texts: Generating fixed distance buffer including slope using ArcGIS Desktop?

texts:
Is it possible to generate a fixed distance buffer including slope using ArcGIS Desktop 10?

The distance on the map is not equal to the distance on the ground due to the incline.

If the calculation is good, I have got this result. If the buffer is 300m (horizontal length on the map), I got 300m on the ground equal to 235m on the map. That's actually what I was looking for. I'll still check if it really on that slope that distance.


texts: QGIS symbol size on final jpg of map different to size in print composer canvas

texts:
I've set map symbol sizes for a layer in pixels (16) in the main map canvas window, and this has transferred to the map composer canvas A4 portrait size, and the size of the symbols looks OK.  However when I save/export the map composer as a JPG, the main map looks OK, but the symbols appear a lot smaller, too small in fact?[![this is the screeshot of the print composer window][1]][1]

[1]: https://i.stack.imgur.com/TJcBS.jpg, and here is a screenshot of the finsished map at A4 size:[![[1]][1]


texts: Converting to geodetic latitude, longitude

texts:
I’m writing a program to determine a vector between two points on earth by taking the difference of the ECEF vectors for each point. I’m using this algorithm:
https://www.mathworks.com/help/aeroblks/geocentrictogeodeticlatitude.html
To convert the latitude, longitude (I understand that the latitude/longitude we all know and love is the “geocentric” lat/long?) to geodetic latitude/longitude. Then, I’m using this algorithm:
https://www.mathworks.com/help/aeroblks/llatoecefposition.html
To compute the two vectors. So, how do I determine the geodetic longitude given the “geocentric” longitude? For example, if you Google “Missouri latitude longitude”, you’ll get 39N 91W. How do I convert this to the geodetic coordinates I’ll need to use with this algorithm?


texts: How to create an interrupted Mollweide map in R?

texts:
I am wondering if it is possible to create an interrupted Mollweide map in R.

This question is similar to Discontinuous or Interrupted map projections? which does not really have a satisfactory answer for my purposes.

I know you can use the Interrupted Goode Homolosine and other interrupted projections are available via alternate open-source tools such as GMT.  However, I do not know how to use GMT and would prefer to avoid learning another software tool just for this purpose.  I've also seen that the M_Map toolbox in Matlab has support for the interrupted Mollweide, but I do not have access to Matlab.

Is this possible in R or alternatively in ArcGIS?

An example of what I'm looking for:


texts: Data Driven Pages in ArcGIS; not all pages plotting

texts:
I am using Data Driven Pages (DDP) in ArcGIS for Desktop 10.3. My pages are indexed with the lables "Page1", "Page2"..."Page12". However only the first ten are showing. From looking into this I am not aware of any such limit of the number of pages. See my index layer below;

OBJECTID *  Shape * Shape_Length    Shape_Area  PAGE
1           Polygon 3883.2122       942341.856  Page1
2           Polygon 6865.951        2912272.508 Page2
3           Polygon 6905.639        2969978.993 Page3
4           Polygon 8350.2668       4357918.976 Page4
5           Polygon 8995.8514       5008438.638 Page5
6           Polygon 5549.911        1905578.347 Page6
7           Polygon 6625.1798       2731887.094 Page7
8           Polygon 3979.3414       983396.9592 Page8
9           Polygon 8625.434        4301756.02  Page9
10          Polygon 8382.0168       4215492.372 Page10
11          Polygon 8305.8166       4290331.162 Page11
12          Polygon 9359.9188       5302510.725 Page12

However the last page that shows in the drawing is Page9; the other shows do not show in the Data Driven Pages Toolbar even after refreshing. See screenshot;

What is the error in my setup or my approach?


texts: Setting a value on a raster where a polygon intersects cells

texts:
I reviewed all of the supposed 'answers' and I just do not see that they really answer my question. Mostly because the ones I'm reading are setting values either inside or outside a boundary. So let me clarify:

We have a river that the coast guard travels. An analyst indicates that halfway up the river, for a distance spanning one third the area is a delay. This delay represents the need for the boats to go through a lock. Since each cell in the current hydrography = the seconds it takes to traverse 1 meter, our approach which would be closest to accurate is to take the delay time halved, set the outer area to that value, set the remaining area to 1 (since the boat can traverse that region it cannot be set to NoData). Now by doing that I do not have to figure out which direction the boat is travelling through the polygon. Cost Distance should move the boat through the first cell, a general straight path through the '1' valued cells, then the last cell. Thus approximating the total delay time.

The polygon, after applying to the hydrography, becomes an outline of the river areas involved. The edge of that polygon must be set to delay-time / 2. All other cells inside must be set to 1.

My current workflow starts once the polygon raster has been extracted from the hydrography:

I do a RasterReclassOp.ReclassByRemap to set the polygon raster to the value of 1
I get the new polygon from the raster shape using RasterToPolygon
Now at this point I want to pass the polygon and the 'polygon raster' and set just the outside edge of that raster to the new value delay/2. I have seen this method but cannot remember what it is called. It does not involve conditional operators or anything else.

I remember the call was something like tool(polygon, value, raster) and every cell that the polygon touched or intersected would be set to 'value' in the raster.

The attached image shows what I am talking about. The dark green area will be set to seconds per meter * 1000. usually around 50. The orange line for a 2 hour delay would be set to 60*60*1000. The inner area (pink) would be set to 1.

I have done a bit of searching and cannot find an answer here. I just need to know the tool that sets that outer edge to a fixed value.


texts: How to loop through a list of lists and safe the output coefficiants?

texts:
I have split a list of NDVI and climate data into small csv. files with 34 years of data each.
Every 34 years should be split into two parts depending on a conflict year, saved in the same table and a certain time range. But this part of the code works already.
Now I want to control the second part of the list with the climate data of the first part, by using multiple linear regression, which is also done.
I basically need to make a loop to store all the coefficients from every round of the lm function of one list in a new list.
I know that I can use lapply to loop and get the output as a list. But there are some missing parts to actually loop through the csv. files.
#Create an empty Vector with all the coefficients
names <- c("(Intercept)","BeforeConf$T.annual.max","BeforeConf$Prec.annual.max","BeforeConf$soilM.annual.max")
coef_df <- data.frame()
for (k in names) coef_df[[k]] <- as.character()

#Start of loop
loop_apply(n, f, env = parent.frame())

#Step 1)
#Load all the .csv files one by one
#iterate through .csv files
setwd("E:\\PYTHON_ST\\breakCSV_PYTHON\\Mathias") #first one is called "selected0"
myFiles <- list.files(pattern="selected.*csv")
for (text in myFiles) {
  readData <- read.csv(file = text)
  head(readData)
}

#Step 2)
#Specify time range according to the slope range
#Conflict.Year (e.g. 1997)
ConflictYear <- myFiles[1,'Conflict.Year'] #loop to select every 34 'Conflict.Year' after first, or always with NDVI.Year =1982
ConflictYear

#Start year of regression
SlopeYears = myFiles[1,'slopeYears'] #to get slope years (e.g.17)
BCStartYear = ConflictYear-SlopeYears #to get start year for regression
BCStartYear

#End year of regression
ACEndYear = ConflictYear+(SlopeYears-1) # -1 because the conflict year is included
ACEndYear

#Step 3)
#Define BeforeConf and AfterConf df depending on Slope Year number and Conflict Year
#Go through NDVI.Year till Conflict.Year (-1 year) since the conflict year is not included in bc
BeforeConf1 <- First34[ which(First34$NDVI.Year >= BCStartYear & First34$NDVI.Year < ConflictYear),] #eg. 1982 to 1999
BeforeConf2 <-  c("NDVI.Year", "NDVI", "T.annual.max", "Prec.annual.max", "soilM.annual.max") #which columns to include
BeforeConf <- BeforeConf1[BeforeConf2] #create table

AfterConf1 <- First34[ which(First34$NDVI.Year >= ConflictYear & First34$NDVI.Year <= ACEndYear),] #eg. 1999 to 2015
AfterConf2 <-  c("NDVI.Year", "NDVI", "T.annual.max", "Prec.annual.max", "soilM.annual.max")
AfterConf <- AfterConf1[AfterConf2]

#Step 4)a)
#Apply Multiple Linear Regression
#Getting model coef from one dataset
model <- lm(NDVI ~ T.annual.max + Prec.annual.max + soilM.annual.max, data = BeforeConf)
summary(model)
coefficients(model)

#Or: Step 4)b)
#Getting Coefs from all datasets and safe in new list
plyrFunc <- function(x){
  model <- lm(NDVI ~ T.annual.max + Prec.annual.max + soilM.annual.max, data = BeforeConf)
  return(summary(model)$coefficients[1:4,1])
}

  coef_DF <- ddply(BeforeConf, .(NDVI), plyrFunc)
coef_DF

#Calculate means of coef columns
mean_coef ->lapply(coef_DF, colMeans)

#update empty vector with the calculated coefs.
#end of loop

The tables look like this

Does anyone know what's missing?


texts:
I am using ogr2ogr to extract point data from a Spatialite db to a csv file:-

ogr2ogr -f "CSV" commandtmp.csv dtm2.sqlite -lco GEOMETRY=AS_XYZ -progress -explodecollections

the Spatialite db is 7GB and it takes days to extract the point data to a 15GB csv file.

Are there any ways to speed this up?


texts: Login to USGS Earth Explorer and download Landsat imagery with Python

texts:
I want to login to the USGS Earth Explorer website at http://earthexplorer.usgs.gov/ with Python and download imagery from the Landsat Archive collection just by giving it username,password,path/row (or lat/long), date, and cloud cover threshold.
I already tried this: https://github.com/olivierhagolle/LANDSAT-Download/wiki
It didn't work.
Then I looked into this: https://github.com/developmentseed/landsat-util
But I could not add the tool due to work restrictions so can't use that.

So. I have limited Python experience and never accessed a website with it before. I'm using Python 2.7.8 on a Windows 7 and trying to access the website through Chrome (Version 51.0.2704.106 m if that helps)

Any ideas for a simple script to access the website, login (I already have login credentials), search for imagery, and download it to a folder? It seems like something Python should be able to do but all of the online solutions seem too advanced for me.
I just need a standalone script that I can use over and over again with different coordinates and dates.


texts: I'm new to Carto VL and html, and could use some help. I'm currently building a map using Carto VL and want to implement a search feature that allows users to type in a location and have the map zoom to that location. How can I go about doing this?


texts:
I want to get the street addresses for all the buildings in London from OpenStreetMap, but I'm not sure how to request for it?

Can someone tell me what request predicate I should use?


texts:
I have setup my WFS data store and published a layer in Geoserver.
Nothing is displayed in the map div when I use the preview with openlayers option and further to this when I click on the map div where I would expect a html table of info I get a file download which is xml text of an error.

The error then displays the response it got from the WFS telling me "Unable to respond to request"

The url for the store ends with a link to a .wfsx file i.e. my.domain.com/my_map.wsfx

The error also displays a "final URL" with a lot of additional parameters appended to the store's url.

I have taken this final url and put it in a browser and sure enough I get the error message "Unable to respond to request"
The interesting thing is that if I remove the "PROPERTYNAME" parameter from the url and input that into the browser I get the results I want.

Geoserver is appending every single property listed against this layer against the parameter PROPERTYNAME in the url is generates when requesting data from the WFS.

