texts:
I would like to execute some code only if a given layout window is open ...
Is there a way to programmatically detect this ? I've browsed the QgsPrintLayout and QgsLayout classes and i didn't find anything helpful ...


texts:
Is there any way to perfectly fit the blue shapes into the green shapes? I have over 7k blue shapes and 550 green shapes and I would love if someone could help me to avoid me doing all the fitting manually.

I'm using QGIS 3.10.4.

EDIT: When i use the "snap geometries to layer" the boundary lines are fine but the inner lines remain in the same place:


texts: Merge multiple buffer files to already available shapefile in QGIS 2.18.2

texts:
I want to merge multiple buffer file to already available shapefile but I'm not sure how to do it. I already applied vector->Data management tools->Merge vector layers, but this is not giving me the actual answer I was expected.

Here is a screen shot of the result I got it after merging multiple buffer files: -

But, I want the result in one shapefile like this: -

Is there any solution using QGIS?


texts: Selecting and updating attribute values using Python console in QGIS?

texts:
I am working with Landusefc and Class columns (ref table).

What I want is: Selecting all water from "Class" and giving a value say '8' in the "Landusefc" column for these selected features.

Table looks like

I have tried the following code, it works till the selection part but doesn't seem to change the attribute value using the ChangeAttributeValue.

from qgis.core import *
import processing
layer=processing.getObject('test1')
query= ' "class" = \'Water\' '
selection = layer.getFeatures(QgsFeatureRequest().setFilterExpression(query))
layer.setSelectedFeatures([k.id() for k in selection])

#using change Attribute to change the value of the selected feature

layer.startEditing()
for feat in selection:
     layer.changeAttributeValue(feat.id(), 5, 8)

layer.commitChanges()


texts: Preventing layer name from snap tip blocking view in ArcGIS Pro?

texts:
When I am using ArcGIS Pro 1.2 and I get near a layer, the layer name physically pops up and it blocks my ability to see where the pointer is in relation to the line and its intersection with another line to snap.

I cannot see where I can turn this snap tip of a layer name off.


texts: Showing marker symbol even when no value in field using QGIS

texts:
In QGIS, I have been learning a few expressions to style my trail maps but still know little and am stumped on what to use to filter my symbol data.
I am showing Parking locations on my map. I use a marker symbol as a background element, so I can do callouts. I created a data field and added values to display beside this symbol a number that references a list of parking addresses in the book's text.
All good except if the field has no number to display, it is NULL, it does not display my marker symbol. I need to filter this, so it does show even when there is no value in the field.


texts: Is there any free resource to get international raster data (other than USGS)?

texts:
I am looking for any raster database that allows free downloads of any kind of raster data pertaining to Damascus, Syria and the surrounding Turkey area. I'm trying to avoid USGS since it requires a lengthy sign-up.

I am open to any site that would allow me to query for data based on that location and extract it for free without too much of a sign up process. I don't care if its DEM, topology, orthography, lidar, etc.


texts: Python script to automate saving satellite images for different combinations of lat longs

texts:
PS. : This is my first try at a GIS application. Please forgive if my question is pedantic.

I would like to get a series of satellite images all at the same scale centered around different points on the surface of the earth. The way I would like it to be done is to define a list of cities/towns say ["New York","London","Mumbai",...] and then generate randomly a set of lat/longs around each of these cities and save the satellite images hence gathered.

So for example the case of NY the lat/long of the center of the city is somewhere around (40.7N,74W). Then I randomly generate points close to it. I would finally like to get satellite images in and around NY city where each image would depict maybe a couple of blocks of the city. Further I would like to repeat this process for all the cities in my list.

Could you please guide me/ give me pointers how to do this and which satellite imagery database is more suitable?


texts: Cannot add a leaflet.pattern pattern to Leaflet map

texts:
I'm using the leaflet.pattern npm package. What am I missing? My Leaflet map is in a Vuejs application.

Maybe I need to correct the import statements?

import L from "leaflet";
import "leaflet.pattern/dist/leaflet.pattern-src.js";

  var myMap = L.map("leafletMapId", {
    layers: [streetTilesLayer],
    scrollWheelZoom: true
  }).setView(this.center, this.zoom);

  var simpleStripePattern = new L.StripePattern();
  simpleStripePattern .addTo(myMap);

No pattern appears on the map.

I have also tried this...

  var myPattern = new L.StripePattern();
  var shape = new L.PatternRect({
    x: 5,
    y: 5,
    width: 40,
    height: 40,
    rx: 10,
    ry: 10,
    fill: true
  });
  myPattern.addShape(shape);
  myPattern.addTo(myMap);

Again, no pattern appears on the map.

I also tried adding these additional import statements and this did not have an effect...

import "leaflet.pattern/dist/leaflet.pattern.js";
import "leaflet.pattern/src/StripePattern.js";
import "leaflet.pattern/src/PatternPath.js";
import "leaflet.pattern/src/PatternRect.js";

This code resulted in an error that might provide insight...
      var shape = new L.PatternRect({
        width: 40,
        height: 40,
        rx: 10,
        ry: 10,
        fill: true
      });

  var pattern = new L.Pattern({ width: 50, height: 50 });
  pattern.addShape(shape);
  pattern.addTo(myMap);

  var circle = new L.Circle(this.center, 400.0, {
    fillPattern: pattern,
    fillOpacity: 1.0
  });
  circle.addTo(myMap);

The error:

  Uncaught (in promise) RangeError: Maximum call stack size exceeded
      at NewClass._updateStyle [as _superUpdateStyle] (leaflet.pattern-src.js?3913:216)
      at NewClass._updateStyle [as _superUpdateStyle] (leaflet.pattern-src.js?3913:217)
      at NewClass._updateStyle [as _superUpdateStyle] (leaflet.pattern-src.js?3913:217)
      at NewClass._updateStyle [as _superUpdateStyle] (leaflet.pattern-src.js?3913:217)
      at NewClass._updateStyle [as _superUpdateStyle] (leaflet.pattern-src.js?3913:217)
      at NewClass._updateStyle [as _superUpdateStyle] (leaflet.pattern-src.js?3913:217)


texts: Create annotation features programatically

texts:
I am using the ESRI Silverlight API for my application. For points, polylines and polygons the Editor class combined with feature layers works great. But it looks like I have encountered a problem. My client needs to add/edit/delete annotations. I created an annotation layer and was able to publish it through ArcGIS Server but obviously couldn't edit it through the API because it's not supported.
From the research I did, I couldn't find an answer which lead me to something. Is there a way how this can be achieved through arcpy / webservice / arcobjects / anything ?

I appreciate all your help!


texts:
I am building a route planning system, but i have still to decide what underlying routing engine i will use. So far i have found pgrouting and neo4j.

I have my route network in a postgresql/postgis database (imported from a shapefile). I have made queries to extract nodes (endpoints of ways where you have to make a decision what direction to go or dead ends) and to extract edges (often made up by several consecutive ways). All my edges are bidirectional.

My main goal is to calculate routes on this network using an A-star algorithm where distance =cost.

My feeling tells me that a graph database like neo4j is the way to go (as it seems to be made for just this purpose), but they don't seem to support A-star by default and also there is no real sense of geometry. It seems better suited for social networks instead of maps.

Would pgrouting fulfill my needs?
Is it fast enough for on the fly queries (+-2000 nodes, +-4000 edges)? Normally this would be a few ms for A-star, but i am unsure about this implemenatation in sql.
Does pgrouting A-star give me a list of nodes and edges?
In most examples i see about pgrouting i notice there is usually a list of commands after calculation of the route (like "At X turn left, etc"). Does pgrouting produce this or is this from another system?

Hopefully someone can give me some information about what system to choose. Neo4j, pgrouting, or some other system.


texts: I have imported a DXF file of my house in QGIS. I also included an openstreetmap layer in WGS84 which also displays my house as a square. Naturally, my house from the DXF file is placed in the ocean at coordinate 0, 0. What I want is to project my house in WGS84. How do I proceed? I am looking for something, like to draw a square around my house in the openstreetmap layer to indicate where to project the data. Is this possible in QGIS or should I follow some other approach?


texts: How to edit a WFS layer with leaflet draw

texts:
I have spend more than 4 hours trying to figure out how I can do this.
I use Leaflet and Leaflet Draw in order to draw news features on my map.

Now I want to be able to edit features of an existing WFS layer (coming from geoserver).

I have searched a lot all around internet and I can not find a clear example of how to make my WFS layer editable.

This is what I do based on the example from here:

// intialize the drawItems and add it to the map
var drawnItems = new L.FeatureGroup();
 map_add.addLayer(drawnItems);
// initialize the controls  (only editing) and add it to the map
var drawControl = new L.Control.Draw({
          draw: {
              position: 'topleft'
          },
          edit: {
              featureGroup: drawnItems,
              edit: true
              }
          }
      });
map_add.addControl(drawControl);

url_string = "thats my url"
// make wfs request and add the layer in the drawItems
var geojson = $.ajax({
          type: "GET",
          dataType: "json",
          url: url_string,
          success: function (response) {
             drawnItems.addLayer(L.geoJson(response));
          }
        });

The layer is displayed on the map. But when I click the edit button (of the leaflet draw plugin) I get a:

      Cannot read property 'enable' of undefined

What am I doing wrong?
Please advise!
If I follow the example in the link I provided it works. But the guy there he uses data inline with his code. I need to use the layer from the WFS request.


texts: QGIS distance from points to nearest line

texts:
How can I get the distances from each point at a shapefile to the nearest line from another?

I've tried to follow the directions from Measuring the distance between lines and points in QGIS and Shortest distance from point to line (big dataset), but both methods didn't worked.

I'm using QGis 2.4 (Chugiak)

Thanks


texts: Fixing "The resource compiler pyrcc5 was not found"

texts:
I was trying to use Plugin Builder to create custom tool.
When I set up parameters for plugin and press "generate", an error appear.
Same situation in QGIS that was downloaded with OSGEO4W64.

I looked through some tutorials where it was said that I need to launch OSGeo4W.bat and run pb_tool. But this tool surprisingly not exist in OSGeo4W folder so i tried to test python3 -m install pb_tool and got another error:

Please let me know what can be done here. I simply want to build a button tool with functions I wrote and share it with another colleagues like a python addin in ArcGIS.


texts:
I have two polygon layers, one of Land and one of Reef. I would like to create two rasters, of the Reef layer, who's values are the area of Land within 15 km of each cell, and the area of Reef within 15 km of each cell.

However I am unsure which function, or combination of functions, I need to use to complete this task.


texts: Iterating through list of values as part of formula in Raster Calculator of ArcGIS Desktop?

texts:
I am trying to create animation of one density raster layer gradually changing to another density raster layer. My idea is to create multiple intermediate raster layers and put them in one group layer in arcscene for animation purpose.

Right now,  for the sake of argument let's call these two raster layers A and B. My way of doing this is: use Raster Calculator to acquire the difference, let's call it D or Delta. Therefore, I can use Raster Calculator to get my intermediate layers with the formulas of:

A + 0.2B
A + 0.4B
A + 0.6B
And so on

However, if I want more layers I will make the increments smaller and it will be imprudent to manually put in all these values. My current model is shown as below

Therefore I am wondering if there is any way to use iterator or arcpy (some format like [0.1, 1, 0.1]) to insert a list of value as part of the formula in raster calculator: A + "input"*B ?


