texts: How can I aggregate data from one polygon unit to another unit and weight this value based upon a population density raster?

texts:
I would like to calculate the socioeconomic status (SES) of a watershed (dark grey) by aggregating SES data available at the health authority unit.

And I would like to weight this calculation based upon a population density raster layer so that health authorities with larger populations within the watershed boundary are given more weight than those with small populations within the watershed boundary.


texts: Nominatim versus Google's geocoder address aproximation

texts:
I have been trying to display the details of the route that my program is retrieving, precisely the street names.
I get the route results in gps coordinates and i decided to use MapQuest's Nominatim service for the reverse geocoding, because the limitations on GoogleMaps's service.

However, apparently, nominatim is not doing a very good job. As an example here is a group of coordinates:  48.8730900 2.3273124 which should belong to "15-19 Rue des Mathurins, 75009 Paris, France" as Google correctly indicates. Nominatim retrieves this:

streetNames12({"place_id":"12999164","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"1227307571","lat":"48.8730597","lon":"2.3269047","display_name":"32, Rue Tronchet, Madeleine, 8th Arrondissement, Paris, Ile-de-France, Metropolitan France, 75008, France","address":{"house_number":"32","road":"Rue Tronchet","suburb":"Madeleine","city_district":"8th Arrondissement","city":"Paris","county":"Paris","state":"Ile-de-France","country":"France","postcode":"75008","country_code":"fr"}})

So an address which is completely off, that is not helping at all, you can see that even on the map http://screencast.com/t/VnCHFV40

Do you happen to know of an more precise service with no limitations that could help me?

Edit:
I looked a bit more into this problem, it looks like Nominatim looks for the closest point for which it knows the address, in this case is 48.8730597,2.3269047.


texts:
I'm searching about the algorithm helping me realize monotone polyline.

I would wonder if anyone has any program realizing monotone polyline.


texts: Getting unique value of second field using arcpy.da.SearchCursor?

texts:
I have a feature class and using arcpy.da.SearchCursor I'm getting unique values of a field (e.g. Name).  How can I use this method to get the associated row value of a different field (diff field = Name2)?

So far I use this to get unique values on only field Name:

values = [row[0] for row in arcpy.da.SearchCursor(fc, ("Name"))]
    uniqueValues = set(values)
    for value in uniqueValues:

When searching through the feature class how do I also get the value of another field, field Name2?


texts: v.edit break: how to loop through XY coordinates on using GRASS on Windows 7

texts:
Trying to follow the suggestions on this thread: splitting a lines layer using points

However, how to do so in a windows environment using the GRASS command console is beyond me, so I'm attempting with the Python Console (still with no success).

used v.out.ascii module to create .txt of XY coordinates (xycoord.txt)

file = xycoord.txt
for x, y in file:
    grass.run_command('v.edit', map='reshydPART_Pirae', tool='break', coords='x,y')

ValueError: too many values to unpack

Does anyone have any suggestions? I wonder if it has to do with the ascii.output file I'm providing (there are newlines in my txt file). I'm feeling a little lost, especially regarding what to put for the coords parameter. I also can't tell what my error is due to. Thanks in advance.


texts: Tool for converting .shp file to .tab file?

texts: I am searching for any free tool which can convert ShapeFile (.shp) to MapInfo (.tab) file.


texts: Raster brick from raster masks by sectors (R)

texts:
The goal is to divide a raster file into quadrants in order to make some computation in each. I'd like to split the raster and create a raster brick with those parts. I don't need to get perfect clips of the raster so the cell with data in the border of the clip could be also present in the contiguous raster brick.
I'm thinking about creating a radial grid and then extract the raster by masking it with each of the polygons within. I found these interesting questions about the topic.

How to split circles in 12 sections in PostGIS?

How to split circles in 8 quadrants

How to split a circle in equal parts in QGIS?

How can be done this in R ?
Here you have the layer (dem) to tryout.

Note 1: number of quadrants must be a parameter.
Note 2: raster brick must have same extension as the original raster.
Note 3: process must be done in R (a function would be perfect)

Update 10/06/2020:
I hope this schema clarifies the purpose: A Function that given a raster and a number of sectors it creates a raster brick (with number of rasters = number of sectors) where each raster keeps just the values within the correspondent sector.


texts:
IDW algorithm says that it makes a grid and assigns value to each point in grid depending on the distance of separation. From this definition, it looks like the output is set of equally spaced points. However, the next step, formation of raster grid is not explained.
How does the algorithm assign a unique value to a cell/rectangle from equally spaced points.
Are the grid points located at center of cells and then the value at point assigned to cell?


texts: Unable to change the fonts of the legend in QGIS 2.8

texts:
I'm running QGIS 2.8.0-Wien on my Ubuntu box and came across odd behaviour of print composer. When adding a legend - I'm unable to change the font size of the title and items.

Bizarrely - in the other legend I can do that perfectly fine.

What can be causing such behaviour?

The project was first created in older version of QGIS and I opened and saved it under 2.8 version (if that matters).


texts: Openlayers - Maximum number of layers in LayerSwitcher

texts:
I am working on a thematic mapping platform showing data at local administrative levels.
I have many layers, so I run into problems (see screenshot: http://gisintersect.com/many_layers.png).

Is there any way I can collapse groups of layers within the layer switcher?
I have a high number of layers, as you can see in the switcher. Hence, I need some way to collapse/group/categorize the layers, so that I do not need to show all of them in the layerswitcher at once.
The result is that layers drop outside the map, so either, there is a maximum number of layers, or there should be a better way to do it.


texts: Processing third-party JSON data with GeoEvent Server

texts:
I'm looking for suggestions to help with ingesting JSON (not GeoJSON) data from a third party service into our ArcGIS GeoEvent Server.  We're running v10.8 on premise and are having problems extracting location data from a JSON response which resembles this:
[
    {
        docId: someDoc1,
        title: TitleString,
        locations: [
            {
                locationId: location1,
                longitude: 20.000,
                latitude: 20.000
            },
            {
                locationId: location2,
                longitude: 30.000,
                latitude: 30.000
            }
        ]
    },
    {
        ... etc ...
    }
]

The problem is with the multiple grouped locations in each event.  Some of the records have one location object while others have as many as 8.  Before I go down the road of building a custom processor, I wanted to see if anyone else has had this problem and if they were able to solve it with any combination of "out-of-the-box" processors.? .
I'm also willing to entertain the idea that the server is perfectly capable of reading those records and that my problem is somewhere else, but all of my testing points to multiple locations associated with a single event/record.  I've  confirmed that the records are being handled & published to my featureserver/layers; other fields such as title & docId appear in the table on my map, but no coordinates.


texts: Custom MMPK and null solveRouteResult route startTime

texts:
I 've created an mmpk file of a network dataset using ArcGIS Pro v1.2. This file is consumed in an arcgis runtime WPF application for routing purposes. Everything works ok except for the <<route.StartTime>> which is always null. I am not facing the same issue when i use an mmpk file obtained from ESRI. This leads me to the assumption that something is wrong with my mmpk file. The code apart from that works perfectly.
Below are some explanatory parts of my code.
solveRouteTask = await RouteTask.CreateAsync(_transportationNetwork);
routeParameters = await solveRouteTask.CreateDefaultParametersAsync();
routeParameters.StartTime = DateTime.Now;
solveRouteResult = await solveRouteTask.SolveRouteAsync(routeParameters);

I 've attached an screeshot where time format is shown. Can anyone suggest me a solution?


texts:
Maybe it is a very simple question but i couldn't find it anywhere.

I'd like to erase a point feature using QField. If I draw any feature the garbage icon appears but this is not possible by selecting a point (or any other feature) Is it possible? How?


texts: R Code in QGIS - Stratified Random Sampling of Land Cover Classified Raster

texts:
I'm trying to write code using the Processing R Provider scripting in QGIS. The script is to perform a stratified random sampling scheme on a classified land cover raster image. The land cover codes are 1 (urban), 2 (agriculture), and 3 (water).

The code that I use in R is:

library(sp)
library(rgdal)
library(raster)
landclass <- raster("Land8_sup_class_min_mc.tif")
names(landclass) <- 'stratum'
stratrand <- sampleStratified(landclass, size=10, xp=TRUE, sp=TRUE)
writeOGR(stratrand, dsn = ".", layer = "stratrand", driver = "ESRI Shapefile")

The issue I am having is converting this R code to a syntax that can be used in QGIS. This is one of the many iterations I have tried thus far:

##XRaster = raster
##Size=number 10
##stratrand = output vector
library(sp)
library(raster)
R = raster(XRaster)
values(R) <- 1:ncell(R)
pts = sampleStratified(R, Size, xp=TRUE, sp=TRUE)
df <- data.frame(FID=row.names(pts), row.names=row.names(pts))
pts2 <- SpatialPointsDataFrame(pts, data=df)
stratrand = pts2

I get an error if I run the "names(landclass) <- 'stratum'" portion of the code from R and the values(R) portion of the code runs forever. Any suggestions?


texts: Applying version control to ArcGIS ModelBuilder models?

texts:
Version control is an indispensable tool for software development, allowing one to reliably and cleanly step back in time to the last time X did it's job exactly right, or to see what changed between then and now -- typically used when trying to figure out why X is no longer working exactly right.

However all the tools I know about for this work only on plain text files. Toolboxes (standard ones, not the python toolboxes introduced in 10.1), and thus their models, are binary. Does anyone have a workable method to bring versioning to them?

Note: versioning is different from backup. There are any number of simple methods to create snapshots of files for a particular date/time -- Windows backup, previous versions, xcopy /s d:\foobar\ x:\foobar_%date%, zip stuff_%date%.zip stuff\*, and so on.

Applying a tool such as git, fossil, mercurial, subversion, or ... to a binary file is one step better than using xcopy or zip in so much as one can add a commit message, "Model foobar %date% now overwrites previous results only if Baz doesn't exist", but is still anemic compared to what that same toolset can do applied to text files: e.g. show me exactly what was changed between last year and today.


texts: Selecting lines affected by sea level rise?

texts:
I'm doing a part for my master's thesis where I'm trying to find out which sites located near the coasts of Sweden that will be affected by sea level rise. I got a DEM with height data and have to select features from lines, points and polygons .shp layers.

I can figure out how to select the points and polygons using a raster calculator mask, but I have troubles with the lines .shp layer.

Is there any method of selecting the lines features that get affected by sea level rise?

Perhaps an alternative method to using raster calculator for simulating sea level rise or some tool that will work with .shp layers and rasters similar to zonal statistics, but for lines?


texts: How to group many points in the same point and colour it by value?

texts:
I have coordinates of car incidents and I have to draw a map.
The coordinates are not precise: as you can see in the image below you can see the coordinates of 10 incidents and the crossroards where they happened. The points are very close but not in the same position. I need to group all the points in the same points to draw a figure coloured by the number of points*
eg:

10 points => red
5 points => orange
single point => yellow

I use QGIS 3.10 on Windows.

update: the points are now grouped on the same point using move feature


texts: How can I disable and enable an ArcGIS 10 Add-In button?

texts: Is there a way to enable / disable Add-In buttons / tools?


texts:
I have build geographic coordinates grid for raster in ENVI. It can be saved in  grd format only, but I need shp (shapefile) format for opening it in ArcGIS Desktop or MapInfo.

Does anyone know how to convert it?


texts:
I have a project file with many nested layers and would like to query certain layers without having to click on them first. The expression tool however requires me to select the layer I want to query. Is there a way to do an expression like SELECT FROM "Layername"='Cities' WHERE "CITY"='New York' AND "Pollution" = 'low'?

I dug around a bit and only found the Expressions+ plugin but that didn't help either.

Edit for clarification: I do not want to filter any layers. I want to access data from any layer from anywhere with a query without having to select it from the layer stack first.

Let's say I have the layer "Fields" activated and press the expression button. The current option is that I can use expressions to query the "Fields" layer's data. However I want to look for data from another layer, e.g. "Cities".

I'm looking for a solution that lets me use the current expression tool. I have come up with an idea to solve the problem with python (save current layer name, navigate to layer x, then use the query window, then go back) but before I write that up I wanted to see if there's already something useful (and more elegant).


texts: Performing multiple intersections between two polygon tables and one raster table in PostGIS?

texts:
Trying to perform an intersection of an intersection in PostGIS. Its an intersection between a point table, polygon table and a raster table with different number of rows.

The polygon table is the area of interest. The point table is a global soil properties file. The raster table is a an agricultural crop mask with 1 or 0 for values.

The goal was to extract soil properties where the crop mask values are 1 within the given study area. The dssat.cropland table is the raster table, kenyasq18.agareas is the polygon/area of interest and dssat.soils is the point table with props/properties.

select props,st_value
from
  (
    select st_value(c.rast,1,1,1)
    from
     dssat.cropland as c,
     kenyasq18.agareas as a
    where
      st_intersects(c.rast,a.geom)
  ) as cropmask,
  dssat.soils as s,
  kenyasq18.agareas as a
where st_intersects(s.geom,a.geom)
 and st_value=1;

The above query results in duplication of rows and values. Mathematically speaking I would like to do (A ∩ B ∩ C) but seems like I keep ending up with (A ∩ B) X (B ∩ C).

What would be the best way to approach such a query?


texts: How do I use Django REST Framework GIS to query GeoJSON

texts:
I am trying to write the view that will return a GeoJSON of my model stored in the database. I would like to create an API so that I can use an AJAX request in a JavaScript file I have. I have not been able to find how to use the Django REST Framework GIS serializers in my views. I simply want to create an API that returns the GeoJSON to load in my Leaflet map.

Views.py

from django.shortcuts import render
from django.core.serializers import serialize
from .serializers import GeoJsonSerializer
from .models import UtmZones
# Create your views here.
def index(request):
    context = {}
    return render(request, 'proj_picker/proj.html', context)

def api_get_utm(request):
    utm_poly = serialize('geojson', UtmZones.objects.all(), geometry_field='mpoly')
    return JsonResponse(utm_poly, safe=False)

models.py

from django.contrib.gis.db import models

# Create your models here.
class UtmZones(models.Model):
    swlon = models.CharField(max_length=254)
    swlat = models.CharField(max_length=254)
    hemisphere = models.CharField(max_length=3)
    zone = models.CharField(max_length=5)
    cm = models.CharField(max_length=5)
    zone_hemi = models.CharField(max_length=5)

    mpoly = models.MultiPolygonField()

    def __str__(self):
        return self.zone

urls.py

from django.urls import path

from . import views

urlpatterns = [
    path('', views.index, name='proj'),
    path('api/utm/', views.api_get_utm, name='utm'),
]


texts:
I have been working with QGIS for a few years now and am just now having issues with the GRASS module. Ultimately, I am just trying to split a line (river) into 100m segments, and have found the solution 'v.split' from the GRASS module to work in the past. However, it is now not working. When I attempt to do this now, I get a string of the following errors, mixed in with other gray script:

WARNING: Datum <unknown> not recognised by GRASS and no parameters found
WARNING: Column 'FNODE_' : type int8 (bigint) is stored as integer (4 bytes) some data may be damaged
WARNING: Unable to create index
WARNING: Unable to copy table <test> for layer 1 from <vector_5e261eb3399f04@PERMANENT> to <outputd6fac97d69a74c25b15df5ddcab257ba>
ERROR: Key column <> not found

Here are my v.split inputs and some system settings:

I'm at a bit of a loss here. This was working before, but now I am unable to use any of the GRASS tools. Is there someone who might be willing to briefly provide a description of how to properly set up GRASS in QGIS so that it works properly?

For what its worth, I am running a MacBook with OS 10.14.6

And, here's a screenshot of how I have my GRASS settings configured:

I'm just a biologist trying to do biology....


texts: Stopping never ending QGIS processes instead of forcing QGIS to quit?

texts:
being a new to using QGIS on an iMac I often start processes on a large data-set that sets the spinning wheel in to a never ending state.
I often need to force quit the whole QGIS program to break free.

Is there a way to interrupt the processes that I have set in train instead of doing a 'force quit' of QGIS? ...maybe using the osx command line in Terminal?

I am using QGIS 3.4.2 on iMac 10.14.2.


texts: How to import file GeoJSON in Google Earth Engine

texts: I need to import a GeoJSON file into GEE. I converted a shapefile in GeoJSON in QGIS, and I would like to import this GeoJSON file into GEE. How can I do this?


texts:
I have created a QGIS plugin and I use this code to get my layers by name from layer panel on QGIS.

Here the simple code :

layer1 = QgsMapLayerRegistry.instance().mapLayersByName("layer1")[0]
layer2= QgsMapLayerRegistry.instance().mapLayersByName("layer2")[0]
layer3 = QgsMapLayerRegistry.instance().mapLayersByName("layer3")[0]

But if I miss some layers from this three layers then my plugin crashed error out of index because can not find the miss layer.

How to create a condition to stop crashed every time to miss some layer and just show me a simple message for ex  :layer1 miss from layer panel ?


texts: What version of SQL Express to download to work with Geodatabase Replica?

texts:
I want to start working with Geodatabase replicas. What version of SQL Express 2014
should I download, at the sample at ESRI Help it is 2008R2, at Microsoft site there is the flowing options  -

What is the most appropriate version for 2 GB geodatabse created at version 10.1 ?


texts: Why are ogr2ogr SQLite geometry functions not available in command line?

texts:
I believe title is all clear.I'm using Ogr2ogr utilities & binaries to read geometry.
I used something like this:

ogr2ogr -f "SQLite" test2.sqlite test.sqlite -sql "SELECT ST_X(GEOMETRY),ST_Y(GEOMETRY),COL1,COL2 FROM TABLE"

Error says that there is no function ST_X,where I also tried X(..) that doesnt work either.
What am I missing ?

I checked the documentation for SpatialLite.There is no other inline function that export X,Y portions of geometry to double.I also need to create geometry from LAT,LONG columns from selection.

How can i do these ?


texts: Error in fit.variogram.gls method of gstat package in R

texts:
I was trying to fit the variogram parameters of an empirical variogram using GLS (Generalized Least Squares) fitting method. I used the 'fit.variogram.gls' method of the 'gstat' package in R.
I tried it out by running the example code given in the help document.

library(sp)
data(meuse)
coordinates(meuse) = ~x+y
fit.variogram.gls(log(zinc)~1, meuse[1:40,], vgm(1, "Sph", 900,1))

But I was receiving the following error on running the above code :
Error in gamfn(h0, theta) : could not find function "gamfn".

How do I go about interpreting the error and the remedy for it.


texts:
I have a 3G and location ready Android device. I am looking for an app which will allow me to save a route in KML or shapefile format. The reason I am OK with KML is that I know that this is convertible to shapefile via ArcGIS toolbox.

So far I have only found MapInr which appears only able to save waypoints and this won't do. I feel like this functionality should exist and be readily available since we have ancient garmin GPS devices perfectly capable of doing this. The only downside is that they require custom basemaps.

What app could be used so I can then upload my route as a shapefile and use it?


texts: select by attribute and calculate field: fiona, geopandas

texts:
This may be more of a python question than gis, but I have 3 bands in a polygon layer, and I would like to select earthquakes within each band and calculate a new field to note these locations (band 1,2,3). I created a filter to select the band, and want to spatial join this with earthquakes. We do not want to use processing module, as my coworkers are unfamilar with qgis or arcgis. Here is the code so far:

with fiona.open("filepath/bands.shp") as src:
    filtered = filter(lambda f: f['band_1']['band_numbe']=='bar', src)

and (skipping steps of transforming to geodataframe with geopandas), from here I would like to use sjoin:

pointInPolys = gpd.tools.sjoin(geo_eq,src, how='inner', op = 'within').

Any ideas of how to do this using a filter? or a better way to obtain a subset for each band?


texts: Joining non-spatial CSV file to spatial data (shapefile) using QGIS?

texts:
I have a CSV file which has postcode data in a field, but it is non-spatial e.g. no Easting and Northing.

I have a shapefile with postcode in a field and some additional data.

I want to join the CSV with the shapefile based on attributes (postcode fields). I know I can do this in ArcMap, but how can I achieve the same thing in QGIS?


texts: Listing features in the order they were selected

texts:
This is an ArcObjects-specific version of this question: Create Array From Selected Features Based on the Order in Which They Were Selected

Is there a way to get the selected FIDs of a feature layer, selected with the interactive selection tools, in the order that the features were selected?

I've tried both enumerating and getting cursors over the map's FeatureSelection, the layer's IFeatureSelection.SelectionSet, and the IDisplayTable.DisplaySelectionSet. All returned in ascending order, not selection order.

I suppose that you could listen to feature selection events and track this yourself, but I was surprised to find out none of the above methods listed the features in selection order!


texts:
I am trying to generate a shapefile with Joel Lawheads pyshape-library. This works fine so far, but I have one important question:
Is there any mandatory or recommended order of the rings of a multipolygon-geometry?

for example this gives a valid shapefile:

import shapefile
w = shapefile.Writer(shapefile.POLYGON)
ring1 = [[0,50],[50,50],[50,0],[0,0],[0,50]] # Main-Polygon
ring2 = [[10,40],[10,10],[30,10],[30,40],[10,40]] #Hole in Main-Polygon
ring3 = [[70,20],[100,20],[100,0],[70,0],[70,20]] # Island of Main-Polygon
ring4 = [[35,40],[35,10],[40,10],[35,40]] # Second Hole in Main-Polygon
w.poly(parts=[ring1,ring2,ring3,ring4])
w.field('FIRST_FLD','C','40')
w.field('SECOND_FLD','C','40')
w.record('Poly','PolyTest')
w.save('TESTPOLY1')

And this gives also a valid shapefile:

import shapefile
w = shapefile.Writer(shapefile.POLYGON)
ring1 = [[0,50],[50,50],[50,0],[0,0],[0,50]] # Main-Polygon
ring2 = [[10,40],[10,10],[30,10],[30,40],[10,40]] #Hole in Main-Polygon
ring3 = [[70,20],[100,20],[100,0],[70,0],[70,20]] # Island of Main-Polygon
ring4 = [[35,40],[35,10],[40,10],[35,40]] # Second Hole in Main-Polygon
w.poly(parts=[ring1,ring3,ring2,ring4])
w.field('FIRST_FLD','C','40')
w.field('SECOND_FLD','C','40')
w.record('Poly','PolyTest')
w.save('TESTPOLY2')

Both examples work fine in qgis and deliver no error , when I check the geometry:

therefore my question: Is there any mandatory or recommended order of the rings of a multipolygon-geometry?


texts: Inserting dynamic text from related table for Data Driven Pages of ArcMap?

texts:
I'm trying to insert a dynamic text from a related table in a ArcGIS layout using the Data Driven Pages feature to generate automatic reports based on attribute table from a feature class.

I have a geodatabase with a feature class and a related table downloaded from Survey123 for ArcGIS.

Here's the schema of the geodatabase. The source layer used in DDP is "_3410__Campanha_de_Comunicacao_para_Fase_de_Estudos", and the related table is the "Stakeholder" file.


texts: panning cesium 2D map having asia as center without zooming

texts:
Using cesium it is possible to pan the 2D map having Asia as the center?
Example as shown in the image.


texts:
Adding page numbers in QGIS Layouts can be done with the [% @layout_page %] expression. In Reports, however, the [% @layout_page %] expression always remains "1"

How do we insert the page number in a Report?


texts: "Vertex Tool" only for some PostGIS Layers

texts:
I want to edit PostGIS layers within QGIS and before that, I changed a layer using ST_Difference. Now, I can select QGIS' Edit Feature after importing it from PostGIS but only for some layers it is possible (which I haven't changed) to change their vertices with the Vertex Tool.

I checked SRID, Geometry Type and so on but couldn't find a difference. Has anyone ever faced the same problem?


texts: Get an average image, but the time of each pixel is different

texts:
Change image is an array image,he stores the time node of each pixel.time1 and time2 are the first node and the second node of each pixel, respectively.I want to get the NDSI average value of each pixel in the image between time1 and time2.I don't know how to express the image between time1 and time2 of each pixel.Hope you can help me.Many thanks.Here is the code link https://code.earthengine.google.com/c9dd75397677fbc1966107b0aa21cf66
var change = ee.Image('users/wiell/CCDCExamples/segments')
var blist = change.select('tBreak')
blist = blist.arrayMask(blist.gt(0))
var region = blist.geometry()

var l5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
  .select(['B2', 'B5', 'pixel_qa'], ['green', 'swir1', 'pixel_qa'])

var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
  .select(['B3', 'B6', 'pixel_qa'], ['green', 'swir1', 'pixel_qa'])

var ndsiCollection = l5.merge(l8)
  .filterBounds(region)
  .map(function (image) {
    return image
      .select([]).addBands( // Replace bands to keep properties
        image.normalizedDifference(['green', 'swir1'])
      )
      .updateMask(landsatMask(image))
      .rename('ndsi')
  })

var segmentCount = blist.arrayLength(0)
var time1 = toUnixMillis(segmentCount.subtract(2))
var time2 = toUnixMillis(segmentCount.subtract(1))

var ndsi1 = ndsiForTime(time1)
var ndsi2 = ndsiForTime(time2)

Map.centerObject(blist)


texts: QGIS : How to calculate centroid on polygons with holes

texts:
I try to compute the centroid of polygons with holes on qgis. I did not manage to do it directly, I had to make a conversion to convex hulls before extraction.

I crashed my pgsql server trying to extract theses using ST_Centroid()

Is there a better way to do it?


texts: How to differentiate between features and labels for select interaction and applying styles in OpenLayers?

texts:
I am using a style function to style a vector layer with text labels. For the text style I have set overflow to true so that labels can exceed the dimensions of a polygon.

I now want to use another style function when hovering the features to give them another style. Therefore I am using a select interaction with pointermove condition. Hovering and styling the features works like expected. The only major problem is that hovering the overlapping labels also triggers the interaction. This leads to ugly flickering because each time I hit a letter the style gets applied, each time I hit a blank between the letters, the style gets removed.

How can I differentiate between the actual features and the texts when hovering?


texts: Use Google 3D-buildings in Matlab's simulation

texts:
I am developing a MATLAB UAV toolbox simulation, and I would like to add realistic characteristics to it.
Is it possible to integrate a 3D view of buildings (Google Maps, Google Earth, or Google Earth Engine) into my simulation?
Example: Use Google Earth 3D-buildings' view and put a drone hovering over it. (including Google Earth Engine)


texts: ArcGIS API V 3.5 Navigation toolbar (zoomToPrevExtent) not working

texts:
I am just getting started with learning Dojo and ArcGIS API so please bear with me.

I have an existing prototype of an application that use ArcGIS version 3.5. I am looking at the navigation toolbar sample https://developers.arcgis.com/javascript/jssamples/toolbar_navigation.html and trying to get the Prev Extent and Next Extent functionality work in my application. This sample uses ArcGIS V 3.8. When I copy this sample code and run it locally it works. However since I use V3.5 I changed the below line in this sample and it stopped working.

<script src="http://js.arcgis.com/3.8/"></script>
<script src="//serverapi.arcgisonline.com/jsapi/arcgis/3.5"></script>

Is this feature only supported in V3.8? How do I get it work with V3.5?


texts: Creating Button Menu in ArcMap AddIn using ArcObjects?

texts: What is the code to use in config.esriaddinx in order to make a Button-Menu (like that illustrated below) when using ArcObjects?


texts: How to edit Python Add-In and get all changes to work?

texts: I have created an Add-In using Python. However, when I edit the Python script for that Add-In and re-create the '.esriaddin' file, I don't get updated results when using that Add-In. Do I need to re-create the Add-In each time when I edit my Python script to cater to changes?


texts: What bands should be used to identify clouds using the cloud function of the landsat package in LANDSAT 8 scenes?

texts:
I am trying to use the clouds function of the landsat r package to identify clouds in my LANDSAT 8 scene.

In the package help, it is said that reflectance bands 1 and 6 should be used:

  clouds(band1, band6, level = 0.0014, buffer=5)

where bands 1 and 6 are data frames.

I have done so, with the following code:

p198r054_sr<-stack("LC08_L1TP_198054_20140205_20170426_01_T1_sr_band1.tif",
                   "LC08_L1TP_198054_20140205_20170426_01_T1_sr_band2.tif",
                   "LC08_L1TP_198054_20140205_20170426_01_T1_sr_band3.tif",
                   "LC08_L1TP_198054_20140205_20170426_01_T1_sr_band4.tif",
                   "LC08_L1TP_198054_20140205_20170426_01_T1_sr_band5.tif",
                   "LC08_L1TP_198054_20140205_20170426_01_T1_sr_band6.tif",
                   "LC08_L1TP_198054_20140205_20170426_01_T1_sr_band7.tif")
p198r054_band1<-p198r054_sr$LC08_L1TP_198054_20140205_20170426_01_T1_sr_band1
p198r054_band6<-p198r054_sr$LC08_L1TP_198054_20140205_20170426_01_T1_sr_band6
p198r054_band1<-as.data.frame(p198r054_band1, row.names=NULL, optional=FALSE, xy=TRUE,
                              na.rm=FALSE, long=FALSE)
p198r054_band6<-as.data.frame(p198r054_band6, row.names=NULL, optional=FALSE, xy=TRUE,
                              na.rm=FALSE, long=FALSE)

Using my two bands gives me the following message (using default threshold):

p198r054_clouds<-clouds(p198r054_band1, p198r054_band6, buffer=5)

Error in x[(i - mwoffset):(i + mwoffset), (j - mwoffset):(j + mwoffset)] :
      subscript out of bounds

Could this error be due to the fact that I am using the wrong bands?
I don't know if the package was meant for LANDSAT 7 or 8 images?


texts: Accuracy error between Trimble RTK and Juniper Geode GPSS systems

texts:
I have set up a system for surveying points with a Juniper Geode GPSS because the survey team is too busy to do it themselves. There is a consistent shift to the northeast of the coordinates I am surveying with the GPSS vs what the surveyors got with their Trimble RTK system. The coordinates have good precision but a consistent problem with accuracy.

I am using an app called MapIt on Android to collect the coordinates. The coordinate system is NAD83 in UTM.

Is there a way to eliminate this consistent northeast shift? Is there a way to post process the data easily, or is there a coordinate system problem? I am not a surveyor so I've had trouble even setting the GPS up.


texts: Count the number of symbols in a 'new symbology' renderer from pyqgis

texts:
Background : I create a lot of symbology using 'saturation' ramps - for want of a better term, e.g. where the hue and value of each symbol stays the same, but the saturation changes. I couldn't figure out how to do this easily in qgis (EDIT: see comment - its easy when you know how), and each time I classify items, the colours reset to a colour ramp rather than a saturation ramp.

I figured this should be relatively easy to do using pyqgis, which it turns out has been, using this code (built for 5 symbols):

from PyQt4.QtGui import QColor              # import this namespace as I want to refer to QColor later
layer = qgis.utils.iface.activeLayer()
i = 0                                       # used to increment the saturation value
for sym in layer.rendererV2.symbols():      # loop through each symbol in the layer using 'new symbology'
    i += 50
    sym.setColor(QColor.fromHsv(40,i,255))

Problem: . The above code works fine, but is not dynamic, in that I've set it up to increase the saturation by 50 each time (giving 5 graduations between 0 and 255). I want to set the saturation to graduate dynamically based on the total number of symbols.

The mathematics of this are pretty straight-forward, but I'm not able to get the count from the symbols() method. I've tried:

>>> rendererV2.symbols().count()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: count() takes exactly one argument (0 given)

... which as you can see returns an error (although the QT documentation seems to list count() as a method of a QList<> object).

I've tried:

>>> rendererV2.symbols().count(QgsSymbol)
0

... which as you can see returns 0, which isn't true. There are 5 items in the list.

I'm sure I must be doing something daft, but being new to python, pyqgis and qt, it is beyond my ability to see what at present.

Help?


texts:
I have a raster list (21 in total) S1 that have the same projection, resolution but not exactly the same extent.

Due to this difference, I cannot stack them without solving the extent/dimensions issue. However, this would require the use of raster::resample and I want to avoid it due to the large processing time that it requires.

Those rasters cover my study area with a different extent and orientation (see image | gray area == study area)

My objective is to create a raster that covers the study area and where the pixel value is the maximum value of that pixel using as reference all the rasters of the raster list

Any experience with this? Is it mandatory to solve the extent issue and stack the rasters?


texts:
When I applied style rules to my "vector" layer,  OpenLayers.Control.SelectFeature  no longer shows the feature as selected. I have tried adding selection to the style:

var style = new OpenLayers.Style({"select":{fillColor: "#66ccff",strokeColor: "#3399ff"}});

The rule:

var zone1 = new OpenLayers.Rule(
                {
                filter: new OpenLayers.Filter.Comparison(
                {
                type: OpenLayers.Filter.Comparison.EQUAL_TO,
                 property: "zone",
                    value: "zone1",
                }),
                symbolizer: {pointRadius: 10, fillColor: "green", fillOpacity: 0.5, strokeColor: "black", label: "${zone}",labelOutlineColor: "black",labelOutlineWidth: 3, fontColor: "white",
            fontSize: "8"}
                });

Rule applied to the style:

style.addRules([zone1]);

The selection worked fine until I added the rules.

Any ideas?


texts: Convert annoatation leader lines to line feature class

texts: I have an annotation feature class many of which have leader lines associated with them. Is there a way to convert just the leaders into line features in a separate feature class? Using ArcMap 10.4.


texts: OpenLayers doesn't proxy WMS requests to Geoserver

texts:
I had an issue with WMS requests from OpenLayers to Geoserver via Proxy.php.
My OL version is 2.12 and my Geoserver is 2.4.0.
I set the variable OpenLayers.ProxyHost as shown in OL documentation, but the requests go directly to the remote IP not passing through Proxy.php.
I read on forums that OpenLayers WMS requests have this problem, and suggest to use this getURL class:

var proxyHost=OpenLayers.ProxyHost="proxy.php?url=";
var myWMS = OpenLayers.Class(OpenLayers.Layer.WMS, {

    getURL: function (bounds) {
        var url = OpenLayers.Layer.WMS.prototype.getURL.call(this, bounds);
        if (OpenLayers.ProxyHost && OpenLayers.String.startsWith(url, "http")) {
            url = OpenLayers.ProxyHost + encodeURIComponent(url);
        }
        return url;
    }
});

Are you aware of this? is it a bug of OpenLayers?
Does OL need a fix?


texts: How to convert KML to CSV or SHP using ArcMap 10?

texts:
I'm using ArcMap 10, I was wondering if there was a way to convert a .kml file into a .csv to check the attributes or a .shp to import it straight into ArcMap?

I've tried downloading various programmes to convert it but they either don't work properly or my university won't let me download them.

Here is the .kml file in question, any help would be much appreciated.


texts: QGIS 3.01 (Mac) Can not filter legend items in Atlas

texts:
I am not sure if this is a bug or if I have missed something that has changed in 3.0.  The issue is that in the composer/atlas when I display the item properties of the legend all of the 'tools' are greyed out:

I can't figure out how to remove irrelevant entries.


texts: Programmatically import new composer from template to project using PyQGIS

texts:
I am trying to find information about how to programmatically import new composer from template, but it is impossible.

There is a lot of information how to print the composer to image, but not save it in the project *.qgs.

Has anyone got any experience of loading new composer to project QGIS and open it from list "Print composers"?


texts: Strip map with horizontal labels in ArcGIS Pro

texts:
I've created a strip index page for my map series in ArcGIS Pro using the Generate Rectangles Along Lines tool. My problem is that the horizontal labels do not rotate with the map frame on the layout. The labels always point towards the north, even though the north is not directed towards the top of the layout. Is there a way to fix this?
Edit: I added an image to clarify the situation. On the layouts (shaped like the blocks) the blue line is horizontal, which is what I want. However, I want the labels to be displayed in the same direction.


texts: Saving layer files and ignoring special characters using ArcPy

texts:
I'm trying to save all layers in my ArcMap mxd as .lyr files using the script below. However, I'm getting an error because some group layer names contain special characters (e.g. © : * )  and cannot be written into folder names.

How can I make sure special characters are ignored/replaced?

import os
basepath = r'C:\Users\Anneka\Dropbox (The Rivers Trust)\CaBA_Data_Phase5\Layers'
mxd = arcpy.mapping.MapDocument("CURRENT")
for lyr in arcpy.mapping.ListLayers(mxd):
     if lyr.isGroupLayer == True:
          grpPath = os.path.join(basepath, str(lyr))
          if not os.path.exists(grpPath):
               os.makedirs(grpPath)
     else:
          fn = os.path.join(basepath, str(lyr) + ".lyr")
          lyr.saveACopy(fn)

The error:

Runtime error
Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "C:\Python27\ArcGIS10.6\Lib\os.py", line 157, in makedirs
    mkdir(name, mode)
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\Anneka\\Dropbox (The Rivers Trust)\\CaBA_Data_Phase5\\Layers\\Issues\\Rivers\\WFD Classification Sites 2016 (EA)*'


texts:
I am trying to make polygons from a set of boundaries from an SVG file with closed polylines I downloaded off wikipedia.

1) convert SVG to DXF via Inkscape
2) import into QGIS (shows polyline data)
3) Lines > Polygon