Is there anyway I can configure this store or layer to not use the PROPERTYNAME parameter?


texts: How do I associate a flag image with an iso country code on a map?

texts: I am mapping fibre optic infrastructure in Africa using CartoDB and in the infoWindow, I am listing the operator, owner, construction, and financing organisations.  Each organisation has an ISO country code associated with it.  I would like to have a tiny (SVG?) country flag next to each organisation in the infoWindow.  Is there a simple way to do this?


texts: Which CRS could these coordinates be in?

texts:
I'm looking at a dataset with polygons for the U.S. state of Kentucky. Most of the coordinate points are in WGS84 lat/longs (e.g. -82.910, 37.873) but a subset of these are in a different projection and look like this 1790295.890, 1125859.117.
I want to reproject this subset to WGS84 but I need to know the CRS I'm projecting from... Any pointers? I know these coordinate points look familiar; I've seen them before but don't remember the CRS they could belong to.


texts: Enterprise portal, webApp Geometry Server error

texts:
I have a web App on an enterprise portal and most people who have access to it (internal and external users) when panning around, zooming or trying to interact with the web App in any way a pop-up error keeps coming up-

All of my users have 'viewer' roles and the web App doesn't have any fancy widgets.

Has anyone come across this issue before, any ideas what might be happening?


texts: 2010 Census Tiger County shp file with defined coastal land area

texts:
I am looking for a 2010 Census Tiger Shape file that hugs the coastline and doesn't include the ocean in county boundaries.  I have a pre 2010 file that did this and I can't seem to find a 2010 version that follows the same pattern.
For Reference, I have been looking here: http://www2.census.gov/geo/tiger/

Below are visuals of the difference

Pre 2010 - Hugs land

2010 Includes Ocean


texts: Label styles Formatting in ArcGIS for Desktop?

texts:
I'm currently making a map that uses custom colors for the layer symbology. It was requested that the labels for each class in the layer use the same color palette as the layer.  Is there a way to automate this process other than doing it manually? Do I need to save the layer symbology as a style?

I am using ArcGIS for Desktop 10.4 to make this map.


texts: Guidelines regarding design and conception of Inspire geoportal for Public Administration

texts:
I am in the process of designing the conception of a geoportal for a local authority which must fulfill the INSPIRE guidelines.

Can anyone offer any information regarding the design and set-up phase of this? Is doesn´t necessarily have to be a technical analysis or overview, but rather a guide to which steps are necessary in order to do the following:

Create Data inventory
Assess and Understand user needs
Interface design...etc.etc

From the conceptual side, it would be usefull to have a list of points which should not be overlooked when designing the concept for a geoportal.

Thanks for any advice,

Robert


texts:
I need to produce a shapefile from a raster. I need to be able to specify either an interval, or manually define the intervals. The input file is a GeoTIFF. I would like to use GDAL and/or Python.

Example raster:

I tried using gdal_contour, which at first glance would have been perfect. However, I want the result to have the same "pixel" definition - that is, the "contours" should maintain the block appearance of the pixels at their extents. For this reason, I can't use gdal_contour, as the results look like this:

Is there another way to do this? My output should be a shapefile that looks like a grid, with only pixels in the same interval connected to each other.


texts: How to cut segments of a LinearRing with another Geometry using NETTopologySuite?

texts:
I have two linear rings, A (green) and B (red). I want to include all intersection points between two geometries in A.

In fact what I need is (A-B)+(A.B) (or maybe just A+(A.B)), but those operations may get too time consuming. The other option is to iterate over A's segments and find their intersections with B and construct a new linear ring from scratch. Now there might be many special cases that I need to cover. So, are there any other fast and robust options in NetTopologySuite?


texts: Adding Oracle Spatial Layer using Python Bindings of QGIS?

texts:
I want to load a layer from my Oracle Spatial Database using the Python bindings of QGIS. I have tried loading the layer by creating the uri as shown in some previous posts.

I am using the python bindings that were installed by default when I installed the QGIS_Wein 32 bit executable.

I am able to connect to the database by using cx_Oracle cursor, but when I am trying to create a vector layer using the URI , It is not happening.
That layer object always returns false to isValid() function.

Do I have to install anything else apart from the cx_Oracle & QGIS executable to add a layer?


texts:
I have a code that suppose to count number of pixels in a polygon and to add it to the polygon as a dictionary.
First NDVI calculted and then differrent ranges inside the polygon should be calculte: the percent of NDVI pixels that their value is higher than 0.2, between 0.2-0.4, between 0.4-0.6 ect....
My problem is that my test polygon  doesn't have all the values inside it and for that reason I get the next error message:

  Collection.toList: The value of 'count' must be positive. Got: 0

How can I tell my code to still work/ ignor when he doesn't find match pixels?

This is link to my code:
https://code.earthengine.google.com/ff24c08f6d3acd50a8108ca656da4b9f

This is the part where I create the ranges:

var stats = listOfImages.map(function(img){
  var image = ee.Image(img).select('NDVI_mean');

  var HighVeg = image.gt(0.6).selfMask().reduceRegion({
    reducer: ee.Reducer.count(),
    geometry: geometry,
    crs: 'EPSG:4326',
    //maxPixels:1310361348,
    scale: 20,
  }).values().get(0);

  var LowModerate = image.gt(0.2).and(image.lt(0.4)).selfMask().reduceRegion({
    reducer: ee.Reducer.count(),
    geometry: geometry,
    crs: 'EPSG:4326',
    //maxPixels:1310361348,
    scale: 20,
  }).values().get(0);

  var ModHigh = image.gt(0.4).and(image.lt(0.6)).selfMask().reduceRegion({
    reducer: ee.Reducer.count(),
    geometry: geometry,
    crs: 'EPSG:4326',
    //maxPixels:1310361348,
    scale: 20,
  }).values().get(0);

    var low = image.lt(0.2).selfMask().reduceRegion({
    reducer: ee.Reducer.count(),
    geometry: geometry,
    crs: 'EPSG:4326',
    //maxPixels:1310361348,
    scale: 20,
  }).values().get(0);

    var total = image.gt(-1).selfMask().reduceRegion({
    reducer: ee.Reducer.count(),
    geometry: geometry,
    crs: 'EPSG:4326',
    //maxPixels:1310361348,
    scale: 20,
  }).values().get(0);

  return image.set('HighVeg', HighVeg).set('LowModerate', LowModerate).set('ModHigh', ModHigh).set('low', low).set('total', total);
});


texts: Adding attributes for polygons to vector layer with polygon intercept using PyQGIS?

texts:
I have a vector layer with polygons. There's only 1 attribute – NAME – corresponding to the name of the polygon.

I need to create a new vector layer containing the line segments representing the borders between the polygons. I want each border to be identified by the names of the 2 polygons that meet at that border.

I can get the line segments, and name of one of the polygons, but not the other. Here's my code:

from PyQt4.QtCore import QVariant
vl = QgsVectorLayer("MultiLineString", "Borders", "memory")
pr = vl.dataProvider()
pr.addAttributes([QgsField("NAME1", QVariant.String), QgsField("NAME2", QVariant.String)])
vl.updateFields()

import itertools
layer = qgis.utils.iface.activeLayer()

for geom1,geom2 in itertools.combinations(layer.getFeatures(),r=2):
 if geom1.geometry().intersects(geom2.geometry()):
  geom = geom1.geometry().intersection(geom2.geometry())
  fet = QgsFeature()
  fet.setGeometry(geom)
  fet.setAttributes(geom1.attributes())
  pr.addFeatures([fet])
vl.updateExtents()
QgsMapLayerRegistry.instance().addMapLayer(vl)

How can I obtain attributes of geom2 and add to the NAME2 field in the new vector layer? I know I need to use something like:

for geom1,geom2 in itertools.combinations(layer.getFeatures(),r=2):
 if geom1.geometry().intersects(geom2.geometry()):
  geom = geom1.geometry().intersection(geom2.geometry())
  fet = QgsFeature()
  fet.setGeometry(geom)
  id1 = provider.fieldNameIndex("NAME")
  id2 = provider.fieldNameIndex("NAME")
  attribute = [None] * len(pr.fields())
  attribute[id1] = geom1.attributes()
  attribute[id2] = geom2.attributes()
  fet.setAttributes(attribute)
  pr.addFeatures([fet])

But this gives me NULL values. How should I change this code?


texts:
I recently discovered the Planet API and have been working through the planet_data_api_introduction Jupyter notebook found here:

https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/data-api-tutorials/planet_data_api_introduction.ipynb.

Within the Activating Assets section, I receive an HTTP 403 status code.

How come I get access forbidden code when I have an API key?


texts: Automating Google Earth to open and zoom to feature?

texts:
I've been tasked with creating a link in an excel spreadsheet that will initiate some basic automation in Google earth.

The specific task is to:

Check if Google Earth is open
Check if specific kmz is loaded
Open Google Earth and and kmz if needed
Zoom to specific feature in kmz

I've been digging around the web to see what I can find. Google Earth API seems close, but it's deprecated as of December and seems focused on embedding in web pages.

Is there any other way to script out a process involving Google Earth?

My users all have Google Earth Pro.


texts: I am trying to project some data that I got. I have .txt files with XYs and they are correct, the problem that when I project the data, the points appearing in a different geographical location than the polygon map and they are distributed in a horizontal position instead of vertical as the shape of the map. Boths layers appears to be in the same projection,I am trying to change they but noting happens. I am sorry I do not know how to explain this problem much clear, and I do not know how to fix it either.


texts: QGIS estimate height of feature vertices from TIN

texts:
I have a TIN representing a digital terrain model, and another polygon layer representing features (e.g. building outlines) which is assumed to 'sit' on top of the DTM. How do I calculate the elevation of the TIN at the position of each vertex in the feature layer, and then add this to the feature layer?

Presumably the first step will be to convert the polygon layer from 2D to 3D so there is a way of storing the elevation of each vertex, but then I am at a loss on how to populate the z values.


texts: How to efficiently load multiple tile layers with different XYZ sources in OpenLayers 6?

texts:
I need to add 60+ tile layers onto a map at once, each with a different XYZ source using MapGuide server.
I'm able to do it, as shown below, but the performance is not ideal, because the way Openlayers deals with this is making requests to the server along the way.
let layers = [];

for (var i = 0; i < 61; ++i) {
    var layer = new TileLayer({
        source: new XYZ({
            tileUrlFunction: testtileUrlFunction.bind(null, i % 99),
            tileGrid: new TileGrid({
                origin: [-5123200, 10002100],
                resolutions: scaleArr,
            }),
        }),
        zIndex: i,
    });

    layers.push(layer);
};

let map = new Map({
    target: 'map',
    maxTilesLoading: Infinity,
    view: new View({
        constrainResolution: true,
        maxZoom: 9,
        minZoom: 0,
        resolutions: scaleArr,
        zoom: 0
    }),
    layers: layers,
});

It seems that each time Openlayers renders a layer, it requests from the server only tiles of that particular layer, while in comparison Leaflet sends out all the requests from every layer at once up front, which improves the performance a lot.
I wonder if there's something I can do in Openlayers to achieve similar effects.


texts: How to set up an OSM server with TileCache and Mapnik?

