texts: Adding styles to a new feature in Google Earth Engine

texts:
I am new to Google Earth Engine and JavaScript. I have created a dropdown box and a button. The dropdown contains sub-district names from a shapefile. After clicking the button, the selected place is shown in the map as a polygon.
var subDist= table.aggregate_array('admin3Name');
var subDistDD= ui.Select([],'Loading...');
subDist.evaluate(function(sD){
  subDistDD.items().reset(sD);
  subDistDD.setPlaceholder('Select a Place');

});
var btnShow=ui.Button('Go To Place');
btnShow.onClick(function(){
  var placeName=subDistDD.getValue();
  var selectedSubdist=ee.Feature(table.filterMetadata('admin3Name','equals',placeName).first())
  .set({style: {fillColor: '00000000'}});
  Map.addLayer(selectedSubdist.style({styleProperty: "style"}));
  Map.centerObject(selectedSubdist,12);
});
var panel=ui.Panel({
  widgets:[subDistDD,btnShow],
  style: {width:'210px', resize:'horizontal'}
});
ui.root.insert(0, panel);

The program runs without error. But when the place is selected and the button is clicked, an error shows up: selectedSubdist.style is not a function.
Can anyone help me in this matter?


texts: Breaking connecting between features (Editor tool)

texts:
I snapped a series of lines to a point (The ? symbol on the picture). Now, I am trying to unsnap them so I can connect them to their respective line I just created.

My question is simple. How do I that?  I looked everywhere online. Whenever I try editing the line vertices they move as one. If I delete the point everything else is deleted. I really don't want to the delete the lines and redo all the attributes associated with it.


texts: I am kinda new to QGIS and am wondering how to change colors when vector layers are categorised but keep the order in the legend? I need to do this because I am making a map with different stages or progreessed represented though phase 1-5. All I want to do is change the vector layers from phase 3 to phase 4. Is there a way to do it with Python because I want to try and use that a little bit to get some experience using it.


texts:
I am new to GIS and I want to read population data from a GeoTiff Grid using the java geotools library.

The following throws a runtime error

GridCoverage2D image  = new GeoTiffReader(f);

gives

Error message: GeoTiffMetadata2CRSAdapter::createCoordinateSystem:Only
Geographic & Projected Systems are supported.

Is there a way to have geotools to use Mollweide ?
Or can I convert the tiff file ?

Below is the gdalinfo.

Driver: GTiff/GeoTIFF
Files: GHS_POP_GPW42015_GLOBE_R2015A_54009_1k_v1_0.tif
       GHS_POP_GPW42015_GLOBE_R2015A_54009_1k_v1_0.tif.ovr
       GHS_POP_GPW42015_GLOBE_R2015A_54009_1k_v1_0.tif.aux.xml
