texts: Always crashes when choosing symbology "unique values"

texts:
Using ArcGIS 10.4

I have a polygon shapefile with many columns, one is called "coding". It includes pure numbers like 31001

Now I need this as a raster with this code as the value. So I tried, as usual, the "feature to raster" tool. It worked fine. It shows me the values as stretched though. Whenever I try to change the symbology to "Unique values" ArcMap crashes immediately. Also I cant reclassify it, because it wont show me unique values. But that is exactly what I need to do, because I need to group certain codes into one.
Any ideas what to do? Is there something wrong with the raster?


texts: Getting a list of Google Earth Engine datasets?

texts:
I'm writing a Google Earth Engine client and need a list of datasets that I can simply parse. In the best case it includes information like the bands, name, id, description, source/copyright, ... I don't really want to parse it from the HTML file I linked to as this is pretty messy.

I found that there is an endpoint https://code.earthengine.google.com/rasters?q=keyword that is used by the GEE Code Editor Playground. Is there any way to access this from outside the Playground?


texts: Select polygons by attribute belonging to another layer

texts:
I'm a recent QGIS user. I have a shapefile A with a series of polygons indicating land use of an urban region (urbanised areas). Now I want to select them in relation to a second shapefile B with the polygons administrative areas (municipalities). In other words, if polygons of shapefile A are inside the boundaries of municipality X they should be selected, and so on.
I tried Select by Location, but only managed to select the parts of shapefile A that intersect the whole of shapefile B (however there are many municipalities/polygons in that layer).
Hope this is clear to you! Thanks.


texts: Changing the extent of a shapefile in ArcMap for distribution modelling in R

texts:
I am currently trying to create a species distribution model in R using maxent. The shapefile I have is a map of an island. When viewed in ArcMap it has a set extent--in Lat and Long. I can successfully pull this into R and plot presence points. However, I cannot plot any points that are outside of the lat/long extent of the map's shapefile.

Is there a way of widening/expanding the extent of this shapefile so that I can plot points further offshore?


texts:
I use GeoServer to publish shapefiles with GeoMesa-Accumulo, but when I click on the map, I see some garbled in map.

How can I have it display Chinese characters?


texts:
I get a runtime error R6034 every time I open QGIS. I am running under Windows 10 on a 64-bit machine.  This issue has been raised previously with answers that might be useful for a experienced system manager (How to fix Runtime Error R6034: An application has made an attempt to load the C runtime library incorrectly?).  However, I would like to recommend QGIS to high school students.

Is there any harm in continuing to run QGIS despite the runtime error?

Will proceeding lead to problems with QGIS or other software on my machine?


texts: Find the points within radius using PostgreSQL

texts: In my table I have three columns ID , long and lat how  to find points within radius (ex., 20 km with center long and lat) without using PostGIS.


texts: How can I serve data from a single PostGIS view, via WMS/WFS, in a way that allows users in a GIS client to filter based on attributes?

texts:
I have a materialized VIEW in PostgreSQL/PostGIS that contains observations for thousands of species.  I am currently serving this view as a single WMS/WFS layer using Geoserver, and this works fine for our web applications.  We just use a CQL filter in the application to limit to the species selected by the user.  But, I am not sure of the best way to get the data to end users in a GIS client (ArcMap mostly, but also QGIS), who will almost always want to view observations for a single species at a time.  Although SQL filters can be applied to a WFS layer in QGIS, I am not sure about ArcMap. Also, it might be too much to ask to suggest that end users form and apply these queries in their GIS client, since most end users will be biologists, rather than GIS or database specialists. The options I can think of that might be viable are:

1) Serve the data as-is, and ask end users to filter by species on their end.

2) Programmatically create a separate layer for each species, possibly as layer groups, in Geoserver, grouped by major taxonomic groupings (e.g., Birds, Mammals, etc.).  This is problematic because the data change on a daily basis, so views/layers would have to be regenerated frequently.

Are there other options I might be missing?


texts: I am working a project that consists of manually digitizing geology layers from a scanned map. At the moment my process consists of me digitizing the small polygons and then the larger areas around them. After that I use the cut polygon tool within the editing toolset to cut out the small polygons within the larger area so that they then show through. (See pic below. Small polygons are yellow and larger area is red) My question is, is there a way within ArcMap that would allow me to create my small polygons and then the larger polygon area without having to cut the small polygons to allow for them to show through?


texts:
Possible Duplicate:
  How to reproject base layers in OpenLayers?

I Am trying to reproject my map from epsg:4326 to epsg:900913 but I couldn't do it. here is my codes

  OpenLayers Example


texts:
I have my web map up and running and am now trying to clean up a few recurring errors in the qgis-web-client-error.log. The error in question is:

[error] [client 123.456.789.1] script not found or unable to start: /home/blank/qgis-web-client/cgi-bin/mapserv, referer: http://blank.com/qgiswebclient.html?map=/home/blank/qgis-web-client/projects/gf_utm.qgs&format=image/png&visibleLayers=paddocks,image,wheat_yield,allendale_cntr

When I look in GlobalOperations.js there is a line in Overview setting that I have not modified:

var overviewLayer = new OpenLayers.Layer.WMS("Pixelkarte",
"/cgi-bin/mapserv?map=/path-to-map/.map",
{layers:"pk_kombiniert",format:"image/jpeg"},
{buffer:0,singleTile:true,transitionEffect:"resize"});

But I am not sure what path to put in here. Is it to qgis_mapserv.fcgi?  I do notice that my overview map does not work.


texts: distance between two points on different direction

texts: I want to measure the distance between two points on the horizon and vertical axis. Is any function on GIS can achieve this?


texts: How to produce a mean raster file based on other raster files?

texts:
Possible Duplicate:
  Tools to flatten the jp2 to a single band (average the bands)?

I have a number of raster files from a same area, that coordinates of corresponding pixels perfectly match one another. I have to perform simple operations like producing a raster that its pixel values are the average of a 3 raster files corresponding pixel values. Simply speaking, I want a new raster file that is average of 3 other raster files.


texts: Classifying land use in polygons using aerial imagery

texts: I am trying to use the shapefile here: https://environment.data.gov.uk/DefraDataDownload/?mapService=EA/HistoricLandfill&Mode=spatial  to work out how much of the sites are covered in trees. I have managed to load the shapefile and aerial images (World Imagery basemap) and clip the map to just show the imagery within the polygons. Now I would like to classify how much of each polygon is covered with trees however the classification tool is greyed out (I think because it is not a raster file). Is there any way around this? I am using ArcMap 10.1.


texts: " QFSFileEngine::open: No file name specified " installing QGIS Server on Windows 2012R2

texts:
I am attempting to get QGIS Server installed on a Windows 2012 R2 Server. After following the information at the https://anitagraser.com/2012/04/06/qgis-server-on-windows7-step-by-step/, and looking at other resources on StackExchange and the official QGIS Server Wiki, YouTube, and everywhere else I could find, I have managed to almost get it working.

When I attempt to access http:///qgis/qgis_mapserv.fcgi.exe? I receive a 500 Internal Server Error. I also receive in the Apache error logs:

(OS 109)The pipe has been ended.  : mod_fcgid: get overlap result error
Premature end of script headers: qgis_mapserv.fcgi.exe

When I run the qgis_mapserv.fcgi.exe binary directly, I see this output:

 QFSFileEngine::open: No file name specified
 Content-Length: 206
 Content-Type: text/xml; charset=utf-8

 <ServiceExceptionReport version="1.3.0"
 xmlns="http://www.opengis.net/ogc">  <ServiceException code="Service
 configuration error">Service unknown or unsupported</ServiceException>
 </ServiceExceptionReport>

Now I think the cause is the first line, since the server is recognizing that it's not a valid HTTP header and hence terminating the script, but I can't figure out the cause or what I can do to make it go away.

My httpd_qgis.conf file looks like this:

LoadModule fcgid_module modules/mod_fcgid.so

DefaultInitEnv PATH "C:\OSGeo4W\bin;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass-@grassversion@\bin;C:\OSGeo4W\apps\grass\grass-@grassversion@\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
DefaultInitEnv QGIS_PREFIX_PATH "C:\OSGeo4W\apps\qgis"
DefaultInitEnv QT_PLUGIN_PATH "C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt4\plugins"
DefaultInitEnv TEMP "C:\Users\C_Young\AppData\Local\Temp"
DefaultInitEnv PYTHONHOME "C:\OSGeo4W\apps\Python27"

#DefaultInitEnv PYTHONPATH "C:\OsGeo4W\apps\qgis\.\python;C:\OsGeo4W\apps\qgis\.\python\plugins;C:\OsGeo4W\apps\Python27\DLLs;C:\OsGeo4W\apps\Python27\lib;C:\OsGeo4W\bin;C:\OsGeo4W\apps\Python27;C:\OsGeo4W\apps\Python27\lib\site-packages"

#DefaultInitEnv GDAL_DATA "C:\OSGeo4W\share\gdal"
DefaultInitEnv GDAL_DRIVER_PATH "C:\OSGeo4W\bin;C:\OSGeo4W\bin\gdalplugins"

#DefaultInitEnv PROJ_LIB "C:\OSGeo4W\share\proj"

#DefaultInitEnv GDAL_FILENAME_IS_UTF8 YES
#DefaultInitEnv VSI_CACHE TRUE
#DefaultInitEnv VSI_CACHE_SIZE 1000000

Alias /qgis/ C:\OSGeo4W/apps/qgis/bin/

<Directory "C:\OSGeo4W/apps/qgis/bin/">
    SetHandler fcgid-script
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

As you can see, there's a number of other commented out directives. I've tried everything I can find relative to OsGeo4W, and QGIS Server, but still to no avail. If I could just find a way to suppress the first line, I'd be happy at this point.


texts: Artefacts using osm2vectortiles world map with OpenLayers 3 in mbtiles

texts:
Using the information in this question, I managed to unpack a random small mbtiles vector tile map from osm2vectortiles.org and load it locally in a browser using npm http-server, based on this OpenLayers example.
This leaves me with this question, when I download the world map for zoom level 0-5 from osm2vectortiles.org, I seem strange triangles tiles appearing in the sea at level 2,3,4 and 5. Please see the screenshot. Land looks perfect.

How can I resolve this?


texts: Configuring pop-up in map notes of ArcGIS Online

texts:
Whenever I try to create my own layer in ArcGIS using Add->Add Map Notes, there is no Configure Pop-up option in newly created layer

Whereas if I use already existing one there is such an option

Is there any way to have a Cofigure Pop-up option, or any other way to add attributes to the new layer?


texts: How to write binary ArcGRIDs outside of ArcGIS in linux?

texts:
I've been looking for a way to create\write binary formatted ArcGRID images in Linux without much luck.  It seems the GDAL project only supports reading these files, but there is not write support.  My major problem with this is that I have raster images being created in custom C++ programs and I'm using ArcGIS Server to display them.

Most operations in ArcGIS Server regarding raster processing via geoprocessing services seems to require the data to be in the binary ArcGRID format (or automatically converts to this format).  Converting from another format to the ArcGRID format on the ArcGIS Server is just too slow for web apps.


texts: How do I get the closest point on a road to a point when I have imported OSM data using osm2pgsql?