texts:
I have been trying for two and a half weeks so far to get a local copy of OpenStreetMap running on a server. I have downloaded the planet file and imported it into a PostGIS database called 'osm'. I have used OSM Mapnik tools to generate an XML stylesheet for Mapnik to use. I have used TileLite to prove that Mapnik can render OSM tiles from the database. The tiles even look the way that I want them to look.

My problem now is that I cannot get TileCache to work with Mapnik. I have a MapServer instance installed that I am using to serve Shapefiles. This works with TileCache. The default 'basic' layer in the TileCache configuration file works as well. Please help with my OSM layer:

[osm]
type=Mapnik
mapfile=/var/maps/bin/mapnik/osm.xml
spherical_mercator=true
bbox=-16697000,8610000,-16667000,8640000
maxResolution=156543.0339/4
levels=18
srs=EPSG:900913

I have read every last blog post, forum post, and tutorial I can find. Any help would be appreciated. I suspect I have either missed something or I am doing something stupid. The problem may even be in OpenLayers.


texts: Leaflet elevation profiles with multiple GeoJSON features

texts:
I have a map which loads a GeoJSON containing two features (lines). I would like to use Leaflet Elevation plugin to display an elevation profile for each of those lines. The problem with my code is that when I click a feature, there is no data added to the elevation profile.

var map = L.map('map').setView([44.635, 22.653], 11);
var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);

function addData(e) {
    var el = L.control.elevation();
    el.addData(e);
    map.addControl(el);
}

function onEachFeature(feature, layer) {
    layer.on({
    click: addData
    });
}

var trails = new L.GeoJSON.AJAX('https://googledrive.com/host/0B55_4P6vMjhITEU4Ym9iVG8yZUU/map.geojson', {
onEachFeature: onEachFeature
}).addTo(map);

Here's a JSFiddle of my work: http://jsfiddle.net/pufanalexandru/eaok0Lnz/3/


texts: prevent osm to load tiles on zoom level > 19

texts:
layer_osm = new OpenLayers.Layer.OSM( "Simple OSM Map","",{
        isBaseLayer : true,
        displayInLayerSwitcher : false,
        numZoomLevels: 26,
    });

I have several WFS and WMS Layers on Top of a OSM Base Layer, and I want to stop loading the OSM layer at zoom 19, which is the max zoom for OSM. When I increase the zoom level above 19, I get 404 when loading the OSM tiles. I simply want my OSM Layer to stop loading tiles when zoom level > 19. How can I do that?


texts: Rendering of SVG for layer symbols using QGIS?

texts:
I have a little problem with the rendering of SVG for layer symbol.
I want to creeate a categorized symbol to show different style of buoy
I have  for that two icons the first is an half circle filled, and the second is a triangle filled, both are yellow, no rotate, same size.
So I define the property of the symbol as descibe in the qgis cookbook page 149
here is my Code in C++ to do that

QgsStringMap MyBoyStyle,MyBoyStyle2;
QString lBoyIcoType1 = "../data/Icones/iconeS52/" + pNameCouche+QString("_")+"RVER1"+ EXT_ICONE;//attention au path icone "../data/Icones/iconeS52/" au lieu de PATH_ICONE
QString lBoyIcoType2 = "../data/Icones/iconeS52/" + pNameCouche+QString("_")+"RVER2"+ EXT_ICONE;//attention au path icone "../data/Icones/iconeS52/" au lieu de PATH_ICONE

// list of property for the boystyle
QStringList MyBoyPropertyName;
MyBoyPropertyName << "fill" << "name" << "outline" << "outline-width" << "size";
// list of corresponding value 1
QStringList MyBoyPropertyValue;
MyBoyPropertyValue << "#f3e54d" << lBoyIcoType1 << "#000000" << "6.8" << "6";
QStringList MyBoyPropertyValue2;
MyBoyPropertyValue2 << "#f3e54d" << lBoyIcoType2 << "#000000" << "6.8" << "6";

// create the map 1 et 2
for (int i =0; i < MyBoyPropertyName.size(); i++){
    //1ere bouee
    MyBoyStyle.insert(MyBoyPropertyName.at(i),MyBoyPropertyValue.at(i));
    //2eme bouee
    MyBoyStyle2.insert(MyBoyPropertyName.at(i),MyBoyPropertyValue2.at(i));
}
// creation du svg marker layer
QgsSymbolLayerV2* MySymbolLayer1;
MySymbolLayer1 = QgsSvgMarkerSymbolLayerV2::create(MyBoyStyle);
QgsSymbolLayerV2* MySymbolLayer2;
MySymbolLayer2 = QgsSvgMarkerSymbolLayerV2::create(MyBoyStyle2);

QList <QgsSymbolLayerV2*> MyLayerList;
MyLayerList << MySymbolLayer1 << MySymbolLayer2;

then I create the categories :

QList<QgsRendererCategoryV2> Categories;
QStringList lListValue; lListValue << "1" << "2";
QStringList lListIcone; lListIcone << pNameCouche+QString("_")+"RVER1" << pNameCouche+QString("_")+"RVER2";

for(int i = 0 ; i < lListValue.size() ; i++){
    QgsSymbolV2* newsymbol = QgsSymbolV2::defaultSymbol(pLayer->geometryType() );
    newsymbol->appendSymbolLayer(MyLayerList[i]);
    //newsymbol->setColor(QColor("#f3e54d"));
    QgsRendererCategoryV2 MyCategorie = QgsRendererCategoryV2(QVariant( lListValue.at(i) ),newsymbol,PATH_ICONE+lListIcone.at(i)+EXT_ICONE);
    Categories.append(MyCategorie);
}
// for the rendering
lrenderer = new QgsCategorizedSymbolRendererV2("RVER",Categories);
pLayer->setRendererV2(lrenderer);

when I launch the application, the file s57 was loaded and the buoy are display good but for the second icon or symbol I have a superposition of shape i have the default symbollayer which is a circle in background of my symbollayer which is a triangle filled in yellow.

Any Idea ?


texts: Best approach to process thousands of TIFF files

texts:
I have a data source with a folder pyramid that contains several thousands of GeoTIFF files, about 70Mb each. I would like to process these so that I can display the map overlays on a OpenLayers web map.

Since the maps have a frame around them its probably not possible to have them into a single covering layer so my approach would be to display them as single maps that would be displayed depending on where on the map the user is.

How and with what software would be the best way to process all these files so that they can be displayed by OpenLayers?


texts: How to create a function for getting a largest polygon from 2 polygons using case statement in PostgreSQL?

texts:
CREATE OR REPLACE FUNCTION public.largest_polygon1(
  geom1 geometry,
  geom2 geometry)
  RETURNS geometry
  LANGUAGE 'plpgsql'

  COST 100
  VOLATILE
   AS $BODY$
  begin
   Return
    Case
       When ST_Area(geom1) > ST_Area(geom2) Then geom1
     else geom2
    End;
  End;
 $BODY$;

  ALTER FUNCTION public.largest_polygon1(geometry, geometry)
 OWNER TO postgres;


texts: Finding points in specific radius that are closest to point?

texts:
I'm trying to find the number of restaurants that lie within 600m of a gym. I've read a post on how to do this: namely generating a near table and summarizing the input feature.

The trouble I'm having is that say there are two gyms, gym A and gym B. If there is a point that is within 600m of both of them, it is in the count for gym A AND gym B. How would I go about making it so that this point is only counted for the gym it is closest to within that 600m radius?

I am using ArcMap over Citrix. 10.3 I think.


texts: Export PDF from OpenLayers map with jsPDF

texts:
I try to use javascript library JSPDF for export my OpenLayers map but it doesn't work.  I create my HTML :

     <button id="cmd">generate PDF</button>

And my Javascript :

$(document).ready(function () {

    var doc = new jsPDF();

    var specialElementHandlers = {
        '#editor': function (element, renderer) {
            console.log(1);
            return true;
        }
    };

    $('#cmd').click(function () {

        var html=$("'#index_map").html();
        console.log (html);
        doc.fromHTML(html, 200, 200, {
            'width': 500,
                'elementHandlers': specialElementHandlers
        });
        doc.save('test.pdf');

    });
});

And when I click on my button I've the message "doc.fromHTML is not a function"


texts: PostGIS Geography Data Changed After pg_restore

texts:
Two PostGIS databases (PostGIS 3.0, PostgreSQL 13.1) were setup on two separate machines to be as close to each other as possible using a Docker image kartoza/postgis:13.1.
A dump of the database was taken from the first machine using
pg_dump --host=db1.foo.com --dbname=foo --username=postgres -Fc --file=/tmp/foo.dump

and then restored on the database on the second machine using
pg_restore --clean --dbname=foo /tmp/foo.dump

When we view a query result using a GUI software TablePlus, we noticed that the column named coordinates of type Geography contains values that look very different after restoring.
Query Result on 1st Machine (pg_dump source):
SELECT coordinates FROM locations LIMIT 5;

Query Result on 2nd Machine (after pg_restore):
SELECT coordinates FROM locations LIMIT 5;

However, our app that queries this database for coordinate data appears to be plotting the data correctly on a map. This makes me think that the data on both machines are the same, but stored using different representations.
Question: Why did the Geography data values in the column coordinates changed, and how can we restore from the dump while keeping the original data values?

Update: Tried using -b when performing pg_dump, but the problem persist.
pg_dump --host=db1.foo.com --dbname=foo --username=postgres -Fc -b --file=/tmp/foo.dump

Update 2: \d+ locations on both databases show the same type for coordinates
1st Machine (pg_dump source):
                                                                Table "public.locations"
        Column         |         Type          | Collation | Nullable |                Default                 | Storage  | Stats target | Description
-----------------------+-----------------------+-----------+----------+----------------------------------------+----------+--------------+-------------
 id                    | integer               |           | not null | nextval('locations_id_seq'::regclass)  | plain    |              |
 coordinates           | geography(Point,4326) |           |          |

2nd Machine (after pg_restore):
                                                                Table "public.locations"
        Column         |         Type          | Collation | Nullable |                Default                 | Storage  | Stats target | Description
-----------------------+-----------------------+-----------+----------+----------------------------------------+----------+--------------+-------------
 id                    | integer               |           | not null | nextval('locations_id_seq'::regclass)  | plain    |              |
 coordinates           | geography(Point,4326) |           |          |                                        | main     |              |


texts: Automatically updating column in feature class when another column is changed?

texts:
I have a feature class in a file geodatabase and it contains a field called [curing] in short integer type and another field called [IsPopulated] in short integer as well.

What I want to achieve is to make [IsPopulated] automatically populated with "0" or "1" depending on whether the [curing] column is filled with a numeric value.

"Field Calculator" does not help as it's just a one-off operation and NOT automatic.


texts: Understand ramp color interpolation using QGIS 2.12

texts:
I try to understand the color ramp in TIN and IDW interpolation. I work with height points layer. The low value in 8 and the highest value is 584. With the interpolation plugin i create TIN raster with Cellsize xy 5.

I get this raster:

and this is the color ramp:

This in the same point but with IDW interpolation:

when i choose random point (the blue point for example)

in the TIN interpolation, i get this value:

and in the IDW interpolation, i get this value:

I don't understand:

Why there are differences in the color ramp between the two options?
What represent the value of some random point (not my layer points) when i use Identify Feature?
Why the color ramp don't include the minimum\maximum height point value?


texts: Load only one state from a MXD file in arcobjects

