texts:
I am a novice getting started to work on a proof of concept to develop a web app powered by JS API.

I have a prototype that was put together back in July 2013 with JS API version 3.5. See below for the stylesheet links in index.html. I am looking to change this to the latest version 3.11.

Previous:

 <link rel="stylesheet" type="text/css" href="//serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dojo/resources/dojo.css">
 <link rel="stylesheet" type="text/css" href="//serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css">
 <link rel="stylesheet" type="text/css" href="//serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css">
 <script src="//serverapi.arcgisonline.com/jsapi/arcgis/3.5"></script>
 <script type="text/javascript">
    require(["viewer/Controller"], function (Controller) {
  Controller.startup();
   });
 var myvar = null;
 </script>

Changed to: (Note 3.11 in the new links)

 <link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/claro/claro.css">
 <link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css">

However when I change

<script src="//serverapi.arcgisonline.com/jsapi/arcgis/3.5"></script>

to

<script src="//js.arcgis.com/3.11/"></script>

the TOC/Legend layer is not loading any more and I get the error message:

"TypeError: Cannot read property 'geometry' of undefined".

Attached screen shot for the detailed message that shows up in Chrome developer Console. I have no clue what's causing this error.
Can someone guide me? How should I go about updating the version, some best practices will be of immense help to me.


texts: Using QGIS Relations with the Print Composer

texts:
I have set up relations for my QGIS project (version 2.8.3 on windows 7 64 bit). I can see the related features when identifying the map.

I'm now trying to get this information onto a print composer.

My first idea was to get the information into the attribute table item--but I have not successfully gotten the related entities in the parent attribute table nor the attribute table item.

Does anyone have any suggestions on doing this?


texts: How to access Shapefile metadata and metatypes information using OGR?

texts:
I'm trying to use ogrinfo to get some details on a shapefile.
Now, the only way that I know is using orginfo:

ogrinfo -ro -so -al  BRA_001.shp

But its display all information about the shape:

INFO: Open of `.\BRA_001.shp'
      using driver `ESRI Shapefile' successful.

Layer name: BRA_001
Geometry: 3D Polygon
Feature Count: 273
Extent: (-42.645514, -22.360532) - (-42.321728, -22.198300)
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AUTHORITY["EPSG","4326"]]
Name: String (0.0)
description: String (0.0)
timestamp: String (0.0)
begin: String (0.0)
end: String (0.0)
altitudeMode: String (0.0)
tessellate: Integer (0.0)
extrude: Integer (0.0)
visibility: Integer (0.0)
drawOrder: String (0.0)
icon: String (0.0)

It's very useful by the way, but what I need is get only metadata names with types, e.g.:

Name: String (0.0)
description: String (0.0)
timestamp: String (0.0)
begin: String (0.0)
end: String (0.0)
altitudeMode: String (0.0)
tessellate: Integer (0.0)
extrude: Integer (0.0)
visibility: Integer (0.0)
drawOrder: String (0.0)
icon: String (0.0)

Can someone help me out?


texts: Store in a python list the attribute table of a vector in QGIS

texts:
I'm stuck with a very simple issue..
I've loaded in QGIS (through the py console) a csv layer (no geometry) made of 4 fields and 3 rows:

#load the csv
layer = QgsVectorLayer("path/to/the/csv", "csvlayer", "delimitedtext")
#add it to the TOC
QgsMapLayerRegistry.instance().addMapLayer(layer)

What I'm trying to do is to store the attribute table of the csv layer in a python list. I tried:

for i in layer.getFeatures():
    l = []
    l.append(i.attributes())

it works, but in the list I have only the last row of the attribute table and not all the 3 rows.

How can I have store all the 3 rows as lists in the main list?

Something like:

l
[[1,2,3], [4,5,6], [7,8,9]]


texts: Convert and export lat longs from text layer - QGIS

texts:
I have imported a Text Delimited Layer that was a csv file with three fields id, lat, long. The layer shows up correctly and the values are in Feet. I need to convert the Feet to Decimal Degrees and then export the file. None of the menu options seem to point towards this goal. Can this be done? I have been searching for solutions on the Internet without luck so far.

Edit: I tried right clicking on the layer and Save As to csv, but it has the same values even after changing the CRS to a Decimal Degree projection.


texts: Label formatting tag escape characters in ArcGIS Pro with VB?

texts:
I have catch basins that I've joined to a table of inspection data.
I want to label the catch basin ID in bold followed by the inspection results each on new lines below unbolded.

It appears to fail when the test results table has a "<" in it as shown below on the left.  it works fine for the one on the right.

Is there an escape character I can use somewhere (either in my label expression or in the table, itself) that will correct the formatting in those cases?

this is the label expression I have now:

"<BOL><UND>" & [L1Storm_Inlets.FACILITYID] & "</UND></BOL>"&vbnewline&"Chlorine: "&[FullComparison.Chlorine]&vbnewline&"Temperature (F): "&[FullComparison.Temperature]&vbnewline&"E-coli (cfu/100ml): "&[FullComparison.E_coli]&vbnewline&"Enterococci (cfu/100ml): "&[FullComparison.Enterococci]&vbnewline&"Surfactants (mg/l): "&[FullComparison.Surfactants]&vbnewline&"Ammonia-Nit. (mg/l): "&[FullComparison.Ammonia_Nit]

I forget the number, but it's the most recent release of ArcGIS Pro.


texts:
After a crash and subsequent reinstall I cannot access SAGA GIS in the processing toolbox, and it appears that QGIS can't find it as there is no setting for the path.

How can I set the path from QGIS to SAGA? There is no option in the Providers menu.

The question have been up before, and the solution that worked in most cases have been to enable and/or set the right path in processing toolbox - options - providers (see eg. here, here and here). I tried to reinstall QGIS, SAGA and all dependencies, but no success.

According to the accepted answer here, the problem was solved in QGIS 2.18.2 on Windows, but maybe not for Mac? Am I missing something?

I can tic 'Activate' in options -> provider, but there is no option to set the path (GRASS and GDAL have the option and works fine):

It is also confirmed in the advanced options settings:

SAGA is installed and appears to work:

and available here:

$ which saga_cmd
/opt/local/bin/saga_cmd

I'm using latest Kyngkaos. QGIS 2.18.13:

On OS X 10.11.6:


texts: percent of total population is x distance from nearest point (ArcGIS 10.2)

texts:
I'm getting my but kicked by some statistical analyses in ArcGIS 10.2 and need a bit of assistance.

I have two data sets.  One is a raster which represents the population of a country at 100m resolution, the other is 35k related points. Both population and the arrangement of points vary widely over space.  From these two data sets I need to derive the following:

10th, 25th, 50th, 75th, 90th percentile distance between population and the nearest point.

I have virtually no background in statistics - It appears as though I'm in a bit over my head at the moment and need a hand staying afloat.


texts: Unable to Load ArcGIS vector tiles to mapbox-gl-leaflet

texts:
So basically I am using the mapbox-gl-leaflet plugin to render mapbox vector tiles on leaflet map. Now I am trying to load ArcGIS vector tiles in the plugin but the vector tile is not rendering on the map. It is specified that the plugin supports any vector tile source like for example this one https://api.maptiler.com/maps/topo/style.json?key=input_key_here which loads without any problems. But the ArcGIS map that I am trying to load: https://www.arcgis.com/home/webmap/viewer.html?webmap=28f49811a6974659988fd279de5ce39f doesn't load in the plugin.
The URL request (points to a 404): https://www.arcgis.com/sharing/rest/content/items/28f49811a6974659988fd279de5ce39f/resources/styles/root.json
Also from the chrome developer console I get these errors when trying to load the vector map:
evented.js:140 Error: missing required property "version"
    at Object.Un [as emitValidationErrors] (validate_style.js:37)
    at Be (style.js:46)
    at i._load (style.js:245)
    at style.js:225
    at ajax.js:165

evented.js:140 Error: missing required property "sources"
    at Object.Un [as emitValidationErrors] (validate_style.js:37)
    at Be (style.js:46)
    at i._load (style.js:245)
    at style.js:225
    at ajax.js:165

evented.js:140 Error: missing required property "layers"
    at Object.Un [as emitValidationErrors] (validate_style.js:37)
    at Be (style.js:46)
    at i._load (style.js:245)
    at style.js:225
    at ajax.js:165

Edit* adding code example
<!DOCTYPE html>

    <title>WebGL</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" />

    <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.9.1/mapbox-gl.css" rel='stylesheet' />


texts: How to select distinct geometries and ids with PostGIS?

texts:
I have point geometries in a PostGIS table. I want to select only the distinct geometries from this table. If a geometrie is duplicated, it should select the first appearance in the table.

I tried to following query:

SELECT DISTINCT ON(wkb_geometry), ogc_fid from points;

But I get the error:

ERROR:  syntax error at or near ","

What is wrong with the query?


texts: Use multiprocessing to speed up rebuild index in ArcPy

texts:
We are in ArcGIS 10.6.1 (on Windows Server 2012) and Enterprise GeoDatabase Oracle 19c (on Linux).
I was wondering if it is feasible to use the Python's ProcessPoolExecutor to open two separate Oracle sessions and run Rebuild_Index (Data_managament) ArcPy tool to speed-up the index rebuild? Will that take advantage of the multiple cores in Oracle DB server?


texts: Scale Bar not appearing in meter-based CRS using QGIS

texts:
Students in my GIS class using QGIS 3.1 are having a problem that I can explain theoretically but not practically.
Some students cannot get scale bars to appear in the map composer, even when bar width and units are appropriate to size of canvas and data.
I have helped them solve this problem by changing the project CRS to UTM. However, the original CRS (in one case PSG:2163 US National Atlas Equal Area) should work because its units are meters.
Why might their scale bars not work with EPSG:2163?


texts: I'm curious if it's possible to decompress a 10.1 tile package (.tpk) into a different format such as the cache bundle format.


texts: Why would having a reference string "boh@10" cause a crash?

texts:
When using the raster calculator in a pyqgis script, I have several layers to process.  When it gets to "boh@10", the processCalculation() call crashes.  I don't see anything in the code that requires that field to be anything other than a QString. Anybody know what's up??

In reference to the question and answers at ...
Help with scripts for processing raster files with the raster calculator in QGIS


texts: What is the correct coordinate system for google geocoded text file layers?

texts:
When importing a text file containing lat/longs geocoded from something like GPSVisualizer.com into QGIS, what is the correct coordinate system to select?

Most web services (GpsVisualizer included) geocode in Web Mercator, but QGIS has no Web Mercator coordinate option.


texts: QGIS Server install on Windows using XAMPP

texts:
I am trying to understand the basics of QGIS Server/Desktop.  I am trying to get WMS and WFS to work on a Windows 2016 Server.  I am using https://docs.qgis.org/3.16/en/docs/server_manual/getting_started.html#installation-on-windows (QGIS 3.16) as the install guide.
My first question is are there any recommendations or requirements regarding both server and desktop being on the same server such as an LTR version of one and non-LTR for the other?
Also, I have seen other guides say that the Full desktop version is needed for all the necessary features to be installed but I don't know if that is accurate for the current XAMPP path.