texts:
I have been trying to use OSM data to find the closest point to a road for a given point. I imported the OSM data into postgis using osm2pgsql, and I am getting results back, but they are at the absolute edge of my imported data (and the point I'm trying to specify is near the middle) and distance reported is about 8000km. I'm pretty sure it has to be something to do with mixing different coordinate systems but I'm quite new to this so not sure.

The SQL query I'm trying to use is:

SELECT osm_id,
   highway,
   name,
   ref,
   ST_X(ST_ClosestPoint(ST_Transform(r.way,4326),
       ST_SetSRID(ST_MakePoint(55.938627,-3.198706),4326))),
   ST_Y(ST_ClosestPoint(ST_Transform(r.way,4326),
      ST_SetSRID(ST_MakePoint(55.938627,-3.198706),4326))),
   ST_Distance_Sphere(ST_ClosestPoint(ST_Transform(r.way,4326),
      ST_SetSRID(ST_MakePoint(55.938627,-3.198706),4326)),
      ST_SetSRID(ST_MakePoint(55.938627,-3.198706),4326))
FROM planet_osm_roads r
ORDER BY 7 ASC
LIMIT 10;


texts: Lock overlay on Custom Geoprocessing Tools

texts:
How do you get rid of the "lock" icon overlay on a custom geoprocessing tool in ArcToolbox?

This seems to appear even with the ESRI Sample Projects.


texts: Do all my layers need to have the same pixel type and pixel depth for an overlay analysis?

texts:
I am doing an overlay analysis with different raster layers, that were once polygons, and some original raster layers.
I have resampled all my layers to have the same cell size or resolution, and now my question is: Do all my layers need to have the same pixel type and pixel depth before running the overlay analysis?
Some of my layers have a 32-bit depth and have floating-point whereas the others which are the polygons that I've converted to raster are 4 bit and unsigned integer.
Should I make them all the same pixel type and depth? And If yes how should I do this?
I am using ArcGIS.


texts: Sum field and use that sum to populate existing field in same table using ArcGIS ModelBuilder?

texts:
I am trying to break down land uses in a watershed by making a tool in ModelBuilder. Right now I am clipping a land use layer by a watershed polygon, dissolving land use layer by land use code, converting the area of each dissolved land use to acreage, then adding a new field  field for total watershed acreage, which i will then create a new field to divide the two together to get a percentage.

Where I am hung up on now is populating the total watershed acreage field. Is there a way in ModelBuilder where I can sum all of the areas of the dissolved land use acreages and populate that sum into each cell of the total watershed acreage field? I imagine it is possible through the calculate field tool. I am not all that familiar with python, but i think that might be the way to go.


texts: Creating set of maps (PDF) using QGIS and Python with WMS Data

texts:
For a scientific project I am trying to create a set of PDFs in QGIS with a fix layout (in the print composer) but per PDF a) different map item attributes (extents) and b) a QR-code to identify this PDF. The QR-Codes are already created with a python module (-> .svg) and the extents of the map items are a simple raster. The map content is a WMS which is embedded in the QGIS project.

My idea is to open a pre-defined print composer, iterate through the raster (has simple coordinates) and generate a PDF per iteration with the actual a) map layout and b) QR-code.

I am working with QGIS 2.12.1 (uses Pyton 2.7.5)


texts: Seeking standard for displaying US vs. State highways on map

texts:
Is anyone is aware of a standard for how State roads, US roads and interstates should be displayed on a map?
Not the label, but standards for the color and width of the symbology used to display the road.


texts: Can't figure out why I keep getting this error in regards to opening the gbd path while using the InsertCursor

texts:
listOfPoints = [(6002672.58675, 2092447.04362), (6003672.58675,
  2093447.04362), (6004672.58675, 2093447.04362), (6004672.58675,
  2091447.04362)]
polyName = 'New Polygon'
polyID = 54321
blockPoly = r'C:\Users\your.name\some_folder\SanFrancisco.gdb\Chapter3Results\TestPolygo
insertCursor = arcpy.da.InsertCursor(blockPoly,
  ['SHAPE@','BLOCK','BLOCKID'])
polyArray = arcpy.Array()
for pointsPair in listOfPoints:
    newPoint = arcpy.Point(*pointsPair)
    polyArray.add(newPoint)
newPoly = arcpy.Polygon(polyArray)
insertData = newPoly, polyName, polyID
insertCursor.insertRow(insertData)
del insertCursor

for blockPoly, I used the whole file path and keep running into this error.

RuntimeError: cannot open 'C:SanFrancisco.gdb/Chapter3Results/TestPolygon'


texts: Update coordinates on geopackage with shapefile

texts:
I have a geopackage file that has all the information about certain items but the coordinates need to be updated. I'm using an old Leica 1200 GPS to get the new coordinates and giving the same ID to these points that they have in the geopackage.
What is the best way to update the coordinates in the geopackage with the ones from the shapefile generated by the GPS knowing that the ID will be same, I've been using excel's VLOOKUP function for this but would like to know if there is a way to do it inside QGIS.


texts: Corrupted Image Layer of DPR File (eCognition Project)

texts:
I just started working with eCognition a few months ago and it is my first time to encounter a problem.

I was on the refinement stage (and almost done manual brushing objects) when I found out that there was a display issue on my project. This has been observed after a power interruption had occurred.

As I asked my senior fellow, he mentioned that the file has been corrupted.

I just like to ask if anyone knows a way to fix it.


texts: Reprojecting WGS84 to metric coordinate system with reference point in QGIS?

texts:
I have GIS data in EPSG:4326 consisting of 2D points, linestrings and polygons that are all close (i.e. less then a couple of hundred of meters) to a certain WGS84 coordinate point.

I would like to convert/reproject the geometry from a WGS84 to a 2D system in which the coordinates are north/south and east/west distance from the reference point in meters. In other words, the reference point should become the origin of a new euclidic SRS and the axis unit should be meters.

How I would I do that in QGIS?

I assumed I would be able to generate a custom SRS with my reference point as a center but I have no idea how to express this in QGIS.

Was I right to assume that I would need to dig into PROJ.4 expressions for that?

Or should I some other tool?

I have the whole osgeo4w toolbox at my disposal.


texts:
I am using  ArcGIS Desktop 10.6.1.

I am trying to fix a dataset that has several holes throughout it. I built a topology to identify any area that does not have gaps or overlaps. However, when I run the error check, the identified gaps come in as polylines and it will not give me the option to fill them.

Has anyone encountered this and have a workaround?

There doesn't seem to be anywhere to specify what feature type the error should represent itself as.

I can click "create a feature," but I'd rather merge that in with the surrounding polygon than create a separate feature for it.


texts: QGIS 3-->Python-Code from graphic modeler doesn't work

texts:
I run a model with an if-condition with sucess. After exporting the code the scirpt gives me an error:
"Unable to execute algorithm Field name is not set. Please enter a field name".
the code-snippt seems to be okay

"""
Model exported as python.
Name : BlnField
Group : Test
With QGIS : 31100
"""

from qgis.core import QgsProcessing
from qgis.core import QgsProcessingAlgorithm
from qgis.core import QgsProcessingMultiStepFeedback
from qgis.core import QgsProcessingParameterBoolean
from qgis.core import QgsProcessingParameterVectorLayer
from qgis.core import QgsProcessingParameterFeatureSink
from qgis.core import QgsProcessingParameterDefinition
from qgis.core import QgsExpression
import processing