somehow the result seems to generate these bad polygons with defects - I attach a screenshot here

I tried re-exporting the file to DXF again, and putting it into a 3d CAD suite (rhino 5). I managed to join the lines without any changes. re-export to DXF, reimport into QGIS, remake polyllines and I get the same result

does anyone have any ideas?


texts: Is Hershbergers improved Ramer-Douglas-Peucker algorithim worth implementing?

texts:
Here is the article with code samples

Other than the C code he wrote are their any implementations? Is it worth making a python or R module out of the C code? Are their known flaws to the algorithm? Known improved implementations in C?


texts: Free aerial map images for commercial use - Alternatives to Google maps

texts:
we are developing a  web based GIS platform. We were planning to use Google maps' satellite view as BASE LAYER and serve WMS content through Geoserver as NON-BASE LAYERS. However since our application will also support premium content for registered users this violates Google's terms of use for the GoogleMaps API, and not only that..
It seems that it also violates Microsoft's Bing Maps and Nokia Maps ToU

particularly for the latter due to the following clause in its terms of use:

6.3 Use of the Service
When using the Service, unless otherwise agreed in writing with Nokia, You hereby agree that You will not:
vi) create an Application which displays any Content outside of the Service. For example, You may not use Content outside of the Nokia Maps service. You may not combine, mix or commingle any Content or Features with third party APIs, services or content similar to the Content or Features provided by the Service, for example with any third party map;

