texts: Delete from a table where the geometry intersects the geometry of another table?

texts:
Is there a way to delete data in one table that intersects the geomety of another table? I am using PostGIS.

Effectively I would like to do the following, but this returns an error.

DELETE FROM table_A
WHERE st_intersects(table_A.geom, table_B.geom)


texts: Cutting Polygons in QGIS at a specific distance from a feature in another layer

texts:
I would like to be able to cut polygons such as the one below, in QGIS, at a set distance either side of a specified feature on another layer, in this case a footpath line from OS Mastermap.

In this way I would then effectively have a buffer along the lines that could represent a woodland ride network, for example. In this case it is a very simple linear feature, but they are often much more complex, and can be very time-consuming to cut out. Ideally I need to retain the original polygon as this will be used as well.

Is it possible to cut a polygon in this way, or would I have to create the new polygons as buffers along the line and then cut these from the existing polygon?


texts: How to improve showing 100.000 points long route vector through whole world?

texts:
While traveling the world I will have GPS logger on me and I want to show whole route on my OpenLayers map (on all zoom levels, planning to have ~100.000 points). I will also have animated smooth zooming & panning from one point to another along the route (Even from USA to China animations).

Firstly I wanted to put KML file for each day of travels and then load them in same layer, but I think updating layer with ~100.000 points in animation will be really process-heavy.

After some research I found I could make vector tile server, but is there any other better/less complicated way to improve performance?


texts:
I have a map sitting on top of a dark gray background.

I have the canvas basemap set to initially load as semi-transparent:

 var canvas = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer", {
            "opacity":0.28,
            "id": "canvas"});

When I zoom in/out, the tiles seem to 'flash' in.
Easier to see what I mean by watching this short screencast.

I am guessing it might be to do with the fact that the layer has some kind of fade in transition for new tiles?

If you agree that this is the likely cause, is there any way to turn this effect off?

For info, elsewhere in my application I have a transparency slider for this layer, but this has the same value as the initial transparency of the basemap. The reason I mention this, is that if there is a way the tiles can have their transparency altered perhaps by CSS, this will not be a workaround for me, as the tiles can have their opacity changed by the slider.

$('#slider').slider({
            min: 0,
            max: 100,
            value: 28,
            range: "min",
            slide: function(event, ui) {
              map.getLayer("canvas").setOpacity(ui.value/100);
          }
         });


texts: Splitting polygon into different regions using ArcMap?

texts:
Is there any way that I can divide the below image into different areas?

Just like a Google Map, where you can see the country borders.

I am using ArcMap 10.0.


texts: Dissolve/aggregate polygons with ogr2ogr or gpc?

texts:
I have a large number of polygons representing the boundaries of US counties which I need to merge into as few polygons as possible.

Is it possible to do this with non-commercial software, or software of a reasonable price?

PostGIS is not available, nor is Java, but C is.


texts: ArcGIS Javascript API Drawing graphics from a feature layer query not appearing in graphics layer

texts:
I'm trying to draw the features resulting from a query of a feature layer onto a graphics layer.

var query = abstracts.createQuery();
query.where = "ANUM = '1'";
query.returnGeometry = true;
var rl = map.findLayerById("graphics");
abstracts.queryFeatures(query).then(function (results) {
    rl.removeAll();
    var features = results.features.map(function (graphic) {
        graphic.symbol = new SimpleLineSymbol({
            size: 6.5,
            color: "darkorange"
        });
        return graphic;
    });
    rl.addMany(features);
});

When I set a breakpoint before the last line(rl.addMany(features)), I see that features contains the expected feature, and the symbol is set properly.  Also, I know that the feature exists, but is not appearing on the map.  Also, below is my declaration of feature layer and graphics layer.

        var abstracts = new FeatureLayer({
            url: "@arcgisServerServiceUrl/" + featureLayerId,
            outFields: ["*"],
            visible:false,
            mode: FeatureLayer.MODE_ONDEMAND,
            maxScale: 0,
            minScale: 290000,
            renderer: renderer,
        });

        var resultsLayer = new GraphicsLayer({id:"graphics"});

        map.layers.addMany([
            abstracts,
            resultsLayer,
        ]);


texts: A method for limiting the number of results the Get Feature Interaction brings through in OpenLayers 3

texts:
I have so far managed to return a list of all the customer names at a single point when the vector layer is clicked on. I am looking to limit this to only show the first (or just one) record.Could this be achieved through a modification of the following?

   function projectClient(browserEvent) {
    var coordinate = browserEvent.coordinate;
    var pixel = map.getPixelFromCoordinate(coordinate);
    var el = document.getElementById('projectClient');
    el.innerHTML = '';
    map.forEachFeatureAtPixel(pixel, function(feature) {
      el.innerHTML += feature.get('Proj_Client') + '<br>';
    });
  }
  map.on('pointerdown', projectClient);


texts: leaflet - divicon - How to hide the default square shadow?

texts:
For example, I write this:

L.marker([lat, long], {icon: L.divIcon({html:"China"})}).addTo(map);

I checked the documentation:

  By default, it has a 'leaflet-div-icon' CSS class and is styled as a
  little white square with a shadow.

But how can I change the default style? I try to change the "className", but it doesn't work.


texts: Match a custom CRS to existing (proj4 database) ones in QGIS 3

texts:
I am reading SPS files (see format definition here) from which I gather CRS information.
Unfortunately, there is no ESPG reference available nor is there any standard naming scheme for Ellipsoids so it is easy to get confused and even a well-known CRS may be better off built manually.

The ellipsoidAcronym() method is not capable of recognizing an existing Ellipsoid if I define my Projection with +a and +rf instead of using the +ellps. Similarly, the findMatchingProj() is failing.
In the following example, using def_wo_name, the Projection is not recognized (it is actually EPSG:30732) and I end up creating a useless custom CRS and cluttering my local database.

def_wo_name = '+proj=utm +zone=32 +a=6378249.145 +rf=293.4663 +towgs84=-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547 +units=m +no_defs'
#def_w_name = '+proj=utm +zone=32 +ellps=clrk80 +towgs84=-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547 +units=m +no_defs'
match = crs.findMatchingProj()
crs = QgsCoordinateReferenceSystem.fromProj4(def_wo_name)
print(crs.ellipsoidAcronym())
print(match)

The above code output is just the proj4 string, an empty string (no Ellipsoid match) and 0 (no Projection match)

Is there any method that would allow a better (actual) matching or do I have to check my +a and +rf against all Ellipsoids in my database and match manually ?


texts: How to set actions while click on popupTemplate in Arcgis javascript 4.0

texts:
I want to set the actions while I click the popupTemplate, please find my code sample below,

  view.popup.on({action:[actionA,actionB] });

The console error is,

  Uncaught TypeError: b.indexOf is not a function                on.js:5


texts: Where can I find a dataset for international borders that includes national waters?

texts:
I'm trying to find a .shp file that not only includes international land boundaries, but also the water boundaries, extending out to international waters.  Does such a thing exist?  I'm not even sure of what terms to search for.

Currently, I'm operating using a world borders map which is mostly good, but when our mobile users approach the ocean and their GPS flakes out a bit, our system can't place them within a country.  I figure the best way to fix this is to used a dataset that will always place the national border well away from dry land (and cell towers for their phone).

This project isn't making any money, so I'm hoping for free :-)


texts: Query to create polygon from lines that touches in PostGIS

texts:
I am trying to create polygons from a line layer with a spatial query in PostGIS

The problem is I don't have a lot of information on the lines, only the id of each line and geometry.


texts:
In Anaconda Python I am getting the following error:
0ERROR 1: JPEGLib:Wrong JPEG library version: library is 62, caller expects 80
I am running Ubuntu 14.04. I found a few references to this problem, but no fix.


texts: How to find out projection code for the sid file?

texts:
I have a miami.sid file and miami.sdw and miami.sid.aux.xml files.

How to find out the projection code? This question is similar to:

I have a .sid image but can't figure out the CRS

GDALInfo output:
----------------
Driver: MrSID/Multi-resolution Seamless Image Database (MrSID)
Files: C:\Users\Miami_25ft.sid
       C:\Users\Miami_25ft.sdw
       C:\Users\Miami_25ft.sid.aux.xml