class Blnfield(QgsProcessingAlgorithm):

    def initAlgorithm(self, config=None):
        param = QgsProcessingParameterBoolean('blnF', 'Soll ein Feld "Fl_m²" angelegt und die Flächen berechnet werden?', optional=False, defaultValue=False)
        param.setFlags(param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
        self.addParameter(param)
        self.addParameter(QgsProcessingParameterVectorLayer('l', 'l', types=[QgsProcessing.TypeVectorAnyGeometry], defaultValue=None))
        self.addParameter(QgsProcessingParameterFeatureSink('Resfc', 'Ergebnis:', type=QgsProcessing.TypeVectorAnyGeometry, createByDefault=True, defaultValue=None))

    def processAlgorithm(self, parameters, context, model_feedback):
        # Use a multi-step feedback, so that individual child algorithm progress reports are adjusted for the
        # overall progress through the model
        feedback = QgsProcessingMultiStepFeedback(1, model_feedback)
        results = {}
        outputs = {}

        # Field calculator
        alg_params = {
            'FIELD_LENGTH': 10,
            'FIELD_NAME': QgsExpression(' if(@blnF ,\'Fl_m2\',\'\')').evaluate(),
            'FIELD_PRECISION': 3,
            'FIELD_TYPE': 1,
            'FORMULA': ' $area ',
            'INPUT': parameters['l'],
            'NEW_FIELD': True,
            'OUTPUT': parameters['Resfc']
        }
        outputs['FieldCalculator'] = processing.run('qgis:fieldcalculator', alg_params, context=context, feedback=feedback, is_child_algorithm=True)
        results['Resfc'] = outputs['FieldCalculator']['OUTPUT']
        return results

    def name(self):
        return 'BlnField'

    def displayName(self):
        return 'BlnField'

    def group(self):
        return 'Test'

    def groupId(self):
        return 'Test'

    def createInstance(self):
        return Blnfield()


texts: How to convert a PNG tile set into the Mbtiles format

texts:
I have exported a folder with PNGs tiles and I want to convert them into Mbtiles format to use with Mapbox (maybe via TileMill?). How can I do that?

Is there a convertor where I can specify the parent folder and all subdirectories with their respective PNGs to be converted into Mbtiles format? Thanks!


texts: Adding a PyQGIS Plugin to the Database Menu

texts:
I am developing a plugin which I would like to add to the Database menu instead of the default Plugins menu.

According to the PyQGIS Developer Cookbook all I have to do is add

category=Database

to my plugin's metadata.txt.

However, that does not have any effect. Do I have to add something in my initGui as well?

Currently the initGui looks like this:

def initGui(self):
    self.importCSV_action = QAction('Import CSV', self.iface.mainWindow())
    QtCore.QObject.connect(self.importCSV_action, QtCore.SIGNAL("activated()"),self.importCSV)
    self.iface.addPluginToMenu('xxx', self.importCSV_action)

If I leave the category=Database out in my metadata.txt the plugin appears as expected in the Plugins menu.


texts: NDVI from ESA's Sentinel-2 training data

texts: I'am trying to generate an NDVI map using ESA's Sentinel-2 training images, which can be found at https://spot-take5.org. I tried using QGIS's raster calculator to create the NDVI image, however quite unsuccessful, as I can't manage to figure out how the bands correspond to the basic NDVI = (NIR - VIS)/(NIR + VIS) formula. Any Python script or other freeware tool would suit me as well.


texts: GeoTIFFS on Geoserver are served slowly, at too low resolution

texts:
I have a bunch of large, high resolution GeoTIFFs, that I am serving using GeoServer. I also have a prototype client I wrote using Leaflet. The resolution of the TIFFs is quite high, but despite that I get unpleasant, low resolution imagery on my client and also on the layer previews using the GeoServer interface.

The GeoTIFFs are stored as an Image Mosaic; I then created a Layer from it and then seeded the tiles using the GeoWebCache interface.

In my Javascript client I use this code to add the layer to my map:

app.currentTileLayer = L.tileLayer.wms('http://mygeoserver:8080/geoserver/wms', {
            layers: 'myworkspace:layer-name',
            format: 'image/png',
            version: '1.1.1',
            transparent: true,
            tiled: true,
            attribution: '&copy; Myself',
        });

I get the layer all right, but, as mentioned above, it is very low resolution - pixelated is the word I'd use. Also, despite the tile caching, it takes such a very long time to actually get the tiles.

Obviously I must have set some options incorrectly. What could I check?

Edit: I'll copy here an edited version of one of the tile requests from Firebug: http://myserver:8080/geoserver/wms?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=myworkspace%3Alayer-name&STYLES=&FORMAT=image%2Fpng&TRANSPARENT=true&HEIGHT=256&WIDTH=256&TILED=true&SRS=EPSG%3A3857&BBOX={coordinates}

Edit 2: I posted screenshots of a part of an original TIFF and of the rendering on the browser at http://imgur.com/gallery/0H08m/new .


texts: Finding feature in layer by attribute value without iterating over layer using PyQGIS?

texts:
My layer has an attribute 'name' which is unique for the layer and enforced by the database. I have been looking for an API call that will return a list of features that match the value of the name attribute but can't find anything.

Is there a more efficient way of finding the feature by attribute value than simply iterating over all the features in the layer?

I am guessing not since this implies QGIS maintains some form of index which I doubt!


texts: How to display shapefile without map in Android?

texts: I have a shapefile which has some building data and I want to display that building structure in Android I have checked nutiteq SDK but they are providing shp file on map not only shapefile can I load only shapefile without map layer?


texts: Adding information of a shapefile to a GPS coordinate

texts:
I am using ArcMap 10.6.1 and I am currently trying to add information to a GPS coordinate. This coordinate (red) lies within a shape from a shapefile, and the shapefile as some attributes (yellow box). I want to match these attribute to the GPS file (blue arrow).

I tried to illustrate this with the picture bellow and would be very glad if someone could help me with this.


texts: How to get GeoServer Vector Tile automatically update on data change

texts:
I have a spatial table in PostGIS that gets written (Insert/Update/Delete) by a production web app. Almost every minute there's write to the table.  The app shows the geometry of the table on web client via database query in the form of 'untiled clear-text-geojson'. The BBOX extent depends on the current client's  bbox.

This way of delivering geojson to client now proves to be not efficient as the geojson gets bigger as the points count grow. I would like to try different way. One of them is with Geoserver Vector Tile. I was thinking that with binary data and tile, the required data sent to client potentially becomes smaller.

So I published the table as geoserver layer and activated the 'application/x-protobuf;type=mapbox-vector' under the Tile Caching tab of the layer.

With OpenLayers 5.1.3 I could visualize the geometry from the table, based on this article.

Next I ran a small test with QGIS adding 2 rows (with points geometry) directly to the table. The aim is to get to know whether the points got rendered to the vector tile.

Here's the step (some with corresponding picture):

Open the OL map page in browser. Zoom-in upto zoom level 18, and stop. I intentionally stop zooming down to this zoom level. The map shows the existing points in the table within the map extent.
Add 1 point (point 'A') with QGIS into the PostGIS table.
Panning left and right on the map does not change the VT to show point A.
Zooming-in exactly 1 level upto Zoom level 19, and stop. Again,
I intentionally stop zooming down to this zoom level. Now point A is shown.
Add 1 more point (point 'B') with QGIS into the PostGIS table.
Panning left and right on the map does not change the VT to show point B (similar to step 3).
Zooming-in exactly 1 level upto Zoom level 20, and stop. Now point B and A are shown.
Zooming-out exactly 1 level to Zoom level 19. The tile shows only point A and not B.
Zooming-out exactly 1 level to Zoom level 18. The tile shows none of point A and B!.
Last step: a double check with another browser on another client machine shows exactly similar symptoms:

Zoom level 20 shows point A and B
Zoom level 19 shows only point A
Zoom level 18 shows none of point A & B.

Now to the question:

How to make Geoserver render these added points to the tile that have been generated (and shown) before?
Is the above symptoms are normal with Geoserver Vector Tile?
Is Geoserver Vector Tile appropriate for the above use case (showing points in a table that gets written dynamically)?


texts:
I need to update tiled raster data from the "whole image". I have created this query:

UPDATE data_tiled AS t  SET raw_data = f.raw_data
FROM
(
SELECT data_time, data_type, ST_Tile(raw_data, 250, 250) As raw_data
FROM data_full
WHERE data_time = '2015-12-06 00:00:00' AND data_type = 'a'
) as f
WHERE t.data_time = f.data_time AND t.data_type = f.data_type;

but this will result in one tile copied to every row. For example, source is tiled to 18 rasters, 18 rows is updated, but every row has the same content. I need it to be each row its own tile.


texts:
I am looking for software to present GIS files (OSM preferred) with these features:

work offline (means I can download a map and present it online in the software).
compatible with Windows 7, 32 bit.
open source code available in Java so I can add it into a desktop app.
editor is preferred as I would like to add 2 features to this map (a balloon with information and fixed length range circle).


texts: Producing gradients between shapefiles and using original boundarys as isoclines (lines)

texts:
to produce a bathmertical map of a river bed I draw shapefiles showing the different depths based on satellite images taken during different tidal levels (deepest, 2nd deepest, 3rd deepest, shore etc). to produce a final map would like 2 things:
- draw isoline (lines along the boundaries of different shapefiles
- shade or make gradients from on shapefile into another that also covers little gaps between the individual shapefiles.

How can I do this using QGIS/ grass?


texts: Normal Proxy Settings block OSM Tools Plugin

texts:
I would like to know if there is a good workaround / solution for proxy settings in an work/ office environment?

More detailed, with usual proxy settings from our IT departement some plugins like OSM Tools don't work. It just goes to request the server but not further.

Our IT Deparment can't see any request to a server like the OSM layer does if you change the map extent or scale..

So, without proxy settings - everything just works fine. But because of reasons we need proxy, but it seems like QGIS does not fetch the user settings if user proxy settings are set.

To clarify:

Also it seems like different plugins use ways around the proxy settings or just ways that aren't visible for our IT departement. And because of that, they can't set them free to use.

thats how the stamen layer looks like with enabled proxy settings.


texts: QGIS web client installation: this.projectSettings.capability is undefined

texts:
I am trying to debug my configuration of QGIS web client.

I have the same problem illustrated here (the GIS-Browser appears but it keeps loading map for the two sample projects ). Yet following the instructions in the same post doesn't solve the problem for me.

The apache log doesn't indicate any error, just warnings

Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.

Yet debugging the page where the maps don't load I get the JS error

TypeError: this.projectSettings.capability is undefined

I can't find any explanation of that.


texts: Exporting QGIS Raster/Vector layers into one PDF?

texts:
I have seen a similiar post to this a while back (Is it possible to export geospatial PDF from QGIS via GDAL/OGR?), and thought I would try asking it again to see if there has been any improvement or new knowledge on this.

Is it possible to export one PDF with multiple layers like the picture shows?

The above shows a Raster image (WMS) and 4 different Vector layers, is it possible to get all these into one PDF as different layers? As shown below, where you can click/unclick each layer?


texts: How to show labels in curved pattern in QGIS?

texts:
When I am trying to show label of these roads parallel almost all roads are showing, but in curved type visibility of labels are getting reduced. How I can show all roads names curved to road?

Using QGIS v2.18.20 in Windows.


texts: EarthEngine - Create a Clipped Global Surface Water Occurrence Layer

texts:
I am looking to create an inland surface water layer using Earth Engine. The JRC Global Surface Water Mapping Layers, v1.2 - Occurrence band is exactly what I want, but as you can see in the attached screenshot (based on below EE code) there is a thick band of blue that extends into the ocean. Has anyone successfully clipped this occurrence band by, say an ocean layer, so that it only includes the inland water? Or am I approaching this wrong and should be thinking of a different approach?
var occurrence = gsw.select('occurrence');

var VIS_OCCURRENCE = {
  min: 0,
  max: 100,
  palette: ['red', 'blue']
};

Map.setCenter(-58.6325312, 6.4030749, 9); // Center on Bartica

// Display the image on the map.
Map.addLayer({
  eeObject: occurrence.updateMask(occurrence.divide(100)),
  name: "Water Occurrence (1984-2015)",
  visParams: VIS_OCCURRENCE
});

![Global Water Layer in Bartica](https://i.stack.imgur.com/dG6BU.jpg)


texts: Interpolating point values to line using ArcMap

texts:
I have count data for different trails. They are points and I would like to make an average of those counts for each trail so that each trail has a count value.

Later on I would like to have a probability of encoutering the different species that were counted along those trails depending on the average counts.

I am fairly new to GIS and I have no idea which tool I could use to do that. I was thinking of interpolation but I want to model the trails only, not the whole layer.


texts: proj.4 definition for Moscow GCS_Bessel_1841 to WGS84 convertion

texts:
I'm developing an app which should show a map using Leaflet framework but i have no luck as
the coordinate system on the map server differs from the one used by Leaflet.

As a map server i use Arcgis which is accessed by means of REST interface
The coordinate system used by the server is GCS_Bessel_1841. WKT definition: GEOGCS["GCS_Bessel_1841",DATUM["D_Bessel_1841",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",37.5],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",55.66666666666666],UNIT["Meter",1.0]
I use proj.4 to convert GCS_Bessel_1841 to WGS84 (used by leaflet) but can't figure out how to make a correct definition especially how to write +towgs84.

The question is how to figure out the values for DX,DY,DZ,RX,RY,RZ.

The afterall my proj.4 defitiion looks like:
+proj=tmerc +lon_0=37.5 +lat_0=55.66666666666666 +ellps=bessel +towgs84=0,0,0,0,0,0,0 +a=6377397.155 +b=6356078.962818188 +pm=greenwich +k_0=1 +x_0=0 +y_0=0 +units=m +no_defs

The Leaflet code:

`var crs = new L.Proj.CRS('EPSG:3857',
    '+proj=tmerc +lat_0=55.66666666666666 +lon_0=37.5 +k=1 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs',
    {
        origin: [-5622500.0, 3830200.0],
        resolutions: [
            305.74811314055756,
            152.87405657041106,
            76.43702828507324,
            38.21851414253662,
            19.10925707126831,
            9.554628535634155,
            4.77731426794937,
            2.388657133974685,
            1.1943285668550503,
            0.5971642835598172,
            0.29858214164761665,
            0.14929107082380833
        ]
    });

var map = new L.Map('map', {
    crs: crs
});

var tileUrl = 'http://egip.mka.mos.ru/arcgis/rest/services/osnova_wgs_cached/MapServer/tile/{z}/{y}/{x}',
    attrib = '© 2012',
    tilelayer = new L.TileLayer(tileUrl, {
        maxZoom: 12,
        minZoom: 0,
        continuousWorld: true,
        attribution: attrib,
    });

map.addLayer(tilelayer);
map.setView([ 55.750984, 37.617571], 0);

map.on('mousemove', onMapMouseMove);'
`


texts: Exporting shapefiles to NetCDF Format using QGIS?

texts:
I'm completely new to using GIS but I've got some shapefiles that I really need in NetCDF format for further analysis.

Does anyone know if this is possible in QGIS?

I know that you can do this using NCL but unfortunately it is not installed on the system I'm working from.


texts: Exporting geospatial PDF for Avenza from ArcGIS Pro?

texts:
I'm struggling to export a functional geospatial PDF from ArcGIS Pro for use in Avenza maps.  I believe the issue stems from ArcGIS Pro's force feeding of "rich" PDFs on the user. The maps completely stall during download in Avenza while similarly sized files from ArcMap are fine.

See: https://community.esri.com/thread/179579

Generally I have workarounds for ArcGIS Pro's PDF export process, so that I can produce smaller, rasterized files.  However none of them seem to preserve the map's spatial reference information, rendering the map useless for me in the Avenza app.

Has anyone else come across this?


texts: VBA script for Incremental labeling in Field Calculator?

texts:
I have a shape file with a bunch of pipes in it.  I would like to be able to label each pipe with "Pipe - X".  X being the number in the row that the pipe falls on (Pipe - 1, Pipe - 2, Pipe - 3, etc).

I've tried using a for loop VBA Script for this but it doesn't work.  The VBA script is as follows:

For counter = 1 To 192
Y = "Pipe - " & counter
Next counter

Pipe_ID = Y

My result is "Pipe - 192"

Any Ideas?


texts: Adding layers to TOC at end of ArcPy process?

texts:
I would like each function to be added into the opened mxd.  This was originally designed to run in Catalog, but the users will all be using ArcMap.

This is my Script:

# nrcs_script_main.py

# Description: This Script will serve to create a geodatabase, create Area of Interest Raster Datasets, and process them with external functions
# Parameters (type): folder_for_gdb (folder), file_gdb_name (string), dem (raster dataset), input_mask_polygon (shapefile), contour_interval (double), smoothing_distance (linear unit)
# ---------------------------------------------------------------------------

# Set the necessary product code
import arceditor

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")

# Import tool modules
import sys
import os
import shutil
import aoigen
import useraoigen
import contourgen
import hydrology
# Script arguments
project_folder = arcpy.GetParameterAsText(0)
folder_for_gdb = project_folder + "\\" + arcpy.GetParameterAsText(1)
file_gdb_name = arcpy.GetParameterAsText(1)
dem = arcpy.GetParameterAsText(2)
dem_sr = arcpy.GetParameterAsText(3)
extraction_checkbox = arcpy.GetParameterAsText(4)
input_mask_polygon = arcpy.GetParameterAsText(5)
mask_polygon_sr = arcpy.GetParameterAsText(6)
aoi_buffer_dist = arcpy.GetParameterAsText(7)
contour_checkbox = arcpy.GetParameterAsText(8)
contour_interval = arcpy.GetParameterAsText(9)
if contour_interval == '#' or not contour_interval:
    contour_interval = "1" # provide a default value if unspecified
smoothing_distance = arcpy.GetParameterAsText(10)
contour_thinning = arcpy.GetParameterAsText(11)
import_rule_layer = arcpy.GetParameterAsText(12)
contour_unit_conversion_factor = arcpy.GetParameterAsText(13)
hydrology_checkbox = arcpy.GetParameterAsText(14)

# Copy and Paste job folder
arcpy.AddMessage("Copy and Paste Folder")
src = os.path.join("C:\\",'ArcPy_NRCS','Template')
dst = folder_for_gdb
shutil.copytree(src,dst,symlinks=False,ignore=None)

# Rename Map Document
arcpy.AddMessage("Rename directories and Documents")
os.rename(dst + '\\template.mxd', dst + '\\' + file_gdb_name + '.mxd')

# Execute Selected Functions
if extraction_checkbox == "true":
    arcpy.AddMessage("Aoigen.aoi")
    aoigen.aoi(folder_for_gdb, file_gdb_name, dem, input_mask_polygon,aoi_buffer_dist)
    if contour_checkbox == "true":
        arcpy.AddMessage("Running Contouring Functions")
        contourgen.contour(folder_for_gdb, file_gdb_name, contour_interval, smoothing_distance, contour_thinning, import_rule_layer, contour_unit_conversion_factor)
    if hydrology_checkbox == "true":
        arcpy.AddMessage("Running Hydrology Functions")
        aoi =  folder_for_gdb +"\\" + "Project_Datasets.gdb" + "\\" + "AOI_dem"
        hydrology.drainvis(folder_for_gdb,file_gdb_name,aoi)
else:
    arcpy.AddMessage("useraoigen.useraoi")
    useraoigen.useraoi(folder_for_gdb, file_gdb_name, dem)
    if contour_checkbox == "true":
        arcpy.AddMessage("Running Contouring Functions")
        contourgen.contour(folder_for_gdb, file_gdb_name, contour_interval, smoothing_distance, contour_thinning, import_rule_layer,contour_unit_conversion_factor)
    if hydrology_checkbox == "true":
        arcpy.AddMessage("Running Hydrology Functions")
        aoi =  folder_for_gdb +"\\" + "Project_Datasets.gdb" + "\\" + "AOI_dem"
        hydrology.drainvis(folder_for_gdb,file_gdb_name,aoi)

# Add Map in ArcGIS
mapdoc = os.path.join(folder_for_gdb,file_gdb_name+".mxd")

arcpy.AddMessage("Lidar Toolset Finished! Your Map document will open when this window is closed.")


texts:
There is an existing similar question here that I have tried but didn't give me what I need.

I have an image with 20 spectral bands.  How do I compute the area under the spectral curve that is bounded by the x (wavelength), y (reflectance) and the curve itself?

img <- brick("sample.tif")
a <- as.array(img)

I was thinking of making an array of the values, then maybe from that I could compute the area as suggested here.  However, I just do not know how to proceed, with the many columns of spectral bands I have.


texts: How to decode GPS coordinates from Android device XML file?

texts:
I’d like to decode the location coordinates from the XML file from my Android phone (SGS2). Any solution how to do it, how to convert them to usable coordinates (longitude/latitude)?
Looks like it's base64 encoded. from there, no idea.

<string name="lastPosition">wLphlm9S56tDr+Ruft1URA4iubjA111HfIdVuhw3cC8=</string>

Full XML example:

<map>
 <string name="lastPosition">1j+wY60EYdawR3UTnoSsbAcGWRDIlNTCd0j3zXZO1D4=</string>
 <int name="deviceTag" value="1118448321"/>
 <long name="locationReportingIntentTimstamp" value="1363120660401"/>
 <float name="lastAccuracy" value="759.0"/>
 <boolean name="locationHistoryEnabled" value="true"/>
 <long name="lastTimestamp" value="1363121442835"/>
 <long name="lastIntentProcessedTimestamp" value="1363121443003"/>
</map>


texts:
When I try to change with python the datasource of a WFS layer, QGis crashes with this error:

Warning: QObject::connect: Cannot connect (null)::raiseError( QString ) to QgsVectorLayer::raiseError( QString )

My code is:

        ...
        newDatasource = urllib.quote_plus(wfsURI)
        WFSLayer.setDataSource(newDatasource, wfs_layer_name, "wfs", True)
        WFSLayer.reload()

where WFSLayer is a qgis._core.QgsVectorLayer.

Any suggestions?


texts: How can I automatically extract attributes in a Shapefile for a group of points (latitude and longitude) using QGIS?

texts:
I have a Shapefile for the City of Montreal with buildings' attributes. I also have the coordinates (Latitude and Longitude) of a group of points and I want to extract the attributes for each point.

My idea is to follow steps like this:

import a .txt or CSV file which includes the location of the points into the QGIS.
Extract the attributes of each point from the shapefile.
export data into a new csv or txt file.

I am a beginner with QGIS and I don't know something like this is doable using QGIS API or there is another solution for it.


texts: pdal | issues when using tiledb reader in python

texts:
I have created an fresh conda environment and installed pdal per the pdal Quickstart instructions:

conda create --yes --name pdalplayground --channel conda-forge pdal

All applications (tindex, tile, info, pipeline...etc) when run from the environment's command line work as expected.

I am working on a simple pipeline, where the first stage is reading from tiledb.  When I "hard-code" in various parameters in this pipeline (pipeline.json), and run pipeline application from command line - everything works.

So then I tried reproducing pipeline in a python script (below).  At first, I got this error.  I had installed python-pdal from conda-forge as well.

RuntimeError: Couldn't create reader stage of type 'readers.tiledb'.

Poking through the pdal FAQ - it looks like I need to update the search path for plugins.  I have done this at top of script - just pointing to the bin directory created from conda pdal package.

os.environ["PDAL_DRIVER_PATH"] = r'C:\Users\hodgest\.conda\envs\pdalplayground\Library\bin'

After setting PDAL_DRIVER_PATH - the tiledb reader works in the python script.  So then I added a reprojection stage.  Sometimes the script below totally crashes the python process, other times it completes just fine.  I am not modifying the underlying tiledb array at all.

Am I doing something obviously wrong here?

import json
import pdal
import os

os.environ["PDAL_DRIVER_PATH"] = r'C:\Users\hodgest\.conda\envs\pdalplayground\Library\bin'

PIPELINE = [
    {
        "type": "readers.tiledb",
        "array_name": "barrylidar"
    },
    {
        "type": "filters.reprojection",
        "in_srs": "EPSG:32615",
        "out_srs": "EPSG:4326"
    }
]

pipeline = pdal.Pipeline(json.dumps(PIPELINE))
pipeline.validate()

# set pdal log level
pipeline.loglevel = 8

# execute the pipeline
count = pipeline.execute()
arrays = pipeline.arrays
metadata = pipeline.metadata
log = pipeline.log
print("done")


texts: Route planning with detours for "nearby" Points of Interest

texts:
I want to know if Google maps, Open Streetmap, or some alternative, lets me plan a route by foot (or bicycle, maybe also car, or even public transportation, but by foot is my initial project) from point A to point B  …

BUT… it should be able to offer a detour  if certain points of interest are “nearby”, where I get to define “nearby”, whether in terms of distance or time added, and I can choose from the API's POIs, or define my own list.


texts:
Possible Duplicate:
  How to configure GeoWebCache that it can generate tile files conform Slippy Map format

With my little knowledge on geoserver, I need to setup a server with can use local tiles of 256x256 size and in jpeg format. The format of directory structure is z/x/y. I tried using the options available in geoserver, but did n't get success. Could anyone guide me with steps to be followed to setup this?


texts: Installing previous versions of QGIS on Ubuntu

texts:
I have been doing some work with QGIS 3.12 Bucaresti. For some reason I had to reboot the computer so I installed QGIS again. However, the official QGIS repository is now installing a newer version (QGIS 3.16 Hannover). With this newer version the previous work I did is not working. Tried also 3.18 Zürich but no luck either.
The work is a code that connects a software with QGIS to send data from one to another, I mean, it is not a particular fixture that provides QGIS by default.
I have been searching and I found this https://qgis.org/downloads/ which saves previous versions of QGIS. However I have not managed yet to properly installed QGIS 3.12.
Wondering if anyone has done it before or knows what steps I should follow to install previous versions of QGIS on Ubuntu.


texts: A list of layer names that you want to be turned off when Layers name are in Right to Left Such as persian

texts:
When I ran this code I got "UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal" error I don't know why I tried many way but I could not success where is my mistake?

# -*- coding: utf-8 -*-
#A list of layer names that you want to be turned off.
import arcpy
names =["باران سنجی","برف سنجی","هیدرومتری"]
arcpy.env.workspace = "E:\GIS\Data_Base_93_07_10\Data_Base.gdb"
mxd = arcpy.mapping.MapDocument(r"E:\GIS\WebGIS_Abniro_Final.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
layers = arcpy.mapping.ListLayers(mxd)
for layer in layers:
    if layer.name in names:
        layer.visible=False
        print layer.visible
arcpy.RefreshTOC()
arcpy.RefreshActiveView()


texts: In the attribute table I have a column "the end of the contract" with date. I want QGIS to show me the label "!" when there will be 30 days or less until the end of the contract.


texts: Failed load delimited layer in QGIS python console

texts:
I'm trying to follow the map rendering section from the PyQGIS cookbook. I am able to render a shapefile using qgs vector layer, however getting error prompt while loading delimited text file through qgs vector layer.

My script is (running in QGIS python console)

from qgis.core import *
from qgis.gui import *
from qgis.utils import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtXml import *

mapinstance = QgsMapLayerRegistry.instance()
mapinstance.removeAllMapLayers()

layer = QgsVectorLayer("f:\scripts\map\wb.shp", "wb", "ogr")

if layer.isValid():
    print "shape layer successfully loaded - adding to map instance"
    mapinstance.addMapLayer(layer)
else:
    print "shape layer failed to load!"

uri = "f:/scripts/map/points.csv?delimiter=%s&xField=%s&yField=%s" % (",", "longitude", "latitude")
vlayer=QgsVectorLayer(uri,"points","delimitedtext")

if vlayer.isValid():
    print "point layer successfully loaded - adding to map instance"
    mapinstance.addMapLayer(vlayer)
else:
    print "point layer failed to load!"

print mapinstance.mapLayers()
# create image
img = QImage(QSize(800,600), QImage.Format_ARGB32_Premultiplied)
# set image background color
color = QColor(255,255,255)
img.fill(color.rgb())
# create painter
p = QPainter()
p.begin(img)
p.setRenderHint(QPainter.Antialiasing)
render = QgsMapRenderer()
# set layer set
lst = [ layer.id() ] # add ID of every layer
render.setLayerSet(lst)
# set extent
rect = QgsRectangle(render.fullExtent())
#rect.scale(1.39800703)
rect.scale(1.1)
render.setExtent(rect)
# set output size
render.setOutputSize(img.size(), img.logicalDpiX())
# do the rendering
render.render(p)
p.end()

# save image
img.save('f:\scripts\out.png',"png")

and points.csv file contains following data

longitude,latitude

88.3697222,22.5697222

87.3194986,22.3243243


texts:
I am trying to write a script that pans to every point of layer, creates a temporal buffer to "highlight" point and exports the image. I want buffer to be deleted after every loop run, so I can use the same name again. Using that symbology that I have chosen is loaded for buffer. Here is the code:

import arcpy
import os
from arcpy import mapping

def point_coords_to_extent(point_coords):
    extent = arcpy.Extent(point_coords[0], point_coords[1], point_coords[0], point_coords[1])
    return extent

mxd = mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd)[0]
out_folder = r"C:\Users\Me\Desktop\export"
with arcpy.da.SearchCursor("ALEJA_test", ["SHAPE@XY","adr_for","nazwa", "OID@", "SHAPE@"]) as cursor:
    for row in cursor:
        if row[1] not in (""," "):
            df.panToExtent(point_coords_to_extent(row[0]))
            arcpy.Buffer_analysis(row[4], "BUFFER_HIGHLIGHT", "30 Meters")
            arcpy.RefreshActiveView()
            arcpy.RefreshTOC()

            arcpy.mapping.ExportToPNG(mxd, out_folder + "\\" + str(row[1][8:]) + "_" + row[2] + "#"+ str(row[3]) +'.png', resolution = 300)
            arcpy.Delete_management("BUFFER_HIGHLIGHT")

The problem is that when I use it as a script tool I get properly exported zoomed images, however there is no buffer. When I paste it directly to Python window in ArcMap, after first export I get the error that "BUFFER_HIGHLIGHT" already exists.

Does anyone has an idea how to fix it? (script tool is my aim)

EDIT:
Instead of deleting buffer I 've set arcpy.env.overwriteOutput = True and it works fine BUT only in Python window. Why it is not generating the same in script tool? What is the difference?


texts: gdalwarp from epsg:4326 to epsg:3413; error: Too many points failed to transform, unable to compute output bounds

texts:
GDAL ver     : GDAL 3.1.1, released 2020/06/22
Python         : 3.8.0
OS:               : windows 10
Input file       : 7200 x 3600 GeoTIF in epsg:4326
File link        : [https://www.dropbox.com/s/z9th2kbp6n3zvbu/sst_bw.tif?dl=0]  (~100mb; Sea Surface Temperature data)
Req output   : in epsg:3413 SRS
in WKT: "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
Console command:
gdalwarp -s_srs "EPSG:4326" -t_srs "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" sst_bw.tif sst_bw_3413.tif

Error:
Creating output file that is 5692P x 5692L.
Processing sst_bw.tif [1/1] : 0Using internal nodata values (e.g. -32768) for image sst_bw.tif.
Copying nodata values from source out_data\sst_bw.tif to destination sst_bw_3413.tif.
ERROR 1: Too many points (529 out of 529) failed to transform, unable to compute output bounds.
Warning 1: Unable to compute source region for output window 0,0,5692,5692, skipping.
...10...20...30...40...50...60...70...80...90...100 - done.

Can someone suggest how to get it working and output correctly. Currently, it creates a file with no data with the primary error:

'ERROR 1: Too many points (529 out of 529) failed to transform, unable
to compute output bounds.'

My apologies if the question seems trivial, as I'm very new to GDAL. I searched through similar questions but they have either not been answered or do not have test data. So, I thought of making a complete post with test data.


texts: Leaflet - Creating lines to connect GeoJSON points

texts:
How do I create lines connecting GeoJSON point features with the same "ligne" data following a given order (Id for exemple).

This is what my GeoJSON looks like :

{
"type": "FeatureCollection",
"name": "test",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 0, "nom": "JAMAA EL FNA", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -7.991506070410076, 31.624380871588261 ] } },
{ "type": "Feature", "properties": { "id": 1, "nom": "KOUTOUBIA", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -7.993921192850516, 31.62551706188404 ] } },
{ "type": "Feature", "properties": { "id": 2, "nom": "HOTE DE VILLE", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -7.997800602958748, 31.627492814514493 ] } },
{ "type": "Feature", "properties": { "id": 3, "nom": "R.P BERDII", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -8.003733858117105, 31.630010280990067 ] } },
{ "type": "Feature", "properties": { "id": 4, "nom": "GRAND POSTE", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -8.009040991276375, 31.633004916540266 ] } },
{ "type": "Feature", "properties": { "id": 5, "nom": "CAREE EDEN", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -8.011327830139466, 31.634311225216251 ] } },
{ "type": "Feature", "properties": { "id": 6, "nom": "PL ABDELMOUMEN", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -8.01491129321975, 31.63631744889955 ] } },
{ "type": "Feature", "properties": { "id": 7, "nom": "PLACE D ARMES", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -8.017961238223567, 31.63862644522986 ] } },
{ "type": "Feature", "properties": { "id": 8, "nom": "FST", "ligne": "L1", "ville": "MARRAKECH", "direction": "A" }, "geometry": { "type": "Point", "coordinates": [ -8.019317263334594, 31.64420691382918 ] } }, .....