texts: Right now I load "StreetMap North America.mxd" from ESRI Data Maps 10 for use with arcobjects / arcengine 10 in Visual Studio with C#.  Since it's slow I am looking for a way to turn off all data except for data from Minnesota and Wisconsin.  What are the main steps to accomplish this?


texts:
I've got a simple Leaflet map with a basemap and one map-layer coming from my own hosted GeoServer.

I made the layers show up nicely in a map.

Now I want to add popups on the point layer showing information stored in MapService.

I couldn't find too much information about that topic.

There's one link to a working example but the link seems to be broken. I found another example which I addopted. You can see it on JSFiddle. I'd like to display the content of the name field in the attribute table but nothing happens when the user clicks the map.

Any idea?


texts: QGIS - Least Cost Analysis - Removing waterbodies

texts:
I'm new to least cost analysis. I have a DEM-layer of a region, an I also have created slope layer. The purpose is to calculate the least cost path between to ancient sites with QGIS. However, in the region there are lakes and river (I have the Shapefiles), and the problem is that the resulted least cost path crosses through the lakes and rivers and I don't want that. I want them to be constraints, so the paths should find another way to the destination point.
How do I make the least cost tool take them into consideration?


texts: Is there an arcpy boolean check for whether an EPSG or prj is supported by arcmap?

texts: I'm writing a tool and essentially I found out that arcmap defaults an epsg to 0 if it sees that the projection is not supported against the predefined projections.


texts: Run processing (GRASS) algorithm as administrator

texts:
I am trying to use GRASS algorithms in a plugin of mine, in order to improve the quality of a shapefile containing lines that will be used as a graph later. The first algorithm I want to use is the one that breaks the lines at their intersections : v.clean.break.

path_to_broken_lines = processing.runalg(
                "grass:v.clean",                                    #Algorithm name
                input,                                              #Path to the layer to break
                0,                                                  #Tool (0<=>break)
                0,                                                  #Threshold (not needed for this algorithm)
                "%f , %f, %f, %f "% (xmin , xmax , ymin , ymax),    #GRASS_REGION_PARAMETER <ParameterExtent>
                -1,                                                 #GRASS_SNAP_TOLERANCE_PARAMETER <ParameterNumber>
                0,                                                  #GRASS_MIN_AREA_PARAMETER <ParameterNumber>
                None,                                               #Errors file (None <=> temporary file)
                None)                                               #Output file path (None <=> temporary file)

Now, despite being the admin of my computer, I get an error saying that my company's policy is blocking the execution of the algorithm. Still, I can execute them manually by running the GRASS plugin, importing my file into grass (v.in.ogr) and using the algorithm afterwards, but it seems like I can't automate it.

My question is the following : is there a way to use "processing.runalg()" as admin ? I have found ways to execute shell scripts as an admin but it is not really the same problem, is it.
The plugin would work if I launched QGIS as an administrator, but I do not really want to force the end users to launch QGIS as an admin just to be able to run a plugin they won't use daily.


texts: Can I stream GeoJSON data in openlayers, using Angular6+

texts:
I am using angular 6 and openlayers 5.

Angular 6 combined with RxJS can easily create streams. I was thinking to use RxJS streams in order to feed GeoJSON data to ol5 vector layers. Why? Because streams supposedly bring data back as soon as they have them and they do not wait for all the data to be available. So, when the GeoJSON data are too big, this can make for better user experience -users dont wait for all the data to load.

But, I dont know if ol5 vector layers work this way. I dont know if they accept streams at all. I dont understand clearly if loading strategies support streams or not.

Anyway, should I try to make this work somehow?

Is it possible, or vector layers wont support streams anyway?

Here is a quick example/explanation of angular streams, that is not geo-related, just in case you dont have a clue about angular

results is an Observable, with a pre-defined structure. Since it is an observable, we can assign to it a stream that brings back data -we can observe it

the structure

class SearchResult {
  constructor(
    public id: any,
    public name: string
  ) {}
}

define the results

results: Observable<SearchResult[]>;

so, results can be equal to a stream pipe that brings back data from a searchName function that is triggered every time the value of a form changes -the this.myform.valueChanges part. So, as I type in a search field, the words are send to the function and I get streamed answers back

this.results = this.myform.valueChanges.pipe(
  switchMap( formdata => this.myService.searchName(formdata.name)),
);

For a more detailed explanation, check this


texts: Get View Projection and Resolution on Draw End

texts:
When drawing a LineString in OpenLayers, if the only thing I have a reference to is a TileWMS layer, is there any way to get the View Projection and Resolution?

I am using the drawend event, so it could come from the feature or geometry? I can't find a getView or getMap in any of these objects.

I need to query a TileWMS service and the way it is written I do not have a handle to the View or Map instance...

function drawEnd(evt) {
  let coords = evt.feature.getGeometry().getCoordinates();

  // how can i get these??
  let projection = null; // ????;
  let resolution = null; // ????;

  let getFeatureInfoUrl = self._myTileWMSLayer.getSource().getFeatureInfoUrl(evt.coordinates, resolution, projection);
  // call getFeatureInfoUrl....
}


texts: QGIS: Is it possible to edit the datasource of a PostGIS layer?

texts:
After creating a layer with RT_SQL_Layer plugin, I want to change some details in the query. Is this possible, or do I need to create a new layer every time I want to change something in the query?

More specifically; I want to change the "Source for This Layer" as shown in example bellow:


texts:
I need to generate map image with vectors drawn on them. I do not have access to backend. Is it possible using mapfish to generate desired image only (not image placed on page)?

When i calculate width and height of A4 (620, 877) using 75 dpi and use it as a page size in mapfish config and use the same size in openlayers i get exception:

Error while generating PDF:Infinite table loop; row content is larger than the page (for instance because you didn't scale an image).


texts: How to add a pie chart based on all (or some) features in a layer?

texts:
I have a vector layer in a QGIS project which has about 60 items with various attributes, including a check for if an item is complete.  I am trying to get a pie chart showing the percentage of the items that are complete.

I can find how to add pie charts for individual records in a layer, but not a pie chart based on statistics for all (or some) features in a layer.


texts: How to have different overlay layers in layer groups having different .geojson files? I want to show three different categories such as Toilets, dustbins and hospitals. There will be three different .geojson files. How can I have three categories at the right top of the map using leaflet.js?


texts: Change Pop-Up Order in WAB Developer programmatically

texts:
What I'm looking for is insight into how to default certain layers to load last. The post here: Change Order of Features in Popup with ESRI ArcGIS Javascript API is useful, albeit does not apply to the Web App Developer Edition framework.

In an ideal world, the solution would just honor the order in the Table of Contents, but as I understand it this is not default/possible as Pop-Ups are displayed in the order of rendering (https://community.esri.com/thread/114482 & https://community.esri.com/thread/182833-specify-order-of-results-from-multiple-layers-in-popup-web-appbuilder).

If this is not possible, I am looking for insight into how I can default a layer to always go last. In practicality, I have three hidden layers in the TOC (Roads, Parcels, Throughfare) that are used for custom pop-ups. But if I turn on 'Schools' and click on a school, it will show me 'Parcel' first and I'll have to click the 'next' arrow to get the school.

Full disclosure : I'm not a GIS developer but have to act as the org's de facto GIS developer since we don't have one


texts: Are there publicly available run-off data for Africa?

texts:
I was wondering if there are good publicly available dataset for surface run-off (water)?

I have a rough idea that surface run-off should be some function of rain-fall and soil infiltration/absorption etc. My question is whether there is some reputable dataset for Africa or globally.

I did a preliminary search, but most datasets that say "rainfall/run-off" are actually rain-fall data. And I can't find a run-off dataset for download.

I have STRM DEM data, and have processed the terrain using ArcHydro. What I am really looking for is something that combines rainfall and soil absorption etc, to give runoff estimates.


texts:
I am going to use pyModis to work with MODIS data,

Since I am quite new to Python, before starting to learn and use pyModis, I have a question for those who are familiar and using pyModis, right now.

We know that Atmospheric data (HDF files) from Modis, like "MOD05_L2", only can be opened and managed using "ModisSwathTool".

In other words, MRT (MODIS Reprojection Tool) can NOT open those kind of HDF files.

As far as I read in the pyModis website , pyModis is using MRT (MODIS Reprojection Tool) to work with the data.

I would be very grateful if anyone could do me a big favour and answer to my question?

Q: Dose pyModis work with “ModisSwathTool” too?

I mean, can pyModis manage and work with Atmospheric data from Modis, too?


texts:
Is there a way to export annotation text bubbles with qgis2web?
Or is there an alternative to implement this?

Exported:


texts:
I 've built a map that can "listen" to the bounds of the whole map window, through leaflet's method:

getBounds()

What I would like, is the user to choose a more specific area with a rectangle.

The user interface could be something like the BoxZoom plugin:

http://gregallensworth.github.io/L.Control.BoxZoom/

https://github.com/gregallensworth/L.Control.BoxZoom

...but instead of zooming, I would like the map to get the coordinates of the drawn rectangle.

Any ideas?


texts: Generating slightly curved arrows in QGIS 3

texts:
In Geometry Generator in Symbology in Layer Properties, the following expression works, but the result is not satisfactory due to the middle point fixed coefficient 1,1:

make_line (
     start_point(make_point("Origin Longitude", "Origin Latitude")),
     translate(centroid($geometry), 1, 1),
     end_point(make_point("Dest Longitude", "Dest Latitude")))

Using the $length function as below doesn't work. Why no lines are displayed?

make_line (
     start_point(make_point("Origin Longitude", "Origin Latitude")),
     translate(centroid($geometry), $length, $length),
     end_point(make_point("Dest Longitude", "Dest Latitude")))

Using the length() function as below works, but while some lines are displayed OK (e.g. India -> Bangladesh), some are way too curvy (e.g. Bangladesh -> India). How can I make all of them just slightly curved like the India -> Bangladesh one?

make_line(
     start_point(make_point("Origin Longitude", "Origin Latitude")),
     translate(centroid($geometry),
     length(
           make_line(
                make_point("Origin Longitude", "Origin Latitude"),
                make_point("Dest Longitude", "Dest Latitude")
           )
     )/5000000,
     length((
           make_line(
                make_point ("Origin Longitude", "Origin Latitude"),
                make_point("Dest Longitude", "Dest Latitude")
                )
     ))/5000000),
     end_point(make_point("Dest Longitude", "Dest Latitude"))
)

QGIS version: 3.4.6


texts: Divide into grid and Mosaic using google earth?

texts: Is it possible to download 1:2000 scale of a town using google earth image? If divide the whole area into grid and mosaic them is an option, how it is done using google earth? I tried using grid. But there is no option to change the grid size.


texts: Convert NAD27 to WGS84 with programming function like PHP

texts:
I am looking for a programming function that can convert NAD27 coordinates to WGS84.

I know QGIS could do the conversion, but I need a function for my purposes.


texts:
What packages are required to install C++ API on Linux Mint 17?
I already have access to the Python API (installed via “python-qgis” package), but no C++.


texts: Toolbar for ArcScan raster painting does not appear in edit session?

texts:
I am in an editing session and am trying to vectorize a raster using ArcScan. The raster is a TIFF file (an 8-bit, single band raster with an unsigned integer pixel type). When I select "start clean-up" on the vectorization on the Raster Cleanup toolbar and then select the Raster Painting tool, the tools do not appear.

How do I fix this?


texts: Displaying (Correctly?) Projected PNG onto Leaflet Map

texts:
I am trying to overlay a PNG onto a Leaflet map.
My GDAL commands:
UL="-125.002000 52.013300"
LL="-125.002000 22.013300"
UR="-66.492200 52.013300"
LR="-66.492200 22.013300"

gdal_translate -of "GTIFF" -a_srs EPSG:4326 -gcp 0 0 ${UL} -gcp 0 1101 ${LL} -gcp 2002 0 ${UR} -gcp 2002 1101 ${LR} somefile-100.png somefile-100_ref.tif
gdalwarp -overwrite -setci -t_srs EPSG:3857 somefile-100_ref.tif somefile-100_warped.tif
gdal_translate -of PNG somefile-100_warped.tif somefile-100-final.png

Source File: https://www.dropbox.com/s/1vjxpofz0hgz3xd/somefile-100.png?dl=0
Resulting Output:

Something is not correct because the resulting layer should cover beyond the Continental US borders and coasts.
Expected Output:


texts: Summing clipped rasters under polygon using PostGIS?

texts:
I have a multiband population raster and geometry table in postgres. For every polygon, I'm trying to sum the population (rast) that is contained in that polygon (geom).

This is how I originally imported my raster

raster2pgsql -s 4326 -d -I -C -M -R /opt/population.tif -F -t 10x10 public.raster

Query

SELECT gid,
       SUM((pop_band1).value) AS population_1,
       SUM((pop_band2).value) as population_2
FROM (
    SELECT
        gid,
        ST_ValueCount(ST_Union(ST_Clip(rast, 1, ST_Transform(geom, ST_SRID(rast)), 0, TRUE))) as pop_band1,
        ST_ValueCount(ST_Union(ST_Clip(rast, 2, ST_Transform(geom, ST_SRID(rast)), 0, TRUE))) as pop_band2

    FROM raster, polygons
    WHERE ST_Intersects(geom, rast)

    GROUP BY 1
) a

GROUP BY 1;

This works when I select specific polygons GIDs, but it breaks when I run it over the entire polygons table.

Error

ERROR:  rt_raster_iterator: The set of rasters provided (custom extent included, if appropriate) do not have the same alignment

CONTEXT:  PL/pgSQL function st_clip(raster,integer[],geometry,double precision[],boolean) line 8 at RETURN


texts: Subtracting (erasing) polygons from polygon using ArcGIS for Desktop?

texts:
I have two polygon layers, one is green that represents all non-public right-of-way land. I have another polygon that is just a circle with a specified radius.

I would like my output to be a polygon layer that represents all the white space (the gaps) in the private land polygon layer that is also within the black circle.

How does one do this (In ArcGIS 10.2)?


texts: Preventing unauthenticated, direct access to OGC layers in GeoServer?

texts:
Let's say that:

I have centralized, single GeoServer for all application
There's bunch of apps (that require login) that need WMS layers
Web server of apps act as reverse proxy for GeoServer. Hence client that opens app-1, gets WMS layers by sending "http://app-1/geoserver/...".
There's no direct access available from Client to Geoserver

Client can potentially get the WMS layer from Geoserver via the reverse proxy of these apps. Client can just request "http://app-1/geoserver/...".
I need to make sure that:

Client that is authenticated in app-1 gets the layer from "http://app-1/geoserver/..." (either via the web browser accessing app-1, or directly from browser url)
Client that is NOT authenticated in app-1 gets ignored when requesting the layer from "http://app-1/geoserver/..."

How to do this?

Few notes: there's a load balancer in the cluster in the illustration.


texts:
My leaflet map is between a navigation bar and a chart displayed underneath. Unfortunately after recently incorporating leaflet-1.0-beta-2 my responsive layout is not working out on mobile devices because the tap: false solution for scroll dragging under map to see graph is not working anymore like 0.7.5. It seems like the issue has been noted on github, but I was wondering if anyone has found a way around this issue? I really wanted to keep the newest version of leaflet because most plug-ins are starting to migrate towards the new revision + fractional zoom.

https://github.com/Leaflet/Leaflet/issues/4051


texts: pgRouting - Assigning source and target from different point layers (AOIs) for network analysis

texts:
I'm new to pgrouting and normally use ArcMap to conduct any sort of network analysis. I have created a simple shortest path network along a downloaded OS Mastermap road network using pgRouting. However, I am unsure of how to develop an applied Origin-Destination route using point data (i.e. weighted population, libraries, public transport points etc..).
Do I need to join the point data with the road network layer to create a single network? I understand that the create topology function assigns nodes along the road network which are used as Source and Target points, but this will be a large scale project and can't afford to write out the lat long for each point along the road network.
I have also tried to use something like this below using the Foss4G format, however it didn't work. This created a random line along the road network rather between two 'Areas of Interest'.
INTO School_to_School
FROM pgr_dijkstra(
    'SELECT gid as id, source, target, length:: double precision AS cost
        FROM bristol_roads',
    (SELECT id FROM bristol_education WHERE ref_no = 115422069),
    (SELECT id FROM bristol_education WHERE ref_no = 110687656), false) as dr
    JOIN bristol_roads
    ON dr.edge = bristol_roads.gid;


texts: ArcGIS JS API 3.x: How to open a Info Window programmatically

texts:
I'm working on a geographic application using the ArcGIS JavaScript API 3.x.
I am looking for a method that runs when a user clicks on suggestion Menu in the Search Bar for showing a specific feature InfoWindow.

Simply I am looking for a method to open an InfoWindow for a specific feature (for example method who I will pass the id of a feature to, and after execution the info window will be showed)


texts: Using pop-up dialog to change properties of northarrow in ArcObjects?

texts:
In ArcMap, users could double-click on elements like north arrow and then change its properties in a pop-up dialog.

I was wondering how to accomplish this using ArcObjects?


texts: QGIS exporting vector layer to SVG as image

texts: I've rendered a fairly ordinary chloropleth in QGIS (2.18) and am trying to export it to SVG via the print composer. While the text labels come through fine, the shapefile's layer is exported as an image within the SVG, rather than as paths. Why is this happening and how do I get it to export as paths?


texts: Split By Attributes tool not recognizing Feature Dataset as Target Workspace?

texts:
Using ArcGIS Desktop 10.5.1, I have a FGDB that contains a feature dataset.  I would like the output from the "Split By Attributes" tool to go inside this feature dataset.  However, the tool does not show the existing feature dataset as an available target workspace, as shown here:

How do I send the output feature classes to a feature dataset?


texts: Easiest way to translate live GPS to realtime GTFS?

texts:
I have live GPS data coming in from the city's buses and given that I already have the routes in GTFS ( https://developers.google.com/transit/gtfs/reference/ ) I would like to convert this data to the GTFS format.

Is there a way to convert a bus's GPS coordinates taken at a certain time into a stop_sequence and delay, if there is any?

EDIT: I've found https://github.com/cbick/gps2gtfs but it requires some tweaking from what I understand, it's not a finished library.


texts: When creating a Nearest Neighbour from xyz, the raster cells are not centered with the original point cloud (QGIS)

texts: I have a gridded point cloud 0,25x025. I ran a Nearest Neighbour with the same resultion (cell 0,25). The points of the cloud and the raster are not centered as seen in the picutre. Am I doing something wrong?


texts: Count specific value in label expression by QGIS

texts: I have successfully count total features of Parcel layer by count aggregate function, next challenge with me is how to count all "5" or "4" values from "lut_zone" field as a label expression.


texts: Specifying the cell size for a rasters on import into ArcGIS

texts:
I've created an artificial surface terrain using Adobe Photoshop (for testing algorithms), and I would like to import the tiff into ArcGIS with the cell size set to a desired scale. At the moment, it comes in at 0.013888889m x 0.013888889m, and I want it to be 10m x 10m.

In theory, you could use the Rescale (Data Management) tool, but that doesn't appear to work. :(

Does anyone have any ideas?


texts: How to save/ export a new data layer in Arcmap 10.1?

texts:
i am doing an export a New Data Layer but when i tried  to save it that's  what happened

what's wrong?


texts: Create a new layer from overlap between two layers?

texts:
I'm new to desktop GIS, and will try to ask while lacking the proper terms from the GIS lingo:

If QGIS was like Photoshop I would like to make a selection from one layer, and then match that selection to another layer to get the overlap between the two and create a new layer from this overlap.

Formulated in another way:

I want to select all land from each of the Norwegian municipalities. In the shapefile I have (you can download it here: http://www.statkart.no/?module=Files;action=File.getFile;ID=41973) municipality borders are found as "N5000_AdministrativGrense" (just the borders) and "N5000_AdministrativFlate" (borders and the land within each municipality). This data (borders and land per municipality) is too administrative - it includes ocean and we have a lot of fjords in Norway. I need the landmass minus ocean.

The landmass is found in the layer "N5000_ArealdekkeFlate" - or so it looks to a novice at least.

So - I want to find the intersection between the landmass (only land, no ocean) and municipality borders and make a new layer that is all municipalities without ocean.

I'm on a mac with QGIS as my installed tool. All tips, pointers and help is much appreciated.


texts:
When I use Buffer tool. Distance is in geographic degrees. And it suggests me "Consider reprojecting to a projected local coordinate system for accurate results"
I try to change map unit in "Project properties" >> "General setting". But I still got that problem. I also try to save as another project, still not work.

My project is WGS 84: EPSG:4326.

Anyone have same problem or know how to fix it?


texts: Accessing iface in QGIS from Jupyter Notebook?

texts:
I am trying to work with an active QGIS from a jupyter notebook - specifically I'd like to be able to access iface so I can perform some layer calculations.
I am having trouble getting the map layers and working with the iface.
from qgis.core import *
import qgis.utils
from qgis.utils import iface, plugins

import numpy
import pandas
import pathlib, os, sys

project_name= r"C:\path-to-project.qgz"
app= QgsApplication([], False)
QgsApplication.setPrefixPath(r"C:\OSGeo4W\apps\qgis", True)
QgsApplication.initQgis()

current_project= QgsProject.instance()
current_project.setFileName(project_name)
print(current_project) #this prints a project instance

print(current_project.mapLayers()) #this returns an empty dictionary {}

layer = iface.activeLayer() #this gives an error: NoneType has no method activeLayer

layers = iface.mapCanvas().layers() #same error as above: it thinks iface is None

For some reason it is not able to use iface and gives me a NoneType error.
How do I work with the currently running QGIS instance from a jupyter notebook and have access to the map layers?


texts: vb.net arcobjects "current no topology available"

texts:
I am using ArcMap add-in to perform a topology validation. I have defined a topology in the geodatabase and add it in ArcMap TOC. When I try to get the current topology using ArcObjects, I get this message : "current no topology available".

My code is shown below:

Public Sub ReturnCurrentTopologyType()
    Dim extUid As UID = New UIDClass()
    extUid.Value = "esriEditorExt.TopologyExtension"
    Dim topologyExt As ITopologyExtension = TryCast(My.ArcMap.Application.FindExtensionByCLSID(extUid), ITopologyExtension)
    If topologyExt.CurrentTopology Is Nothing Then
        MsgBox("Current no Topology available")
        Exit Sub
    End If
    If TypeOf topologyExt.CurrentTopology Is IMapTopology Then
        MsgBox("Current Topology is a map topology")
    Else
        MsgBox("Current Topology is a geodatabase topology")
    End If
End Sub

Now I am not sure what I miss for getting the current topology.
I am using ArcObjects 10.2.1 and vb.net(vs 2012). Please advise me, thanks.


texts: Looking for Raster Renderer statistics in ArcObjects

texts:
I've got a plug-in for ArcMap that I have been working on.  I have my own renderer seperate from ArcMap that I am using to display imagery.  My goal is to sync up the display of this imagery with that produced by the renderer that ArcMap is using.

My ideal solution would be to get a copy of the lookup table that Arc is using in displaying the image.  I thought this might be buried somewhere in the IRasterStretch interface, particularly in the IRasterStretch2.StretchStats method described here:

IRasterStretch2.StretchStats Description

Unfortunately, I cannot figure out what the method is returning.  Basically, I am looking for what "ISomething" should be in the code snippet below:

IRasterStretch2 irs = irrgbr as IRasterStretch2; //irrgbr is of type IRasterRGBRenderer.
IArray ia = irs.StretchStats;
ISomething value = ia.get_Element(0) as ISomething; // What should "ISomething" be?

If anyone has any other ideas on how to go about getting the lookup table and/or statistics that the renderer is using to draw the raster layer, please let me know.

Many thanks!


texts: Figuring out the most probable country out of a string?

texts:
I got a problem with a twitter analysis i am doing.
What i want to do:
Based on the country i want to make a nice graphic about how many tweets were posted per country.

Using python and tweepy i manage to receive streams of tweets in json format.
In most cases those json format tweets don't have geo locations. All information I have is the user location which is represented as a simple string.
Here are a few examples:

Berlin, Deutschland
France
Paris et plein Centre
Punjab, Pakistan
South Africa
Boulder, Colorado
NONE
London
United States
Ethiopia
Ethiopia
TΧ
NONE
Paris, Mulhouse, sur la route
London
Barcelona
Liverpool
Bay Area, CA

As you can see there a many different formats in which countries and cities or states (USA) are listed. Is there a Package / Framework / Library / Algorithm i can use to get the most probable country out of these variable informations (Preferably written for python)?

I am hoping to transform TX into USA. (to state an example)

Anyone got any hints what i could use to solve my problem?


texts: Search cursor stops selecting after two iterations

texts:
I have a script which selects an extent from a grid and exports the data frame.

import os, arcpy

mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
grid_lyr = arcpy.mapping.ListLayers(mxd,"grid")[0]
scur = arcpy.SearchCursor(grid_lyr)

for row in scur:
    sqlExp = """{0} = '{1}'""".format(arcpy.AddFieldDelimiters(grid_lyr,"PageName"),row.getValue("PageName"))
    arcpy.SelectLayerByAttribute_management(grid_lyr,"NEW_SELECTION",sqlExp)
    print "Selecting {}".format(row.getValue("PageName"))
    df.extent = grid_lyr.getSelectedExtent(False)
    df.zoomToSelectedFeatures()
    df.scale = df.scale*1.05
    arcpy.mapping.ExportToTIFF(mxd,os.path.join(r'C:\temp\109147',row.getValue("PageName")+".tif"),df,817, 534,world_file=True)

    arcpy.RefreshActiveView()
del scur, mxd

I ran this script last week, and it crashed ArcMap after exporting the first tiff. I then ran it in a blank ArcMap document, changed CURRENT to the full path and it worked (all 414 tiff files exported).

I am running the same script again today, on the same data, from a blank document. It now successfully exports the first two tiffs, and then stops executing as if it is finished, without any errors. When I try to run it again, ArcMap crashes again. I am not sure what the problem is, last week when it failed I just opened a blank document, as that normally solves the issues half the time.

I updated the code to include print statements for debugging:

for row in scur:
    print "Row count: " +str(arcpy.GetCount_management(grid_lyr))
    sqlExp = """{0} = '{1}'""".format(arcpy.AddFieldDelimiters(grid_lyr,"PageName"),row.getValue("PageName"))
    arcpy.SelectLayerByAttribute_management(grid_lyr,"NEW_SELECTION",sqlExp)
    print "SQL is: {}".format(sqlExp)
    df.extent = grid_lyr.getSelectedExtent(False)
    df.zoomToSelectedFeatures()
    df.scale = df.scale*1.05
    print "Data frame {0} has a scale of {1}".format(df.name, df.scale)
    name = os.path.join(r'C:\temp\109147',row.getValue("PageName")+".tif")
    arcpy.mapping.ExportToTIFF(mxd,name,df,817, 534,world_file=True)
    print "Exported {}".format(name)
    arcpy.RefreshActiveView()

del scur, mxd, row

The output was:

Row count: 500
SQL is: "PageName" = 'E3'
Data frame Layers has a scale of 2276.80888604
Exported C:\temp\109147\E3.tif
Row count: 1
SQL is: "PageName" = 'E4'
Data frame Layers has a scale of 2276.80888604
Exported C:\temp\109147\E4.tif

My grid layer only has 414 features, so the row count numbers are a bit weird. Also, if I try to define the cursor variable again in the same session, ArcMap crashes.


texts: How to connect places (points) without crossing lines?

texts:
I have two sets of data.  One with placemarks represented by blue dots in image below, and another set of geographic data with lines represented by grey lines.

1) For the first point in drawing, I'm looking for a way for automatically connecting placemarks, by adding new lines geometry between them, but not crossing grey lines (representing streets in fact).  In drawing, green connections are connections wanted, and red connections are unwanted ones.

2) This second point is maybe more difficult to achieve.  Connections between two dots should not exist if they're not "following" (maybe by having roughly the same angle of) the grey lines.

Is it possible to play with data to solve this problem by playing with QGIS, or another tool, and save new lines in database?

P.S.: I'm new to GIS world.


texts: Accessing a WMS layer from geoserver and adding it in cesium globe

texts:
I had tried adding a WMS layer from geoserver to cesium globes by below code

var widget = new Cesium.CesiumWidget('cesiumContainer');
var url='http://localhost:8080/geoserver/wms'; //Geoserver URL
var layers = widget.scene.globe.imageryLayers;
layers.removeAll();
layers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
    url : url,
    layers: 'Vishakapatnam:Vishakapatnam_Imagery'
}));