Since the area we will cover with our platform is relativelly small I was thinking to purchase georeferenced aerial images from a provider i.e. Terraserver and use them as a BASE LAYER, however
(a) the cost - although considerably less to licensing - is still a barrier  and
(b) implementation complexity is increased,

Any recommendations or ideas on other options? All thoughts are welcomed and appreciated,


texts: Using ArcMap 10.6 with the Basic license, I need to split our district boundary into two sections. The west side needs to be 56% of the area, while the east side is 44% of the area. Also, our district has exclaves inside that are not part of the district boundary polygon. I believe there would be a tool for this task but I am unsure of what it may be.


texts:
I have a requirement where I need to convert a set of Geohash to KML files such that they can be used as areas to plot data by overlaying on map.

Is anyone aware of an open resource which can help me with this conversion.


texts:
Is there a possibility to do "Map.addLayer" so the image is not already displayed in the output but can be loaded in via check mark in the layer dropdown?

(I would like to do the reverse of the default "Map.addLayer"..... visual go through multiple images, by default, all with Map.addLayer are displayed and I wondered if there is a better way, then manually disable each Layer in the Output by clicking away the check mark).


texts:
I applied the cloud masking on Sentinel 2 imagery in GEE. The original image collection without masking clouds is this:

First I tried the script exactly as written at the bottom of this page Sentinel-2 MSI: MultiSpectral Instrument, Level-2A
and I got this result:

I saw other tutorials that other people use median,  so the second time I deleted 'mean' in the last line here:
Map.addLayer(dataset.mean(), visualization, 'RGB');

Instead I added 'median' in the image collection variable:
 .map(maskS2clouds)
 .median();

And this is the result:

I realized median () produces much clearer image, however I am not sure about differences between median () and meanand since mean was used in the GEE website, I do not know if I am doing right by using median and having such a clear image!


texts: Advise with 'Integrate' tool in ArcToolbox

texts:
Im looking for advises on the usage of this tool or some other that may help on my challenge.
So i have 2 road layers i need to conflate and find the mismathed ones.
My question with integrate tool is it possible to avoid any move from the master layer (the one with higher rank 1 ) in documentation it says:

"Note that features in the feature class with a rank of 1 may move when a large x,y tolerance is used.XY Tolerance (optional)
The distance that determines the range in which feature vertices are made coincident. To minimize undesired movement of vertices, the x,y tolerance should be fairly small. If no value is specified, the xy tolerance from the first dataset in the list of inputs will be used.
"

Many thanks
Jorge


texts: referencing to features geometry in an expression

texts:
I have a layerA with roads and a layerB with one shortest path.

If I put an aggregate function into a virtual field in layerB to calculate the sum of fieldAA where the shortest path contains features of layerA, it returns the sum of every feature in layerA.

I tried different expression and they returned all the same result (sum of every feature):

aggregate( 'layerA', 'sum', "fieldAA", contains($geometry, $geometry))

aggregate( 'layerA', 'sum', "fieldAA", contains(geometry($currentfeature), $geometry))

aggregate( 'layerA', 'sum', "fieldAA", within($geometry, geometry($currentfeature)))

In the documentation you find

So I was wondering to which geometry they both refer to and how I can perform an expression like contains(geometry currentfeature layerA, geometry features layerB)

Suggestions on how to get the same result with a custom pythoncode in the function editor are also welcome.


texts: Perform raster calculation with logical operators in Python with GDAL?

texts:
I would like to perform raster calculation with logical operators but I get this error. How can I fix this issue? In QGIS raster calculator this is the statement: ( "cloud_mask_prefire@1" > 0 OR "cloud_mask_postfire@1" > 0 OR ( ( "Band 3 (GREEN) pre-fire@1" - "Band 8 (NIR) pre-fire@1" ) / ( "Band 3 (GREEN) pre-fire@1" + "Band 8 (NIR) pre-fire@1" ) ) >= 0.0 )

water_cloud_mask = np.logical_or(cloud_mask_prefire_Data>0, cloud_mask_postfire_Data>0, ((B3_prefire_Data-B8_prefire_Data)/(B3_prefire_Data+B8_prefire_Data))>0.0)

Error:

C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:3: RuntimeWarning: invalid value encountered in greater This is separate from the ipykernel package so we can avoid doing imports until


texts: How do I limit the number of labels for similar objects in QGIS?

texts:
I'd like to reduce the clutter in this map by limiting the spacing or number of times that a particular label can appear. For example, the label 'US 15' should not appear within some set distance another 'US 15' label.
I know why there are so many: QGIS is labeling every feature. I just don't know how to limit it.


texts: Prevent formatting of label text in OpenLayers

texts:
I have a vector layer in OpenLayers containing a few point features. Each of my features have an attribute tag which contains a short text identifying the feature.

Example:

  tag: '1e-1'

Applied to my vector layer I have a point style where I specify that I want to display my tag as a label above the point:

...
new OpenLayers.Rule(
{
    symbolizer: {
        "Point": {
            label: "${tag}"
        }
    }
})
...

The problem:
My problem is that my data in this case has some very unfortunate tags, since

  '1e-1'

is treated mathematically and displayed on the map as

  '0.1'

Question:
Can I avoid the formatting somehow without overriding a bunch of OpenLayers objects and methods?


texts: Converting between coordinate system types

texts:
I have made it work by using dots instead of commas, and later change the CRS for the coordinates.

I am having problems converting the coordinate type: ETRS89 to WGS84.

I am unable to load my coordinates into QGIS 3. My data is simply 2 columns in excel, one column being x-coordinates and the other being y-coordinates, and it looks like so:

I have copied it into the notepad, which is how i try to load it (which worked previously for another coordinate system type), and it looks like so when copied:

It does not work when i upload it with settings as below:

Instead of getting a layer in qgis, i get a table, depicted below:

Does anyone know how to upload ETRS89 datapoints directly, or how to convert them?

Examples of x and y coordinates for ETRS89 are:

x:5,14858806438, y:55,2493152696999


texts: Error message when trying to create a new layer using the Spatial Query tool

texts: Simply trying to create a new layer where points (which represent tick occurrence) are contained within a UK boundary shapefile as opposed to working with points for the whole of Europe. When I try and do this I get the following error message:


texts: Difference between UTM GDA94 and GDA94/MGA zone 56

texts:
I was wondering if anyone would be able to tell me the difference between UTM UPS GDA94 (set on my GPS) and GDA94/MGA zone 56, the nearest equivalent I can find in ArcGIS (under Projected Coordinate Systems - National Grid - Australia).

When I import GPS coordinates (UTM UPS GDA94) into ArcGIS in an excel file and onto a GCS GDA94 dataframe, I set the projection to GDA94/MGA zone 56, and they appear in the correct place on the map.

I'm still coming to terms with different coordinate systems.


texts: Retrieving Layer Files From Map Packages

texts:
I am using ArcMap 10.5.
I have around 57 map packages that I need to salvage layer data from.  The layer files were incorrectly saved with absolute paths instead of relative paths so they won't display unless they are opened in the map package.  I want to get rid of the map packages because they take up a lot of time and server space.
My goal is to somehow retrieve these layer files and save them to a server where they can be accessed easier.  Exporting them isn't an option because I need to keep them in a layer file format to preserve aspects of the data. Opening the map package and trying to save them out as layer files again dosen't seem to work either, the layer files seem stuck looking back at the original creator's C: drive.


texts: Raster Calculator with conditional arguments?

texts:
I am trying to create a binary raster using the Raster Calculator in ArcGIS 10.2. I have a raster with ~20 different values, but I'm only interested in cells where the value = 10. I've been using the conditional argument, but I think there might be a problem with my variables having text associated with them; I keep getting "Error 000539: Runtime error Syntax Error: Keyword can't be an expression."

I've used the following:
Con("InputRaster" = 10, 1, 0)

This didn't specify where the variable values were, so I tried:
Con("InputRaster", "Value" = 10, 1, 0)

And then I tried enclosing the argument:
Con("InputRaster", '"Value" = 10', 1, 0)

In all instances, I received the exact same error message. In the "value" column in my attribute table, only numbers are listed, not text, so there shouldn't be an issue with non-numeric values. The associated text only appears in the table of contents, next to the numeric value.

Any thoughts on how to fix my equation?


texts: "Out of Memory" error using Network Analyst

texts:
I get an "Out of memory" error when running a closest facility analysis on a fairly large public transport network dataset using network analyst ArcGIS 10.2, even when the process is only utilizing about 3.1gb out of my 8gb memory computer.

Any idea on why this error comes up, and what can be done to fix this?


texts: Saving of multi-polygon shapefile into a individual polygon shapefiles

texts:
How to separate a multi-polygon shapefile into individual polygons (as separate shapefiles)? I had huge data...
I know the traditional process like export data...

Please help me...


texts: Displaying buildings where tallest building on block is above certain height?