texts: Is there a way to set QGIS to automatically load in images with no data values of (0,0,0) as transparent instead of black? I've looked through the forums, tried saving a .qml file out, looked through all the settings, and I can't find a way to do it. We process thousands of images, and we need to be able to look at them without black no-data areas covering up the images underneath. I can manually set it by going in to the properties of a raster layer, putting 0 in as a no data value and hitting apply, but I need a way to do this automatically when the images load in. In ERDAS Imagine or ArcGIS this is an easy thing to set. Can it be done in QGIS?


texts: No Exception Handling in GDAL/OGR java bindings: ogr.UseExceptions() has no effect

texts:
When a GDAL/OGR 2.0.1 swig/java operation encounters an error, the message is written to stderr but no exception is thrown within the application -allowing it to continue, which is highly undesirable.I have tried ogr.UseExceptions() but this seems to just erase the error message from stderr and not result in a thrown exception within the application!

Is there another method required to get the error handling to work properly, or is this just a limitation with the bindings?


texts: How to most consistently get all bus stops from Overpass?

texts:
I'm using overpass (the python wrapper overpy) to get bus stops in an arbitrary bounding box (i.e., any city) in Europe, and I was wondering which tags I can most consistently expect to be present - i.e., which query I should use.

The reason I'm asking: I noticed a large variation in the number of results, even within countries. In my case, the query node["public_transport"="platform"]["bus"="yes"] returns hundreds of results in Hamburg, but only 5 (long-haul only) in Berlin.