texts: Calculating normal vector distance between two surfaces using ArcGIS Desktop?

texts:
I have two surfaces mapped out from seismic data, imported as x,y,z datasets in ArcMap and then converted to rasters using the point to raster tool. These surfaces are rugose (seafloor and an underlying horizon), and I want to know if there is a way to calculate the shortest distance from the lower horizon to the upper?

An approximation of this would be to calculate the path that is normal to the lower surface (as shown in B), rather than just the vertical distance (as shown in A), as would be calculated in an isopach. Is there a way to do this in Arc and save the calculated values as a surface / contour set?


texts: How to call ogr2ogr from command line with Python 2.7 from ArcGIS 10.2 for Desktop?

texts:
I am trying to access ogr2ogr in the command line, and this is the message I receive:

 'ogr2ogr' is not recognized as an internal or external command, operable program or batch file.

This is current python setup-up. I am using the python version installed with arcgis 10.2 (aka. python 2.7). I have installed and linked Python(x,y) to python itself. I call on arcgis and a variety of python gis function using the Spyder editor, which comes with the Python(x,y) editor.

I installed a compiled gdal package from:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

Now I am able to call the gdal function inside of Spyder, but I am unable to call ogr2ogr from the command line. I did not create a environmental variable for windows yet. My primary issue is that I dont know how create a enviornmental variable for gdal that allows me to call ogr2ogr in the command line, given that I am using the compiled gdal package.

Does anyone know what to do?

Here is the location of the ogr2ogr on my installation:

C:\Python27\Lib\site-packages\osgeo\ogr2ogr.exe


texts: I'd like to extract Spain from my country shapefile using QGIS so that it becomes a seperate layer. Is there a way to do so?


texts: Prevent script to stop when there is an issue with a .shp file

texts:
I am trying to iterate through all my shapefiles to check if they have a coordinate system assigned or not.

The script works fine and iterates through most of my .shp files, however some files seem to have some issues due to unknown reasons and stop the iteration process. The core part of my script, where the error is located is the following:

import arcpy
from arcpy import env
import os

folder = 'C:\\myfolder'
arcpy.env.workspace = folder
fcs = arcpy.ListFeatureClasses()

for shp in fcs:
    print '\t', shp
    dsc = arcpy.Describe(shp)
    print(arcpy.Exists(shp))
    if dsc.spatialReference is None:
        print('shape not readable: ' + folder)

    else:
        sr = dsc.spatialReference

I was able to deal with some problems using the if dsc.spatialReference is None: exception.

Currently I am getting the following error which is was not able to find a solution for. I do not necessarily need to resolve that error. I just want to skip that shapefile and continue with my script.

  Runtime error  Traceback (most recent call last):   File "",
  line 18, in  AttributeError: DescribeData: Method
  spatialReference does not exist

Any suggestions?


texts: "QtCore4.dll Access Violation" on QGIS custom plugin C++

texts:
I have developed a custom QGIS plugin (dll) using C++ through QTCreator. All compiles fine but when I try to activate this plugin in QGIS it crashes and a minidump is created.

After some investigations on the minidump, I am getting this :

FAILURE_BUCKET_ID:  WRONG_SYMBOLS_c0000005_QtCore4.dll!Unknown

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 5fe6d5a0 (QtCore4+0x0009d5a0)
ExceptionCode: c0000005 (Access violation)

Here is my .pro for the QT project :

TEMPLATE = lib
TARGET = MyApp2CPP
QT += core gui sql xml

DEFINES += QT_DLL QT_SQL_LIB MYAPPCPP_LIB QT_XML_LIB

win32:CONFIG(Release, Debug|Release)
{
    LIBS += -LC:/OSGeo4W/lib -lQtCore4
    LIBS += -LC:/OSGeo4W/lib -lQtGui4
    LIBS += -LC:/OSGeo4W/lib -lQtXml4
    LIBS += -LC:/OSGeo4W/lib -lQtSql4
    LIBS += -LC:/OSGeo4W/apps/qgis-dev/lib -lqgis_core
    LIBS += -LC:/OSGeo4W/apps/qgis-dev/lib -lqgis_gui
}

win32:CONFIG(Debug, Debug|Release)
{
    PRE_TARGETDEPS += C:/OSGeo4W/lib/QtCored4.lib
    PRE_TARGETDEPS += C:/OSGeo4W/lib/QtGuid4.lib
    PRE_TARGETDEPS += C:/OSGeo4W/lib/QtXmld4.lib
    LIBS += -LC:/OSGeo4W/lib/ -lQtCored4
    LIBS += -LC:/OSGeo4W/lib/ -lQtGuid4
    LIBS += -LC:/OSGeo4W/lib/ -lQtXmld4
    LIBS += -LC:/OSGeo4W/apps/qgis-dev/lib -lqgis_core
    LIBS += -LC:/OSGeo4W/apps/qgis-dev/lib -lqgis_gui
}

win32:
{
    INCLUDEPATH += C:/OSGeo4W/include
    DEPENDPATH += C:/OSGeo4W/include
    INCLUDEPATH += C:/OSGeo4W/apps/qgis-dev/include
    DEPENDPATH += C:/OSGeo4W/apps/qgis-dev/include
}

...


texts: Create transect lines of specific length through points

texts:
I've got a series of 30 random points in ArcGIS 10.3.1.  I'm hoping to generate 200 meter lines of a specific orientation (i.e. north-south) through each point so that I can sample continuous raster values along each line. Ideally, the point itself would be the center of the line. I'd also be interested in generating perpendicular lines with the point as the intersection.

Is there a simple way to generate straight polylines of a specific distance in ArcGIS?

I'm hoping to repeat this analysis many times, and so I'd love to avoid creating and editing each line manually.

I've searched all over this site and can't find an answer to this specific problem.


texts: x-www-form-urlencoded request vs JSON reseed request - GeoServer

texts:
If I make a JSON request:

http://mygeoserver.pt:8080/geoserver/gwc/rest/seed/TOPP:STREET.json

{
    "seedRequest": {
        "name":"SGM:SGM_RUA",
        "srs": {
            "number": "900913"
        },
        "zoomStart": 1,
        "zoomStop": 20,
        "format": "image/png",
        "type": "reseed",
        "threadCount": 4,
        "bounds": {
            "coords": {
                "double": [
                        "-851266.6436",
                        "4795638.2539",
                        "-850359.5510",
                        "4796040.7426"
                ]
            }
        },
        "parameters": {
            "entry": [
                {
                    "string": [
                        "STYLES",
                        "line"
                    ]
                }
            ]
        }
    }
}

The tiles won't refresh.. However, if I make a x-www-form-urlencoded request with same parameters it works.

http://mygeoserver.pt:8080/geoserver/gwc/rest/seed/TOPP:STREET?threadCount=01&type=reseed&gridSetId=EPSG%3A900913&tileFormat=image%2Fpng&zoomStart=19&zoomStop=19&parameter_STYLES=line&minX=-851266.6436&minY=4795638.2539%0A&maxX=-850359.5510&maxY=4796040.7426


texts:
I am attempting to mosaic 2 DEMs from northern Illinois, USA with QGIS. One DEM has a 4m resolution while the other has 2m. Both DEMs have been clipped and converted to .geotiff from larger .adf rasters. The resulting file size for both DEMs is between 300-400mb. I am using WGS 84 16n for the coordinate system.

I have tried the merge and align tools under raster options with no luck. The operation fails with a memory error or system timeout after about 15 minutes of running.

Is there a step I am missing in this workflow? Do the DEMs need to be resampled at the same resolution/scale? Do I need to manually geo-reference the rasters to align them?

Or is there a more appropriate tool/method within SAGA or GRASS?


texts: Understanding scaling or projection with vector shapefiles which leads to 1:500,000,000,000?

texts:
I am conducting a habitat suitability analysis using ArcGIS desktop 10.2.2.

I have a vector .shp of a number of georeferenced hare sightings across Ireland, however when I load the layer on to my map, the map will only show my existing layers (island of ireland, approx 1:2,000,000 WGS 1984), or alternatively I can 'zoom to layer' on my new vector, which causes the other layers to disappear but the new polygons to correctly draw, at a scale of something absurdly high, around 1:500,000,000,000.

I have tampered with the 'scale' function to rescale the polygons, but it only seems to make the scale get even larger.

I have toyed with various projections too, but to no avail.

Anyone have any ideas how to reconcile these two?


texts: Stack Builder not finding spatial extentions for Postgre 10 when installing PostGIS

texts:
I've never set up a development environment on Windows before.

I followed this guide which is for PostgreSQL 9, but nevertheless. PostGIS is supposed to be installable through Stack Builder, but Stack Builder 4 does not show any Spatial Extensions. I can't find any stand-alone bundles for PostGIS, nor anybody that has the same problem.

When I throw SELECT AddGeometryColumn('testtable', 'g', 3036, 'POINT', 2) at my postgre-server it tells me that addgeometrycolumn() cannot be found, so I assume that PostGIS is missing.

Any hints as to where to start with this one?


texts: How to convert a raster to point with certain value GEE?

texts:
I want to convert the raster to point where hough band have 1 value. I tried with bellow code but can't get the output. any way to get the latlon of the pixels where the value is 1? Please help me. This post
var img = ee.ImageCollection('COPERNICUS/S1_GRD')
            .filter(ee.Filter.date('2020-02-01', '2020-02-28'))
            .filterBounds(area)
            .select(["VH"])
var mome = img.min()
var areac = mome
var canny = ee.Algorithms.CannyEdgeDetector({
  image: filt, threshold: 0.2, sigma: 4.5
});
var hough = ee.Algorithms.HoughTransform(canny, 256, 2, 10).eq(1).clip(area); //this
is an binary image.

var proj = hough.projection()
var latlon = ee.Image.pixelLonLat().reproject(proj)
var coords = if(hough.select("band")==1){
                  latlon.select(['longitude', 'latitude']).reduceRegion({
                               reducer: ee.Reducer.toList(),
                               geometry: area,
                               scale: 50,
                                })
               }
var lat = ee.List(coords.get('latitude'))
var lon = ee.List(coords.get('longitude'))
var point_list = lon.zip(lat)
var mp = ee.Geometry.MultiPoint(point_list)
Map.addLayer(mp,{}, 'Points')


texts: ST_LineInterpolatePoint Error - Does not exist

texts:
I am having an issue 'snapping' a points layer (be - bristol education) onto a road network (br - bristol_roads). I have created the code below using the PostGIS in Action guidebook as a reference however when I execute the code I receive this error -
 SELECT DISTINCT ON (be.id)
  br.geom AS br_geom,
  be.geom AS be_geom,
  br.gid AS br_id,
  be.id AS be_id,
  ST_Line_Locate_Point(
  br.geom,
  ST_Line_Interpolate_Point(br.geom, be.geom)
  ) AS snapped_point
  FROM bristol_education AS be INNER JOIN
  bristol_roads AS br
  ON
  ST_DWithin(be.geom, br.geom, 1)
  ORDER BY
  be.id, ST_Distance(br.geom, be.geom);

ERROR:  function st_lineinterpolatepoint(geometry, geometry) does not exist
LINE 8:   ST_LineInterpolatePoint(br.geom, be.geom)
          ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
Character: 147

Does anyone know how I can get around this? I have tried snapping the points in arcmap/qgis but it seems that PostGIS does not pick up on this.