The WMS layer is not getting added in the globe. Even i tried adding cors filter in /etc/tomcat7/web.xml. But no luck.


texts: Error while creating a site on arcGIS server manager

texts:
Everytime I try to create new site on ArcGIS server, it gives me this error.
"ERROR: Failed to create the site. Another administrative operation is currently accessing the store. Please try again later"
 Yet i'm unable to create my site on server


texts: Non-Default Projection requires extent when using ol.layer.Tile in OpenLayers 3.5

texts:
I've recently upgraded from version 3.4 to version 3.5 of OpenLayers 3.

I use an ol.layer.Tile layer with a ol.source.TileArcGISRest source. My map projection is EPSG:27700 (British National Grid) which is not a standard projection so I have had to add it using the proj4js library.

This layer stopped working after upgrading to 3.5. It appears to be because the projection does not have an extent defined. After explicitly defining an extent the layer is rendered correctly.

My question is should you always define an extent when adding a projection to OpenLayers 3? If so why did it work before and what is the reason for this change in approach? As far as I can see this has potentially made the ol.layer.Tile less robust because users must remember to set an extent if they are using a non-standard projection.

I can see that there have been modifications around this area as shown in:

https://github.com/openlayers/ol3/commit/b05193fa454a963b33e6c5965181abde9b45b7fa

The code below recreates the error. If I uncomment the set projection extent line the error does not occur. In my real world code I'm pointing to a local ESRI MapServer that displays data in the British National Grid projection, I cannot use that in the example below as it is hosted internally.

<!doctype html>

    <link rel="stylesheet" href="http://openlayers.org/en/v3.5.0/css/ol.css" type="text/css">

    <title>OpenLayers 3 example</title>

My Map


texts: Computing altitude from contour table - slow ST_Dwithin query

texts:
I am using PostgreSQL 9.2/PostGIS 2.0. I have a table of house addresses and a table of contour lines which are as follows:

address_list

house_id | geom (point, 4283)
---------+---------
    1    | Point
    2    | Point

sa_elevation

   gid   | altitude  |geom (MultiLineString, 4283)
---------+-----------+-----------------
    1    |  100m     |
    2    |  550m     |

I am trying to compute the altitude for each house in the address_list table (approx 6,000 houses) using a 'nearest neighbour' approach ie. find the nearest contour line to the home and tell me what the altitude is for that contour line. My syntax is included below. I use a left join because I don't know if all houses will have a contour line within 3km (following PostGIS in Action p. 137). Note that 3112 is in metres. I've tested the syntax on 5 houses and it works.

But the problem is that if I run it on the whole table and leave it running all night it never seems to finish. I have run vacuum analyse and haves spatial indices on each table. Could someone suggest a faster procedure? Or is there anything else I should do? Many thanks.

SELECT DISTINCT ON(a.house_id)
    a.house_id,
    e.altitude AS altitude
FROM address_list AS a
LEFT JOIN sa_elevation AS e
ON ST_Dwithin (ST_Transform(a.wkb_geometry, 3112),ST_Transform(e.wkb_geometry, 3112), 3000)
ORDER BY a.house_id, ST_Distance(ST_Transform(a.wkb_geometry,3112), ST_Transform(e.wkb_geometry,3112));

The explain plan is:

   Unique  (cost=232208649.81..232208684.17 rows=6871 width=4109)
  ->  Sort  (cost=232208649.81..232208666.99 rows=6871 width=4109)
        Sort Key: a.house_id, (st_distance(st_transform(a.wkb_geometry, 3112), st_transform(e.wkb_geometry, 3112)))
        ->  Nested Loop Left Join  (cost=0.00..232183921.91 rows=6871 width=4109)
              Join Filter: ((st_transform(a.wkb_geometry, 3112) && st_expand(st_transform(e.wkb_geometry, 3112), 3000::double precision)) AND (st_transform(e.wkb_geometry, 3112) && st_expand(st_transform(a.wkb_geometry, 3112), 3000::double precision)) AND _st_dwithin(st_transform(a.wkb_geometry, 3112), st_transform(e.wkb_geometry, 3112), 3000::double precision))
              ->  Seq Scan on address_list a  (cost=0.00..212.71 rows=6871 width=36)
              ->  Materialize  (cost=0.00..46527.78 rows=42852 width=4073)
                    ->  Seq Scan on sa_elevation e  (cost=0.00..24845.52 rows=42852 width=4073)


texts: Using ArcGIS Desktop concurrently in remote server?

texts: We have the license of ArcGIS 10 for concurrent use. For the data security and validation, we installed the application in a remote server, where we are a group of three people can access the remote server concurrently. But, the problem is we can use the ArcGIS only one person at a time, whether we have the concurrent license. How can we three people concurrently use the ArcGIS 10?


texts:
I'm using QGIS with a flat-world approximation dataset and for my specific use, geometric coordinates on a 1 unit = 1 metre scale are perfect.

Unfortunately, QGIS doesn't have EPSG:404000 built-in, and complains if I try to create a custom CRS with +proj="" as the instructions on http://spatialreference.org/ref/sr-org/7589/ say.