texts:
I'm trying to figure out how to use the WHERE function to display only polygons (NYC properties, I'm using the PLUTO land use database) where the height (numfloors) of the tallest building on the block (there's a block column with a unique identifier for each block) is six stories or higher. I assume this is achieved using some nested combination of max, joins, etc., but I can't quite figure it out.

Any help?

SELECT * FROM qnmappluto
WHERE ...???

I'm using MapPLUTO, not straight PLUTO. My problem isn't getting the polygons to display.

I'm not trying to display all buildings where NumFloors >= 6. Rather, I'm trying to display all buildings where the tallest building on the same block is six stories or greater – as in, where the max NumFloors value of all buildings that share the same entry in the Block column is greater than or equal to six.


texts: Shrink polygon on a particular side using Python

texts:
I have a polygon geometry (with vertices 1,2,3,4) as shown in the figure below. Now my requirement is that I want to get this polygon shrink/compress to a new polygon (having vertices 1',2',3',4') as shown in the figure below.
(Note vertex 1 = 1' & vertex 2 = 2' in both existing polygon and desired polygon)
My existing polygon (with vertices 1,2,3,4) is having UTM projection.
The figure is as follows:

How can I achieve this programmatically using Python?
Found the solution (coordinates of (x1,y1) & (x2,y2)) using trignometric equations followed by using the concepts of corresponding angles of parallel lines. Please see the below figure:


texts: I've just installed a local Open Street Map server. Is there a simple desktop client (win or linux), which can connect to local OSM server?


texts: What is the relationship between ArcMap scale and JPEG width/height?

texts:
Basically I want to automate exporting maps from a data view as a 1200x1200 JPEG where the selected feature (one polygon each time) has to be within the inner square and at least one vertex touches the inner gridline (say the square is a size of 1000x1000).

So I want to ask about the relationship between map scale and JPEG width/height so that I can try to calculate the map scale to export and fit in the square.


texts:
My Python toolbox uses a function (code below) to save values to a CSV file. When I was using the same code in a Jupyter notebook, saved records were properly encoded (I am dealing with Polish letters like ć,ą,ę), but when I run my code in ArcGIS Pro as a toolbox script I got results such as BiaĹ‚ostocka instead of Białostocka saved in the CSV.

I tried adding:

# -*- coding: utf-8 -*-

But without any positive results.

Code for function below:

def zapis_do_csv(
        lista_1, lista_2, nazwa_1,
        nazwa_2, csv_name, katalog,
        czesc_nazwy):

raw_data = {nazwa_1: lista_1,
            nazwa_2: lista_2}
df = pd.DataFrame(raw_data, columns=[nazwa_1, nazwa_2])
df.to_csv('{0}\{1}_{2}.csv'.format(katalog, czesc_nazwy, csv_name), index=False, header=True)


texts: Count overlapping polygons, including duplicates

texts:
I am using ArcMap 10.2.2 (Advanced license, no toolbar add ons/no spatial analyst) on a Windows 7 computer (i7 processor, 8GB RAM). I have used ArcMap for other basic analyses and have only very basic coding skills.

I am trying to count overlapping polygons where some of the polygons have identical geometry.  My end goal is to create a map counting overlapping polygons, along the lines of this or this.

Normally I'd follow the "spaghetti and meatballs" protocol for counting overlapping polygons, which requires using the feature-to-polygon tool or running a union as the first step to chop up the polygons into all their pieces.

However, neither feature-to-polygon or union are working, presumably because of the identical polygons--I get "Invalid Topology [Duplicate Segment]" (I repaired the geometry, just in case, too).

I could delete the geometrically identical polygons but the identical polygons are important--where two identical polygons are, I'd like the count to be 2 (+any other polygons they overlap).  Some polygons have up to four identical duplicates (so five identical-geometry polygons).

This is because I'm trying to map the number of pathogens found in any one place (assigning pathogens geographic ranges based on the species that carry them) and if one species carries multiple pathogens, I want that reflected on the map.

Because of this, I don't want to just identify duplicates or delete duplicates using the Find Identical or Find Duplicate tools, which are the options I found when searching this forum.

Besides manually going in and trying to slightly edit the geometry of all the identical polygons, does anyone know a way to count overlapping polygons, when some of those polygons have identical geometry?

I could try to assign those polygons a value of 2 (or more) based on how many duplicates they have, but I'm not sure how to keep that value associated with the polygons when running the feature-to-polygon tool.

To better describe what I'm trying to do, here's a small subset of my data:

^Rickettsia (small green dots, hard to see without clicking to view the image larger) and Metagonimiasis (blue blobs/"glacier") have exactly the same ranges, whereas Lyme (light yellow) and Toxoplasmosis (angled lines) overlap these polygons but have different geometry.

Since I'm trying to determine disease hot spots, it's important to double count the duplicate geometry polygons, since they represent different pathogens.

Here's the data I'm currently working with, if it would be of use to anyone.  It's in a file geodatabase, if that's important.  It's the first of several that I'm trying to do.

Edit: I slightly changed the geometry of a couple polygons (edited a single vertex on each) in a subset of the data which made each polygon's geometry unique and I still got the same error when running Feature to Polygon ("Invalid Topology [Duplicate Segment]"), possibly because I didn't edit every segment of the polygon?  But if I have to edit each duplicate polygon that much, then the resulting map would be inaccurate (and editing each segment would take a long time!).

Edit2: Tried doing a spatial join of the data to itself, following FelixIP's suggestion/answer and GIS encounters a background processing error, each of the ~10 times I've tried it.  Additionally, exporting the files out of the file geodatabase and trying again does not seem to fix this.


texts: ogr2ogr -sql command when appending to PostgreSQL database: what functions are available?

texts:
I am trying to append a set of polygons from a shapefile to an existing table in a PostgreSQL/PostGIS database. The destination table only has a geography column and an 'attributes' column with jsonb data type, in which I would like to store all outstanding fields of the shapefile as a JSON. I am attempting something like this:

ogr2ogr -f PostgreSQL PG:dbname=destination_db   input_polygons.shp \
        -nln destination_table  -update  -append  -t_srs "EPSG:4326" \
        -sql "SELECT *, row_to_json(input_polygons) as attributes from input_polygons"

and am getting:

ERROR 1: Undefined function 'row_to_json' used.

Should I assume that row_to_json() is not usable within the scope of the ogr2ogr -sql command? From the documentation files here and here, my understanding is that the -sql command passes SQL statements directly to PostgreSQL, and that "anything possible in SQL can then be accomplished".


texts: Problems with constructing a polygon in ArcGIS 10.4.1

texts:
Background - I am drawing polygons of counties over a 17th century map that I have georeferenced. I have a number of issues with this version of GIS which I haven't experienced with past versions.
When I try to draw a polygon the shape keeps closing after 3 vertexes have been applied. The only way I have found to get round this is to draw a square of vertexes over the whole county and then keep adding vertexes to draw in the polygon which is very time-consuming.


texts: Lowering Raster (elevation map) by shape ile (roads)

texts:
I have a raster layer that I want to carve (CNC) roads onto. I have a shapefile of the roads.
I used Serval Plugin for the lake to lower it so I could put epoxy into it, but the roads are not all one elevation so the serval won't work.


texts: Project do not open anymore because of a minidump

texts:
I have closed my project two days ago and this message appeared : minidump déposé dans C:\Users\wwf-adm\AppData\Local\Temp\qgis-20150903-171144-3780-1392-8fdd08a.dmp
When I try to open my project, I have this message : Erreur de lecture du fichier de projet : unexpected end of file à la ligne 1 et colonne 1 pour le fichier D:/French Guiana/Projets SIG/zcb_terre_3.qgs
And when I close the message, there is nothing into my project, completely empty.

I do not know how to continue to work on my project !


texts: Python, GDAL2 translate and MbTiles options

texts:
I try to apply this answer :

Choose what zoomlevel to read from for mbtiles file in GDAL

to a gdal call from python (witout using os.system() / subprocess.call() ) but i can't find how i should add the "-oo ZOOM_LEVEL=12" GDAL Parameter to my code :

ds = gdal.Open('c:\data.mbtiles')
ds = gdal.Translate('c:\data.png', ds, format="PNG")

any advices ?


texts: Joining feature classes defined in list to dbf tables which defined in another list using ArcPy?

texts:
I am trying to join feature classes in a list to tables in another list using a join field which is the same for all joins. In general terms, I want to join the first feature class in the list to the first dbf table in the list, the second feature class to the second table, an so forth. Here are two codes I have written and I get error messages for both.

import arcpy
>>> arcpy.env.workspace= c:/Users/Administrator/Documents/ArcGIS/NewFileGeodatabase.gdb"
#Trial 1
>>> fclist2= arcpy.ListFeatureClasses("D*", "point", "")

>>> tablesmplg= arcpy.ListTables("", "")

>>> for table in tablesmplg:
...     for fc in fclist2:
...         arcpy.JoinField_management(table, "NEAR_FID", fc, "OBJECTID", "")
...

Runtime error  Traceback (most recent call last):   File "<string>", line 3, in <module>   File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\management.py", line 6597, in JoinField     raise e ExecuteError: ERROR 000499: table is not editable Failed to execute (JoinField).

Trial 2

>>> in_data= arcpy.ListTables("", "")

>>> in_field= "NEAR_FID"

>>> join_table= arcpy.ListFeatureClasses("D*", "point", "")

>>> join_field="OBJECTID"

>>> for table in in_data:
...     for fc in join_table:
...         arcpy.JoinField_management(in_data, in_field, join_table, join_field, "")
...
Runtime error
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\management.py", line 6597, in JoinField
    raise e
RuntimeError: Object: Error in executing tool


texts:
I have a shapefile which is a district map. There are close to 800 districts. There are around 30 funding agencies. There are four different health programs. The different funding agencies fund specific amounts for different programs in different districts. I have an Excel sheet which has this four column information vs. District name, Funding Agency, Program name and the fund given.

I want to display this on a shapefile, this is available and I am able to display the shapefile with district separations. How do I use this data and pose specific queries like which funding agency has provided in which districts and any such different combinations?

This may be construed as an SQL query and any responses should be made use for displaying on top of the district map regions or to show as a pop up window. To display with different shaded regions on the map is better.

Do I have to use a separate database for exporting this kind of data or QGIS has its own database where I can export this file and start using data from it?
How can we compose the SQL query for the different queries that may be posed?
How do I display this resultant query on top of the shapefile or display as pop up on top of the shapefile? Can this be called as Metadata?

Can someone help me on this lengthy question and not sure if this is a trivial requirement someone has already implemented on QGIS.


texts: Get the date a feature class was last modified using SQL?

texts:
I have an oracle database that contains versioned and non versioned feature classes.
Each feature class has editor tracking enabled, so when a feature is added or updated, I can see the date the change occurred, and from that can calculate the maxdate of that featureclass to get when it was last "modified".
However if a feature is deleted that information is not captured within the featureclass (therefore the last modified date will be incorrect). I know that if it is versioned the OBJECTID is captured in the deletes table, but there is no date field (that i am aware of).
Is there a SQL way of getting the last modified date of a feature class, whether it is versioned or non versioned and regardless of whether it is an insert, update or delete.


texts: Openlayers4 ol.layer.Group only gets first item

texts:
I am trying to change the opacity of vector layers using one slider but I seem not to get the right logic to loop each item as opposed to just the first. Here is my code so far. Link to full code

This is where I guess I have the particular issue.

map.getLayers().forEach(function(layer, i) {
      bindInputs('#layer' + i, layer);
      if (layer instanceof ol.layer.Group) {
        layer.getLayers().forEach(function(sublayer, j) {
          bindInputs('#layer' + (i) + (j), sublayer);
        });
      }
    });


texts: Selecting attributes with query in ArcObjects?

texts:
I have a Street_Light shapefile. It contains a field (POLE_TYPE).

POLE_TYPE can only have two values: "concrete" or "iron"

I am trying to select POLE_TYPE=iron.

When I tried manually by selecting by attributes, it showed 454 features but when my code run it selects only one feature.

Where did I go wrong?

Here is my code:

ESRI.ArcGIS.ArcMapUI.IMxDocument mxd = ArcMap.Application.Document as ESRI.ArcGIS.ArcMapUI.IMxDocument;
ESRI.ArcGIS.Carto.IMap map = mxd.FocusMap;
for (int i = 0; i < map.LayerCount; i++)
{
    ESRI.ArcGIS.Carto.ILayer lay = map.Layer[i];
    if (map.Layer[i].Name == "Street_Light")
    {
        ESRI.ArcGIS.Carto.IFeatureLayer flay = lay as ESRI.ArcGIS.Carto.IFeatureLayer;
        ESRI.ArcGIS.Carto.IFeatureSelection fsel = flay as ESRI.ArcGIS.Carto.IFeatureSelection;

        ESRI.ArcGIS.Geodatabase.IQueryFilter qfltr = new ESRI.ArcGIS.Geodatabase.QueryFilterClass();
        qfltr.WhereClause = "POLE_TYPE ='IRON'";
        ESRI.ArcGIS.Geodatabase.IFeatureCursor cur = flay.Search(qfltr, true);
        ESRI.ArcGIS.Geodatabase.IFeature fea = cur.NextFeature();
        while (fea != null)
        {
            fsel.SelectFeatures(qfltr, ESRI.ArcGIS.Carto.esriSelectionResultEnum.esriSelectionResultAdd, true);
            fea = cur.NextFeature();
        }
        mxd.ActiveView.Refresh();
    }
}


texts: How to populate the geometry column in a PostGIS table?

texts:
After loading a polygon shapefile into PostGIS, the geometry column (geom) is blank for several features. In one case, only a single feature has the geometry calculated and all others are blank.
I'm using the PostGIS SHP and DBF loader v.2.0. I am creating a spatial index, and using COPY rather than INSERT.
I have loaded several other point datasets and they geom column is populated just fine...
(Otherwise, things are working just fine for the polygons: when I create a new feature, the geometry is calculated / geom field populated...etc.)
Have I done something wrong when importing the data?

Solution by @ThomasG77 (in comments)
PgAdmin3 [doesn't] display features that are too complex but they are present.  You can try SELECT length(ST_astext(the_geom)) from your_table to confirm or you can find "true" empty geometry with SELECT * from your_table WHERE the_geom IS NULL;.


texts: gdal2tiles has no attribute 'generate_tiles'

texts:
I created a new conda environment with python version 3.7
Then installed
conda install -c conda-forge gdal=2.4

Then installed gdal2tiles
pip install gdal2tiles

and then python test.py
#test.py
import gdal2tiles
gdal2tiles.generate_tiles('xyz.tif', 'output_dir')

but I am getting an error
AttributeError: module 'gdal2tiles' has no attribute 'generate_tiles'

It's the same method that I copied from the documentation but doesn't seem to work. https://pypi.org/project/gdal2tiles/


texts: How to sync a FeatureTable with a FeatureLayer's selection set?

texts:
The ArcGIS Server JS API contains a new FeatureTable class, which shows the attribute table corresponding to a FeatureLayer. There is an option syncSelection which:

  Enables an interaction between the map and the feature table. Setting
  this property to true allows selection of a feature on a map via
  clicking row in the table, and selection of a table's row via clicking
  a feature on the map

However, this doesn't seem to honour a selection set made programatically against the layer.

Taking the sample at https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=featuretable, if I apply a selection to the FeatureLayer it is not reflected in the FeatureTable:

// Create the feature layer
myFeatureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Warren_College_Trees/FeatureServer/0", {
  mode: FeatureLayer.MODE_SELECTION,
  visible: true,
  outFields: ["*"],
  id: "fLayer"
});
var myQuery = new Query();
myQuery.where = "Spp_Code ='SABA'";
myFeatureLayer.selectFeatures(myQuery,FeatureLayer.SELECTION_NEW)

This correctly applies the selection to the feature layer (note that the map only contains one point), but not to the feature table (it lists all 1146 points with 0 selected):

Is there a way to refresh the feature table to reflect the selection set?


texts: Optimizing PostGIS query on table using buffered point

texts:
I have a global dataset of ecoregion boundaires. There are ~809 unique polygons in this dataset. I've imported it into PostGIS with SRS of 4326 and built a spatial index using the function below

CREATE INDEX ecoregionsindex ON ecoregions USING gist(geom);

Querying with a point takes ~150ms to run

SELECT id FROM "ecoregions"
WHERE ST_Within (ST_PointFromText('POINT(-111 45)', 4326), geom);

Buffering ~20,000m around this point using the ST_DWithin() method takes about 15,000ms to run.

SELECT id
FROM "ecoregions"
WHERE ST_DWithin(ecoregions.geom, ST_MakePoint(-111,45)::geography,
20000);

Is there a way to optimize my data or the query above to run more quickly?


texts: post instlacion ArcSde 10 "error creating Arcsde direct Connection (-9)

texts:
I installed SQL sever 2008'm doing the post installation used ArcSDE 10

these are the steps I am doing in post installation of ArcSDE 10

complete installation.
SDE Schema.
put the name of my server and I connect using windows authentication.
put a new password and name of the database "I get message that the database and the password was created successfully" give ok.
in the configuration file will leave the default I give next.
in the repository setup option I put the name of my instance name of the database you just created together with the password I set when I made the database.

then I get an error message

  connection to "name my base" failed (0) esri server setup utility
  arcsde date and time
  -------------------------------------------------- ---------------- Error creating arcsde direct connection (-9)

could someone tell me I'm doing wrong or that I need


texts: Showing nearest feature side to side in ArcMap?

texts:
I have 2 polygons and I would like to know which side of these polygons is the nearest from each other, probably by pointing out through a new created shapefiles from the analysis.

Is there any tools possible for that in ArcGIS Desktop?

This is the visual representation:


texts: Syntax to use when entering geographic data into geography columns via SQLSERVER Management Studio