texts: OpenLayers and WFS: Using a mapfile correctly with featureType and featureNS

texts:
For starters, I went off the example at http://openlayers.org/dev/examples/wfs-reprojection.js and got that working just fine with the states vector layer showing up.

Now I'm trying to use my own mapfile (wfs_navdata_02.map) and do the same. Just one layer for now, cities_1x.

var wfs = new OpenLayers.Layer.Vector("My Layer", {
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.WFS({
                version: "1.1.0",
                srsName: "EPSG:4326",
                url:  "http://my_local_url/cgi-bin/mapserv.exe?map=/file_location/wfs_navdata_02.map",
                featureType: "cities_1x",
                featurePrefix: "",
                featureNS: "http://yourdomain/application/catalogLayer"
            }),
    });
    map.addLayer(wfs);

What do I put in for featureNS? For the url, is referencing the mapfile like that ok? I read one poster that said he needed to use featurePrefix but I don't think thats necessary here.

Also for featureType, is that the name of the LAYER or the wms_title within the layer?

I've successfully used WMS before but WFS is a bit more confusing. I am not having any errors in the javascript console via Chrome.

Snippet of mapfile can be seen here: http://codeshare.io/C1hki

Not sure if OUTPUTFORMAT is necessary.

Any input is appreciated.


texts:
is there any api to get bounds of city. What i want is i give city name and in return i get that city boundaries.

I have searched google maps, arcgis and OpenStreetMap but didnt found any satisfactory response. I have also used openstreetmaps api but no luck.


texts: Filtering GeoJSON data to include in Leaflet map

texts:
I am trying to filter through my geojson polygons and get all data entries with a specific attribute.

I have a layer of polygons describing parks around the city parks.json. I want the user to click on a button and see parks that have picnic areas. I have GeoJson data in the following format:

{"type":"Feature",
"geometry":{
    "type":"Polygon",
    "coordinates":[[[long1, lat1],[long2, lat2],[long3, lat3]]]},
    "properties":
{
    "Playground": Yes,
    "Picnic":Yes,
    "ParkName":"Barr Lake",
    "ParkStatus":"Open"}

How do I retrieve all of the polygons where "Picnic" = "Yes" and map them?

I tried this with no luck:

var picnic_parks = $("parks.json").filter(' "picnic":"Yes" ').addTo(map);


texts: Using field calculator for attribute table data in QGIS

texts:
I'm experimenting with adding fields to attribute table data in QGIS 2.14.5LTR (mainly *.csv files) and stumble into a variety of issues or some things I do not understand, respectively. I imported a csv file via import text file as layer button, drag and and dropped the same file to the project and saved the latter as csv from QGIS.

My s(i/a)mple project looks like this (note the edit state of the layers):

1st scenario - import *.csv file and trying to add a field with field calculator.

When opening a *.csv file and trying to do so, I'm only able to add a virtual field to the table (Which can obviously not be used for joins, which is the aim of the game in the end). Strange enough: When dragging the same file into the project, I'm able to toggle editing mode and add new fields.

The imported *.csv file looks like this (no column headers):

92891A14.1;Eigenausbau;92891A14;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Döbra;Tannenweg;3;;2;4475738;5571977;272;11,99;11300;;30001;;100001;
92891A17.32;Eigenausbau;92891A17;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Schwarzenbach;Thiemitztalstr.;11;;1;4472917;5572009;432;16,61;12430;;30001;;90001;
92891A30.31;Eigenausbau;92891A30;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Schwarzenbach;Hochstr.;26;;15;4473440;5571918;147;4,78;13560;;30001;;100001;
92891A1.69;Eigenausbau;92891A1;09475169;Bayern;Hof, Landkreis;95131;Schwarzenbach;Schwarzenbach;Hauptstr.;16;;1;4473041;5571724;428;16,93;12430;;30001;;90001;

2nd scenario  - saving the opened csv file as csv

Done so, I'm now able to switch to toggle editing mode and add a new field to the layer the usual way:

The saved *.csv file looks like

field_1,field_2,field_3,field_4,field_5,field_6,field_7,field_8,field_9,field_10,field_11,field_12,field_13,field_14,field_15,field_16,field_17,field_18,field_19,field_20,field_21,field_22
92891A17.32,Eigenausbau,92891A17,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Thiemitztalstr.,11,,1,4472917,5572009,432,16.61,12430,,30001,,90001
92891A30.31,Eigenausbau,92891A30,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Hochstr.,26,,15,4473440,5571918,147,4.78,13560,,30001,,100001
92891A1.69,Eigenausbau,92891A1,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Hauptstr.,16,,1,4473041,5571724,428,16.93,12430,,30001,,90001
92891A17.31,Eigenausbau,92891A17,9475169,Bayern,"Hof, Landkreis",95131,Schwarzenbach,Schwarzenbach,Thiemitztalstr.,22,,1,4472928,5572055,428,16.47,12430,,30001,,90001

Note: re-importing the saved *.csv layer leeds to the same issue as in 1st scenario

3rd scenario - Trying to add a field to the saved layer via field calculator from processing toolbox

Further more, attribute tables can not be selected as input layers for the field calculator from the processing toolbox (note the empty dropdown):

Questions:

What is the difference between the two *.csv layers in 1st and 2nd scenario (or the different ways they come into the project)? Why can the saved layer be edited and have fields added and the layer imported from a text file can not, but can, when dragged and dropped to the project?
What is the difference between all the field calculators and is there a way to add fields to a table with any processing tool?


texts: A method for noise reduction in GPS derived cycling routes

texts:
I'm pre-processing GPS data to assess possible methods for a planned research. The aim of the research is to use crowd-sourced cycling routes data to plan a cycling paths in an Israeli city.

Currently I'm using my own walks data to form a GIS working process. In short:

Data is collected using a mobile app (http://www.sports-tracker.com/dashboard), giving point location (lat,lon), altitude and a timestamp.
Data is parsed from its .gpx (xml) format using R. Distance in meters, speed and Z values for speed are being calculated.
Data is written out as polylines (for each walk); that is one line between any two points, to form one polyline shapefile for each route. The output is a .csv file with WKT as the geometry column.

Further on, I plan to overlay multiple routes from many users, to form a map of magnitude of use and reative velocities (using the Z-values). The velocities are meant to detect obstacles.

One problem is noise routes  due to GPS accuracy limitations. The image below gives an example for such noise (Google maps on the background to give context):

I'm trying to think of a way to clean the data, that is to remove the noisy paths (or nodes) an by-pass them with a straight line.
The only thing that came in mind is to find self-intersections using arcmap topology; but I'm still looking for more ideas. Note that this process must be automated, since it will be preformed many times (hopefuly some thousands of times).

I'm open to qgis, grass-gis, python, arcmap and R solutions; but mainly looking for an algorithm (workflow).

Any Ideas?


texts: Accessing Polygons of Dissolved Layers in QGIS

texts:
I've been trying to access the polygons of a dissolved layer in QGIS, and every time I query them, I get an empty polygon back. My procedure is as follows:

I start with a layer of polygons, and use the dissolve feature to dissolve some of them (this is not a problem, and the layer is generated, and I can see it, highlight it, and interact with its features)
In the python console, I find a feature in this layer, and type:

feature.geometry().asPolygon()

which returns

[]

even though I can highlight it in the map interface.

Am I misunderstanding the scope of the asPolygon() function?

I figured out my mistake! To all future readers: the dissolve function may output multiple polygons as a single feature, meaning that they are a multipolygon, not a polygon. Thus, the function that should be called is geometry().asMultiPolygon() to return the co-ordinates.


texts: I could not find the option to include the DEM and RPC files in Orfeo (Geometry tool). Please, review the attachment.


texts:
Is there a way in ArcGIS10 to export all feat classes, tables, datasets all at once as XML?  I know there is a batch command but still appears you have to select items.
I am in process of writing a script but do not yet know what method/function in ArcGIS to use that would get all at once the FeatureClassList, TableList, and DatasetList instead of getting one by one and then manipulating.

Any Help is appreciated!
Thanks.


texts:
I am currently trying to use leaflet to display images (jpeg or png) instead of maps, I have followed the instructions on this blog post to create the tiles using gdal2tiles.py here is the code we used

gdal2tile.py -p raster -z 0-5 -w none "SOURCE_PATH.png" "DESTINATION_FOLDER"

The command produces the necessary tiles for leaflet, but the problem is that it takes around 2 minutes to create tiles for the attached image (size: 777KB, resolution: 2592x1728) and a disastrous number of tiles of around 1600 file.

I am trying to optimize the time and number of files to generate tiles for leaflet and looking for suggestions, please help.


texts: Generating contours from DEM using GDAL?

texts:
We have just received a large set of DEMs at work and I would like to generate contours from them.  The DEMs have a resolution of 1m and a size of 1kmx1km.
Output from gdalinfo:
Driver: AAIGrid/Arc/Info ASCII Grid
Files: 380000_6888000_1k_1m_DEM_ESRI.asc
Size is 1000, 1000
Coordinate System is `'
Origin = (380000.000000000000000,6888000.000000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Corner Coordinates:
Upper Left  (  380000.000, 6888000.000)
Lower Left  (  380000.000, 6887000.000)
Upper Right (  381000.000, 6888000.000)
Lower Right (  381000.000, 6887000.000)
Center      (  380500.000, 6887500.000)
Band 1 Block=1000x1 Type=Float32, ColorInterp=Undefined
  NoData Value=-9999

I know I can use gdal_contour to generate the contours (my blog post on the topic) but I'm wondering what some best practices for generating contours are.
Are there any rules you should follow to get the most out of the contours but not make stuff up or loose too much information?
Say I want to generate three sets of contours:

250mm
1m
5m

Is there anything I should do to the DEM before each set?
Is post smoothing of the lines a good way to go or is smoothing the raster a better option?


texts: Clip a raster based on the extent of another raster in ArcMap

texts: I need to clip a raster to extract only the surface in common with another raster. How can I do that in ArcMap?


texts: I realize it is not listed as a supported Database.  I am interested to see if anyone has tried to install and use it.


texts: Making Large Data Sets Faster in ArcGIS Online or Portal

texts:
I have a sql view joined to a parcel layer for the entire city of New York (over 800k records). All data is registered to to the arcgis server. As you could imagine, this produces very slow response times in ArcGIS itself and when published to an online mapping service. Does anyone have any ideas on a different approach to linking this data or publishing methods to cut down loading times?

It looks like publishing a Tiled Service has improved speed but so far i am unable to toggle different layers off and on, furthermore, while my configured pop-ups remain in place, i am unable to reconfigure them.


texts: Pyproj projection 0.5 meter differnce from official results (IGD05/12,IG05/12) Israel Grid


texts:
I am trying to run a python script from within a python plugin. The script runs a CGIHTTPServer in a separate thread. It works as expected when executed from the command line and i can issue requests from the browser but when run from the plugin as an import the browser never loads the issued request. Any advice?

Here is my server code:

"""
A stoppable, threadable version of Jurgen's origin server
"""

import CGIHTTPServer
import BaseHTTPServer
import httplib
import threading
import sys

class RequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
    cgi_directories = ['/scripts']

    def do_QUIT (self):
        """Send 200 OK response, and set server.stop to True"""
        self.send_response(200)
        self.end_headers()
        self.server.stop = True

class StoppableHttpServer(BaseHTTPServer.HTTPServer):
    """A http server that reacts to self.stop flag"""

    def serve_forever (self):
        """Handle one request at a time until stopped."""
        self.stop = False
        while not self.stop:
            sys.stdout.flush()
            self.handle_request()

class ServerInThread(threading.Thread):
    """A class designed to start a stoppable HttpServer in a separate thread."""

    def __init__(self):
        """Initialize the port to use for the server and start the thread"""
        self.port = 3030
        threading.Thread.__init__(self)

    def run(self):
        """Method that is called when the start() method of an instance is called"""
        server = StoppableHttpServer(("", self.port), RequestHandler)
        server.serve_forever()

def stop_server(port):
    """send QUIT request to http server"""
    conn = httplib.HTTPConnection("localhost:%d" % port)
    conn.request("QUIT", "/")
    conn.getresponse()

And this is what my qgis plugin does. It has 2 button with the following methods:

from syncServer import *

# other initialization code

# Method to start the server
def startServer(self):
    """Start sync server in a seperate thread"""
    # check if server instance exists
    if not hasattr(self, 'threaded_server') or self.threaded_server is None:
        self.logger.info("Starting new server thread")
        self.threaded_server = ServerInThread()
        self.logger.info("Starting server")
        self.threaded_server.start()
        self.logger.info("Serving at port %d", self.threaded_server.port)
    else:
        self.logger.info("A server thread already exists")

# Method to stop the server
def stopServer(self):
    """Stop sync server via http request"""
    # check if server instance exists
    if hasattr(self, 'threaded_server') and self.threaded_server is not None:
        self.logger.info("Stopping server")
        stop_server(self.threaded_server.port)
        self.logger.info("Stopped server")
        self.threaded_server = None
    else:
        self.logger.info("No server thread exists")

Thanks in advance.


texts: PostgreSQL Trigger to keep track of table changes

texts:
I am trying to create a trigger (PostgreSQL 9.4) to track changes made to a table. This is my approach:

CREATE OR REPLACE FUNCTION taxon_history() RETURNS trigger AS
$BODY$
BEGIN
    IF TG_OP = 'DELETE' THEN
        INSERT INTO history.taxon(operacao, "data", tecnico, original_oid, taxon)
        VALUES ('DELETE', current_timestamp, current_user, old.oid, old.taxon);
        RETURN old;

    ELSIF TG_OP = 'UPDATE' THEN
        INSERT INTO history.taxon(operacao, "data", tecnico, original_oid, taxon)
        VALUES ('DELETE', current_timestamp, current_user, old.oid, old.taxon);
        RETURN old;

    ELSIF TG_OP = 'INSERT' THEN
        INSERT INTO history.taxon(operacao, "data", tecnico, original_oid, taxon)
        VALUES ('INSERT', current_timestamp, current_user, new.oid, new.taxon);
        RETURN old;
    END IF;
END;
$BODY$
LANGUAGE plpgsql;

CREATE TRIGGER history_taxon
AFTER INSERT OR UPDATE OR DELETE ON taxon
FOR EACH ROW EXECUTE PROCEDURE taxon_history();

However when something changes in the taxon table, no record is added to the taxon_history table. I also don´t get any error message so I am in the dark on why nothing is happening. What am I doing wrong?


texts: How to Update Plugin Installed Manually (Zip File)

texts: I've created a QGIS plugin (written in Python) that users install it by its zip file. But I have problem with the updating system. Whenever I release a new version I have to create a new zip file and tell them to install the new one instead. Just wanted to know if there is an easier way to do it. For example by uploading the new versions somewhere and let the plugin get the new version and install it by itself.


texts: Create an Origin - Destination map using roadnetwork layer

texts:
I am using Qgis 2.14.2, I am trying to create a O-D using the road network that I have in a feature. Is any way or plugin that can help me to plot 500 trips using as a path my road network layer? I know about the flow map plugin, but I do not understand how I should apply it, and if my data would apply it.

My data looks like:

ID - OrgX  - OrgY - DestX - DestY


texts: When will QGIS 3.0 with QT5.7 (possibly) be released as a stable and long term support version?


texts: How Does QGIS Read 'nodata' in 3 Band Raster Data?

texts:
I have 3 band GeoTiffs of aerial imagery.  The imagery is byte data with values of 0-255 on each band. A 'nodata' value has not been assigned on any band. I am assembling these images using a VRT, with no additional arguments, and displaying them in QGIS.

gdalbuildvrt out.vrt *.tif

Is it possible to tell QGIS or gdalbuildvrt to ONLY render transparency in those instances where:

b1 = 0
b2 = 0
b3 = 0

Currently, if you set transparency to zero in QGIS or use:

 gdalbuildvrt -srcnodata "0 0 0" out.vrt *.tif

many instances outside of these conditions are rendered transparent.  For example, if:

b1 = 0
b2 = 0
b3 = 15

Am I missing something in defining transparent/nodata values in QGIS or with gdal?


texts:
I want to read variables from an XML file generated by a WFS. I do this with WMS but I didn't find the equivalent of it in case of using WFS. Do you have any idea ?

here is my code :

ol.control.LayerControl.prototype.showNewLayerPanel = function(btn){
var this_ = this; //get it ready to be passed on listener functions
var urlsArray = this.options.capabilitiesURLs;
var capabJsonDocs = new Array();
  for (var i=0;i<urlsArray.length;i++){
      Ext.Ajax.request({
          url     : urlsArray[i],
          method  : 'GET',
          async   : false,
          success: function(response) {
              var parser = new ol.format.WMSCapabilities();
              capabJsonDocs.push(parser.read(response.responseXML));
              console.log("capabJsonDocs",capabJsonDocs)
          }
      });
  }

I have  options.capabilitiesURLs : ['{my_path}/geoserver/PFE/wms?request=GetCapabilities']


texts: Allow popups to show through another layer

texts:
I have a Leaflet feature layer (Layer1) with popups bound.
I'm using Leaflet Draw to draw a polygon in Layer2 over the feature layer.
I want to then be able to open the popups for Layer1 while still having Layer2 visible on top of Layer1.

Here is an example:
http://jsbin.com/keroyoy/8/edit?html,js,output

The layer of white squares has popups:

But when I draw a polygon over them, it blocks me from opening popups.

Is there a way to click 'through' the top layer? A way to make it not have a fill? I don't want to stack Layer2 behind with layer.bringToBack() because then it's not visible.


texts: Using EDN license instead of purchasing full ArcGIS licenses?

texts:
I am planning to start a business in Turkey and I need GIS software. At this moment, ArcGIS seems to be most convenient software option to me.

I'm wondering if I need the EDN License for the first time. Because when you try to buy ArcGIS for Desktop (with most of its extensions, with a price of $2,500.00 for each extension) and ArcGIS for Server, you confront a really huge budget.

But EDN License is annual. I'll have to pay $4000 for every year. It makes sense when you grow your business up. But at the starting point?


texts: ArcGIS Server WFS does not render custom style in OpenLayers 4?

texts:
When I load my WFS into OpenLayers 4 it does not use the custom style which I've specified in ArcGIS Server. The points appear in the default OL style (white transparent fill with a blue outline).

I remember that when I used GeoServer the styles specified in the server would automatically appear in OL. So I expected it to be the same way with ArcGIS Server, but I guess that is not the case. I've added styles=default& in the WFS URL but with no success.

The JS I'm using to load the WFS:

SamF2016source = new ol.source.Vector({
format: new ol.format.WFS(),
loader: function (extent, resolution, projection) {
    var url = 'https://atlas.brabant.nl/arcgis/services/fauna/MapServer/WFSServer?request=GetFeature&typeName=SamF2016&version=1.1.0&styles=default&SRSname=EPSG:3857&outputFormat=gml3';
    // Use fetch, more simple & modern instead of XMLHttpRequest
    fetch(url).then(function (response) {
        return response.text();
    }).then(function (text) {
        var features = SamF2016source.getFormat().readFeatures(text);
        // Add parsed features to vectorSource
        SamF2016source.addFeatures(features);
    }).catch(function (error) {
        console.log(error.message);
    })
}
});

SamF2016 = new ol.layer.Vector({
    source: SamF2016source,
    setZIndex: 1005,
    title: 'SamF2016',
    visible: false,
});

In the GetCapabilities of the server the style is specified as so (bottom part of the GML):

Layer queryable="1">
<Name>1</Name>
<Title>
<![CDATA[ SamF2013 ]]>
</Title>
<Abstract>
<![CDATA[ ]]>
</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:28992</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>4.211658</westBoundLongitude>
<eastBoundLongitude>6.025627</eastBoundLongitude>
<southBoundLatitude>51.244639</southBoundLatitude>
<northBoundLatitude>51.815840</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox CRS="CRS:84" minx="4.211658" miny="51.244639" maxx="6.025627" maxy="51.815840"/>
<BoundingBox CRS="EPSG:4326" minx="51.244639" miny="4.211658" maxx="51.815840" maxy="6.025627"/>
<BoundingBox CRS="EPSG:28992" minx="73913.494800" miny="362246.413600" maxx="198987.600000" maxy="425141.200000"/>
<Style>
<Name>default</Name>
<Title>1</Title>
<LegendURL width="130" height="928">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://atlas.brabant.nl/arcgis/services/fauna/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1" xlink:type="simple"/>
</LegendURL>
</Style>
</Layer>

When GetLegendGraphic is called the right symbology returns:
http://atlas.brabant.nl/arcgis/services/fauna/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1

With a GetMap request the right symbology also returns (BBOX is a bit off but you get the idea):
https://atlas.brabant.nl/arcgis/services/fauna/MapServer/WMSServer?request=GetMap&service=WMS&version=1.1.0&layers=1&styles=default&srs=EPSG:28992&bbox=-73913.494800,362246.413600,198987.600000,425141.200000&&width=780&height=330&format=image%2Fpng

What code do I need to add/adjust so that the points in my OL map appear like the symbology in the GetLegendGraphic and GetMap requests?


texts:
The Soil SURvey GeOgraphic (SSURGO) database is a set of very large and complicated shapefiles.  We want to load all of the shapefiles for the US into a national SQL database.

Are there import limitations for SQL 2008 for Spatial?

Also, are there any websites that use a SQL database for interactive thematic mapping?

Thanks

Bernie


texts:
Is it possible to snap (drag and snap) a feature to another feature in the same layer?

I found OpenLayers.Control.Snapping module but it's snapping only to the points.


texts: SetFeature creates infinite loop when updating sqlite feature using OGR

texts:
when using the SQLite driver in python - setting a feature after changing an attribute field value creates an infinite loop on the first record. the same code works fine if i substitute the sqlite driver for an esri shapefile.
some code to setup the issue -

'''create a new database with a point feature containing 2 records'''
def mkptdb():
    drv=ogr.GetDriverByName('SQLite')
    if os.path.exists('test.sqlite'):
        os.remove('test.sqlite')
    ds=drv.CreateDataSource('test.sqlite',options=['SPATIALITE=yes'])
    lyr=ds.CreateLayer('test',None,ogr.wkbPoint25D)
    flddef=ogr.FieldDefn('Name',ogr.OFTString)
    flddef.SetWidth(32)
    lyr.CreateField(flddef)
    flddef=ogr.FieldDefn('newfld',ogr.OFTString)
    flddef.SetWidth(32)
    lyr.CreateField(flddef)

    feat=ogr.Feature(lyr.GetLayerDefn())
    feat.SetField('Name','george')
    pt=ogr.Geometry(ogr.wkbPoint)
    pt.AddPoint(150000,48375999)
    feat.SetGeometry(pt)
    lyr.CreateFeature(feat)

    feat=ogr.Feature(lyr.GetLayerDefn())
    feat.SetField('Name','fred')
    pt=ogr.Geometry(ogr.wkbPoint)
    pt.AddPoint(150050,48376005)
    feat.SetGeometry(pt)
    lyr.CreateFeature(feat)

    feat.Destroy()
    ds=None

'''function to update one of the existing fields - this is the part that loops forever'''
def updatePt():
    print 'updating...'
    drv=ogr.GetDriverByName('SQLite')
    ds=drv.Open('test.sqlite',True)
    lyr=ds.GetLayerByName('test')
    for feat in lyr:
        s=feat.GetField('name')
        print s
        feat.SetField('newfld','hi')
        lyr.SetFeature(feat) #continuous loop stops if this is commented out
        feat.Destroy()

as noted above - if i comment out the line 'lyr.SetFeature(feat)' - the infinite loop ends and the feature will increment as expected. but without that line, the field value is not updated.

thoughts?
python 2.7.6, gdal 1.10.1 (just noticed there might be an update here to 1.11.05, will check.)
EDIT: updated to gdal 1.11.0 - same issue of infinite loop.


texts:
I had read posts where give to solution to reprojectin using GDAL but is always like this:

gdalwarp -t_srs '+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 \
            +k=0.999990 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs' \
            input_raster.tif output_raster.tif

or this:

gdalwarp -t_srs EPSG:2784 input_raster.tif output_raster.tif

but I want to make it on script to add it to my code, not just putting on console, and haven't found any documentation about that.

Also, what are the input parameters exactly? I am trying to reproject Landsat images from UTM 19N to UTM 18S,
the proj4.string I have are:

p1 = Proj("+proj=utm +zone=19 +ellps=WGS84 +datum=WGS84 +units=m  ")    #Input projection
p2 = Proj("+proj=utm +zone=18 +south +ellps=WGS84 +datum=WGS84 +units=m ")  #output projection

EDIT: I am working on Python 2.7


texts: How can I import only a subset of the polygons in a Shapefile using QGIS?

texts:
I have a shapefile that is covering a huge area, with lots of polygons. The area I'm insteresting in is small and limited. Is there any way to only import (using "add vector layer") the polygons from the shapefile that covers my smaller area?

How can I do this in QGIS? How do I specify the smaller area for my import?


texts: Extract an ArcSDE datasets (rasters/shapefiles) using Python?

texts:
I would like to write a Python script to extract/export a dataset (rasters/shapefiles) in ArcSDE. I saw this posts to connect to the server:

Define Workspace for SDE Connection in Python

But how can I extract the dataset?


texts: Forcing ArcGIS iOS to use GPS data from External GPS device?

texts:
I created an app that will display the map and the location of the external GPS device. The scenario is using a wifly module to broadcast the GPS data of the GPS receiver in wifi. The app is now receiving the data from the wifly module.

How do i force ArcGIS to use the data from the wifly module?

I am using the AGSLocationDisplay of ArcGIS iOS but its using the data from the CLLocation.


texts: What methodology is used to quantify global warming?

texts:
This article in the LA Times says:

  The first detailed global temperature measurements were recorded in
  1880. Since then, nine of the 10 warmest years on record have occurred since 2002, according to NOAA.

Presumably with each year there were more temperature sampling sites.  How do you compare global temperature maps between years when there are far greater sampling sites in recent years?


texts: How can I show numbers as percentages in CartoDB?

texts: I would like to format numbers as percentages in cartodb. What are the best functions to display numbers with decimals, comma separators or percentages?


texts:
I've got a problem with my script and hope that someone can help me.

What I´d like to do is using the field calculator to calculate values for a field using values from another field and a variable in the expression. The script should be as follows:

var_a = 6.2
arcpy.CalculateField_management (in_table, in_field,"[FIELD_A]*100/var_a")

[FIELD_A] contains the values of another field in the same table.

I only know how to integrate var_a in the expression using

arcpy.CalculateField_management (in_table, in_field, "'"+str(var_a)+"'", "PYTHON")

but then I can´t use the other values for the calculation.


texts: Check QGIS processing Saga version from a plugin

texts:
I am writing a QGIS plugin using SAGA by Processing. Is is possible to test whether SAGA is installed and which version is on?

For GDAL, it's OK with:

processing.tools.raster.gdal.__version__


texts: Image Shifting After Georeferencing in ArcGIS Pro?

texts:
I am georeferencing images in ArcGIS Pro using control points. After I export the control points and save the image, it shifts downward and displays in a different location. Now when I open the image, it loads into this new incorrect location.

When I try to re-georeference by loading the control points, the control points stay in the same place, and the RMSE does not change, but the image stays in its incorrect location. This result does not change when I close/reopen Pro and reload the control points, or do the same from ArcMap.

In the screenshot below, the B & W image is what is being georeferenced. The control points are where the image used to be aligned, but it has shifted southward. I have encountered this error continuously while georeferencing in ArcGIS Pro.

What could be causing this?

I have found that the image only shifts in this way when the georeferencing results are saved for the first time. Subsequent saves will not cause unwanted shifts. My workaround is to save the results after using the move/scale tools, and then moving the image back to its proper location before starting with control points.


texts: Create dynamic table in layout view (Arcmap)

texts:
I want to add an attribute table to my layout view in Arcmap 10.1. I only want some columns and I have made a few other customizations. However, some attributes might change along the way and I don't feel like adding the table all over again each time it does, since there's a lot of tideous work with hiding and unhiding columns and whatever else I might do to it.

How can I create a dynamic table in my layout view which updates automagically when I change values in the source table? There are descriptions about how to create tables that only displays features that are currently in the visible extent (like here). But that's not what I'm looking for.

I would think this is something that someone else would've wanted, so I hope there's an easy solution out there! (Preferably not involving programming/Python, unless it's the only way to do it...)


texts: Moving buildings in water layer into Buildings layer using MapInfo?

texts:
I am using MapInfo.

I mistakenly vectorised some building on my water layer, is there any way I can fix this by moving the buildings in the water layer into the Buildings layer?

It was so tedious and doing it all over is not desirable.


texts: Why can't I load my basemap from the ArcGIS rest services using leaflet?

texts:
Why can't I load my basemap from the ArcGIS rest services using leaflet ? do I need to include"the esri-leaflet" package as well to use ArcGIS rest services in leaflet?*
<!DOCTYPE html>

        <link rel="stylesheet" type="text/css" href="leaflet.css"/>

        <title>Getting Started with Leaflet</title>


texts: Extract raster files from VIIRS VNP02 files provided in NetCDF format?

texts:
I work in R with HDF files and sometimes i use HEG tool to deal with HDF files.

But now NASA has introduced something else that is NetCDF files with VIIRS VNP02 data.
I want to extract I04 and I05 bands from a .nc file attached herewith. the extracted bands should be projected with UTM WGS84 Zone 45.
 Link to example NetCDF (.nc) file

Can anyone help me how to do this in R.


texts: Unable to publish a GeoTiff file in GeoServer with curl tool

texts:
I have a workspace in GeoServer with many shapefiles and postgis tables. Now I'm writing a script that will publish GeoTiff files in that workspace using curl tool.  I'm trying to succeed that in two steps.
At first I create a coveragestore with the following command:

curl -u admin:geoserver -v -XPOST -H 'Content-type: application/xml' -d '<coverageStore><name>input.tif</name><workspace>myworkspacee</workspace><enabled>true</enabled><type>GeoTIFF</type><url>/usr/share/geoserver/data/data/myworkspace/input.tif </url></coverageStore> http://my_mv_ip/geoserver/rest/workspaces/myworkspace/coveragestores'

which works fine. And then I execute:

curl -u admin:geoserver -v -XPUT -H "Content-type: image/tiff"  \
--data-binary @input.tif   \
http://my_vm_ip/geoserver/rest/workspaces/myworkspace/coveragestores/input/input.geotiff

The output from both commands in command line is the following:

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying my_mv_ip...
* Connected to my_mv_ip (my_mv_ip) port 80 (#0)
* Server auth using Basic with user admin`
> POST /geoserver/rest/workspaces/myworkspace/coveragestores HTTP/1.1
> Host: my_mv_ip
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.47.0
> Accept: */*
> Content-type: application/xml
> Content-Length: 249
>
* upload completely sent off: 249 out of 249 bytes
< HTTP/1.1 201 Created
< Date: Mon, 14 Aug 2017 13:11:28 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Location: http://my_mv_ip/geoserver/rest/workspaces/myworkspace    /coveragestores/input
< Transfer-Encoding: chunked
<
* Connection #0 to host my_vm_ip left intact
*   Trying my_mv_ip...
* Connected to my_mv_ip (my_mv_ip) port 80 (#0)
* Server auth using Basic with user admin
> PUT /geoserver/rest/workspaces/myworkspace/coveragestores/input    /input.geotiff
HTTP/1.1
> Host: my_mv_ip
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.47.0
> Accept: */*
> Content-type: image/tiff
> Content-Length: 44295940
> Expect: 100-continue
>
< HTTP/1.1 100 Continue

After about 20 minutes it raises the following error:

We are completely uploaded and fine
< HTTP/1.1 502 Bad Gateway
< Date: Mon, 14 Aug 2017 12:10:44 GMT
< Server: Apache/2.4.7 (Ubuntu)
< Content-Length: 311
< Content-Type: text/html; charset=iso-8859-1
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>502 Bad Gateway</title>

Bad Gateway

The proxy server received an invalid
response from an upstream server.

<address>Apache/2.4.7 (Ubuntu) Server at my_vm_ip Port 80</address>

* Connection #0 to host my_vm_ip left intact

I tried some solutions from:
Adding a new Coveragestore in a certain Workspace by REST
and:

Programming Geoserver 2.0.2 to add a raster data store and layer without the UI

But with no result. I'm using GeoServer 2.7.4 Tomcat7 and Ubuntu 14.04.

My Apache logs:

[Mon Aug 14 17:14:04.785741 2017] [proxy:error] [pid 14922:tid             139798341732096] (104)Connection reset by peer: [client 176.92.115.36:34098]     AH01084: pass request body failed to [::1]:8080 (localhost)
[Mon Aug 14 17:14:04.785886 2017] [proxy_http:error] [pid 14922:tid    139798341732096] [client 176.92.115.36:34098] AH01097: pass request body     failed to [::1]:8080 (localhost) from 176.92.115.36 ()

A piece from my tomcat logs:

14 Aug 17:14:04 ERROR [geoserver.rest] - Could not determine format. Try  setting the Content-type header.
14 Aug 17:14:04 ERROR [geoserver.rest] -


texts: Creating Relationship Class- Adding new records to table

texts:
I am creating a relationship class inside an SDE Environment (SQL Server 2016).

I have a point feature class and a related table.

I am trying to add rows to the currently empty table based off specific features from my point feature class.

the only way I see to do this is start an edit session, select all my points and open the attribute editor window then select the feature, use the drop down, right click the table and select "add new".

I have several thousands points I need to do this for, is there a bulk option or a way to automate this process?

My keys in the origin table is GlobalID, the key field in destination table is a GUID field type named "Parent_GUID"


texts:
I want to calculate "surface area in a basin with reference to incremental height of DAM"

i tried this:

step_size = 10 # metres; reduce this if you want finer resolution
num_steps = 20 # increase this, if you need more steps
workspace = r'C:\Some\path\to\folder'
raster_file = 'mytopo.tif'

gp = arcgisscripting.create()
gp.CheckOutExtension ('3D')
gp.workspace = workspace

# Start from the minimum elevation
min_rast = gp.GetRasterProperties(raster_file, 'MINIMUM')

# Start CSV output of elevation/volume relationship
print('step, height, elev, volume')
for step in range(num_steps):
    height = float(step*step_size)
    elev = min_rast + height
    gp.SurfaceVolume_3d(raster_file, '', 'BELOW', elev)
    result = gp.GetMessages()
    volume = float(re.findall(r'Volume= *([\d\.]+)', result)[0])
    print(', '.join([repr(x) for x in [step + 1, height, elev, volume]]))

Can you help me edit this code to get volume to get surface area?


texts: How to densify point feature class in ArcGIS?

texts:
I have a 3D (x,y,z) single point feature class which points are equally spaced, like this:

As the distance between each points are more than one meter, I was wondering if there's a possibility to automatically identify data by adding new points like this (maybe also in arcpy):


texts: I'm using the above mentioned QGIS version, and it somehow does not include ZonalStats plugin. I installed ZonalStats 0.0.4, but plugins now says this is designed for QGIS 1.7.2-1.99 and does not work for me. Is there a way to get hold on Zonal Stats?


texts: Identify and delete all unrequired fields from Shapefile using ArcPy

texts:
I have some Shapefiles inside one Folder and for the sake of data compression I want to delete all fields from Table of Content that can be removed (that are not required)!

What I have:

What I expect:

My code that is not working:

import arcpy
import os

arcpy.env.workspace = r"C:\Temp\"
fcList = arcpy.ListFeatureClasses()

for fc in fcList:
    fields = arcpy.ListFields(fc)
    for field in fields:
        delFlds = [field for field in fields if field != "FID" or field != "Shape"]
        arcpy.DeleteField_management(fc, delFlds)

I am using Python 2.7 and ArcMap 10.4.1


texts: What is the new projection for Google Maps called?

texts:
Google released a new projection for the desktop version of Google Maps which appears to preserve the spherical nature of the Earth at all zoom levels. The old projection was called “Web Mercator”.

Does this new projection technique have a name or a defined standard?
Additionally, is this projection or its calculations available via the Google Maps JavaScript API? Can this projection be implemented using other JS mapping tools (leaflet.js, mapbox-gl-js)?

Tweet announcing changes:
https://twitter.com/googlemaps/status/1025130620471656449