texts: Using ArcPy to copy layer in ArcMap TOC, rename copy, and paste back to TOC?

texts:
How do I make a copy of a layer in the ArcMap TOC (passed to my script as a Feature Layer), assign the copy a new name, set a definition query on it, and then add the copied Feature Layer back into the TOC?

This is easily achieved manually via the ArcMap interface, but I'm yet to discover how to achieve this programatically.

My application of this is to take an input layer, then effectively split the layer by attributes in a specified field, creating a new Feature Layer for each unique attribute in the input.  Thus the number of output Feature Layers will vary depending on the input data.  All output Feature Layers will be added to a specified group layer.

The following code almost achieves this, but if I then try and change the name of the copied layer (via ArcPy), the names of both the original layer in the TOC, and the copy of that layer (now in the new group layer) are changed.  Note that this code also includes adding of a new Group Layer to the TOC (using a template LYR file on disc), into which the copied layer is inserted)

mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, dataFrameName)[0]
inputLayer = arcpy.mapping.ListLayers(mxd, inFC, df)[0] #this is the Layer from the TOC     specified by the user

#Add empty group layer to TOC
groupLayer = arcpy.mapping.Layer("<File path to LYR file>\EmptyGroupLayerTemplate.lyr")
arcpy.mapping.AddLayer(df, groupLayer, "TOP")

targetGroupLayer = arcpy.mapping.ListLayers(mxd, "EmptyGroupLayerTemplate", df)[0]

#Add copy of feature layer into the new Group Layer
arcpy.mapping.AddLayerToGroup(df, targetGroupLayer, inputLayer, "AUTO_ARRANGE")

I have tried ensuring that I get a reference to only the new copy of the layer, by ensuring the layer name is proceeded by the group layer name:

for layer in layerList:
  if layer.isGroupLayer and layer.name == groupLayer.name:
    for subLayer in layer:
      if subLayer.name == inputLayer.name:
        #Change this layers name
        subLayer.name = outName
        arcpy.RefreshTOC()

..and I have also tried:

for lyr in arcpy.mapping.ListLayers(mxd):
  #If layers long name contains the new grouplayer name..
  if lyr.longName.find(groupname + "\\") != -1:
    #'-1' when string not found
    inputLayerFullName = groupname + "\\" + inputLayerName
    if  lyr.name == inputLayerFullName:
      lyr.name = "NewLayerName"
      arcpy.RefreshTOC()

...both these techniques do rename the copied layer, but they ALSO rename the original layer, regardless of where it is in the TOC.

It feels like I am working with a reference type rather than a value type in this respect, but I cannot see how to work with the layer object in another way.  Seems that the issue lays with the fact that both Feature Layers (in the TOC) have the same name; reference one by name, yet both get updated.

I've tried making a copy of the input Feature Layer, assigning the copy a new name, then add this to the TOC, but the code errors executing AddLayerToGroup():

arcpy.MakeFeatureLayer_management(inputLayer, "TestFeatureLayer")
arcpy.mapping.AddLayerToGroup(df, targetGroupLayer, "TestFeatureLayer", "AUTO_ARRANGE")

I'm yet to try saving the original Feature Layer to a LYR file on disc, then changing the properties of the LYR file, and adding that back into the TOC, but I'd prefer not to go down this route as I dont really want to save any data to disc.  After all, this operation is achieved within the ArcMap GUI without saving to disc, so it should be possible via Arcpy (or ArcObjects if necessary) too.

I am using ArcGIS 10.0.


texts: Define projection of GeoTIFF in ArcGIS for Desktop?

texts:
I want to load a satellite picture into ArcMap. The file has no coordinate system, but the metadata say it is 'WGS 84 / UTM zone 31 N'. However, when I perform 'define projection' the image is located near the equator, whereas it should be located in Northern France. How should I solve this?

entityID = MEN-31-45_UR_2000
lines = 512
samples = 512
FileFormat = GeoTIFF
FileSize = 1213179837
Platform = Landsat
Sensor = ETM
UtmZone = 31
ColorCompositeRGB = 7,4,2
RowStart = 1
ColStart = 1
RowCount = 19635
ColCount = 21516
Projection = UTM
Datum = WGS84
Units = Meters
XStart = 499512.375
YStart = 5543941.125
XIncrement = 14.25
YIncrement = -14.25
ULLat = 50.047762
ULLong = 2.993189
URLat = 49.969161
URLong = 7.269105
LLLat = 47.530835
LLLong = 2.993522
LRLat = 47.458851
LRLong = 7.061480
SCLat = 48.770736
SCLong = 5.079598
ComponentCount = 13
EarliestAcqDate = 19990902
LatestAcqDate = 20010813
BrowseAvail = Y
LocalBrowseName = MEN-31-45_UR_2000.jpg
SiloPath = /hsm/lta3/lsat_ortho/tridecadal/etm_mosaic/31/45/N-31-45_ur_2000.tar.gz
ContrastAdjustment = EarthSat_LOCAL


texts: Merging two linestrings gives Geometry type error in MMQGIS?