texts: How to georeference images with GCP's in straight line?

texts:
I would like to use the Thin Plate Spline tranformation type in the QGIS georeferencer plugin. The image I'm trying to georeference is a sequence of aerial images which have been merged manually. I have the coordinates (position of the UAV at the time of taking a picture) of all the centers of the images which form the resulting flight line image. A screenshot to illustrate what I'm trying to do:

The result is very disappointing though, it's all stretched and wonky (see 2nd picture). I tried polynomial 2 and 3 and both of them were trash as well. Helmert gives a decent result but it's not what I need, I need to nullify the errors on the GCP's, therefore I'd like to use a TPS. Any clue on what I could do to fix it?


texts: I want to plot point shapefile on a raster to know if they are at the right place in R

texts:
I have one raster and a shapefile of points. I want to check them if they are in the same coordinate system by plotting them together on a map (like in a classical GIS), here the R script :

# raster first
library(raster)
setwd("P:/folder/")
my.raster <- raster("raster_1991.img")

# shapefile second
library(rgdal)
library(sp)
library(maptools)

setwd("P:/folder")
meteo.shp <- readShapePoints("meteo.shp")

# set up same coordinate system
coord.sys <- CRS("+init=epsg:2065")
proj4string(meteo.shp) <- coord.sys
proj4string(my.raster) <- coord.sys

# plot them in one map (window)
plot(meteo.shp)
plot(my.raster, bg = "transparent", add = TRUE)

I am able to read the data and plot them, but only separately. How can I make sure myself that the points - meteo stations - are exactly where they should be if I cannot check them on a map?


texts: Measure length (in pixels) between multiple points on an image?

texts:
I have a fairly high resolution map (jpg, not vector), with a known scale. How to measure the length in pixels between multiple points on an image? For a straight line it is simple, but how to do it when there are multiple points / no straight lines? Is there a simple GIS tool that could do such a thing?
Example:
This can be reduced to 9 legs to get the total length in pixels.

I currently use the measure tool in Gimp, which allows for a maximum of two legs only. This gets tedious quickly (write down the pixels, and then sum the total later), when there are a lot of curves in a road.
Browsing through this Stack, I found QGIS, and installed it. I can import the map as a raster layer, but from that point on I'm not sure what to do. Can I overlay the map with points/lines somehow, to get distances?


texts:
I have a polyline that is self intersecting in some points and I want to create a "clean" version of it.

Basically something like that Remove Self Intersections in the first image(single part). So all self intersecting "small" parts are deleted.

But I do not have a production mapping license. Can this be achieved in QGIS?


texts: How to define outline color from polygon layer using Python?

texts:
I´m using a QGIS 2.8.3 and I want to define a style for the legend of my polygon layer. I was using this code that works perfect:

str1= 'C:/Documents/Layer.shp'
myVectorLayer = QgsVectorLayer(str1, 'Layer', 'ogr')
myTargetField = 'FWI_AROME'
myRangeList = []
myOpacity = 1

# Make our first symbol and range...
myMin = 0.0
myMax = 8.5
myLabel = 'FWI Baixo'
myColour = QtGui.QColor('#289e26')
mySymbol1 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())
mySymbol1.setColor(myColour)
mySymbol1.setAlpha(myOpacity)
myRange1 = QgsRendererRangeV2(myMin, myMax, mySymbol1, myLabel)
myRangeList.append(myRange1)

#now make another symbol and range...
myMin = 8.6
myMax = 17.2
myLabel = 'FWI Moderado'
myColour = QtGui.QColor('#fee916')
mySymbol2 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())
mySymbol2.setColor(myColour)
mySymbol2.setAlpha(myOpacity)
myRange2 = QgsRendererRangeV2( myMin, myMax, mySymbol2, myLabel)
myRangeList.append(myRange2)

#now make another symbol and range...
myMin = 17.3
myMax = 24.6
myLabel = 'FWI Elevado'
myColour = QtGui.QColor('#ec6e00')
mySymbol3 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())
mySymbol3.setColor(myColour)
mySymbol3.setAlpha(myOpacity)
myRange3 = QgsRendererRangeV2( myMin, myMax, mySymbol3, myLabel)
myRangeList.append(myRange3)

#now make another symbol and range..
myMin = 24.7
myMax = 38.3
myLabel = 'FWI Muito Elevado'
myColour = QtGui.QColor('#cc292a')
mySymbol4 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())
mySymbol4.setColor(myColour)
mySymbol4.setAlpha(myOpacity)
myRange4 = QgsRendererRangeV2( myMin, myMax, mySymbol4, myLabel)
myRangeList.append(myRange4)

#now make another symbol and range...
myMin = 38.4
myMax = 100.0
myLabel = 'FWI Extremo'
myColour = QtGui.QColor('#75263b')
mySymbol5 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())
mySymbol5.setColor(myColour)
mySymbol5.setAlpha(myOpacity)
myRange5 = QgsRendererRangeV2( myMin, myMax, mySymbol5, myLabel)
myRangeList.append(myRange5)

myRenderer = QgsGraduatedSymbolRendererV2('', myRangeList)
myRenderer.setMode(QgsGraduatedSymbolRendererV2.EqualInterval)
myRenderer.setClassAttribute(myTargetField)
myVectorLayer.setRendererV2(myRenderer)
QgsMapLayerRegistry.instance().addMapLayer(myVectorLayer)

The problem is that I want to define the outline color (that appears in black) to the same fill color.

How can I do this?

Any suggestions?


texts: How to reproduce the gdal utility programs in Java by GDAL Java bindings

texts: Can anyone tell me how can I reproduce the gdal utility programs gdal_translate, gdalwarp and gdal2tiles in java by GDAL Java bindings?


texts:
I have transform vector that I have gotten from bbox with sentinelhub:
transform=bbox.get_transform_vector(10,10)
>>>
(-101.7359960059834, 10.0, 0, 20.8312118894487, 0, -10.0)

The type of this affine vector is tuple:
type(transform)

>>>tuple