Is there any way to teach QGIS about EPSG:404000 and get it to work basically without projection ?


texts: Merging multiple vector layers to one layer with multiple geom types with QGIS

texts:
I have a situation where I need to merge a large number of spatial files into a single output with a free tool like QGIS, rather than FME or Alteryx.

Along the lines of this post:
Merging multiple vector layers to one layer using QGIS?

However, I have some point features, some line features, and some polygon features. This rules out outputs like shapefiles, but anything else is fine like GML, TAB, or a database.

Is there anyway to do this in QGIS?

Every process or model I try makes a shapefile at some point which means this can't work.


texts: Fixing topology errors creates more errors

texts: I am running topology on a shapefile to fix overlaps/gaps, when I correct some of them, more seem to form when I run validate topology. I think maybe in fixing the errors I am perhaps moving  the shapefiles which is causing a ripple effect. Also is there anyway a newbie GIS user can batch correct topology errors, I have loads of shapefiles I am putting into a set format and obviously none can have topology errors.


texts: PostGIS replace view crashes PostgreSQL server from ArcGIS script

texts:
I have the following script which when from ArcGIS (and a similar script from a QGIS plugin) will update a view.

Every so often (around 1 in 5 times the script is run) it causes the PostgreSQL server to 'crash' (no features show up in ArcGIS or QGIS and both will hang) and the script will fail to update the view. Restarting the PostgreSQL server resolves whatever the problem was.

def replace_view(self, ref_num_str):
    conn = psycopg2.connect(*connection string*)
    cur = conn.cursor()
    sql = """CREATE OR REPLACE VIEW old_search AS
            SELECT desktop_search.gid, desktop_search.search_type, desktop_search.client,
            desktop_search.reference, desktop_search.author, desktop_search.dategis,
            desktop_search.datebm, desktop_search.property_name, desktop_search.street,
            desktop_search.town, desktop_search.city, desktop_search.county,
            desktop_search.postcode, desktop_search.searches, desktop_search.reports,
            desktop_search.geom, desktop_search.asq_lasteditedby,
            desktop_search.asq_lasteditedwhen, desktop_search.asq_lockedby,
            desktop_search.shapelength, desktop_search.shapearea
            FROM desktop_search desktop_search
            WHERE desktop_search.reference = %s::text;

            ALTER TABLE old_search
            OWNER TO postgres;
            GRANT ALL ON TABLE old_search TO postgres;
            GRANT ALL ON TABLE old_search TO "Archivists";
            GRANT ALL ON TABLE old_search TO "Geologists";"""
    data = (ref_num_str, )
    cur.execute(sql, data)
    conn.commit()
    cur.close()
    conn.close()
    arcpy.AddMessage("the Old_Search view has been sucessfully updated")

I have the following errors in my postgres log:

2014-02-12 11:51:59 GMT STATEMENT:  DECLARE qgisf18_120 BINARY CURSOR FOR SELECT st_asbinary(st_force_2d("geom"),'NDR'),"gid","dategis"::text FROM "public"."desktop_search" WHERE "geom" && st_makeenvelope(209586.46110484766541049,77341.20856820739572868,209797.37429537757998332,77461.20856820742483251,27700) AND st_srid("geom")=27700
2014-02-12 11:51:59 GMT ERROR:  cursor "qgisf18_120" does not exist
2014-02-12 11:51:59 GMT STATEMENT:  move absolute 0 in qgisf18_120

However, I am unsure if they are related to the problem but nothing else looks abnormal.

I am using PostgreSQL 9.2.3 and postgis 2.0.1

Is there anything in my script which may be causing this problem? Any other suggestions?


texts:
I have a problem in gvSIG. I imported datas from OpenStreetMap using osm2pgsql. I do use them everyday with QGIS, it works perfectly.
In QGis, the CRS is set to 32630 (WGS 84 UTM zone 30N) +proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +no_defs +towgs84=0,0,0

When I want to connect to the same database with QGIS, if I use the default WGS 84 4326 it works well bit the datas are displayed in oblique which sounds normal, it does the same in QGIS. But here is my problem, when i set up a CRS in 32630 in gvSIG it doesn't work … I will get a crappy animation of big objects all over the map that are slowing down the software …
If I change the CRS after, I dot have nothing displayed and using the icon to zoom over the data areas does nothing.

here is a screen shot of the result using 32630 CRS.

https://www.box.com/s/731pqcpa3szkrzun6i1f
https://www.box.com/s/l1to0a36rpqqmk29nm2n


texts: Map Layout Elements In New Layer Automated Using Python

texts: I was wondering if there was a way to put a title and integer data from an attribute table in a new layer created in Python. I was able to create a new layer using copy features, zoom to the selected features, and export the zoomed features in a map as a PNG all using arcpy, but I also wanted a title at the top and data from the attribute table of that specific layer in the map layout before it was exported. Is it possible to get all this automated using Python?


texts: Where are Print Composer Template files stored?

texts: When I saved my Print Composer template, I cleverly navigated to a logical (to me) folder among my documents to save it. Now I find that it does not show up on the list of Composers under “File”. Can someone please tell me where it is supposed to be, so I can move it to there and open it?


texts: Why is creating features with FALSE boolean fields in QGIS and Postgres failing when the fields have default values?

texts:
I'm having problems with adding rows that have boolean columns to Postgres tables from QGIS.  In a nutshell, shapes with boolean fields can only be created when the booleans are set to true (updates work fine).  Update: The only columns that fail are those with default values on the DB side.

Note: I have found a work-around but would like a proper solution (see my answer below)

In QGIS, the boolean fields have "Check Box" as their edit widget with t for the checked value and f as the unselected value.  Creating a new shape and saving it results in errors for the boolean columns that are false since the field value is not being quoted unless the value is true.  Subsequent updates work fine though (including setting the value to false).  As best I can tell most (but not all1) boolean columns are affected.

Does anyone know a fix for this?3  I'm going absolutely batty with having to set the booleans true then go back and set them false after saving.

1 A few of my boolean columns are working fine.  They seem identical2 to the ones that are failing on both the QGIS and the Postgres side.  Oddly, one of my tables has ~7 boolean columns of which only two exhibit the problem.  This plus the logs make me think the issue is on the QGIS side.

2 Actually, they're not identical.  All of the failing columns have default values on the DB side.

3 I found a work-around but not a true solution (see my answer below)

Versions:

QGIS 2.16.0
Postgres 9.5.2 (64-bit)

Error messages, etc. for one of the affected tables follow.  I'm seeing the same issue with all of the tables I'm using that have boolean columns.

The error reported by QGIS is:

Could not commit changes to layer ny_wetlands_modified

Errors: ERROR: 1 feature(s) not added.

  Provider errors:
  PostGIS error while adding features: ERROR:  column "f" does not exist
    LINE 1: ...,$2,NULL,NULL,NULL,'Riverine',NULL,NULL,NULL,NULL,f) RETURNI...

The Postgres log shows the following:

ERROR:  column "f" does not exist at character 264
STATEMENT:  INSERT INTO "public"."ny_wetlands_modified"("geom","gid","attribute","hgm_code","qaqc_code","wetland_ty","acres","hist_attri","shape_leng","shape_area","is_hidden") VALUES (st_multi(st_geomfromwkb($1::bytea,4326)),$2,NULL,NULL,NULL,'Riverine',NULL,NULL,NULL,NULL,f) RETURNING "gid"

Setting the field to true using the checkbox and then saving succeeds with the log showing:

LOG:  execute addfeatures: INSERT INTO "public"."ny_wetlands_modified"("geom","gid","attribute","hgm_code","qaqc_code","wetland_ty","acres","hist_attri","shape_leng","shape_area","is_hidden") VALUES (st_multi(st_geomfromwkb($1::bytea,4326)),$2,NULL,NULL,NULL,'Riverine',NULL,NULL,NULL,NULL,'t') RETURNING "gid"

Now the field can be set false (unchecked) resulting in:

LOG:  statement: UPDATE "public"."ny_wetlands_modified" SET "is_hidden"='f' WHERE "gid"=27650

The definition of the boolean column for this particular table is:

ALTER TABLE public.ny_wetlands_modified ADD COLUMN is_hidden boolean;
ALTER TABLE public.ny_wetlands_modified ALTER COLUMN is_hidden SET DEFAULT false;


texts: Convert locations from ECEF NED (local coordinate system) to WGS 84 (global coordinate system)

texts:
I track relative positions to known fixed reference location (Lat/Lon/Alt on WGS 84).

Which means Location_0 is the above reference location, and Location_i is something like (X,Y,Z) relative by definition to Location_0 under ECEF convention (one can think about something like INS/IMU system).

I can obtain Location_i (Lat, Lon, Alt) from (X,Y,Z) with ECEF & NED conversions.