texts: Finding top values in each cell using ArcGIS Desktop?

texts:
I have 60 raster files and I need to find the top 5 values in each cell.

Now I know that if I had to find the highest value, I could just use the maximum function in cell statistics. But I am not able to find the top 5 in each cell nor can I find a solution through which I can identify the top 5.

Is there any toolbox or any other method that I could use?


texts: Disappearing map image when georeferencing in ArcGIS 10.6 desktop

texts:
I am trying to add an un-georeferenced map into ArcMap as raster so that I can manually georeference it, then use it as a base to draw polygon features on top of it.

I can add in the image and roughly position it using the georeferencing tools in ArcGIS. However, if I zoom in to a scale larger than 1:4000, the image of the map I just added disappears. It will reappear again if I zoom out to 1:4000. I can't finish georeferencing or use the map as a reference to draw polygons without being able to access it at a larger scale.

My map project settings:
Projection: WGS1984 UTM Zone 52N and using World Imagery basemap

Details of the map image I'm trying to georeference:

JPG, PNG, TIF (I tried all three formats) exported from a PDF.
Size: 12284x6709 pixels.
Scale: 1:600

Other details:
The issue occurs whether or not I create pyramids when adding the image file to the map project. I also tried nearest neighbor and bilinear interpolation resampling.


texts:
I'm a fairly new user to QGIS. I've used OpenStreetMap to geocode small data sets (30-ish points) with no problems. Now I'm trying to plot 1100 points. I've loaded up a basemap and a polygon layer, formatted my CSV with location data (address, city, state), but when I try to use the 'Web Service Geocode' tool as I have in the past (see below image), I get the following error:
Failure connecting to API: HTTP Error 502: Bad Gateway
I was under the impression I didn't need an API key for OSM, but maybe I'm wrong?


texts: Referencing return value from openProject macro

texts:
It is very good to have available  functions on startup.py, I created one to get the qgs project base name and referencing it as a Python expression on the composer using all the information found and it works well!

What I want to do now, is to use the function not on startup but with the project macros, so it will be available for the users of the .qgs file, which we share in our office as a template.

I wrote the following code on the openProject function macro, based on the code I wrote for startup.py:

def openProject():
  from qgis.utils import qgsfunction
  from qgis.core import *
  from PyQt4.QtCore import *
  prjbaseFileName =  QFileInfo(QgsProject.instance().fileName()).baseName()

But I do not know if this is even possible! how can i pass /use  the return value of prjbaseFileName to a label on my composer.

I am using QGis 2.2 Valmiera.


texts: QGIS query/syntax for overlapping features

texts:
I have a dataset (buildings, polygons) that has some overlapping features. Some buildings are old and already demolished but are still in the dataset. I want to hide all these.
These have properties of ‘demolished’. So that’s easy one might say. However, for the same (old building) another feature exist and has properties ‘in use’. Luckily these two features have the same reference numbers. I like to filter the identification numbers (so multiple features) when at least one of the features has properties ‘demolished’.

I’m not experienced with good syntaxes for this and was wondering If anyone could help me out with this. I’m using QGIS 2.14.

The easy one, only filtering the demolished building would be:

NOT “buildingstatus” = ‘demolished’

But I need the other features with a corresponding identification number. What would be this syntax? Either to hide them, or select them (and delete, or move to other layer)?

CASE
WHEN buildingstatus = demolished
THEN SELECT Identification
END

UPDATE:I'm trying this query with a virtual layer. First I get geometry issues. If I define the geometry as a polygon, than it adds a layer but QGIS crashes.

NOTE: If I embed the layer it doesn't make a difference


texts: Lizmap unable to load maps that need authemtification after updating from 3.3.3 to 3.3.10

texts:
I have a running Lizmap v. 3.3.3. instance that uses PostgreSQL for authentification.
I would like to update to a newer version v.3.3.10 and followed exactly the update instructions.
When I now go to the new 3.3.10 site, all projects are there, but I'm only able to load the public maps (maps that do not need an authentification). When I log in, all my projects are there, but I cannot load the maps (I get an dark screen with the Lizmap logo indicating, that the maps going to be loaded - but nothing happens). When I change the access level to 'anonymous', the same project is loaded without issues.
unzulässige Anfrage(ERROR:  current transaction is aborted, commands ignored until end
of transaction block(SELECT "ug"."login", "ug"."id_aclgrp" FROM "jacl2_user_group" AS "ug"
WHERE  "ug"."login"  = 'admin'))    /var/www/lizmap-web-client-3.3.10/lib/jelix/plugins/db/pgsql
/pgsql.dbconnection.php 180

The same query executed in the lizmap database (with DBeaver) gives a valid result.
The connection to the lizmap-database works, since the login is written into the log_detail table.
All the access rights at file and directory level are set identical to the working v.3.3.3 instance.
Since I know, this is a very specific topic I also openend an issue at the Lizmap github account.
But maybe someone has an idea or encountered the same problem.


texts: QGIS: export map images centered on a series of GPS coordinates

texts:
I am hoping to create an animated video based on a QGIS map I have created. The Time Manager plugin looks like a close match, but I'm not sure if it will be able to do what I'm looking for:

Instead of a layer being animated on top of static map, I'd like the map itself to pan following a route generated by Google Maps.

I am imagining a scenario where I would import a path of Lat/Long coordinates, choose a fixed scale to "photograph" from, and then automatically export images along the path centered on each of the coordinates. Some kind of sequential file naming would then make it easier to import into an animation software program.

Is this something that can be done?


texts:
I have an esri popup in my web app MapView:
  // Add the map to a MapView
  const view = new MapView({
            container: "viewDiv",
            map: map,
            center: [-82.9001, 32.1656],
            zoom: 8,
            popup: {
                //actions: [risk_snapshot],
                actions: [],
                dockEnabled: true,
                dockOptions: {
                    buttonEnabled: true,
                    breakpoint: false
                }
            }
  });
  ...
  view.popup.open({
        // Set the popup's title to the coordinates of the clicked location
        title: "Location Coordinates: [" + lon + ", " + lat + "]",
        location: event.mapPoint, // Set the location of the popup to the clicked location
        content: setContentInfo(view.center, view.scale),
        actions: [risk_snapshot]
  });

I also have a simple Bootstrap Navbar in my app:

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapibleMenu">

            </button>
            GA Map Viewer

Home

For some reason, whenever, I close the popup, the navbar disappears. Any reason why this would happen or suggestions on how to fix it?


texts: Django/PostGIS: How to insert coordinates in PointField in EPSG:27700, and return EPSG:4236?

texts:
I am using Django 1.9 with PostGIS. I have input data that consists of British National Grid eastings and northings, and a table that looks like this:

class Org(models.Model):
  name = models.CharField(max_length=200)
  location = models.PointField()

I have been setting the location of points manually as follows:

from django.contrib.gis.geos import GEOSGeometry
practice.location = GEOSGeometry('POINT(%s %s), 27700' % (lng, lat))
practice.save()

Now I want to serialize the table as GeoJSON, and I want to get WGS84 out. But the response shows the original coordinates, even though it says it is EPSG:4236:

from django.http import HttpResponse
from django.core.serializers import serialize
results = Org.objects.filter(code__in=codes)
print HttpResponse(serialize('geojson', results,
                    geometry_field='location',
                    fields=fields = ('name', 'location', )),
                    content_type='application/json')

results in GeoJSON which claims already to be in 4326:

{"type": "FeatureCollection", "crs": {"type": "name", "properties": {"name": "EPSG:4326"}}, "features": [{"geometry": {"type": "Point", "coordinates": [444139.0, 518708.0]}, "type": "Feature", "properties": {"name": "THE DENSHAM SURGERY"}}]}

How can I change this to show the correct coordinates in EPSG:4236?

I tried the following in my serialization script:

for result in results:
  results.coord_property_name.wkt
  results.coord_property_name.transform(4326)
  results.coord_property_name.wkt

And in both cases I get the same result:

 POINT (366697.0000000000000000 426141.0000000000000000)


texts: QGIS Desktop 2.14.5 and 2.16 Projects with Multiple Composers Loading Very Slowly

texts:
I am experiencing a lot of problems with QGIS Desktop versions >= 2.14 when opening  projects with a large number of composers(~100).  It appears that each composer is being loaded into memory when the project is loaded instead of when I open the composers.

The project is large and contains a large number of layers.  It was created using QGIS 2.10. When I load a version of this project with the same layers but no map composers it opens very quickly (roughly 8 seconds).  When I load the version with all composers it takes about 20 minutes for the project to open.

Is there a setting that can be used to change this behavior or should I plan on sticking to older versions of QGIS?


texts: Export selected PostGIS features to a new PostGIS layer in QGIS?

texts:
I am trying to export a selected set of features from a PostGIS layer into a new layer. But when I go to the context menu for the later and choose Export -> Save Selected As ..., there is no option for saving the selection into PostGIS. The only options are GeoPackage, Shapfiles etc:

Is there a way to save to PostGIS without going through these other format first?

(This is with Ubuntu 18.04, QGIS 3.6, PostgreSQL 11, PostGIS 2.5).


texts: Create a buffer for polygons that meet a condition with QGIS

texts: I have a layer with polygons, and I want to make a buffer but only for the ones that meet a condition ("MUNICIPIO"=5). When I make a fixed distance buffer, it makes a buffer for all the polygons in the layer. Is there a way to make a buffer only for the polygons I want?


texts: Updating the other column when data in the column changes in ArcGIS

texts:
In ArcGIS in one of my layers, I combined two columns with calculated field and printed it into a third column. However when I change a data in my first column, I want that data in the third column to change automatically.
Is this possible?
How can this be done with Python code?


texts:
Followig the query here:
QGIS2web Export open layers map as PDF, PNG or JPEG
I would like to be able to export my map in the PNG format.
Unfortunately the code from here:
https://www.kreidefossilien.de/webgis/dokumentation/beispiele/export-als-png-hoehere-aufloesung
doesn't work
I embedded this code into the file, which has been uploaded here:
https://jsfiddle.net/x6wgz12v/
The console throws:
Uncaught ReferenceError: $ is not defined
where an answer is here:
https://stackoverflow.com/questions/2925130/jquery-equivalent-of-getting-the-context-of-a-canvas
but it doesn't match my code
    var canvas = $('canvas').get(0);

The PNG export button doesn't work at all

I've changed the var canvas to
var canvas = document.getElementById('canvas');
https://competa.com/html5-canvas-the-basics
and now the console shows another problem:
qgis2web.js:871 Uncaught TypeError: Cannot read property 'width' of null
indicating the canvas size function:
   function setDPI(canvas, dpi) {
    var scaleFactor = dpi / 96;
    canvas.width = Math.ceil(canvas.width * scaleFactor);
    canvas.height = Math.ceil(canvas.height * scaleFactor);
    var ctx=canvas.getContext("2d");
    ctx.scale(scaleFactor, scaleFactor);
   }