Size is 35497, 15236
Coordinate System is:
PROJCS["World_Mollweide",
    GEOGCS["GCS_WGS_1984",
        DATUM["D_WGS_1984",
            SPHEROID["WGS_1984",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Mollweide"],
    PARAMETER["False_Easting",0.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",0.0],
    UNIT["Meter",1.0]]
Origin = (-17619594.547443531453609,8751029.461868489161134)
Pixel Size = (1000.000000000000000,-1000.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-17619594.547, 8751029.462) (  5d15'16.97"W, 83d38'22.73"N)
Lower Left  (-17619594.547,-6484970.538) (107d 3'58.73"E, 55d59' 2.97"S)
Upper Right (17877405.453, 8751029.462) ( 15d52' 0.05"E, 83d38'22.73"N)
Lower Right (17877405.453,-6484970.538) (103d21'55.35"W, 55d59' 2.97"S)
Center      (  128905.453, 1133029.462) (  1d17'47.25"E,  9d10'43.07"N)

SOLUTION from @IanTurton:

I created a epsg.properties file with the line indicated by Ian.
And added the following code:

   URL epsg = getClass().getClassLoader().getResource("epsg.properties");
          if (epsg != null) {
           Hints hints =
            new Hints(Hints.CRS_AUTHORITY_FACTORY, PropertyAuthorityFactory.class);
           ReferencingFactoryContainer referencingFactoryContainer =
            ReferencingFactoryContainer.instance(hints);
           PropertyAuthorityFactory factory;
            factory = new PropertyAuthorityFactory(
                            referencingFactoryContainer,
                            Citations.fromName("EPSG"),
                            epsg);
            ReferencingFactoryFinder.addAuthorityFactory(factory);
            ReferencingFactoryFinder.scanForPlugins();
}
          else throw new IOException("properties not found");


texts: Google Earth Engine: error using uploaded shapefile to subset MODIS image collection

texts:
I am trying to run the following script to calculate the mean vegetation condition index (based on MODIS NDVI data) for a single district in Ukraine (Tokmatskyi). I imported the shapefile for this region as an asset which I am using in the script (tok) to subset the image collection. However I am having issues when exporting the data to csv as I keep getting this error:

//calculate average seasonal NDVI for Ukraine between 2001-2020.
var collection = ee.ImageCollection('MODIS/006/MOD13A1').select('NDVI');

// Choose a reference period for your baseline
var reference = ee.ImageCollection(collection.filterDate('2001-01-01', '2020-12-31'))
  .sort('system:time_start');
print("reference",reference);

//filter out images from specific date
//march, april, may (spring)
var spring = reference.filter(ee.Filter.dayOfYear(59,150));
//june,july, aug (summer)
var summer = reference.filter(ee.Filter.dayOfYear(151,243));

//calulate min of full series (mam 2001-2020) for each pixel
var spring_min = spring.min();
var summer_min = summer.min();

//calculate max of full series (mam 2001-2020) for each pixel
var spring_max = spring.max();
var summer_max = summer.max();

var vci_bot = spring_max.subtract(spring_min);

var vci_bot_sum = summer_max.subtract(summer_min);

//iterate through months and calculate average Vegetation condition Index
var years = ee.List.sequence(2001, 2020);
print("years",years);

var byYear = ee.ImageCollection.fromImages(
      years.map(function (y) {
        return spring.filter(ee.Filter.calendarRange(y, y, 'year'))
                    .select(("NDVI")).mean()
                    .subtract(spring_min)
                    .divide(vci_bot)
                    .set('year', y);
}));
print("byYear",byYear);

//var spring_ref_tok = ee.Image(byYear.clip(tok));

//Define chart parameters
var chartParam = {
 title: 'Average VCI (spring), Tokmatskyi',
  hAxis: {title: 'Time'},
  vAxis: {title: 'Average VCI'},
};

//Plot the chart
var chart = ui.Chart.image.seriesByRegion({
  imageCollection: byYear,
  regions: tok.getInfo(),
  reducer: ee.Reducer.mean(),
  scale: 500,
  xProperty: 'year',
  seriesProperty: 'PROJECT'
});
//Print chart to console
print(chart.setOptions(chartParam));

var spring_vci_tok = byYear.filterBounds(tok);

//get means as table and add to Drive
var spring_vci_means = byYear.map(function(image){
  return image.reduceRegions({
    collection:spring_vci_tok,
    reducer:ee.Reducer.mean(),
    scale: 30
  });
});
var table2 = spring_vci_means.flatten();
print(table2);
Export.table.toDrive(table2,"spring_vci_means_tokmatskyi");

//summer
//iterate through months and calculate average Vegetation condition Index
var years = ee.List.sequence(2001, 2020);
print("years",years);

var summer_vci = ee.ImageCollection.fromImages(
      years.map(function (y) {
        return summer.filter(ee.Filter.calendarRange(y, y, 'year'))
                    .select(("NDVI")).mean()
                    .subtract(summer_min)
                    .divide(vci_bot_sum)
                    .set('year', y);
}));
print("byYear",summer_vci);

//var summer_ref_tok = ee.Image(summer_vci.clip(tok));

//Define chart parameters
var chartParam = {
 title: 'Average VCI (summer), Tokmatskyi',
  hAxis: {title: 'Time'},
  vAxis: {title: 'Average VCI'},
};

//Plot the chart
var chart2 = ui.Chart.image.seriesByRegion({
  imageCollection: summer_vci,
  regions: tok.getInfo(),
  reducer: ee.Reducer.mean(),
  scale: 500,
  xProperty: 'year',
  seriesProperty: 'PROJECT'
});
//Print chart to console
print(chart2.setOptions(chartParam));

var summer_vci_tok = summer_vci.filterBounds(tok);

//get means as table and add to Drive
var summer_vci_means = summer_vci_tok.map(function(image){
  return image.reduceRegions({
    collection: summer_vci_tok,
    reducer:ee.Reducer.mean(),
    scale: 30
  });
});
var table = summer_vci_means.flatten();
print(table);
Export.table.toDrive(table,"summer_vci_means_tokmatskyi");


texts: Coloring multilinestringzm M values in QGIS

texts:
I have output from a geophysical technique that produces X,Y,Z and scalar value for millions of points, which have been stitched together appropriately (by networkx if it matters) into multilinestringzm format, then inserted into a PostGIS DB by my own (homebrewed) geophysical code.

There is one multilinestring per Z value (roughly 10-20% of the ~12 million points all share the same Z values), and each of the 10 or so Z values and their corresponding multilinestringzm geometries are in a separate row of the table.

What I'd like to be able to do is color each point in a multilinestring according to its M value, but have been struggling for quite some time in how to accomplish this. (Even better would be to have a color gradient on the line segment between two points.)

I really need to have this work in QGIS (or ARCscene?) because there is a whole lot of other normal 2D GIS info to integrate. My earlier trials outputting my data in VTK format and using VisIt from LLNL to read both the VTK and GIS files, while successful, is too heavyweight to share with my colleagues in joint projects.

Any hints on how to color-by-m-value?


texts:
I am trying to get (print out)  all unique values of a field named PhaseAtt in a group of shapefiles which all have that field with different unique values

import arcpy
from arcpy import env
print "Satrted"
env.workspace = "C:/Phases"

for feature in arcpy.ListFeatureClasses():
    print feature

Can you please let me know how to do that?


texts:
Is it possible to create a custom geocoder that uses both the default Esri geocoder with additional fields that are from a hosted feature service. I want to add in bus stop locations and they will change over time and I want to be able to update them when there is a schedule change. I know that there is a way of doing this with ArcPro, but I am hoping that I might be able to do this without the use of it as this is for a web app for my "lean" startup that cannot afford fancy liscences.
I am open to other options like a self hosted geocoder.


texts: Add wmts layer from Geoserver to ArcGIS viewer for Flex

texts:
Is there anyone out there who has set wmts layer from Geoserver to ArcGIS viewer for flex?

I am trying to do that but without any luck.

<layer label="Sample WMTS layer" type="wmts" visible="true" useproxy="false" imageformat="gif" url="http://v2.suite.opengeo.org/geoserver/gwc/service/wmts" style="_null" servicemode="KVP" layerid="world" tilematrixsetid="EPSG:4326"/>

If I change the type to "wms" it works like a charm.

Anyone?


texts: Split single polyline network at a point feature to make unique fields with unique distances

texts:
I am working with a large river network polyline shapefile. I am trying to calculate a dendritic connectivity index using a point shapefile representing locations.

The river network shapefile has a large number of rows/individual lines that I merged into one row/line. I want to split this river network into distinct segments where a dam intersects it, where I would be able to calculate the length of each of these segments (fragments). I have tried the "Split Line at Point" tool and this simply split the river network at each vertex, not each point despite it being a single feature.


texts: ArcGIS REST API query failing with large geometry as input

texts:
I am querying different ArcGIS Services passing a polygon as the input geometry to get the features from the service that intersect with it. However, depending on the polygon's geometry I get sometimes the following error when attempting to do the query:

Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Doing tests with different polygons I realized that the query failed when the polygon's geometry was too large, regardless of the service being queried. For example, a query with a polygon composed of 11 vertices worked fine but one with a polygon composed 65 vertices failed. All tests were carried out in the ArcGIS REST interface (using Chrome), in Python (using requests) and Postman, yielding the same results.

Reading the ArcGIS REST API documentation was not helpful as it does not specify whether there is a character limit in the input geometry.

How can I query an ArcGIS Service using a long geometry as one of the inputs?


texts: I have a set of layers with a certain symbology for each. Is it possible to save the style or only the symbol as SVG file?


texts: Using processing algorithm in QGIS plugin

texts:
I'm building a plugin in QGIS, one of its part is processing algorithm: intersection. I want to save the result as memory layer, and then work on it. Following code was working fine, nothing changed (I changed nothing), and: boom! it stopped working. The problem is in the 2nd line:

processing.runandload("qgis:intersection",selectedLayer,selectedLayer_2, "memory:temp_layer")
layer = QgsMapLayerRegistry.instance().mapLayersByName("memory:temp_layer")[0]

The memory layer is created (I can see it in QGIS) but I can't define 'layer'. I'm getting an error:

  IndexError: list index out of range.

Why? :(


texts: When I load a KML in Google maps, it doesn't show all polygons, instead there are Google "next-previous" pages, each containing parts of the KML. How can I view all the information in one page?


texts: MapsEngine Deprecated - can I call a layer in the same way from CartoDB?

texts:
We have an online map that is built partly by calling a Google MapsEngine layer (http://dea.snowball.co.za/).  MapsEngine has been deprecated and we need to bring in this layer from somewhere else.

MapsEngine made it very easy by providing layerkeys etc.

mapsEngineLayer[0] = new google.maps.visualization.MapsEngineLayer({
            mapId: '08041245187153135450-08879288594674088841',
            layerKey: 'layer_00006',
            map: map,
            name: 'Reserves'

Can I do something similar from CartoDB?


texts: QGIS Server - Internal Server Error at GetCapabilities reguest - no Apache error

texts:
Maybe the question is answered often before, but i can't find a solution which works on my system

I try to install qgis server by the tutorials by using the following links
http://hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial
http://anitagraser.com/2012/04/06/qgis-server-on-windows7-step-by-step/

i changed in the httpd_qgis.conf:
- LoadModule cgi_module modules/mod_cgi.so
- SetEnv ( 3 times)
and SetHandler cgi-script

after this i copyied all dll's from c:/osgeo4w/apache/bin/ to
 c:/osgeo4w/apps/qgis/bin/

Now the tutorials said that the GetCapabilites works, but it doesn't

i only get the error

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@local.domain and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

Apache and Firebug doesn't give any error.

Can anybody help  I use a windows 7 64 Bit?


texts:
I have some enthusiastic people who want to learn more about OSM, so I'm planning to host a demo to my personally hosted server (as it won't be wise be using bandwidth from original host), I have download all PBF, then converted them into XML. And have rendered them in OpenGL/matplotlib and showed them, now I want to render different layers. Like only - roads, landmarks, different features.
And now my server is being overloaded. Half of it's bandwidth is gone. And it's really slow, when a request arrives, it renders and then responds. So is there any way I can render tile-set as vector. And save them. When the request arrives, I'll just respond.
Is there any library, for this - OSM 2 Vector or something like that ?
I just want to render raw, without text or sometime with text.
Here is what I'm rendering :

I'm using Python to parse and process and then matplotlib to render and save images. These are really time consuming and not even close to tile sizes, that's why I'm looking for some library, where I can just render tiles, as I like, with as much customization I want.


texts: How to set coordinate dimensions in Django GDAL API?

texts:
The Django GDAL documentation for coord_dim says:

coord_dim
Returns or sets the coordinate dimension of this geometry. For example, the value would be 2 for two-dimensional geometries.

But how do I actually set the dimension? I'm working with three dimensional data, and trying to convert it to two dimensional data:

    ds = DataSource(options['filename'])
    for layer in ds:
        for i in layer:
            print i.geom.coord_dim
            i.geom.coord_dim = 2
            print i.geom.coord_dim

This doesn't produce an error, but outputs 3 twice, and doesn't seem to change the coordinates at all when I print those.

How do I use coord_dim to set the number of coordinates?

The underlying thing I'm trying to achieve is to transform three-dimensional data to two-dimensional data.


texts: OpenLayers refresh vector source with bbox strategy after map moved

texts:
I have a vector layer, in GeoJSON with a Vector source on which I applied the BBOX strategy. I have unique IDs for each feature in the layer and having a look at the network tab in the browser the strategy is working, bringing back all the features at a given extent, whenever I move the map.

The problem is that the returned features sum up on the Vector source and they don't get replaced by the new ones in the extent (those which are not in the extent just stay in the source).

How could I refresh the source with the new returned features (only in the current extent) and removing from the source those which are not in the extent?

What I am trying to achieve is a way to get the features loaded with each map moved, clear the vector source and replace the features with the new loaded. But I am not sure how and where to accomplish this.

    var vectorSource = new ol.source.Vector({
    format: formatGEOJSON,
    url: function(extent) {
        return 'http://localhost/geoserver/wfs?service=WFS&' +
        'version=1.1.0&request=GetFeature&typename=workspace:layer&' +
        'outputFormat=application/json&srsname=EPSG:27700&bbox='.concat(extent.join(','), ',EPSG:27700');
    },
    strategy: ol.loadingstrategy.bbox
});
var vectorLayer = new ol.layer.Vector({
    source: vectorSource,
    style: new ol.style.Style({
        stroke: new ol.style.Stroke({
            color: 'rgba(0, 204, 0, 1)',
            width: 2
        }),
        fill: new ol.style.Fill({
            color: 'rgba(0, 204, 0, 0.2)'
            }
        )
    }),
    minResolution: 0,
    maxResolution: 20,

});


texts: Get number of changed features in a layer using pyqgis

texts:
I'm looking for a method to find out how many features in a layer have changed during edit mode (specifically attribute values). For my example i'm using QgsVectorLayerEditBuffer object, method ChangeAttributeValue().

I use editBuffer() method to get the layer buffer and after making some changes, I use ChangedAttributesValues(). This returns 'None'.
Example:

layer = iface.activeLayer()

buffer = layer.editBuffer()

..# make changes

buffer.changedAttributeValues()
..None

see also: Get number of changed features in a layer under edit mode using pyqgis


texts: How can I show a popup in a map, using Leaflet?

texts:
How can I show a popup in a map, using Leaflet, loading the markers from an GeoJSON external file?

function onEachFeature(feature, layer) {

    if (feature.properties && feature.properties.popupContent) {
        layer.bindPopup(feature.properties.popupContent);
        //console.log(feature.properties.popupContent)
    }
}

// Llamadas a los archivos .geojson con Ajax
let xhr = new XMLHttpRequest();
xhr.open('GET', './geojson-farmer.geojson');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
    if (xhr.status === 200) {
        L.geoJSON(JSON.parse(xhr.responseText)).addTo(farmer);
        console.log(L.geoJSON(JSON.parse(xhr.responseText),{onEachFeature:onEachFeature})).addTo(farmer);

    }
};
xhr.send();


texts: Natural Earth land in GeoServer: line cut through Antarctica for EPSG 900913

texts:
I have created a GeoServer layer (GeoServer 2.15) that contains the 10m resolution Natural Earth land countour shapefile data (https://www.naturalearthdata.com/downloads/10m-physical-vectors/). But if I preview it in EPSG 900913 (Google Mercator) or create pre-seeded tiles from this layer, the image shows a line that cut right through Antarctica and a color inversion below this line (see picture).
I think it may be related to this problem: https://www.geo-solutions.it/blog/geoserver-continuous-map-wrapping/, but that seems to be solved in recent GeoServer versions.
Anyone who has experienced similar problems and/or knows a solution to this?


texts:
I experienced problems with installing TopoJSON.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform oolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". [C:\Users\Sigita\AppData\Roaming\npm\node_modules\topojson\node_modules\d3\node_modules\jsdom\node_modules\contextify\build\contextify.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Sigita\AppData\Roaming\npm\node_modules\topojson\node_modules\d3\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
...
npm ERR! contextify@0.1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.8 install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "topojson"
npm ERR! cwd C:\Users\Sigita
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Sigita\npm-debug.log
npm ERR! not ok code 0

I'm running it on Windows 8.1. with all updates installed, npm version 1.4.3., gyp 0.13.0 and node.js 0.10.26.


texts: Oracle Procedure Call From ArcToolbox Script - Error processing call -

texts:
Background:

I have an Oracle package with procedures to randomize and reset passwords for our SDE/GIS schemas.

These procedures work perfectly via SQL Plus command line commands.

My package looks like this:

  create or replace package gis_pass_pkg as
    TYPE schema_name_var IS TABLE OF VARCHAR2(1000);
    procedure randomize_pass(schema_name in schema_name_var);
    procedure reset_pass(schema_name in schema_name_var);
  end gis_pass_pkg;
  /
  Procedures omitted for brevity

My call to the procedure looks like this in SQL Plus:

  exec gis_pass_pkg.randomize_pass(gis_pass_pkg.schema_name_var('SCHEMA1','SCHEMA2'));

I have created the python code in the toolbox that replicates this call.

And it looks like this in ArcToolbox:

  SQLexe = "call gis_pass_pkg.reset_pass(gis_pass_pkg.schema_name_var('SCHEMA1','SCHEMA2'));
  arcpy.AddMessage(SQLexe)
  sysConn.execute(SQLexe)

Here is the error I receive when executing through the toolbox script:

  Traceback (most recent call last):   File
  "T:\DataCenter\Citrix\AppData01\clhays\Application
  Data\ESRI\Desktop10.2\ArcToolbox\My Toolboxes\SDE Manager
  Scripts\ResetPasswordsViaPackage.py", line 53, in
      sysConn.execute(SQLexe)   File "c:\arcgis\desktop10.2\arcpy\arcpy\arcobjects\arcobjects.py", line 27,
  in execute
      return convertArcObjectToPythonObject(self._arc_object.Execute(*gp_fixargs(args)))
  AttributeError: ArcSDESQLExecute: SreamExecute ArcSDE Extended error
  902 ORA-00902: invalid datatype

  Failed to execute (resetpasswords).

I am assuming that the Oracle error of "ORA-00902: invalid datatype" is related to configuration of the procedure call from the toolbox.

It is confusing to me that the same call - formatted the same way as the SQL Plus command line would cause such an error.  But obviously I'm missing something here.

As an addendum, these procedures were originally getting a single string as parameters in the command line and had worked via the ArcToolbox calls.  And they have been reworked to receive multiple strings for input parameters.

The addition of "TYPE schema_name_var IS TABLE OF VARCHAR2(1000);" in the package facilitates the processing of those parameters from the SQL Plus command line.

Can anyone shed some light on what I am missing here to complete the functionality?


texts: ArcGisPro Finding street intersections with a high concentration of vehicle crashes

texts:
I'm trying to find street intersections with a high concentration of traffic crashes.
First of all, I´ve tried with kernel density analysis, but I'm wondering if there is something that makes a sort of ranking of street intersections so that I can determine which is the most dangerous street intersections of our city.
I'm new to spatial data and I'm eager to learn new things. I´m working on ArcGIS  PRO and I have a feature class of crashes.


texts: Use a dropdown menu to display various feature layers

texts:
I am trying to develop a dropdown menu that can display various feature layers, something similar to the following, except that I don't need the relocation function and when each option is selected, the previous layer will be erased and the new feature layer will be applied.
http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=dataadapterfeaturelayer

This is what I have so far:

   JS:
       map = new Map("cpCenter", {
         basemap : "satellite",
         extent : extentInitial
         });

        map.on("layers-add-result", function() {
      query("#lplist").on("change", function(e) {
        var value = e.currentTarget.value;

        // Remove previously added layer
        if (layer) {
          map.removeLayer(layer);
          layer = null;
        }

        switch (value) {
          case "wgs84":
          case "bng":
            layer = new FeatureLayer(url);
            break;
         }

        if (layer) {
          map.addLayer(layer);
          layer.on("update-end", function() {
          map.centerAt(graphicsUtils.graphicsExtent(array.filter(this.graphics, function(graphic) {
              return graphic.geometry;
            })).getCenter());
          });
        }

    HTML:
       <select id="lplist">
            <option value="choose" selected="selected">(Select an option)</option>
            <option value="wgs84">XY Coordinates: WGS 84 (CoordinateLocationProvider)</option>
            <option value="bng">XY Coordinates: British National Grid (CoordinateLP)</option>
          </select>

Apparently this doesn't work, as no feature layer is added upon selection.
Also, I am currently having

    map.on("layers-add-result", function(){})

the basemap is able to show at this point. However, if I use

    map.on("load", function() {}

nothing will show up.


texts:
I'm currently trying to create a map based on GeoServer and OpenLayers 3.

My main issue at this point is the coordinate system. I want to use EPSG:25832 (EUREF89 Zone 32).

This is how far I´ve got:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="http://openlayers.org/en/v3.18.2/build/ol.js" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js"></script>
<script src="http://epsg.io/25832.js"></script>
<script type="text/javascript">

window.onload = function()
{
var euref89z32proj = ol.proj.get('EPSG:25832');
var osmLayer = new ol.layer.Tile(
{
    source: new ol.source.OSM()
})

var format = 'image/png';
var linjetest = new ol.layer.Image({
    source: new ol.source.ImageWMS({
        ratio: 1,
        url: 'http://localhost:8080/geoserver/postgre/wms',
        params: {'FORMAT': format,
                'VERSION': '1.1.1',
                STYLES: '',
                LAYERS: 'postgre:linjetest',
        }
    })
});

var map = new ol.Map({
target: 'map1',
layers: [
    linjetest
],
view: new ol.View({
center: ol.proj.fromLonLat([10.09, 56.45]),
    maxExtent: new ol.extent.boundingExtent(384015, 5846682, 516991, 5931295),
    zoom: 15
    })
});

var mousePosition = new ol.control.MousePosition({
        coordinateFormat: ol.coordinate.createStringXY(5),
        projection: euref89z32proj,
        target: document.getElementById('location'),
        undefinedHTML: '&nbsp;'
      });
 map.addControl(mousePosition);
}

When I move the mouse around in the map correct coordinates are displayed, but when I use Chromes debugger and look at the the network tab, the URL to GeoServer is based on EPSG:3587 coordinates. Is it possible to configure OpenLayers to use EPSG:25832 instead?


texts: TurboCARTO ramps do not work with CartoCSS user conditional filters

texts:
If you want to define manual class breaks with the ramp() function it seems you're out of luck; as far as I can tell this is not working as intended. For example, here I try to supply different colors for values that fall within user specified ranges

Code:

#layer{
           [dominant_origin = "Puerto-Rican"]{
             polygon-fill: ramp([relative_dom], (#004c6d, #3d708f, #6996b3, #94bed9, #c1e7ff), (.2, .4, .6, .8, 1), "<=");
           }
           [dominant_origin = "South American"]{
             polygon-fill: ramp([relative_dom], (#ff0000, #ff5d38, #ff8b67, #ffb297, #ffd8cb), (.2, .4, .6, .8, 1), "<=");
           }
           [dominant_origin = "Central American"]{
             polygon-fill: ramp([relative_dom], (#00ff00, #6cfb53, #97f67e, #b7f0a3, #d1eac7), (.2, .4, .6, .8, 1), "<=");
           }
           [dominant_origin = "Dominican"]{
             polygon-fill: ramp([relative_dom], (#ffff00, #fcf853, #f8f17b, #f1eb9d, #e9e4bd), (.2, .4, .6, .8, 1), "<=");
           }
           [dominant_origin = "Mexican"]{
             polygon-fill: ramp([relative_dom], (#7f00ff, #a451ff, #c181ff, #daaeff, #efdbff), (.2, .4, .6, .8, 1), "<=");
           }
           [dominant_origin = "Other"]{
             polygon-fill: ramp([relative_dom], (#000000, #363636, #6a6a6a, #a4a4a4, #e2e2e2), (.2, .4, .6, .8, 1), "<=");
           }
           [dominant_origin = "Cuban"]{
             polygon-fill: ramp([relative_dom], (#e6550d, #f17940, #f99a6b, #feba98, #ffd9c6), (.2, .4, .6, .8, 1), "<=");
           }
         }

if you console.log() the event on a metaDatachange you get this:

_buckets: Array(5)
0: {min: null, max: 0.2, value: "#004c6d"}
1: {min: 0.2, max: 0.4, value: "#3d708f"}
2: {min: 0.4, max: 0.6, value: "#6996b3"}
3: {min: 0.6, max: 0.8, value: "#94bed9"}
4: {min: 0.8, max: undefined, value: "#c1e7ff"}

If you console.log() bucket.min and bucket.max you'll get:

null
undefined

This is an issue for a few reasons. First you're getting nulls and undefined values for min and max in the first and last bins. Second, the class breaks are not explicit. Lastly, the last value supplied in the filter is ignored.

I know in a previous issue it was suggested to use the "<" mapping instead, but the result is exactly the same.


texts: How do I measure the distance between two points within a country arcmap

texts:
I have two shapefiles with points distributed over the whole world. I would like to measure the distance (like the crow flies in km) from each point in shapefile 1 to the closest point from shapefile 2, add all the attributes from the closest point of shapefile2 to the point in shapefile1 but at the same time I have to make sure that these distances are only calculated within the same country. The distance measurement should not cross any borders.

I tried to use the Near option and it gives me partly what I want. It adds all the attributes from the closest point in shapefile2 to the closest point in shapefile1 plus it measures the distance. Now the only problem is that it does not take into account if the two closest points are also in the same country.
I would need something like an "if" option for the Near tool. Something like "measure distance to the closest point if country in shapefile 1 = country in shapefile 2".
Is there something like that??

Any suggestions?


texts: Unable to load geometry field from geodataframe to a PostgreSQL table 'geometry' field

texts:
I am trying to load a geodataframe to a PostgreSQL table, but I am struggling with the geometry field.

First I read feature class using Geopandas:

geodata = (r'path_to_gdb', driver='FileGDB', layer='test')

Then I try to export it to an existing PostgreSQL table called "vml_polygs":

for index, row in geodata.iterrows():
    load_to_pg = "INSERT INTO public.vml_polygs VALUES ({0}, {1}, {2}, {3}, ST_GeomFromText('{4}'::GEOMETRY,27700));".format(index, row[0], row[1], row[2], row[3])
    cursor.execute(load_to_pg)
    con.commit()

row[3] contains the geometry of the geodataframe. It's in WKT. With the expression ST_GeomFromText('{4}'::GEOMETRY,27700)I am trying to convert it to WKB since I believe that's the required format of the geometry for PostgresSQL (please, correct me here if I'm wrong).

I am getting the following error:

Traceback (most recent call last):
  File "footprint.py", line 72, in <module>
    cursor.execute(load_to_pg)
psycopg2.InternalError: parse error - invalid geometry
HINT:  "...100000001030000000100000005000000713D" <-- parse error at position 48 within geometry

And if I try with the following instruction:

load_to_pg = "INSERT INTO public.vml_polygs VALUES ({0}, {1}, {2}, {3}, ST_GeomFromText({4}, 27700));".format(index, row[0], row[1], row[2], str(row[3]))

I get this error message:

Traceback (most recent call last):
  File "footprint.py", line 71, in <module>
    cursor.execute(load_to_pg)
psycopg2.ProgrammingError: syntax error at or near "306481.5500000007"
LINE 1: ...882934, ST_GeomFromText(MULTIPOLYGON (((452640.71 306481.550...


texts: Can GDAL extract a raster window from disk without loading the whole file to memory?

texts:
I have a 500MB GeoTIFF with 3 bands on disk.  I can easily read a very small, 25x25-pixel subwindow using GDAL like so:

gdal_translate -srcwin 600 550 25 25 hugeimage.tif smallwindow.tif

Does this operation have to read the entire large GeoTIFF into memory, or is it able to seek to the appropriate bytes on disk and read only them?

Does the answer change for selecting individual bands, instead of clipping pixels?

Does the answer change if the GeoTIFF is compressed?


texts: Error 0xc000007b while opening QGIS 3.10 and 3.12 on Windows 8.1

texts:
I have a problem with starting the both versions QGIS 3.10.4 and QGIS 3.12.1.

I have Windows 8.1. It can't start working at all. It needs different .dll files.

When I download the file it needs, then it needs another one. I when I download all the files, there is 0xc000007b error. I tried all the ways that are in Google to fix that error and the programme can't start working yet.


texts:
The coords variable has been tested with 3857 and 3067 data. Using the below code, I understand it should expect 3067 and output as 3857.

However, 3857 code coordinates work fine (and I assume they shouldn't), but the 3067 ones don't show up at all. I logged the source var below and projection_ is null. Not sure is thats the problem and how to solve it.

Final goal for this part of code is:
read coordinates from DB (format 3067) then output as map on a 3857 map

  var coords=this.$store.state.MapsSingle.item.coordinates
    var geojsonObject = {

    'type': 'Feature',
    'geometry': {
    'type': 'Polygon',
    'coordinates': [JSON.parse(coords)]
  }
              };
var source = new VectorSource({features: (new GeoJSON({
    dataProjection: 'EPSG:3067',
    featureProjection: 'EPSG:3857'
})).readFeatures(geojsonObject)});


texts: How to add multiple fields to many Feature class using Arcpy

texts:
I have a geodatabase with multiple Feature Class (at least 100).

I would like to add in each attribute table of each Feature Class, two new columns. I have to do that with a python script because it would be very long to add the columns one by one.
The two new columns are : "symbole" and "deslotID".

I try to make a python script, but I don't know anything about python.
This is the code (I know it don't works)

>>> import arcpy
from arcpy import env

#My environment and the geodatabase that contains the feature class
env.workspace = "C:/data/arcgis/gdb/Featureclass.gdb"

#Set fieldname variables = 2 new columns
field_name1 = "symbole"
field_name2 = "deslotID"

#Define the fields's structure
fields = [
("featureclass", "field_name1", "LONG", 9, "", "", "refcode", "NULLABLE", "NON_REQUIRED")
("featureclass", "field_name2", "INT", 9, "", "", "refcode", "NULLABLE", "NON_REQUIRED")
]

for field in fields:
    arcpy.AddField_management(*(featureclass,) + field)

For this code, I was inspired by this question : Possible to add multiple fields in single arcpy statement?

I think I have to make a loop that runs through all the feature class in the geodatabase, I really don't know how to do that.


texts:
I am wanting to add the ESRI Vector Basemaps http://www.arcgis.com/home/group.html?id=30de8da907d240a0bccd5ad3ff25ef4a#overview to QGIS 3.4.

Does anybody have any suggestions on how to do this?


texts: Creating "starburst" table from two point features with 1:N relationship using Spatialite?

texts:
I have a point feature called site_investigation and another point feature called sample_location which are in a Spatialite database.  They have a 1:N relationship and the primary key is report_id.

CREATE TABLE site_investigation (
        fid         INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
        report_id   TEXT UNIQUE NOT NULL,
        geometry    POINT
);
CREATE TABLE sample_location (
        fid            INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
        report_id      TEXT NOT NULL,
        official_name  TEXT UNIQUE NOT NULL,
        geometry    POINT
        FOREIGN KEY(report_id) REFERENCES site_investigation(shz_report_id) ON DELETE CASCADE
);

I would like to create a table of lines that connects site_investigation to sample_location to form a "starburst" display. I'm a Spatialite novice.


texts: World File Not Corresponding to Coordinates of Warped geoTIFF

texts:
I am attempting to change CRS for a TIFF with TFW.

Loaded OK. Warped OK. Overlays fine. Properties report correct origin etc.

However when creating a world file (Translate: -co worldfile=yes) the values that are entered are for the old CRS.

What remedial steps can I take?


texts:
I am trying to run the r.sim.water in GRASS. I have calculated the partial derivatives dx and dy rater map using r.slope.aspect. I am using this elevation map [1] to get the time-series depth map. But I got the output file is not being saved in the "outputDepth" rater map (says failed to open, on seeing the metadata).

r.sim.water -t elevin=testElevationLive@sampleMapSet dxin=dx@sampleMapSet dyin=dy@sampleMapSet rain_val=150 manin_val=0.015 depth=outputDepth nwalk=50000 outiter=20

STDOUT:

Min elevation   = 43.00 m
Max elevation   = 103.00 m
Mean Source Rate (rainf. excess or sediment)    = 0.000030 m/s or kg/m2s
Mean flow velocity  = 21.486384 m/s
Mean Mannings   = 0.015121
Number of iterations    = 647482826 cells
Time step   = 0.00 s

and on the cmd line:

Command 'd.rast map=outputDepth@sampleMapSet' failed
Details: Raster map <outputDepth@sampleMapSet> not found

Further I am not getting the time-series data output, by using the -t flag and setting the output_step to 20 as suggested here http://grass.osgeo.org/grass70/manuals/r.sim.water.html.

[1] https://www.dropbox.com/s/ooxcj0y6v2kzeml/testElevationLive.tif?dl=0


texts: Error adding the move graphic functionality to the undomanager

texts:
The following code is what I am using to get the graphics to be added to the update operation:

 //Obtaining the graphic before it is moved
 moveToolbar.on("graphic-move-start", function (evt) {
 //Storing the original geometry in a json string - else it keeps changing
 json1 = JSON.stringify(evt.graphic.geometry);
 });

 //Updating the graphic on move end
 moveToolbar.on("graphic-move-stop", function (evt) {

//Getting the old geometry and converting it back into an object
var obj = JSON.parse(json1);

//Creating the previously created graphic. All the below are needed else the Update operation does not accept it
 oldGraphicMove = new esri.Graphic();
 oldGraphicMove.geometry = JSON.parse(JSON.stringify(evt.graphic.geometry));
 oldGraphicMove.symbol = undefined;
 oldGraphicMove.attributes =JSON.parse(JSON.stringify(evt.graphic.attributes));
 oldGraphicMove._count = JSON.parse(JSON.stringify(evt.graphic._count));
 oldGraphicMove._extent = JSON.parse(JSON.stringify(evt.graphic._extent));
 oldGraphicMove._graphicsLayer = evt.graphic._graphicsLayer;
 oldGraphicMove._layer = evt.graphic._layer;
 oldGraphicMove._offsets = evt.graphic._offsets;
 oldGraphicMove._shape = evt.graphic._shape;

 //Changing the value of the oldGraphicMove object to the values of the graphic before it was moved
 for (var z = 0; z < obj.rings[0].length; z++)
 {
  oldGraphicMove.geometry.rings[0][z] = obj.rings[0][z];
 }
 newGraphicMove = evt.graphic;

 //Creating the operation to add to the undomanager
  var operation = new Update({
        featureLayer: evt.graphic._graphicsLayer, //The layer that will contain the modified graphic
        preUpdatedGraphics: [oldGraphicMove], //The graphic before the changes are created
        postUpdatedGraphics: [newGraphicMove] //The graphic after the changes are made
       });

 //Adding the undo/redo operation
undoManager.add(operation);

 json1 = {};
 json2 = {};

 //Updating the graphic

 evt.graphic._graphicsLayer.applyEdits(null, [evt.graphic], null);
});

However on the part of var operation = new update the following error is thrown:

Uncaught TypeError: a.preUpdatedGraphics[b].geometry.toJson is not a function
at Object.constructor (Update.js:4)
at new <anonymous> (init.js:108)
at Object.<anonymous> (eGISEditing.js:1141)
at Object.<anonymous> (init.js:1191)
at Object.h [as onGraphicMoveStop] (init.js:244)
at Object._moveStopHandler (_GraphicMover.js:9)
at Object.<anonymous> (init.js:177)
at Object.h [as onMoveStop] (init.js:244)
at Object.destroy (Mover.js:3)
at HTMLDocument.<anonymous> (init.js:177)

I have been through both passed graphics and all geometry is present within them, and as a result I am unable to determine how to resolve this issue.


texts: Why do we need to make correction manually in flow direction files

texts:
I have created flow direction and flow accumulation files for my DEM. Using the feature to point function, Ive got all the points in point form and then I converted them to arrows.

But most of the arrows are colliding and some are making a loop. I need them all in a nice form like they are accumulating and making a stream.

I have posted a photo of what kind of problem I have.

My area is large and I dont want to do it manually. Do we have an automatic process for this??


texts: How to handle an "Input CRS error" when clipping?

texts:
I'm trying to clip a soil use shapefile, with a polygon I've created this morning. The clipping function works, but the clipped polygon doesn't have features (the table of contents is empty). QGIS advices me that:

*Created output shapefile:
/Users/biaginisandra/Desktop/Uso_suolo_Roncacce/Uso_suolo_Roncacce.shp
Warnings:
Input CRS error: One or more input layers missing coordinate reference information, results may not be as expected.
GEOS geoprocessing error: One or more input features have invalid geometry.
Some output geometries may be missing or invalid.
Would you like to add the new layer anyway?*

Where is the problem?

Thanks in advance.


texts:
Does anyone know how I can extract the raster field names (VALUE, COUNT and other existing field names on a categorical raster file) in R?

I am using the raster package to load the raster files.


texts: Access GeoServer from Amazon EC2 to mydomain.com

texts:
DONE SUCCESSFULLY:

I've installed Apache HTTP and Tomcat on Amazon WS (AWS) EC2 instance (MS Windows Server 2012 R2 64 bit).
I've deployed GeoServer .WAR file on Tomcat; port 8080.
I've added inbound TCP rule in Security Group of AWS to allow port 80 and 22 for Apache and SSH respectively. TCP rule for RDP, Port 3389 is allowed by default in Inbound.
I can access GeoServer from 'http://localhost:8080/geoserver/web' on server machine.
Firewall on Windows Server is disabled fot both Private and Public.

I want to access GeoServer from my sub-domain 'www.geotool.mydomain.com'.

TRIED BUT FAILED:

Followed these instructions; entered my sub-domain 'www.geotool.mydomain.com' in Proxy Base URL, but I get timed out error.
Can't access GeoServer from Server IP, 'http://10.129.13.8:8080/geoserver' either.

Can someone please guide me?


texts: How to make a PostGIS LINESTRING with only one initial point

texts:
I have a service that will be sending GPS coordinates as it moves, and these will be added to my PostgreSQL / PostGIS database.
Right now, created a table with one column that is a Geometry("LINESTRING") type.
However, it seems that in order to make a LINESTRING, you need at least two points.
But, I will only be receiving one point at a time. So initially when the service starts sending me location data, it only has one location to send. I will have to wait for the second location submission in order to have at least two points.
What is the recommended procedure to follow in this case for the initial case when I only have one point so far?


texts: Geography point and integer in multicolumn PostgreSQL index

texts: I want to create a multicolumn spatial index on a geography point and integer in order to do efficient spatial queries. The integer is a user_id and queries are always limited to a single user. Is a multicolumn gin index the best approach?


texts: Converting matrix to a WGS84 raster is rotated the wrong way

texts:
I have a matrix like so:

xy <- matrix(rnorm(128 * 64),128,64)

and I want to turn it to a raster in WGS84.

I also have a longitude and a latitude matrix:

with the following dimensions:

min(lon) <- 0
max(lon  <- 357.1875
min(lat) <- -87.8638
max(lat) <- 87.8638

the latitude and longitude came for a netCDF, and for some reason the longitude is from 0 - 360 instead of -180 to 180, for now I am not worried about that though.

I try to create the raster like so:

r <- raster(xy, xmn = min(lon), xmx = max(lon), ymn = min(lat), ymx = max(lat), crs = CRS("+init=epsg:4326"))

but this returns:


texts: What to use to divide longitude on smaller parts than time zones?

texts:
I have a database of earth's grid, I have consolidated elements from 1152x576 to 360°x180° and then those degrees into geographical zones and time zones so I get 5(6) geographical zones (N/S frigid, N/S temperate, (N/S) torrid) and ~24 time zones ((+/-)0, +1 to +12 (or +-12) and -12 to -1) and that's the problem, because it's 5:24 zones (latitude:longitude) and it's bad ratio.

I am displaying those zones in a table and it doesn't look well, when the x axis is 5 times longer than y axis. Is there widely used consolidation of longitude into less, but bigger areas?

I was thinking for example about 8 areas, 4 on western and 4 on eastern hemisphere, but I could't find if this division of longitude exists. Would it be somthing like WWW, WWE, WEW, WEE, EWW, EWE, EEW, EEE? Is it used normally so the people looking into my database will understand it? I can make it look like "WWW (0°-45°)" etc, I think it will be the best, am I right?

EDIT: I encountered a new problem, that this division of longitude has different borders than division on time zones, time zone start on 7.5° + x*15° and this division would start on 0° + x*45°, so I couln't consolidate 3 time zones into one portion of 45° and I consolidated those 2 approaches separately.


texts: How do I limit the features shown in attribute table to those in the current time range?

texts:
I loaded a vector layer with temporal information and set up the Temporal properties accordingly. The Temporal Controller lets me view temporally filtered subsets of my data according to its current time range.
How do I limit the features shown in the attribute table to just the features intersecting the current time range?


texts: Extracting xyz data from .dxf after conversion to shapefile in QGIS

texts:
I have both a .dwg and derived .dxf data set originally generated in AutoCAD Civil 3D. It appears as a series of triangles which cannot be exploded but each individual triangle does have xyz coordinates attributed to it.

When imported into QGIS the attribute table does not contain the xyz data, only Layer, SubClasses, Linetype and EntityHandle. Each of these EntityHandle elements when viewed in Draftsight by using the GetProperties command does have a list of xyz coordinates attributed to it.

Ideally I'd like to produce a shaded relief contour map of the dataset but without access to the individual xyz data, I'm just going around in circles. Am I approaching this in the wrong way or is there an easier way to extract the xyz data to allow the contour generation task to be completed quickly?


texts: How to update a Mapinfo layer at certain time intervalls?

texts:
I have point which represents stress signal. The signal changes at certain time. How do I implement this in mapinfo ? I did this using time() function and increment it to certain seconds but whole application becomes busy which it is running the procedure. Is there other way?

question on mapinfo-l


texts: 'Pausing' a Python script tool to allow the user to provide input before continuing

texts:
I am using ArcGIS. I have written a Python script that creates various surfaces including NDVI. After the script creates those surfaces, I would like the script to stop running while the user manually:

examines the NDVI and other outputs from the first part of the script
creates a feature class
and edits the feature class to add some point features at appropriate locations.

Once the user is done creating and editing the point feature class, I want the script to keep going.

Is this possible?


texts: Creating fishnet from template feature class using ArcPy?

texts:
I can’t use the tool arcpy.CreateFishnet_management because define the parameter “templateExtent” with a shapefile it is not filling automatically the  parameters “originCoordinate” and “yAxisCoordinate”.

import arcpy
from arcpy import env
env.overwriteOutput = True
env.workspace = r"D:\Users\julia\erste_aufg"

#Process: Create Fishnet
outFeatureClass = r"D:\Users\julia\erste_aufg\at001l_wien\at001l_wien\wien.shp"
cellSizeWidth = '200'
cellSizeHeight = '200'
templateExtent = r"D:\Users\julia\erste_aufg\at001l_wien\at001l_wien\at001l_wien.shp"

arcpy.CreateFishnet_management(outFeatureClass, "", "", cellSizeWidth, cellSizeHeight, '0', '0', "", "NO_LABELS", templateExtent, "POLYGON")

It is working in the ModelBulider, so something is running in the background of the ModelBulider that it could create the parameters “originCoordinate” and “yAxisCoordinate” when it has a “templateExtent”.
How can I get this tool running in ArcPy by having just the parameter “templateExtent”?

I would be really happy if someone has a solution because I need the Fishnet in a scripttool and cannot go one without because in the end there is a loop so the values of the extent are always different.  the first part of the whole script


texts: Identifying unused Step Types in ArcGIS Workflow Manager (WMX)?

texts:
Is there a way to bulk identify unused step types using ArcGIS Workflow Manager Administrator?

Perhaps someone has worked up (and is willing to share) a SQL select statement that returns unused step types.


texts: Interpolate Temperature Data On Urban Area Using Cartopy

texts:
I'm trying to interpolate temperature data observed on an urban area formed by 5 locations. I am using cartopy to interpolate and draw the map, however, when I run the script the temperature interpolation is not shown and I only get the layer of the urban area with the color palette. Can someone help me fix this error? The link of shapefile is

https://www.dropbox.com/s/0u76k3yegvr09sx/LimiteAMG.shp?dl=0

https://www.dropbox.com/s/yxsmm3v2ey3ngsp/LimiteAMG.cpg?dl=0

https://www.dropbox.com/s/yx05n31dfkggbb6/LimiteAMG.dbf?dl=0

https://www.dropbox.com/s/a6nk0xczgjeen2d/LimiteAMG.prj?dl=0

https://www.dropbox.com/s/royw7s51n2f0a6x/LimiteAMG.qpj?dl=0

https://www.dropbox.com/s/7k44dcl1k5891qc/LimiteAMG.shx?dl=0

The Data is:

      Lat      Lon       tmax
  0   20.8208 -103.4434  22.8
  1   20.7019 -103.4728  17.7
  2   20.6833 -103.3500  24.9
  3   20.6280 -103.4261   NaN
  4   20.7205 -103.3172  26.4
  5   20.7355 -103.3782  25.7
  6   20.6593 -103.4136   NaN
  7   20.6740 -103.3842  25.8
  8   20.7585 -103.3904   NaN
  9   20.6230 -103.4265   NaN
 10   20.6209 -103.5004   NaN
 11   20.6758 -103.6439  24.5
 12   20.7084 -103.3901  24.0
 13   20.6353 -103.3994  23.0
 14   20.5994 -103.4133  25.0
 15   20.6302 -103.3422   NaN
 16   20.7400 -103.3122  23.0
 17   20.6061 -103.3475   NaN
 18   20.6400 -103.2900  23.0
 19   20.7248 -103.5305  24.0
 20   20.6238 -103.2401   NaN
 21   20.4753 -103.4451   NaN

the code is:

import cartopy
import cartopy.crs as ccrs
from matplotlib.colors import BoundaryNorm
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import cartopy.io.shapereader as shpreader

from metpy.calc import get_wind_components
from metpy.cbook import get_test_data
from metpy.gridding.gridding_functions import interpolate,remove_nan_obervation
from metpy.plots import add_metpy_logo
from metpy.units import units

to_proj = ccrs.PlateCarree()

data=pd.read_csv('/home/borisvladimir/Documentos/Datos/EMAs/EstacionesZMG/RedZMG.csv',usecols=(1,2,3),names=['Lat','Lon','tmax'],na_values=-99999,header=0)

fname='/home/borisvladimir/Dropbox/Diversos/Shapes/LimiteAMG.shp'
adm1_shapes = list(shpreader.Reader(fname).geometries())

lon = data['Lon'].values
lat = data['Lat'].values
xp, yp, _ = to_proj.transform_points(ccrs.Geodetic(), lon, lat).T

x_masked, y_masked, t = remove_nan_observations(xp, yp, data['tmax'].values)

tempx, tempy, temp = interpolate(x_masked, y_masked, t, interp_type='cressman', minimum_neighbors=3, search_radius=400000, hres=35000)
temp = np.ma.masked_where(np.isnan(temp), temp)

levels = list(range(-20, 20, 1))
cmap = plt.get_cmap('viridis')
norm = BoundaryNorm(levels, ncolors=cmap.N, clip=True)

fig = plt.figure(figsize=(15, 10))
view = fig.add_subplot(1, 1, 1, projection=to_proj)

view.add_geometries(adm1_shapes, ccrs.PlateCarree(),edgecolor='black',  facecolor='white', alpha=0.5)

view.set_extent([-103.8, -103, 20.3, 21.099 ], ccrs.PlateCarree())

ZapLon,ZapLat=-103.50,20.80
GuadLon,GuadLat=-103.33,20.68
TonaLon,TonaLat=-103.21,20.62
TlaqLon,TlaqLat=-103.34,20.59
TlajoLon,TlajoLat=-103.44,20.47

plt.text(ZapLon,ZapLat,'Zapopan',transform=ccrs.Geodetic())
plt.text(GuadLon,GuadLat,'Guadalajara',transform=ccrs.Geodetic())
plt.text(TonaLon,TonaLat,'Tonala',transform=ccrs.Geodetic())
plt.text(TlaqLon,TlaqLat,'Tlaquepaque',transform=ccrs.Geodetic())
plt.text(TlajoLon,TlajoLat,'Tlajomulco',transform=ccrs.Geodetic())

mmb = view.pcolormesh(tempx, tempy,   temp,transform=ccrs.PlateCarree(),cmap=cmap, norm=norm)
plt.colorbar(mmb, shrink=.4, pad=0.02, boundaries=levels)
plt.show()

how to solve this?


texts: Moving legend items up and down with arcpy

texts: How can I move a layer up/down in the legend using arcpy? I work with ArcMap 10.2.2


texts: Calculating closest distances in meters/kilometers given lat/long coordinates?

texts:
I am using ArcGIS 10.2 for Desktop.

I have a shape file containing points worldwide with lat and long, and another world map polygon file whose Geographic Coordinate System is GCS_WGS_1984 and Datum is D_WGS_1984.  I want to use Generate Near Table (Analysis) tool to search for polygons within 100 miles within each point and displaying distance in meters, kilometer, or miles.

I have looked for a solution for a while, one suggested me projecting my points using 'WGS_1984_EASE_Grid_Global'.

Any comments?


texts: Google Earth Engine Map Layer Incorrect Position

texts:
Having read the Google Earth Engine guide 'NDVI, Mapping a Function over a Collection, Quality Mosaicking' (https://developers.google.com/earth-engine/tutorials/tutorial_api_06) I am trying to compute a Normalized Difference Vegetation Index (NDVI) image from a LANDSAT/LC08/C01/T1_TOA image and have written the following code:
var roi = ee.Geometry.Rectangle(138.78575924068758, 35.99620792950091, 140.41997554928133, 35.27856379077837);
Map.centerObject(roi, 8);
Map.addLayer(roi, {}, 'roi');

var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA');

var image = ee.Image(
  l8.filterBounds(roi)
    .filterDate('2015-01-01', '2015-12-31')
    .sort('CLOUD_COVER')
    .first()
);
print(image)

var nir = image.select('B5');
var red = image.select('B4');
var ndvi = nir.subtract(red).divide(nir.add(red)).rename('NDVI');
print(ndvi)

var ndviParams = {min: -1, max: 1, palette: ['blue', 'white', 'green']};
print(ndviParams)

Map.addLayer(ndvi, ndviParams, 'NDVI image')

Also here is the link to the code: https://code.earthengine.google.com/b46f6ec756fe35c65d302eedbb23d5da.
In the console all of the code appears to compute correctly but for some reason the map layer is not added within the region of interest (roi) and I have no idea why. Also I have tried to use the clip tool (this code: https://code.earthengine.google.com/3c93d1c804aa21ff0c0fb082caa953f3) but the map layer is not added at all.
How can I adjust my code so that the NDVI map layer is added within the region of interest (roi)?


texts:
I'm trying to connect to the crsChanged signal in PyQGIS and each time I try to connect to it, I get the following error:
() missing 1 required positional argument: 'x'

The relevant pieces of code are:
self.project = QgsProject.instance()
self.project.crsChanged.connect(self.crsFx)

def crsFx(self):
    print('Changing Crs')
    self.crs = self.iface.mapCanvas().mapSettings().destinationCrs().authid()
    print(self.crs)


texts: Creating random points in area not covered by polygons using QGIS

texts:
I need to create some random points using QGIS. I have two vector files, one line and the other polygon type. I need to create the random points in those spaces that are not the polygon in itself but are the lines.

Let's assume some buildings (polygon), I need to create the random points in those places where there is not a building.


texts: Making new layer with some objects from existing layer in ArcMap?

texts:
In ArcMap desktop, I have a layer with buildings drawn as polygons. I would like to copy buildings which are within 50 m from a particular block of buildings into a new layer.

Ideally, I would like to draw a polygon around the block of buildings. Than, I can use a 50-m buffer to select the buildings that are within this buffer.

What tools can I use to draw the block as polygon? How to transfer the buildings within the buffer into a new layer?


texts: How to generate a WMS from ncWMS and put it in the OpenLayers?

texts:
I am a beginner to make a web application.

I am using ncWMS to serve the netCDF data. And I put some data in the server, I got a interface like this:

This basically satisfies the function that I need. However, I am not happy with the GUI.

Can anyone please enlighten me on how to get a WMS from this server? As I would like to create a layer in the OpenLayers.


texts: Keeping streaming on in ArcMap when switching editing tools?

texts:
I have this problem constantly, because I digitize for work. No one there has figured this out and I was wondering if someone can tell me how to do this, because I'm tired of constantly hitting F8 and it sometimes not even switching to streaming when I click it. I need to be able to keep streaming on when switching tools such as cut polygons, reshape features, and creating features. Anyone know?

I know there is a method to do this, because one of the computers we have does this, but I want to do it on the other ones as well, and I want to know how to turn it off on that computer when I need to.


texts: Cross-validation and optimal p power in IDW

texts: I use the "Geostatistical Wizard" in ArcMap 10 to do my interpolations. For example, when I do IDW and I want to decide for the optimal p power or the optimal number of neighbors that will contribute with weights to my interpolation I try several runs with several combinations (f.i. for 5: min number of neighbors and 10: max number of neighbors), I try all different p powers from 1 and above, and every time I check the RMSE and ME provided. I write down on an excel table all my results and decide for the optimal p or number of min - max neighbors based on which combination gives me the smallest RMSE and ME. What I don't understand and I ask you to help me is, why when I press the optimal button for the p power, the p that is computed usually gives an RMSE and ME larger than what I have computed when I try the different p powers manually?


texts: Zonal Statistics vs. Focal Statistics for GPS points

texts:
I have 200 gps points. I want to calculate total population living within a 5 km radius of the GPS point. I have a input raster for population.

What is the most efficient way to make these calculations? Would it be possible to use focal statistics, or would I have to create a buffer around each GPS point and then run some script to calculate the zonal statistics for overlapping polygons?


texts:
I'm looking for demographic information and various things, and most of the time data are available as CSV (my application use geoJSON format).

Shall I encode the CSV to geoJSON or is there a "library" for geoJSON or some kind of a database of geojson files ?


texts:
I'm looking for a way to export Stretch Function values from images that’s stored in a Mosaic dataset. Not values from the whole set, but specific stretch functions per image. The set is stored in either a filegeodatabase or SDE.

The values I’m looking for is eg. Band[] Min, Max, Mean values and Gamma values....

EditRasterFunction_management() allows me to insert, update or delete which I’ve used to initially create the Stretch Function.

But after some manual editing for the raster images I need a way to export the new values.
I can’t manage to get access to this information using cursors since it’s a function?

Any ideas how to maintain this function values?

Preferably using Arcpy/python.

Thanks!


texts: Layer not completely drawing in ArcGIS published service

texts:
I am publishing a service and one of my polygon feature layers is not completely drawing when viewing the published data through ArcGIS REST API. All features within this feature class are drawing with the exception of one. All shapefile fields are visible. Please refer to the screenshots below...

ArcMap:

REST Service:


texts:
Resulting map is not generated after performing following steps:

Add vector layer(shapefile of a country)
Add demlimited text layer(.csv file of values/variables)
Click on processing toolbox
Type "oridinary kriging" in search tab.
In the window opened: select> points, attribute>desirable,type of quality measure>0/1, block size>100(?),max distance> ?,Lag distance classes>?,skip>?, variogram model> a+b*x, output extent>?,cellsize>?
and remaining options....

Help me for solving the question marks i.e (?)


texts: Can't create new geodatabase for SQLServer Express in ArcCatalog 10.0

texts:
I'm trying to create a new geodatabase in my local SQLExpress Database Server from ArcCatalog 10.0 (ArcInfo). I can create a database server entry just fine (image below):

ESRI documentation has me convinced that at this stage, I should be able to right-click on that server entry, and select the "Create Geodatabase" option.  There is no such option:

It seems a bit like this ArcDesktop 10.0 bug, but following the workaround instructions saw no joy for me.  Any ideas on where I can go from here in solving this?


texts: I am trying to use the new plugin Red Layer, I have installed it in QGIS ver. 2.81. I can open the menu but it is not active. How do I enable it?


texts: Add style-name to table of content in QGIS 2.18

texts:
There is a possibility to add multiple styles to one layer.

Is there a way to add the style-name to the layername in the TOC, changing when you change to another style?


texts: GDAL OGR Polygon.Contains(Point) returns false but point is contained in QGIS map

texts:
I'm sure I must be missing something here but for the life of me I can't see what it might be. I have been struggling for the last hour with an issue with the Contains() method in OGR.

I am iterating through a grid square feature set and trying to perform a function when Polygon.Contains(Point) returns true. Both point and polygon are projected correctly to ETRS89(3035), but contains always returns false.

The map below illustrates one such point and square:

But the following returns false. Note the WKT is taken directly from QGIS to ensure an accurate test.

testPoly = ogr.CreateGeometryFromWkt("POLYGON ((3260000 3560000, 3260000 3570000, 3270000 3570000, 3270000 3560000, 3260000 3560000))")
testPoint = ogr.CreateGeometryFromWkt("POINT (310936.84887920797336847 319641.00836165697546676)")
print(testPoly.Contains(testPoint)) #Always returns false!!


texts:
I am trying to create a line in the center of each polygon of my shape like the red lines in the picture below (all polygons are rectangles).
There's almost 22.000 polygons and I can't figure out how to do this.
Any idea ?


texts: Maplex Label Engine Places Labels Too Close Together

texts: I'm currently trying to label major arterial highways such as interstates and U.S. Routes. I want to have multiple labels per object but Maplex seems to want to cluster the labels together. I've tried setting a minimum duplicate label distance but this has had little effect. To clarify, I don't have any duplicate objects (like multiple segments of the same highway) as I've merged them together in an attempt to solve the problem.


texts: QGIS Web View Widget does not load images properly

texts:
I have developed a custom slider (html5 + js + css) to be able to add multiple images and files to any inventory item, not only to add it in QGIS but in any Web GIS, corporate webs, etc.
The slider is loaded as a Web Widget (url) that takes the item id as a parameter.
Most of the times when opening the form the image is loaded like this:

Sometimes when opening the form in QGIS the second time it is then displayed ok but some other times it keeps beeing displayed always like this...
Any clues on why is this happening?
If I open the url in any web browser it is always displayed ok, the problem is within QGIS.


texts: Openlayers(with proj4.js) transforms coordinates incorrectly

texts:
I encountered a strange behaviour in Openlayers(2) while transforming a point from EPSG:4326 to EPSG:31467.

The Input lat/lon in EPSG 4326 is:
48.002718, 7.841573

This is the output in Openlayers:

OpenLayers with latest proj4.js:
EPSG 31467: 3413629.117584194 5318941.910572025

https://jsfiddle.net/cag5n970/4/

OpenLayers with proj4.js 1.1.0:
EPSG 31467: 3413629.117584194 5318941.910572027

https://jsfiddle.net/cpwqA/75/

This is the output of epsg.io:

With different desktop-GIS-systems I also get the correct coordinates:

GlobalMapper: EPSG 31467: 3413632.71674 5318940.01018

FME: EPSG 31467: 3413632.7176193688 5318940.0085047819

ArcGIS: EPSG31467: 3413633,330872 5318935,858400

OpenJump: EPSG31467: 3413633.0419754055 5318938.324243281

QGIS: EPSG31467: 3413633.35 5318938.35

Here you can see the shift of up to 7.5 meters between the transformed OpenLayers coordinate and the result of the other transformations:

Any idea why Openlayers or the used proj4.js has a wrong output of the transformation?


texts: Changing vector projection in OpenLayers

texts:
I have added vector layer to map:

    vactorTest = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection("EPSG:900913"),
protocol: new OpenLayers.Protocol.WFS({
    srsName: "EPSG:900913",
url: "http://localhost:8080/geoserver/wfs",
featureType: "ROADS",
featureNS: "http://localhost:8080/MIA",
featurePrefix: "MIA",
geometryName: "GEOM",
version: "1.1.0"
})
});

map.addLayer(vactorTest);

And then, added polygon draw control:

var drawPolygon = new OpenLayers.Control.DrawFeature(
vactorTest, OpenLayers.Handler.Polygon,
{
title: "Draw Polygon",
displayClass: "olControlDrawFeaturePolygon",
multi: true
}
);

with drawn polygon I want to filter layer:

testLayer.mergeNewParams({
    "CQL_FILTER": mergeFilter
});

I use within filter:

WITHIN(GEOM, POLYGON((4693721.49445 672633.89194, 4560244.10812 322255.75282, 4703732.29843 422363.79257, 4693721.49445 672633.89194)))

target layer is in Georgia, and if I draw polygon near Italy then, filter works.

How can I change vector projection like my layer to get right result?


texts: How to integrate Standalone GeowebCache with Geoserver on different machine

texts:
We are trying to configure Standalone GeoWebCache on a server. The WMS service is hosted on different server in Geoserver.

How should we fetch WMS layers in GWC.


texts: Load rasters with for loop without dialog box

texts:
I am trying to load many rasters (pngs in this case) using a for loop but for each raster loaded the "Coordinate Reference System Selector" dialog box pops up and I have to hit OK.  I have specified the CRS for each layer within the loop. How can I avoid the dialogue box?

import os
from qgis.core import *
from PyQt5.QtCore import QFileInfo,QSettings

s = QSettings()
oldValidation = s.value( '/Projections/defaultBehaviour' )
s.setValue( '/Projections/defaultBehaviour', 'useGlobal' )

path = '/path/to/my/files/'
files = os.listdir(path)
pngs = [path + f for f in files if f.endswith('.png')]

for png in pngs:

    name = png.split('.')[0].rsplit('/')[-1].rstrip('1234567890_').partition('ave_')
    name = name[0] + name[-1]
    rlayer = QgsRasterLayer(png,name)
    rlayer.setCrs( QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId) )

s.setValue( "/Projections/defaultBehaviour", oldValidation )

The code imports the rasters, but it requires me to sit there and click the button in the box each time, which is obviously undesirable.
Thanks.


texts:
When clicking Print > Adobe PDF the filesize is nice and small but the legend gets messed up.

Does anyone know how to fix this?

I am aware of the Export > PDF and of the reduce DPI and Re-sampling sizes.


texts:
I have got laz file without classification
However everything what I can extract with pdal is this:

Seems like the algorithm detects everything as ground. The code is following:
pipeline = [
"/home/input.laz",
{
    "type":"filters.pmf",
    "returns":"first"
},
"/home/output.laz"
]

 import pdal
 import json
 import numpy as np
 pipeline = pdal.Pipeline(json.dumps(pipeline))
 pipeline.validate()
 count = pipeline.execute()

I tried different filters, however no positive result. Another question is why 'return' condition works only with 'first' and returns RuntimeError: filters.pmf: No returns to process. in any other case
P.S. https://pdal.io/tutorial/ground-filters.html - this solution worked in my case. Now I have segmented ground and unclassified stuff. The problem was in deleting classified .laz file and ept folder every time before I'm trying to do segmentation.  However problem with 'returns' still be unclear


texts: Arrays from feature collections in Google Earth engine

texts:
I need to convert a Feature Collection containing only numeric data to a 2D matrix. I have written the following code however it gives matA as a list of arrays despite explicit type conversion, here table is my feature collection and data is the list of properties I need to extract into the matrix

// list of data to extract from FC
var data=ee.List(['bio01','bio02','bio03','bio04','bio05','bio06','bio07',
              'bio08','bio09','bio10','bio11','bio12','bio13','bio14',
       'bio15','bio16','bio17','bio18','bio19','dem','tmax','tmin','prec']);

//data becomes the list from which the user wants to remove the ones he doesn't need

var tableArray=table.toList(200,0)  // list of features

var tableList=ee.List(tableArray.map(function(element){
  var feat=ee.Feature(element)
  var array=feat.toArray(data)  //feature to array
  return ee.List(array) //array to list
}))

// array needs all elements of list only not array inside list so we change feature to list

var matA=ee.Array(tableList)

print(matA)

The error I am getting is:

Array (Error)
Array: Unrecognized type, may only use numbers or lists, found type Array.


texts:
I know this may sound like a silly question, and it is, but I've read lots of questions and tutorials, watched a few videos and still can't properly understand what I should do...

I am trying to work with Rio de Janeiro's datasets at two different administrative levels: neighbourhoods and administrative regions. Their shapefiles are made available by Rio's city hall, but are set in different CRS (i'll link them by the end of the post). The neighbourhoods shapefiles are set in EPSG:31983 and the administrative region in EPSG:29193(29183).

How can I get the shapefiles to align correctly?

When loading both shapefiles, the neighbourhoods CRS is correctly interpreted by QGIS (I should mention that I'm using QGIS 3.2), which sets it as 31983. The administrative regions are not, and QGIS generates a CRS.

From my understanding the next step should be to reproject this layer onto its right CRS, 29193 (or 29183, I don't know, but either way it doesn't come up right). When I do this the shapefiles are almost aligned, but they're not. They are some 15 meters misaligned.

Thinking that I might have understood something wrong, I tried another approach. I changed the administrative region's CRS via "set layer CRS" in the properties to 29123, and after that reprojected it to 31983. Again, with no success.

I've tried basically all combinations with reprojecting the layer and changing the CRS, but none worked. The first approach is the one I thought would be correct, but I ended up getting frustrated and trying several others.

The links I mentioned earlier in the post:

Neighbourhoods' shapes - http://www.data.rio/datasets/limite-bairro
Administrative regions' shapes - http://www.data.rio/datasets/limite-ras


texts: Passing data from mysql/PHP into Leaflet

texts:
I'm trying to add points to a Leaflet map.

The points are stored in a MySQL database as latitude and longitude.

I would like some leads and recommendations.

<?php
    $showpoint = $bdd->prepare("SELECT t.Depart AS tDepart, v1.ville_latitude_deg AS lat1, v1.ville_longitude_deg AS long1,t.Arriver AS tArriver, v2.ville_latitude_deg AS lat2, v2.ville_longitude_deg AS long2 FROM trajet t, villes_france_free v1, villes_france_free v2 WHERE t.Depart = v1.ville_nom_reel AND t.Arriver = v2.ville_nom_reel");
    $showpoint->execute();
    $nbRows = $showpoint->rowCount();
?>

So I would post all starting points and points to arrive.


texts:
I have a pgRouting network graph of ~ 1 mio edges and ~ 0.4 mio vertices. I want to find out something like "nearest facility" for bigger subsets.
E.g. i have a bigger number of source vertices and a bigger number of target vertices. I need to know the cost (!) of the shortest path from every source vertex to the closest (lowest cost) target (and it's id). Nothing more. The graph itself won't be changed anymore.
At the moment I use pgr_dijkstraCost which takes ~ 0.05 s per source vertex. This is fast, but I need to run thee whole query (with up to 20.000 sources and up to 100 targets) within < 15 s.
Is it realistic to reach this goal just by optimizing the graph?


texts: Measuring angles (not lat long) in QGIS in DMS

texts:
I'm just wanting to find out if QGIS has a setting to measure angles (using the measurement tool) in Degrees Minutes Seconds. Similarly, if one could input Degrees Minutes Seconds using the CAD Tools toolbar?

I am using QGis 3.0

Not sure if I'm just missing a setting somewhere, but I can't seem to find it.


texts: TypeError: QgsVectorLayer(): argument 1 has unexpected type 'QgsVectorLayer'

texts:
I'm getting this error when I try to run the following code:

a6 = processing.run("native:difference", {'INPUT':'_78b00e45_4a8e_4490_9920_f75f6e055a6a','OVERLAY':'te_afb4845c_d9b4_4498_87b0_9da89a98b2f4','OUTPUT':'TEMPORARY_OUTPUT'})
layer1 = QgsVectorLayer(a6['OUTPUT'])
QgsProject.instance().addMapLayer(layer1)

How can I solve it?


texts: Subset of lines that are within polygon in R

texts:
I have a large SpatialLinesDataFrame (~23000 features) and a SpatialPolygonsDataFrame (8 features). I want to make 8 new variables, each with the lines that are on the same locations as the polygons. This should be easy, but I can't find the right way.

I tried the sp::over method, but it returns the error: Don't Kont how to get path data from object of class data.frame. I assume that this is because in the help section there is not a method where x = SpatialLinesDataFrame and y = SpatialPolygonsDataFrame.


texts: Cannot run external scripts with QGIS 3.2 on Mac OS X 10.12

texts:
I am trying to move some automation out of the GUI and into some external python scripts, and I am having a challenge getting a script to run in Terminal.

I have a fully functioning install of QGIS 3.2, can run commands in the console in app etc.

But trying even a basic hello world crashes when I try to run it:  the following:

from qgis.core import *

QgsApplication.setPrefixPath("/Applications/QGIS3.app/Contents/MacOS", True)
qgs = QgsApplication([], False)
qgs.initQgis()
qgs.exitQgis()

produces this error:

This application failed to start because it could not find or load the Qt platform plugin "cocoa" in "".

Reinstalling the application may fix this problem.
Abort trap: 6

Does anyone have a workaround or specific list of bash_profile variables to have things set up correctly?  Do I need to import Qt or similar in the script (this was pulled directly from the QGIS Documentation site)


texts: Median and Mode estimations in the QGIS Modeler?

texts:
I would like to know if there is anyway in which I can combine the available tools in QGIS in the Modeler to estimate median and mode values from a raster (DEM) using polygons.

I know the zonal stats tool will calculate a few things, but not median and mode. There is a plugin option, but third-party plugins are not really well-looked upon at my work, so I'd prefer a different solution, and I'd be happy to try new suggestions. So, is there a way to use the built-in tools of QGIS in the Modeler to estimate median and mode values from a DEM using polygons?


texts: Would anyone know how to thin contour lines in high gradient areas such as a cliff face? Using Esri ArcGIS 10.1 with Maplex labeling engine.


texts: Earth Engine: adjust rectangular box to exactly fit underlying pixel grid?

texts:
In Earth Engine, I want to draw rectangular boxes around points, with the constraint that the box will exactly fit a pixel grid (from another raster).
Drawing a rectangular box around a point has been already discussed (see Creating planar rectangle about points of interest in Google Earth Engine?): use x.buffer(50).bounds().
But how can I adjust that box so that it fit exactly a raster grid, i.e. it contains only 100% covered pixels?
See example below, I would like either a smaller box (removing the <100% covered pixels) or bigger (including also the <100% covered pixels). Link for this code: link

var point = ee.Geometry.Point([-103.44862, 25.90856])
var box = point.buffer(50).bounds()
var LS = ee.ImageCollection("LANDSAT/LC8_L1T_32DAY_NDVI")

var pal = ["#000004FF", "#56106EFF", "#BB3754FF", "#F98C0AFF", "#FCFFA4FF"]

// Display the polygon on the map
Map.centerObject(point, 18);
Map.addLayer(point, {color: 'FF0000'}, 'point');
Map.addLayer(ee.Image(LS.first()).clip(box.buffer(30)), {min:0.1, max:0.2, palette: pal}, 'LS');
Map.addLayer(box, {}, 'box');


texts: Generate list of neighboring polygons QGIS

texts:
I am looking for a way to create a list of polygons that each polygon touches.  I am a complete novice at QGIS and I have no idea where to even start.  I am using a map of voting precincts in Utah that looks like this:

I want to generate a list that shows the precinct name (the attribute is called PrecinctID).  Preferably, the output list would be in the form of a CSV file.  How would I accomplish this?

Edit: When following the instructions provided by PieterB, I get an empty error window.  The Python error log reads:

Traceback (most recent call last):
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/db_manager/db_plugins/gpkg/data_model.py", line 63, in run
              self.model = GPKGSqlResultModel(self.db, self.sql, None)
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/db_manager/db_plugins/data_model.py", line 195, in __init__
              c = self.db._execute(None, sql)
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/db_manager/db_plugins/gpkg/connector.py", line 147, in _execute
              self.connection = spatialite_connect(str(self.dbname))
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 595, in spatialite_connect
              con.enable_load_extension(True)
             AttributeError: 'sqlite3.Connection' object has no attribute 'enable_load_extension'


texts: Using `arcpy.Exists()` and `arcpy.Delete_management` on a temporary layer

texts:
Suppose I make a temporary layer from a feature class in a gdb:

select = arcpy.MakeFeatureLayer_management("roads", "select_lyr", "FIPS_CODE = '06023'")

Later I want to see if that layer exists and if it does, delete it.

try:
    if arcpy.Exists(select):
        arcpy.Delete_management(select)
    else:
        print "select doesn't exist"
except:
    pass

In this scenario, nothing happens. Assuming the layer gets deleted automatically , the print statement doesn't print, and if I just type >>> select in the console, I get a <Result Object>. What am I doing wrong here?! Do I even need to delete this (say I am creating hundreds of similar selects and I don't want it to run out of memory)? Do I need to add the arcpy.en.workspace = 'roads' or something before the delete?


texts: Water direction and intensity of superficial flow

texts:
I'm working on maps that the goal is: to display the direction and intensity of surface water flow. I have the DEM for the watershed and generated the direction of flow, but I don't know how to generate the intensity and display the arrows proportionately.
Based on what I researched, I need to generate the intensity data and merge/join it with the flow direction and then display the direction and intensity vectors.
Does anyone know how to generate the map of direction and intensity of surface water flow?

Note the direction of flow with intensity results in the different  arrows, different from the flow direction.


texts: When exporting shapefile I added polygons to I get an error

texts:
I was tasked with updating a map at work and had to add a number of polygons to the layout. I did this by creating features and then just selecting polygon or autocomplete polygon and just drawing them in. I then had to just match the attributes of the new polygon to some nearby ones.

Nothing too complicated. However, when I try to export the new shapefile I get the following errors in order of pop up windows.

First

Error exporting data. The parameter is (or has an element that is) the wrong kind of geometry

Second

Warning: Some records may not have been exported correctly.

Third

There was an error exporting the layer.

The shapefile is still created, but when adding it to the map it seems like it only exports the shapefiles that already existed before my edits.

I ran the Check Geometry Tool afterwards and the table it returns tells me under the Problem Field that there are self-intersections and empty Z values.

I am able to easily see which ones I created because they have 0 as ObjectID. Is this part of the issue?

Is there any easy way to remove self-intersections and empty z values without deleting all of my work creating and measuring out the new polygons?


texts: I am currently using Arcgis 10.2 and working with dynamic text.  I'm aware of formatting tags available (http://resources.arcgis.com/en/help/main/10.1/index.html#/Formatting_tags_available_in_ArcMap/00s800000017000000/) however, there is no proper case function?  I know i can always field calculate, but everything in our data is always all caps and would be easier to specify through dynamic text.  Is this function just not available in arcmap, or do i have to dig deeper?


texts:
I have a python script in ArcGIS 10.1 which takes in a few inputs from the user.  One of the inputs is a coordinate system.  I would like to test whether the coordinate system the user chose was projected or geographic.

A sample of the code is:

input1 = arcpy.GetParameterAsText(0)
input2 = arcpy.GetParameterAsText(1)
coordsys = arcpy.GetParameterAsText(2)

desc1 = arcpy.Describe(input1)
desc2 = arcpy.Describe(input2)
descCoordSys = arcpy.Describe(coordsys)

The code runs fine until the last line.

I have forced the user to enter a coordinate system in the third line:

What am I missing here?

EDIT:

I've tried to implement the changes proposed by @dmahr but it still doesn't work.  It isn't getting to the nested try statement.  It just quits with the error "There was an error with an input file.  Please run again."  I'm not sure what I'm doing wrong.  I've tried with both projected and geographic coordinate systems.

input1 = arcpy.GetParameterAsText(0)
input2 = arcpy.GetParameterAsText(1)
coordsys = arcpy.GetParameter(2)

try:
    desc1 = arcpy.Describe(input1)
    desc2 = arcpy.Describe(input2)

    try:
        coordsys_linearunit = coordsys.linearUnitName
    except:
        arcpy.AddError("Input coordinate system is not projected.")
        sys.exit("Exiting.")

except:
    arcpy.AddError("There was an error with an input file.  Please run again.")
    sys.exit("Exiting.")


texts:
I'm trying to use QGIS 3.4.14 to clip a subsection of a larger map. What I tried doing was creating a new polygon shapefile layer, then using "Add Polygon Feature" to enclose the Falkland Islands/Islas Malvinas. I then went to Vector -> Geoprocessing Tools -> Clip and selected the layer with the polygon enclosure as the overlay layer and the layer named "Límites"(a line layer) as the input layer. It works...sort of. The layer containing the clip includes the outline of the coast of the Falklands/Malvinas, but I also get several other groups of lines farther out from the coastline. I don't want these. "Límites" is organized as some sort of hierarchy or grouping. What I want is just "Línea de costa", but the clip operation is also picking up "Límite del Mar Territorial Argentino" and "Línea de base".

I have tried hiding the unwanted elements and even deleting them prior to the clip, but they always show up. How do I get QGIS to only clip the "Línea de costa" object? This is what I get after the clip:

The file is publicly available here:

Direct file link:

https://www.ign.gob.ar/archivos/sig250/Mapa_Argentina_Bicontinental_QGIS.rar

Page link:

https://www.ign.gob.ar/NuestrasActividades/InformacionGeoespacial/CapasSIG


texts: Limiting size of require statement when using ArcGIS JavaScript API

texts:
Sometimes I look back at my code or someone else's and see these crazy long require statements - sometimes, hundreds of lines long.

Some of the options for limiting the size of the require statement that I have seen are to:

Componentize the functions
Use promises or callbacks

Is it actually a big deal that the require statement gets so long?

Many aspects of a web map using the ArcGIS API for Javascript simply will not work unless scripts are run within the require statement.

Here's an example of some code I've inherited with a ridiculously long require statement. The full length is actually 300 lines long.


texts: Severe drift occurs during unprojection between XYZ and lat/lng coordinates in Leaflet

texts:
Our team is creating a module for performing offline downloads of Leaflet tile layers that utilizes GeoJSON to optimize the process.

The typical approach is to only use a bounding box and to generate tile URLs for every tile within that box. This approach isn't adequate for what we're doing because we are working with agriculture fields which may be non-contiguous and spread far apart physically. Therefore the overwhelming majority of the time is often wasted iterating through and calling tiles that don't exist. We also need to iterate through several zoom levels in order to obtain a fully functional offline layer, so this can easily involve iterating through 100,000+ tiles. This is unacceptable for our case since we want to support mobile devices (mbtiles is an alternative option, but we'd like to avoid it if possible).

We are optimizing this process by accepting GeoJSON data that describes the true shape of our agriculture fields. We are still iterating through every tile in the bounding box of the shape, but we ultimately only call the URLs of those tiles which intersect the bounding box and the GeoJSON shape.

The problem stems from needing to project the coordinates of the shape's bounding box into XYZ, allowing us to iterate within the boundary by tile indices (if there's a way to avoid this please enlighten me). We then need to convert the XYZ point back into lat/lng in order to determine if the tile's coordinates intersect with the GeoJSON shape. When converting back to lat/lng there is a pretty severe loss of accuracy / drift occurring, and this causes the intersection detector to always return false.

This snippet outlines the issue that occurs during project/unproject

for (var j = tileBounds.min.y; j <= tileBounds.max.y; j += 1) {
  for (var i = tileBounds.min.x; i <= tileBounds.max.x; i += 1) {
    var tilePoint = new L.Point(i, j)
    var tileLatLng = map.layerPointToLatLng(tilePoint) // FIXME: this value is experiencing drift!
    var tileShape = { type: 'Point', coordinates: [tileLatLng.lng, tileLatLng.lat] }
    var tileIntersects = gju.pointInPolygon(tileShape, origShape)

    if (tileIntersects) {
      // ...
    }
  }
}

Interestingly the use of map.unproject (instead of map.layerPointToLatLng) produces much worse results. layerPointToLatLng produces data that's "close", but still several KM away from the expected coordinate.

For instance, if the lat/lng bounding box of the shape is

[-120.210483180564, 36.1665531949778, -120.192638904505, 36.1764258657549]

Then calling unproject on the tile coordinates will produce something like

{lat: 85.00333833822032, lng: -179.7664546966553}

which is completely inaccurate (or at least, completely unexpected).

However, using layerPointToLatLng gets us closer to an expected coordinate, but still off:

 {lat: 35.732091125624216, lng: -120.022931098938}

layerPointToLatLng is simply calling unproject, but it also subtracts the pixel origin from the result.

I have tried experimenting with different Coordinate Reference Systems but they make no difference in the results. We are using Leaflet's default CRS, which is EPSG3857.

What else could be causing this drift? If this is somehow expected behavior, which I'm assuming it could be, what is the reasoning behind it?

I put together a Codepen which outlines the problem. You will need to look at the console output in order to get the full picture.

If you zoom out 6 levels or so you will see a marker cluster to the south and slightly east of the expected area. This helps to visualize the high amount of drift taking place.

https://codepen.io/slurmulon/pen/zRVzjX


texts: Geographic Transformations in Alaska Between NAD83 and WGS84

texts:
I have done a ton of research on the most accurate transformation to use in mainland Alaska to convert between the NAD83 and WGS84 datums, but I just can't seem to find a definitive answer.

ArcMap gives 3 options for my area of interest:

WGS_1984_(ITRF00)_To_NAD_1983

This one I am really unsure of and I have not found much information on when it should be used. I know it has something to do with epochs or realizations of datums, but I am in over my head on this one. Can someone please enlighten me?

NAD_1983_To_WGS_1984_5

This is the one I think might be most applicable, but I am unable to find any definitive information to say whether or not it should be used for Alaska.
Esri says it is applicable for Alaska, but I can't find confirmation of this anywhere else
EPSG doesn't list this transformation when I search with coordinates in Alaska (or at all for that matter)

NAD_1983_To_WGS_1984_1

I am fairly certain that this is a "null" transformation that doesn't actually do anything, and would therefore be least accurate. Especially in Alaska where everything shifts with time.

I should also note that we are using NAD83 (NSRS 2007) in our geodatabase and converting GPS survey data from WGS84 to NAD83 (NSRS 2007) with a custom transformation developed by a geodesist for our area of interest which shifts everything by a meter or so in x and y (the Esri transformation for this is a null transformation that doesn't actually do anything). What I am trying to do is load legacy/reference data that is currently in NAD83 by first transforming to WGS84 (my question here) and then transforming to NAD83 (NSRS 2007) via our custom transformation.

I need to define a definitive procedure for the project team to follow and it will be used on potentially hundreds of layers so I need to get it right.


texts:
I'm trying to download the USGS NLCD 2011 Tree Canopy data from the National Land Cover Database (http://www.mrlc.gov/nlcd11_data.php), but it's really slow. Does anyone know of an alternative site to get this data, or if it is just me that is finding it slow?

It's a 3GB file and will take 4 days at the current speed. I've been checking the website frequently for the last three days and it seems to be consistently slow. Problem is, I want the 10GB file too. I emailed them about it and they said to reset my browser, but then never replied to subsequent emails after that. I download GIS data all the time from different sources, so I don't think the issue is on my end.


texts: Exporting data from DBF to Excel template using ModelBuilder?

texts:
I have created a model in ModelBuilder that uses the iterator tool to run through a polygon layer and clip a raster based on the polygon's unique name in the attribute table. The model then copies the rows of the clipped raster's attribute table and creates a dbf table saved with the polygon name.

I now need the dbf table data to be exported or copied and pasted into an excel workbook that contains formulas in a separate worksheet to analyze the data.

Is there any way to do this in ModelBuilder?

I have used the do.TransferSpreadsheet command in VBA to transfer data from MS Access to an Excel Template in past.  The command works great for automated analysis of complex data and would like something similar for ArcGIS.


texts: Finding output values of point density calculation?

texts: I ran the point density tool and got an output, but because the 'Area Units' option in the Point Density was locked to Square_Map_Units - I don't know how to tell what units the density was calculated with, and no way to convert that into density/km2 which is my desired output.


texts: Are 'Nigerian Colony Coordinate System', MTM (Modified Transverse Mercator) and NTM (Nigerian Transverse Mercator) one and the same? How can I transform coordinates on 'Nigerian Colony Coordinate System' to UTM/WGS84?


texts: What's the ArcGlobe equivalent of BaseDynamicLayer

texts:
I'm attempting to have a dynamic layer in ArcGlobe but obviously BaseDynamicLayer is only for ArcMap.  I'm looking for something that has similar functionality where I can Display data dynamically and update a list of points as I chose.  (Basically the abstract override DrawDynamicLayer)

I was looking at the GlobeGraphicsLayerClass but I'm not sure if this is what I need.