texts:
I am trying to merge two linestrings/Lines/Polylines (not sure actually how I can see the difference whether my layer is a Linestring/Line or Polyline and googling didn't really brought clarification).

When I try to merge them (I tried with the MMQGIS 'Merge layers' function as well as with 'Data management Tools' -> 'Merge Shapefiles to one') I get an error saying that the geometry types need to be the same.

This is what I've tried so far:

I tried the 'Multiparts to Singleparts' option on both of them and tried to merge them
I tried to save both of them with the LineString as geometry type and with the Z-dimension bocks ticked off and merging the results
I tried to export them as a CSV and manuallymerging the data in one excel document that I tried to upload again (failed since it can't find coordinates)

(these three are worked out here: Error in merging 2 shape files of different geometry types)
 4. Finally I tried the Dissolve tool after which I tried to merge the result.

All of this without result. Probably I'm just overlooking something very easy. I hope someone can shine his/her light on this and help me out with it. I attach a photo of the Two Linestrings as well as their Attribute Table.


texts: Conversion problems from mappoint to screenpoint using ArcGis Javascript API

texts:
I am getting a very strange problem when converting from mappoint to screenpoint.

I am using the following code:

var sp = esri.geometry.ScreenPoint(512, 151);
    mp = map.toMap(screenPoint);

After converting from screenpoint(512, 151) to mappoint, I get the following map coordinates:

338638.7275175141, 4404774.250335829

Now when I perform the reverse conversion (i.e., from the same point above which is mappoint(338638.7275175141, 4404774.250335829) to screenPoint), I get a very different screenpoint (i.e. 31563417740, -72455974). I think I should get the same screenpoint(512, 151) coordinate. For this reverse conversion I am using the following code:

mp1 = new esri.geometry.Point(338638.7275175141, 4404774.250335829);
sp1 = map.toScreen(mp1);

With it, I get a very different screenpoint as I showed before and no the value (512,151).

Any help will be appreciated,


texts: Converting standalone script to ArcGIS tool?

texts:
I am currently trying to make my (working) standalone script into an ArcGIS tool so I'm not the only person in my office that can use it.  It selects all the data within a specified location and copies it to a new geodatabase.  Since replacing my old variables with sys.argv[#], new errors keep popping up.  The following section of code is giving me problems right now:

out_folder_path_gdb = sys.argv[1]
out_name_gdb = sys.argv[2]
out_name_fc = "buffer_point"
geometry_type = "POINT"
has_m = "DISABLED"
has_z = "DISABLED"
sr = sys.argv[3]
fc = out_folder_path_gdb + "\\" + out_name_gdb + "\\" + out_name_fc
lyrlst = []

######################
# Create geodatabase #
######################

try:
    arcpy.CreateFileGDB_management(out_folder_path_gdb, out_name_gdb)
except:
    print "Geodatabase already exists."
    arcpy.AddIDMessage("Error", 12, out_name_gdb)
    sys.exit(0)

##########################
# Create point to buffer #
##########################

arcpy.env.overwriteOutput = True
arcpy.CreateFeatureclass_management(out_folder_path_gdb + "\\" + out_name_gdb, out_name_fc, geometry_type, "", has_m, has_z, sr)

############################################
# Sets given coordinates as a point object #
############################################

rowInserter = arcpy.InsertCursor(fc)
x = sys.argv[4]
y = sys.argv[5]
pointGeometry = arcpy.Point(x,y)

When running the tool within Arc, I get the following error:
: Failed to execute. Parameters are not valid.
ERROR 000732: Feature Class Location: Dataset C:\Documents and Settings\benoyn\Desktop\DaS GIS work\data_extraction_test\pleasepleaseplease does not exist or is not supported
Failed to execute (CreateFeatureclass).

The only reason I can think of for this error is the spaces in "Documents and Settings".


texts: OSGeo4W Network Installer for several version of QGIS

texts:
I want install several versions of QGIS with OSGeo4W Network Installer (2.18, 3.0 and master).
Will it be good if I install it in one root direction or should I create separate folders?


texts: Calculate minimum distance between feature types in PostGIS?

texts:
I have polygon layer in QGIS, and for each polygon I would like to calculate the minimum distance to the nearest polygon in another layer. My desired result is an attribute for all features that has the minimum distance from that feature to another layer. (context: it's a sort of (ecological) connectivity analysis)

I got a lead to using PostGIS, so I installed that successfully and loaded the dataset into a PostGIS database. I think the function ST_Distance might be the right tool, but I don't know enough SQL to construct the right query.

Sample of my dataset: I want to know the shortest distance between a red or yellow polygon tot a purple polygon. distance measured between outlines, not centroids or something.


texts: What GIS Data should Amazon add to its Public Data Sets?

texts:
Amazon says:

  If you have a public domain or
  non-proprietary data set that you
  think is useful and interesting to the
  AWS community, please submit a request
  below and the AWS team will review
  your submission and get back to you.
  Typically the data sets in the
  repository are between 1 GB to 1 TB in
  size (based on the Amazon EBS volume
  limit), but we can work with you to
  host larger data sets as well. You
  must have the right to make the data
  freely available.

Given that Amazon is a gold sponsor at the Esri Dev Summit, maybe this would be a good time for the community to recommend data sets for Amazon to put in their cloud.

Having the data on Amazon allows fast access by things like Server Object Extensions and geoprocessing services running on EC2.

Currently I just see 3 datasets for geography.

Update
I dropped by Amazon's booth at the Dev Summit and spoke a bit with an AWS rep.  He said they are still sorting out how they will keep public dataset current.  He said there has been a lot of interest from the Human Genome community.  He said to expect something in last half of 2011 regarding changes to community data sets that will make it easier for GIS.

I also visited with Microsoft.  While Azure looks promising, it doesn't look like you'd be able to do server-side geometric network traversal, as you would with AWS.


texts:
I'd like to get a little more control over the layout and functionality of the user interface associated with a processing script I've created. I've made a ui file using Qt Designer, but I can't figure out how to replace the default form (which uses the ## notation to define parameters) with my new one.

I've found many examples on doing this for a plugin and for feature popups, but nothing for processing scripts.

I tried the following but I just get a blank dialog

from PyQt4 import uic

myForm = uic.loadUi('path_to_ui.ui')
myForm.show()


texts: ArcGIS 10.5 - Testing the accuracy of a satellite image's georeferencing using dGPS ground control points

texts:
I want to test the accuracy of the georeferencing of a satellite image by using a set of independent ground control points collected in the field via differential GPS.

Is there a tool/method/procedure in ArcGIS 10.5 to quantify/assess the deviation of a location in the satellite image from that of a dGPS control point.


texts: Does NetCDF4excel provide packed or unpacked values?

texts:
I'm using the NetCDF4excel tool to work on files from the ERA Interim database. I'm wondering whether I should adjust the values of the variables produced by the tool using each variable's "scale_factor" and "add_offset", or whether the tool does this for you.

I've tried:

Going through the documentation, and this is not clear.
Adjusting the values provided and comparing them with the unconverted ones
doesn't help either because in both cases you obtain feasible values
(the difference for temperatures, for example, is within 10C).
Another possibility would be to check whether missing values are filled with the missing value code (in this case -32767) or whether they are in fact converted to missing, but since this is reanalysis data there are no missing values.


texts:
While I'm adding a geometry column in PostGIS by using AddGeometryColumn then the error is

  no function matches the given name and argument types. you might need
  to add explicit type casts


texts: Applying advanced parameter settings with RQGIS?

texts:
I am working on stream network delineation with GRASS 7 in RQGIS, the 'r.stream.extract' algorithm in particular. However, the algorithm returns erroneous result when the Advanced parameter, "v.out.ogr output type" has not been defined as "line". The advanced parameters setting is accessible in the QGIS GUI ver 2.14.17 (as shown below)

but couldn't be found as argument in RQGIS.

I wonder if there is anything that I have missed. Is there any workaround to solve this?


texts: Get feature's geometry from feature Form's argument

texts:
Under a pyqgis form,  the feature from Form's argument doesn't has geometry .
Here the code I used:

def formOpen(dialog,layer,feature):
     geometry = feature.geometry()

Geometry return is None.

But my feature is multi-point and has a geometry.

To get geom I have to use getFeature from layer with an expression and then it's work.
like that :

    idField = layer.fieldNameIndex('id_field')
    fcode = feature.attributes()[0]
    request = QgsExpression( "\"id_field\" = '{}' ".format(fcode))
    iterator = layer.getFeatures(QgsFeatureRequest(request))
    sit = iterator.next()
    geom_buffer = sit.geometry().buffer(20000, -1)

with that code I can use the geometry from my feature.
But it's not very effective as I already have the feature from the Form's argument.

Why the feature argument from the formOpen class doesn't has geom ?


texts: Using ArcScripts that are AML from ArcGIS Desktop?

texts:
I use ArcGIS 10
I want to use an arcscript to compute an index of ruggedness for each cell of my map. For this  purpose, I found, Evan's TRI.aml script here:
http://arcscripts.esri.com/details.asp?dbid=12435

I have never added a script to  ArcGIS before. So I downloaded it, and aded to as a script to my newly created toolbox.
However, I do not know what to enter when I am asked to add parameters, and if I don't add any  I cannot use the script when I double click on it.

No specific indication on "parameters" is available on the website from which I downloaded the aml file.


texts: Unable to update R scripts in Processing

texts:
I'm unable to update my R script on Processing.

Nothing happens after hit OK button. Those scripts under "Updatable" never get updated. Am I missing something?

(QGIS 2.18.21, Linux Mint 18.3 Cinnamon)


texts: Percent of polygon area within multiple ring buffers using ArcGIS Desktop?

texts:
I would like to calculate the percent of area of polygons that are within multiple ring buffers of a number of points. The polygons are associated with a specific point so I would like the buffers to extend out by specific intervals (5km, 10km, etc) up until it covers all the polygons associated with the point.

Then I would need to get the percent of cumulative areas of the polygons overlapping each interval extension of the buffer - e.g at 5km from point M1, percent of areas from the polygons (M1-P1, M1-P2 M1-P3, M1-P4,etc) is 10%, and at 10km, it is 40% and all the way up to 100% with the maximum buffer distance.
And this would be done on multiple points with other associated polygons (M2 with polygons M2-P1, M2-P2, M2-P3, etc).

A very rough illustration of the polygons, point and buffers are shown in the image below:

Can this be easily be done in ArcGIS Desktop?

I need the output from this to get into a cumulative distribution function.


texts: QGIS Intersect tool produces two copies of intersected line

texts:
I'm using the Intersect tool in QGIS 3.10.3 on two line layers A and B to create the intersecting layer C. I can then use the Difference tool to subtract A-C and to subtract B-C, resulting in three mutually exclusive layers. The problem is that each of the features in layer C has two copies of the intersecting line segment (one from each input layer?) so that when the feature is drawn the line appears heavier or thicker than the lines in the other two layers. How can I resolve this? Can I make an intersecting layer with just one copy of each intersecting line? I have tried using the Remove Duplicate Vertices tool without effect, maybe I don't know how to use it.

I guess I should clarify. I'm looking for line segments that overlay each other, so I'm using the Geoprocessing tool called Intersection. I'm not interested in lines that simply cross each other at a point.


texts: Changing size of popup on ArcGIS Online?

texts:
Is there any kind of way to change the size of the popup that ArcGIS Online displays in the maps/apps?

I want it so that there is no scrolling required to view the picture/thumbnail at the bottom.


texts: How to SetVisible a layer without redraw all the mapcanvas

texts:
I am working with QGis 2.8.2 API c++/ QT 4.5
I am displaying a lot of layer in a mapcanvas, I am looking for a method like setVisible(boolean ) in order to setvisible or not a specify layer

setVisible is for the QgsMapCanvasLayer
Actually i add a layer in the QList and i refresh the renderer and the mapcanvas  to display it, if i want to hide it i remove it from the qlist and i refresh the renderer and the mapcanvas

but this method is too slow and force me to redraw all the canvas

I don't want t oredraw all the canvas i just want to show or hide a layer

any idea ?


texts: R {spdep} Get list of neighbors from nb object

texts:
I want to identify the specific neighbors of each polygon within a SpatialPolygonDataFrame from nb object.

I know I can get the number of neighbors by polygon id by card(nb), but how to get the list of the pairs? For example, something like this (in rook case):

id neighbors
1  NA
2  3,5
3  2,6,4
4  3,7
etc

My dummy data:

library(spdep)    # neighbours
library(rgdal)
library(rgeos)
library(sf)
library(raster)
library(dplyr)
library(spData)
library(sf)

# create simple reproductible example

r <- raster(nrow=6, ncol=6, crs = "+init=epsg:2957")
values(r) <- matrix(data = c(9,  NA, NA, NA, NA, NA,
                             NA, NA, NA, NA, NA, NA,
                             NA, NA, NA, NA, NA, NA,
                             NA, NA, NA, 1, 1, 1,
                             NA, NA, NA, 1, 9, 1,
                             NA, NA, NA, 1, 1, 1),
                    nrow = 6,
                    ncol = 6,
                    byrow = TRUE)

Calculate neighbors:

# continuity based neighbourhood: import whole
# shapefile, do not split it
nb <- poly2nb(polys, row.names = polys,
                   snap = 10) # snap corrects for the gaps/slivers

Extract the number of neighbors (here, QUEEN case)

card(nb)

[1] 0 3 5 3 5 8 5 3 5 3

Merge data back:

# add number of neighbours to original polygon
polys$nb_count<- card(nb)

Get the count of neighbors by polygon:

> polys@data

   layer nb_count
1      9        0
2      1        3
3      1        5
4      1        3
5      1        5
6      9        8
7      1        5
8      1        3
9      1        5
10     1        3

Which polygons are the specific neighbors?


texts: How to select specific fields using getFeatures() without getting all of them in QGIS-3.10

texts:
So I'm trying to convert code from ArcGIS to QGIS. The part I am at right now is converting:

lst_fields = ["full_id", "osm_id", "osm_type", "boundary", "is_in", "leisure", "name", "type", "landuse"]
with arcpy.da.UpdateCursor(urh, lst_fields) as cursor:
    for row in cursor:
         ...

However, with QGIS I have to instead use:

with edit(vector_layer):
    for row in vector_layer.getFeatures(request):

I did not find a way to get only the fields specified in the list apart from doing another for loop and doing this and then storing the values in another list:

row.attributes()[row.fields().indexFromName('boundary')]

The code I have right now is:

lst_fields = ["full_id", "osm_id", "osm_type", "boundary", "is_in", "leisure", "name", "type", "landuse"]
vector_layer = QgsVectorLayer(repertoire+'\\protected_areas.shp','ogr')
request = QgsFeatureRequest().setSubsetOfAttributes(lst_fields, vector_layer.fields())

with edit(vector_layer):
    for row in vector_layer.getFeatures(request):
        print(lst_fields)
        print(row.fields().names())

The first print gives this:

['full_id', 'osm_id', 'osm_type', 'boundary', 'is_in', 'leisure', 'name', 'type', 'landuse']

The second print gives this:

['full_id', 'osm_id', 'osm_type', 'boundary', 'is_in', 'leisure', 'name', 'type', 'wikidata', 'wikipedia', 'landuse', 'name_de', 'sagns_id', 'website']

I thought the request would make it so the two prints would give the same result.
I will say what my question is again just in case it wasn't clear:

Is there a way to only get the fields specified in the list like it was possible in arcGIS without the need of another for loop that would save the value of 1 field at a time.


texts: 1m cell size equivalent value in decimal degree

texts:
I'm doing re-sampling pixel size in ERDAS 2014,I'm using input image(Indian terrain)  in GCS_WGS_84 projection.
Now I have to keep out put cell size as 1m,what is the 1m equvivalent value in Decimal degree?


texts:
My agency currently maintains and distributes shapefiles with FGDC XML metadata.

We have now converted a lot of shapes to GeoJSON but are concerned that if our developers forget where they got the data, then they will not know who to blame when their node apps break.

Is there a GeoJSON metadata specification?


texts: Combining SAR ascending and descending passes

texts:
I have managed to obtain the displacement map from S1-A. However, the values appear to be too large for a 10 day period.

I've read that I should combine results from ascending and descending passes. How should I do this? averaging?


texts: How to restrict Leaflet points to general DB rule

texts:
I am trying to make a REST call which accepts bounding box lat-lng as body parameters. But unfortunately DB geoPoint restriction is:

•         Latitude : max/min +90 to -90
•         Longitude : max/min +180 to -180

But Leaflet fetches beyond this limitation. Because of this REST call fails. Any suggestions?


texts: Recalculating raster based in number of cells?

texts:
I am working with binary rasters of fish species distributions (1=presence, 2=absence). I am looking to recalculate each raster in this way:

Count the number of cells with value 1.
Divide: 1/Number of cells with value 1.
Replace each cell with value 1 with the value resulting from the division.

I think that should be some way to do it with raster calculator in QGIS or ArcGIS for Desktop.


texts: Importing ArcPy installed with ArcGIS Pro in PyCharm

texts:
I am trying to import arcpy in a script, which is running in a PyCharm environment using the Python 3.6.6 installation that comes bundled with ArcGIS Pro 2.3.2 as the base interpreter. I get the following error:

Traceback (most recent call last):
    File "C:/Users/lharris/PycharmProjects/general/test.py", line 1, in <module>
        import arcpy
    File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 72, in <module>
        from arcpy.geoprocessing import gp
    File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
        from ._base import *
    File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
        import arcgisscripting
ImportError: DLL load failed: The specified module could not be found.

As per the only answer to Importing ArcPy in PyCharm? I have created a new PyCharm project using the Python install described above, which for my default installation is located here:

  C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe

Based on the answers to Why can't I import arcpy? and other similar issues, I have opened that Python interpreter on the command line, ensured that I can import arcpy (which I can) and then checked sys.path, which gives me:

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python36.zip
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\DLLs
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages
C:\Program Files\ArcGIS\Pro\bin
C:\Program Files\ArcGIS\Pro\Resources\ArcPy
C:\Program Files\ArcGIS\Pro\Resources\ArcToolbox\Scripts
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\future-0.16.0-py3.6.egg
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pytz-2018.5-py3.6.egg
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\sympy-1.2-py3.6.egg

I have created a .pth file in venv\Lib\site-packages that contains all of these paths. Without this file, the error given was "no module named arcpy" and with only 'C:\Program Files\ArcGIS\Pro\Resources\ArcPy' on the list, the error was "no module named arcgisscripting". With the complete list above, the error is the one I give at the beginning of this question.

Is there anything I've not tried that might help me to get arcpy imported in a Python 3 script in PyCharm using ArcGIS Pro?


texts: Arcpy: Calculate new field from user input and existing data

texts:
Can't seem to figure out what is wrong with this create fields from a calculation. The code creates the new field in the shapefile as selected by the user but I keep getting a 9999 error on every attempt I have to go further. I am rather new to Python and ArcPy, if anyone has any suggestions they would be greatly appreciated. The code is to work as a tool from an exported route from a network analysis and provide a fuel cost which changes slightly in relation to the speed limit of the road. Thanks.

        import arcpy
        from arcpy import env
        import os

        inputFC = arcpy.GetParameterAsText(0)      # Input feature class
        distanceField = arcpy.GetParameterAsText(1)      # Name of distance field in                           input fc
        speedField = arcpy.GetParameterAsText(2)      # Name of speed field in input feature class
        price = float(arcpy.GetParameterAsText(3))      # Input the current price of gas in $/Liter
        mpg = float(arcpy.GetParameterAsText(4))      # Input vehicle mpg in MPG

        arcpy.AddField_management(inputFC, 'Cost', 'DOUBLE') #create cost field
        rows = arcpy.SearchCursor(inputFC)
        #row = rows.NextRow()
        #arcpy.AddMessage(row.GetValue(distanceField))
        for row in rows:
            arcpy.AddMessage(row.length_12)
            distance = row.getValue(distanceField)
            arcpy.AddMessage(distance)
            lperkm = row.getValue(mpg)
            milageupdate = lperkm * 2.35214  #convert mpg to liters per kilometer
            if speedField <= 30:
                cost =(price * 0.07 * distance)/ milageupdate -(milageupdate * (0.07))
            elif speedField >30 and speedField <50:
                cost =(price  * distance)/ milageupdate -(milageupdate * (0.03))
            elif speedField >50 and speedField <90:
                cost =(price  * distance)/ milageupdate
            row.setValue('Cost', cost)
            rows.updateRow(row)
        del row, rows


texts:
Can QGIS (1.8.0 Mac) rotate the entire view of a project i.e. have north pointing in a direction other than up on the screen and on output?

Of course, while still allowing adding new layers etc.


texts: Difference in pixel size between gdalinfo and gdal2tiles

texts:
I'm getting two different pixel size values, does anyone know what is the reason for this issue?
From gdalinfo:

From gdal2tiles.py:

GDAL version: 3.20


texts: So I've just finished the tutorial to at least get a map on the screen, and it already isn't working. Can someone see what I'm missing?


texts: QGIS won't read table columns in CSV import on Mac OS

texts:
I am trying to import a CSV file into QGIS, but it ends up looking like my print screen below (program is in Swedish but in the preview window you can see how QGIS won't read my data correctly). I can't load the data since for some reason, QGIS reads my CSV table columns as one single row. What is wrong? I want QGIS to read my data as numbers, so I have created an additional csvt-file with the code "String","String","Integer". Is there something else that I need to to in order for QGIS to read the third column as numbers?

Still, after doing that it loos like this...


texts: Probability distribution from list of rasters using ArcGIS Desktop?

texts:
I have 100s (exactly 224) of wind distribution rasters.

I want to create a probability distribution raster of wind speed using all these rasters, so we can predict the possible wind speed in any location.

Is there any sufficient way in ArcGIS Desktop?


texts: java.lang.IllegalArgumentException while updating Geoserver WFS using QGIS 2.16.3

texts:
I get the following error when I try to update features using a WFS in QGIS 2.16.3 version (NOTE: The features are updated fine when i use QGIS 2.14.3).

Commit errors:
              ERROR: 1 feature(s) not added.

          Provider errors:
              WFS service exception:
                  java.lang.IllegalArgumentException: java.lang.ClassCastException@11805eee
            java.lang.ClassCastException@11805eee

I am using Geoserver 2.9.0, PostGIS 2.2, and QGIS 2.16.3

Geoserver log


texts: Changing default rounding and alignment for all attribute table columns in ArcMap?

texts:
I am on ArcDesktop 10.3 and wondering if there is a way to change the default rounding decimals and alignment numbers for all columns across all attribute tables?  ie. a global default?

In the image above it is the two circled values I would like to change the default of so they always come up 1 decimal place and 0 Alignment spaces

The problem happens when links to the data-driven FC are broken and subsequently the link to the joined table breaks, and I have to break these links frequently as I point the MXD to different geodatabases.  After I re-path things the rounding and alignment values default back to 6 and 12.

I did find a workaround where I can save a layer file of the data-driving feature class linked to the joined spreadsheet, then make sure other MXD's are closed and add that layer file to a new MXD it does come in with the table joined and the decimal/alignment settings retained, but it would be nice if I could just know that the numbers would default to this behaviour.


texts:
I have a problem combining several rasters into one big raster. Particular annoying is, that I had this problem once before and solved it, but I can't remember how. Unfortunately the other StackExchange-Entries didn't help me either.

I try to combine a set of grayscale rasters using the function Raster>Miscellaneous>Merge. The problem is, that the outputraster always contains gaps, where the novalue areas of one raster overlap the value area of another layer. This Problem seems to appear no matter what settings I choose. Sometimes the merge-function creates an multicolor raster and tries to put the different input rasters into different colorbands. In any case I dont get the wanted result. Does anybody know this problem and remember how to get rid of it?


texts:
i have create a simple custom line style in QGIS where i have 10 dash 2 spaces and inside a cross and i have define specific distance in millimeter .

style like this :

but my style is different if i change the scale.
if i have zoom in, zoom out in QGIS project then that style is differrent if i change scale in print composer then again is differrent.

here an example in scale 1:700 :

and here an example in scale 1:1500 :

in that scale union neighbors styles i think but i dont want this .

i want my style to stay Stable for any or specific scales,how to do that ?

i think the problem is the style render,can i disable style render ?


texts:
Last week I was told on a phone conference that GML supports shared boundaries in Polygon's. I have been unable to find any documenatation to substantiate the claim. Here is the situation:

I have a series of Polygons which represent areas in a forest. As a requirement for our operating license we have to submit these administrative boundaries to the government in a custom xml schema with the spatial data included as GML objects. I have a shape file which contains our polygons which was exported from our SDE. I then ran ogr2ogr on this shapefile to convert it into a GML file. I have a custom program that reads that GML file and then inserts the other information that the government requires.

The problem is the file is too large for the government site to accept, the original shapefile is 8.5 MB and the GML file is roughly 12.5 MB. Generalizing the shapefile isn't an option unfortunately because that alters the boundaries of the polygons and could lead to compliance issues.

Can GML Polygon, or MultiPolygons share boundaries? If so can someone point me to some documentation to that effect.


texts: CartoDB "Error loading rows, check your SQL query" & "There is a pb with your connection"

texts:
I have been trying to install my own CartoDB server for a few weeks.

I succeeded to install each part with no error (after few corrections) with this tutorial.
Make check with CartoDB-SQL-API and Windshaft-CartoDB are ok!

I can import data : when I am in my dashboard, I can see my file with its 193 rows.

But when I try to see the table, the message "Error loading rows, check your SQL query" appears.
All columns of my file are here but empty.

I try to click on Map View, which give me the following error : "There is a problem with your connection".

The view is already focused on the area which contains my data.


texts:
I've been working with imposm and Python, it's fairly easy to parallelise. I've hit a performance problem when trying to associate the coordinates to the ways.

Creating a dictionary from coordinate_id to lat,long and then using it turns out to be really slow.

Do you know of any alternatives that I can use?

Has anyone used a C++ library, or even Scala, or PostgreSQL

Btw, I've been able to iterate through 39GB of PBF, almost the whole globe in 17 minutes on a 32 core machine. That's the performance I'm looking for.


texts:
I have KML file for country polygon.
I can read the KML file in PHP and see all boundaries.
What I want now is when I put a marker on point showing me the title of the polygon.
Does anyone have any idea how to check if the point in the polygon?


texts:
Is it possible to embed a map image inside a Crystal Report using ArcGIS 10?

I have seen articles about creating reports based off of map fields, but I would like to include an image of a selected area (i.e. a specific parcel on a map).

Is there a way to do this?


texts: Calculating Median/Quantile of Rasterstack and converting Results to Data Frame in R

texts:
I have a Raster Stack with 32 Raster Layers. What I want to do is to calculate the median for each Raster and also the 0.25 and 0.75 quantiles. Then I want to convert the results into a dataframe.

For the median I have allready found a quite simple solution:

#calculate median and convert to dataframe

median.df <- data.frame(cellStats(r_stack, "median"))

The Problem is, that I can´t do the same with the quantiles, since cellStats cant calculate that.

My best approach with the quantiles so far was:

quant <- calc(r_stack, fun = function(x)
          {quantile(x,probs = c(.25,.75),na.rm=TRUE)} )

quant.df <- as.data.frame(quant)

But the dataframe has 16644 rows instead of the expected 32.


texts: Using Python to create xml metadata files for different file types

texts:
I have a folder with 3 subfolder, each having a different type of data. Folder_A and Folder_B have standard shapefiles (about 3 shapefiles in each folder). Folder_C has .tif grid files (about 100). I am trying to write a Python script that will create the metadata files (xml) for each of these files in the subfolder. I was looking at using arcpy.SynchronizeMetadata_conversion, but something seems awry. It looks like it is primarily designed for features in a .gdb. Also, it doesn't have an output file. Or you cannot name one anyways. Is there another way to do this? :

import arcpy, lxml, copy, sys, os
from lxml import etree
from arcpy import env

mydir = "<file path to Spatial_Files folder>"

def list_files(dir):
    r = []
    for root, dirs, files in os.walk(dir):
        for name in files:
            print(name)
            r.append(os.path.join(root, name))
        return r

def list_folders(dir):
    d = []
    for root, dirs, files in os.walk(dir):
        for dir in dirs:
            print(dir)
            d.append(os.path.join(root, dir))
        return d

subdirs = list_folders(mydir)
for subdir in subdirs:
    files = list_files(subdir)
    for file in files:
        arcpy.env.workspace = subdir
        arcpy.SynchronizeMetadata_conversion(file, "CREATED")


texts: How create a dynamic layer in OpenLayers map

texts:
I am using GeoServer, PostGIS (database) and OpenLayers for map. Now I want to create a layer (WFS, WMS) dynamically. The goal is to allow the user to create any number of layers from front end without hard coding in (map.js) file.

Is it possible?


texts: pyinstaller stops in the middle of process

texts:
I try to create a .exe from a .py script. I use Pyinstaller. The script runs fine with no errors in Pycharm. If I open the .exe my Tkinter opens I can choose the files etc.. And then in the middle of the process it stops at this line:

WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [granuleidentifier] does not exist.

This Warning makes usualy no problem.

Has anybody an idea? I am frustrated with that. I can't find the error.

I worked with the libraries:

import snappy
from snappy import ProductIO
from snappy import GPF
from snappy import jpy
from snappy import HashMap
from Tkinter import *
from tkFileDialog import askopenfilename, asksaveasfile
import numpy
import numpy.ma
from osgeo import gdal, ogr, osr

I can produce a exe from a predecessor project with the libraries and the package cx_freeze in the Osgeo4w shell:

from snappy import ProductIO
from snappy import GPF
from snappy import jpy
from snappy import HashMap
from Tkinter import *
from tkFileDialog import askopenfilename, asksaveasfile

The code was written in pycharm environment wit the python-qgis-ltr-dev.bat as python interpreter located in the bin folder of Osgeo4w.
With all libraries i get an error message that the sqlite3.dll file is missing in the Python27 Dlls folder. I placed the missing file into the desired folder and cx_freeze crates an exe which is not opening

If i work with pyinstaller i get an warning that the jvm.dll file can#t be conected- Pyinstaller creates a exe which is opening my GUI i can import all the files the process is starting but then crashing in.

I tried bbfreeze with the same result of missing dll's.

Py2exe created a exe which performs similar to the pyinstaller version. I had two insert two dll's to the python27 dlls folder.

My thoughts are that numpy is not compatible because i get for all trials an message that numpy is not imported.

Is it possible to insert a package in the setup file?


texts: Change start / end points of a line with field attributes

texts:
I've written an expression to update node layers coordinates to coordinate values from a survey file with the following expression:

geom_from_wkt('POINT('||$x||' '||$y||' '||$z||')')

(replacing $x, $y and $z with the field names of the northing, easting and elevation values)  This works great for moving the nodes to the proper coordinates.

Now I'm trying to use the same logic to update the start and end points of a line layer but I can't seem to get the proper syntax, what I was expecting to work is:

geom_from_wkt('start_point('||$x||' '||$y||')')

geom_from_wkt('end_point('||$x||' '||$y||')')

(again, replacing $x and $y with the attribute field names)

I'm not getting any errors, but the geometry is also not updating... I can only assume the expression is not written correctly? or is there a better way to accomplish this task?


texts: Difference in vector / raster area measurements

texts:
I'm comparing raster and vector distance zones.

So I created a line, calculated the Euclidean distance, and reclassified the raster to two zones: from 0-10m and 10-20m. To compare it with vector distance, I created a Multiple Ring Buffer with the same line and the same two zones, 0-10m and 10-20m.

When I'm calculating the area, for example for the 0-10m zone, the (vector) buffer has an area of 1475 m² while the Euclidean distance raster for the same zone has an area of 1493 m²!

Can someone please explain why those two values differ?


texts:
I have a temporal Image Mosaic layer containing 15 daily geotiffs. I want to add the 16th day and have Geoserver expose it dynamically. I attempted this by

adding the new geotiff - rtmatmax_20150116.tif to my image mosaic directory
adding a new row to the postgis table geoserver had generated:

  fid-|-the_geom-|-location---------------------|-ingestion

  16   |    01030......    |    rtmatmax_20150116.tif  |  2015-01-16
  17:00:00.000000

But when I try to view the new day in the openlayers preview nothing appears.What am I missing?


texts:
Incredible claims have been made about a map named after its creator (Piri Reis).

I was looking into digitizing the map and overlaying it with a modern map of the world, specifically the east coast of the Americas, Antarctica and the west coast of Africa.

Before attempting this I wanted to make sure it hasn't already been done.

So, has anyone seen/done this and have pointers to the data?  A shapefile or GML file?  Something that can load into Google Earth?

http://1.bp.blogspot.com/_tBL67utkyNw/S_lE7zti5RI/AAAAAAAAAU8/HgEFCjd74Ik/s1600/piri_reis_full.jpg


texts: Aligning data from PostgreSQL and ArcGIS Desktop in QGIS?

texts:
I am pretty new to ArcGIS and QGIS. I have loaded some geometry data in QGIS from my postgres database, then I have also loaded the same data in ArcGIS. Then from ArcGIS i have created a shapefile containing part of the data loaded from the database.

Now my problem is that when I load the shapefile containing part of the whole geometry data in QGIS , they are not being displyed on top of each other. Instead they are displayed both totally in different locations.

Now my data from postgres is set to 4326 and my data created in ArcGIS is set to wgs1984 UTM 33N.

I have uploaded these two images to explain more myself. I would like that in QGIS will appear that the blue rectangle will be on its twin rectangle. NOT ON ANOTHER PART


texts: Change Stroke Style of a Simple fill Symbol Selector with PyQGIS

texts:
How do i change the Stroke Style of a simple fill with python ?
Here is a picture that i want to change ?

Here is my code :

    processing.run('native:buffer', {"INPUT": delta, "DISTANCE":QgsProperty.fromExpression("bande"), "OUTPUT": "memory"})
    blayer=QgsVectorLayer("MultiPolygon?crs=epsg:2154", "Bande Etude", "memory")
    QgsProject.instance().addMapLayer(blayer)
    blayer_feat= blayer.getFeatures()
    blayer.startEditing()
    j=0
    for feat in blayer_feat :
      blayer.changeAttributeValue(feat.id(), 1, delta_t[j])
      j=j+1
    target_field = 'delta_t'

    myRangeList = []

    symbol = QgsSymbol.defaultSymbol(blayer.geometryType())
    symbol.setColor(QColor("#f7fbff"))
    symbol.setOpacity(0.6)
    #symbol(0).setStrokeStyle(Qt.PenStyle(Qt.NoPen))
    myRange = QgsRendererRange(0, 10.0, symbol, '0 a 10')
    myRangeList.append(myRange)

    symbol = QgsSymbol.defaultSymbol(blayer.geometryType())
    symbol.setColor(QColor("#08306b"))
    symbol.setOpacity(0.6)
    myRange = QgsRendererRange(10.1, 100.0, symbol, '10 a 100')
    myRangeList.append(myRange)

    myRenderer = QgsGraduatedSymbolRenderer(target_field, myRangeList)
    myRenderer.setMode(QgsGraduatedSymbolRenderer.Custom)

    blayer.setRenderer(myRenderer)
    blayer.setFeatureBlendMode(QPainter.CompositionMode_Darken

I've tried a line code like : symbol(0).setStrokeStyle(Qt.PenStyle(Qt.NoPen)) but it does not work.


texts: QGIS 2.14.3 can't attach oracle spatial table

texts:
when I try to attach spatial table in QGIS, the application close without errors.
The tables which have problem have a UUID column:

  mslink    NUMBER(10,0)  NOT NULL,
  uuid      RAW(16)       DEFAULT sys_guid() NOT NULL,..

How I can open this table with QGIS ?


texts: ArcGIS Pro SDK EditBox update on Project Change

texts:
I have an EditBox displaying the ArcGIS Pro project path.  When I open a different project, the EditBox does not update with the new project path.
internal class ProjectPathEditBox : ArcGIS.Desktop.Framework.Contracts.EditBox
    {
        public ProjectPathEditBox()
        {

            string stringURI = Project.Current.URI;
            Text = stringURI;
        }
    }

How do I get the Text value to update when opening a new project?  Is an EditBox the best control to use?


texts: How to use Cesiumjs without bingmap api key

texts: Can I use cesiumjs without bingmap api key. I need to create a viewer which should use my own wms layer and osm. Further i want to use it as a platform for geospatial analysis on my spatial data. As i know cesiumjs is a opensource tool but why it needs bingmap api key.


texts: How to visualise generic geometry column from SpatiaLite database in QGIS

texts:
I have a SpatiaLite database with various tables. One is a table called Geometries that has a geometry column which is defined as a generic Geometry column - that is, not POINT or POLYGON or anything, but just GEOMETRY and able to hold any sort of Geometry.
This seems to work fine in SpatiaLite, and when I view the data with ogrinfo, I get the right WKT printed out to the console.
However, when I try and view it in QGIS, I just get an entry in the layers list, but with nothing displayed in the main map canvas. I can't seem to find anyone else with this problem online.
Does QGIS support displaying tables with generic geometry columns? If not, is there a way to extract just the points and view them as a separate layer, and then just the polygons, and so on? Is there any other way around this?
Example images to show what I'm talking about are below:
Here's the list of tables in QGIS. It correctly identifies the geometry as GEOMETRY:

But when I add it to the layers list, it appears with a strange icon, and nothing appears on the canvas:


texts: Deleting polylines based on features from an attribute table

texts:
I have shapefile with polylines representing a road network. Under the attribute table, there is a column called highway which specifies which each feature belongs to. i.e primary, secondary,tertiary etc.
I want to delete all the polylines in the shapefile except the polylines belong to the "primary" category. Any ideas on how to do this?


texts:
Je suis nouveau sur le site et je suis francophone, je cherche a créer un bouton avec QGIS mais je n'ai pas réussi à faire ce petit exercice . s'il vous plait s'il y a un tutoral ou quelqu'un qui peut m'aider?

I'm new to the site and I am French-speaking. I would like to create a button with QGIS but I haven't yet succeeded with this little exercise; so please is there a tutorial or someone who can help me?


texts:
I have al lot of shapefiles who share zero, one, some or all fields.  I want to write an expression that can be used on all of the shapefiles.

I was wondering if there is something like if "field1" exists do ... else nothing?

In fact I want to create a virtual field that - let's say -  sum every field.


texts: create table with IDs for all arcs downstream of all others

texts: I need to summarize downstream information associated with each arc in an NHD dataset.  I have a table with the downstream ID for stream segment but am not sure how to get all of the downstream IDs.  Any ideas?


texts:
I have one layer (raster geotiff image) published in geoserver with EPSG: 3011 projection. But I want this layer in EPSG 4326 projection for use it in google API web application. I have searched on web and get to know that Geowebcache can do this conversion by adding custom projection. I am not sure, if geowebcache will change the layer projection from EPSG: 3011 to EPSG: 4326. Is it possible in geowebcache? If yes, then, should i need to add custom projection with EPSG: 4326? and then assign that layer (layer with EPSG: 3011) to custom projection.

need brief answer as i am new to geowebcache.


texts: Distance matrix only for a specific rule [QGIS]

texts:
I am having a hard time using distance matrix vector tool in QGIS for a specific need.

I know you need to have two different point layers in order to get a distance matrix, so far so good.

But as I have 3 000 points in one layer and 568 points in the other layer, and only need to calculate the distance between one point to another one, I would like to be able to get the distance matrix rule based.

As an exemple, i would like to set a rule like this:
IF Layer 1 - Column A = Layer 2 - Column B then execute the distance matrix calculation between those points.

Can I do this in qgis ?

QGIS version 3.8.3


texts: inner convex-hulls in a set of 2D points

texts:
A set of 2D Points are scattered randomly (i.e., no specified pattern), we are interested in finding all inner-convex-hulls (ICH) in an order of largest in area to a minimum until the entire study area to be covered by set of ICHs, if possible.

As shown in the following figure, it appears that the green convex-hull is the largest possible inner one. We mean inner implying that no point can be inside in the desired convex-hull. The boundary condition for the region can be a normal (i.e., conventionally recognised) convex-hull for all points. In Figure for the first largest in area inner-convex-hull #1 is selected first. The area covered by #1 is then excluded to avoid overlapping problem of the next generations. It seems a bit confusing and hard, hope Figure helps. We guess may be the concept of largest enclosed ellipse could help. It is however a starting guess.

Update 1:
Well the result of our implementation of the idea given below by Uffe Kousgaard is here:

Numbers are ranks i.e., smaller number, larger area. It shows working, however, we noticed several cases the result is not correct. It may be due to bugs in our implementation or the method as noted by whuber below as comment.

Here is result of the method mentioned by Uffe applied on whuber's data:

Apparently something does NOT work well!

Update 2:
The correct complete solution is as follows (for whuber's example data):

There are three stages, therefore, to complete the solution. We apply the method fully on each stage. That is, at stage one when all triangles were visited for possible largest inner convex-hull, the selected ICH is stored and the obsolete associated edges/points are removed from data. The procedure starts again for the remaining data. Found a solution, the steps just mentioned above apply. After exhausting all iterations (in a lucky situation as here) the area is fully covered by ICHs (here by 3 ICH) which is our ultimate goal. Note that the given answers so far are only one iteration.

Here we show our understanding of whuber's comment/answer.

He was correct that greedy approach won't work as demonstrated above. This disqualifies Uffes idea as a fully correct solution, unfortunately. It looks more challenging thus compared to the initial thoughts.


texts: How can I add WFS layer URL in WPS request builder in GeoServer 2.17?

texts: I tried adding my layer URL under reference input type but no luck. I'm trying to create buffer.


texts: Interpolating within geographic boundary in MapInfo?

texts:
I have two layers: one is rain gauge data, another one is boundary.

I want to create rainfall distribution map within that geographic boundary in MapInfo. Can you say how to interpolate there?


texts:
I need to load json from geoserver to a leaflet map. But I'm getting few errors. Below is my code.

 <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>

  `

I'm getting

  ows:1 Uncaught SyntaxError: Unexpected token :

If I give the datatype as only json, Im getting -

  XMLHttpRequest cannot load
  http://localhost:8080/geoserver/Geospoc/ows?service=WFS&version=1.0.0&reque…poc:ABHI_new&maxFeatures=50&outputFormat=json&format_options=JSON_CALLBACK.
  No 'Access-Control-Allow-Origin' header is present on the requested
  resource. Origin 'null' is therefore not allowed access.

Can anyone help on this?


texts: Average Kernel Density as Dependent Variable in Regression

texts:
I have point pattern dataset and I estimated a kernel surface from it. I want to use a census tracts average kernel density as a dependent variable in regression analysis. Is OLS appropriate or should I also fit a spatial regression model? The dependent variable would inherently be autocorrelated because of how the kernel surface is estimated, but if IV's are autocorrelated I would still need a spatial model, correct?
Forgive me if this is an obvious question as I am fairly new to GIS and working with spatial data.


texts:
Running QGIS 3.18.2-Zürich on Linux Mint 20.1 Ulyssa.  Just tried to add the Viewshed/Visibility Analysis plugin and the Plugin Manager shows it as installed, but it's not in the plugin menu (or any other that I can find). No error messages relating to this have popped up.
Any ideas on how to get this up & running?


texts: ERROR: type "geoms" does not exist. What version of pgRouting should I use for postgres 8.4 & postgis 1.5?

texts:
I am running this on windows 7:

Postgres 8.4
postgis 1.5

I installed pgrouting, but I am getting the error: ERROR: type "geoms" does not exist.

so my question is: which version of pgRouting should I use?

I suppose I should use this one : http://www.wiesenhaan.com/pgrouting/pgRouting-1.03_pg-8.4.2.zip

If the version number is accurate, what other possible causes for such error?

thanks for any advice.


texts:
I'm currently updating a plugin that I wrote a long time ago for Qgis v2. I have a line that add attributes to a vector layer written as below but it's getting an error:

provider.addAttributes([ QgsField(att, QVariant.Int) ])
NameError: name 'QVariant' is not defined

I have looked in the Python documentation for PyQgis v3 for add attribute and found this:
https://qgis.org/pyqgis/master/core/Vector/QgsVectorDataProvider.html?highlight=addattributes#qgis.core.QgsVectorDataProvider.addAttributes
But I don't understand what I need to pass to this function to make it work properly.


texts: Adding features to ArcGIS featureLayer via HTML form and ArcGIS JavaScript API

texts:
I am using the ArcGIS JavaScript API 3.24 and trying to update a featureLayer via an HTML input form. Below is my code:

<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>MyMap</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.7/esri/css/main.css">

Edit Information

                   <form class="">

                           ID

                               <input  type="text" class="" id="Id">

                           Name

                               <input  type="text" class="" id="Name">

                    </form>

                   <button type="button" class="" id="edit-save">Save Changes</button>


texts: Contingency Table between to Vector (polygon) Layers

texts:
I have two polygon layers (Soil Type and Glacial Geology).

I want to see the relation of the two as a contingency table.

Recall doing this in ArcGIS. I forget the tool but it gave me a list of from/to counts. I used a pivot table in Excel to get the contingency table.

How do I do this in QGIS?


texts: How to Georeference 2.5D or Birds Eye View models or Buildings?

texts: I am working on 2.5D mapping.So I don't know how to georeference Birds Eye Viewor 2.5D view buildings.If you did not understand then open http://www.youcity.com there you will find 2.5D buildings.If anyone knows help me.


texts:
Using ogr2ogr I want to export tables from a PostGIS database as KML-files. I have succesfully used an "OGR_STYLE"-column/attribute on my line features to define line width and color, see: http://www.gdal.org/ogr_feature_style.html

An example of a line styling could be: PEN(c:#b3ff00,w:2.5px) - when using ogr2ogr this styling is applied to the output KML feature when displayed in Google Earth.

However, when I try to use this kind of styling for my point features (e.g. SYMBOL(c:#00FF00,id:"points.sym-45,ogr-sym-7") ), the default marker and color is displayed when opening the KML-file in Google Earth.

Is there any way to get this custom styling to work when exporting point features to KML?


texts: No password supplied error from osm2pgsql

texts:
I want to load some power data to a database I have created in postgres (postgis). But when type the following command in the terminal (ubuntu 18.04) I ended up with the following error.
osm2pgsql -r pbf --username=postgres --host=127.0.0.1 --port=5432 --database=de_power_160718 --style power.style -s -C cash_size_in_MB --number-processes nb-processors de_power_160718.osm.pbf
The error I ended up with.
Osm2pgsql failed due to ERROR: Connection to database failed: fe_sendauth: no password supplied
I didn't ended-up with a prompt to input the password which is usually the case. Any ideas what I am doing wrong.


texts: PostGIS 2.0 and Postgres 9.1: ST_Transform => failed to load NAD27-83 correction file (Windowsx 64)

texts:
after making a clean install with the latest stable release of postgis (2.0) i can't perform any transformations:

SELECT ST_Transform(ST_SetSRID('BOX3D(2644033.2454124987 4580030.29781942,2645409.1119216317 4581406.1643285528)'::box3d,3785), 4326)

The above raises the error:

 NOTICE:  PostGIS was unable to transform the point because either no grid shift files were found, or the point does not lie within the range for which the grid shift is defined. Refer to the ST_Transform() section of the PostGIS manual for details on how to configure PostGIS to alter this behaviour.

 ERROR:  transform: couldn't project point (2.64403e+006 4.58003e+006 0): failed to load NAD27-83 correction file (-38)

 ********** Error **********

 ERROR: transform: couldn't project point (2.64403e+006 4.58003e+006 0): failed to load NAD27-83 correction file (-38)
 SQL state: XX000

Tried the other suggestions of copying proj in contrib folder, restarting pg service with no luck.

Any ideas?

UPDATE:
Something really weird is going on here. When executing the statement right after a PG restart it works! Any following statements after that fail!

-- Executing query:
SELECT ST_AsText(ST_Transform(ST_GeomFromText('POINT(2649262.94974021 4579345.79221865)', 3785), 4326))
Total query runtime: 20 ms.
1 row retrieved.

-- Executing query:
SELECT ST_AsText(ST_Transform(ST_GeomFromText('POINT(2649262.94974021 4579345.79221865)', 3785), 4326))
NOTICE:  PostGIS was unable to transform the point because either no grid shift files were found, or the point does not lie within the range for which the grid shift is defined. Refer to the ST_Transform() section of the PostGIS manual for details on how to configure PostGIS to alter this behaviour.

ERROR:  transform: couldn't project point (2.64926e+006 4.57935e+006 0): failed to load NAD27-83 correction file (-38)

*** Error ***

George


texts: Create Editable Layer ArcMap 10.2 Desktop

texts:
In ArcMap 10.2 for desktop, I wish to create an editable layer to add a simple shape to.  As of right now, I have a basemap layer and my selected basemap.  However, since the basemap layer is not editable on its own (via the Editor toolbar), I am unsure of how to proceed to make a square.

My question is: how do I draw a square on my map?  I would like to highlight an area by drawing a square to show the outline of it.  Do I have to add a layer or shapefile?  If so, how do I create a blank, editable layer or shapefile?  It seems like there should be a simple method of drawing a polygon but I can't figure out how to.

For further explanation, I would essentially just like to draw a polygon as if I was doing so in Microsoft Paint then change the color of the outline and set the fill color to be transparent.

Edit: I am trying to create a locator map (I already have a separate data frame for it) and I am also relatively new to ArcMap 10.2.


texts: Overlay Vector Layer on 3D model built from another Vector Layer

texts:
I have 2 vector layers.  One vector layer has data that I built a 3d model from.  I built a choropleth from the other vector layer.  I want to overlay the choropleth layer onto the 3d model built from the other layer.  I guess in a sense that I need to use the values from the '3d' layer as elevation values that I can apply to the choropleth thus overlaying the choropleth over the 3d model.  The layers are disparate (one has zip code polygons and the other has voting district polygons) but I'm trying to do this to show a correlation of one set of information with another.
My experience is nearly exclusively with vector data so using DEM and elevation and working with rasters is new to me. Anyone can point me in the correct direction?


texts: Which are the Geojson css style properties for mapbox.js?

texts:
I try to style a LineString in a Mapbox Map through L.Geojson and all the style properties I could find are: fillColor, colour, weight, opacity.
Does anyone know if there is something else? For example to add a border width, a colour to this border, dashed the line, etc. ?


texts: How to create a vertical scale bar in ArcMap?

texts: Wondering if anyone out there knows how to  create a vertical scale bar in ArcMap? With text I can adjust the angle. Is this possible with a scale bar as well?


texts:
I need to create masks with QGIS of hedgerows for satellite images (raster) segmentation.

I tried with the SCP plugin but I can't use growing algorithm because I only want to keep hedgerows, not forests.

So how can I pixel-wise annotate my raster with QGIS ? Any plugin ?

Do you think there is a semi-supervised technique, better than pixel-wise manual annotation that can solve my problem ?


texts:
I just installed QGIS (2.18) using the OSGeo4W-installer (64-bit). When I use the python-console in QGIS it is possible to run the 'import numpy' statement and to use numpy.

When I open python in the command-window of windows or when I create a stand-alone script it is impossible to import numpy. It gives this:

 ImportError: No module named _ctypes

This is strange because it is the same installation of python and ctypes is installed during the installation of QGIS. Any ideas how to get numpy working in standalone scripts?

Some additional information: I used the default installation of the OSGeo4W installer and my pythonpath is set to:

 C:\OSGeo4W64\apps\Python27\Lib

and python is added to the path-variable:

 C:\OSGeo4W64\bin


texts: Where to find Population Density (shp. or grid) for Europe?

texts: Does anybody know where to download shp. or grid file on European population density (inhabitants/ sq.km)?


texts: OpenLayers trying to use cluster strategy and filter strategy on the same layer

texts:
I have a cluster strategy being used on a vector layer that is working correctly. However, when I try and add the filter strategy to the vector layer, the filtered data does not appear on the map, in fact when I add the filter strategy, neither the cluster strategy or filter strategy appear on the map.  I only see the base layer. I've seen the example in the OpenLayers 2.12 documentation; I have even hardcoded the property 'Value' to see if it would work but it doesnt work. Here is my code:

var year_filter = new OpenLayers.Filter.Comparison({
     Type: OpenLayers.Filter.Comparison.BETWEEN,
     Property: “start_date”,
     Value: '2012/04/22',
     lowerBoundary: new Date(2012, 01,01),
     upperBoundary: new Date(2013, 11, 30)
});

var cluster_strategies = [new OpenLayers.Strategy.Cluster({distance: 42})];
var filter_strategies = [new OpenLayers.Strategy.Filter({filter: year_filter})];
var layer_name = “Active Assignments”;

mapVars.activeAssignmentLayer = new OpenLayers.Layer.JsonLayer(layer_name, {
    location: “/assignments/index.json?mode=active”,
    attributeMap: [“name”, “start_date”, “end_date”, “city”]
    },
    {
    strategies: [cluster_strategies, filter_strategies],
    styleMap:  mapVars.clusterStyleMap
});

mapVars.map.addLayer(mapVars.activeAssignmentLayer);
mapVars.activeAssignmentsLayer.setVisibility(visibility);


texts: Detaching part of feature without detaching all parts from each other?

texts:
On this map, Denmark and Greenland are one feature, and I need them to be two features. How do I split them apart?
If I use Singlepart to Multipart, I create a new layer where there is a feature for each island (denmark has a lot of islands).
Is there a way I can specify that only Greenland as a whole gets split up?


texts: New geographical point won't show on map

texts:
I did recently ask a question about how to add a new point to a PostGIS table. Now when I've got the new point in the table it should be visible on my map, but it isn't.

I'm using Mapnik together with TileStache. The cache for TileStache is temporary turned off, and I've restarted PostgreSQL. It's still not there.

The query I used to add the point was the following:

INSERT INTO osm_transport_points(osm_id, name, type, geometry)
VALUES(1, 'name', 'station', ST_SetSRID(ST_MakePoint(lat, lng), 900913));

Is there something I've missed to flush, or am I doing something else wrong?


texts: I was deploy geoserver.war using WildFly, it can be deploy but the unzip file will be shown at TMP folder. Is there any way to change the path and make it unzip to "deployments" file?


texts: 3DES Import raster layer - Datum appears to convert vertical units twice in QGIS

texts:
I import a 3DES IMG raster layer formatted in NAD83 metric vertical units (EPSG:26911) from the USGS 3D Elevation program. When I look at the elevation values in the layer properties, they appear to be about 1/3.2808 of the expected elevations. The layer comes in with a range of 254 to 304 meters in an area that ranges from 2732 to 3261 feet in the real world. That should translate to a range of 832-994 meters. This roughly corresponds to it converting from feet to meters, but the source is in meters already.

Is there a way to verify the source IMG values?

Is there a way to prevent this conversion (assuming the source data is valid) in QGIS?


texts: PostGIS change from multipoint to point and add column

texts:
I am trying to change the geometry of a PostGIS db from multipoint to point and using this expressions works quite well

SELECT (ST_Dump(the_geom)).geom AS the_POINT_geom
  FROM MULTIPOINT_table;

But when trying to add this as new column via

ALTER TABLE  your_table ADD COLUMN the_POINT_geom double precision;

UPDATE your_table SET the_POINT_geom = (ST_Dump(geom)).geom;

this only causes an error:

  set-returning functions are not allowed in UPDATE

Is there a way to add the point geometry as new column?


texts: Setting layer to be shown in the Overview Panel using PyQGIS?

texts:
I'm at the moment working on some QGIS Plugin and are facing a problem I couldn't find a solution for.

Basically I'm composing a map from many different layers and I want to set one layer to be shown in the Overview Panel (the one from View -> Panels -> Overview Panel).

Is there a way to set programatically which layer should be shown in the overview panel?

And does anybody know if there exists any PyQgis class, so that one can use the overview panel with it's functionality in a stand alone application?

@underdark said what I was looking for. I was all the time searching for something like "MapOverviewPanel" since it's named like this or for "overview panel" etc and had no success. Knowing it's named QgsMapOverviewCanvas (not Panel..) I found the following Link:

For completeness I'll repost the code here:

from PyQt4.QtCore import Qt, QObject
from PyQt4.QtGui import QColor, QVBoxLayout, QDockWidget
from qgis.gui import QgsMapOverviewCanvas
from qgis.utils import iface

layer = iface.activeLayer()
canvas = iface.mapCanvas()
main_window = iface.mainWindow()

new_dock_widget = QDockWidget(u"My doc widget")

layout = QVBoxLayout()

map_canvas_overview = QgsMapOverviewCanvas(
    new_dock_widget,
    canvas
)

layerset = [layer.id()]
map_canvas_overview.setLayerSet(layerset)
map_canvas_overview.setBackgroundColor(QColor(255, 127, 0))
map_canvas_overview.enableAntiAliasing(True)
map_canvas_overview.setMinimumWidth(380)
map_canvas_overview.setMinimumHeight(280)
new_dock_widget.resize(400, 300)
layout.addWidget(map_canvas_overview)

new_dock_widget.setLayout(layout)

main_window.addDockWidget(Qt.RightDockWidgetArea, new_dock_widget)
new_dock_widget.show()

map_canvas_overview.refresh()  # Make the background color disappear?

# Layout optional playground
layout.setContentsMargins(0, 0, 0, 0)

As you can see, this script is not communicating with the existing Overview panel in the Qgis GUI but instead creating a new widget inside the canvas showing the overview there (see image below on the right).

What I would like to do for the plugin, is communicating with the existing QgsMapOverviewCanvas which the user can de-/activate from the View-Panels menu. For the standalone application this was exactly the class reference I was looking for.

How can I communicate with the Overview Panel and not create a widget with a second overview panel inside the map canvas.


texts: Set NaN values to Transparent in Matlab 'geoshow' function?

texts:
I am trying to plot rainfall values in MATLAB using geoshow function.
NaN values should be transparent in the map. However, the plot I am getting comes with dark blue color for NaN values. I have found that this is an issue in MATLAB.

Below is what I am trying;

geoshow(lat,lon,data, 'DisplayType', 'texturemap');

Where, lat, lon, and data are 2-dimensional matrices.
How to set NaN to transparent?


texts:
I have a data set that is classified into 7 landcover classes. I've been asked to expand this data set to a new boundary.

How can I interpolate my existing data out to meet the new boundary?

In the example below:

A is the current data set with two landcover types (1 & 2)
B shows the new boundary that I need to expand and fill
C shows the desired interpolated outcome where 1 & 2 have been interpolated to the new boundary

This needs to be done for several hundred locations - some of which are slivers where the differences are minimal so I would like to avoid manually making the changes.

I suspect this may not be possible in the current form as I can't figure out how to tell the GIS which boundaries it needs to follow and the image above is a simplified example of the sort of boundaries involved.

Buffering is out as this would result in overlaps. A couple of solutions I've thought about include creating a point grid over the existing data and create thiessen polygons. Alternatively the data could be rasterised and then carry out some form of interpolation for the missing areas.

I'm using ArcGIS with a standard licence.


texts: Calculating row in field based off another row in same field using ArcGIS Field Calculator?

texts:
An attributes table has 3 fields: ID, Field1, and Field2 and looks something like this:

  ID | Field1 | Field2
  1. | text......| 10
  2. | text......| NULL
  3. | text2....| NULL
  4. | text2....| 20
  5. | text2....| NULL

In this table there is only 1 value in Field2 for each value of Field1, the rest are all NULL.

And using python in the field calculator in ArcMap I want to calculate the NULL values so that the values in Field2 are the same across all equal values of Field1 so the resulting attribute table looks like:

  ID | Field1 | Field2
  1. | text......| 10
  2. | text......| 10
  3. | text2....| 20
  4. | text2....| 20
  5. | text2....| 20

This is what I can come up with but it will not change the NULL values to what it's reading from the populated row.  What I'm trying to have it do is read the populated Field2 value (as x) for a specific Field1 value then overwrite that and all the other Field2 values that have the same corresponding Field1 value with x.

Pre-Logic Script:

def Calc( field1 , field2 ):
  if field1 == "text" and field2 >= 0:
    x = field2
  else:
    x = None
  return x

Field2=

Calc( !Field1! , !Field2! )


texts: How can you use a custom symbol for either dot density or proportional symbol maps in QGIS? Is there a way to import a symbol of your own such as a drawing or image that you can create or download from somewhere else?


texts: Does anyone know of a way to keep track of last added or edited features in QGIS? A kind of Editor Tracking tool.


texts: How to deal with tables that contains a unique constraint

texts:
I am not quite sure how to title this post, so please bear with me as I explain what is going on...

I am using ArcGIS 10.7.1 with OracleDB as our database back-end.

I have a table with approximately 310k records. I need to append records from another table but it won't let me due to an error within ArcPy which says 'Failure to Insert record' which leads to an error within OracleDB to throw  'ORA 000001 Unique Constraint 'SDE.R78_ROWID_UK' Violated'.

I know that the issue is being caused by duplicate 'ObjectID''s conflicting with one another, but I am not quite how to resolve said issue. I just want to be able to append the new records and assign them a new 'ObjectID'.

I had an idea to unRegister the table & then append, because I have read in ESRI documentation that registering a table to a database is what assigns the 'ObjectID' within ArcGIS geodatabases.

Am I going down the wrong rabbit hole with my thinking for dealing with this problem?


texts: Unable to make infowindow work in CartoDB runtime layer

texts:
I'm trying to personalize a layer created with CartoDB. The layer is created at runtime and the problem is that I cannot make work even easy things like custom infowindow or legends or click interactions. No errors shown in the js console.

I tried with other layers (the ones used with the CartoDB tutorial) and those are working. What it's wrong with mine?

Here's the code I'm using:

function main() {
      var map;
      var urbino = new google.maps.LatLng(43.7292108173, 12.6530746836);
      var mapOptions = {
        zoom: 15,
        center: urbino,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      map = new google.maps.Map(document.getElementById('map'),  mapOptions);
  cartodb.createLayer(map, {
    user_name: 'my_user',
    type: 'cartodb',
    infowindow: true,
    legends: true,
    sublayers: [{
      sql: "SELECT * FROM raw_output",
      cartocss: '#raw_output { marker-opacity: 0.9;}'
      }]
})
.addTo(map)
.on('done', function(layer) {
   var sublayer = layer.getSubLayer(0);

   sublayer.infowindow.set('template', $('#infowindow_template').html());

   sublayer.on('featureClick', function(e, pos, latlng, data) {
      alert("Hey! You clicked " + data.cartodb_id);
    });
  }).on('error', function() {
    console.log("some error occurred");
  });

}

Seems that using runtime layers is not that flexible as using predefined visualizations with the UI...Am I wrong?


texts:
I have an attribute table that has multiple rows with individual land parcels on this.
Several surveys are being carried out by contractors and we are needing to be able to link to their outputs stored online, with hyperlinks to the documents in question each in an individual field.
Due to the nature of the project hyperlink shortening is not an option.
Can currently get part on the link to work in terms of being able to click on it, however it stops at a () and can't see a way to fix it.


texts: How to get parameter popup in Python Add-in ArcGIS?

texts:
I would like to generate a tool in Python Add-in ArcGIS with the popup interface as image attached.

I use the Add-in Button but when I click the Button, the parameter popup does not appear. This my script
    import arcpy
    import pythonaddins

    class ButtonClass1(object):
        """Implementation for A_addin.button (Button)"""
      def __init__(self):
              self.enabled = True
              self.checked = False
      def onClick(self):
        param0 = arcpy.Parameter(displayName="Inputraster",name="in_raster",datatype="GPRasterLayer",
                        parameterType="Required",direction="Input",multiValue=False)
        param1= arcpy.Parameter(displayName="range1",
            name="value_1",datatype="GPLong",parameterType="Optional",
            direction="Input",multiValue=False)
        param1.filter.type = "ValueList"
        param1.filter.list = [1,50]
        param2= arcpy.Parameter(displayName="range2",
            name="value_2",datatype="GPLong",parameterType="Optional"
            direction="Input",multiValue=False)
        param2.filter.type = "ValueList"
        param2.filter.list = [1,50]
        param3=arcpy.Parameter(displayName="output",name="in_raster",datatype="GPRasterLayer",
        parameterType="Required",direction="Output",multiValue=False)

        if (param2[![enter image description here][1]][1]==''):
           outFocalStat = FocalStatistics(input, NbrAnnulus(range_1, range_1, "CELL"),"MINORITY",
                                         "NODATA")
        else:
            outFocalStat= FocalStatistics(input, NbrAnnulus(range_2, range_2, "CELL"),"MINORITY",
                             "NODATA")
        outFocalSat.save(output)


texts: QGIS - Rule-based Symbology - Added Ranges do not carry over Legend entries

texts: When I add ranges to a rule, under Rule-based Symbology, the auto-populated (or modified) legend values do not carry over.  To fix this, I would have to manually change each line in the legend properties of the print layout.  Anyone know of a solution to get the legend values to carry over as it appears they were intended to do?


texts:
I am trying to use the Bertin 1953 map projection, as described in the book "Semiology of graphics" by Jacques Bertin. But I can't find the settings in any of my GIS software.
Does anybody have a solution ?

Thanks,

Luc


texts:
I would like to update the connection property in all .msd in a folder, that already have a certain connection property.
The manual process is to

right click on the .msd,
select "select all",
select "replace all",
select the layer in the local SDE fot that map,
click add
and ok.

Can I do this with ArcPy?

PS.  The reason for doing this is the password changed in the .sde and this is an alternative to republishing the service.


texts: Plotting arrays of coordinates that are all under one column in CSV table?

texts:
I am trying to project specific route paths that all have coordinate points under a single column. Each row represents a different route path. Some of them go on for more than 100 coordinate points so I am trying to figure out the most efficient way to display the data.

If there were just one set of longitude and latitude coordinates, it would be very easy as I could just use text to columns feature to separate them into X and Y components. However, doing this with this data set would generate a lot of columns and make the uploading process very tedious.

I have attached a picture of the data.


texts: problem converting OTF from Mercator to equal area

texts: QGIS 1.8.0 on OSX 10.10.5: I've got continent outlines from Natural Earth that are in EPSG:4326 (degrees) plus USGS tree range data in EPSG:2030 (also degrees). When I set the project CRS to EPSG:4326 I get a Mercator projection showing all layers properly. But when I set an equal area projection such as EPSG:2163, the continent outlines vanish; I only see the USGS layers. I'm sure it's something simple I'm missing, but I'm lost!


texts: After converting vector data to raster with GDAL in Python, I get completely black TIFF file

texts:
I am trying to convert data from vector to raster with GDAL rasterize using by Python. I want to output raster format as TIFF, but the result TIFF opens completely black.

I am writing code benefit from this recipe: Convert an OGR File to a Raster.

I tried different combinations some part of code but I don't have any solution.

from osgeo import gdal, ogr

# Define pixel_size and NoData value of new raster
pixel_size = 25 # I tried different combinations (0.001 etc.)
NoData_value = -9999

# Filename of input OGR file
vector_fn = 'test.shp'

# Filename of the raster Tiff that will be created
raster_fn = 'test.tif'

# Open the data source and read in the extent
source_ds = ogr.Open(vector_fn)
source_layer = source_ds.GetLayer()
x_min, x_max, y_min, y_max = source_layer.GetExtent()

# Create the destination data source
x_res = int((x_max - x_min) / pixel_size)
y_res = int((y_max - y_min) / pixel_size)
target_ds = gdal.GetDriverByName('GTiff').Create(raster_fn, x_res, y_res, 1, gdal.GDT_Byte)
target_ds.SetGeoTransform((x_min, pixel_size, 0, y_max, 0, -pixel_size)) # I tried different combinations
band = target_ds.GetRasterBand(1)
band.SetNoDataValue(NoData_value)

# Rasterize
gdal.RasterizeLayer(target_ds, [1], source_layer, burn_values=[0]) # I tried different combinations


texts: GeoExplorer: Setting more/custom zoom levels

texts:
I have BoundlessGeo's OpenGeo Suite (Geoserver,PostGIS,GeoWebCache,GeoExplorer) installed, and love the web functionality of GeoExplorer, but need my maps to zoom in a few steps further.

So far the only way I can think would be to edit the GeoExplorer.js file (which appears a min/concat of Ext and OpenLayers) to change the default zoom levels, but that seems like a bad way to go.

Any ideas? Is this functionality that should be added to GeoExplorer? Perhaps I could add zoom levels after the map is loaded?


texts:
I was wondering if anyone has tried already to utilise the GPU in tile generation? I have a quite big dataset so tile generation takes a while (especially on high zoom levels) even on a quite high spec machine (Xeon X5355, 24G RAM, NVIDIA Quadro FX 4600).

Geographic extent: [-10, 46, 4, 65] (EPSG:4326)
Zoom levels: 19

There are a couple of things out there (e.g. gumpy) that looks promising, however, I have not find any case studies or references.

I am using MapProxy at the moment, but I am open to any other solution as well.


texts: Road Extraction from Latitude and Longitude using Google Maps API?

texts: Google Maps API allows grabbing roads for individual latitude and longitude specifications (or the nearest roads if the point/s are not on a road). However, the way it requires data to be entered for each individual request makes finding a large number of roads very difficult (in my case ~17000). I was wondering if anyone knew how to automate the process to take a list of points and spit back the relevant roads (either in Google Maps or elsewhere)?


texts: GeoServer refuses startup after security updates

texts:
On an Ubuntu 16.04 a GeoServer 2.14.3 instance worked without problems published by Tomcat. After running unattended-upgrades GeoServer refuses to startup. My guess is that Package: libtomcat8-java or tomcat8 has been updated which causes problems.
Java Version:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Tomcat Version
8.0.32
Java Opts (in /etc/default/tomcat8):
GEOSERVER_DATA_DIR="/data/geoserver-data"
GEOSERVER_LOG_LOCATION="/data/geoserver-logs/geoserver.log"
GEOWEBCACHE_CACHE_DIR="/data/gwc_cache_dir"
GEOFENCE_DIR="$GEOSERVER_DATA_DIR/geofence"

JAVA_OPTS="-Djava.awt.headless=true -XX:MaxPermSize=512m -XX:PermSize=128m -Xms512m -Xmx2048m -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=true -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -DGEOSERVER_DATA_DIR=$GEOSERVER_DATA_DIR -Dgeofence.dir=$GEOFENCE_DIR -DGEOSERVER_LOG_LOCATION=$GEOSERVER_LOG_LOCATION -DGEOWEBCACHE_CACHE_DIR=$GEOWEBCACHE_CACHE_DIR"

Catalina.out
SCHWERWIEGEND: The web application [geoserver] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@653a0a9e]) and a value of type [org.springframework.security.core.context.SecurityContextImpl] (value [org.springframework.security.core.context.SecurityContextImpl@ffffffff: Null authentication]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jan 29, 2021 3:08:17 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
SCHWERWIEGEND: The web application [geoserver] created a ThreadLocal with key of type [java.lang.ThreadLocal.SuppliedThreadLocal] (value [java.lang.ThreadLocal$SuppliedThreadLocal@69cce781]) and a value of type [org.geowebcache.storage.CompositeBlobStore.StoreSuitabilityCheck] (value [EXISTING]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Full catalina.out logs here: https://0bin.net/paste/vhTcUrZ9#8QCsrd9U-XO8TxcWQmWu6uPbEX7lP/D9a5JjY5d9qbw
geoserver.log
Error creating bean with name 'geoWebCacheExtensions': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

Full geoserver.logs here: https://0bin.net/paste/2k4iAlzZ#sPZrPiNIFk5mtUOh4ndZQkpKsUfklTCDfrUHsPCs9vt
How can I get GeoServer up and running again? (I know that the current version is 2.18.2)


texts: Are there any technical limitations as to why GPS can't have a centimetre resolution?

texts:
GPS is not very accurate. I was wondering if this is a technical or economic feasibility problem. If there are no technical barriers, GPS devices with accuracy within 1 centimetre might be possible by 2040. Am assuming this can be achieved with new generation of GPS satellites making use of millimetre wave technology, quantum radar etc
Can anyone please confirm this


texts: Seeking free API that allows to get state and city using name of country and postal code?

texts:
Original question:

I create an web application and I need to obtain the information contained in the question on the backend side of my application.

What I need the most is the automatic retrieval of information about the city based on the name of the country and the postal code. State is optional.

I would like to have free use in commercial use, but if there is no free solution to this question, what is the cheapest solution?

Do you know about such API?

If so, is the use of it related to any quantitative limits or legal restrictions?

Update:

I have in database information about country and postcode provided by users in form on my site. This may apply to the whole world. The names of countries are always correct and the postal code is not necessarily.

What do I want to receive?

If the postal code is incorrect for a given country, I want to receive information: the place does not exist and the state does not exist.

If the postal code is correct for the given country, but there is no administrative division into the state in this country, I want to get the name of the town that this postal code refers to and the information that the state does not exist (or the name of the country).

If the postal code is correct for a given country and there is an administrative division into the state in this country, I would like to receive the name of the location to which the zip code applies and the name of the state or province in which it is located.

By the name of the location I understand: the name of the village, town or town to which the postal code is assigned. If possible, I would not like to get district names here, but if it is problematic, they can be.

By state I understand the largest administrative unit on which the country is divided. It may be a state, a province, a region, an island name, etc. As far as possible, I would not like to receive the names of districts, communes, counties etc. in this place, but if it is problematic, it can be.

Examples:

{"countryName": "United States of America", "postalCode": "90201"}
    => {"locationName": "Los Angeles", "stateName": "California"}

{"countryName": "United Kingdom", "postalCode": "PH33 6DB"}
    => {"locationName": "Fort William", "stateName": "Scotland"}

{"countryName": "Poland", "postalCode": "11-230"}
    => {"locationName": "Biegonity", "stateName": "warmińsko-mazurskie"}

{"countryName": "Italy", "postalCode": "97019"}
    => {"locationName": "Vittoria, "stateName": "Sicilia"}

{"countryName": "Mongolia", "postalCode": "65193"}
    => {"locationName": "Цэцэрлэг", "stateName": "Хангайн бүс"}

However, if it is a big problem to serve information from the whole world, maybe at least I can get information from some continents or countries (e.g. North America and Europe etc.).

What I took into account?

I do not have much experience in this matter, but from what I see most of the Geolocation API works in such a way that it works with geographic co-ordinates of the earth, but it's not my case at the moment.
I think that the Google Geocoding API could handle this task, because I can give the address (maybe even not full like in my case) and it can return a lot of information about the address from which I could extract something..., but I must have an account, and what prevents me from setting up this account is that this service is paid, and I would not like to pay additional costs if I do not have to.
Maybe also it would be a good idea to put own database with the right information, but where to get a reliable database for commercial use, which is free or not too expensive?


texts: Automatic Watershed Delineation in ArcGIS Desktop and Arc Hydro?

texts:
I am trying to delineate watersheds automatically using Arcgis/Arc Hydro.
I got the drainage area contribution of stream segment (part of stream) as shown in figure stream. The corresponding drainage area as shown in figure area. But I am looking for drainage areas/catchment areas as shown in figure Water Shed. In watershed figure , at any point on the stream, it calculates drainage area by considering entire upstream length of the stream. Suppose, if you choose point "8", its catchment/drainage area covers the area of points "9" and "10". Similarly for point "5" covers all points upstream of stream.
I want to get similar automatic watershed delineations.
Please guide me to the software/method to get the result as shown in figure watershed for my entire stream network of an area.


texts: Choosing CRS / PROJ4 string for EURO-Cordex rotated pole projection?

texts:
I have to analyze some CORDEX models which have a rotated pole projection.
The projection is described in this document, see page 10, Table 1, row "Europe high res".

I have tried to describe the proj4 string like so: +proj=ob_tran +o_proj=longlat +o_lon_p=-162.0 +o_lat_p=39.25 +lon_0=180 +lat_0=0, but it seems that this is not correct, at least using sf in R:

st_crs(rsf) <- "+proj=ob_tran +o_proj=longlat +o_lon_p=-162.0 +o_lat_p=39.25 +lon_0=180 +lat_0=0"
Warning message:
In CPL_crs_from_proj4string(x) :
  Cannot import crs from PROJ.4 string `+proj=ob_tran +o_proj=longlat +o_lon_p=-162.0 +o_lat_p=39.25 +lon_0=180 +lat_0=0', missing crs returned

What is the correct CRS for this projection?


texts: Impossible to split line in two parts with QGIS tool 'Split features'

texts:
I'm willing to cut a line in two parts with QGIS.

So I enabled Snapping and I wanted to use the Split Features tool, like I've seen anywhere: one first left click and then another left click on the vertex I choose in order to draw a red line and then right-click to finish the process and split the line.

But it doesn't work properly!

The first picture is what I do with the split features tool, and the second is what I get.

Could someone please explain to me why I'm obtaining that?


texts: Adding style to a published layer using GeoServer REST API with Node.js

texts:
Lets say I have a custom style in GeoServer and after I created a new layer, I want to add the style to that layer. I am using this link for documentation.

function editLayerStyle(layerName, body) {
url = `http://admin:geoserver@IP:PORT/geoserver/rest/layers/{layerName}/styles`

return new Promise((resolve, reject) => {
    request.post(url, {
        body,
        headers: { 'content-type': 'application/vnd.ogc.sld+xml' }
    }, function (error, { statusCode }, body) {
        if (error) {
            return reject({ success: false, statusCode: statusCode, message: body })
        }
        if (statusCode === 201) {
            return resolve({ success: true, message: 'Style added to layer' })
        } else {
            return reject({ success: false, statusCode: statusCode, message: 'Unknown Error' })
        }
    })
})
}

let layerName = 'layer_name'
let body = `
<styles>
    <style>
        <name>{style_name}</name>    /// name of my style
        <filename>{style_name.sld}</filename>  /// format of style
    </style>
<styles>`

try {
    await editLayerStyle(layerName, body)
} catch (error) {
    console.log(error)
}

I get the error even I tried to change the style and the content type.


texts: Generate synthetic trajectory dataset that has global coverage

texts:
I want to generate a spatial trajectory dataset which basically contains tuples - (lat,lon,time), grouped together by an identifier so they form trajectories. In addition, I want this dataset to have global coverage.

I would prefer to use AIS or ADS-B, however, these datasets are not free and the ones that are free have only regional coverage. So, for my study purpose I want to create a synthetic dataset that resembles these datasets.

My purpose is to try different tools (python lib or Postgres extensions) to manage and visualize large trajectory data. How can I generate large trajectory data?


texts:
I have a table with a lot of place names. There are much too many names for all of them to be shown on the print composer map.  Some names are important, and in the column fontsize these have a bigger font size number (for instance 270). I want to prioritize bigger font size names over smaller font size names. So I go to Layer Properties -> Labels -> Placement -> and in Priority chose a data defined override by selecting the field fontsize .

Should this work? It does not give rational results, as some smaller labels are still shown instead of bigger ones.

Qgis version 2.18.7


texts:
I'm a total newbie to GIS, but attempting to build an app similar to zillows that quickly serves up data based on user input.

Currently, i'm collecting the data via shp files which are being store in a postgis database, and then standardized and serialized into json. When standardized, there will be thousands of shapefiles for the user to query upon.

Based on intuition alone, this feels 'heavy'. Is this a standard/decent way to handle the backend or no?

-using geoDjango for server side framework


texts: How to truncate file geodatabase tables with Python?

texts: I need to truncate file geodatabase tables (1 or all) with Python. What is the code for that?


texts: Percent cover based equation for horizontal ground visibility?

texts:
I'm trying to put together a layer representing horizontal visibility at ground level. I'm thinking of using the EVC (vegetation cover) layer from the landfire project (see http://www.landfire.gov/vegetation.php). However, I know that, for instance, 70% cover does not correspond directly to 30% horizontal visibility...I imagine there is a threshold at which the cover saturates any visibility, with visibility increasing in a non-linear way as percent cover decreases - probably calculated over some neighborhood (100 meters, maybe?). I'm thinking of cooking something up myself along these lines.

However, I'm wondering if there hasn't been work done in this realm, or some theory to exploit that anyone may be aware of. A lit/google search hasn't turned up much of interest.


texts:
I work on QGIS Plugin in python. This plugin load several Print layout in a QGIS project. These print layout contain a legend. I would like to be able to remove a layer from the composer legend without this layer being deleted in the main map. For that I found the code of Ben W on GIS Stack Exchange Hide legend entries in PyQGIS and it works very well. But in my case the layers are organized in groups like in the photo below. When I use groups the code doesn't work anymore. There is no error but the layer is not deleted from the legend. How could I arrange this code to work with layers that are in groups ?
Code of Ben W that I tried:
project = QgsProject().instance()
layer_to_remove = project.mapLayersByName('Your Layer Name')[0]
layout = project.layoutManager().layoutByName('Your Layout Name')
legend = [i for i in layout.items() if isinstance(i, QgsLayoutItemLegend)][0]
legend.setAutoUpdateModel(False)
legend.model().rootGroup().removeLayer(layer_to_remove)
legend.adjustBoxSize()
layout.refresh()

Organisation of my layers:


texts: Is there an easy way to find closest point on line in iOS?

texts:
I have a coordinate, and a path. I need to find a point on path closest to my coordinate.
Something like http://turfjs.org/static/docs/module-turf_point-on-line.html but for iOS. ArcGIS doesn't seem to have such functionality. Or I don't see it.
In worst case I may implement own algorithm. But it is really hard to wrap head around math formulas.