where an answer is here:
https://stackoverflow.com/questions/16509020/uncaught-typeerror-cannot-read-property-width-of-null
but doesn't match my situation.
The final question is how to get the Openlayers maps generated in QGIS2web plugin downloadable as a PNG format?


texts: Serving one large polygon or many little ones from ArcGIS Server?

texts:
I´m designing a geoprocessing service on ArcGIS Server using several nationwide datasets.

Currently I´m preparing some of the datasets and I´m wondering if I should dissolve my polygon layers (buffers) to have only one huge polygon with many, many vertices or if I would get better performance if I leave them with many small polygons (approx. 500.000).

The geoprocessing service will always be applied only on very small areas at a time.


texts: Arc-node topology data structures in Python GIS packages

texts:
I am looking at using the traditional arc-node topological data structure to make some spatial data analysis more efficient. I would like to avoid reinventing the wheel. Is there an implementation in any (preferably open-source) Python spatial data package where I could build and access the face, edge and node tables?

For background info, the topology is discussed for instance here http://library.oceanteacher.org/OTMediawiki/index.php/Vector_Data_Topology


texts: Changing the color of scale and rotation points when editing a feature

texts: When selecting a feature in my application and selecting the edit button the selected features become editable. This means that the points for scaling and rotation of that feature are made visible as well as the point for editing the current vertices and creating new ones. Since the points for scaling and rotating vertices are white in color as well as the points to create new vertices for that features, I was wondering whether there may be a way to change the color for one of them to have them stand out. I cannot seem to find any information regarding whether this can be done.


texts: Set border symbology by bordering feature?

texts:
I'm using a US state shapefile, and I want to have different border types based on properties specific to the border, not to any state.

For example, I might want the Florida-Georgia border to be red, the Florida-Alabama border to be blue, the Florida-ocean border to be non-existent, and the Alabama-Georgia border to be dotted.

Is there any way to accomplish this in QGIS or ArcGIS?


texts: How to find whether a Point lies inside a Polygon using ArcGIS JavaScript API?

texts:
We want to find whether a Point lies inside a Polygon.

var point = new esri.geometry.Point(-85.91,25.68,this.parent.esriMap.spatialReference);

var polygon = new esri.geometry.Polygon(this.parent.esriMap.spatialReference);

polygon .addRing([contains the lat and long]);

boolean result=polygon .contains(point);

The moment I add the contains method call (polygon .contains(point);), I get an error stating that ESRIMapViewer does not have a constructor.  ESRIMapViewer.js is the file which contains the above code.


texts: Error gap-filling Landsat 7 SLC-off with QGIS 2.18.3 on Windows 10

texts:
I am trying to gap-fill Landsat 7 SLC-off images with open-source software as explained in the comment below this post.

I'm new to QGIS and have almost no knowledge with Python (I'm a GIS novice normally working with ArcGIS 10/Pro).

GdalTools is installed and checked and I am using the Band 1 mask (from USGS download) on Band 1. When I run FillNoData, it returns Band 1 with the gaps remaining.


texts: How to get names of all layers in a store in GeoServer using OpenLayers

texts:
I have strict requirement to retrieve names of all layers in a GeoServer store using OpenLayers. I've gone through the post here, but it doesn't answer my question. I've also gone through GeoServer's REST API, which would be ideal if I'm using another language, say C#, Java, or PHP. But I want to do this entirely in JavaScript.

UPDATE:
From what I can see in the WFS GetCapabilities document, I can retrieve names of all layers by sending a WFS GetCapabilities request using filters. But I'm not sure if its possible to incorporate filters in a GetCapabilities request. Neither do I have any idea how such a filter will look like.

Any advice on how I can go about achieving this will be highly appreciated. Any alternative approach will also be appreciated.

UPDATE:

I believe I've found a solution here; "WFS GetCapabilities requests can be filtered to only return layers corresponding to a particular namespace. To do this, add the following code to your request: namespace=<namespace>". I hope this assists someone else.


texts:
I am trying to setup up a enterprise geodatabase with ArcGIS 10.4.1 and PostgreSQL 9.4 where I can use PostGIS for my SQL queries in PostgreSQL and have the sde functionality.

I have a windows computer.

My process so far was:

install postgresql/postgis
copy st_geometry dll over to postgresql lib
run create enterprise geodatabase
create sde login

then inserted data from a file GDB into that databse connection and it worked like sde but I went to use a simple st_union postgis functions like this

select st_union(shape) geom from base_layers.hl_huc

and got this error

ERROR:  function st_union(st_geometry) does not exist
LINE 1: select st_union(shape) geom from base_layers.hl_huc
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
********** Error **********

ERROR: function st_union(st_geometry) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 8

Can someone please tell me DETAILED instructions on how I can get PostGIS to work for this database!

I came across this pdf, but it is for older versions of arc and PostgreSQL and the directions are not very clear.  For example on page 15 one of the steps is Edit a SDE config file and a PostgreSQL one  pretty vague...

Ran create extension PostGIS in the DB. All the postgis functions are there, but I cannot use them!

Maybe there is way to switch between the spatial type backends?

CONCLUSION

Vince's third point led me down the path to figure out how to have ArcGIS SDE versioning and editing while maintaining the PostGIS backend. Note I may have made it more complicated than it had to be but nonetheless I figured it out

steps

copy st_geometry from.dll C:\Program Files (x86)\ArcGIS\Desktop10.4\DatabaseSupport\PostgreSQL\9.4\Windows64 to C:\Program Files\PostgreSQL\9.4\lib (or whatever version of arc and postgresql you have)
run esri tool "create enterprise geodatabase" (this tool will create a new postgresql DB with the needed sde login name and supply the password)
I created a superuser called postgis, then created a schema in the database called postgis and ran create extension postgis *this could be bad practice to have another superuser in the DB but I did not want the postgis functions to be in the same schema as the SDE
run esri tool "export geodatabase configuration keywords". database connection = the DB you just created
edit the file in notepad, go to line 27 change ST_GEOMETRY to "PG_GEOMETRY", SAVE!
run esri tool "import geodatabase configuration keywords" for that database connection and any layer you bring in now should have postgis default backend with sde functionality!

now I can use the awesome power of postgis in the backend and when I create a table all I need to do is right click on the layer in the db connection, manage and register with geodatabase. I should note when I click on register with geodatabase sometimes the arcmap shuts down and give me the crazy there was a serious error, please send error report to ESRI....


texts: Finding and deleting overlapping polygons using ArcMap

texts:
I have generated these (green) polygons in ArcMap 10.5.1 by: import XY data > buffer 5 m > minimum bounding geometry (plus a couple of other steps).
image.png

The screenshot is a self-intersect of the polygon layer. I need to achieve zero overlaps between polygons, by deleting the minimum number of them. I have tens of thousands of polygons.
Can someone suggest a way around this?
I have tried to select the points on the basis of their proximity to each other before buffering - any that are >= 10 m apart would survive the cull.
But my test of ArcGIS nearest neighbour analyses is not promising:

Average Nearest Neighbor (Spatial Statistics) gives only what the name says - not a feature class with attributes that can be queried / selected
Calculate Distance Band from Neighbor Count (Spatial Statistics) - likewise


texts: Date different in field calculator using python method

texts:
I would like to calculate date different between two fields of date format.
The idea is to know if Field_1 is greater than Field_2.

My calculate code is something like this:

def date(f1,f2):
  if f1 > f2:
    return'yes'
  else:
    return'no'

  date( !Field_1!, !Field_2! )

The format of Field_1 and Field_2 is :

  %m/%d/%Y

The script is run but the result is not as I expected.
As you can see below, the result is not different each other.

Any thoughts?


texts: ArcObjects: identifier for ICommandBars.Find

texts:
I am looking for the identifiers for the method ICommandBars.Find(object identifier) method in the ArcObjects. During web search I found the following page, that used the class ArcID, but I cannot find it anywhere.

I need to get the CommandItemfor the Start Editing command.


texts: Disable pop-ups by attribute in ArcGIS Pro

texts: Is there a way to disable pop-ups in ArcGIS Pro by attribute? I have a layer on an indoor floorplan and would like to disable popups for the "corridor/vestibule/locker/entrance" attribute, and keep pop-ups for the rest. I don't see an option for disabling pop-ups for individual attributes, only for the entire layer.


texts: PostGIS > Intersect two circles. Each Circle must be built from Long/Lat degrees plus radius

texts:
I'm trying to figure this out, so I wanted to try asking to the experts.

This question is related to PostGIS (from postgresql).

What I want is:

1) Based on a longitude and latitude I want project a single point (similar on how you can pass the lat and lon to a google map and then have a single point projected).

2) Create a circle geometry around that with a radius. (I'm going to determine the radius based on the horizontal accuracy of the Lat/Lon)

3) Then, I want to do 1 and 2 again to another Lat/Lon combination. And see if those two circles touch.

I suppose for point 2), I could use a constructor like ST_GeomFromText, however I dont quite understand yet how I can project a single point based on two spherical angles (lat/lon).

Then  for point 3, I guess I could use something like ST_Touches


texts: How to read the attribute values using PyQGIS?

texts: What is the way to  get the information contained in the attribute table,  say in column 2, row 2 using pyqgis?


texts: CartoDB geom (coordinates) join: without exact match