texts: I am starting to learn about spatially aware databases.  I have QGIS 2.61 and SQLserver express 2012.  I can set up a table using the  SQL Server Management studio GUI and insert a geography column.  What syntax should I use when entering data into that column to store, for instance, the coordinates for a polygon or linestring etc.  Try as I might I cannot find an answer other than using Transact SQL which is not what I want to do.


texts:
I have created a JSON file which includes 30 map service layers and their attributes. This includes the map service url. My function creates a table of contents from the JSON object so that when I click on a ToC value it returns the map service owner, name and service url. Using the url how can I add the service layer to my basemap??

So far the code to return the layer info is as follows:

 $(document).ready(function () {
    for (index in jsonString.Land) {
        $('#land ul').append('
' + jsonString.Land[index].name + '
');

    }
            for (index in jsonString.Air) {
        $('#air ul').append('
' + jsonString.Air[index].name + '
');

    }
    for (index in jsonString.Water) {
        $('#water ul').append('
' + jsonString.Water[index].name + '
');

    }
    for (index in jsonString.Heritage) {
        $('#heritage ul').append('
' + jsonString.Heritage[index].name + '
');
    }
    for (index in jsonString.Waste) {
        $('#waste ul').append('
' + jsonString.Waste[index].name + '
');
    }

    $('a').on('click', function () {
        $('#show').html($(this).attr('data-owner') + '
' + $(this).attr('data-url'));
    });
});

I've searched online for an example and having had a look at the Javascript api fro ArcGIS I'm still failing.


texts: What's the difference between EPSG:4326 and EPSG:900913?

texts:
I am a bit confused on EPSG:4326 and EPSG:900913. I thought that they were both same. Though as I am placing my features over GMaps, which is EPSG:4326, I need to define the srsname of the WFS layer as EPSG:900913 to get it into the right place. If I define srsname as 4326 it is projected somewhere completely wrong.

Could someone explain it a bit more in detail as to what is wrong here?


texts:
I am rather new at GIS and I would like to have some guidance on what follows.

I have some DEMs derived from LiDAR data. These DEMs contain building and other human features (e.g., roads).
I was wondering what the (negative?) consequence would be if contour lines are extracted from these DEMs. In other words, how the presence of human features will affect the calculated z.values (i.e., elevations.).

The DEMs I got have the horizontal resolution of 1 meter. The program I am working with is ArcGIS, and I am a bit familiar with QGis as well.


texts:
I am trying to figure out how to combine two adjacent rasters into one raster using ArcMap 9.3.1.  The problem I am having is that there appears to be a gap in the data. I would like to be able to combine the rasters and/or contour data created from the raster datasets into one so that I can get rid of the gap in information. I am eventually going to do a watershed analysis, so I am seeing the gap in information as a problem.

I'd post a screenshot but I don't have enough reputation points yet.


texts: Inverse distance weighting variable search radius based on third variable

texts:
I am trying to perform inverse distance weighting (and possibly kriging), but want to base the search radius on a third variable:

high population density -> small search radius
low population density -> big search radius

I have been looking at various examples in ArcGIS, R's gstat and Python, but cannot seem to find a solution. In all solution, I can only vary the search radius based on the number of points found.

In order or preference, I am looking for a solution in Python, R or ArcGIS. Any help?


texts: Leaflet control to display scale in native/declared CRS (i.e. degrees)

texts: I'd like to have a Leaflet map display the scale of a layer in native coordinates (i.e. degrees in EPSG:4326). From what I have read so far the map control always handles meters; is there a way to change its behavior to show native CRS units?


texts: World Shapefile country borders and the bordesr of big cities or regions

texts: Searching for a World Shapefile where you can see the country borders and the borders of big cities or regions.


texts: Correctly updating stand-alone QGIS install on Windows?

texts:
I want to update QGIS 2.14.6 to 2.14.12 in Windows.

Aims:

Receive all projects
Receive all additional third party plugins

My plan at the moment is:

Copy folder "plugins" within .qgis/python
Delete folder .qgis
Delete QGIS 2.14.6 and their desktop assignments
Install 2.14.12
Paste folder "plugins"

Question:

Is anything wrong in 1-5, if yes: What?
Any other points that need to be considered?


texts: Python, creating layers and rasterizing polygons in GDAL

texts:
Trying to figure out how to rasterize in GDAL.

I have two problems (see example code below):

1) Even creating the raster layer with the gdal.GDT_Float32 type option, the resulting layer ('s bands) all end up being integer

2) In spite all efforts regarding noData setting, cells outside the polyons end up being set to zero.

# Create the destination data source
tempSource = rasterDriver.Create(tempRasterPath + tileName + "_Building.tif", tileHdl.RasterXSize, tileHdl.RasterYSize, gdal.GDT_Float32)
tempSource.SetGeoTransform(tileGeoTransformationParams)
tempTile = tempSource.GetRasterBand(1)
tempTile.SetNoDataValue(-999)
tempTile.Fill(-999)

# Rasterize
gdal.RasterizeLayer(tempSource, [1], buildingPolys.layer, options=["ATTRIBUTE=%s" % meanZAttributeName])
tempSource = None


texts: Error trying to call for raster file in gdb RasterToPolygon

texts:
I'm trying to convert raster to polygon. But I'm running into error.

ERROR 000865: Input raster: C:/Juivy//python/python.gdb/test does not exist..

This is what I wrote:

import arcpy
workspace = "C:/Juivy/python/python.gdb"
fc = "test"
output = fc + "_" + "convert.shp"
input = workspace +"/"+ fc
arcpy.RasterToPolygon_conversion(input,output,"NO_SIMPLIFY","VALUE")


texts: Masking casing/outline of line feature (road) within ArcMap?

texts: I need to mask just the black outline/casing of road features in my map. Here is an example below. I do not want to mask the entire road as seen here but instead just the black lines on each side of the road. Also, these road features are a representation file, and I would like to keep them in representation. I know an easy workaround outside of representation files but that is not what I wish to do.


texts:
I am trying to create new symbols for our Stormwater Stream Restoration dept.. Utilizing some of the ESRI came symbols, I have adjusted their size and color and added them to the map. When I click the Rotate tool, it shows the feature rotating in the preview as I turn it, but when I let go of the mouse, the screen blinks, but the symbol never rotated. Also, when I'm in Symbology/Advance/Rotation, the only options in the drop down are: *None, Random, and expression.
Btw... I don't know how to code or write any scripts yet.

Thanks


texts: How to load OSM data into PostGIS preserving all Tags?

texts: I am new to the field of GIS and am trying to view source tags in OSM. I have downloaded the shapefiles from http://downloads.cloudmade.com and have loaded them into Postgres. When I view the data, I am unable to see any tagging data. Should I be following a different process or using shapefiles at all?


texts: Digital elevation model - getting files in the .DEM extension

texts:
Could you tell me from where can I get the Digital Elevation Model data in the .DEM file extension?
The option for QGIS here:
https://www.qgistutorials.com/en/docs/working_with_terrain.html
shows the USGS way, but there is an option for GeoTIFF only.
For my purpose (terrain analysis in the Kasmir 3D software I need it in the .DEM version.

All links provided there are inactive, which is out of wonders since the data comes from 2004 year.

Could anyone share some hints?


texts: ST_ClosestPoint() moves all points to one line instead of closest line

texts:
I have a line network and I've created evenly-spaced points along those lines. The problem is that the points are not exactly on the line so subsequent overlay operations will not work as expected. I've tried to move the points to the nearest place on the lines, but the result is that I end up moving ALL the points in the table to only one line, and it is not the nearest line to most of the points. I have a couple different queries with the same result. Here is one sample:

SELECT pt.id, ST_ClosestPoint(a.geom, pt.geom) geom
FROM pt, (
SELECT line.geom
FROM line, pt
ORDER BY line.geom <-> pt.geom
LIMIT 1) a

Anyone know why my points are being moved to one (often far-away) line, instead of the closest lines?


texts: QGIS (2.4) keeps caching old Python code

texts:
I'm fiddling around with a piece of python code to use with form validation. It works fine, but the real problem is that QGIS refuses to acknowledge the changes I make in the script.

Here's what I did:

created the .py
referenced it in "layer Properties - Fields - Python init function"
it works as expected, popping up the message box saying CHEESE
now I open the py file in an editor, and change the message to MOUSE and save/close the editor
QGIS now still says CHEESE. I either have to restart QGIS or rename the file and reference it again, which is obviously a massive waste of time.

How can this be fixed?

Code:

from PyQt4.QtCore import *
from PyQt4.QtGui import *

nameField = None
myDialog = None
def formOpen(dialog,layerid,featureid):
    global myDialog
    myDialog = dialog
    global nameField
    nameField = dialog.findChild(QLineEdit,"Name")
    buttonBox = dialog.findChild(QDialogButtonBox,"buttonBox")

    # Disconnect the signal that QGIS has wired up for the dialog to the button box.
    buttonBox.accepted.disconnect(myDialog.accept)

    # Wire up our own signals.
    buttonBox.accepted.connect(validate)
    buttonBox.rejected.connect(myDialog.reject)

def validate():
  # Make sure that the name field isn't empty.
    msgBox = QMessageBox()
    msgBox.setText("MOUSE")
    msgBox.exec_()


texts:
I can not understand why Web Mercator projection is strictly square.

In my mention:

We have a planet as a sphere.
We have 360 degrees of longitude and only 180 degrees of latitude.
That means if we measure equator it gives us 360n, and if we measure meridian from pole to pole, it gives us 180n.

Additionally WM projection does not project 80-90 latitude. This means we have linear size about 360n x 160n.

The planet as an ellipsoid is nearly spherical. The diameter in equator section is not 2 times larger than diameter between poles, the ratio De/Dp is about 1.1, not 2x...

This means if we project 360nx160n to a square, the scale of one side will be >2 times bigger.

But WM is equiangular (conformal) projection, this means that scales should be equal, or nearly equal due to some features of projection, but not 2x times.


texts: Building maps - when to embed in tiles versus implement in leaflet

texts:
I'm wondering if there are any principles or rules for when to "bake" geographic features into map tiles (e.g. using Mapbox Studio) versus when to "draw" them on dynamically (e.g. using Leaflet.js).

I'm not experienced with GIS or maps, but I do want to build beautiful, bespoke, functional maps for my web application to improve the user experience. i.e. every pixel is there for a reason, and when users click on something and expect to get a result, that happens. The challenge with that latter goal is that many things I'd expected to show on tiles are then non-interactive and maybe need to be pushed up to the leaflet layer instead.

As an example: Public transport stops, especially subway stations. I'd like to make them clickable in a similar way to Google Maps, i.e. clicking exposes a popup about the station as well as focuses attention on the subway lines that pass through it by thickening them. Currently we have non-interactive stops on our tiles, but now I'm realising I'd also need a Leaflet overlay to produce popups, so may as well draw the station icons themselves with Leaflet if I'm doing it that way anyway.

Afer this I assumed I surely can't be the only person to have faced the problem before and hoping those with more experience than I have found some good principles to follow. Is it as simple as "If the user wants to click on it then implement it with leaflet, otherwise bake it into the tiles?


texts:
The ingredients:
I have animal GPS points separated by a certain amount of time
& I have a map of roads... This time could be separated by hours, or days

The question:
I want to identify a minimum number of road crossings

The hard(er) parts:
It would be simple(er) to connect the dots with straight lines and look where those lines intersect roads but this can be way off because the line connecting two dots won't necessarily be where the animal crossed the road. I've done this. I want the most accurate idea where the animals are crossing the roads, so I want to narrow down the locations. What I am looking for is to instead do two things -

to put some resistance value on the roads such that lines that connect two wildlife points will cross as few roads as possible (so the line drawn  between two points isn't spanning a great distance and multiple roads).
that any line connecting two points can only be X meters long (where X is something like 2km.  If X is not set then the line could be many thousands of km indicating the animal may be trying to avoid crossing a road!).


texts: Adding multiple points to same layer using GeoTools?

texts:
I've got a java Swing application which loads a shapefile and draw a map. Now I need to allow the user to click on the map and add points. I've successfully completed that with the following code.

        private void runMe(double x, double y) {
        final SimpleFeatureType TYPE = createFeatureType();
        final SimpleFeatureBuilder BLDR = new SimpleFeatureBuilder(TYPE);

        DefaultFeatureCollection featureCollection = new DefaultFeatureCollection("internal", TYPE);

        // arbitrary start pos
        Coordinate pos = new Coordinate(x, y);
        int id = 0;
        featureCollection.add(createFeature(BLDR, pos, id));

        // Display the points on screen
        Style style = SLD.createPointStyle("circle", Color.BLUE,
                Color.BLUE, 1.0f, 5.0f);
        Layer layer = new FeatureLayer(featureCollection, style);

        map.addLayer(layer);
    }

This function is called from a onMouseClicked() event. As obviously seen, this function adds a layer each time the function is called. Points are correctly displayed on the map.

Now I want to add only one layer to the existing map and add all the points to that layer. I've read that featurecollections can be added at a later time, so I've first added the layer with an empty feature collection as follows.

    DefaultFeatureCollection featureCollection;
    SimpleFeatureBuilder BLDR;

public void addPointFeature() {
    final SimpleFeatureType TYPE = createFeatureType();
    BLDR = new SimpleFeatureBuilder(TYPE);

    featureCollection = new DefaultFeatureCollection("internal", TYPE);

    // Display the points on screen
    Style style = SLD.createPointStyle("circle", Color.BLUE,
            Color.BLUE, 1.0f, 5.0f);
    Layer layer = new FeatureLayer(featureCollection, style);

    map.addLayer(layer);
}

Then at each onMouseClicked() event I add a point to the featureCollection as follows.

        @Override
    public void onMouseClicked(MapMouseEvent ev) {
        DirectPosition2D p = ev.getWorldPos();

        runMe2(p.getX(), p.getY());

    }

    private void runMe2(double x, double y){
        // arbitrary start pos
        Coordinate pos = new Coordinate(x, y);
        val++;

        featureCollection.add(createFeature(BLDR, pos, val));

        mapPane.repaint();
    }

    private SimpleFeature createFeature(SimpleFeatureBuilder bldr,
            Coordinate pos, int id) {
        com.vividsolutions.jts.geom.Point p = GEOMFAC.createPoint(pos);
        bldr.add(p);
        bldr.add(id);

        // null arg means allow the builder to generate a default feature ID
        return bldr.buildFeature(null);
    }

I can see the layer being added to the map. But none of the points are visible on the map.

I just noticed that, when I make any layer of the map invisible and visible again, all the points that I clicked appear (I use the map layer table toggle visibility button). This problem should be related to the layers not being refreshed/redrawn.


texts: Strange field rename behavior in file geodatabase by ArcPy?

texts:
This is really strange. I am using ArcGIS Desktop 10.3.1. I have an ArcPy script that ingests data from Excel then converts it into a pair of tables in a file GDB. One part of the code renames the fields to new names according to our field naming protocol. For some odd reason, the GDB refuses to rename some of the fields, but doesn't throw an exception or generate a message. Here is the code:

inFields = ['FieldName','FieldType','FieldLength','FieldPrecision',
        'FieldScale','FieldAlias','SOURCEFIELD_XLS_MDB','DOMAIN_NAME']
xrefTbl = scratch + delim + 'SchemaFieldXwalk'

def renameFields(raw,xref,curr,wh):
incomingFields = arcpy.ListFields(raw)
incoming = []
for field in incomingFields:
    fname = field.name
    incoming.append(fname)
with arcpy.da.SearchCursor(xref,inFields,wh) as cursor:
    for f in cursor:
        newName = f[0]
        oldName = f[6]
        domain_name = f[7]
        if newName in incoming or oldName == "FUTURE": ##Logic to test if field exists or is yet to be implemented. Added on 1/31/2017
            msg = "\t{0} field already exists or has not yet been added.".format(newName)
            arcpy.AddMessage(msg)
        else:
            msg = "{0} to be renamed to {1}.".format(oldName,newName)
            arcpy.AddMessage(msg)
            arcpy.AlterField_management(curr,oldName,newName) ##Renames fields in currWorkTable
del cursor

The fields this script refuses to rename are below with their desired end names.

MidLat ==> MIDLAT

MidLong ==> MIDLONG

Stratum ==> STRTM

Targeted ==> TARGETED

TRLat ==> TRLAT

TRLong ==> TRLONG

Out of 130+ fields in the table, these are the only ones that simply refuse to rename, even if we attempt it manually in the table "Properties" dialog box on the 'Fields' tab. I don't get it. Are these potentially some sort of reserved word that nobody knows about? The .format(oldName, newName) shows the correct values for those variables. The fGDB simply refuses to accept the new names.


texts: Exporting layers as CSV-files using PyQGIS

texts:
I am trying to export several layers as CSV-files since I need to analyze them in another software. However, I cannot get my code to work. I am new to Python. Currently working in QGis 3.10.9. I would like all the fields in the attribute table to get exported. Here is the code I am using:
file_path = "/Users/user/Desktop/gis/Vikter/NUTS_ID_AT111978Q1.gpkg"
layer = QgsVectorLayer(file_path, "NUTS_ID_AT111978Q1", "ogr")
QgsVectorFileWriter.writeAsVectorFormat(layer, "/Users/user/Desktop/gis/Excel/NUTS_ID_AT111978Q1.csv", "utf-8", None, "CSV", layerOptions = ['GEOMETRY=AS_XYZ'])

The error message I receive:
Traceback (most recent call last):
  File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "<string>", line 3, in <module>
TypeError: QgsVectorFileWriter.writeAsVectorFormat(): arguments did not match any overloaded call:
  overload 1: argument 4 has unexpected type 'NoneType'
  overload 2: argument 4 has unexpected type 'NoneType'
  overload 3: argument 3 has unexpected type 'str'


texts: How to draw centerlines of Oriented Minimum Bounding Box in the orientation closest to orientation of all polygons collectively in QGIS?

texts:
How to draw centerlines of Oriented Minimum Bounding Box in the orientation closest to overall orientation of all polygons collectively in the layer in QGIS?
I have a shapefile of Oriented Minimum Bounding Box rectangles (accessible from the following link: https://drive.google.com/drive/folders/1Xr_0Apg9s7s0daevIUctWTr0-WCABC83?usp=sharing) produced by using Oriented Minimum Bounding Box Tool in QGIS and as Input Layer: a shapefile of irregular polygons (accessible from the following link: https://drive.google.com/drive/folders/1BKp5VbR1aMAzCObGprvqeL0WSMqpTX32?usp=sharing)

Figure 1: Shapefile of Oriented Minimum Bounding Box

Figure 2: Shapefile of Irregular Polygons
I constructed centerlines using the centroid of the polygons (in this case rectangles) and angle values in the attribute table of Oriented Minimum Bounding Box using the following expression:

The overall orientation of all polygons collectively as illustrated in the Rose Diagram below from the Line Direction Tool QGIS plugin: https://plugins.qgis.org/plugins/LineDirectionHistogram/ approximates to 30 degrees.

I am seeking to draw the centerlines of each polygon in the overall orientation of all polygons in the layer collectively.
That is, the deciding factor whether the centerline will be drawn either across the shortest segment or the longest segment of each polygon, will be the angle of the resulting centerline.
For example, let assume that the overall orientation of polygons collectively is 30 degrees.
Angle of Centerline of polygon across shortest segment is 40 degrees,
Angle of Centerline of polygon across longest segment is 130 degrees,
The centerline of polygon with angle 40 degrees is drawn. 40 degrees being closer to 30 degrees, which is the overall angle of all polygons collectively.
This rule is applied for each centerline in each polygon in the layer when drawn.


texts:
I've used TileMill to style my shapefiles and export it as MBTiles file. The intention is to run the map application offline. What's the best way to serve the tiles from the .mbtiles file to OpenLayers?
I see a lot of tileservers on the internet but I can't figure out what way is the best lightweight solution for me.


texts: ArcGIS Swaping XY Coordinate of WCS Coverage

texts:
When I am bringing a WCS coverage into my ArcGIS (both ArcMap and ArcGIS Pro). It is coming with Swapped XY. I have checked the version, and the version is correct. The same coverage loads fine in QGIS.
Is there a way to set XY Swap in ArcGIS for WCS Request, I know there is one for WFS.


texts: Why do I get gaps in the isochrones polygons with ORS tool in QGIS?

texts:
I am trying to represent isochrones from a points layer using ORS Tools in QGIS 3.8.3-Zanzibar.
Does anyone know why there are some gaps in the resulting polygons, even though the road, according to the OpenStreetMap base layer underneath, is continuous? (OpenRouteService works with OpenStreetMap, so the same network should be used to build the isochrones, right?)
I am especially concerned about the highways and main roads.
Here are some examples:

The parameters I used in the ORS Tool were (after obtaining and input the API key):

Isochrones from layer option

Provider = openrouteservice

Input point layer= a layer with 12 points (not very complicated as to
see the outputs easily)

Travel mode= driving-car

Dimension = time

Ranges in minutes = 15,30,45,60

If, as the last image shows, the polygons are created following vertices and not just the polylines of the road, how could I densify (as suggested in an answer) the network ORS uses?


texts: Should large Basemaps be stored in DBMS via ArcSDE?

texts:
As I understand it, the SDE Geodatabase provides the technology for Multiuser databases, Versioning, replication and other Geodatabase functionality. In my organisation, this could be useful for vector datasets but we also have a large amount of basemap material including Aerial images for many different years, many topographic maps, and other historical and infrared images.

My question is this. Does it make sense to fill my MSSQL DBMS with all this imagary? I am constantly having to explain to my colleauge who runs the DBMS why we are always short on filespace. If I simply created file-geodatabases and published these without using sde wouldn´t it be less work for the DBMS?