Size is 112000, 60000
Coordinate System is `'
Origin = (876995.250000000000000,539495.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

Metadata:
  IMAGE__ENCODING_APPLICATION=GeoExpress 8.0.0.3065
  IMAGE__FORMAT=MrSID/MG3
  IMAGE__INPUT_FILE_SIZE=20165006292.000000
  IMAGE__INPUT_FORMAT=TIFF w/ World File
  IMAGE__INPUT_NAME=D:\11715_7_color_adjusted\0.25 Ft\10NE.tif,  D:\11715_7_color_adjusted\0.25 Ft\10NW.tif, D:\11715_7_color_adjusted\0.25 Ft\10SE.tif, D:\11715_7_color_adjusted\0.25 Ft\10SW.tif, D:\11715_7_color_adjusted\0.25 Ft\11NE.tif, D:\11715_7_color_adjusted\0.25 Ft\11NW.tif, D:\11715_7_color_adjusted\0.25 Ft\11SE.tif, D:\11715_7_color_adjusted\0.25 Ft\11SW.tif, D:\11715_7_color_adjusted\0.25 Ft\12NE.tif, D:\11715_7_color_adjusted\0.25 Ft\12NW.tif, D:\11715_7_color_adjusted\0.25 Ft\12SE.tif,
.....
.....
D:\11715_7_color_adjusted\0.25 Ft\8SE.tif, D:\11715_7_color_adjusted\0.25 Ft\9NE.tif, D:\11715_7_color_adjusted\0.25 Ft\9NW.tif, D:\11715_7_color_adjusted\0.25 Ft\9SE.tif, D:\11715_7_color_adjusted\0.25 Ft\9SW.tif
  IMAGE__LTI_ESDK_VERSION=8.0.0.3065.Bob_3062_br win64-vc8/Release
  IMAGE__MODIFICATIONS=COMPRESSED EMBEDDED MOSAICKED
  PShop__ImageResources=
  VERSION=MG3
Image Structure Metadata:
  INTERLEAVE=PIXEL

Corner Coordinates:
Upper Left  (  876998.250,  539499.000)
Lower Left  (  876998.250,  524499.000)
Upper Right (  904998.250,  539499.000)
Lower Right (  904998.250,  524499.000)
Center      (  890998.250,  531999.000)

Band 1 Block=1024x128 Type=Byte, ColorInterp=Red
  Minimum=0.000, Maximum=255.000, Mean=143.114, StdDev=49.379
  Overviews: 56000x30000, 28000x15000, 14000x7500, 7000x3750, 3500x1875, 1750x938, 875x469, 438x235, 219x118, 110x59

Band 2 Block=1024x128 Type=Byte, ColorInterp=Green
  Minimum=0.000, Maximum=255.000, Mean=145.812, StdDev=46.856
  Overviews: 56000x30000, 28000x15000, 14000x7500, 7000x3750, 3500x1875, 1750x938, 875x469, 438x235, 219x118, 110x59

Band 3 Block=1024x128 Type=Byte, ColorInterp=Blue
  Minimum=0.000, Maximum=255.000, Mean=141.074, StdDev=47.739
  Overviews: 56000x30000, 28000x15000, 14000x7500, 7000x3750, 3500x1875, 1750x938, 875x469, 438x235, 219x118, 110x59


texts: Replacing data source for group layers from FGDB to ArcSDE with different file names

texts:
Being a recent graduate and just started working I'm fairly new with Python, but I'm trying my best to learn and I find it really fun and useful! However, I'm stuck with a problem I can't seem to solve on my own. We recently migrated our data from FGDB to an SDE database and I've got hundreds of lyr-files containing multiple layers which I need to change data sources for. The file names in the SDE, however, is not exactly the same as in the FGDB.

For example:

Name in FGDB: kl_c_Clip

Name in SDE: blabla.whatup.kl_c_y

As you can see part of the name is the same, which is pretty much always the case. I've been looking around for a solution but haven't found any where the names differ. I'm thinking the script should look something like this:

sdePath = r"Database Connections\Connection to thedatabase.sde"
mxd = arcpy.mapping.MapDocument("CURRENT")
for df in arcpy.mapping.ListDataFrames(mxd):
    for lyr in arcpy.mapping.ListLayers(mxd, ""):
        if lyr.isFeatureLayer == True:
            lyr.replaceDataSource(sdePath, "SDE_WORKSPACE", "")
del mxd

I run the script and it's loading, but nothing happens. No error or anything, and no change in data sources. I realize I have to get the name change in there somewhere, I just don't know where and how.


texts: Download WFS features as shapefile using ArcGIS Server

texts:
I've been looking everywhere for a way to output a shapefile in ArcServer. A sample ArcServer WFS GetCapabilities response says all the output is either in GML, KML, or JSON.

This is is very easy using GeoServer:

http://localhost:8080/geoserver/bw/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ws:layer&outputFormat=SHAPE-ZIP&

Is there an external library I could install on the server-side that would add SHAPE-ZIP to this list?

I'd like to refrain from writing VB.NET / C#.NET, Python, or ogr2ogr to change between file formats.


texts: Calling LineString.closestPoint or LineString.project methods from Python?

texts:
I'm trying to use the GEOS library from Python, specifically via Django (django.contrib.gis.geos).

Looking at the GEOS documentation, there are two methods on LineString I want to call that aren't available from Python: project and closestPoint.

Is there any reason why they're not available? Can they be added to the Python bindings?

As far as I can tell, they're in /usr/lib/libgeos_c.so.1.6.0, is there a way to call them directly if they can't be added to the library?


texts: Is it possible to use a boolean as an input and if it is true then the field will be created?


texts: An error while loading a KML file from distance and area measurement application unto the QGIS

texts:
I am trying to load a KML file from distance and area measurement application onto QGIS. The problem I encounter is that I receive an error saying:

Invalid Data Source:C:\Users\user003\Desktop\files\Farm_1.kml is not a valid or recognized data source


texts:
I have installed QGIS 2.4 with the stand alone installer and the OSGeo4W too on three different computers. Two have Win7 64 and one vista 64. It seems that the OpenLayers plugin does not work any more. What I did was the following:

1) Open a GPX file with GPS tools

1.1) Once I converted the GPX to .shp and declare that I wanted the data in EPSG:4326

2) Tried to use OpenLayers plugin either with the GPX file or the .shp (in a new project)

This is what I get:

Python Warning

warning:C:/Users/Mapoteca/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py:146: DeprecationWarning: QgsMapCanvas.mapRenderer() is deprecated

if rendererContext.painter().device().logicalDpiX() != int(self.iface.mapCanvas().mapRenderer().outputDpi()):

traceback:  File "C:/Users/Mapoteca/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py", line 109, in draw
self.render(rendererContext)

Python Error (same message on another computer)

An error has occurred while executing Python code:

Traceback (most recent call last):
File "C:/Users/Mapo/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py",
line 109, in draw
self.render(rendererContext)
File "C:/Users/Mapo/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py", line 158, in render
for res in self.resolutions():
TypeError: 'NoneType' object is not iterable`

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version:
2.4.0-Chugiak Chugiak, 8fdd08a

Moreover I uninstalled the OpenLayers Plugin, since I wanted to reinstall it, but it is no longer on the list.

My question is if the plugin is not compatible with QGIS new version or this behaviour is just happening on my machines.

I have a 2.3 version and it shows the same symptoms.


texts: arcpy.ListFeatureClasses() not respecting feature_type keyword default?

texts:
I am using ArcMap Version 10.6.

I am having a problem with the ListFeatureClasses() function in arcpy. I am wanting access to all the feature classes in my datasets within a geodatabase.
The following code when run only gives me access to the feature_type="Point"

def geoProcessing(database):
        ap.env.workspace = database
        datasets = ap.ListDatasets("*", feature_type="Feature")
        for dataset in datasets:
            for fc in ap.ListFeatureClasses(feature_dataset=dataset):
                do stuff…..

When I specify a feature type such as "Polygon" it gives me access to the polygon type feature classes.

def geoProcessing(database):
        ap.env.workspace = database
        datasets = ap.ListDatasets("*", feature_type="Feature")
        for dataset in datasets:
            for fc in ap.ListFeatureClasses(
                         feature_type="Polygon",feature_dataset=dataset):
                do stuff…..

Does anyone know what the problem is? It doesn't seem to make sense. I have tried including a wildcard and that doesn't fix the issue.


texts: Display multiple pop-ups when superposition of polygons with Openlayers

texts:
I have a map with polygons vector objects.

Superpositions can exist between the polygons. That is to say a bigger polygon is sometimes completely above a smaller one.
With Openlayers, is it possible to display two pop-ups instead of only one (the 1st pop-up being related to the polygon above, the 2nd being related to the polygon on the bottom) ?  Or one pop-up containing the attributes of the two polygons ?

I looked for infos but didn't find a lot of stuff on that. There is that subject (https://stackoverflow.com/questions/43859364/display-multiple-wfs-layers-with-popup) but no answers.


texts: Python script to copy first row of certain attributes and paste in the newly digitised rows the copied features

texts:
Starting from this question, I need a script to be insterted in the processing graphical modeler that can copy some attributes from the first digitised row in all the newly digitised lines of a polyline vector layer. As said I don't need to copy all the attributes, just 8 attributes (column names are: ALT_0, ALT_1, ALT_2, ALT_3, ALT_4, ALT_5, ALT_Ideale and ALT_propos)

The script has to produce an output in order to be inserted in the next algorithms of my model.


texts: PyQGIS writeAsVectorFormat into SQLite SpatiaLite database

texts:
I am relatively new to PyQGIS and am attempting to save a SpatialLite layer into a new layer (preferably in the same database) with a different CRS (I had it working in shapefile but have had to move the data to SpatialLite which I have not used before).
I keep on getting errors about the types of my variables, but am unable to figure out how else to do it and I can't find an example online which says what each of the variables are when exporting to SQLite.
layers = QgsProject.instance().mapLayersByName('SiteCard_AMG')
layer = QgsVectorLayer(layers[0].dataProvider().dataSourceUri(), '', 'ogr')

crs=QgsCoordinateReferenceSystem("epsg:4326")

error = QgsVectorFileWriter.writeAsVectorFormat(layer, 'C:\\Users\\Megan\\Documents\\new.sqlite', 'utf-8', crs, 'SQLite', False, None, ['SPATIALITE=YES'])

error as follows;
Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "<string>", line 47, in <module>
TypeError: QgsVectorFileWriter.writeAsVectorFormat(): arguments did not match any overloaded call:
  overload 1: argument 7 has unexpected type 'NoneType'
  overload 2: argument 4 has unexpected type 'QgsCoordinateReferenceSystem'
  overload 3: argument 3 has unexpected type 'str'


texts: What is the math behind Avoid High, Medium, low in Network Analyst and can it be changed ?

texts: When you are creating the network, in the attribute section you can define restrictions. Of such restrictions are Avoid High,Medium, Low and Prefer High, Medium, Low can someone mathematically explain what happens here and if it can be altered? I couldn't find info elsewhere.


texts: Using "select feature" to show attributes in QGIS?

texts:
Is there a way to show the sum of certain attributes of the selected features?

for example, I'm selecting several buildings each having a number of users, selecting the buildings only shows their number, and what I do is copy the data and paste them into an excel sheet and then use an autosum formula to obtain the result.

Any ideas to solve this?


texts: How to save color VALUE to attribute table in QGIS for a vector layer with a graduated symbol renderer

texts:
I am trying to achieve this -> How to copy the color styling to a color column in a layer's attribute table?

script by @Germán Carrillo

prefix = "'"
layer = iface.activeLayer()
attr = layer.rendererV2().classAttribute()
attrColor = 'color' # Name of the field to store colors
fieldIndex = layer.dataProvider().fieldNameIndex(attrColor)
attrFeatMap = {}

for cat in layer.rendererV2().categories():
  expr = "\""+attr+"\"="+prefix+unicode(cat.value())+prefix
  for f in layer.getFeatures(QgsFeatureRequest(QgsExpression(expr))):
    attrMap = { fieldIndex : cat.symbol().color().name()}
    attrFeatMap[ f.id() ] = attrMap

layer.dataProvider().changeAttributeValues( attrFeatMap )

but after using that script I am getting an error

Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'QgsGraduatedSymbolRendererV2' object has no attribute 'categories'

because it is for a layer classified with a Categorized Symbol Renderer.

So problem is that I can use this script only with random color...
But how to make same thing gradient colors like ndvi -1 / 1

could this help me? -> http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#graduated-symbol-renderer

First time working with python.....

EDIT: Qgis 2.10.1 - PISA
EDIT: Iam adding picture


texts: In ArcGIS there is a Erase Point tool how can this be done in R

texts:
I have a SpatialPolygoneDataFrame and a SpatialPointsDataFrame I would like to erase the points inside of the polygon, Keeping only the points outside and all of the data. I am new to GIS in R moving from ArcGIS and arcpy.

This is what the Erase Points tool does in ArcGIS 10.4 can this be done in R
http://desktop.arcgis.com/en/arcmap/10.3/tools/editing-toolbox/erase-point.htm


texts: Creating cost surface for least cost water transport analysis?

texts:
I am working on a project to derive least cost pathways between sites by dug out canoe travel.

Has anyone worked on a similar project or found a function like the Tobler hiking function that can be used for water transportation?

I am hoping to use ArcGIS 10.1 but I would be open to shifting to GRASS if that increases my options or coding with python.


texts: Trouble with Request URLs sent by QueryPanel.js

texts:
I use the GeoExt QueryPanel, which I got working so far. I configured an osgeo proxy on my Apache Server, I use the override-ext-ajax.js and have the OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; class configured. My problem is the following: When the QueryPanel.js sends requests to geoserver, it uses wrong URLs which I figured must be related to the QueryPanel.js file. The sent request URLs look like this:

http://localhost/cgi-bin/proxy.cgi?url=
http%3A%2F%2Flocalhost%2Fcgibin%2Fproxy.cgi%2Fwfs%3F
VERSION%3D1.1.0%26REQUEST%3DDescribeFeatureType%26TYPENAME%3Dcases%26query%3D

The request is sent via the proxy.cgi twice. The request URL should rather look like this, going passed geoserver´s WFS:

http://localhost/cgi-bin/proxy.cgi?url=
http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwfs%3F
VERSION%3D1.1.0%26REQUEST%3DDescribeFeatureType%26TYPENAME%3Dcases%26query%3D

When using firebug, I can temporarily change the URLs and make the queries work! When replacing line 182

url: Ext.urlAppend(protocol.url, Ext.urlEncode({

with

url: Ext.urlAppend("http://localhost/geoserver/wfs", Ext.urlEncode({,

the describeFeatureType requests are sent the right way, but attribute queries are still using the wrong URL (localhost/cgi-bin/proxy.cgi/wfs instead of localhost/geoserver/wfs). I can´t find the responsible line for the query URLs and I´m also not really sure what to replace, since I´m quite new to JS & GeoExt. If it´s not possible to fix my problem that way, can you see another method to fix this problem?


texts: Can I use areal mean pixel value in raster for input to Extract Values to Point tool

texts:
I have a dataset consisting of a point vector file (plant leaf area) overlaid and georeferenced to a raster file (soil moisture) that I want to use as inputs to the Extract Values To Point Tool in ArcGIS 10.3. I want to investigate correlation between soil moisture values and plant leaf area.

Is there a way to take the mean raster values of areas (defined by coordinate bounding box or radius circle) whose centerpoints correspond to the locations of the point features, and use those values as the raster input? Comparing the mean value for a given area corresponding with the plant location strikes me as a more robust, and less computationally intensive, approach.


texts: How to convert Raster to points in MapInfo?

texts: I wanted to convert Raster data to point data in MapInfo.Does there any tool to convert? can anyone help me?


texts: Driving directions and multi-modal route planning service for a city with OpenStreetMap data

texts:
First off I'd like to mention that I've never come close to anything-GIS until a few weeks ago when I thought of this. So please expect some layman's questions. I'm looking to create driving directions and public transport planning service for my home town in Asia.

Currently, the city has decent coverage in Google Maps (I'd say about 70-80% accurate and recent) while not too great coverage in OpenStreetMap though - about 80% that of Google Map. I'm leaning towards using OSM data to go ahead mainly because:

OSM data seems flexible enough and available readily that modifications/contributions could be done easily.
Quite a fair amount of GIS tools support OSM data.
I believe in contributing to projects like OSM.
Current budget won't fit into getting a Google Maps license (if that's even necessary in the first place)

I've thought of a fairly naive blueprint for the project. Please do point out if anything is amiss or outright impossible.

Serving maptiles

As much as I like OSM, the tiles aren't smooth for the eyes. Found a few solutions for this: MapBox, CartoDB or TileStream by MapBox.
Given that the city as well as the country's international internet gateway isn't anything spectacular, I'm more inclined to deploy TileStream at a dc inside the country. This means TileStream will most likely be the choice. I suppose the process will be OSM (import to postgresql) -> TileMill with OSM Bright -> Export MBTiles -> Tile Stream.
I'll probably go with ModestMaps for JS lib as I have some experience with it before.

Updating OSM data

iD by MapBox seems great for editing OSM. I'm not sure how long do the updates take to make it to public OSM data. I think I'll need to look into modifying iD to immediately update the local OSM data then update it online for others to see as well.
I'm looking to trace the maps using Bing aerial imagery. If I can stretch the budget, I'll hire a few part-timers to drive through parts of the city.
Are there any other tools you'd recommend? I looked at QGIS btw. It looks pretty great though a bit overwhelming for a first time user.

Routing engines

This is ridiculously complicated for me right now. So I've found out I'd need at least two engines: a shortest/fastest path route engine (pgRouting, OSRM) and a multi-modal planner (OpenTripPlanner, GraphServer) for public transport. I probably shouldn't complain about not being able to find documentation/guides/references for certain projects as I'm not too familiar with all these for now.
No public transport data is available for the city. I'll need to talk to the few operators on ground and gather the info myself. No live feed whatsoever expected in the near future.
Which engine would be suitable in your opinion? Or am I even asking the right question?

Reading PostGIS in Action hoping it'll help me speed up. Anything else recommended for reading? I'm running this out of my pocket as of now. Probably can't hire a professional just yet. I do hope to talk to a few people with deep pockets in the near future. But it's just a thought.

If I didn't make any sense, it is because I am quite clueless at the moment.


texts: Zonal statistics error: 0-d arrays can't be indexed

texts:
How can I fix the error 0-d arrays can't be indexed?

This message appears after the tentative to use the algorithm Qgis Zonal Statistics.
Detail: the algorithm worked very well several times and then failed irreversibly.


texts: Description is grayed out in Layer List -- ArcGIS Online

texts:
I am trying to add layer descriptions for a GIS application in ArcGIS Online.

However, when I try to add a description, the option is grayed out in the legend drop-down menu.

Is there a way to enable the descriptions?


texts: Starting QGIS 3.4 with own startup.py faults on Mac OSX Catalina

texts:
Created file startup.py:

from qgis.core import *
QgsApplication.setPrefixPath('/Applications/QGIS3.app/Contents/MacOS', True)
qgs = QgsApplication([], False)
qgs.initQgis()
qgs.exitQgis()

and saved in "Library/Application Support/QGIS/QGIS3" (The example taken from PyQGIS Cookbook).

Trying to start QGIS 3.4 under macOS Catalina I get a message in separate window "No Data Providers:

No QGIS data provider plugins found in:

No vector layers can be loaded. Check your QGIS installation.

After I close this window QGIS crashes.
If I delete startup.py QGIS starts it's right way.

What is the reason of that error?


texts: Changing color of raster images based on their data values - gdal

texts: Let's say I have 1 band raster images with Gray Color Interpretation and I want to change their color based on their data values. Data values -1, will be Blue, -0.5 will be Light Blue, 0 will be Yellow, 0.5 will be Orange and 1 will be Red. If the data values are <-3000, I want to have that colored Black and if the data values are >3.402, that should be colored White . Will that be possible in gdal? And process that in batch?


texts:
I'd like to increase the space between the symbol and the text for only one item in my legend; I can only seem to increases for all the items.

Specifically, I want to combine the two screen shots such that the labels for all items except GNSS = Figure 1 (left) and the GNSS label = Figure 2 (right).
Similar to Manage space in legend print composer QGIS but would like to avoid using two legends.

Figure 1
Figure 2


texts: Importing GPS coordintates in Decimal Degrees with N and S at the end instead of + or -

texts: I have a CSV file with GPS coordinates formated in decimal degrees. Instead of using negative symbols for south hemisphere and east of the prime meridian coordinates some of the coordinates shows a N or S, E or W letter after the decimal degrees. QGIS is only plotting XY coordinates without letter characters. Any idea how to have QGIS recognize both formats?


texts:
I am a software developer, and have installed Geoserver to serve Links (Geojson) data in my application as image tiles to frontend.

I have found TMS service of Geoserver which serve image tiles in  {z}{x}{-y} format, as it is TMS it follows bottom left grid style so {-y}

Here is my Geoserver TMS URL "http://localhost:8080/geoserver/gwc/service/tms/1.0.0/test:Curb_Segments@EPSG%3A900913@png/{z}/{x}/{-y}.png"

My Question:

I want XYZ tile service form Geoserver. Does Geoserver support XYZ tile service ?. format   {z}{x}{y} not {z}{x}{-y} which TMS.

If yes ?. Please provide a sample URL as above I provided.

My Research

Found Geoserver blob store which has slippy(XYZ), I have configured it to my layer but did not work for me.


texts: Grass Gis r.viewshed how i can set max distance in meter or kilometer?

texts:
I have a problem with the r.viewshed max distance
wiki: "The value entered is in the same units as the cell size of the raster. "
Work: I get one geo file and where I run a viewshed with radius x(measure)
I do not know which projection and therefore which size the cells have. Perhaps one cell is 1m, 1km or 1 mile.
Is there an option for me to setup the unit in meter or kilometer beforehand?


texts: Reading or creating empty shapefile in R

texts:
I have several polygon shapefiles that I need to merge into one using a loop in R.
I want to start with an empty shapefile and merge it with the existing shapefiles. All shapefiles will be chacked before the merge that they have the same fields.
I can think of two options:

create an empty shapefile in ArcMap and read it into R.
I tried this with readOGR and got an error:

library(rgdal)
EI_GIS_ALL = readOGR(dsn = EI_GIS_ALL_dsn, layer=EI_GIS_ALL_FileName)
Error in readOGR(dsn = EI_GIS_ALL_dsn, layer = EI_GIS_ALL_FileName) :
  no features found

Create an empty shapefile in R and use union to merge it with existing shapefiles.
The union is like in maycca's solution in Merging multiple SpatialPolygonDataFrames into 1 SPDF in R?

Any suggestions?


texts:
I have a GeoTIFF file which when imported using rasterio get flipped on the y-axis, and now I am trying to rotate this GeoTIFF file using NumPy rotate, it gives an error (Axes=(0, 1) out of range for array of ndim=0)
rf = rasterio.open(r'C:\Users\NESAC\tp.geotif')
fig, ax= plt.subplots(1,1)
show(rf, ax = ax, title = 'temperature')
rot = np.rot90(rf, k=3)


texts: PostGIS layer works in Mapserver 6.4 but fails in 7

texts:
I have the following layer defined in a mapfile:

            LAYER

                NAME "aggregates"
                #STATUS OFF
                TYPE POLYGON
                CONNECTIONTYPE POSTGIS
                CONNECTION "host=localhost port=5432 dbname=*** user=*** password=***"
                DATA "geom FROM (SELECT b.geom AS geom, a.peril_id, a.portfolio_id, a.tiv, a.thematic_tiv, a.aggregates_id FROM schema.aggregates a INNER JOIN gisdata.adm_1 b on a.gid = b.gid) AS c using SRID=4326 using unique aggregates_id"

                PROJECTION
                    "proj=longlat"
                    "ellps=WGS84"
                    "datum=WGS84"
                    "no_defs"
                END

            END

This works in Mapserver 6.4. However, when I try to use this with Mapserver 7, I get the following errors logged when I try to generate tiles:

            [Wed Jun  7 03:42:43 2017].502983 msDrawMap(): rendering using outputformat named png (AGG/PNG).
            [Wed Jun  7 03:42:43 2017].503018 msDrawMap(): WMS/WFS set-up and query, 0.000s
            [Wed Jun  7 03:42:43 2017].523359 msPostGISLayerWhichShapes(): Error (ERROR:  syntax error at or near ")"
            LINE 1: ...2300166285,129.462890606979 36.6292300166285))',4326) and ()
                                                                          ^
            ) executing query: select "thematic_tiv",encode(ST_AsBinary(ST_Force2D("geom"),'NDR'),'hex') as geom,"aggregates_id" from (SELECT b.geom AS geom, a.peril_id, a.portfolio_id, a.tiv, a.thematic_tiv, a.aggregates_id FROM portfolios.aggregates a INNER JOIN gisdata.adm_1 b on a.gid = b.gid) AS c where geom && ST_GeomFromText('POLYGON((129.462890606979 36.6292300166285,129.462890606979 68.6423395678331,179.999999974944 68.6423395678331,179.999999974944 36.6292300166285,129.462890606979 36.6292300166285))',4326) and ()
            [Wed Jun  7 03:42:43 2017].523377 msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs
            [Wed Jun  7 03:42:43 2017].523434 msDrawMap(): Image handling error. Failed to draw layer named 'area_aggregates_tiv'.
            [Wed Jun  7 03:42:43 2017].523927 msFreeMap(): freeing map at 0x560aa573b6c0.

I'm sure something's changed in the way I'm supposed to configure the mapfile, but I can't figure out what it is.

EDIT: I've tried eliminating the joins by creating a table with all the necessary data. In this case, I have:

            DATA "geom from portfolios.area_aggregates_join using SRID=4326 using unique aggregates_id"

Yet I still get the same error. That "and ()" at the end of the final query that's causing the syntax error is bothering me.


texts: Masking out shadows in Sentinel images using Google Earth Engine?

texts:
This question is an addition to this answer to Creating Sentinel-2 cloud free, cloud-shadow free composite or scene on Google Earth Engine (GEE)?

There Rodrigo E. Principe showed how to mask out the clouds. I am wondering if there is a way to mask the shadows as well. And, if possible then not only the shadows of the clouds but also, shadows in rugged topography.


texts: ogr2ogr: Can I add a field when I import to PostGIS?

texts:
I have a bunch of GeoJSON files that I want to import to a PostGIS database.

I can import individual files perfectly as follows:

ogr2ogr -f PostgreSQL PG:"host=x user=x dbname=x password=x" myfile.geojson -nln my_table

But as I import them, I want to add an extra column to these rows in my_table for the filename, so that I know which source file each field came from.

Is this possible using ogr2ogr?


texts: Creating TIN in ArcGIS from 5 points using VB.NET?

texts:
I am asking this question as I do not have any experience in VB.NET coding. I tried to follow ESRI help but I did not quite understand it. I have 5 points with X,Y and Z dimensions.

How to add these 5 points to make a TIN?

I want VB.NET code.


texts: Background map as open data from geoserver

texts:
I'm in the process of opening up as much data to the public as possible.
I've been told to open up for the background map (tiles?) which is used from a geoserver(.org), so others can use the maps/tiles? for their own projects.

Which way would be the best way to do it? Is it a collection of images which should be exported, is it some sort of vector-graphics or documents which can be exported or...?

I really do hope such a question is OK, I'm in no way a GIS expert (or GIS-user for that matter).


texts:
Our GIS Server setup includes 1SOM and 2SOC servers. I am getting this error in Server log. I have tried several settings but none seem to fix the issue, looking for  some feedback on what is the actual fix.

Error1:
Server Object instance creation failed on machine

Error2:
Server has no associated SOC machines or all SOC machines are at capacity. Add a SOC machine or change the capacity of the available SOC machines

Thanks
Jay


texts: Install OTB (Orfeo Toolbox) for Qgis Wien (2.8) on Ubuntu 15.04

texts:
I want to install OTB in Ubuntu 15.04.

The unstable Ubuntugis is installed, but OTB itself is not available as package.
I tried sudo apt-get install otb-bin otb-bin-qt python-otb

and get:

'Package otb-bin is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package otb-bin-qt is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'otb-bin' has no installation candidate
E: Package 'otb-bin-qt' has no installation candidate
E: Unable to locate package python-otb'

The "standalone" Monteverdi is an option, but I'd rather see it integrated in Qgis.
Is there an other unusal way to install the OrfeoToolbox?


texts: Lasclip produces overlap with non-overlapping shapefiles

texts:
Using a set of non-overlapping polygons (sf object) to clip a LAScatalog or LAS object creates an overlapping set of LAS files. I think the overlap is due to the use of the bounding box of the shapes rather than the shape itself but I'm not sure. Are the resulting las files really overlapping? Or are they just appearing as such due to the use of the bounding box?

clip shape:

> wp_shape
Simple feature collection with 25 features and 5 fields
geometry type:  POLYGON
dimension:      XY
bbox:           xmin: 563164.3 ymin: 4868599 xmax: 563346 ymax: 4868781
epsg (SRID):    26918
proj4string:    +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
First 10 features:
   id comp_id    area subplot_id PLOT_ID                       geometry
1   1      20 335.285         12   20_12 POLYGON ((563307.7 4868739,...
2   2      20 335.021          6    20_6 POLYGON ((563346 4868725, 5...
3   3      20 353.954         11   20_11 POLYGON ((563299.2 4868717,...
4   4      20 358.526          5    20_5 POLYGON ((563321.1 4868710,...
5   5      20 342.092          4    20_4 POLYGON ((563313.6 4868688,...
6   6      20 346.649          3    20_3 POLYGON ((563304.9 4868666,...
7   7      20 340.926          2    20_2 POLYGON ((563297.7 4868644,...
8   8      20 338.967          1    20_1 POLYGON ((563289.8 4868622,...
9   9      20 366.296         10   20_10 POLYGON ((563291.6 4868696,...
10 10      20 366.606          9    20_9 POLYGON ((563283.4 4868675,...
> plot(wp_shape$geometry)

LAScatalog and clip shape overlay:

resulting clipped LAS files:

> clipped_ctg <- readLAScatalog("~/Downloads/wp_plots/")
# Be careful, some tiles seem to overlap each other. lidR may return incorrect outputs with edge artifacts when processing this catalog.
> lidR::is.overlapping(clipped_ctg)
# [1] TRUE
> plot(clipped_ctg)


texts: Distance Matrix of Shortest Paths from all m points to all n points through a network

texts:
This question was asked many times and I could reference endless GIS-SE links here. Most of them suggest using pgRouting, which is not an option here. I have to use QGIS (for other technical questions). Others suggest QNEAT3 plugin, which is not working as expected (see here).

So I'm looking for a definitive answer, which can be referenced forever here and put an end to new ones (and, of course, put an end to my recurrent problem). I know it is possible to have a purely QGIS-based answer, as pointed out in the documentation. With my somewhat superficial python knowledge, I can't do it myself, but I know it's possible.

Problem

I have three layers:

m points in a map layer origins;
n points in a map layer destinations;
k arcs/paths/lines in a map layer network;

I need a distance matrix of shortest paths from all m points to all n points through that network.

Almost a solution

The Shortest path (point to layer) tool is the closest solution you can readily have. Except by the fact you have to manually input the from coordinates picking it from the map. This can be really painful if you have 100+ from origins to calculate.

Easiest solution I can foresee

use the Shortest path (point to layer, dijkstra method) tool iterating through all records of the origins map layer getting its coordinates and processing it in a loop.

Some test datasets

https://github.com/jecogeo/network_analysis_test_dataset

The problem is how? I'm relatively new to QGIS and I'm not sure how to build a model or modify the native tools. Any insights are much appreciated!


texts: WHERE query when creating layer in MapServer

texts:
Is there a way to have WHERE clause when you're querying for PostGIS data on MapScript? like, geom FROM country WHERE country = 'usa' USING unique gid.

My current workaround is by creating VIEW.


texts: How to extract zones that are contained in bigger zones from two different layers

texts:
I am newbie in QGIS. I have two layers lets say X1 and X2. The X1 is used as a background and consists of more zones than the X2 layer.

For istance in the pic below zone 117 of the X1 layer, contains many smaller areas of the X2 layer. I would like to create a table with all the small areas contained in the zone 117.

How can I do it in QGIS?


texts: How to separate and get geographic area info from planetosm

texts: I have planetosm data file which is nearly 18GB now i need to seperate and get only my country details. Is there any way to seperate that data from osm file? I'm using OSGEO 6.05


texts: Incorporate location selection drop-down widget into split panel Earth Engine App

texts:
I am relatively new to using the ui module for creating Earth Engine Apps. I used the split panel code from the Earth Engine example apps https://google.earthengine.app/view/split-panel to create my own version for viewing NAIP imagery over time.
I am interested in taking this a step further, where I can add in a drop down widget that will allow my end users to select different locations, and the app will subsequently zoom to their selection. I am using a FeatureCollection of locations from which I derive the list for selection.
I have found a snippet of code which is getting me closer to what I am looking for (https://code.earthengine.google.com/2217e2c7de9571f3177fd7acdbdfd516) and I have added it underneath the split panel code. The panel and widget look good, but I am unable to get the app to zoom in to the location of interest. I believe it has to do with the callback function for the location selection widget, but I am uncertain exactly how to get this part of the script working correclty.
Would anyone happen to have a solution?


texts: Is it possible to import Ozi Explorer waypoints with background and foreground colours to QGIS?

texts:
OziExplorer allows one to create waypoints with a range of background and foreground colours.  I use this to classify and display waypoint properties by various background and foreground colours.
If I export a Shapefile of the waypoints from OziExplorer, they import fine into QGIS with correct location, but without any colour data.

Even if the colour data could be imported in the Shapefile, is there any way it could be used to create similarly displayed waypoints in QGIS?


texts: Measurement accuracy for small distances - geodesic vs. planar UTM WGS84

texts:
Does anyone know how accurate geodesic measurement is compared to planar measurements in UTM WGS84 for distances below 15km? We'd like to inform our users about measurement accuracy when using tools based on geodesic measurements. Some of these measured distances are critical because we have to comply with margins regulated by law.

Some tests (3km line drawn in UTM32 WGS84 and measured geodesic) have shown that the difference can be up to 0,5%. Can anyone confirm this? Maybe based on literature or formula? I couldn't find anything in the Internet...

Or am I completely wrong and both measurements have to be identical within one UTM zone because they are based on the same ellipsoid (WGS84)?


texts: Pixel-based calculation of valid observations in Landsat ImageCollection

texts:
I am trying to calculate an ee.Image() object that contains the number of valid (= unmasked) pixels of a given Landsat ImageCollection. Originally I thought a simple ee.ImageColllection.count() would do the job, but as the function treats each image independently of the observation date, the areas where the WRS rows in the Landsat tiles overlap are counted twice. My intention on the other hand is to retrieve a date dependent information of valid pixels.

Given that I have tried the following:

var imgCol_L8_SR = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
          .filterBounds(ROI)
          .filter(ee.Filter.calendarRange(year_start,year_end,'year'))
          .filter(ee.Filter.calendarRange(month_start,month_end,'month'))
          .filter(ee.Filter.lt('CLOUD_COVER', cloud_cover))
          .map(maskL8SR);

// initial Image in list
var ini =ee.List([
  imgCol_L8_SR.select('B1').max()
    .remap([0], [0], 0, "B1")
    .rename('NOBS').int16()
]);

var fun_nobservations = function(date, previous) {
  // Cast
  date = ee.Date(date);
  previous = ee.List(previous);
  var filtered = imgCol_L8_SR.filterDate(date, date.advance(1,'day'));

  // count valid observations per pixel:
  var mask = ee.Image(filtered.count());

  // set valid obs. in overlap back to 1:
  mask = mask.where(mask.gt(1), 1);

  var sum = mask.add(previous.get(-1));
  return ee.Algorithms.If(filtered.size(), previous.add(sum), previous);
};

var start = ee.Date('1985-06-01');
var finish = ee.Date('2017-08-31');
var diff = finish.difference(start, 'day');
var range = ee.List.sequence(0, diff.subtract(1))
                   .map(function(day){return start.advance(day,'day')});

var nobs = ee.Image(ee.List(range.iterate(fun_nobservations, ini)).get(-1));

It counts the number of valid pixels dependent on the date and sums the single image layers iteratively in a list. The problem here is that given the study area size and the time-interval I run into a user memory exceeded error.

Any ideas on how this could be approached differently?


texts:
I'm investigating how we can improve our vector-layer performance of our GIS component (based on openlayers 4).

OpenLayers keeps all the fetched vector features in memory. This becomes a problem when you are panning around a lot, because you start to feel a noticable delay when there are a lot of features loaded. (I reckon this is because OL has to access an ever growing collection). Especially in IE this becomes really bad, really fast..

Do you have some tips/thoughts?

I was thinking to periodically clear the layer source and ideally read repeat requests from the browser cache, but I find it hard to implement this.

Some concerns:

VectorTiles sound like a nice solution, but we can't use them because we need to be able to edit/snap/calculate overlap/.. to these layers
Since we use the BBOX filter to fetch data, I wonder if we can cache the request, since the BBOX will be slightly different each time
Right now we use POST requests for our WFS, because we allow our users to send quite large XML filters in request -> can we still use POST and caching? I've read that e.g. Firefox ignores all caching headers when you use POST..
Ideally we'd also like a way to "invalide" certain cached vectors, because they since have been edited

I find it a little strange that I can't find a lot of information about this on the internet, I'd assume that more people would have run into this problem by now.

Perhaps this could be fixed by using a custom loadingStrategy like they advise at WFS Caching / Back button


texts: Fixing "You don't have permission to access /qgis-ltr/qgis_mapserv.fcgi on this server"

texts:
I installed QGIS server ltr 64 bit version from osGeo4W, then I installed Apache 64 bit httpd-2.4.29-Win64-VC15, along with mod_fcgid-2.3.9-win64-VC15, I followed the instructions on Adding QGIS Server to an existing Windows web server exactly,
still I am getting error: You don't have permission to access /qgis-ltr/qgis_mapserv.fcgi on this server

PS: the Apache server is running, I changed the corresponding changes in Conf files. I am trying to run all of this on one machine which has windows 10 on it.


texts:
I am working on a digitizing application that also lets users delete a layer’s attribute (i.e. properties) by selecting a property from a dropdown.

The workflow: a user selects a feature (someFeature) by clicking it on the map and selects a property of that feature in a dropdown (removeProperty).
Now removeProperty should be removed from someFeature.

var features = layer.getSource().getFeatures();

features.forEach(function (feature) {

    if (feature === someFeature) {

        var properties = feature.getProperties();

        for (var prop in properties) {

            if (properties.hasOwnProperty(prop)) {

                if (prop === removeProperty) {

                    delete feature.getProperties()[prop];

                }

            }
        }

    }

});

The problem is that the line delete feature.getProperties()[prop]; does not work to achieve this as getProperties() seems to simply return a new object from which the key is then deleted (instead of being deleted from the actual layer).

Using setProperties by assigning an object without the selected key also does not work as setProperties, as stated in the docs changes any existing properties and adds new ones (it does not remove any existing properties).

So, how can I remove a property?


texts:
First off, I'd like to mention that I'm pretty new to working with GIS, so please forgive my inexperience.

My situation is as follows: I'm tasked with georectifying a set of imagery and importing those images into a Google Earth Enterprise server as an overlay. From what I've researched, it sounds like a good route to do this would be to convert the images into a .tif, install GeoTIFF metadata, and import the image directly (Google Earth will figure out the rest). However, I'm not exactly sure where to go from there to actually create the GeoTIFF metadata (and install it).

Here's the data I have: lat/lon of the center of the image, orientation (i.e. degrees to rotate to orient north), and resolution (e.g. 90m). Does anyone know of a good method/set of tools to derive any other data and install it into the .tif? Is something other than a GeoTIFF a good idea?


texts: Re-arranging date to mm/dd/yyyy and skipping empty cells in ArcMap using ArcPy cursor?

texts:
I'm trying to get my code to re-arrange existing dates in the cell to mm/dd/yyyy and skip empty cells. I thought by putting if None: continue would work but it's not.

Any tips?

Here is my code and the result:

##location of your oilspills file
arcpy.env.workspace = r's:\User\Lab1'

##use an update cursor to update the values
updateCursor = arcpy.UpdateCursor('testfile (3).shp')

findEmpy = row.RPT_DTE
if findEmpty == None:
    findEmpty = '0' + str(row.RPT_DTE)
print findEmpty

#updateCursor.updateRow(row)

oldDate = row.RPT_DTE
if len(oldDate) > 0:
    newDate = oldDate.split("/")
    year = '19' + str(newDate[0])
    month = newDate[1]
    day = newDate[2]
    row.RPT_DTE = month + '/' + day + '/' + year
    print month + '/' + day + '/' + year

#updateCursor.updateRow(row)


texts: AGS10 Soap Geometry/Project function vanishes

texts:
So I am doing a pretty simple process that looks a lot like right out of the SOAP API/SDK for AGS10.

My webservices takes a Lat/Lon coord from a mobile app, I reproject it to Web-Mercator to identify against my mapservice data and return a result. Pretty simple, but for some reason that I am not seeing any place, the project method is returning blank, no exception raised, no errors on the server/service side.

            SpatialReference inputSpatialReference = new GeographicCoordinateSystem();
            inputSpatialReference.WKID = 4326; //WGS 84
            inputSpatialReference.WKIDSpecified = true;

            PointN llPnt = new PointN { X = lon, Y = lat, Z = 0 };
            llPnt.SpatialReference = inputSpatialReference;

            SpatialReference outputSpatialReference = new ProjectedCoordinateSystem();
            outputSpatialReference.WKID = 3857; //Web Mercator (Auxiliary Sphere)
            outputSpatialReference.WKIDSpecified = true;

            Geometry[] inputGeometry = new Geometry[] { llPnt };

            bool transformForward = false;

            GeoTransformation transformation = new GeoTransformation();
            // NAD1983_To_WGS1984_1
            transformation.WKID = 108100;
            transformation.WKIDSpecified = true;

            EnvelopeN extent = null;

            Geometry[] outputGeometry = geometryService.Project(inputSpatialReference, outputSpatialReference,
                                                                transformForward, transformation, extent,
                                                                inputGeometry);

            PointN wmPnt = outputGeometry[0] as PointN;

Now; when my defining my points works great; I am able to see the point, my X, Y and Z values as well as my existing coordinate system look great. So I define where my coordinates are going, to, define my transformation since I need to get from Lat/Lon to WebMercator and then after that, fire the GeometryService.Project call.

Now when I look at the output in the debugger of the outputGeometr the point is blank; not even the existing coordinates the new point is null.

So I look to the server, to see what it says; no errors listed, so I am very puzzled.

Any thoughts or suggestions?


texts:
I'm developing a product for offline use in Brazil in rural areas where there is no Internet connection. I'm searching for a free imagery source which can be used offline in a commercial product.

ESRI and mapQuestOpen are free but their agreements only allow online use.

Is there any free or open offline satellite/aerial imagery for commercial use?


texts: WCS GeoServer: Get subset of raster image

texts:
I know that WCS is used to get the "raw" data of a coverage (such as an image), but is it possible to download only a subset of the image, for example a block of pixel 1000*1000 from the original image?

If not, is there a another GeoServer interface for that?


texts: I have 10 multidate Cartosat-1 stereo pair derived raster DEMs of dates ranging over a decade over a river sand area. I want to derive volumes of sand deposited in that period within that area. Is it possible?


texts: I'm new to OSM. I'm building my own OSM Server (I'm using : https://github.com/gravitystorm/openstreetmap-carto), I would like to know how to display only roads on the map (remove the buildings, water and green lands).


texts: Interpolating raster without edge bleeding in GDAL/Python

texts:
I'm working with a raster that is loaded into a numpy array that has a bit of noise in it. The area that I'm interested in is a particular area in the center of the image, but not necessarily bound by a rectangle.

I need to interpolate (smooth) out the "particular area", but not have the edges bleed in. I've tried using the SciPy Gaussian Filter, but that takes values outside of the area desired and averages that into the image.

Is there some way to tell SciPy 0 is the nodata value and to disregard it? or is there a way better way that I'm missing?


texts: arcpy.Parameter : how to create "The interactive feature input control"?

texts:
I am using ArcMap 10.5, but help pages I am referring are the same as in 10.7.

I am trying to make a GP tool within Python toolbox with kind of selection input: user selects features in ArcMap interactively.

I was reading Using the interactive feature and record input controls and found that it's possible for GP tool to have such kind of parameter. Quote: "The interactive feature input control gives you two methods for inputting features to a tool—either by clicking on a map display or by providing an existing dataset."

OK, so I checked what parameter types I can create here: Defining parameter data types in a Python toolbox and it seems that Feature Set (GPFeatureRecordSetLayer) is what I am looking for as description says: "Interactive features that draw the features when the tool is run.".

Here is my magic tool, but I do not see any way to "enter features interactively":

class AttachTool(object):
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "Add attachments"
        self.description = "Adds the same file as attachment to multiple selected features"
        self.canRunInBackground = False

    def isLicensed(self):
        """Set whether tool is licensed to execute."""
        return True

    def getParameterInfo(self):
        """Define parameter definitions"""

        paramInputFeatures = arcpy.Parameter(
            displayName="Input Features",
            name="in_feature_set",
            datatype="GPFeatureRecordSetLayer", # Interactive features that draw the features when the tool is run
            parameterType="Required",
            direction="Input",
            multiValue = True)

        paramInputFile = arcpy.Parameter(
            displayName="File to attach",
            name="in_file",
            datatype="DEFile",
            parameterType="Required",
            direction="Input")

        return [paramInputFeatures, paramInputFile]

    def updateParameters(self, parameters):
        """Modify the values and properties of parameters before internal
        validation is performed.  This method is called whenever a parameter
        has been changed."""
        return

    def updateMessages(self, parameters):
        """Modify the messages created by internal validation for each tool
        parameter.  This method is called after internal validation."""
        return

    def execute(self, parameters, messages):
        """The source code of the tool."""
        arcpy.AddMessage('Just pretending to do something...')
        return

Input field looks like this and I don't see how I should select features...

PS. Copy on GeoNet: https://community.esri.com/thread/243774-arcpyparameter-how-to-create-the-interactive-feature-input-control


texts: Hide layer name in map legend using python in QGIS 2.16

texts:
I am trying to render the layer in QGIS as a map using python console.  I am using QgsComposerLegend() for drawing the legend in the map.

Is it possible to make the layer name hidden in the map legend using python console?


texts: Trouble interpreting zonal statistics as table output

texts:
Consider this a follow-up to this question.
I transformed a census block group vector map (decided to use this instead of census tracts) into a raster map and generated a kernel density map using supermarket points. Since I want the average density per census block group, I ran the Zonal Statistics as table tool and specified the value for different CBGs as the zone. Sample output is below.

My cell size is 10x10 and the projection unit is in feet (kernel density area units defaulted to square miles, I'm not sure how much this matters). My issue is that I'm not entirely sure what these numbers represent? Are they the average number of stores per 100 sq ft? And if yes, what number do I need for the cell size so that the mean represents the average density per square mile? I've read other materials trying to figure this out but it still isn't clear to me.


texts:
I have got a detailed CAD drawing (DWG format) showing a house plan and topographic survey. I want to use the heights from the topo survey to create a digital elevation map in QGIS.

I have tried a couple of converters such as DXFtoXYZ however cannot seem to work out how to create the DEM from this.

Does anyone have any suggestions/know how to create a DEM from DWG points?


texts: GRASS v.clean error in generating output layers

texts:
I am trying to run v.clean through GRASS 7.6.1 using QGIS 3.10 and Python 3.7 on a line shapefile. I have tried with the output both saving to a file location and as a temporary file, and the error is the same.

Input Parameters:

{ '-b' : False, '-c' : False, 'GRASS_MIN_AREA_PARAMETER' : 0.0001,
'GRASS_OUTPUT_TYPE_PARAMETER' : 2, 'GRASS_REGION_PARAMETER' : None,
'GRASS_SNAP_TOLERANCE_PARAMETER' : -1, 'GRASS_VECTOR_DSCO' : '',
'GRASS_VECTOR_EXPORT_NOCAT' : False, 'GRASS_VECTOR_LCO' : '', 'error' :
'TEMPORARY_OUTPUT', 'input' : 'C:/file.shp', 'output' : 'TEMPORARY_OUTPUT', 'threshold' :
'1', 'tool' : [1], 'type' : [1] }

Error message:

File "C:\Python37\Lib\site.py", line 177
file=sys.stderr)
^
SyntaxError: invalid syntax
Press any key to continue . . .
File "C:\Python37\Lib\site.py", line 177
file=sys.stderr)
^
SyntaxError: invalid syntax
Press any key to continue . . .
Execution completed in 2.32 seconds
Results:
{'error': <QgsProcessingOutputLayerDefinition {'sink':TEMPORARY_OUTPUT, 'createOptions': {'fileEncoding': 'System'}}>,
'output': <QgsProcessingOutputLayerDefinition {'sink':TEMPORARY_OUTPUT, 'createOptions': {'fileEncoding': 'System'}}>}

The closest answer I could find was an issue with using Python 2 instead of 3, but I am definitely using Python 3.7. I have had issues with that in the past, and made sure to run this both with my regular file names and renaming the path for 2.7 to be sure it's not accidentally using Python 2.


texts: QGIS drag-and-drop forms: move cursor to other field without mouse

texts:
When I create a form by 'drag and drop' design, the only way to go to another field is by mouseclicking in that field.

Is it possible to do the same action with the tab-button, as it does in an autogenerated form?

(QGIS 2.18.7, Windows 10)


texts: Action opening DWG file in Intellicad using file name in a attribute table

texts:
I have tried numerous variations in creating an action to open a DWG file in Intellicad after selecting a specific row in a table in QGIS.

I am quite frankly stumped at this point.

I have the DWG files associated with Intellicad, and can open them directly from Explorer.

I am trying to create a project management system in QGIS that will allow me to retrieve specific projects based upon various fields within the data table.

I have the folder location and name of the file I wish to open, as well as other pertinent information.

I highlight the row/field of the project I desire, right click, then Highlight the Open MSCAD file option in the dropdown menu.

I then click on that option and get the following error.

As I stated above, I have tried numerous options when trying to configure the actions including full file path and file extension for the executable, as well as other variations.

This is the actions page of the current properties for that layer.

Any suggestions?

QGIS 2.18.17 64 Bit, Windows 7


texts:
Ref to this: http://forum.openseamap.org/viewtopic.php?id=2060 and this: How to extract primary and secondary roads from OSM data? and this: http://wiki.openstreetmap.org/wiki/Seamarks/Seamark_Objects

I need to import all seamarks from my OSM planet data to my PostgreSQL OSM database, but I can't find the "seamark:type=*" tag in osm2pgsql default.style file.

Can someone show me an example line to write into default style (or osmosis parameter) to import this kind of data to PostgreSQL?


texts: XML ElementTree in ArcPy consuming WMTS XML

texts:
How do I work with the xml Element Tree to obtain the ScaleDenominator parent where ows:Identifier = default028mm?

With a fair bit of swearing I have managed to hack my way into all of the WMTS Scale's, I  noticed that the OGC ones list first, I've taken advantage of this. But I want to do it properly and read the OGC Scales only. Alas, I've hit a brick wall. Any ideas?

import arcpy
import urllib
import xml.etree.ElementTree as et

WMTS = urllib.urlopen("http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/WMTS/1.0.0/WMTSCapabilities.xml")
print "Started"

import xml.etree.ElementTree as et
tree = et.parse(WMTS,parser=None)
root = tree.getroot()
test = 0
MaxScale = 600000 #600K No Scales Above

for ScaleDenominator in root.iter('{http://www.opengis.net/wmts/1.0}ScaleDenominator'):
    Scale = float(ScaleDenominator.text)
    ScaleCon = ((Scale/90.7144671432)*95.9999999999)
    print 'WMST: ', ScaleDenominator.text
    print 'Esri: ', ScaleCon
    if test == 0:
        test = (ScaleCon+1)
    if test > ScaleCon:
        print 'OGC028:', ScaleCon
        test = (ScaleCon+1)
        if ScaleCon < MaxScale:
            print '< OGC028:', ScaleCon

WMTS XML:
National Map USGS Topo WMTS XML


texts:
Is there a way to export into KMl a geoserver layer?
I have used KML reflector but this doesnt return the whole content of the layer but a reference to it.
Alternatively can I get a KML of a layer using OpenLayers?


texts: ArcGIS Schematics - Preventing overlapping links and consistent layout?

texts:
I'm trying to recreate some network diagrams on a consistent basis based on our geometric network data.

The layout algorithms I'm selecting are getting me close but I can't seem to fine tune the layout task to generate a consistent diagram with the desired layout.

This is the approximate style I'm looking to recreate. The important part is the roughly even distribution of the links / branches.

This is roughly what I have going (some of the time) when using the Schematic Editor.

1A / 1B: These are links that overlap that should not.
2: This is a link that need not extend to the right at all. It would great if it was just a straight link downwards.
3: This branch is an example of where better placement would be on the other side of the main line.

I used a Composite algorithm of the following tasks:

Orthogonal
Relative - Main Line (using a line attribute)
Geo - Rotate Nodes Along Links
Separate Overlapping Links
Square Links
Bypass Nodes

Anyone have a clue as how these tweaks can be achieved?

(This is cross-posted on ESRI's Geonet)


texts:
I'm working with OpenLayers, I created a new plugin to perform a selection feature.
But every event I perform in my plugin button it creates a new layers. (Attached is a print).

Of the attempts that tried to make the removal of the layer were:

map.layers.remove (0);
map.layers.length;
map.layers.remove;

Can anyone help me ?


texts:
I have a 200 mile diameter circle in Google Earth.

I saved as a kml and imported into QGIS with the "add vector layer" and it was imported as WGS 84 GCS.

Now the Circle lines up on the correct coordinates but is an oval and measures east to west well over 270 miles however 200 north to south. Why do the Coordinates match but not the distance measurements? Does one program not account for curvature and the other not? What coordinate system do you use from google earth to Qgis to be able to maintain a circle a 200 mile diameter?


texts: Workflow for data expression in Arcade - generate elements from concatenated fields

texts:
I am familiar with Arcade for pop-ups and labeling, but new to using it for data expressions in the new AGOL dashboards.
I have dataset and I would like to generate dashboard elements based on the concatenation of two fields.
E.g. Field_1 has a domain with values 'A', 'B', and 'C', and Field_2 has a domain with values '1' and '2'. I would like to generate charts and other elements that summarize values 'A 1', 'A 2', 'B 1', 'B 2', etc. Due to the nature of the data these fields should remain separate.
Basic concatenation in other aspects of Arcade (pop-ups, labeling, etc), is straightforward:
Concatenate([$feature["Field_1"], $feature["Field_2"]], ' ')

What is the proper workflow for concatenating these fields and summarize for the entire featureset? You call the featureset...
var portal = Portal('https://MyPortal.maps.arcgis.com/');
var itemId = 'itemId';
var layerId = 0;

var fs = FeatureSetByPortalItem(portal, itemId, layerId, ['*'], false);

... and then I'm not sure.
Do you generate a dictionary of potential concatenated values?
It doesn't seem like you can create a new field and calculate values with a featureset, which is what I would do through a GUI.


texts: PostGis st_dwithin super slow when inserting

texts:
I am trying to insert the newly obtained data from st_dwithin into a new table.

However, it has been running since 1 day and I still can't get any data into the new table.

Can i know what is the problem?

When i do the select only, it took less than 10 seconds to return the result

sql> SELECT
            a.event_id,
            a.local_date,
            a.source,
            a.user_id,
            a.tourism_region_name,
            a.latitude,
            a.longitude,
            b.poi_latitude,
            b.poi_longitude,
            b.name,
            b.zip_code,
            b.city,
            b.group_designation,
            b.category_id,
            a.geom,
            b.geom
    FROM attraction_dwell_pre_2 a left JOIN tomo_poi_master_rto_sub2 b
        ON ST_DWithin(a.geog, b.geog, 200.00)

[2018-01-17 12:40:14] 500 rows retrieved starting from 1 in 792ms (execution: 621ms, fetching: 171ms)

Below is my code:

create table attraction_dwell_pre_3 as
(
   SELECT
            a.event_id,
            a.local_date,
            a.source,
            a.user_id,
            a.tourism_region_name,
            a.latitude,
            a.longitude,
            b.poi_latitude,
            b.poi_longitude,
            b.name,
            b.zip_code,
            b.city,
            b.group_designation,
            b.category_id,
            a.geom,
            b.geom
    FROM attraction_dwell_pre_2 a LEFT JOIN tomo_poi_master_rto_sub2 b
        ON ST_DWithin(a.geog, b.geog, 200.00)
);

*There are no index or primary key on the 2 tables


texts: ArcGIS Server - Map features received from html forms

texts: I would like to know if there is a way to send features data, such x and y coordinates and attributes properties, by a html form to ArcGIS Server in order to generate a map of these features.


texts:
In QGIS, I am trying to simulate some measures against erosion. One measure would be to install a drainage ditch at a contour line, where the slope goes from e.g. >30% to <30%. What I've tried so far:

calculate slope of the DEM
Raster calculator, such that I have a raster that's 0 wherever slope <30%, 1 elsewhere
SAGA buffer with a distance of 20m (grid resolution) to get a 1 pixel buffer

I'd get a boundary around the steep slopes. However, this boundary goes all around the steep parts.
How can I select the cells that are downslope the steep part?


texts:
I have a kmz file which I would like to convert to geotiff. Unfortunately, gdal cannot handle kmz files from the rack. Obviously, there seems to be a driver available on: https://www.gdal.org/drv_libkml.html

How do I build this driver and use it?


texts: Adding KML layer using ArcGIS API for Silverlight?

texts: I am trying to create a map which will include radar rainfall data in a KML format. How can I easily do this using the Silverlight API (the version doesn't matter)?


texts: Finding difference of two Google Earth Engine ImageCollections

texts:
I'm trying to take the difference of two separate ee.ImageCollections, each containing a timeseries of 23 images. One of the image collections is of 20-year mean NDVI, and the other is for a single year. I'm pretty new to GEE, so I'm probably making very silly mistakes.

The first bit was adapted from this great tutorial, and works as expected to create the two image collections (NDVImean and distinctDOY):

var col = ee.ImageCollection('MODIS/006/MOD13A2').select('NDVI');

// Define a mask to clip the NDVI data by.
var mask = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017')
  .filter(ee.Filter.eq('country_co', 'US'));

// Define the regional bounds of animation frames.
var region = ee.Geometry.Rectangle(-127.18, 19.39, -62.75, 51.29);

//*******Group images by composite date: *******

//grouping inter-annual image data representing the same 16-day composite window into lists
col = col.map(function(img) {
  var doy = ee.Date(img.get('system:time_start')).getRelative('day', 'year');
  return img.set('doy', doy);
});

//filter the complete collection to a single year of data
var distinctDOY = col.filterDate('2013-01-01', '2014-01-01');

// Define a filter that identifies which images from the complete collection
// match the DOY from the distinct DOY collection.
var filter = ee.Filter.equals({leftField: 'doy', rightField: 'doy'});

// Define a join.
var join = ee.Join.saveAll('doy_matches');

// Apply the join and convert the resulting FeatureCollection to an
// ImageCollection.
var joinCol = ee.ImageCollection(join.apply(distinctDOY, col, filter));

//******Reduce composite groups: ******
// The result is a new collection, with one image per distinct DOY composite
// that represents its 20-year mean NDVI per pixel.

// Apply mean reduction among matching DOY collections.
var NDVImean = joinCol.map(function(img) {
  var doyCol = ee.ImageCollection.fromImages(
    img.get('doy_matches')
  );
  return doyCol.reduce(ee.Reducer.mean());
});

I tried to use the same method to join the two new collections by date, before subtracting one from each other (so that each image is subtracted from the image of a corresponding date). Since there is no Reducer for subtraction, I tried a work around by first multiplying the distinctDOY by -1, and then using ee.Reducer.sum().

The results are clearly incorrect. I'm pretty sure it's something to do with either the filtering or sum reduction step, since everything looks as expected before that.

My code is:

//**** Find difference *****
// Join mean NDVI with individual year and convert to an image collection

// This function multiplies image by -1
var makeNeg = function(image) {
  return image.multiply(-1);
};

// Map the function over the collection
var neg = distinctDOY.map(makeNeg);

var compyear = ee.ImageCollection(join.apply(neg, NDVImean, filter));

// Apply sum reduction among matching DOY collections.
var NDVIcomp = compyear.map(function(img) {
  var doyCol = ee.ImageCollection.fromImages(
    img.get('doy_matches')
  );
  return doyCol.reduce(ee.Reducer.sum());
});

In case it's relevant, the code I'm using to visualize the results is:

// Define RGB visualization parameters.
var visParams = {
  min: -1000.0,
  max: 1000.0,
  palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ],
};

// Create RGB visualization images for use as animation frames.
var rgbVis = NDVIcomp.map(function(img) {
  return img.visualize(visParams).clip(mask);
});

// Create animated gif
// Define GIF visualization parameters.
var gifParams = {
  'region': region,
  'dimensions': 600,
  'crs': 'EPSG:3857',
  'framesPerSecond': 10
};

// Print the GIF URL to the console.
print(rgbVis.getVideoThumbURL(gifParams));


texts:
Does GeoPackage support topology?

I am looking for resources that discuss this topic in more detail.

I googled and did not come across good resources that discuss this question in detail. I could not find informations on this topic in the official webpage. I do not seem to be the only person who does not find any resources on this topic (see Seeking alternatives to Geodatabase to describe topological relations?). As I think that it is very important to know weather or not this format supports topology, I consider it to be an important question. Especially, since geopackage are considered to be an alternative for shapefile and latter is often criticized for not supporting topology.


texts: Add point on the editor toolbar is not available to click on?

texts: I have created a new shapefile, I chose a coordinate system and enabled the editor. When I now start editing and choose the new shapefile I created, it is not available to me to click add a new point. The button is just grey. Have I done something wrong when creating the shapefile?


texts:
When I click on Advanced Digitizing Panel, I get the message "CAD tools are not enabled for the current map tool"  What does this mean and how can I used the Advanced Digitizing tool?

I'm using QGIS 2.18.12


texts: Seeking syntax for adding query to spatial view from related table in ArcGIS Desktop?

texts:
I'm just learning SQL so apologies for the poorly worded question.  I'm basically trying to create a spatial view of hydrants that have been painted in 2018.  I have a hydrant feature class (wHydrant) and a hydrant maintenance table (wHydrant_Maint).  They are related by a common ID, although the names of the fields that contain the common ID are different.  Here are my first few lines that I can get to return a view of all my hydrants with maintenance records:

SELECT h.OBJECTID, h.FACILITYID, h.SHAPE
FROM wHydrant h
JOIN wHydrant_Maint r
ON h.FACILITYID = r.Hydrant_ID

My issue (well, my issue is that I don’t know or use SQL…) is that I don’t know how to start the next part of the statement.  I can do it using the definition query builder, no problem!  But creating the proper statement is alluding me.  I’m essentially trying to say: wHydrant_Maint.MAINT_ACTIVITY = 'Paint' and MaintDate > '2018’.  I thought I could just tack on a WHERE statement, but I think because it’s pulling from the related table that maybe there is additional syntax. I'm using ArcGIS 10.5.1 and a SQL Server Enterprise database.


texts: Where can DEM data for all of British Columbia be found?

texts:
Is there a website or server from which a DEM covering all of BC can be downloaded - preferably at 1:50K scale?

GeoBase has tiles for 1:50K and 1:250K, but they do not provide it as a mosaic. It's not very time efficient to download 1000+ tiles and mosaic them.


texts: How to create "Unique class values" in QGIS for quicker entries?

texts:
I am starting to learn how to create QGIS database for assignments at work, I know how to create query's that you can "search" the database for, but this not exactly what I want in QGIS.

I want to create shapefiles inside the database with created unique value, so entrys of new objects can be easier.
In ArcGIS desktop you had the option to create Domains, so you can setup specific values in Shapefile fields. So when you made the connection to that feature class field, you have those options to select from. For example, the author's are two people so you have two names in a list. Another example is the state of maintenance for a tree. It is that kind of stuff that I want because to make it possible for quick efficient entry's, so that so less much typing is possible. Is this possible or not in QGIS? And you can you "import" an excel table with such values?


texts: Algorithm r.reclass in QGIS gives same results with different reclass rules

texts:
I am trying to reclassify several rasters using the r.reclass algorithm from GRASS GIS 7, but I don't get the expected output.

My input rasters have values between 0 to 1 and NaN; and I am using 2 different reclass rules:

0.0 thru 0.24999 = 0.0
0.25 thru 1 = 1.0
* = NULL

and

0.0 thru 0.099 = 0.1
0.1 thru 0.199 = 0.2
0.2 thru 0.299 = 0.3
0.3 thru 0.399 = 0.4
0.4 thru 0.499 = 0.5
0.5 thru 0.599 = 0.6
0.6 thru 0.699 = 0.7
0.7 thru 0.799 = 0.8
0.8 thru 0.899 = 0.9
0.9 thru 1 = 1
* = NULL

After the execution of the algorithm (twice using the same input raster, only changing the reclass rule), I do obtain 2 reclassed rasters, but with only 2 categories (even though the second rule should give 10 categories), and the result is the same whatever the rule used.

During the execution of the algorithm, I do not get any error message, so I don't know how to fix the issue. If that's any help, I get the following log messages during the processing, but I do not know what to make of them.

Starting GRASS GIS...
Executing '/home/user/.qgis2//processing/grass7_batch_job.sh' ...

GRASS_INFO_MESSAGE(3977,1): Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default
GRASS_INFO_END(3977,1)

GRASS_INFO_MESSAGE(3977,2): Projection information updated
GRASS_INFO_END(3977,2)

GRASS_INFO_WARNING(3978,1): Over-riding projection check
GRASS_INFO_END(3978,1)

GRASS_INFO_MESSAGE(3978,2): Reading band 1 of 1...
GRASS_INFO_END(3978,2)

GRASS_INFO_MESSAGE(3978,3): r.external complete. Link to raster map created.
GRASS_INFO_END(3978,3)
0.500000 rounded up to 0
0.599000 rounded up to 0
0.600000 rounded up to 0
0.600000 rounded up to 0
0.699000 rounded up to 0
0.700000 rounded up to 0
0.700000 rounded up to 0
0.799000 rounded up to 0
0.800000 rounded up to 0
0.800000 rounded up to 0
0.899000 rounded up to 0
0.900000 rounded up to 0
0.900000 rounded up to 0
0.999000 rounded up to 0
1.000000 rounded up to 1
1.000000 rounded up to 1
1.099000 rounded up to 1
1.100000 rounded up to 1
1.100000 rounded up to 1
1.199000 rounded up to 1
1.200000 rounded up to 1
1.200000 rounded up to 1
1.299000 rounded up to 1
1.300000 rounded up to 1
1.300000 rounded up to 1
1.399000 rounded up to 1
1.400000 rounded up to 1
1.400000 rounded up to 1

GRASS_INFO_MESSAGE(3982,1): Checking GDAL data type and nodata value...
GRASS_INFO_END(3982,1)

GRASS_INFO_MESSAGE(3982,2): Using GDAL data type
GRASS_INFO_END(3982,2)

GRASS_INFO_MESSAGE(3982,3): Input raster map contains cells with NULL-value (no-data). The value 255 will be used to represent no-data values in the input map. You can specify a nodata value with the nodata option.
GRASS_INFO_END(3982,3)

GRASS_INFO_MESSAGE(3982,4): Exporting raster data to GTiff format...
GRASS_INFO_END(3982,4)

GRASS_INFO_MESSAGE(3982,5): r.out.gdal complete. File created.
GRASS_INFO_END(3982,5)
Execution of '/home/user/.qgis2//processing/grass7_batch_job.sh' finished.
Cleaning up temporary files...

Concerning the parameters used in r.reclass, the input and output rasters are TIF files, and the reclass rule is just a basic text file; and the others parameters are left to default. And I'm running QGIS 2.8.6-Wien.


texts: Importing Several Raster Layers, Doing Manipulations and Exporting The Newly Saved Rasters

texts:
I have the following code:

src_ds = gdal.Open("/home/usr/Desktop/RasterFolder/Name.tif")
if src_ds is None:
    print 'Unable to open %s' % src_filename
    sys.exit(1)
myarray = np.array(src_ds.GetRasterBand(1).ReadAsArray())
rows = src_ds.RasterYSize
cols = src_ds.RasterXSize
BufferDistance = 15
IndexingSquare = 2*BufferDistance + 1
i,j = np.ogrid[:IndexingSquare,:IndexingSquare]
struct = ((i-BufferDistance)**2 + (j-BufferDistance)**2 <=BufferDistance**2+1)
forests_buffered = ndimage.binary_dilation(myarray, structure=struct)
driver = src_ds.GetDriver()
outDs = driver.Create("/home/usr/Desktop/Buffers/Name_NEW.tif", cols, rows, 1, GDT_Int32)
if outDs is None:
    print 'Could not create .tif file'
    sys.exit(1)

outBand = outDs.GetRasterBand(1)
outData = forests_buffered
#Write the data
outBand.WriteArray(outData,0,0)
#Flush data to disk
outBand.FlushCache()
#geo-reference the image
outDs.SetGeoTransform(src_ds.GetGeoTransform())
outDs.SetProjection(src_ds.GetProjection())
del outData

It inputs a raster file, creates a buffer with a certain buffer distance and then exports the new raster with the added buffer as a new .tiff file. I have all my rasters in a directory:

rasterDir = "/home/usr/Desktop/RasterFolder/"

What I need to do is apply the buffering using the code above to all the rasters in the RasterFolder (in an automated fashion) and save the outputs into a new output directory:

outputDir = "/home/usr/Desktop/Buffers/"

Could you give me a suggestion how to do this in the most computationally efficient way? Essentially, I want to create a function which loops through the files in the RasterFolder, applies the buffering and saves the buffered rasters in the output directory.


texts: Where can I find data of city boundaries in the US?

texts:
I know there is previous question about this topic but there is no exact answer. Actually I was wondering, does city boundaries cover all around the nation without space?

I mean, for MA I found two different dataset. One of them is towns (from MASSGIS):

One of them is places (that includes towns and cities from Census Bureau's 2010 TIGER/Line shapefiles):

Which one is true?


texts: Is there a way to visually clip a layer in QGIS to prevent information from rendering outside the boundary?

texts:
In ArcGIS you are able to Clip to Shape, meaning you can use a shapefile to visually clip anything outside if it. This option does not physically clip anything, nor make a new shapefile.

For example:

You could add the Google satellite imagery and set the clip to prevent having to wait for information outside a certain shape from rendering.

Is there a way to visually clip as mentioned above in QGIS?


texts:
I want to insert rows which the field CNTY_NM meets the requirement. The code is OK for running, but the feature class only has the records but no geometry. What is wrong with my code?

import arcpy
import os

int_buffer_TXcounties = r'C:\Users\TL\Desktop\1216\buffer\int.shp'
inputfeatureclass = r'C:\Users\TL\Desktop\1212\TXCounty\TXCounty.shp'

#Create an empty featureclass by using inputfeatureclass as template
arcpy.CreateFeatureclass_management(out_path="C:/Users/TL/Desktop/1216/buffer", out_name="TC1", geometry_type="POLYGON", template="C:/Users/TL/Desktop/1216/buffer/TX_counties.shp", has_m="DISABLED", has_z="DISABLED", spatial_reference="GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision", config_keyword="", spatial_grid_1="0", spatial_grid_2="0", spatial_grid_3="0")
insertfeatureclass = r'C:\Users\TL\Desktop\1216\buffer\TC1.shp'

#get the counties names
counties_name = []
fields = ["CNTY_NM","CNTY_FIPS"]
with arcpy.da.SearchCursor(int_buffer_TXcounties, fields) as cursor:
    for row in cursor:
        print("{0}, {1}".format(row[0], row[1]))
        counties_name.append(row[0])

#Insert counties
for county in counties_name:
    print county
    expression = """"CNTY_NM" = '{0}'""".format(county)
    print expression
    with arcpy.da.InsertCursor(insertfeatureclass, '*') as i_cursor:
        with arcpy.da.SearchCursor(inputfeatureclass, '*', where_clause=expression) as s_cursor:
            for s_row in s_cursor:
                i_cursor.insertRow(s_row)

The following picture shows the records in the feature class. But when I used Zoom to Layer, I can't have any geometry.

I am using ArcGIS 10.3.1 Advanced License.


texts:
What I would like to achieve is an A4 print out of an OSM map with a polygon outline printed on top.

This would come from a web application. Where a user can centre the map, upload a polygon. Which I can do already using Leaflet.js and Mapbox.

I have no idea where to start on this, but I need to take the tiles from the current "view" which would be easy enough, but then I need to scale them, draw the polygon ontop, and then print to a PDF which gets emailed back.

Does anyone have any suggestions on how to achieve this in an automated way?


texts:
I have radar meteorological data in an Azimuthal Equidistant projection and I want to georreference it. I would know how to do it if the data were refered to the typical WGS-84 ellipsoid, but it isn't the case.
There are metadata in my file that says that earth_radius = 637813700, (so, spherical Earth, it seems), and inverse_flatting = 298257224. If I define a Globe cartopy instance to account for this,
globe = ccrs.Globe(semimajor_axis=637813700, inverse_flattening=298.257224)

and the rest as
lon0 = 344.38556
lat0 = 28.01861
map_proj = ccrs.AzimuthalEquidistant(central_latitude=lat0, central_longitude=lon0, globe=globe)
fig = plt.figure(figsize=(20, 16))
ax = fig.add_subplot(111, projection = ccrs.PlateCarree(globe=globe))
ax.set_aspect("equal")
X, Y = np.meshgrid(x_dim, y_dim)
pm = ax.pcolormesh(X, Y, data, transform = map_proj)
ax.coastlines("10m")
ax.gridlines(draw_labels=True)
plt.colorbar(pm)
plt.show()

I can't see the coastlines (and I need them), while if I just ignore the Globe instance, I see them. I am seeing a high resolution image when I include the Globe instance (I see it from the values of gridlines), while if I do not include Globe, I see a wider area). So how can I specify correctly the Globe, since I have to include it due to the fact that I am not in the WGS-84 projection?


texts: Applying same symbology to different DEMs?

texts:
I am using ArcScene and ran into this problem where I downloaded a couple of neighboring/bordering DEMs(in BIL format), imported them into the scene (as separate entities) and applied Base Heights so it would display in 3D.

The problem is that the DEMs have slightly different shading so they do not join properly (The color/shading does not match up, but the physical height does).

How do I display them all in the same shade/color/symbology?


texts: Creating rectangles from CSV coordinates via Python console in QGIS

texts:
As of v3.10, there is an asPolygon method for qgis.core.QgsRectangle.
This runs:
QgsRectangle(1804512.8556, 5453390.58088, 1813512.8556, 5461390.58088).asPolygon()

However, no vector data (i.e. an actual rectangle) appears on-screen in the View.
Maybe all I've done is transpose the inputs and haven't actually created a feature, yes?
What do I need to add/specify to write features to either a temp or shp file?
(my end goal is to iterate through records in the csv to create multiple rectangles in a single shp)


texts: Simplify/generalize vector geometry with side bias

texts:
I have contour polygons as vector geometry with attached elevation attributes.
Is there a method to simplify vector polygons while preserving topology and elevation bias?
By elevation bias I mean that simplification of two neighboring polygons with different elevation values should not produce result where simplified polygon of higher height overlaps original polygon of lower height but reverse is allowed. Elevation bias can be considered sided bias as well, since in the oriented border between two neighboring polygons the simplification should "eat into" one side only i.e. newly produced line segments from simplification process go over area of one side only (higher elevation side).
I'm aware of different simplification method available with PostGIS and GRASS, but haven't found any that allows sided bias.
I don't have source raster, only vector contours geometry.


texts: QGIS OBIA join attributes by location xml file

texts:
I was trying to follow this tutorial for object base classification

However, when I reach this step, it becomes confusing.

I run the join attributes by location just as it said, and the output are .shp, .shx, .qpj, .prj and .dbf. There is no xml file, meanwhile the next step requires an xml file.

Does this module (join attributes by location) produce xml file?
If not, is there any way to create an xml file from a shp file?


texts:
I am working with ArcGIS 10 and have some tiff elevation files (NED).
I can load them into Arc GIS and can look at them, and the values seem OK. I also have some shapefiles polygons and want to get the average elevation of each polygon from the tiff elevation file.

How can I accomplish this? I tried "Zonal Statistics as a Table", but I get this error:

"ERROR 000864
Input raster or feature zone data: The input is not within the defined domain. ERROR 000863: Invalid GP data type"

I thought it might be because I do not have an attribute table. So I tried to create one with "built raster attribute table", but I get an error:

"ERROR 000423 Only single band integer raster dataset is a valid input"> I do not really understand this error since I can see in Layer Properties\Source that the tiff file has only one band.

The ArcGIS help says that "It is not possible to build a raster attribute table for a raster dataset that is a pixel type of 32-bit floating point", so maybe that's the problem.


texts: How to find road distance between points from two shapefiles in QGIS

texts:
I am new to QGIS, but have to find the distance between centroids of NJ municipalities (which I have as a shapefile) and the nearest road sign which is also its own shapefile, along the roads of the state.
I have three shapefiles: one road shapefile, and two point shapefiles and my goal is to find the road distance between points of the two point shapefiles.
I have tried the RoadGraph plugin but I do not want to have to manually click each point since I have to know the nearest sign to each centroid first.


texts: 1.82 meters between 2 lat readings -- What would that be in minutes?

texts:
If I have 2 longitudes that are seperated by 1.82 meters how would I estimate their separation in minutes?

Here is what I did not sure if it is valid

X   Y
52.33816424 -106.2851684
52.33816424 -106.2851419

2 points  representing the center of 2 plots so to get the width of a plot I find the difference between the centers:

abs(-106.2851684) - abs(-106.2851419) = 0.000026500000004

so

1/2plot = 0.000026500000004/2 = 0.000013250000002

so top of plot 1 =-106.2851684  - 0.000013250000002 = -106.285181650000000

does that make sense?

I know minutes isn't a distance measure.


texts: OpenLayers - Test Control To See If It Is Active

texts:
I am trying to get the active state of an OpenLayers SelectFeature control. I create this control and add it to my map but I do NOT activate it yet. This part works fine. Here is the script to create the control and add it to the map:

var highlightControl = new OpenLayers.Control.SelectFeature(lyrstands, {
        hover: true,
        highlightOnly: true,
selectStyle: {
   fill: "#0000FF",
           strokeColor: "#0000FF",
           strokeWidth: 2,
   fillOpacity: 0.5
          }
    });

map.addControl(highlightControl);

Then I have a button that calls a function. Here is the code for the button:

new OpenLayers.Control.Button({title: "Select Polygon", trigger: HiLite})

I know the button is calling the HiLite function because if I put a simple alert statement in the HiLite function (for example: alert("The Function Works");) it works correctly.

So what I am trying to do is check to see if highlightControl has been activated by testing the highlightControl.active value, if it is already activated the function should do nothing, but, if highlightControl is NOT activated it should activate it. Unfortunately, the function does not work. Here is the function I have written:

function HiLite(){
  if (highlightControl.active==false)
          {highlightControl.activate();}
  else {}
   }

If I write the function to simply activate the tool without the If Else stuff it works fine. But, for some reason when written as above I cannot get the status of the Active attribute. The OpenLayers documentations states that the Active attribute is a Boolean value and I assumed I could check the status using the highlightControl.active==false statement.

Why can I not get this function to work?


texts: How can I use child window in ArcGIS Silverlight

texts:
Can i use child window control to show map legend or overview?
I tried to use the child window control to show map legend but i couldn't make it work. Is there any way to use the child window control in ArcGIS Silverlight projects?