texts: Trying to join two datasets (layers) on CartoDB based on their geographical fields (in CartoDB's the_geom created field). However, the basic ST_Intersection function does not work since its tolerance is too small and these coordinates are off by more than 0.00000001. Is there another function to do this? (Trying to join based on approximate coordinates).


texts: ogr2ogr batch load shapefiles into geodatabase

texts:
I'm trying to load a directory of shapefiles into a geodatabase with ogr2ogr. It works fine if I specify a single shapefile, but can't open the datasources if I specify a wildcard. Is there a wildcard I can use to import all of the shapefiles in the directory?

this works:

ogr2ogr -f 'FileGDB' -update -append allroads.gdb roads.shp

This fails and errors with:
"Unable to open datasource `roads.shp' with the following drivers."

ogr2ogr -f 'FileGDB' -update -append allroads.gdb *.shp


texts: ArcGIS Reports on multiple feature classes

texts:
I am GIS student working on my capstone project and I am currently trying to build a report that has multiple parts. In my case I am trying to build a document that has information coming from my chosen feature class but also from other feature classes as well (examples: precipitation average, forest density, etc).
I have all that information spread across multiple feature classes and the report tool in ArcMap only seems to be able to create a report from one feature class at the time.
Is there a way to putting all this information together in one single report? I seem to have reach a dead end here.


texts:
I am new to QGIS and wants to develop a method to generate a series of map in the following case:
I have a polygon feature shapefile of a state and it has multiple polygons inside it of various districts.
I want to divide the whole state into number of overlapping grids and then map them according to the grid.
Here in this image I have highlighted the grid A5. It shows the state polygon along with districts polygons and the grids and its overlap with surrounding grid.

So there are two possibilities when grids are intersected with polygon: either district polygon will be completely inside the grid (which I want to show as continuous line) or some part of a district polygon will be outside the grid or we can call as overlay polygons (i want to show them as dashed line).
I want to make a map of each grid in a data frame and another data frame showing the whole state polygon and having an extent indicator in it, which will highlight the grid which is mapped on the other data frame. Along with this I want to put a map title which shows the state name and grid no (e.g. Chhattisgarh Grid No A5) likewise in all maps.
I have tried the atlas option but desired results were not obtained.
It would be of great help if this can be done automatically using a python script.
The output map is shown below:


texts: Correlate two different zone system records

texts:
I am working with two data sets from different sources that represent the same phenomena and have a challenging point.
Both data sets represent demographic attributed of the population [ person id, age, gender, income , ... ] and records are matched to the zone number with no specific Location. So I can only map them to the center of the zone.
My question is, what algorithm, method, technique is suitable to find a common grid system for both zones for comparison? They should represent a high correlation as they are for the same population.
I use PostGIS, QGIS, Python and Java


texts: I want to open a form (made in QTDesign) in the layer action. It is possible?


texts: Populating an fc field based on the Count of a unique attribute

texts:
I am trying to add a field in a feature class that is populated with the number (or count) of how many other features in that same feature class have the same attribute value in a particular field.  For example, I have a feature class of gas wells that has an attribute field with the wells pad name called "PadName".  I want to create a field in this same feature class with the total count of how many wells share that same "PadName".

I am able to get the count of how many features share that same pad name but I am struggling to populate the newly create "COUNT" field with that number?

Below is my current code.

import arcpy, os, sys

fc = r"GIS\mygeodatabase.gdb\wells"
field = "PadName"
count = "COUNT"

try:
    arcpy.AddField_management(fc, "COUNT", "TEXT", "", "", "10", "", "NULLABLE", "NON_REQUIRED", "")
    print "Successfully Created Count Field!"
except:
    print "Failed to Create Count Field"

Occurances = []
with arcpy.da.SearchCursor (fc, field) as cursor:
    for row in cursor:
        Occurances.append (row[0])

for i in set(Occurances):
    icount = Occurances.count(i)
    print str(i) + ":", icount, "features"
    with arcpy.da.UpdateCursor(fc,count) as cursor:
        for row in cursor:
            row[0] = Occurances.count(i)
            cursor.updateRow(row)

It is populating my new "COUNT" field that I created but it is giving every feature a value of "5" for some reason?


texts:
I have a shapefile with a number of points. Using GeoPandas, I am trying to create a convex hull around the set of points. However, my output layer returns the same points as were fed in. My understanding is that convex hull would take the points and return smallest convex Polygon containing all the points. But that doesn't seem to be happening. I feel like I am missing a basic concept here, but I cannot figure it out. What am I missing?

Here is my code:

import pandas as pd
import shapely
import geopandas as gpd

node_shp = gpd.read_file(node_path)

within_15mins = node_shp.loc[node_shp["within15"]>0].copy()
within_15_hull = within_15mins.convex_hull

node_shp looks like:

      ID    within15    geometry
0   960233     0           POINT (537654.434909813 4812991.530337551)
1   960234     0           POINT (538582.515799641 4812470.00595164)
2   960236     0           POINT (545187.4344721519 4807876.94211408)
3   960237     0           POINT (549496.7740777618 4806878.272506691)
4   960238     0           POINT (551647.5381420769 4805487.459653219)

within_15_hull results are:

139        POINT (610977.628373108 4842383.41564639)
143                           POINT (614301 4841063)
146                           POINT (613955 4842000)
147                           POINT (613825 4842422)
148                           POINT (614790 4842672)
                            ...
26499    POINT (617182.5693036331 4851689.407768221)
26695     POINT (608644.0917927549 4851434.42780789)
26696     POINT (608679.5770971529 4851538.48593273)
26700     POINT (612368.671008331 4838778.938846011)
26702      POINT (609655.111841024 4849233.53601891)
Length: 1467, dtype: object


texts: How can I create a pollutant dispersion raster in QGIS?

texts:
As my previous questions have indicated, I am working on an air quality problem where I have a dataset of industrial emissions that consists of a location (long, lat), and an annual volume of emissions in pounds or tonnes.

The end result that I am looking for is a 'dispersion raster' that will provide an aggregate value of emission dispersion (see below) based on overlapping 11KM buffers, where the dispersion value of each buffer is aggregated wherever the buffers (2, up to 57!) overlap.

Details

I am trying to understand how I can model the dispersion of emissions, from the emissions source, through a simple linear decay model where the dispersion at a point (away from the emissions source) is ((1-d)/(11000m)) (from Hystad 2011 - "Environmental Health Perspectives") where d = the distance to the emissions source in meters.

I envision creating a buffer around each emissions point (and have done so, see below) but do not know how to apply the above formula to the buffer.  Once the buffer has that formula, thus providing a range of values that degrade to zero as you move from the emissions source, I would like to aggregate all the values (through the vertical or Z) of overlapping buffers.

For instance, the attached image provides a view of the emissions sources (red dots) and the buffers (the grey buffers are 'low values' and the red 'high').  How would I create buffers that decay from the emissions point by ((1-d)/(11000m))? Once these are created, how could I calculate the aggregate (i.e. the exposure from all the buffers that overlap a point) exposure value at a point, as represented by the blue dot.

This is hard to explain, so please ask questions! Thanks!


texts: Watershed delineation taking into account lake/reservoir

texts:
My watershed has several big lakes. When I delineated my watershed, I had some unwanted subwatersheds and river segments inside the lakes (see fig. below). I want to tell ArcGIS/ArcHydro to delineate my watershed but ignore places where there are lakes/reservoir. Moreover, the generated subwatershed and streams should be consistent in terms of cascading flow from upstream to downstream e.g. subwatershed 2 flows to the lake and water from the lake flows to subwatershed 3, etc.

Any suggestion would be highly appreciated. Thanks!


texts: error because of missing gdal200.dll while I do have it on my pc

texts:
I've been trying to set up a python script so I can run grass functions by running the script from my command window. The setting up seems to be working, but now I get a system error (different window) saying that the program can't be started because gdal200.dll is missing from my computer. It suggests to possibly solve the problem by re installing the program. (Dutch exact message: Het programma kan niet worden gestart omdat gdal200.dll ontbreekt op uw computer. U kunt dit probleem mogleijk oplossen door het programma opnieuw te installeren).

Consequently the error message in the prompt window is:

*Traceback (most recent call last):
  File "probeertry.py", line 65, in <module>
    for rast in g.list_strings(type = 'rast'):
  File "C:\OSGEO4~1\apps\grass\grass-7.0.4\etc\python\grass\script\core.py", line 1143, in list_strings
    mapset=mapset).splitlines():
  File "C:\OSGEO4~1\apps\grass\grass-7.0.4\etc\python\grass\script\core.py", line 446, in read_command
    return handle_errors(returncode, stdout, args, kwargs)
  File "C:\OSGEO4~1\apps\grass\grass-7.0.4\etc\python\grass\script\core.py", line 313, in handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['g.list', '--q', '-m', 'type=rast'] ended with error
Process ended with non-zero return code -1073741515. See errors in the (error) output.*

If I search for the gdal200.dll on my computer it is actually present in two different places (which might make the error, but then, can I delete one?!) It's found in C:\OSGeo4W64\bin as well as in C:\Program Files\QGIS 2.14\bin.
If I run the same script (found below) directly from the python console, this problem doesn't occur. (I do have a different problem with importing my self made modules there, which doesn't occur if using command prompt... If you have any suggestions on this, would be welcome as well :)) So it's not actually the script but the system.. Can anyone help me with this one?

Here's my script. It goes wrong once using the grass commands (line g.message)

# settings
import os
import sys
import subprocess

grass7bin_win = r'C:\OSGeo4W64\bin\grass70.bat'
gisdb = r"C:\GrassData\2016MDP"
location="Loc_KathmanduValley"
mapset="Deliniation_KV"

# QGISinst=u'C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr'
# qgs = QgsApplication([], False)
# qgs.initQgis()

if sys.platform.startswith('win'):
    grass7bin = grass7bin_win
    print "platform should be configured now"
else:
    raise OSError('Platform not configured.')

print grass7bin