I want to define this transform to be affine transform in rasterio, e.g to change it type to be affine.Affine a,so it will look like this:
Affine((-101.7359960059834, 10.0, 0, 20.8312118894487, 0, -10.0)

I haven't found any way to change it, I have tried:
#try1
Affine(transform)

#try2
affine(transform)

but obviously non of them work.
I have also tried:
rasterio.transform.guard_transform(transform)

but then I get this error:

TypeError: GDAL-style transforms have been deprecated.  This exception
will be raised for a period of time to highlight potentially confusing
errors, but will eventually be removed.

I still haven't found the way to create affine type from tuple.
My end goal: to get my tuple as type affine in rasterio


texts:
I am trying to create a functional add-in button that calculates the areas of a selected shapefile. The code is located below. However, when I create the add-in and bring up the toolbar, I can only see a red circle with a cross, and the word [MISSING]. There is no button to click. Is this an issue with my code?

I have another add-in installed (not ESRI created) that has many buttons, and these all seem to work fine. They were made using the same method (arcgis add.in installer).

import arcpy
import pythonaddins

class CalculateArea(object):
    """Implementation for CalculateArea.button (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
## Set parameters

        mxd = arcpy.mapping.MapDocument("CURRENT")
        df = arcpy.mapping.ListDataFrames(mxd)[0]
        layers = arcpy.mapping.ListLayers(mxd, "*", df)
        arcpy.env.overwriteOutput = False
        SelectedLayer = pythonaddins.GetSelectedTOCLayerOrDataFrame()
        f_name = "Area_ha"
        f_type = "DOUBLE"
        f_precision = 5
        f_scale = ""
        f_length = ""
        f_alias = ""
        f_null = "NULLABLE"
        f_required = "NON_REQUIRED"
        f_domain = ""

## Create Area field, calculate area in hectares.
        arcpy.AddField_management(SelectedLayer, f_name, f_type,
f_precision, f_scale, f_length, f_alias, f_null, f_required, f_domain)
        areaexpression1 = "{0}".format("!SHAPE.area@HECTARES!")
        arcpy.CalculateField_management(SelectedLayer, f_name,
areaexpression1, "PYTHON_9.3", "")


texts: Edit a not geometric table via a flow WFS

texts:
I want to know if it is possible to modify a non-geometric table via a flow WFS in QGIS.

I have a flow WFS in QGIS with a layer connected to a table on which we can add several recordings (relation 1-n).

I have no problem adding an object on the first one but it is impossible to add recording over the second, the edition is not allowed.


texts: Using enterprise geodatabase with ArcGIS Online?

texts:
I need to create an online map using ArcGIS Online.  The data is stored in an enterprise geodatabase.

Can I add the data to a map directly from the geodatabase?

If not, what's the best way to add it?


texts: Multipart geometry after PyQGIS-3 intersection()

texts:
I'm trying to intersect two polygons with intersection() function of QgsGeometry. The problem is that the result is a multipart polygon instead a single part polygon and QGIS doesn't allow me to save the output layer.
The output layer needs to be a Polygon, not Multipolygon.

I need to work at geometry level, I followed this topic but the problem already exist.

This is my python code:

l1_list = QgsProject.instance().mapLayersByName('Buffer_10km')
l2_list = QgsProject.instance().mapLayersByName('municipality')

l1 = l1_list[0]
l2 = l2_list[0]

prv1 = l1.dataProvider()
prv2 = l2.dataProvider()

# Create a memory layer to store the result
outlayer = QgsVectorLayer('Polygon?crs=' + prv1.crs().toWkt(), "result", "memory")
outpr = outlayer.dataProvider()

feats_l1 = l1.getFeatures()
list_geom_l1 = []
for feat_l1 in feats_l1:
    print('id feature: ' + str(feat_l1.id()))
    g_l1 = feat_l1.geometry()
    list_geom_l1.append(g_l1)

outlayer.startEditing()
outlayer. dataProvider().addAttributes([QgsField('code', QVariant.String)])

for feature in prv2.getFeatures():
    g = feature.geometry()
    g_tmp = g.intersection(list_geom_l1[0])
    print('Multipart?: ' + str(g_tmp.isMultipart()))
    new_feat = QgsFeature()
    new_feat.setGeometry(g_tmp)
    outlayer.addFeature(new_feat)

outlayer.commitChanges()
outlayer.updateExtents()
QgsProject.instance().addMapLayer(outlayer)

The reference system of input layers are the same (WGS84).
Below there is an image of the layers.


texts: Now that NationalAtlas.Gov is retired/removed, where is the largest source of public shapefiles for the USA?

texts: I used nationalatlas.gov for many years, downloading various shapefiles regarding water, roads, boundaries, environmental factors, and more.  NationalAtlas.gov was a central public site that many GIS users in the USA relied upon regularly.  Nationalatlas.gov now forwards to nationalmap.gov , which has a map viewer but does not provide nearly the level of functionality or shear volume of downloadable shapefiles.  So, now that nationalatlas.gov is retired, where are the largest sources of public shapefiles that can be easily accessed?


texts:
I have a software-development background with a powerful use of svn and git.

I work now for a public authority with two offices far from one another. Two other colleagues and I are sharing several QGIS projects and are looking for some features to:

Keep track of changes in files
Be able to fork/create branches/commit/pull and so on

I think we might do that with git, however this will not track files changes (it will note that the file has changed, but not how as it does for codes and scripts).

What is the most efficient way of managing a shared project and keep track of all the changes with the possibilities to revert files to older versions?

PS: I already checked the suggested questions and many other sources on the net.


texts: Arcpy Result object - status Waiting, Cancelling, etc?

texts:
This is a question similar to Using ArcPy Result object associated with Currently Running Script.

I'm curious about how result objects in arcpy can have certain statuses that indicate a geoprocess in process. Statuses such as Submitted, Waiting, Executing, Cancelling, and Deleting. As I understand them, result objects can't be accessed until a geoprocess has completed. Is there a way to access such information mid-process with the result object?


texts: Adding multiple feature classes (everything within gdb) to a group layer in ArcGIS Pro - Python

texts:
I am currently trying to add all the feature classes contained within a gdb to a group layer in ArcGIS Pro via a script. I have however not managed to add more than one single feature class at a time.

By looking at the script below, does any of you have any suggestions to solve this?

arcpy.env.workspace = "C:\\TEST_ENV\\AGOL_output\\AGOL.gdb"
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []
rootPath_aprx = 'C:\\TEST_ENV\\AGOL_output\\'
aprx = arcpy.mp.ArcGISProject(rootPath_aprx + 'WMStest1.aprx')
aprxMap = aprx.listMaps("Map")[0]
targetGroupLayer = aprxMap.listLayers('Group1')[0]
for ds in datasets:
    for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
        path = os.path.join(arcpy.env.workspace, ds, fc)
        print(path)
        for GroupLayer in targetGroupLayer:
            # print(l)
            if str(GroupLayer) == GroupName:
                try:
                    aprxMap.addLayerToGroup(aprxMap, targetGroupLayer, path, ['AUTO_ARRANGE'])
                except:
                    print("gah.")
aprx.save()

The error I am receiving when I run the script is:

  for GroupLayer in targetGroupLayer: TypeError: 'Layer' object is not
  iterable


texts: Rasterize difference between QGIS and FWTools

texts:
I am wanting to use FWTools to rasterize a large number of Shapefile polygons.  I have used the Rasterize tool in QIS and it works great.  But when I use the generated code in FWTools the process does not work.  Here is the generated code:

gdal_rasterize -a COVTYPE -ts 5000 3705 -l LCC001k_dis
C:/GlobalData/Vectors/LCC/LCCRasters/LCC001k_dis.shp
C:/GlobalData/Vectors/LCC/LCCRasters/LCC001k.tif

Unfortunately I am not a programmer, so I am not able to create my own script to perform this task.  Can anyone assist me with why this code doesn't work in FWTools, or what changes I need to make to utilize the Rasterize functionality.


texts: How can I convert lon, lat coordinates to x, y?

texts:
For machine learning, I need to convert an array of coordinates in lon, lat format to simple floats where x=0,y=0 will be a most southwest coordinate and x=1,y=1 most northeast, and x=0.5,y=0.5 will be coordinate in a center.
How can I do this?


texts: Converting gdb files to shapefiles for AutoCAD

texts: I am new to GIS world and been slowly teaching myself Civil 3d. I have been working with importing maps and raster dgn etc., but now I have hit a wall with the contour files being in .gdb format. Is there anyway to convert these file types to shape files for AutoCAD?


texts:
I have a .shp file(A) with several polygons in it. I need to clip other .shp file(B) by each one of the polygons from the first one(A) and save the results in seperate file.

How can I do that using  ModelBuilder in ArcGIS?


texts: other than GrADS and NCL, any other map/chart scripting and plotting software dedicated for climate and meteorology?

texts: NCL is quite good indeed, but I would like to know whether there are other options.


texts: Finding coordinate pair at any given distance along calibrated route?

texts:
Goal: given a route as a set of ordered coordinates, measure the overall distance of the route and be able to access the coordinate pair at any given distance along the route.

Application: I'm building software to analyze driving routes and I would like to be able to get data for any particular section of the route that I want. For example, if I want to know the elevation profile between 50.3 and 58.7, I need the points from the route that are included between those distances.

Problem: I have tried this in Google Earth and various online route building websites like MapMyRide with absolutely horrible results. The process has been to take the file produced by the service, which is a set of points, and interact with the route based on the points in the file. When measured from start to finish, the distance is the same as the service claims. BUT, if I request a point at a distance along the route, using the same calculations for distance between points, I get a points that is anywhere from .5 to 2km off as compared to the distance from the service (basically, the km markers along the route).

Other info: This is a python project and I'm using Vincenty's ellipsoid to measure distance. This question is stemming from a conversation that started at Calculated distance doesn't match Google Earth.


texts: QGIS 3.x Hide form on add feature with Python?

texts:
I use Python for add new tools in QGIS.

How do for access the command "Hide form on add feature with Python" with Python ?

I searched and I didn't find any trick.


texts: Is it possible to export, save, or find the Esri locator files for a geocoding service running on ArcGIS Server?

texts:
I have a geocoding service running fine on an ArcGIS Server 10.4.1 machine, it was created years ago and its origins are unknown to me. I do have admin rights on the server. I need to recreate this geocoding service on a new 10.7.1 site. In order to do that, I need the locator files (.LOC file, etc.) used by the current geocoding service. Is there a way to save or export those files using the service, or at least a way to examine the service and, somewhere in its details or properties, find the path where the locator files used by the service are stored? There is no useful information in the service's Item Description or other metadata.
If this were a map service, I could look in Service Properties > Parameters and the Original Document field would tell me the path to the .MXD that was used to create the service. But there doesn't appear to be any equivalent for a geocoding service: There's no way to look at the geocoding service properties and find the path to the locator files it's using.


texts:
I have two shapefiles.
Shapefile A has five attributes and shapefile B has 20 attributes.
I use the Identity tool to determine, what of shapefile A lies in shapefile B.

This is how both attribute tables look like:

Shapefiel A

Shapefile B

My results are rather confusing

How comes that it splits BO, FE, ... up, when that is contained in Reg1?

Why is it contained two times in there?

Working with ArcGis Desktop 10.2.2 here.

Here is the snipped of the python code and a screenshot.

# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script
# The following inputs are layers or table views: "clip4_diss_clipCopy", "dissolve_clipCopy"arcpy.Identity_analysis(in_features="clip4_diss_clipCopy",identity_features="dissolve_clipCopy",out_feature_class="C:/Users//Documents/Scoring/up.shp",join_attributes="NO_FID",cluster_tolerance="#",relationship="NO_RELATIONSHIPS")

The underlaying green shapefile was used as the Identity Feature. The cyan lines are the different Reg X and the dark outlined features are the Infeatures for the tool!


texts: Where is the "Add vector layer"-button in GRASS 6.4.4. plug-in QGIS 2.10.1?

texts:
I've just downloaded and installed the new version of QGIS 2.10.1 with GRASS 6.4.4.
When opening a new GRASS mapset and importing layers, I missed the button "Add a new vector layer". I've updated the GRASS plugin, but again the button wasn't there (all other GRASS symbols except "add raster layer" were visuable).

It's maybe a stupid question of a GIS beginner, but what can I Do? Is there an option to add (not import) a vector layer via the GRASS toolbox?


texts: Which is correct projection in ArcGIS Server for EPSG:3857/900913?

texts:
I want to publish a mapservice in ArcGIS server, which will be overlayed on Google Maps or Bing Maps. For this, the Map Service needs to be in EPSG:3857/900913.

The Google Maps projection is supposed to assume a Spherical Earth Projection.
So I went to

  Coordinate Systems\Projected Coordinate Systems\World (Sphere-based)

There seems to be a Mercator (sphere).prj, but it does not seem to have the proper Projection parameters.

I then went to

  Coordinate Systems\Projected Coordinate Systems\World

& there are 3 WGS84 based mercator projections:

I see that in a lot of ESRI literature, they use WGS 1984 Web Mercator (Auxiliary Sphere). Is that the Google Maps Projection? What is the WGS 1984 Web Mercator.prj then?

(As a bonus question, this image is from ArcGIS desktop 10.0, but does the answer again change at ArcGIS 10.1?)


texts:
I have pandas DataFrame with these columns:

                                   point            datetime      value
1   Point(-24.6064453125 26.3683280945) 2014-09-11 19:00:00  24.885258
2   Point(-24.6472167969 26.4629898071) 2014-09-11 19:00:00  24.854557
3   Point(-24.6881408691 26.5576820374) 2014-09-11 19:00:00  24.822819
...

with types: string, datetime and float.

What would be the easiest way to migrate this data to a new table in PostGIS enabled database?

Pandas has to_sql function (working through sqlalchemy connector, which is based on psycopg2), but I don't think there is an option for declaring geometry/geography data type.


texts: I'm trying to write an HTML page where the user can upload a GPX file and it is then converted into a series of points on a map, using OpenStreetMap. What is the best way to do this? (Using JavaScript)


texts:
I want to record the location of each grave site in a cemetery for overlaying on Google maps. My Android cell phone (HTC Thunderbolt) reports an accuracy of between 10 meters and 25 meters.  I'd like to get accuracy of around 3 meters or better.

Would it increase my accuracy if I take a GPS reading from a precisely known survey marker in the cemetery first and use the difference between that reading and the actual longitude and latitude to correct the grave site readings?

What kind of accuracy could I expect to get with that method?

I estimate it would take about 3 hours to survey the cemetery.  How consistent are the readings? Do I need to recheck the survey marker during that period?  If so how often?


texts: Shapefile extremely slow to read in Jupyter Notebook

texts:
I have a shapefile of Phoenix, AZ of size 172mb which I am loading in to the Jupyter notebook. It's a extremely slow process to read the file in. I am running the notebook on locally and the files are stored locally as well. When I read CSV or other data files, it's fairly quick, no issues at all.
%%timeit
# Read shape file

px_shp = '~/data/map/City_Parcels.shp'

geodata = gpd.read_file(px_shp)
geodata.dtypes
.
.
.
44.9 s ± 11.5 s per loop (mean ± std. dev. of 7 runs, 1 loop each)

# Filter for Phoenix, Mesa, Tempe, Scottsdale and Chandler

df_geodata =geodata[geodata['CITY'].isin(['PHOENIX','MESA','SCOTTSDALE','TEMPE'])]
df_geodata.plot()


texts: Georeference a raster, CRS unknown but latitude and longitude grid is there

texts:
So, the situation involves :

QGIS 2.18 and georerencer plugin;
Downloaded TIF of an old canadian
topographical map from Quebec National Library and Archives
(permalink here) and as you can see, this nice map included a
grid with latitude and longitude.
The project I'm working on includes
vector data using NAD83 MTM7.

Now, the problem :

Right after selecting file in the georeferencer plugin, I have to enter what i think is the CRS of the original map, which I don't have a lot of info on (It says "polyconic projection" only).
I was under the impression that "real" lat/long would be more than enough to georeference it precisely, but it appears that a entering a CRS is essential!

EDIT : Here's a screen capture of the menu prompted when adding the raster. It's in french, but in the first field, it translates to "select the CSR for the raster layer"

Now, the questions are :

Is there any way I can avoid specifying a CRS when using georeferencer and just enter the lat long of the grid corner? Something that would tell QGIS "Look, forget the CRS, I have latitude and longitude and that all you need!"
If answer to question 1 is "No", what should I do?


texts: Format field in header file invalid for GRASS GIS?

texts:
I have a raster map in GRASS database. When i try to load using

d.rast map=Raster-name

I get the following error:

  Failed to run command.

  Details: GRASS_INFO_ERROR(9937,1):Raster map (Raster-name) :format
  field in header file invalid GRASS_INFO(9937,1)

But my header file for that layer seems to be okay.

  proj:       99

  zone:       0

  north:      605142.56603693

  south:      183380.37076456

  east:       1292651.17488958

  west:       922758.12807321

  cols:       3699

  rows:       4218

  e-w resol:  99.99812025

  n-s resol:  99.99103729

  format:     -1

  compressed: 2

I have tried to copy to a different name both in same and different dataset. But the error still occurs.


texts: Exporting attribute table to text file(.txt) in ModelBuilder

texts:
I'm having trouble exporting directly an ArcGIS attribute table to a text file (.txt) while I'm working in ModelBuilder. I tried the followings and none of them worked:

Copy Rows tool: I tried to add the (.txt) extension to the output table but it still gave a (.dbf) table.
Export Feature Attribute to ASCII: It adds the coordinates (X, Y) which are not needed. Also, the order of the attributes is not the same as the one in the table.
Export table to Excel: I know that it could work if I export my Excel file to a text file from the Excel panel but I'd prefer having this process completely automatic!

EDIT: LOOK AT THE COMMENTS AT THE BOTTOM


texts: Not able to view Planet Lab geotiff file

texts:
Downloaded geotiff L13-0123E-0323N.tif from #planet lab and tried to open using ArcGIS, Windows Picture viewer, and Google Earth.

However, I don't see the image clearly. 120MB file must be having lot of data and details in it.

https://support.planet.com/hc/en-us/articles/211451028--What-can-you-see-

I am referring to this link. Is it possible for me to see a crop from as close as possible to assess its health?


texts: The right way to convert GeoJSON to DXF using QGIS

texts:
I have a problem exporting GeoJSON to vector format.

I downloaded GeoJSON of highway objects from OSM, opened it in QGIS, and then saved it as DXF.

The problem is when I open it in CorelDraw, road shape consists of thousands of parts and nodes and I don't know how to convert it into single curve (CorelDraw just hangs-up)

I need a single closed curve with minimum nodes, may be there is a better way to do it?


texts:
I am using Python and ArcGIS 10.1.

Is there a function or very quick way to extract points out of point feature class into an array without looping through a search cursor (as I have millions of points to process).

I eventually want to transform this into a multipoint feature and make a convex hull from it.

UPDATE:

Although, initially I thought the 11 million point convex hull optimisation was good, I think it is really too long, in order to create a random convex hull and then do an intersect and switch selection, it took 4 hours and 30 mins.  That's NOT INCLUDING the actual processing of the sub-selection of points to (some 100K) create the final convex hull result.  So I think it may be back to the drawing board.

The real success here for actually completing long operations and memory intensive ones, has been to upgrade ArcGIS Python geoprocessing to 64bit.  Before I did this, it would just hang, now it has all the memory it needs and can really slog through some long iterative processes.


texts:
For a GIS assignment I have used raster analysis map overlays in ArcMap to find areas where, if legalised, cannabis dispensaries would be able to be located in London.

I have identified several small areas which are further than 1000ft from schools, nurseries, parks and playgrounds etc.

At present, many of the 'legal' locations seem to be near train stations, notably Paddington, Charing Cross and London Bridge - is there a way of quantifying this relationship?


texts: Adding operational layers to ArcGIS Viewer for Flex?

texts:
I am new to Flex Viewer and am currently trying to view my Map Service that comes from remote Arc GIS Server over the Internet. All parameters in the config.xml file are set up as default (I made no changes to the original file) and I am trying to add a new operational layer. I have installed (locally) Apache 2.2 as my local web server and Flexviewer v 2.3.1. I am therefore using the Flexviewer through my localhost.

My map service using a single feature class, file geodatabase with the data and mxd data frame set to WGS_1984_Web_Mercator_Auxiliary_Sphere, to be consistent with the basemap layers from arcgis online.

I haven't got the ability to install flex viewer on the actual ArcGIS service (in a different office) but I have access via ArcCatalog and ArcGIS Server Manager.

I assume the problem is either

the URL structure specifying the map service, or
some issue with that fact that I'm using a remote ArcGIS Server map serivce?

Below is the code used in config.xml specifying my map service. Is this correct?

    <operationallayers>
        <layer label="test" type="feature" visible="true"
               url="http://myserver/arcgis/rest/services/myservice_wgs84wm/MapServer/"
    </operationallayers>   ,

where 'myservice_wgs84wm' is the name of my map service, served from my ArcGIS Server (named above as 'myserver').

Can anyone advise on the structure of my URL? Do I need to include 'REST' parameter - I don't really understand this?

I'm going to post cross post on the http://forums.arcgis.com/


texts: Strange spatial interpolation results from ordinary kriging

texts:
I'm using Ordinary Kriging to interpolate a set of spatial data. I'm working on different sets which represent different days of measurement. I get good results, apart from one specific set. Will post some examples:

Good interpolations:

Strange interpolation:

What might be causing this behaviour? Why is it going light-blue on almost all the map, without spatially expanding lows and highs (which are pretty clustered!)?
What parameters should I fix, or what could be the dataset error behind?

I see a pretty evident pattern, in that values tend to get high in the top-right corner, but it is not reflected by the interpolating surface.

Thoughts:

There could be some bug in my code, but as said, it goes well for all other sets except this one. I've tried applying different variograms but the results is still silly. On the other hand, other algorithms (e.g. inverse distance) do not show any issue.

Other info:

I'm using R, but could switch to GIS if needed. For R folks, I'm just calling:

kriging <- autoKrige(value~1,finalDataset,new_data=DEM)

from the automap package.

Sample data

I uploaded a working case and the problematic one (hopefully).


texts: How to get the attribute list of a point that is clicked on the map

texts:
I would like to double click a point on map and directly getting to its attributes. I'm too lazy to go through the list auf 400 items, just to find it.

Is there any way to do this?


texts: Creating rectangular graphic on single mouse click using ArcGIS API for Silverlight?

texts:
I'm using Silverlight plugin 5.1.3 and I'm trying to create a rectangular polygon graphic based on a mappoint.  For simplicity reasons, lets assume the maps spatial reference is Web Mercator WGS84 and the rectangle is 1 Meter by 2 Meters.

How can I go about this?


texts: Leaflet - MultiPolyline constructor and arrays in JSON

texts:
I am struggling with the AntPath Plugin ( link to GitHub  ) for Leaflet and the documentation is limited and difficult to read. This setup works well(se code-snippet in the end), but instead I want to add multipolylines. To do that I must change it to:L.MultiPolyline.MultiAntPath(path) and modify JSON-file to my array of polylines.

The valid and working JSON-file for current polyline looks like this:

[[-3.748494, -38.460304],[-3.74845, -38.4603],[-3.7482748, -38.46086]]

But I want something like this(Example for 2 paths):

[[55.778659,12.151137  ], [55.779807,12.158085  ], [55.773663,12.163626  ], [55.769615,12.16311  ]], [[55.766945,12.158487  ], [55.767806,12.154152  ], [55.769787,12.150391  ], [55.772687,12.147922  ]]

How does the setup look like when adding multiple polylines with lat/lon in my new JSON-file (see 2 paths-example)?

    $http.get('newsingle.json').then(function (res) {
                path = res.data;

                L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
                    attribution: '&copy; OpenStreetMap contributors'
                }).addTo(map);

                layer = new L.Polyline.AntPath(path);
                map.addLayer(layer);
                map.fitBounds(layer.getBounds());
            });

            scope.$watch('options', function (opts) {
                if (layer !== null) {
                    map.removeLayer(layer);
                    layer = new L.Polyline.AntPath(path, opts);
                    map.addLayer(layer);
                }


texts: Using my "layerGroup" outside of the function

texts:
The console show this error: "spots is not defined"
How can I use my layerGroup spots outside of the function?
$.get("./data.csv", function (csvString) {
  var data = Papa.parse(csvString, { header: true, dynamicTyping: true }).data;

  for (var i in data) {
    var row = data[i];

    var marker = L.marker([row.Latitude, row.Longitude], {
      opacity: 1,
    }).bindPopup(row.Name);

    var spots = L.layerGroup([marker]);
  }
});

var overlaySpots = {
  "Some name": spots,
};

L.control.layers(null, overlaySpots).addTo(map);

spots.addTo(map);


texts: How to add points in degrees + decimal minutes to QGIS?

texts:
I try to add geocaches with x,y coordinates in a xls-table to qgis and convert to shp.file.

Usally geocach-coordinates are like this: N 51° 29.440' E 011° 56.430' (WGS84) (in german its called "bogenminute) . But it seems that qgis only know geographic coordinate system (WGS 84) with coordinates like this one: 51.754683 12.000967 ("dezimalgrad"). So i can charge them from one to another but i think its sensless. There must be a easier way.

Is there another geographic coordinate system ,qgis has,  to add the points directly from the first format (bogenminute)?


texts: Cloud cover percentage in Google Earth Engine

texts:
I'm doing a project at my university about the Cloud cover percentage in determinate areas in the world. I'm completely new to Google Earth Engine and I'm struggling a lot trying to find a solution for this task. The main problem is how to obtain the percentage of cloudiness in a certain pixel of a list of images.

Here is just the beginning of the code, hope you could help.

//coordinates Pavia
var city = ee.Geometry.Point(9.15, 45.18);

//add point on the map
Map.addLayer(city);

//dates of interests
var start = ee.Date('2016-01-01');
var end = ee.Date('2017-01-01');

//image collection
var Pavia = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(città)
.filterDate(start, end)
.sort('CLOUD_COVER', true);


texts:
Using QGIS 2.18.17, I'm trying to count the points in this polygon but I'm not able to do it. What I have done:

Loaded mapbox map (EPSG:3857)
Loaded CSV-file with the points (EPSG:32633)
Used georeferencing for the shapefile (EPSG:3857)

When I try to count the points in the polygon / shape, it processes for a long time but when I open the attributes table there is no data there. I think it might have to do with the shapefile being EPSG:3857 and the CSV-points being EPSG:32633, even if it's still correctly positioned (see image). Anyone have a clue of what I'm doing wrong?


texts: Problems with Path Distance tool in ArcGIS

texts:
for the first time I run the Path Distance tool in ArcGIS but I guess something went wrong, and the process went into a loop.
I needed to calculate the path distance to rivers. I use a rivers shpfile (lines) and the DEM as surface raster.


texts: Mapnik LineSymbolizer for overlaping lines

texts:
I'm creating a map with Mapnik, and I have some trouble to correctly render overlapping lines. Fot instance let's consider this piece of XML:

<Style name="ferry-routes">
    <Rule>
        &min-zoom-12;
        <LineSymbolizer stroke="#ffffff" stroke-width="1.5" />
        <LineSymbolizer stroke="#0000ff" stroke-dasharray="2, 5" stroke-width="1" />
    </Rule>
</Style>

<Layer maximum-scale-denominator="3000000" name="ferry-routes">

    <StyleName><![CDATA[ferry-routes]]></StyleName>

    <Datasource>
        &postgis-settings;
        <Parameter name="dbname">osm</Parameter>
        <Parameter name="table"><![CDATA[(
            SELECT
                osm_id,
                way
            FROM
                planet_osm_line
            WHERE
                route = 'ferry'
            ) AS ferry_routes]]></Parameter>
    </Datasource>

</Layer>

When two lines have the exact same geometry, I'd expect it to draw, in this order:

white background of line 1
blue dashes of line 1
white background of line 2
blue dashes of line 2

Resulting in only line 2 to be visible.

Instead, it does this:

white background of line 1
white background of line 2
blue dashes of line 1
blue dashes of line 2

Resulting in all the dashes to be visible, like here (buggy line on the left, correct one on the right):

Is there a workaround?


texts: Online service that allows drawing a circle on top of a map?

texts:
I need to draw a circle around a central location to show where other places are within a given distance.

As objects, OSM-based Umap only supports Marker, Polyline, and Polygon.

Currently, I take a screenshot, add a circle using Paint Shop Pro, and send the resulting JPG, but I'd rather a live map so people can zoom in/out and move around:

Does someone know of an alternative, preferably with OSM tiles built in, that would also support circle drawing?


texts: How to reload the Geowebcache gwc-gs.xml manually

texts:
Is there a possibility to reload the gwc-gs.xml configuration file manually?
For example I changed <cacheLayersByDefault>true</cacheLayersByDefault> to false and reloaded the configuration at http://localhost:8082/gwc/demo but it has no effect on the user intreface.

I also tried to reload it via REST post request:

The status code returns an OK but still there are no changes (here is a link to the Geowebcache documentation).

The reload works if the whole geoserver is restarted.
Is it possible to reload the gwc-gs.xml file without restarting the geoserver or do i somehow have to reload the xml with a geoserver REST request?


texts: Do shapefiles sometimes contain the necessary data for address resolution?

texts:
Right now I am doing address resolution with a ESRI file called Street_Addresses_US.loc which works.  I have been given a shape file that contains streets that was compiled by the state.  Is it theoretically possible that I could use this streets shapefile for address resolution?  Or do shapefiles never contain the necessary data for address resolution?

By address resolution I mean put in an address get a lat / long.
ArcEngine 10 C# VS2010.

ESRI support suggested converting a shapefile into a geodatabase file (.gdb) or (.mdb) so I went looking for that, and I'm going to post it here for the community

 public void ShapeFileToAccess()
    {
        //output
        IWorkspaceName pWorkspaceName = new WorkspaceNameClass() as IWorkspaceName;
        pWorkspaceName.WorkspaceFactoryProgID = "esriCore.AccessWorkspaceFactory";
        pWorkspaceName.PathName = "c:\\Data\\test.mdb"; //this is the output file that is created
        IFeatureClassName pFeatureClassName = new FeatureClassNameClass();
        IDatasetName pDataSetName = pFeatureClassName as IDatasetName;
        pDataSetName.WorkspaceName = pWorkspaceName;
        pDataSetName.Name = "test";

        //input
        IWorkspaceName pInShpWorkspaceName = new WorkspaceNameClass() as IWorkspaceName;
        pInShpWorkspaceName.PathName = "c:\\Data\\Shapefiles";
        pInShpWorkspaceName.WorkspaceFactoryProgID = "esriCore.ShapefileWorkspaceFactory";
        //define the dataset
        IFeatureClassName pFCName = new FeatureClassNameClass() as IFeatureClassName;
        IDatasetName pShpDatasetName = pFCName as IDatasetName;
        pShpDatasetName.Name = "Roads.shp"; //this is your input file
        pShpDatasetName.WorkspaceName = pInShpWorkspaceName;

        //convert
        IFeatureDataConverter pShpToFc;
        pShpToFc = new FeatureDataConverterClass();
        pShpToFc.ConvertFeatureClass(pFCName, null, null, pFeatureClassName, null, null, "", 1000, 0);
    }


texts:
I am drawing a dynamic moving vehicle like this:

m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, this.bluePoliceCarGlyph);
m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolMarker, .3f, .3f);
currentUnitPosition = getNextPosition();
dynamicDisplay.DrawMarker(currentUnitPosition);

Does anyone know an easy way to do a hit test on my vehicle?  I am having trouble with this code example, http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_identify_objects_in_dynamic_display/0001000004s2000000/

One of the issues I have with the example is that ESRI states:

ArcGIS versions 9.2 and later have the following three display systems that use OpenGL as their underlying drawing pipe—ArcGlobe/GlobeControl, ArcScene/SceneControl, and MapControl's dynamic display.

So I am trying to get a hit test for a dynamic display object, but according to the tutorial, part 1 (link above), I have to use the OpenGL display system to give my dynamic display object a watermark in order for the hit test to work.  This makes no sense at all.

uint ID = Convert.ToUInt32(r[0]);
OpenGL.GL.glLoadName(ID);

Another issue I have is when this code is called

IArray dynamicHitArray = m_dynamicDisplay.Locate(x, y,
    esriDynamicSelectionMode.esriDSMLayers, this as IDynamicLayer);

Another event is fired off to DrawDynamicLayer and I will get a stackoverflow unless I do this

if(!someBool)
{
    someBool = true;
    IArray dynamicHitArray = m_dynamicDisplay.Locate(x, y,
        esriDynamicSelectionMode.esriDSMLayers, this as IDynamicLayer);

  someBool = false;
}


texts: ArcGIS 10.3: How to merge lines divided by junction points?

texts:
I have one shapefile with train stations (points) from a region in the UK and another shapefile with railroad tracks (lines) between these stations. Problem is, in the latter I don't have a unique line from one station to the next, but multiple connected segments. The only thing that I was able to do was to add another shapefile with junction points, to just visualize where the segment endpoints are.

How can I merge these multiple lines together, so that from station A to station B there is only one line? This is intended to be repeated for any pair of connected stations.

I would also be keen on using Python to do this, making sure there is a way for me to tell the script to merge all the lines between two stations, ignoring the junction points.

I have already tried both Unsplit lines and Dissolve, but the resulting lines are longer than they should be, e.g. they incorporate one too many segments, thus going past their intended endpoint. Unsplit lines seems to be the closest match, but I'd need to be able to restrict the merging so that it is only performed when junction points stand in the way (see image below), thus stopping at station points. If someone came up with a manual procedure, that'd be ok as well, as my dataset is not massive and I could handle it.

For purposes of clarity, see the image below. Currently, I have a number of segments and junction points in between two consecutive stations. The desired output is, instead, a unique object (line) connecting the two stations.

EDIT

Dissolve does not work as the segments composing the A-to-B route do not share any common field value.


texts: How to count pixels in patches of the Global Surface Water Layer (JRC)

texts:
I'm using the GlobalSurfaceWater-Dataset in GEE for creating a mask layer. The mask I do need should only contain  water areas bigger than a certain threshold, so I need to get an information on the area of each of the patches. I did try the .reduceConnectedComponents() function using a sum reducer:

var double= extentGSW.addBands(extentGSW);
var patchreduce= double.reduceConnectedComponents({
  labelBand: "max_extent",
  reducer: ee.Reducer.sum(), //sum up nr of pixels per patch
maxSize: 2000,
});

I would think this should lead to each pixel in one patch getting assigned the value of the total number of pixel in that patch, which would represent the area. However in the output layer pixels in a patch that visibly consist of e.g. two pixels have values of 300. Is there some error in the code? Or rather some problems with scale/projection maybe?
Requesting the scale (pixel size) of the output layer returns 30m, which actually is the correct resolution for GSW.

Did also try the .connectedPixelCount() function, but it lead to the same problem.
Some hints? If my question isn't very understandable, I'm sorry but ready to answer any querys..


texts: Google Earth Engine : Summarise list properties of an image in (sum, mean, etc.)

texts:
Using Noel Gorelick's segmentation session script you end up with pixels that are assigned to a field.  I made some modifications but ended with a similarly structured image included here in the script.

What I would like to do is summarise the information under these pixels (Area, NDVI, etc.) grouped by "labels". In the following example I just get a count of the number of pixels in each group.  And try to sum them using an iterate algorithm.

var image = ee.Image("users/JASPR/Lotes/Lotes15M");

Map.centerObject(image,12)
Map.addLayer(image.randomVisualizer())

var imageOfOnes = ee.Image(1)

image = image.addBands(imageOfOnes)

var countOfPixels = image.reduceRegion({
  reducer: ee.Reducer.count().group({
    groupField: 0,
    groupName: 'labels',
  }),
  geometry: image.geometry(),
  scale: 15,
});

print("countOfPixels:",countOfPixels)
//Object (1 Property)
// property is a list called "groups"

var listOfFields = ee.List(ee.Dictionary(countOfPixels).get("groups"))

print("listOfFields:",listOfFields)
//List of 755 elements
// each element is an object with 2 properties

var fieldObject = listOfFields.get(0)

print("fieldObject:",fieldObject)
//Object with 2 Properties
// count and labels

var fieldCount = ee.Dictionary(fieldObject).get("count")

print("fieldCount", fieldCount)
// a number which the number of pixels inside the field

var addPixels = function(myList,sumCount){
    sumCount = sumCount + ee.Dictionary(myList).get("count")
    return sumCount
}

var sumOfPixels = listOfFields.iterate(addPixels,fieldCount)

print("Sum of Pixels", sumOfPixels)

result is an ee.ComputedObject that I can't figure out how to handle.


texts: Using Google Earth Engine Python Api for NDVI range wise area Calculation?

texts:
I am using Google Earth Engine Python Api for calculating the area of crop fields and to identify good, avg or bad areas of the cropping areas. For this, I am using the below codes

ndvi = clip.normalizedDifference(['B8', 'B4'])

bad=ndvi.gte(-0.99)and(ndvi.lte(0.4)).rename('bad')

avg=ndvi.gt(0.4) and(ndvi.lte(0.7)).rename('avg')

good=ndvi.gt(0.7)and(ndvi.lte(1)).rename('good')

clip = clip.addBands(ndvi).addBands(avg).addBands(bad).addBands(good)

areas = clip.select(['avg', 'bad', 'good']).multiply(ee.Image.pixelArea()).reduceRegion(reducer = ee.Reducer.sum$

    bad_area = areas.getInfo()['bad']*0.0001

avg_area = areas.getInfo()['avg']*0.0001

good_area = areas.getInfo()['good']*0.0001

print(areas.getInfo())
print(bad_area)
print(avg_area)
print(good_area)

But the function is returning all the time the same exact/almost same valus of good amount with the bad and avg amount.

{u'bad': 8993438.423736611, u'avg': 8993438.423736611, u'good': 8993438.423736611}
899.343842374
899.343842374
899.343842374

I am not able to understand what wrong I am done in the code.

I have checked for different areas too and it is confirmed that good, avg and bad values are not just co-incidence


texts: I'm trying to use the kml file in qgis but only the html code is being stored in the attribute table. How to show the uploaded image(Google+) in qgis. It works fine in Google earth.


texts: Making a custom expression "portable"...?

texts:
In a QGIS project im using a custom expression.

As far as i know they are stored locally in a .py file located in the user profile.

What would be the solution to make this custom expression "portable" so that my QGIS project could be distributed ?

Is there any possibilities to define this custom expression in the project's python macros ?


texts: How to push objectIds' array to RelationshipQuery's object in ArcGIS API JavaScript 4.9?

texts:
I need to push array of the object IDs to RelationshipQuery's object using executeForIds that generates the array. I also used executeRelationshipQuery that executes the query. I don't not why, but executeForIds executes after the executeRelationshipQuery, so objectIds array in RelationshipQuery is empty. Can anyone advise me how to push all objectIds to array? Everything works fine when I push the array to RelationshipQuery manually without executeForIds (queryRel.objectIds = [1,2,3,...]).
Here is my code:

 var queryTask = new QueryTask({
              url: "http://xxx/ags/rest/services/xxx/xxx/FeatureServer/1"
          });
          var query = new Query();
          query.outFields = ["*"];

const queryRel = new RelationshipQuery({
              outFields: ["*"],
              relationshipId: 0,
              returnGeometry: true
});

 queryTask.executeForIds({
                  where: "id <> ''"
              }).then(function pokus(results) {
                  queryRel.objectIds = results;
                      alert(queryRel.objectIds);
              });

 queryTask.executeRelationshipQuery(queryRel).then(function (results) {
                  console.log("queryTask results", results);
              });


texts: CAD data not overlaying in ArcGIS, but has correct coordinates in AutoCAD

texts:
I received a set of drawings that were drawn in millimetres but in the correct coordinate system; I use GDA94 with my coordinates in metres, so this should theoretically be a simple fix using my usual process:

UNITS > change 'millimetres' to 'metres'.
Select all > SCALE > base point 0,0 > .001 scale factor

Once this is done, checking the coordinates on the status bar on AutoCAD indicates that my data is in the correct scale and coordinate system, but once I bring it into ArcGIS, it projects nowhere near where it's meant to go and with coordinates that probably aren't even in the same coordinate system.

What is happening? I've used this method before and it usually works, I'm not sure what's happening in this case.

EDIT: the coordinate system I am using is a variation of GDA94 (Perth Coastal Grid 1994). A centre point in the CAD drawing shows a coordinate of 59501 E, 273281 N, which is correct for my purposes. However, zooming to the same layer overlayed in ArcGIS produce a central coordinate of approximately -845 E, -3346 N -- the data doesn't even display, but it could be due to CAD hatching not importing.


texts: Combining two models, one having an iterator

texts:
I have two different ModelBuilder models:

Create a new field and split a layer
Merge all layers in one folder

I want to append both models in one but it does not work.

The Model have a loop and I do not know why and how to solve it.

Could you help me?


texts: Seeking publicly available ArcSDE Servers to use for developing client applications

texts:
I have been asked by our client if I can add the ability to connect to instances of ArcSDE servers from our desktop application.

I am sure that we can do this a number of different ways, what I was looking for was a server I could connect to whilst doing a bit of research / initial development.

We currently don't have any ArcGIS licences or products at present.


texts:
I am trying to shortlist optimal physical locations in my county for developing recycling centres that serve the population.

I have a vector point layer of the centre point of around 100 potential sites and a polygon layer of urban/built-up area. I've a known catchment of 2km as a reasonable distance for a recycling centre and I'm wishing to choose a number of my 100 sites to provide complete coverage over my urban area for recycling activities.

Is there a way using QGIS of calculating/selecting the most rational sites to be chosen for developing as a recycling centre based on their intended catchment?

Some overlap is OK, and I realise that the reality on the ground may be very different to arbitrarily choosing sites based on the distance between them e.g. topography, natural barriers, roads etc. However, I just want a simple model for now that will at least show me roughly where may be sensible to develop the recycling centres.

Alternatively if I was looking at the problem as a blank slate e.g. no potential sites identified, is there a way of suggesting optimal locations for n recycling sites that provide complete coverage for my urban population given that each site will have a catchment of around 2km?

As you can see from the attached image the sites are by no means evenly distributed.


texts: Having functional copy of geodatabase in same SQL Server instance?

texts:
Having an Esri Enterprise geodatabase, I want to have a copy of the database in order to make some tests. I have an instance of SQL Server, and I do not want the overhead of installing and maintain another instance of SQL Server. The tests are going to change the data, that is why I should keep the original data available. Moreover, this is a development environment,it would be nice to have a Database copy per developer.

How do you create a copy of an ESRI enterprise geodatabase on the same SQL Instance?


texts: Convert MapCoordinate from WGS 84 and vice versa - ESRI MOBILE 10.0

texts:
I am seeing a strange issue in 10.0 mobile version. If a convert a coordinate (x.x,y.y) to WGS84 using mobilecache1.spatialreferece.towgs84 and if I convert the resulting GPS coordinate back to map coordinates using mobileCache1.SpatialReference.FromWgs84, the resulting mapcoordinates does not match the original map coordinates. Its about 30 to 50 m off, depending on the mobilecache spatial reference. Below is the piece of the code, I used to test this. However in 9.3.1 the same function works fine and , the resulting coordinates match close to a decimal point.

Has anybody seen this ?? and is there a workaround or an alternate method to convert GPS coordinates to map coordinates.

private void TestTransformations()
{

Coordinate coordinate = new Coordinate( 245649.4, 3280766.6 );
Coordinate gpsCoordinate = mobileCache1.SpatialReference.ToWgs84( coordinate );
Coordinate coord = mobileCache1.SpatialReference.FromWgs84( gpsCoordinate.X,gpsCoordinate.Y);
MessageBox.Show( coord.X + " " + coord.Y );

}

Thanks,


texts: Create a named map with a base map - without Javascript or browser

texts:
I'm using the static maps API to retrieve a .jpg image from a CartoDB named map.  It looks like this.

It's a bunch of residential land parcels.

I need to add a base map such as Here Nokia Reduced Day to this so that the street names can be shown, like this

How would I do that without using a Browser or Javascript?  My earlier question gives some background for those curious about the "no browser, no Javascript" constraints, and my answer describes what I'm currently doing.  I may be wrong about these constraints, but I don't know how to get around them.


texts: How to support multiple Coordinate systems with ArcGIS Server 10.0 WMS?

texts: I have a serve a number of wms Layers with ArcGIS Server (AGS) with the following coordinate system support - EPSG:25832, EPSG:31467, EPSG:4326 and CRS:84. As far as I can tell, AGS only supports 2 coordinate systems in the GetCapabilities document. Is this correct? Do I have another way to server wms layers in multiple Coordinate systems.


texts:
I am trying to reduce a region by clipping an image from copernicus to get NDVI and then calculate a Kc value. However, Once I use a polygon I imported with the "Draw a Shape" tool, the calculations cannot be performed. I get the same error for all.

Dictionary.toArray: Unable to convert dictionary to array, key 'NDVI' has a null value

Does anyone have an idea why this may be happening?

These are the sources I have in my script:

This is the actual script:

var image = ee.Image('COPERNICUS/S2/20170519T173911_20170519T174800_T13RBM');
var NDVI = image.normalizedDifference(['B8', 'B4']).rename('NDVI');
var NDVI_LI = NDVI.clip(Lixin);
var image=image.addBands(NDVI);

var maxNDVI = NDVI.reduceRegion({
  reducer: ee.Reducer.max(),
  geometry: Lixin,
  scale: 10,
  maxPixels: 1e9
});

var minNDVI = NDVI.reduceRegion({
  reducer: ee.Reducer.min(),
  geometry: Lixin,
  scale: 10,
  maxPixels: 1e9
});

var meanNDVI = NDVI.reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: Lixin,
  scale: 10,
  maxPixels: 1e9
});

meanNDVI = meanNDVI.toArray();
minNDVI = minNDVI.toArray();
maxNDVI = maxNDVI.toArray();
print('maxNDVI',maxNDVI);
print('minNDVI',minNDVI);
print('meanNDVI',meanNDVI);

var  Kc = ((NDVI_LI.subtract(minNDVI)).divide((maxNDVI).subtract(minNDVI))).multiply(1.20);
var Kc = Kc.arrayGet([0]);
var image = image.add(Kc);
Map.centerObject(Lixin,15);

And these are the errors I'm getting in the console:


texts:
I want to add labels with geocoordinates on the grid of the map. I have previously asked you this question and you have shared some code with me (How can I label the coordinate position of the grid coordinate lines), but I had no time to try it before.
So, now I am trying to adapt this code as bellowe

But I have no got the positive resoult yet with this work and also I have no any errors... Am I doing somthing wrong? Could you at least describe the steps to create these labels, please..?


texts: Acquiring x y cordinates using bearing and distances

texts:
A polygon ABCD, I need to find x, y coordinates of points ABCD in WGS 1984.

Bearing AB  106.344   Distance AB 497.69m
Bearing BC  182.4108  Distance BC  469.5m
Bearing CD  268.3627  Distance CD 576.17m
Bearing DA  10.5734   Distance DA 636.61


texts: Projecting a world map on 6 segments to print on ball

texts:
Working with QGis and data from Natural Earth I would like to prepare a world map (1:50 000) for a globe that can be printed in 6 segments, which glued together build a ‘sphere’ (ball) according to the following graticule:

What projection would you recommend (Winkel tripel?) and how can I export the result (probably segment by segment?) via the print composer to a vector graphic program that allows me to generate the final printing layout (CMYK)?

I am not (yet) an experienced GIS user; the result will be used as teaching aid in poor South American schools.


texts: Is there a spatially constrained Raster Calculator in QGIS?

texts:
This is a slightly random question, and difficult to find relevant material online. I'm curious if there is a way to use the Raster Calculator functionality on only the section of a raster covered by a polygon.

I'd like to use this to update sections within my raster with certain formula, but not the entire surface as the raster calculator would normally act.

I did find the 'Serval' plugin, which seems to be a step in the right direction, but still doesn't quite do what I'm looking for.


texts:
Is there any built-in tool in QGIS that I can use to buffer points to a variable size (I want to circles around the points, with widths dependent on an attribute in the point layer)?
The Vector/Geoprocessing/Buffer tool only lets me set a fixed buffer size for all features.


texts: Updating In Memory layers, saved layers, group layers and single layers?

texts:
I was wondering if someone can give an explanation to why the following the scenarios happen ?

or direct me to relevant thread or documentation?

Back story is that I have been working a lot with layer files and group layer files. I wanted to give these to user to use as the way of accessing the data.

Although through testing I have come into a couple of issues and I was interested in knowing why these happen

Scenario 1 ( one single layer from one feature class)

I am working on MXD_1 and take a single feature class streets_new_york and run a definition query to filter it to show only red sections , using the sections field.

I save this out as  layer file onto windows calling the layer red_sections.lyr

At a later point I am working on MXD_2 and I drag and drop red_sections.lyr into MXD_2 and save the map.

At a later point I am working on MXD_3 and I edit the streets_new_york to include addition polygons , some of which are red_sections.

When I open MXD_2 it has Automatically updated to show the new data that has been Added to the new feature class.

Scenario 2 Group Layers

I Create a group layer , that contains data from three separate feature class

I call this group layer USA_SECTIONS.lyr , Save to windows and then drag and drop this layer from windows onto my MXD_2.

At point , while working on a different map that contains the USA_SECTIONS.lyr , i add another layer into the group , so it now consists of 4 layers. i save this layer file using the same name USA_SECTIONS.lyr , Overwriting the old file. I open up MXD_2 and it contains the first version.

I think that there is an issue with how the in memory layers work and group layers.


texts: How to Calculate area of LULC at different elevation by using zonal statistics as table tool

texts:
I have to calculate the area of different land classes like forest,barren land etc from my classified land use data at different elevation zones at an interval of 100m. I have DEM of my study area also.

I have tried Zonal Statistisc as table tool and got the output table but i dont know how to identify the type of land class from the table. Can somebody give a solution?


texts: How to configure various client applications to display AVL data?

texts: Given x number of GPS units transmitting NMEA formatted strings back to a server (xxx.xxx.xxx.xxx:xxxxx) is there a way to listen in on the traffic and parse NMEA formatted strings for display on a map? Could a combination of a COM port data emulator and the standard tools in the ArcMap GPS toolbar on a client machine get me there? Any thoughts generally (or specifically in regard to ArcGIS) on what I might do (if anything) if I know where the data is coming in?


texts: Create a valid shapefile with phpmyadmin/Shapefile lib

texts:
I'm trying to create a shapefile with the PhpMyAdmin\ShapeFile library.

I followed the example in the Github project repository, but I would like to create a shapefile within polygon elements, not within point elements.

I also wonder if shapefile coordinates could be decimals lat long (EPSG:4326 WGS84) or if I have to convert them.

The file that I create doesn't work in QGIS (no errors, but it is not displayed).

Here is my PHP code:

$xmin=0;
$xmax=0;
$ymin=0;
$ymax=0;

$sql = "SELECT poli FROM poligons WHERE ID = '$id'";

$res = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($res)) {
    $poli = json_decode($row[0],true);
    foreach ($poli["geometry"][0] as $vert) {
        if ($xmin==0 || $vert[1]< $xmin) $xmin = $vert[1];
        if ($xmax==0 || $vert[1]> $xmax) $xmax = $vert[1];
        if ($ymin==0 || $vert[0]< $ymin) $ymin = $vert[0];
        if ($ymax==0 || $vert[0]> $ymax) $ymax = $vert[0];
    }
}
$shp = new ShapeFile(5, [
    'xmin' => $xmin,
    'ymin' => $ymin,
    'xmax' => $xmax,
    'ymax' => $ymax,
]);

$res = mysqli_query($conn, $sql);

while ($row = mysqli_fetch_array($res)) {
    $poli = json_decode($row[0],true);
    // I don't know if I should pass 1 or 5 to create new shape record
    // in next line: 5 is for polygons 1 for points...
    $record = new ShapeRecord(5);
    $firstVertex=true;
    $record_to_repeat=null;
    foreach ($poli["geometry"][0] as $vert) {
        $record->addPoint([
            'x' => $vert[1],
            'y' => $vert[0],
        ]);
        if ($firstVertex) {
            $record_to_repeat = $record;
            $firstVertex = false;
        }
        $shp->addRecord($record);
    }
    $shp->addRecord($record_to_repeat);
}
$shp->saveToFile("extraction_$id.*");

Here is the JSON extracted from one record of my table (the $poli variable content). I confirm that vertex are correctly extracted from the JSON string file shp seems to be generated with them inside (no error occurs on $record->addPoint(...) and $shp->addRecord(...) ):

{
    "type": "POLYGON",
    "id": "1",
    "title": "303",
    "geometry": [
        [
            ["43.91270111368998", "10.763205885887146"],
            ["43.91284216823677", "10.762763321399689"],
            ["43.912703045946344", "10.762830376625061"],
            ["43.912710774970996", "10.762543380260468"],
            ["43.91272623301729", "10.761880874633789"],
            ["43.912737826549396", "10.761044025421143"],
            ["43.912919458257605", "10.760885775089264"],
            ["43.91306244453156", "10.761824548244476"],
            ["43.91320349822197", "10.761883556842804"],
            ["43.91304698657257", "10.762304663658142"],
            ["43.91313586978198", "10.762417316436768"],
            ["43.913207362701925", "10.76258897781372"],
            ["43.91293491624973", "10.763594806194305"],
            ["43.91279772642933", "10.763554573059082"],
            ["43.91278033614783", "10.763546526432037"],
            ["43.91269531692063", "10.763541162014008"]
        ]
    ]
}


texts:
After the installation of postgis 3.1 and postgres 13, GDAL is complaining about libpq.so.5 library:
gdalinfo: /usr/pgsql-13/lib/libpq.so.5: no version information available (required by /lib64/libgdal.so.27)

I am running Fedora 33 and installed postgis and postgres from YUM, see this guide. I am not using the default Fedora packages, because they offer older version. What is going on and how should I fix this?


texts: Shapefile output customization via WFS in GeoServer?

texts:
I'm running GeoServer 2.4 and I've created a layer that I'm using WFS to download as shapefile (or, rather a zip file with shapefiles). This works fine, and a request like:

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

Returns a zip-file containing the shapefile(s) I requested. No problem. The only problem is that this file contains a wfsrequest.txt file that I'm rather sure my users won't need or worse, be confused by.

After digging a bit around in the GeoServer documentation I've found this page which says that I can use FreeMarker templates to customize the zip-file. But, for the life of me I cannot figure out where to put the FreeMarker template file and what it's filename should be!

In addition it seems to me that the only thing the template let's me configure is the name of the text file, not it's content or if it's included or not.

Any pointers to where to place this template and what I can do with it?


texts: Enable Archiving failing on sde 9.3.1 and MS SQL Server 2008

texts:
I am trying to enable archiving and am getting this error: Violation of PRIMARY KEY constraint 'archives_pk'.  Cannot insert duplicate key in object 'dbo.SDE_archives'.

Is this saying that there is already a primary key in the dbo.SDE_archives table or there is already a primary key which is called archives_pk?  I deleted all versions, unregistered as versioned and moved all edits to base, then re-registered as versioned and tryed to enable archiving again with the same error.

My overall question is, how do I approach the dba because I don't have access directly to management studio on SQL Server 2008 nor would I know what I am doing?..Thanks.


texts: Heatmap plugin crashing/ No longer available for QGIS 2.16?

texts:
I am a Windows user, quite new to QGIS, and I just updated my QGIS to 2.16 (from 2.12 Lyon). I was previously able to create a heatmap overtop a basemap, but my heatmap plugin now crashes the program whenever I try to add that raster layer - my error message just says the program has stopped working.

I was hoping to uninstall/reinstall the plugin, but all fields are grayed out when I look at the plugin manager, as seen below:

Does anyone know if the heatmap is no longer supported in this version of QGIS, or if there is another step I am missing? As I mentioned, I was previously able to create the heatmap using the plugin without much trouble.
If it is no longer supported, which version of QGIS would you recommend using? I am uncertain what to download in the list of previous versions of QGIS (ex: QGIS-OSGeo4W-2.12.2-1-Setup-x86_64.exe VS qgis-2.16.2.tar.bz2.md5).
Are there recommended alternatives to showing data in the heatmap style over a basemap without the plug in?


texts: Calculating Terrain Roughness Index using ArcGIS Pro?

texts:
I am trying to calculate Terrain Roughness Index (TRI) as written up in Riley et al 1999, and have used the python code located here. However, this approach converts a raster to a numpy array and then iterates over the rows.

This can be relatively slow, so is there a way to use ArcGIS Pro to write a custom focal statistics script to calculate a TRI value for each cell over a moving window?


texts: How much effect does having information from more than 4 satellite increase the accuracy of a 3D fix

texts: I know that a GPS receiver requires at least 4 satellites to locate its position in 3D, and I have read elsewhere that having more than 4 satellites would increase its location accuracy. My question is is there a way to calculate how much of a reduction in error is gained due to the increased number of satellites?


texts: python Get current workspace and then re-source to new SDE

texts:
I am trying to write some code that will get the current workspace name and if it matches a particular datasource path, it will re-path the SDE layers to the new database. Initially I had the code working by just running the re-source code on ArcMap startup but this caused problems with the MXD's "Store relative pathnames" option in MXD and would turn it off.
The problem I am having is that I am not sure how to tell it "if the workspace is "blah.sde" then only run the resource code. The MXD's connect to 3 SDE's. Here is what I have:

import arcpy
import pythonaddins
from arcpy import env

class ExtensionClass1(object):
"""Implementation for python_addin.extension2 (Extension)"""
def __init__(self):
    # For performance considerations, please remove all unused methods in
this class.
    self.enabled = True
def startup(self):
    mxd = arcpy.mapping.MapDocument("CURRENT")
    if arcpy.env.workspace = r"C:\ArcGIS\blah.sde":
        mxd.findAndReplaceWorkspacePaths(r"C:\ArcGIS\blah.sde",
                                     r"C:\ArcGIS_10.3.1\blah.sde")
        mxd.findAndReplaceWorkspacePaths(r"C:\ArcGIS\blah2.sde",
                                     r"C:\ArcGIS_10.3.1\blah2.sde")
        mxd.findAndReplaceWorkspacePaths(r"C:\ArcGIS\blah3.sde",
                                     r"C:\ArcGIS_10.3.1\blah3.sde")
        arcpy.RefreshActiveView()
        arcpy.RefreshTOC()

def openDocument(self):
    mxd = arcpy.mapping.MapDocument("CURRENT")
    if arcpy.env.workspace = r"C:\ArcGIS\blah.sde":
        mxd.findAndReplaceWorkspacePaths(r"C:\ArcGIS\blah.sde",
                                     r"C:\ArcGIS_10.3.1\blah.sde")
        mxd.findAndReplaceWorkspacePaths(r"C:\ArcGIS\blah2.sde",
                                     r"C:\ArcGIS_10.3.1\blah2.sde")
        mxd.findAndReplaceWorkspacePaths(r"C:\ArcGIS\blah3.sde",
                                     r"C:\ArcGIS_10.3.1\blah3.sde")
        arcpy.RefreshActiveView()
        arcpy.RefreshTOC()


texts: Visual Studio 2015 doesn't read ArcGIS 10.2.2 advanced license

texts:
I have an ArcGIS 10.2.2 Advanced License installed. I have Visual Studio 2015 installed. When I open my form I assign.

public frmMain()
{
    // this must be the first object created
    try
    {
            ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop);
            init = new AoInitializeClass();
            init.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);
    }
    catch (Exception)
    {
        MessageBox.Show("Unable to obtain license. Application will be shut down.");
        Environment.Exit(1);
   }

    InitializeComponent();
}

However when I check for the license name, I get a Basic license.

ArcGIS 10.2.2 was installed when I inherited the computer, and I installed Visual Studio 2015 C#.

Would anyone have any idea on why my advanced license would show as a Basic license in C#?


texts: How to add values to a shapefile field with a list with PyQGIS

texts:
I am trying to add values to a field that believes in shp "clasific" with data from a list "clasi".
The code I try to use is the following, but in the function SetAttribute () it tells me that the second argument cannot be of this type. I don't know if there is another way to do it.

ruta = "C:/Users/Pc/Desktop/crudo/TF-FLORENCIA-221_7246_1003.shp"
vlayer= QgsVectorLayer(ruta) ## crea el shp de la ruta

######### add field (columna) a shp
campo= vlayer.dataProvider()
campo.addAttributes([QgsField("clasific", QVariant.String),
                     QgsField("area",QVariant.Double)])
vlayer.updateFields()  ### actualizar

f=QgsFeature()
f.setAttributes(clasi)

####### Add values  to the field
for feature in vlayer.getFeatures():
    vlayer.startEditing()
    feature.setAttribute(feature.fieldNameIndex("clasific"),f)
    vlayer.updateFeature(feature)
    iface.vectorLayerTools().stopEditing(vlayer)