But if the "distance" (for the sake of simplicity let's relax the definition of what exactly I mean by 'distance') between Location_0 & Location_i going as far as hundreds of kilometers etc. ECEF & NED assumptions not enough and I need to work with WGS 84.

How can I track positions calculated under ECEF NED assumption relatively to known referenced point on WGS84, and then convert them to WGS84?


texts: How to maintain schema when copying feature from layer 1 to layer 2, where both layers have same schema?

texts:
If I load two unique layers, wherein each layer contains unique data, but both layers share the exact same schema, why is it when I copy a feature from layer 1, and paste it into layer 2, the attributes to not transfer exactly as they should?

What happens is when pasting a feature from layer 1 into layer 2, the layer 2 attributes of said feature has the data offset by 2 columns, e.g.-

  layer 1 schema
  id
  clave
  name
  address
  tel

  layer 2 schema
  id
  clave
  name
  address
  tel

A record from layer 1 like this:

  clave; 666
  name; JOE BLOW
  address; 123 ANYSTREET
  tel: 867-5309
  email; joe@blow.com

Transfers to layer 2 like this:

  clave;
  name;
  address; 666
  tel: JOE BLOW
  email; 123 ANYSTREET

So, the actual data is being offset by two columns, and the two columns that are passed over, the data from those columns does not show up anywhere.  Clearly, this is not the way it should be behaving, perhaps others have had the same problem?

Thanks,

Eric Jarvies


texts: Summarizing table and keeping other attributes (ArcMap)

texts:
My original table in ArcMap is associated with polygons.  In some cases, a polygon can have two records but with different values for each record.

I can summarize the table based on unique value of each polygon as well as get the max value from the polygon - but I would also like to bring along the associated attributes with the max record in the summary.  Is there a way to do this in ArcMap or any other database/spreadsheet program.

Example

UniquePoly   Yield   Crop     Number of Acres
1             100    Wheat    125
1             75     Canola   60

My summary table would be:

UniquePoly    MaxAcres    CountofUniquePoly
1             125         2

But I also like to carry across the yield and crop in the summary table

UniquePoly    MaxAcres    Count    Yield    Crop
1             125         2        100      Wheat


texts: How to get a table with the values of a given raster layer aggregated by a second raster layer in grass?

texts:
Let's say in grass I have a raster layer "regionId" (integer) and a raster layer "forestArea", where I store the ha of forest within the pixel (float).

How can I get a table summing up the forest area by region ?


texts:
Anyone know of a way to be able to create a new shapefile of points that sit within a polygon, without having to trace along the boundary line to select all thousands of points?

I used the "Count Points in Polygons" tool thinking it would create a point shapefile with the number of points within the polygon I had selected but I was wrong. It actually made an additional polygon shapefile with one feature telling me the amount of points in this location.


texts: Fill a column with a coordinate X or Y with PyQgis

texts:
I've created a new field on my layer (points vector) named Coord_X, and want to fill it with the coordinate of all features.
I'm trying this way, but something is not right:

for f in layer.getFeatures():
    geom = f.geometry()
    x = geom.asPoint().x()

for f in x:
    new_values = {layer.fieldNameIndex('Coord_X') : x}
    provider.changeAttributeValues({x.index(f):new_values})


texts: Pictures with no background or transparent in ArcGIS layout

texts:
I would like to add a .jpg, .png or .tiff with a no background. In other words, I want the logo to appear as it was created, without a border or background, to my Layout view.

Also is it possible to have a transparent logo.


texts: Autopopulated combobox value passed to definition query - results won't display on map

texts:
I have a dojo combobox that is populated with unique values.  The user chooses a value, and the value is passed to a definition query, and the results displayed on the map.  I can't get the results to display once the value is chosen from the combobox.

I"m pretty sure I'm not passing the value from the combobox to the definition query correctly, but not exactly sure where it goes wrong.

Here is my code http://plnkr.co/edit/eFzNtlO8DpkGYaaTpf8w?p=preview


texts:
I want to check if 2 linestrings intersects (or overlaps) or no.

I use turf.js overlap.

Here are the results I want to get:

CodePen

1- If only first or last points of line 1 intersects with first or last points of line 2, intersection test should return false.

2- If a part of line 1 overlaps with a part of line 2, intersection test should return true

Problem is here:

// button click event
button.addEventListener('click',function(){

  // line-A end point coord and line-B start point coord equal
  // result must be true
  var overlapping = turf.lineOverlap(long, short);
  L.geoJSON(overlapping, {color: 'white',opacity:0.6,lineCap:'butt'}).addTo(map);

  // Part of line-C overlaps line-D
  // result must be false
  var overlapping = turf.lineOverlap(long1, short1);
  L.geoJSON(overlapping, {color: 'white',opacity:0.6,lineCap:'butt'}).addTo(map);

})


texts: How to classify land cover with MMU 25hac

texts: By using the 30 meter resolution of landsat TM & ETM+ data, I want to create the land use/ land cover map. I have read in several studies to first decide about the minimum mapping unit (MMU) that is manifested by CORINE land use land cover for Landsat data. How can I specifically make analysis by using 25hac (90x90).


texts: way in R or Python to add image/video in map plot marker click popup/infowindow

texts:
I have many different (lat,long data) points of world associated with unique place names and corresponding each point specific image or video data. Now I want to create an html file where if user click on each point they can see that specific image or video in the pop-up/infowindow. Previously I have successfully used html files with my shiny web application.

Target examples links are as below but they are all in Java:

1.custom image in marker[http://en.marnoto.com/2014/09/5-formas-de-personalizar-infowindow.html]

2.custom video in marker

  [1]: http://en.marnoto.com/2014/09/5-formas-de-personalizar-infowindow.html

streetview image in marker[http://jsfiddle.net/sST8z/]

var map;
var mapOptions = { center: new google.maps.LatLng(0.0, 0.0), zoom: 2,
mapTypeId: google.maps.MapTypeId.ROADMAP };

function initialize() {
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
street = new google.maps.StreetViewPanorama(document.getElementById("street"), {

position: new google.maps.LatLng(40.72982797782924, -73.98622512817383),
zoomControl: false,
enableCloseButton: false,
addressControl: false,
panControl: false,
    linksControl: false
});

var infow = new google.maps.InfoWindow({ content: document.getElementById("street")
});
var myLatLng = new google.maps.LatLng(40.72982797782924, -73.98622512817383);
var marker = new google.maps.Marker({ position: myLatLng, map: map, visible: true });

infow.open(map, marker);
map.setCenter(myLatLng);

}
google.maps.event.addDomListener(window, 'load', initialize);

</script>

First I have tried with plotGoogleMaps, there I have to manually change the generated html file javascript section code for each marker so it is becoming a lot of manual work. So alternatively Is there any way to achieve the same in " leaflet " or " rleafmap " R package or any other combination of R-based package ?

I am more from R less from Python, is there any easy solution exists in Python at least to generate that html page. I just want to build that html file so that I can use in shiny web framework.


texts: Location of Quickmapservice plugin in QGIS interface

texts:
I have been using Quickmapservice plugin located in web column but I cannot locate it now.

It just disappeared and even after uninstalling and reinstalling several times the problems remains.


texts: Identifying which polygons lie within grid of polygons using ArcMap

texts:
I work in ArcMap 10.8.1. I have a polygon layer of municipalities and a polygon layer of 1x1 km square zones of air polluted areas (it's not a raster). I need to find which of the municipalities are "hit" by the air pollution polygons. Situation is displayed in the picture.
Is there a tool in Toolbox to resolve this?

I managed to run Select by Location tool but the result is not satisfactory.
Why didn't the tool select every polygon that contained "the polluted polygons"?
As in the picture.


texts: Con statement not working in Raster Calculator of ArcGIS for Desktop?

texts:
I'm trying to combine two rasters in 10.3 using a con statement with the raster calculator in map algebra.  (ie - con (raster 1 ==1, raster 1, raster 2))
where raster 1 is a smaller extent and does not have continuous values, and raster 2 is a land use raster.
the output is always equivalent to raster 1 only.  i've tried the CON tool, the "plus" tool instead of raster calculator (raster 1 + raster 2; so that i can then reclassify).  with the "plus" tool, i get the combined values, but the values for raster 2 where there should be NoData for raster 1 are missing.

this is a simple process i've done many times with prior versions, so what am i missing?


texts:
I'm very new to QGIS, so apologies if this is a daft question. I've been trying to resolve my problem for a couple of days and I can't get anywhere. I have searched for similar issues here on SE but no-one seems to have the same problem.

I have a layer of forest habitat patches (green patches) and a boundary line layer (in purple). I want to determine which forest habitat patches are within certain buffers from that boundary line. I have used "Vector > Geoprocessing Tools > Clip" in order to create a new .shp with forest habitat patches within a buffer. I am getting inconsistent results, it seems to work for some distances...

But in others it misses patches (highlighted by the red square)...

Can anyone tell me why this might be happening? And any way to resolve it?

I have tried to construct workarounds using "Difference" and "Intersect" but I get other inconsistencies there as well.

I'm using QGIS 2.12.0, I have checked that all my shapefiles are in the same CRS, and checked that there are no Geometry errors.


texts: Moving points by multiple attributes automatically

texts:
I have a shapefile including sightings of birds (points), but the gps points are taken from where the sighting have been made, not where the bird actually are. And in the map I need to show the real location of the birds.

My attribute table includes columns of distance to the bird (m) and the bearing in whitch it have been seen (degrees). Is it possible to move all the points automatically by using these two attributes? So for example 30 m to 90° (the east).

Im using Qgis 2.18.


texts: Run graphical modeler on multiple pairs of selected features

texts:
I have a shapefile of 10,000+ county polygons. Of these, I've identified ~5,000 that are geographically too small, and I want to combine with their immediate nearest neighbor, naming the combined county A and county B "A - B"

Current workflow:

Manually select the two counties I want to combine
Click "Merge Selected Features"
Manually specify output fields and concatenations
Click "OK"

I want to be able to manually select the two counties (some human judgment is required for that part), then run the model so it runs steps 2-4 only on those two selected features.

I've been digging around for a while and can't seem to find an answer for this. This was close, but I will have thousands of these pairs, and I don't want to select two, save them as a new file, then run the model that merges them.

That asker's previous question was also close, but I'm wondering if it's possible to do this 100% in the graphical modeler.


texts: How do I add elevation data to a shapefile in the attributes table?

texts:
I'm using ArcGIS to create a DEM/DTM for a viewshed analysis. I have an existing DTM created from UK OS Terrain 5.

I'm attempting to add the elevation data to the UK OS Open Map shapefiles for buildings and woodland. The method to do this would be to add an extra field in the attributes table and assign the 8m/15m elevation to this field respectively. What field type/properties should the new field have?


texts:
ArcGIS 10.2.2 Standard

I'm looking for a code sample that can delete all relationship classes from a database, including inside Feature Datasets.

I've searched ESRI's site and only found a suggestion to use IDataset. I've searched google and not found anything helpful.

Do I need to delete the existing relationships prior to deleting the entire relationship class?

I got this working here is the WORKING CODE:

public Result DeleteRelationshipClasses(IWorkspace WS)
{
  try
  {
    IEnumDataset relds = WS.get_Datasets(esriDatasetType.esriDTRelationshipClass);
    IEnumDataset featds = WS.get_Datasets(esriDatasetType.esriDTFeatureDataset);
    relds.Reset();
    IDataset relclass = null;
    try
    {
      while ((relclass = relds.Next()) != null)
      {
        if (relclass.CanDelete())
          relclass.Delete();
      }
    }
    catch (Exception ex)
    {
      RecordException(ex);
    }
    featds.Reset();
    IEnumDataset classesInDs = null;
    IDataset classInDs = null;
    try
    {
      while ((relclass = featds.Next()) != null)
      {
        classesInDs = relclass.Subsets;
        classesInDs.Reset();
        while ((classInDs = classesInDs.Next()) != null)
        {
          if (classInDs.Type == esriDatasetType.esriDTRelationshipClass)
          {
            if (classInDs.CanDelete())
              classInDs.Delete();
          }
        }
      }
    }
    catch (Exception ex)
    {
      RecordException(ex);
    }
  }
  catch (Exception ex)
  {
    RecordException(ex);
    return Result.Failure(ex.Message);
  }
  return Result.Success();
}


texts: How to create infrastructure coverage using pgRouting?

texts:
I'm trying to reproduce what Underdark did here.
I succesfully installed pgrouting and the two required function (nearest neighbour and driving_distance).
cdv_osm_v contains all the openstreetmap points of my region, from which I select only transportation infrastructure.
taa_2po_4pgr and taa_2po_v contain network and nodes extracted by osm2po for my region.
When I try to run this query in pgAdmin3 I got a syntax error at or near "FOR".
The first select works well, and also driving_distance outputs results fine if called separately.
I'm a noob at postgresql/postgis and I don't know how to pass a geometry to nn() to test it separately (and maybe x,y and factor parameters are not so good).
What am I doing wrong?

CREATE TEMPORARY TABLE nodes_costs (vertex_id integer,edge_id integer,cost double precision);

FOR i IN
  SELECT the_geom
  FROM cdv_osm_v
  WHERE highway like 'bus_stop' OR railway like 'station' or amenity like 'bus_station'
LOOP
  INSERT INTO nodes_cost
  driving_distance(
    'SELECT id, source, target, km AS cost
    FROM taa_2po_4pgr',
    mm(i.the_geom ,0.0001,2,2,'taa_2po_v','id','geom_vertex'), 0.4, false, false);
END LOOP;

SELECT *
FROM taa_2po_v
JOIN
  SELECT vertex_id, min(cost) AS costo
  FROM nodes_costs
ON
taa_2po_v.id = nodes_costs.vertex_id;

I forgot: posgresql 9.1, postgis 2.0.1, pgrouting 1.0.5 from kyngchaos.