# query GRASS GIS itself for its GISBASE
startcmd = [grass7bin, '--config', 'path']
try:
    p = subprocess.Popen(startcmd, shell=False,
                         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = p.communicate()
except OSError as error:
    sys.exit("ERROR: Cannot find GRASS GIS start script"
             " {cmd}: {error}".format(cmd=startcmd[0], error=error))
if p.returncode != 0:
    sys.exit("ERROR: Issues running GRASS GIS start script"
             " {cmd}: {error}"
             .format(cmd=' '.join(startcmd), error=err))
gisbase = out.strip(os.linesep)

# set GISBASE environment variable
os.environ['GISBASE'] = gisbase

# define GRASS-Python environment
grass_pydir = os.path.join(gisbase, "etc", "python")
sys.path.append(grass_pydir)
sys.path.append(r"C:\Program Files\QGIS 2.14\bin")

# import (some) GRASS Python bindings
import grass.script as g
import grass.script.setup as gsetup

gsetup.init(gisbase, gisdb, location, mapset)

print gisbase
sys.path.append(r"C:\OSGEO4~1\apps\grass\grass-7.0.4\bin")
sys.path.append(r"C:\OSGEO4~1\apps\grass\grass-7.0.4\scripts")
sys.path.append(r"C:\OSGEO4~1\apps\grass\grass-7.0.4\lib")
##check Path
print sys.path

g.message('Current GRASS GIS 7 environment:')
print g.gisenv()

g.message('Available raster maps:')
for rast in g.list_strings(type = 'rast'):
    print rast

Let me know what you think! Or if I should look somewhere else/provide more info.

OS: Windows 10 64bit
QGIS: Desktop 2.14.6 with Grass 7.0.4
Python27


texts: Exploring the association between two variables on QGIS

texts:
I am doing a project on primate electrocutions. I have primate population density data - in the form of point data for each troop, and in the attribute table I have the total number of monkeys for that troop, and I have point data for electrocutions (each point is an electrocution). I have assembled these into a grid and counted number of electrocutions and number of monkeys for each square, and now I am wondering how it is best to answer my question: is electrocution density significantly associated with population density?

I was thinking of doing a Geographically Weighted Regression for this, however using the SAGA GWR tool does not seem to work - it seems to want a raster layer, or points. 'Gwr for multiple predictors' allows me to input a polygon and the columns I want for the attribute table, but it does not actually work when I try to execute it.

From a GIS and a statistical standpoint - how is it best to explore this association?

Would a correlation be better?


texts:
I originally had a DEM .tif raster in Decimal degrees. I projected it into a PCS with the spatial reference in ArcGIS as: WGS_1984_UTM_ZONE_44N

Then, I took the Curvature tool and with a Z-factor of 1 (i used value of 1 because i assumed units are in meters), I computed the profile,plan and general curvatures.

However, I obtained values for the values as such:

plan: high = 128, low = -175
profile: high = 185, low = -148
overall : high = 261, low = -360

I was expecting lower values and not sure how could i interpret the absolute numbers in this case.


texts: Classify Pixel using Deep Learning (strange result)

texts:
I've started to use new version of deep learning tools for Arcgis Pro.
Then I received a strange results on my classification:

The main libraries that i used are:
arcgis=1.8.2
scikit-image=0.15.0
pillow=6.2.2
libtiff=4.0.10
fastai=1.0.60
pytorch=1.4.0
torchvision=0.5.0
tensorflow-gpu=2.1.0
When I go back to my old libraries:
arcgis=1.8.2
scikit-image=0.15.0
pillow=6.2.2
libtiff=4.0.10
fastai=1.0.54
pytorch=1.1.0
torchvision=0.3.0
tensorflow-gpu=1.14.0
All back to normal, and I received such result:

Some details:

I used the same type of imagery, same version of Arcpro (2.5),  same deep learning model. Only change was libraries pytorch (tensorflow).

Also tried on the different type of imagery (simple RGB, non multispectral). Result the same - on new pytorch and tensorflow - result with artifacts as on first figure.

Even tried to train a new model on new libraries. Training comes with no problems. But classification causes the same strange result as mentioned before.

The new libraries I was installed such as mentioned in recommendation by installing deep learning tools or installing python api for deep learning.
I think such kind of result may cause that the new version of tensorflow or pytorch had different interpretation of functions for segmentation. But may be its an another cause. I want to clarify that.
Maybe some of You have such a problem and can help me to figure  out.


texts:
I am working on a custom QGIS application using QGIS C++ APIs.
I am able to render .mbtiles file of world blue marble as a raster file on Qgsmapcanvas. but when I call zoomscale API on canvas with various inputs like 10000000000, 1000000, or 1000 .... it zooms to the same location. no matter what you put value inside this API.. it leads to same extent of the zoom. I need to scale our basemap using scale tab like QGIS does .
Am I using wrong API for this functionality ?
Here is the image of required functionality:


texts:
How do I select multiple features in a vector layer using the Query Builder in QGIS?
Using U.S. Census geographic data, I'm trying to select a large number of specific block groups using the GEOID feature / field.
Based on an answer found here and using the LIKE operator, I've used the following query in the Query Builder:
"GEOID" ILIKE ('34013000100%', '34013000200%')

This results in error:
OGR[3] error 1: SQL Expression Parsing Error: syntax error, unexpected ','.
I've also tried using the LIKE and IN operators; changing the wildcard from % to _ (a single underscore); and other separators replacing the comma, all with error results.
I note that filtering for a single value (such as "GEOID" ILIKE ('34013000100%') works fine.
A sample data file is found here.


texts:
I have many polygons which represent different areas (with different plant species in each of them).

I want to “link” some information to the polygons in order to later be able of seeing which kind of vegetation is in each of the areas (or polygons).

I attach an image so that you can see better what I am trying to explain and do.

The attribute tables of all the polygons are like shown in the picture, and I would like to add the information there is in the excel table.

In each polygon I want to have the information corresponding to the row belonging to the area (as you can see each area has a number and correspond to a specific polygon).

Then, in each polygon should have the same amount of species (all of them) and the information which will be specifically belonging to the area (or polygon) which is based on the numbers (1, 2, 3 or 0) which correspond to the abundance of each of the species in each area.

After, I will need to select the different areas or polygons by if they have 3 of Acer campestre, or 1 of Calluna vulgaris…. For example when selecting by attributes to select: 2 of abundance of Acer campestre species and then all the polygons with this characteristics to be in another colour.


texts: Finding long axis of irregular polygon using ArcGIS Desktop?

texts:
I need some help in how to find the long axis of an irregular shaped ellipse using ArcGIS Desktop.

I have found the centroid but don't know how to determine the longest distance.


texts: Using coordinate system in ArcGIS Desktop?

texts:
I have a few layers. The layers have been made by a different company. So

How do I combine them all together so that they have the same coordinate systems?

I already add the layers, right click < Data frame properties < coordinate system. And select a coordinate system. But it shows the same.  The layers do not seem to overlap. (For example I pick a river layer at the same place, and I add a road layer also from the same place.) But they don't overlap.

Is it because the size of the layers are different?

Or is the coordinate system from map info is different from the beginning?


texts: Creating a useable Geometry for GeoTools

texts:
Just getting into using the GeoTools framework, after having done a lot of things manually.

One of my previously-written functions transforms a given lat/lon/height between CRS.

I found this link:
How to Transform a Geometry

I have generating my custom CRSs set up using WKT text and all - that's fine. But I'm not 100% about the Geometry part. Referenced in the JTS.transform(sourceGeometry, transform) line.

I have what I THOUGHT was what it was expecting:

GeometryBuilder builder = new GeometryBuilder(sourceHCRS);
Point sourceGeometry = builder.createPoint(34.5678, -77.45343);

But I'm getting an error on the JTS.transform that reads:

Error: no suitable method found for transform(Point,MathTransform)
 method JTS.transform(Envelope,MathTransform) is not applicable (argument mismatch; Point cannot be converted to Envelope)
 method JTS.transform(Geometry,MathTransform) is not applicable (argument mismatch; Point cannot be converted to Geometry)

Now, Point is apparently a superclass of Geometry, so I figured that would work. I've dug down enogh to realize there are TWO classes of 'Geometry' - org.locationtech.jts.geom.Geometry which is what JTS.transform() is expecting, and org.opengis.geometry.Geometry, which is what Point is superclassing.

Searching around I haven't been able to deduce how to generate a Geometry with my location/point in it to send to the transform().


texts:
I have created a route events point field based on a table.

When using version 10.2 on a previous computer, the route events would update when the values in the table were changed.  You would change the value in the table then refresh the map view, and the point would update.

I am currently using version 10.6 and this is not happening.  I have tried closing ArcMap and opening again after table edits have been made, in addition to refreshing the view.  It seems the only way to reflect the updated data is to create a new route events layer.

Was this functionality removed from ArcMap at some point between 10.2 and 10.6 or what?

(All reference field types are the same in the route events layer and events table.  I have tried as string, double, and long with the same results.)

Edit: It is now updating upon closing and opening the MXD.  I am waiting longer between the closing and opening now.  After further research, it appears that I need to turn caching off to have the route events update upon refresh.  I guess my previous company had this set? Now the issues is that they only have files to update up until 10.5.  Anyone know how to turn off the caching for the route events in 10.6.1?

https://support.esri.com/en/technical-article/000006530


texts: Usage of custom metric in hybrid analysis in sdna

texts:
I would like to use a custom metric for the distance analysis in sDNA.

To this end, I use the following settings:

Routing and analysis metric: 'Hybrid'
Radii: same order of magnitude as the metric
Radial metric: Custom or Hybrid (see below)
Custom metric field: Empty
Advanced config: lineformula = euc/FULLeuc*column_name

If I set the radial metric to hybrid, I receive the error message: 'ERROR: Error in formula for link metric'.

If I set the radial metric to custom, there is no change in the output values (e.g. betweenness remains the same, I assume because the same links are considered in the calculation).

The purpose of the custom metric is to reward/penalize more/less attractive links in the calculation of metrics.

My example network can be found here.

Software:
ArcGIS 10.5.1
sDNA+ 3.4.5


texts: QGIS - best fit to the sectoral terrain (SRTM 30m resolution data)

texts:
I need a help to find out the Slope of "best fit to the sectoral terrain".
here is in details  about the area of calculation.

we have a reference point, from the reference point our sectoral area could be around 1000m with the sector range starts from 220 degree to 300 degree. I wanted to calculate the "best fit to the sectoral area between 220 degree to 300 degree with the length of 1000m".

What I did so far is, I calculated the slope of the whole terrain but I am not able to limit the slope area within 1000m with 220deg to 300degree. Again I don't know how to calculate the "best fit" of the slope for the sectoral plane.


texts:
I am trying to extract data from a geotiff file in the Ubuntu terminal. My professor used the command "gdal NDVI.tif" and was able to write the data to a text file. When I use that command, I get the error "gdal: command not found."

I type in "gdalinfo --version" and it gives me the version number. I type in "whereis gdal" and it shows me what directories it's in. I used the command "sudo apt-get install python-gdal" to install and already have python 2.7.

Does anyone have any idea why I am getting this error? Google searches have been fruitless.

Best,
Sean


texts: Making output name same as input name in different file and doing this process for many different inputs using ModelBuilder

texts:
I am trying to create a unique watershed polygon for many different points and then running a function to merge all of the overlapping polygons into a single file. My model is successful at running one input point at a time but to save the outputs in the files I want, I have to manually change the names each time. I'm not sure how to automate the naming of these files.

I also don't know how to automate the process of loading in all of the different input points. I assume you would use an iterator but not sure which one and how to connect it to my model.

Regarding the merge tool, I would like to take each output from the raster to polygon tool and merge them into a single polygon file. This step isn't totally necessary because I can manually drag them all into the merge tool but if its not too difficult I would like to learn how to implement that as I am new to ModelBuilder.

This is 3 questions in one really.


texts: How to get/set label scale ranges (e.g. minScale) in ArcPy?

texts:
For a layer object lyr, one can programmatically set the minScale in arcpy as such:

lyr.minScale = 150000

For a label, one can manually set the scale range within a dialog in ArcMap. In arcpy, is there a way to programmatically set the minScale for a layer's label in much the same way one can for the layer itself?

I see that it can be done through the JavaScript API, but I haven't yet found a way via arcpy.  (I have ArcMap 10.1 SP1.)


texts: ArcMap - Labeling Expression - If-then, else

texts:
I am very new to writing expressions. I am working with address data. We want to display the street number and #unit number if there is a unit, and just the street number if the unit field is empty. I have mimicked various scripts (VBScript & Python) provided in other helpful posts, but I am still getting the # after the street number if the unit field is empty. I am not sure what I am doing incorrectly.
The script I used:

Function FindLabel ( [STNUM] , [UNIT] )
if [UNIT] <> " " Then
  FindLabel = [STNUM] + " " +  "#" + [UNIT]
else
 FindLabel = [STNUM]
end if
End Function


texts: QGIS: General tab not showing up under Properties for ESRI shapefiles

texts: I'm a QGIS novice, have been using ArcGIS for years. Pulled ESRI shapefiles into a QGIS (version 3.12.1), wanted to select a subset of features (essentially doing what a Definition Query would do in ArcMap). Online help says: Open Properties and select General tab (hammer and screwdriver icon), choose Feature Subset to set up query. Only problem is when I go to Properties, there is no general tab for any of my layers (all ESRI shapefiles). I can see lots of other tabs (symbology, source, etc). Why is that? Is there another way to set up Feature subsets?


texts: Calling a Python function for each page in an atlas

texts:
I have made a script to do some calculations for each page of a QGIS atlas (QGIS Atlas with insert map)

The script is adjusting the bounding box of a map on the layout page. To make it run for each page, I have made a textbox where the script is returning nothing. I do not care for the return value, I just want the side effect of having the bounding box adjusted.  The solution is working nicely, but it feels a bit kludgy.

Is there anywhere else I could put the script to make it run once per page for my atlas?

(using qgis 3.6.1 on windows 10)

Correction: When testing a bit more, it turns out some maps are being exported before they have finished rendering (I am fetching some relatively large data sets from a wms-server). When I browse manually through the maps, it goes a little slow, but when I export the entire atlas, for about  one third of the maps, the map I am adjusting manually is showing the map from the former page.


texts: Click event returning wrong Y container point in Leaflet?

texts:
I am using QGIS Server and Leaflet to display geotiffs on my website. I have created an onMapClick function which uses a GetFeatureInfo request to QGIS Server which returns the value of the geotiff in a popup. The function looks like this:

popup = new L.Popup({maxWidth: 400});

function onMapClick(e){
    var BBOX = map.getBounds().toBBoxString();
    var WIDTH = map.getSize().x;
    var HEIGHT = map.getSize().y;
    var X = map.layerPointToContainerPoint(e.layerPoint).x.toFixed(0);
    var Y = map.layerPointToContainerPoint(e.layerPoint).y.toFixed(0);

var alayer = 'Ppt%20ElW%20(mm)';

var gfURL = URL + '?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=' + alayer + '&' + 'BBOX=' + BBOX + '&HEIGHT=' + HEIGHT + '&WIDTH=' + WIDTH + '&FORMAT=image%2Fpng&' +
    'INFO_FORMAT=text%2Fhtml&X=' + X2 + '&Y=' + Y2 + '&CRS=EPSG:4326&QUERY_LAYERS='+alayer;

$.ajax({
    url: gfURL,
    dataType: "html",
    type: "GET",
    success: function(data){
        popup.setContent(data);
        popup.setLatLng(e.latlng);
        map.openPopup(popup);
    }
});
};

map.on('click', onMapClick);

For some reason, the calculated Y value is slightly inaccurate. It is close, but does not align completely with the geotiff grid-cells. It will be apparent when you try to use the website.  The inaccuracy varies with the zoom level. I have been trying to figure this out for weeks and cannot seem to get anywhere.


texts: ArcMap Area Calculations vs MultiNet FEATAREA Field Discrepancy

texts:
I'm finding a huge discrepancy between the values supplied in the FEATAREA field in my MultiNet data and the area calculation results from ArcMap v10.2.2.

In this case, I'm looking at the area of U.S. counties in the *__A8 MultiNet files. A spot check of the values supplied in the FEATAREA field suggests that the values are correct (based on Google searches for county area).

However, when I project the layer to WGS 1984 Web Mercator in ArcMap, then add a new data field to the attribute table and do a "Calculate Geometry" on that field, the resulting value is off by a factor of 50 to 100 percent - it varies from one row to the next and isn't a constant scale factor error. I've verified that I'm asking for the same unit of measure (square meters in this case).

Obviously this leads me to question both my methods and the accuracy of the polygon data supplied by MultiNet. It seems more likely that I'm doing something wrong or omitting a required step, but I can't figure out what that might be.


texts: Arcpy: Using where clause in append_management

texts:
I would like to write a script where I select a feature class by attributes, add a field for a timestamp, and append the selected features to another feature class.  My code is below; Do I need to create a feature layer before selecting by attribute and is it possible to select the layer by attribute, and append the selection another feature class?  My code is below;

import arcpy
SDE5556 = "C:\CleanStreets_55_56.gdb\Clean_Streets_55_56"
SOSC = "C:\CleanStreets_55_56.gdb\SOSC"
AppendPath = "C:\CleanStreets_55_56.gdb"
AppendTable = "CleanTable"
aTable = "C:\CleanStreets_55_56.gdb\CleanTable"
Clause=  "' PlannedDate = CONVERT(DATE, GETDATE()) AND RESOLUTION_CODE = '55'"

arcpy.MakeFeatureLayer_management (SOSC, "sosc")

arcpy.SelectLayerByAttribute_management(SOSC, "NEW_SELECTION ", Clause)

arcpy.AddField_management(PeterTable, "DATE", "DATE")

dateExpression = "Date"

arcpy.CalculateField_management(aTable, "DATE", dateExpression)

arcpy.Append_management(SOSC, SDE5556, NO_TEST)

When executing the first two lines of the main code block in the Python window in ArcMap I receive Runtime error  Traceback (most recent call last):   File "<string>", line 14, in <module>   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 6688, in SelectLayerByAttribute     raise e ExecuteError: ERROR 000800: The value is not a member of NEW_SELECTION | ADD_TO_SELECTION | REMOVE_FROM_SELECTION | SUBSET_SELECTION | SWITCH_SELECTION | CLEAR_SELECTION.


texts: Choose a specific geometry column of a Spatial View in a Microsoft database to plot feature points in ArcMap

texts:
I have created a Spatial View in a Microsoft SQL database (SQL Server Manamgement Studio v18.4), i.e. a View with spatial columns. This View contains the two following point geometry columns for two different coordinate systems (CH1903/LV03 [EPSG 21781] and CH1903+/LV95 [EPSG 2056] respectively):

geometry::Point(X1, Y1, 21781) AS GEOM_1
geometry::Point(X2, Y2, 2056) AS GEOM_2

In ArcCatalog, this View is recognized as a Spatial View, i.e. at least one of the spatial columns is recognized as such by ArcCatalog. However, when drag-and-pull this View from ArcCatalog into the Data Frame of ArcMap 10.7, I can not choose which one of these two geometry columns is used to plot the points. ArcMap automatically takes the geometry column with CH1903/LV03 [EPSG 21781] coordinates. How can I enforce the other geometry column to be used to plot the points?


texts:
I have multiple geometries with multi-points, and when I use script to select a feature, all features from multi-points are selected, but I want only clicked point.

My code to select points:map.addInteraction(new ol.interaction.Select());

Obs:I need use multi-point because I have so many points to draw, and this way is faster


texts: Turning on another layer when one is selected in TOC using PyQGIS?

texts:
I have a large number of raster model files of water depths with corresponding velocity vectors in point shapefiles.  I want to be able to 'walk through' the results displaying the depths and velocity vectors on top of each other but without having to select both layers in the TOC.

Would it be possible to write python code that would turn on the corresponding vector layer when a raster was turned on in the TOC, based on matching its name?

It would ideally need no user input except to run the code before the user started to visualise the results.

The two files (one raster and one shapefile) have essentially the same names identifying the model name and containing a numeric identifier which would be unique to just those two layers.


texts: Error converting ASTER level 2 HDF to geotiff using Heg

texts:
I am trying to convert ASTER level 2 HDF files (AST_08 Surface Kinetic Temperature) to GeoTiff using the HEG swtif tool and a parameter file from the command line in Ubuntu. When I run the program I get the following error:

  (swtif)
  Start Time:  Sat May 13 01:15:56 2017

  Listing Command Line Options:
  ./swtif -p param_file

  Error: Failed to get environment variable PWD. Not setting it may cause   >some problems later.
  Error: Check_envs_for_space : Environmental Variable Not Found
      : One of the environment vaiables PWD, MRTDATADIR, PGSHOME, or   >MRTBINDIR has not been set or has an illegal space in it. This causes   >problem later.
  Fatal Error, Terminating...
  Fatal Error, Terminating...

The contents of the parameter file are:

NUM_RUNS = 1

BEGIN
INPUT_FILENAME = /home/me/Documents/data/AST_08_00301012002193924_20170512065710_28288.hdf
OBJECT_NAME = SurfaceKineticTemperature
FIELD_NAME = KineticTemperature|
BAND_NUMBER = 1
OUTPUT_PIXEL_SIZE_X = 90.0
OUTPUT_PIXEL_SIZE_Y = 90.0
SPATIAL_SUBSET_UL_CORNER = ( 14.635767 39.845845 )
SPATIAL_SUBSET_LR_CORNER = ( 13.970527 40.618836 )
RESAMPLING_TYPE = NN
OUTPUT_PROJECTION_TYPE = UTM
ELLIPSOID_CODE = WGS84
UTM_ZONE = 0
OUTPUT_PROJECTION_PARAMETERS = ( 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0  )
OUTPUT_FILENAME = /home/me/Documents/data/processed/AST_08_00301012002193924_20170512065710_28288_SurfaceKineticTemperature.tif
OUTPUT_TYPE = GEO
END

Which I run at the command line with:

export MRTDATADIR=/opt/heg/data
export PGSHOME=/opt/heg/TOOLKIT_MTD
sudo ./swtif -p param_file

I've tried setting the environment variable PWD manually, but I get the same error.


texts: Area units for output polygon in WGS 84 UTM Zone 32N using QGIS

texts:
I am calculating the area of my polygon and I have used WGS 84 UTM zone 32N to calculate the area (using geometry on the field calculator) of my polygon, and I obtained 745461 (without units).

How do I determine whether it is in square metres or square kilometres?


texts: Unioning each 4-elements group in grid using postgis

texts:
I have a table containing multipolygons of stratasystems. One of the stratas contains a set of multipolygons - each of equal size - so they make up a grid of non-overlapping polygons. This grid is too detailed - we want to reduce the resolution by combining each 4 gridcells into a new cell and taking the mean of the data value in the 4 cells being unioned.

Is there a way to do this in postgis or using a gdal tool? The grid is bound around a coastline - so some cells will not have 3 neighbours - so they should be unioned with 2 or 1 neighbour if possible.

Edit: Here is sample data input:
Query:select id, name, ST_AsText(geoshape) from hcell where id_grid=9 and (name='Y0X0' or name='Y0X1' or name='Y1X0' or name='Y1X1')

|id | id_grid | st_astext | name |
|---|---------|-----------|------|
|1036243|Y0X0|MULTIPOLYGON(((12.840605 64.22435,13.32486 64.305214,13.145422 64.51621,12.657933 64.43471,12.840605 64.22435)))|
|1036323|Y0X1|MULTIPOLYGON(((13.32486 64.305214,13.811942 64.38435,13.635805 64.595985,13.145422 64.51621,13.32486 64.305214)))|
|1036244|Y1X0|MULTIPOLYGON(((12.657933 64.43471,13.145422 64.51621,12.962985 64.72692,12.472228 64.64476,12.657933 64.43471)))|
|1036324|Y1X1|MULTIPOLYGON(((13.145422 64.51621,13.635805 64.595985,13.456705 64.80734,12.962985 64.72692,13.145422 64.51621)))|

and desired output:
Queryselect ST_AsText(ST_Union(geoshape)) from hcell where id_grid=9 and (name='Y0X0' or name='Y0X1' or name='Y1X0' or name='Y1X1')
Output:

|st_astext|
|---------|
|POLYGON((13.32486 64.305214,12.840605 64.22435,12.657933 64.43471,12.472228 64.64476,12.962985 64.72692,13.456705 64.80734,13.635805 64.595985,13.811942 64.38435,13.32486 64.305214))|


texts: GDAL SQL syntax to add field an put values

texts:
I try to make a new field in my attribute table and put in values from another field after converting from character to integer but can't get the right syntax. I run this as shell-script in MSYS.

cd D:/GIS_DataBase/CorineLC/shps_app_and_extr/
myfile=extr_and_app.shp

name=${myfile%.shp}

ogrinfo $myfile -sql "ALTER TABLE $name ADD COLUMN code_num int(3)"
ogrinfo $myfile -sql "UPDATE TABLE $name SET code_num = CONVERT(code_06 As int(3))"

Error Message (MSYS):

Kay@KAY-PC /c/users/kay/desktop/bash
$ sh calc_field_shp.sh
Warning 6: Unsupported column type 'int'. Defaulting to VARCHAR
INFO: Open of `extr_and_app.shp'
      using driver `ESRI Shapefile' successful.
ERROR 1: SQL Expression Parsing Error: syntax error
INFO: Open of `extr_and_app.shp'
      using driver `ESRI Shapefile' successful.

Edit - Another go with SQLite:

cd D:/GIS_DataBase/CorineLC/shps_app_and_extr/
myfile=extr_and_app.dbf

name=${myfile%.dbf}

ogrinfo $myfile -sql "ALTER TABLE $name DROP COLUMN code_num"

ogrinfo $myfile -sql "ALTER TABLE $name ADD COLUMN code_num integer(3)"
ogrinfo $myfile -dialect SQLite -sql "UPDATE $name SET code_num = CAST(code_06 As integer(3))"

Error message:

Kay@KAY-PC /c/users/kay/desktop/bash
$ sh calc_field_shp.sh
INFO: Open of `extr_and_app.dbf'
      using driver `ESRI Shapefile' successful.
INFO: Open of `extr_and_app.dbf'
      using driver `ESRI Shapefile' successful.
ERROR 1: SQL Expression Parsing Error: syntax error
INFO: Open of `extr_and_app.dbf'
      using driver `ESRI Shapefile' successful.


texts: Need help in Print task in ArcGIS JSAPI 3.2/3.3

texts:
I am using print task in my code and using dynamic map service layer and graphics layer (not using feature service layer) and I am able to print the map but it’s not displaying info window and graphics in the print out.

So any help will be great!!

Complete code on JSFiddle (I removed my server name)

What I am trying:

I am going though this example in which I found that they are using graphics  layer +  feature layer and graphics is coming while printing the map
Replaced with ESRI sample REST service for the print task  still not getting the graphics and info-window
Researching on my side

Software’s: ArcGIS for Server and Desktop version 10.1 and JSAPI version 3.2/3.3


texts: How to join a dataframe with a dbf via a common column in R?

texts:
I have a SpatialPointsDataFrame with the data of a city and i want to join it with a dbf that contains the population via a common column that they have. How do i do that so the first one has the population.

df <- read.dbf("newyork2014pop.dbf")
 j<-merge(city,df,by="what do i put here?")

----UPDATE----

df1 <- read.dbf("newyork2013population.dbf")
city<-readShapeSpatial("shp")
m<-merge(df1,city,by.x="C2013",by.y="CODS")
reclass = function(x){
 ifelse(x < 500, 0,
     ifelse(x < 1000 & x >= 500, 5,
            ifelse(x > 1000, 10, NA)))
}
 m$vat<-as.numeric(lapply(m$POP2013,reclass))
 city.a<-gBuffer(m[m$POP2013==1000,],width=200,byid=T)

this returns

Error in (function (classes, fdef, mtable)  :
unable to find an inherited method for function ‘is.projected’ for signature       ‘"data.frame"’


texts: QGIS point sampling tool really slow for polygons?

texts:
I have a large field of randomly distributed points (100,000 of them to be precise), and I'd like to get values for a variety of raster and polygon coverages for each point.  I've been using the QGIS Point Sampling Tool, and it seems to work very nicely for rasters (runs in under a minute) but to take literally hours for many of my polygon coverages.

Can someone explain to me why this is taking so long?

Is there a more efficient open source tool to do this?


texts: What's the correct csv format for MMQGIS Join by attribute?

texts:
When trying to join attributes from CSV-file with MMQGIS, I currently get the error message:

File inaccessible or in unrecognized CSV format /Netzplanung/Truck_park/trkbuspk15_2.csv

Tried with semicolons and commas as seperators, didn't work. Using Qgis master 1.9.0, MMQGIS 2012.12.07. Anybody got an idea?

Attached sample csv file (semicolons as separators)
sample file


texts: Calculating mean of true ground points in every pixel of DEM using ArcGIS Pro

texts:
I have a DEM of 12m resolution and true ground points (more than 11,0000 points) to assess this DEM.
I want to take the  mean from all points within every pixel using ArcGIS Pro.
How can I do this?


texts: Howerive vector stream network from a DEM using D-Infinity Flow Direction algorithm?

texts:
I have been working with a 1m LiDAR derived DEM to create a vector stream network. Using the D8 flow direction, D8 flow accumulation, and a specified threshold, I was able to create a vector stream network. I used the Stream to Feature tool from ArcGIS Desktop using the D8 Flow Direction raster and the Stream Source Raster. However, if I want to calculate the stream feature from D-Infinity flow direction and flow accumulation, what can be done? In terms of using the Stream to Feature tool of ArcGIS, it does not take the D Infinity Flow Direction raster as input since it is a floating point raster.

I am using ArcGIS Desktop 10.6.1 and also I am using TauDEM software.


texts: How to retain cells with >50% nodata in QGIS raster calculator?

texts:
I'm trying to calculate 10x10 km pixels from a 30x30 second raster in QGIS. The raster calculator seems to do what I want, except that the new raster has nodata in cells where more than half (I guess?) of the area from the source raster is nodata. Is there a way to make the calculator ignore nodata or change the acceptable nodata threshold?
I've also read Projections->Warp suggested, but I'm not sure how this would work with the second to km conversion.

Note: I'm aware that ignoring large amounts of nodata has severe pitfalls, but I think it should be OK in this case, as nodata simply means 'water', and I'm only interested in what's on the land, but would like to retain coastal cells that are only 10% land.

EDIT: Apologies for not checking this in detail before posting, but after experimenting with different resolutions it seems that there is no real 'threshold' as I assumed. At 5x5 km I have some cells as nodata even though their area is 80%+ covered by the source layer, others have a value even though only ~10-20% of their area is covered. All cells where the area is 100% or 0% covered behave as expected, while those on the edge (i.e. partially covered in the source layer) may or may not have a value in the output layer. I can't really seem to find a pattern. Any advice?


texts: WebScene: scene completely black in Chrome

texts:
We suddenly have problems visualizing ArcGIS Online WebScenes in Google Chrome (Version 76.0.3809.100 (Official Build) (64-bit)) and I am wondering if we are the only ones, as some searches returned not something like it. OS is Windows 7.

What we see is actually nothing in the scene frame:

We contacted ESRI's support but they did not seem to know about it. This is happening in both existing- and new scenes. Both local and global. It does work in IE (11.something) but we need it to work in Chrome.

Devtools shows a lot of errors like

  [.WebGL-0000000006BB1390] GL_INVALID_OPERATION: Error: 0x00000502, in
  ../../third_party/angle/src/libANGLE/renderer/d3d/d3d9/Image9.cpp,
  createSurface:278. Internal D3D9 error: HRESULT: 0x8876086C: Failed to
  create image surface

Update 20-08-2019:
It turns out that the WebGL2 tests fail:

https://get.webgl.org/webgl2/

https://webglreport.com/?v=2


texts: Where is the open Java client for ArcGIS Server?

texts:
Short of hacking the Android SDK into your Java project, are there any Java clients that can consume and work with ArcGIS Server services? e.g. create Feature Sets, Geometries, perform Queries/Geoprocess tasks, etc..
Similar to what you can use the Javascript or ObjC SDK's. Though I don't need to visualize, only interact with the services.
The closest thing I've seen is the Geometry API:
https://github.com/Esri/geometry-api-java
No, I don't want ArcObjects or any SDK that requires some $$license.


texts: Are there sources for more esoteric data than streets worldwide?

texts:
Related to this question.

For example, things like:

political world map (as polygons)
cities of the world
geolocated climate data (avg temp, humidity, rain, as polygons),
earthquakes,
hurricanes (as polylines hopefully with strength as z-axis data)
store location of international chains (mcdonalds, for example)

If you know sources only for specific countries/regions, that is still helpful. Please point out if the source provides only a WMS layer or supplies downloadable data


texts:
Anyone know a TIN DEM file format commonly used?

In the context of a TIN DEM generator project, I am searching for a file format to save the TIN generated.


texts:
Can someone provide a precise definition of what a "non-noded intersection" is? There are various GIS platforms and toolkits that have errors with this text, and Google search results for this tend to fall in the category of "drop some precision and all your problems go away" without any real explanation of what's going wrong. Given two valid geometries, why would this error occur?

References to documentation would be most helpful.


texts:
I have a bunch of georeferenced TIFF images created in QGIS. The person creating them saved them as uncompressed (around 1 GB each).
I would like to compress them as LZW to save space.

How can I do that in a programmatic way (e.g. batch)?

I am open to QGIS or R approches. Please consider I do not know how Georeferencing information are attached to an image (e.g. I have seen somewhere references to a world file, but I do not know what it is).


texts:
Here is the simplest example of the web map using ArcGIS Javascript API in jsbin.
I'm getting a Reference error: "require is not defined".

Does anyone know why is this happening since require should have been exposed by the Dojo loader which is included in ArcGIS JavaScript API?


texts:
I am trying to add a custom tag to everything in my Overpass query. As far as I understand this can be achieved with convert. But so far, this kind of statement:

convert way
      ::id=id(),
      ::=::,
      import_id=17;

drops all attributes except id and all way contents (nd refs), so only tags and id remain intact, and with the new tag added. Is is possible at all to make a complete copy of a set element with convert, or with any other means?


texts: Updating field based on another field in ArcPy?

texts:
I need to update a field based on another layers field. I could do this in arcmap manually by joining the two layers together and then using field calculator. Is there a way I can do it with a script? I.e just enter the field as an input and run it and it will calculate the field I need.

I was thinking along the lines of

inputFC = arcpy.GetParameterAsText(0)

searchcursor, updatecursor?

all I want is the average of a field in one layer to be entered into one row/column in another.

I should also add I want this as a script so it automatically creates a new field in the polyline and puts the average of the other layers field in it.


texts: automating forest cover calculations with Python

texts:
I have a layer of forest cover comprising ~ 30,000 individual forest patches, and I need to calculate the amount of forest cover within a 5 km buffer of each patch. The buffers all overlap each other, which stopped me from calculating forest cover with a simple intersect of the buffer layer with the forest layer. In a small test area I have been able to calculate amount of forest by doing a Union on the forest cover and buffer layers, using a definition query on the resulting layer to only show features where buffers and patches intersect, then Spatial Joining this layer to the original buffer layer with a 'sum' merge rule to give the total amount of forest per buffer. However, the largest area I have been able to apply this process to successfully is about 1/1000th the total area that I need to do it to, and even this takes about 1hr of processing to complete. Beyond this the initial Union fails - I think that this is because all the overlapping buffers create an enormous number of features when Union runs.

So, I’m wondering if it will be possible to break this process down into smaller chunks with a Python script? I’m a raw beginner with Python (aside from a few online tutorials I’ve just done) but guessing it might be possible to individually intersect each of the 30,000 buffers with the native forest layer, sequentially write the output of each of these intersections into e.g. a text file, then joining this to the buffer layer’s attribute table. Before I invest too much effort into learning scripting, can anyone tell me if this approach is likely to be doable for a Python newbie or am I barking up the wrong tree?

Thanks in advance,

Jay


texts: Chart Series By Region in Google Earth Engine?

texts:
I've wrote a code for modis ndvi timeseries(code below). But it returns error in chart creating (ui.Chart.image.seriesByRegion) : Error generating chart: Invalid argument specified for ee.Number(): system:time_start

var regions = ee.FeatureCollection([
  ee.Feature(    // forest.
    ee.Geometry.Rectangle(geometry), {label: 'forest'}),
    ee.Feature(    // crop.
    ee.Geometry.Rectangle(geometry2), {label: 'crop'})
  ]) ;

var modis = ee.ImageCollection("MODIS/006/MOD13Q1")
.filterDate("2000-01-01","2017-12-31");

var mod13 = modis.map(function(img){
  var id = img.id();
  img = img.select("NDVI").rename(id);
  return img.multiply(0.0001)
  .copyProperties(img,['system:time_start','system:time_end']);
});

print(mod13);

var timeseries = ui.Chart.image.seriesByRegion(
  mod13,regions,ee.Reducer.mean(),250,'system:time_start','label')
  .setChartType('ScatterChart')
  .setOptions({
    title : 'vegetation series',
    xAxis : {title : 'time'},
    yAxis : {title : 'NDVI'},
    lineWidth : 1,
    pointSize : 2,
    series : {
      0 : {color : 'red'},
      1 : {color : 'green'}
    }});

print(timeseries);


texts:
I have a table with a few columns (id, col2, col3, geom) in a PostgreSQL/PostGIS database.
I want to find all duplicates (or more) from "col3" having that they share value in "col2".
The next step would be to rename those duplicates (or more) to something unique (anything will do).

As a first step I've managed to get the records that are duplicates (or more) from my table with this statement:

SELECT col2, col3,  Count(col3) from my_schema.my_table
group by col2, col3
having Count(col3)>1;

However this does not give me the “id” column that tells what records to rename.  Any ideas on how to include the id-column and still be able to achieve what i described above? Is there a way to rename the records that are duplicates so that all records are unique in “col3” when “col2” is unique?


texts: Remove/hide selected layer and display new layer after click on button

texts:
I´m trying to create two drop-down lists:

                    <select id= "select1">
                        <option value="layer1">layer 1</option>
                        <option value="layer2">layer 2</option>
                    </select>
                    <select id="select2">
                        <option value="_sample1">sample 1</option>
                        <option value="_sample2">sample 2</option>
                    </select>
                     <button id="testing">Try it</button>

I want to display map service with the help of values from these drop-down lists:

on(dom.byId("testing"), "click", myFunc);

function myFunc() {
    var sum = document.getElementById("select1").value + document.getElementById("select2").value;
    var jprlLayer = new esri.layers.ArcGISDynamicMapServiceLayer(urlPrefix + "blabla/" + sum + "/MapServer", {
        "id": "jprlLayer",
        "opacity": 0.8
    });
    mainMap.addLayer(jprlLayer);
    mainMap.reorderLayer(jprlLayer, 3);
};

When I select values from lists and click on the button, the layer with specific id is displayed in the map. But when I want to select other values and click on the button again, it´s still showed the first layer instead of new layer according to newly selected values from lists. Can someone help me with this situation or advice me how to resolve this ? I need to remove actually showed layer and add new layer with newly selected values. Sum of values represents id of map services.


texts:
I've set up a simple web application where users can draw vectors (points, lines and polygons) using OpenLayers.

Actually digitizing is handled controls (OpenLayers.Control.DrawFeature) and I'm using featureadded, afterfeaturemodified, featureselected and featureunselected listeners to save edits in the database.

I want to be able to manually add features, and insertXY() method of OpenLayers.Control.DrawFeature (full reference: http://dev.openlayers.org/docs/files/OpenLayers/Control/DrawFeature-js.html#OpenLayers.Control.DrawFeature.insertXY) to add x and y values, manually or using browser geolocation. This is working fine on PATH and POLYGON controls, but it's not working as expected on POINT control. In fact it's not working at all.

When I fire insertXY method no point is added on the map and no callback function is called. Am I missing something? I tried also to call the finishSketch() method after insertXY(), but I get the following error: TypeError: this.handler.finishGeometry is not a function

Maybe insertXY does not work with points?


texts: PyQGIS 3 vector layer labeling settings dialog

texts:
I am working on a PyQGIS standalone application with the latest QGIS 3 libraries and in Python 3.7. I would like to allow users to modify any vector layer's labeling style, I know in QGIS program, one can just right click on a layer and go to its properties, I would like to open up that labeling dialog directly, but I couldn't find the right dialog to call.
Anyone know what QgsXXXDialog that I can call for label setting configuration? (I know I can build one myself, but really want to use one from QGIS python API)


texts: Remove specific points from linestring postgis

texts:
I am working with a data set that has been using the (0 0) point to pad any points that were missing when the linestring was created. So now the query

SELECT
    id, route as line
FROM
    trips
WHERE
    ST_Contains(route, ST_PointFromText('POINT(0 0)', 4326))

Returns some linestrings where a point or two has been set 0 0 and some where the entire linestring is 0 0's.

Is there a way get the index of ST_PointFromText('POINT(0 0)', 4326) from a linestring so I can delete it?

EDIT

Removing the lines that are all 0 0 points is trivial now that I think about it.

DELETE

FROM
    trips
WHERE
    ST_Contains(route, ST_PointFromText('POINT(0 0)', 4326))
AND
    ST_LENGTH(route) = 0

I am still trying to remove the points in lines.


texts:
Due to limitations in the processing script framework (for example, inability to specify an optional field) I'm thinking of writing a Provider.

I found the example ExampleAlgorithmProvider but no documentation.

Two questions:

Are the interfaces used by the example provider considered stable and unlikely to change in any way that breaks compatibility?
What is the recommended way to distribute/deploy a custom provider?


texts: When loading a GPX-File in QGIS it is not referenced on WSG84. It´s shown with wrong coordinates. Settings are WSG84.


texts: Automated way of creating random points for accuracy assessment in QGIS?

texts:
I have created a land use land cover map using the SCP plugin of QGIS. I want to perform accuracy assessment of this classified image by creating 100 sample points for each class and importing them into Google Earth. This option, however, is unavailable in SCP. There is only an option to provide a reference shapefile (created from my ROI training file) or a raster image for the assessment.

If this is not possible, is there an option for performing stratified random sampling for each class using the raster itself, without having to polygnize it?


texts: Separate a polygon in different polygons depending of the distance to another polygon

texts:
I have a reference polygon "R", and others polygons (in grey).

I want to separate each grey polygon in multiple polygons, depending on the distance to R with different Buffers :

The red line is R with a 5 meters buffer
The green line is R with a 20 meters buffer
The purple line is R with a 50 meters buffer

I don't know how to achieve this simply, because in this case, the smaller grey polygon should be split into 3 polygons, and I'm able to split it in only 2 in one query.

If I have 3 buffer, should I do 3 different queries to fill my table, or is there a way to do it in one time ?

The criteria for the splitting is the distance to R.

The small grey polygon can be split in 3 polygons, determined by :
- The area before the red line
- The area between red and green line
- The area after the green line

My full query is :
-- 5m zone

create table splited_polygons as
select p.id, p.nom, 5 as distance, ST_Intersection(ST_MakeValid(ST_Buffer(h.geom::geography, 5)::geometry), ST_MakeValid(p.geom)) as geom
from polygons p, hydro h;

-- 5m-20m zone

insert into splited_polygons (id, nom, distance, geom)
select p.id, p.nom, 20 as distance, ST_Intersection(ST_MakeValid(p.geom), ST_Difference(ST_Buffer(h.geom::geography, 20)::geometry, ST_Buffer(h.geom::geography, 5)::geometry)) as geom
from polygons p, hydro h;

-- 20m-50m zone

insert into splited_polygons (id, nom, distance, geom)
select p.id, p.nom, 50 as distance, ST_Intersection(ST_MakeValid(p.geom), ST_Difference(ST_Buffer(h.geom::geography, 50)::geometry, ST_Buffer(h.geom::geography, 20)::geometry)) as geom
from polygons p, hydro h;

-- > 50m zone

insert into splited_polygons (id, nom, distance, geom)
select p.id, p.nom, 100 as distance, ST_Difference(ST_MakeValid(p.geom), ST_Buffer(h.geom::geography, 50)::geometry) as geom
from polygons p, hydro h;


texts:
I need to create a qgis plugin to import dip and dip direction data from an android compass app into an (existing) bedding data layer.

I need some suggestion about the best exchange file format; my idea would be to use QgsJsonUtils to import a GeoJson file, instead of using xml or csv format.


texts: QgsFeatureRequest with expression on joined fields in pyqgis

texts:
I have a shape layer in a QGIS 2.8 project with fields A and B joined to a Oracle database layer with field C.

I am writing a plugin to search the shape for fields A, B, and C.  I am doing this with a QgsFeatureRequest.  I get no results when the joined field C is in my Expression.  The Expression with the joined field does work fine if I put it in the ExpressionEditor in the Attribute Table.  The Expression without the joined field also gives me results in the code.

Is it not possible to do a QgsFeatureRequest using fields that are joined to the layer?

Here my code:

# GEM_NAME is the joined field from an Oracle Table
# FLUR and FLSTCK are present in the Shape file

expr = u"""upper(\"GEM_NAME\") like \'%{}%\'
           and \"FLUR\" = {}
           and \"FLSTCK\" = {}"""
layer = self.getLayerByName("flurstueck")
features = layer.getFeatures(QgsFeatureRequest().setFilterExpression(expr))


texts: Generating Styled Vector Tiles with QGIS 3

texts:
I have generated raster tiles before with QGIS 3.14 (which worked fine) and now wanted to generate vector tiles. Once I tried that and viewed the mbtiles file in QGIS, I saw that all the styling that I applied to the layers in QGIS were not rendered onto the tiles.
This is what I saw on the canvas in QGIS when I was styling my map:

This is what I saw when viewed the rendered mbtiles file in QGIS:

This seems to be the case for both the vector MBTiles export and the vector XYZ export. I also tried if it would make a difference if I used a PBF file as my data layer of shapefiles, which does not seem to impact the outcome.
Maybe I had a wrong understanding of vector tiles but I thought it would be possible to have the exact same data and styling that I saw on the QGIS canvas rendered into vector tiles.
The mbtiles file will later be integrated into a web app so I need to make sure the styles are preserved. How can I achieve this goal? I am a little confused since this seems very trivial to me but I am currently having a hard time finding information about this issue.