texts: Using ArcPy to check for duplicates AND Latest date?

texts:
I am stumped (and new to Python).
I have a feature class with a field that contains a centroid in MGRS. That field is called MGRS.
I also have another field called ED_Date that is the production date of a map.

The MGRS field has many coincidental points because there may be several maps over the same area, but produced at different dates.

I need to look for duplicate MGRS attributes, then FROM those, get the latest one into a selection. After this iterates through the entire table, export those selected features into a new class or maybe append them. I have not decided yet.

Below is an example of my table:

I have thought about trying to do a dictionary of the MGRS field and then selecting the dates.


texts: gdal: create a tile index or VRT from a folder of downloaded map tiles

texts:
I need to use GDAL tools to either create a tile index or create a VRT from a folder full of map tiles. The folder is in the format:

<zoom_level>
     |
     |-- <row_number>
     |       |
     |       |-- <column_number>.png
     |       |-- <column_number>.png
     |-- <row_number>
     |       |
     .       |-- <column_number>.png
     .       |-- <column_number>.png

They're standard slippy-grid / MTS / WMS tiles, all png files.

I can't seem to figure out the right command to do this... does anyone know what I should do here?


texts: Emulate a tilted / perspective global projection

texts:
I am looking to emulate the perspective of the base map used in this image, using ArcMap 10.4.

Basically an isometric view of all the continents with the view at an angle.  the Southern Hemisphere continents appear larger and the northern hemisphere look smaller.

I can simulate this view in ArcScene, however I find it difficult to get the symbology to work as I need it to.


texts: Error in executing commands in GRASS GIS

texts:
I'm using Grass 6.4.3RC2. I have a problem because when I execute the command:
r.radcov csv_file=cell_list_hataDEM_umts_amc_testTEST.csv dem_map-AlbSRTMdem@PERMANENT clutter_map=AlbClut@PERMANENT out_map=dita_hataDEM_umts_amc_TEST frequency=2500 --o

It an error appears:

READING AND CHECIKNG THE RADIO SECTOR CSV TABLE...
ERROR: Cannot open Radio cell/sector input file

I added the file "antennamap" and file "cell_list_hataDEM_umts_amc_testTEST, I have done as is described in GRASS-RaPlaT Radio Planning Tool for GRASS, User Manual, page 4 and page 8.
I'm looking forward of any solution.


texts:
I would like to be able to log execution times of the algorithms launched in the toolbox. I see there's a history of all the launched commands with start times but there is nothing given about the duration of the process.

Is there a way to achieve that ?


texts: Finding out whether an EPSG code is geographic or projected in Python

texts: Can one tell that from the number of digits or a similar rule?


texts:
I created a basic dashboard with MVC 4, visual studio 2012, The dashboard displays a Google map. Here is an image of the dashboard:

My intention is to be able to take this Kml file:

And successfully overlay it, onto the Google map, on the dashboard.

I have heard about the 'Geomxl3', the Kml map parser, below is my layout of how i used the Geoxml3:

However, it built without a problem and the dashboard opened up without a problem, but, there was no kml to be seen,the kml had not been overlayed. Is there a mistake in my script? am i not using the correct method of overlaying kml files onto a a Google map? must i use the Xml schema of my Kml file instead of the kml file itself? any advice would be helpful.

Please note:
I have the Google Maps Api Javascript V3, I am using MVC4, visual studio 2012, My Kml is stored on a local server.


texts: How to pass unencoded/properly encoded url query string to ArcGIS Online Web App Builder

texts:
I am attempting to add a form to an existing html that allows the user to type in a search term and query and existing ArcGIS Online map. For example, a person would enter a coordinate into the form such as:

The resulting url should be (unencoded) : www.arcgis.com/apps/webappviewer/index.html?find=-112.111 33.3456

encoded it should look like: www.arcgis.com/apps/webappviewer/index.html?find=-112.111%2033.3456

The problem is that because the parameter (find) is after the "?" the whitespace in the url is encoded with a "+" instead of "%20". The url becomes: www.arcgis.com/apps/webappviewer/index.html?find=-112.111+33.3456

This causes  the feature search to search for :  which results in not finding the coordinate.

My question is how can I get a html form to pass the search query either unencoded, or having the whitespace encoded as "%20" instead of "+"? I am using the "get" method and have tried having a javascript function replace the whitespace with "%20", but the % symbol gets encoded.


texts: GRASS r.catchment causes r.reclass error

texts:
I'm using GRASS 7.0.3 on Windows 7 (part of the QGIS 2.14 distribution) with the extra installed add-on module r.catchment. I'm trying to use GRASS to calculate a catchment raster, but I keep getting this error related to the use of the r.reclass module by r.catchment (see output below).

Here are the GRASS commands that I execute:

v.in.ogr input=location_utm.shp output=V_LOCATION_UTM --overwrite --quiet
r.in.gdal input=astgtm_utm.img output=R_ASTGTM_UTM --overwrite --quiet
r.catchment elevation=R_ASTGTM_UTM start_points=V_LOCATION_UTM buffer=R_CATCHMENT sigma=15 area=100000000 map_val=1 --verbose
r.out.gdal input=R_CATCHMENT output=catchment.img

This is the output (and error) I am getting:

C:\Temp>r.catchment elevation=R_ASTGTM_UTM start_points=V_LOCATION_UTM buffer=R_CATCHMENT sigma=15 area=100000000 map_val=1 --verbose
There is already a MASK in place, and you have also selected to mask slope
values above 15.
The high slope areas (slope mask) will be temporarily added to current
MASKED areas for the calcualtion of the catchment geometry.
The original MASK will be restored when the module finishes
Wanted buffer area=100000000
step 1 of 4: Calculating cost surface
Calculating for time costs only
Creating optional slope mask
 100%
Maximum cost distance value 58426 covers an area of 2243889760 square map
units
Commencing to find a catchment configuration.....
Catchment configuration found!
Cost cutoff 5671 produces a catchment of 100003308 square map units.
Creating output map
ERROR: Cannot open rules file <c:\users\xxx\appdata\local\temp\tmpeopqnp>
Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts/r.catchment.py", line 379, in <module>
    main()
  File "C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts/r.catchment.py", line 329, in main
    output='cost.reclass.%s' % pid, rules=temp.name)
  File "C:\PROGRA~1\QGISES~1\apps\grass\grass-7.0.3\etc\python\grass\script\core.py", line 394, in run_command
    return handle_errors(returncode, returncode, args, kwargs)
  File "C:\PROGRA~1\QGISES~1\apps\grass\grass-7.0.3\etc\python\grass\script\core.py", line 312, in handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['r.reclass', 'rules=c:\\users\\xxx\\appdata\\local\\temp\\tmpeopqnp', 'input=temporary.cost.9304', 'output=cost.reclass.9304'] ended with error
Process ended with non-zero return code 1. See errors in the (error) output.

I have no idea why this error occurs or how to solve this.


texts: Function for Selecting Points in a Polygon

texts:
I've been banging on this for a few hours, but since I'm relatively new to PostgreSQL and PostGIS, I can't find the solution. I'm trying to create a stored procedure (function) which will return all locations whose specified point geometry is within the specified polygon.

Here is my PostgreSQL function:

CREATE OR REPLACE FUNCTION public.spGeoPoly(polystring text) RETURNS setof locations
AS $$
BEGIN
RETURN QUERY
SELECT * FROM locations
WHERE ST_Contains(ST_GeomFromText('POLYGON((polystring))', 4326), point_geom);
END;
$$ LANGUAGE plpgsql;

I've tested this with a hard-coded polystring, which works.  However, when I call the function with an input string such as:

SELECT spGeoPoly('50.4 8.2,50.3 9.3,49.9 9.5,49.7 8.8,49.9 7.8,50.4 8.2');

I get an error:

ERROR:  parse error - invalid geometry
HINT:  "polygon((" <-- parse error at position 9 within geometry

I assume my input text is not getting transformed properly into the format necessary to create the polygon, since position 9 is the start of the polygon parameter string. How can I fix the text parameter?  I'm sure there's something simple, but none of the examples I've found for GeomFromText use a parameter, they all use hard-coded values...

I'm using PostgreSQL 8.4.13 and PostGIS 1.5.8.

Edit:  I knew it was something simple.  Unknown to me, PostgreSQL uses '||' for text concat, so the query should be:

WHERE ST_Contains(ST_GeomFromText('POLYGON((' || polystring || '))', 4326), point_geom);

That makes it work!


texts: Filter MapComposer legend to only show layers visible on the map

texts:
I have written a function in Python / PyQGIS (no standalone application, so copy/paste it to the Python console editor to run it) that takes a VectorLayer as argument, creates a MapRenderer object for that layer, then creates a MapComposer object using the MapRenderer, adds the map, a title and a legend to the composition and saves it as a png file.

Everything works fine except for the fact that the legend always includes all layers that are currently visible in the QGIS layer widget. What I like to have is to show only the layer in the legend that I passed to the MapRenderer (and then to the composition). See the following example.

That's what the QGIS layer widget looks like: Two layers are loaded, one is selected.

That is what the output image looks like when running the script below: Both layers from the layer widget are included in the legend instead of only the first layer (which is the only one visible in the plot).

This is my script. When trying to run it yourself, set the plotdir parameter at the top of it to match your desired output directory. The script does not load any layers, so this has to be done in advance.

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

plotdir = r'C:\pyqgis_plots\\'

def saveImagesWithMapComposer(layer):

    print 'saving images with map composer'

    #######
    # set up layer set, extent and create a map renderer
    #######
    mapRenderer = QgsMapSettings() #new in QGIS 2.4 - replaces QgsMapRenderer()
    #mapRenderer = QgsMapRenderer()
    layerset = [layer.id()]
    mapRenderer.setLayers(layerset) #when using QgsMapRenderer, replace this with setLayerSet(layerset)
    mapRectangle = mapRenderer.fullExtent()
    mapRenderer.setExtent(mapRectangle)
    mapRenderer.setOutputSize(QSize(1600,1200)) #when using QgsMapRenderer(), setOutputSize needs a second argument 'int dpi'

    #######
    # create a composition and pass the renderer
    #######
    comp = QgsComposition(mapRenderer)
    comp.setPlotStyle(QgsComposition.Print)
    dpi = comp.printResolution()
    dpmm = dpi / 25.4
    width = int(dpmm * comp.paperWidth())
    height = int(dpmm * comp.paperHeight())

    #######
    # add map to the composition
    #######
    x, y = 0, 0
    w, h = comp.paperWidth(), comp.paperHeight()
    composerMap = QgsComposerMap(comp, x, y, w, h)
    comp.addItem(composerMap)

    #######
    # create label
    #######
    composerLabel = QgsComposerLabel(comp)
    composerLabel.setText(layer.name())
    composerLabel.adjustSizeToText()
    comp.addItem(composerLabel)
    composerLabel.setItemPosition(20,10)

    #######
    # create legend
    #######
    composerLegend = QgsComposerLegend(comp)
    composerLegend.model().setLayerSet(mapRenderer.layers()) #when using QgsMapRenderer, use layerSet() instead of layers()
    composerLegend.setTitle('')
    comp.addItem(composerLegend)
    composerLegend.setItemPosition(20,20)

    #######
    # create image and initialize
    #######
    image = QImage(QSize(width, height), QImage.Format_ARGB32)
    image.setDotsPerMeterX(dpmm * 1000)
    image.setDotsPerMeterY(dpmm * 1000)
    image.fill(0)

    #######
    # Render composition
    #######
    imagePainter = QPainter(image)
    sourceArea = QRectF(0, 0, comp.paperWidth(), comp.paperHeight())
    targetArea = QRectF(0, 0, width, height)
    comp.render(imagePainter, targetArea, sourceArea)
    imagePainter.end()

    # Save image to disk (other extensions possible)
    image.save(plotdir + layer.name() + '.png', 'png')

    return

###################################
# call function
###################################

# get first layer from the canvas and pass it to the plot function
layers = iface.legendInterface().layers()
layer = layers[0]

saveImagesWithMapComposer(layer)

print 'finished'

I already tried using the deprecated QgsMapRenderer class instead of QgsMapSettings (see inline comments what has to be changed to try this) but the result is the same.

Any suggestions what I am missing here?


texts: Using overlap with different layer file to create a simple Y/N field in attributes of another layer

texts:
I have two layers, which I wish to use one of to educate and populate an attribute field in the other layer with a simple Yes/No for if they overlap in terms of location.

Is there a simple way to do this?


texts:
I have a point shapefile where I set up a hyperlink to a .pdf file.  In Arc the hyperlink works fine, and the desired .pdf file is opened when I click on the specific feature.
If that layer is then converted to a .kmz file, the hyperlink no longer works when the new .kmz file is opened in Google Earth.  Does the hyperlink feature only work in Arc with a shapefile, or should it translate over to Google Earth?


texts: Labeling features with font dependent on polygon area?

texts: i want to label my island data with variety of size of text based on  the island area for example island that have more than 100km, i want to label it using Arial 12 while island less than 100km i want to label using Arial 10..im label it using maplex.


texts:
I would very much like to purchase a globe that has no political borders. I don't want the continents all diced up into countries and I certainly don't want any names or labels: just the geography of our planet. I suppose I wouldn't mind geographical wonders, tectonic plates, or other such intrinsic features labeled, but I want nothing political.

I've searched and searched and haven't been able to find anything. Does anyone know where I could purchase such a globe?


texts:
I have seen this question come up before and have tried the related fixes as best as I could but nothing seems to work.

I am running the most recent LTR of QGIS, 3.4.8 but my GRASS plugin cannot be found. In the Plugins tab of the Log Messages, it says GRASS was loaded. In the Messages tab, this is what I see:

  2019-06-19T09:56:23     WARNING    GRASS init error : GRASS was not found in 'C:/PROGRA~2/QGIS 3.4/apps/grass/grass76' (GISBASE), provider and plugin will not work.

I have tried:

Uninstalling and deleting all program files and then re-installing it
Downloading the latest version, 3.6.3
Downloading with the OSGeo4W installer
Looking at the GRASS options menu and resetting the path to the directory and the modules
Going into GRASS GIS 7.6.1 and making sure the database directory is set
Installing Windows 10 updates

Links to previous related posts:

GRASS GIS Plugin not loading in QGIS 3

GRASS not working with QGIS 3.6


texts: How to save python ogr2ogr shapefile to memory, and stream to web client as zip

texts:
I'm trying to accomplish something similar to the site http://ogre.adc4gis.com/

I want to be able to manipulate a geojson file, and send it to the client as a shapefile, in a single zip file.

I'm writing the program in python, and I see that the site mentioned above is using Javascript.

I've already been able to save the json as a shapefile with the following command:

ogr2ogr.main(["", "-f", "ESRI Shapefile", "fishnet", "fishnet.json"])

This saves our geojson file as 4 separate files in the folder fishnet.  I'm wondering how I can avoid saving files to the harddisk and just serve the zip file to the client in memory.

Update

So far I've zipped it.  Still yet to stream to the client, but I think it should be easy enough to find some resources on StringIO.

Basically, what I've done so far is to go ahead and save the files to disk, get the data from them, convert them, and then delete them (after they've been streamed):

import ogr2ogr, shutil, uuid
name_of_files = 'custom_name_here'
# random directory name
# http://stackoverflow.com/questions/10501247/best-way-to-generate-random-file-names-in-python
directory_for_files = str(uuid.uuid4())
# -nln gives a custom name to files in folder
# string without .shp gets saved to directory as four files
ogr2ogr.main(['','-f','ESRI Shapefile','-nln', name_of_files, directory_for_files, 'test.json'])
# create zip from directory with same name
shutil.make_archive(directory_for_files, "zip", directory_for_files)
# remove directory
shutil.rmtree(directory_for_files)


texts: ArcGIS - Point Density with Geocode data - not working

texts:
I would like to create a simple density map based on a geocoded data but the output shows up as blank.

Below are steps I took:

Add data - Import raw data based on Excel which has postal code (field: postal) and # of freq (field: visit_count).
Geocode data - the raw data is geo-coded and saved as a layer named ABC
I go to Spatial Analyst Tool -> Point Density
selected ABC as input point features, population is selected as visit_count
output cell size set as 50
neighborhood - circle
radius set as 1000
After I run the results show High: 3.40282e+038 to Low: -3.40282e+038 and nothing shows up on the map view.
 When i looked at the results tab it shows a warning Skipping feature(s) because of NULL or EMPTY geometry.

Could anyone help me identify how to go about fixing this?

Edit: Below is the before & after point density.


texts: How to manage user privilege on layers to Arcgis 10 Desktop?

texts:
Problem:

I am a Computer Analyst on a town hall.  Here we have the sector A and B. Both work in ArcGIS 10 Desktop. The sector A has granted to access/edit everything. The sector A has all the privileges! The sector B can see everything. But, the sector B can only edit some Layers/Dataset.
I'm having problems with the Oracle user B sector in SDE.

What I tried:

I tried to grant privileges in Oracle. To the user of sector B I grant to access/edit all. I only blocked the sector B some tables (layers). That he can't change. The user of the sector B can access the ArcGIS Desktop and can see all Layers. But, the user of sector B get an error when, by the ArcGIS Desktop, he try to edit a Layer that he has privileges. I can't understand, because I grant all the tables, including the temp tables of ArcGIS, just don't grant some tables (of some layers). The error occurs when giving a "Start editing" a layer that user B has full permission.

That is the description of the error:

"
Error: No editable layers
ArcGIS 10
None of the layers in your map can be edited. You cannot start an edit session on this data.
Solution: Make sure that the data you want to edit is in a format that can be edited in ArcGIS and that you have the proper permissions to edit it.
More information: In ArcGIS, you can edit data from shapefiles; geodatabase feature classes; standalone table formats, such as INFO or .dbf; and the attribute tables of certain rasters. If your map has data in any other format, you are unable to edit it. Make sure that the data you are attempting to edit is in one of these supported formats. If the data is not from any of these workspaces, it may be possible to export it to one of these formats to be able to edit it.
Many times, you encounter this error along with layer warnings that may provide more specific reasons why the layer cannot be edited. For example, if you have data from a geodatabase in the map but the feature classes are read-only, you also receive a warning message telling you that you need to check the permissions.
"

Question:

Anyone have any suggestions? How do you control your users in ArcGIS 10 Desktop?
What I did wrong?  Can I manage in ArcGIS Server Manager users of ArcGIS Desktop?

The idea is simple, the user sector B in ArcGIS Desktop can not access some layers. But I do not know do it.


texts: How to switch base layer programmatically in MapBox/Leaflet

texts: I have multiple base layers, and need to switch them programmatically, dependent on various actions and states in my application. Can't find how, for the life of me.


texts:
I have several raster files (raster_1, raster_2, [...], raster_n) and a point shapefile. The point shapefile (point.shp) was created using "generatepointspixelcentroidsinsidepolygons" so my points are located at the center of each raster pixel.

processing.runalg('qgis:generatepointspixelcentroidsinsidepolygons',".../raster_1.tif","input.shp", "point.shp")

My goal is to extract raster_n value to each point. This is possible using the point sampling tool plugin. However I want to use the python command on QGIS.

There must be a solution similar to:

processing.runald('qgis:pointsamplingtool',"raster_1","raster_2","raster_n","point.shp","output.shp"


texts: ArcMap addin well-known folder not saved in mxd

texts:
We have a mix of Win7 and Win8 computers, with ArcGis 10.2.1

On the Win7 computers, under Add-In Manager > Options tab, we can add a well-known folder to the box "Search for additional Add-Ins in these folders".  This path is retained by ArcMap, (possibly in the Normal.mxt since it is present in a blank ArcMap doc, before opening an mxd).

This path is not retained on Win8 machines.

Anyone encountered and solved this?


texts: Projecting longitude / latitude from shapefile

texts:
I have a shapefile with this information embedded:

Projected Coordinate System:

CH1903+_LV95
[+proj=somerc +a=6377397.155000 +b=6356078.962818 +x_0=2600000.0 +y_0=1200000.0 +k_0=1.0 +alpha=90.0 +lon_0=7.439583333333333 +lat_0=46.95240555555556 +no_defs]

How would I convert a point from this shape (as example:
(2883434.7562500015, 1208358.5424999967, -1.4551915228366852E-11)
to a normal longitude/latitude) ?

Anyone know the correct formula?


texts:
Suppose one wants to make polygons A and B, and their respective attributes to be one unique polygon C. What is this GIS operation called?
Is there any difference in GIS terminology about "joining" and "merging" geometries? Or does the terminology expand to different concepts besides geometries?

As an example, I could not find the answer reading tag wikis in GIS SE.
Currently, the excerpt and wiki of merge says:

In the context of GIS, merge typically refers to either

combining two or more geometries into a new, single geometry
combining the records of two different tables into a single table (similar to append)
combining multiple raster files (stacked or adjacent) into one.

A specific type or method of merging is dissolve.

And the excerpt of joins states:

The process of connecting two or more datasets based on a common attribute or spatial location.

"Connecting two or more datasets based on a common attribute" seems to be the same as the second bullet in the merge wiki.


texts: Connecting to *.sde file in database IDE

texts:
I have no experience with connecting to ArcSDE databases other than opening user on prod.sde connection files in Catalog, so I have no intuition for entering information about hosts/servers/etc. In our case, the data I would like to access is on an Oracle database using a 12c client.

Is it possible to connect to, and query, an ArcSDE database through an IDE like DataGrip?


texts: How to Connect to .geodatabase Replica Created File by ArcMap

texts:
I am able to create Two Way Replica from ArcGIS Server 10.4.1 which has a Feature service containing only one Feature Class( Transformers feature class) and I am getting a file like
_ags_data{01D644C0D8F0434DA6E65607141EC0EC}.geodatabase in ArcGIS Server directory C:\arcgisserver\directories\arcgisoutput\Test_MapServer after creating the Replica.

Now I would like to check this file in an ArcMap session. I tried to connect to it through Database Connection tool but there is not any support for SQLLite on there. I also tried this link to Connect to SQLite from ArcGIS for Desktop but it says that the file must have the extension .sqlite (or .SQLITE or .SQLite) and not .geodatabase

Can you please let me know if there is a way to see the actual data in the _ags_data{01D644C0D8F0434DA6E65607141EC0EC}.geodatabase through ArcMap? I already tried to open the file by SQLLite Studio but the Feature class Transformers table in empty! so where are the actual attributes?


texts: I have a line geometry in PostGIS and I am wondering how I would break the line into 100m segments. Is there a function for this?


texts:
I'm having a bit of a problem with a script on a particular machine.

==========================================================

import arcpy,sys

class AddLayer(object):

    '''
    classdocs
    '''

   def __init__(self,sNewHabFile,workspace):

        scriptPath = sys.path[0]
        f = file(scriptPath + chr(92) +'AddLayerFile_ArcGIS_log.txt', 'w') # open for 'w'riting

        f.write("Add layer file initialised") # write text to file
        f.write("\n")

        layerFile = sNewHabFile + ".lyr"
        f.write(str(layerFile)) # write text to file
        f.write("\n")

        mxd = arcpy.mapping.MapDocument("CURRENT")

        f.write(str(mxd.filePath)) # write text to file
        f.write("\n")

        addLayer = arcpy.mapping.Layer(layerFile)

        f.write(str(addLayer.name)) # write text to file
        f.write("\n")

        df = arcpy.mapping.ListDataFrames(mxd)[0]

        f.write(str(df.name)) # write text to file
        f.write("\n")

        arcpy.mapping.AddLayer(df, addLayer, "TOP")

        f.write("Layer added?") # write text to file
        f.write("\n")

        layer = arcpy.mapping.ListLayers(mxd)[0]

        f.write("First layer is called:" + str(layer.name)) # write text to file
        f.write("\n")

        arcpy.RefreshTOC()
        '''
        end
        '''

============================================================

It's working fine on my machine, but testing the whole tool on another machine, AddLayer here and in another module I have written does not throw up an error, it just doesn't add the final outputs to the map.

As you can see above I have writen to a text file and
layer = arcpy.mapping.ListLayers(mxd)[0]

and

f.write("First layer is called:" + str(layer.name))

are writing the correct layer to the text document, but I can't see anything in the TOC.

I can manually add the created data.

On my original machine, which is working I am running:

ArcView single use with Spatial Analyst, 4th or 5th service pack I think.

The machine that is not working is running ArcEditor concurrent with access to Spatial Analyst, this is likely to be a much earlier service pack (either none or 1 or 2).

Does anyone have any ideas?


texts: Moving multipoint using ArcGIS API for JavaScript?

texts:
I am trying to move a multipoint object using the edit toolbar, but I keep getting the below error:

> Uncaught Error: [esri.toolbars.Edit::activate] Unable to activate the
> tool. Check if the tool is valid for the given geometry type.

I have read that using editToolbar.activate(Edit.MOVE, selected); is not possible for multipoint geometries. Is there any other way to do this? I am trying to move all the points at the same time not one at a time, this I can achieve using the following : editToolbar.activate(Edit.EDIT_VERTICES, selected);

I am using  ArcGIS JS API (v3.22)


texts: Efficient processing of ST_ValueCount Results in Postgresql

texts:
General Problem: I have a table of rasters. The rasters are classified MSI images, so each pixel is an integer indicating the class of the pixel. For a number of regions, I am querying pixel counts in those regions, i.e., making a table like:

filename | total pixel count | pixels in class 0 | pixels in class 1 | ...

Specific Problem: My problem is that the script takes a long time, so I want to get the runtime down.

What I've tried: Full disclosure, I'm not well versed in postgresql. Also, note that in the two code snippets below, the most inner sub-selects are identical. Here's my first attempt:

EXPLAIN ANALYZE SELECT
    filename AS filename,
    ST_Count(rast,1) AS totalpixels,
    (ST_ValueCount(rast,1,false,ARRAY[0.0])).count AS nodata,
    (ST_ValueCount(rast,1,false,ARRAY[1.0])).count AS lowveg,
    (ST_ValueCount(rast,1,false,ARRAY[2.0])).count AS highveg,
    (ST_ValueCount(rast,1,false,ARRAY[12.0])).count AS clouds,
    (ST_ValueCount(rast,1,false,ARRAY[13.0])).count AS shadow
FROM
(
    SELECT
        filename,
        ST_Clip(rast,ST_GeomFromText('POLYGON ((125.229490000007 6.900509999999138, 125.2404900000019 6.900509999999138, 125.2404900000019 6.889510000004179, 125.229490000007 6.889510000004179, 125.229490000007 6.900509999999138))',4326)) AS rast
    FROM
        rasters
    WHERE
        ST_Intersects(rast,ST_GeomFromText('POLYGON ((125.229490000007 6.900509999999138, 125.2404900000019 6.900509999999138, 125.2404900000019 6.889510000004179, 125.229490000007 6.889510000004179, 125.229490000007 6.900509999999138))',4326))
) AS source_rasters;

This runs in 185 ms. I thought surely it's sub-optimal to ST_ValueCount so many times. So here's my improved attempt -- running it once and converting the SETOF result to an array so that I can index the values:

EXPLAIN ANALYZE SELECT
    filename AS filename,
    totalpixels AS totalpixels,
    pxcnt[1] AS nodata,
    pxcnt[2] AS lowveg,
    pxcnt[3] AS highveg,
    pxcnt[4] AS clouds,
    pxcnt[5] AS shadow
FROM
(
    SELECT
        filename AS filename,
        ST_Count(rast,1,false) AS totalpixels,
        ARRAY( SELECT count FROM ST_ValueCount(rast,1,false,ARRAY[0.0,1.0,2.0,12.0,13.0]) ) AS pxcnt
    FROM
    (
        SELECT
            filename,
            ST_Clip(rast,ST_GeomFromText('POLYGON ((125.229490000007 6.900509999999138, 125.2404900000019 6.900509999999138, 125.2404900000019 6.889510000004179, 125.229490000007 6.889510000004179, 125.229490000007 6.900509999999138))',4326)) AS rast
        FROM
            rasters
        WHERE
            ST_Intersects(rast,ST_GeomFromText('POLYGON ((125.229490000007 6.900509999999138, 125.2404900000019 6.900509999999138, 125.2404900000019 6.889510000004179, 125.229490000007 6.889510000004179, 125.229490000007 6.900509999999138))',4326))
    ) AS source_rasters
) AS f;

But it only reduced the runtime to 155 ms.

But then I thought maybe the ST_ValueCount is only a small portion of the total work cost, so this is all the improvement I could expect. However, if I reference just one result:

EXPLAIN ANALYZE SELECT
    filename AS filename,
    totalpixels AS totalpixels,
    pxcnt[1] AS nodata
FROM
...

It cuts the runtime down to 55 ms, which I don't understand because it seems to have done all the work of intersecting, clipping, counting, etc.

Question: So is there a faster way to unpack the results of ST_ValueCount, or an obvious way to speed this up in general?

Just for what it's worth, I've made other incremental improvements since I began, e.g., tiling the rasters was a big improvement. At this point, this seems like the most likely opportunity for a significant improvement, please let me know if I might be wrong about that.


texts: Getting EPSG codes from Dotspatial.Projections

texts:
I have installed Dotspatial.Projections in my Visual Studio C# project.  I have not found a way to get the EPSG codes.

Is there a way to do this using the Dotspatial.Projections library?


texts: Why is SAGA kriging slower in QGIS than in SAGA itself?

texts: I'm using QGIS for a while. In my opinion the SAGA kriging tool (processing toolbox) is very slow. Is that an QGIS issue? I tried to interpolate a point layer with 300.000 points (I know it is big) and it takes round about 1 hour to get the interpolated result. In SAGA it works much more faster.


texts: Stripes in slope raster calculated from aster-dem in QGIS

texts:
I calculated a slope map from Europe based on the aster-DEM with raster->analysis->slope (gdaldem) in QGIS. But this results in vertical stripes throughout the map.

I thought that this might be a problem of the input projection. But the same happens for WGS84 EPSG:4326 (with scale = 111120) as well as the metric ETRS89 EPSG:3035.
Does anyone has an idea where this comes from? Do I have to worry that the slopes are incorrect?


texts: Polygons vs MultiPolygons in Google Earth Engine

texts:
Is there an advantage to work with Polygons versus MultiPolygons in Google Earth Engine? I need to subdivide a region of interest into many sub-areas for which I will calculate the evolution of some variable. In GEE you can draw many different polygons and then repeat the operation but you can also define a MultiPolygon but I don't see the benefits of doing it. As an example, I'm calculating the mean of the values of B (a collection of images filtered by dates) over time.

    var C = Chart.image.series(B, MultiPolygon, ee.Reducer.mean(),
    1000, 'system:time_start');
    print(C);


texts: Exporting terrain (elevation) raster data and output is not specified pixel size using Google Earth Engine

texts:
I am new to Google Earth Engine, and this is likely a simple solution, but I cannot seem to figure it out. I am using Google Earth Engine to export a 30m elevation raster tiff file bounded by my area of interest. Within the Export.image.toDrive() function, I set the scale to 30, maxPixels to 1e12 since the area of interest exceeds the maximum GEE has set, yet my output has a cell size of 0.00026949459. From GEE video tutorials and StackExchange posts, I haven't seen anyone add additional functions or discuss steps to ensure the cell size stays as specified to export terrain raster datasets. My end goal is to have an exported raster tiff file of my area of interest with a 30-meter cell size.
My GEE code:
var elevation = ee.Image("USGS/NED");
//Map.addLayer(elevation)

// Create a geometry representing an export region. [R, B, L, T]
var aoi = ee.Geometry.Rectangle([-106.067341, 41.725516, -111.162722, 45.050258]);
//Map.addLayer(aoi)

// Export the image, specifying scale and region.
Export.image.toDrive({
  image: elevation,
  description: 'DEM30_ned',
  scale: 30,
  maxPixels: 1e12,
  region: aoi,
});```


texts:
In QGIS 2.12 the curves tool is integrated by default, I know. I would like to test the Spline Plugin whether it works better for my purpose or not (purpose is just to digitize streets mit nice curves, that's all).

The problem is, it doesn't work. There are the same edged lines as the standard drawing tool creates. I tried...
... to vary setting values.
... to reinstall the plugin.
... to use it in older versions (2.8 and 2.10).
... checking the option for ”suppress attribute form pop-up after feature creation” found in settings-options-digitizing-feature creation (as an answer to a similar question said).

None of this worked for me. Do I have to press a key while drawing or is there something else I can do?


texts: Connecting QDateEdit and QTimeEdit widgets to corresponding Field in QGIS layer

texts:
Could anybody give me a hint how to connect the QDateEdit and the QTimeEdit widgets with a field in a QGIS layer (shp or spatialite)?

The fields in the QGIS layers are from datatype "date" (dd.MM.yyyy) and "datetime" (HH:mm). ObjectName in Qt-Designer and the layer in QGIS are equal. For some reason the connecting doesnt work and the entry in my table stays "NULL". The binding with normal LineEdits works. I tried to describe my problem here but obviously I wasn't that precise.

I'm not a programmer and until now I haven't worked with C++.


texts: GEE: How to export a list of multiple feature collections to a single CSV?

texts:
Apologies for my ignorance but I am brand new to using GEE and javascript. I've searched for some time for solutions but can't find/understand what I'm looking for.
I have 4 shapefiles which each contain a series of polylines (named below as 'icefalls', 'tongues' etc.). The goal is to extract mean and max slope data along these lines and have the data exported in CSV.
I have imported the shapefiles into GEE as feature collections and displayed them on a DEM, which also has slope calculated from it. I've then used reduceRegions to get the mean and max values - I've done this seperately for each feature collection, but if this can be streamlined into a single operation please enlighten me.
I then create another variable to combine the above variables into one for printing to the console and (I had hoped) for export to a single CSV. The console is saying this new variable is a List with 4 elements and is hence failing to export to CSV with the error: "Unknown element type provided: object. Expected:  ee.Image, ee.ImageCollection, ee.FeatureCollection or ee.Element."
So how can I export the data in this collection of feature collections (mean max values for 4 sets of polylines) to a single CSV file?
If anyone could suggest some better ways of doing this I'd be very appreciative as I'm a bit stuck!
Here's some of the code:
// Add the DEM to the map, then calculate and add slope
Map.addLayer(dem, {min: 0, max: 6000}, 'DEM');
var slope = ee.Terrain.slope(dem);
Map.addLayer(slope, {min: 0, max: 90}, 'slope');

// Add the icefall lines to the map
Map.addLayer(icefalls, {color: 'cyan'}, 'EU Icefalls');
Map.addLayer(tongues, {color: 'blue'}, 'EU Tongues');
Map.addLayer(non_icefalls, {color: 'orange'}, 'EU Non-ogive Icefalls');
Map.addLayer(non_tongues, {color: 'red'}, 'EU Non-ogive Tongues');

// Create variable for joint reducer that finds both the mean and max of data
var reducers = ee.Reducer.mean().combine({
  reducer2: ee.Reducer.max(),
  sharedInputs: true
});

// Extract slope values along the lines
var icefall_slope = slope.reduceRegions({
  collection: icefalls,
  reducer: reducers,
  scale: 30
});

var tongue_slope = slope.reduceRegions({
  collection: tongues,
  reducer: reducers,
  scale: 30
});

var non_icefall_slope = slope.reduceRegions({
  collection: non_icefalls,
  reducer: reducers,
  scale: 30
});

var non_tongue_slope = slope.reduceRegions({
  collection: non_tongues,
  reducer: reducers,
  scale: 30
});

//Combine above variables into 1 single variable containing the data within each line set.
var slopes = [
  icefall_slope,
  tongue_slope,
  non_icefall_slope,
  non_tongue_slope
  ];

// Show the results in the console
print ('Slopes', slopes);

// Export the results to a csv file and upload to Drive.
Export.table.toDrive({
  collection: slopes,
  description: 'Test_export',
  fileFormat: 'CSV'
});


texts: Does QGIS feature a tool like ArcGIS Data Driven Pages?

texts:
Has QGIS progressed to the point of having a Data Driven Pages type tool set yet?
Or perhaps something similar to the old DS MapBook pre arcgis 10?


texts: Using PHP's curl to Upload *.csv file into CartoDB?

texts:
I use CartoDB import api to upload csv file correctly, and I can see the 'pointtest' table is created in the cartoDB website. By following command line:

#curl -v -F file=@/mnt/hgfs/D/cartodb/pointtest.csv "https://{username}.cartodb.com/api/v1/imports/?api_key={apikey}"

but when I use php to rewrite this above command line, there are nothing happened,

upload.php

    <?php
echo "Hello World";

$url = "https://{username}.cartodb.com/api/v1/imports/?api_key={apikey}";
$file = getcwd()."/pointtest.csv";//locate in /var/www/html/pointtest.csv
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
    CURLOPT_SSL_VERIFYPEER => false,
    userfile => '@'.$file
  )
));
$result = curl_exec($ch);
curl_close($ch);
echo $result;?>

I get a success message

{"item_queue_id":"fcbfd6ag-c8df-47b2-8a16-fa8392576f2c","success":true}

But there is nothing happened on my cartodb web page.

Than I try to use this "item_queue_id" append to my $url and curl_exec(),
there is nothing happened. So I try to test four case as following:
A as I use command line to get the item_queue_id.
B as I use php code to get the item_queue_id.
C as I use command line to upload my "testpoint.csv" data.
D as I use php code to upload my "testpoint.csv" data.

First, A than C, it works well.
Second, A than D, it works well.
Third, B than C, it gets error message as following:

* Connection #0 to host {username}.cartodb.com left intact{"id":"XXX-xXXX-XXXX-XXXX-XXXXXXXXXXXX","user_id":"XXXXXXXX","table_id":null,"data_type":"datasource","table_name":null,"state":"failure","error_code":99999,"queue_id":"aa175163-ec18-4f8a-99eb-d5683264ac0a","tables_created_count":null,"synchronization_id":null,"type_guessing":true,"quoted_fields_guessing":true,"content_guessing":false,"create_visualization":false,"visualization_id":null,"user_defined_limits":"{\"twitter_credits_limit\":0}","get_error_text":{"title":"Unknown","what_about":"Sorry, something went wrong and we're not sure what. Try\n      uploading your file again, or contact us and we'll try to help you quickly.","source":"cartodb"},"display_name":"XXX","success":false,"original_url":"","warnings":null}

Fourth, B than D, it shows nothing on my chrome.

I don't know how to deal with it.


texts: Efficiently finding the 1st order neighbors of 200k polygons

texts:
For every one of the 208,781 Census block groups, I'd like to retrieve the FIPS IDs of all of its 1st order neighbors.  I have all the TIGER boundaries downloaded and merged into a single 1GB shapefile.

I tried an ArcPython script that uses SelectLayerByLocation for BOUNDARY_TOUCHES at its core, but it takes over 1 second for each block group which is slower than I'd like.  This is even after I limit the SelectLayerByLocation search to block groups in the same state.  I found this script, but it also uses SelectLayerByLocation internally so it's not any faster.

The solution doesn't have to be Arc-based--I'm open to other packages, though I'm most comfortable coding with Python.


texts: Joining .csv with duplicate values to .shp layer with points and getting all points visible using QGIS?

texts:
My problem with QGIS (version 3.4.8)

I have a .shp map layer containing point data of buildings. I want to join .csv spreadsheet to this layer so I can look into it and visualize different variables of this spreadsheet on the map. The join is done by building value, not coordinates. The spreadsheet contains variables that are from the same building. If I'd do the basic join, it would only combine one of these variables by the building value and leave others out.

Here's a picture with example data of what I mean:

Because Emloyees A, B, C and D have all the same building the basic join function only includes one of them. Let's say if the .csv spreadsheet has 500 fields, because of this it returns back 350 and 150 are left out because of the same building value.

Only column I need from the .shp attribute table is the Building value so I can look into the different variables from the .csv spreadsheet on the map.

I was advised in Getting duplicate values when joining .csv spreadsheet to .shp map layer using QGIS? to do join attribute by values for joining the .shp and .csv files. This joined table now includes all the values (the example 500 values) even with the same building value so exactly what I wanted.

Is it possible to join this joined table back to the .shp map layer containing the point data so that all points are visible even some of them in this case are on top of each other?

For the visualization it wouldn't show of course, but it would be crucial to know where and how many (N=?) points are located on the map. So is it possible to display all the 500 points on the map (for example where companies are located), even though 150 of them are from same buildings?

I tried to do this with the basic join (Layer properties of the .shp -> Joins) but it did the same as when I started, leaving variables out with the same building value and containing only the first observed value.

I also thought of adding the left out values all as separate .csv spreadsheets and looking into these separately, but that would take a lot of time.


texts: openlayers web application derive the county in the US that contained the click point

texts:
I have a requirement for users to be able to select a point within a state within the US on a map (which would be an openlayers web application) and once they clicked on the map it would derive the following:
a.) the latitude and longitude of the point that was clicked on the map
b.) the county that contained this click point

What possible ways could the above be implemented?


texts: ArcGIS Online - How to change underlying planet?

texts:
Background: I am a high school teacher with a brand-new ConnectED K-12 account from ESRI for ArcGIS Online and am trying to figure out the very basics to use this for planetary science.

I have loaded maps of Mars, but my measurements are as if the lat/longs were on Earth.

What I've done so far:

Loaded the maps

basemap: ArcGIS Server - Mars MDIM2.1 Basemap
layers: ArcGIS Server - Mars Global GIS Overlay Service

both of these servers are from thare_USGS

When I turn on the measurement tool, the widths of common features (e.g. Olympus Mons) are about twice what you'd expect (checked vs JMARS), as if the lat/longs were on Earth rather than Mars.

How do I change (the size of) the underlying planet for measurements?


texts: How to set parameters for Describe() function?

texts:
I developed one tool  in arcgis using python code, in the process i used Describe(feature class) function to know the coordinate system of input feature class. I got success while compiling code, But i couldn't get how to set parameters for this function in tool(arcgis 10.0) designing.

I tried parameters as follow

Display  name:input feature class
Data type : coordinate system.
Type   : optional
Direction : input.

My problem is  while i'm selecting input feature class, i didn't get coordinate system of that feature class.

Please Suggest..


texts: How to publish a QGIS map for use with Garmin/Android?

texts:
I made a hiking map with QGIS (for printing) and would also like to provide a digital version of the map for Garmin and Android to my consumers.

Garmin:
I know GarminCustomMaps but, the possible map extend and resolution is not good enough for me. And I can not find any other way to bring a QGIS map to Garmin.

Android:
What could be a approach to bring my map to Android. As own App, or as map for an already existing Map-App. It has to work offline and with GPS mode. It would be perfect to have a combination of Raster/Vector, but raster in a good resolution would also be fine.


texts: Python Script to Add Multiple Fields to Feature Classes

texts:
I am trying to add 2 (multiple) fields to each feature class in a gdb.  I based the script off of Python Script to Add Fields to Feature Classes.

I feel like I am missing something and can't figure it out.

import arcpy, os

arcpy.env.workspace = r'Z:\project\....gdb'

for fc in arcpy.ListFeatureClasses():
    try:
        arcpy.AddField_management(fc, "Depth", "SHORT", field_length = 10)
        arcpy.AddField_management(fc, "OD", "SHORT", field_length = 10)
        with arcpy.da.UpdateCursor(fc, "Depth", "OD") as cursor:
            for row in cursor:
                row[0] = fc
                cursor.updateRow(row)
                print "Working on {0}".format(fc)

    except Exception as ex:
        print "There was an error --->    {0}".format(ex)

print ("Add Field Finished")


texts: Selecting lines with start and end points inside polygons but do not cross them with PostGIS

texts:
After trying several ways of selecting those lines, I can't seem to find any kind of solution. So, I have two tables

network : lines forming a network containing source (id of node) and target (id of node).
nodes : the network nodes.
cities : well, cities... contains also the id of the closest node.

For now, the query I'm building calculate the shortest way between each cities of a certain importance. But I want to get rid of the ways that are passing near other cities. A picture will probably be clearer (sorry, paint, you know...) :

Black dots are nodes affected to a city, and red is a buffer of x metres.
Basically, I need a way to keep the blue one and the orange one and get rid of the green one. The blue and orange lines connects two city nodes, the green one connects two city nodes as well but also cross the buffer of an other city.

I've tried several ways but it just won't return the right results.
dijkstra temp table contains merged lines according to source and target nodes.
citynodesbuffer contains buffers around nodes that are associated with a city.

CREATE TABLE graphtest AS (
WITH dijkstra AS (SELECT DISTINCT start_vid, end_vid, (ST_Dump(ST_LineMerge(ST_Collect(net.geom)))).geom
    FROM pgr_dijkstra('SELECT id, source, target, cost FROM network',
        array(SELECT id_node FROM network_cities WHERE importance < 2),
        array(SELECT id_node FROM network_cities WHERE importance < 2), FALSE) as dij
    INNER JOIN network net
        ON dij.edge = net.id
    GROUP BY start_vid, end_vid),
citynodesbuffer AS (SELECT ST_Buffer(nd.geom, 0.020) as geom
    FROM network_nodes nd, network_cities ct
    WHERE nd.id = ct.id_node)
SELECT DISTINCT dij.start_vid, dij.end_vid, ST_Difference(dij.geom, cn.geom) FROM dijkstra dij, citynodesbuffer cn
WHERE GeometryType(ST_Difference(dij.geom, cn.geom)) = 'LINESTRING');

This query, apart from being a waste of resources, returns all input lines, just like if ST_Difference didn't make any... differences.

An other.

CREATE TABLE graphtest AS (
WITH dijkstra AS (SELECT DISTINCT start_vid, end_vid, (ST_Dump(ST_LineMerge(ST_Collect(net.geom)))).geom
    FROM pgr_dijkstra('SELECT id, source, target, cost FROM network',
        array(SELECT id_node FROM network_cities WHERE importance < 2),
        array(SELECT id_node FROM network_cities WHERE importance < 2), FALSE) as dij
    INNER JOIN network net
        ON dij.edge = net.id
    GROUP BY start_vid, end_vid),
citynodesbuffer AS (SELECT ST_Buffer(nd.geom, 0.020) as geom
    FROM network_nodes nd, network_cities ct
    WHERE nd.id = ct.id_node)
SELECT DISTINCT dij.start_vid, dij.end_vid, ST_Difference(dij.geom, cn.geom) FROM dijkstra dij, citynodesbuffer cn
WHERE (ST_Intersects(ST_StartPoint(dij.geom), cn.geom) AND ST_Intersects(ST_EndPoint(dij.geom), cn.geom))
--the line above is not really useful
AND NOT EXISTS (SELECT FROM citynodesbuffer cn2 WHERE ST_Crosses(dij.geom, cn2.geom)));

Worst, this one returns nothing, I guess this is because of ST_Crosses which eliminate every lines but I had hope concerning this function.


texts: What is the easy way for extracting a dted raster file?

texts:
I have some SRTM data which was converted to dted file with GlobalMapper or ArcMap ascii to raster. I want to extract raster from vector with an easy way. I have tried "extract by mask" method but it depends raster files for i/o.

Do you know any easy way of extracting a raster?

A section is raster file B section is vector file.

B section is what i want to extract from A Raster File.

Raster File:

Raster and Vector File:


texts:
I am trying to create a combobox using PyQGIS for a custom plugin. The values in the combobox have to come from a database - I can't use a .csv or a layer because the values in the combobox will change over time. I've defined my field as Value Map in my default style, and am using the following code to try and create my list of values (based on this example).

SQL_departements = "SELECT (string_agg('u'''||dept.description||''' : u'''||dept.valeur,''', ' ORDER BY description))||'''' FROM ref.dept;"
    cur_qgis.execute(SQL_departements)
    departements = cur_qgis.fetchone()
    dept_rat_index = layer.fields().indexFromName('dept_rattachement')
    dept_rat_widget_setup = QgsEditorWidgetSetup( 'ValueMap', {
                         'map': {departements[0]}
                        }
                      )
    layer.setEditorWidgetSetup(dept_rat_index, dept_rat_widget_setup )

(For the record, the result of print(departements[0]) is u'01 - Ain' : u'01', u'07 - Ardèche' : u'07', u'26 - Drôme' : u'26', u'42 - Loire' : u'42', u'69 - Rhône' : u'69', u'Métropole de Lyon' : u'ml')

So far, I haven't have any success. The combobox in my custom form remains empty.

What is the correct code I should use to be able to fill my Value map list using PyQGIS?


texts: OpenLayers: Problems adding WMS layer to OSM

texts:
I need to create a map with two layers. The first layer (basemap) is the OSM layer, and the second layer is my custom GeoServer WMS layer. This layer is in EPSG:4326 projection. Is this possible?

I have read many posts but I didn't solve my problem. I don't find this GeoServer layer in my map.

map = new OpenLayers.Map('map'{projection:"EPSG:900913",
                               maxResolution:2319.89824519781,
                               units:'m' });

osm = new OpenLayers.Layer.OSM( "Simple OSM Map");
wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "95.172.21.2:8080/geoserver/wms";,
                                 {layers: 'asl.caserta:distretti_4326',trasparent: true},
                                 {isBaseLayer: false});
map.addLayers([osm, wms]);
map.setCenter( new OpenLayers.LonLat(14.22231, 41.26700).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject() ), 12 ); –


texts:
I have UTM coordinates and multiple depths of soil horizons. I would like to create a bore hole log (depth vs distance) that i can edit over with. I only have a .doc file with the coordinates and depths for horizons. Each coordinate has 5 different depths associated (5 different soil types). I would like to create a map and cross section of the bore holes - and label them accordingly to their depths.

Is there a way to do this on QGIS?

I tried Midvatten, however it is asking to import spatialite files - i only have text.

I am fairly new to this.


texts: How to Import Shapefiles (or any dataset) to a webmap using Openlayers/GeoExt online? WFS-T

texts:
I tried Using Heron, But it didn't workout well. The problem is, I couldn't found any good documentation about this matter. I just want to "Update" DataSet using an UpLoad tool to my actual Database.
I'm using GeoExt 1 / ExtJs 3.4 / Openlayers 2 and Geoserver.


texts: Generate Panel of overlapping features and export them to csv with GIS and Python

texts:
Given is a dataset, split into 250 .gml files, containing multiple vector layers.

The features of interest are:

parcels as polygons (~250k total),

buildings as polygons (~350k total),

addresses as points (~250k total)

Note that attributes of the interesting features vary over files; buildings and addresses not necessarily have to appear in each file.

Assignment) Write a python script that gets all buildings and addresses that intersects with parcels and creates a new layer with joined attributes of parcels and intersected addresses/buildings) for export to csv.

Well, that's my homework.
I started by writing following code which isn't working (run on a single file):

for pc in parcels:
    bd_res = None
    ad_res = None
    for bd in buildings:
        if bd.geometry().within(pc.geometry()):
            bd_res = bd
            print 'Building: '+`bd_res['gml_id']`
    for ad in adresses:
        if ad.geometry().within(pc.geometry()):
            ad_res = ad
            print 'Adress: '+`ad_res['gml_id']

The Output is (no error messages):

Adress: u'DEHHALKAz00031c3'

It fails at the if-condition, where the method .within(pc.geometry()) only returns a single address and no buildings.

Furthermore I'm uncertain about assigning polygons to polygons and I'm a bit worried about the execution time, if there is a more efficient method, just mention.


texts: What does ValueError: invalid literal for int() with base 10 indicate?

texts:
# Process: Get Raster Properties
Max_Aggl = arcpy.GetRasterProperties_management(EucDist_Aggl, "MAXIMUM", "")
print (Max_Aggl)
print float(Max_Aggl.getOutput(0))
b = int(Max_Aggl.getOutput(0))
c = b/2
print c
delta = int(Max_Aggl.getOutput(0))
print delta
a = delta/1000
print a

This is a part of the code, and the value of Max_Aggl=44250.27734375 (more than 10 digits)
and I have error :

  44250.27734375
  44250.2773438

  Traceback (most recent call last):   File "D:\NEO\bbbb.py", line 22,
  in
      b = int(Max_Aggl.getOutput(0)) ValueError: invalid literal for int() with base 10: '44250.27734375'

you help me first time to convert the result to value


texts: I am trying to customize Optical calibration module for hyperion sensor. I am not able to find RSR foramt .can any one suggest me what is the format of Relative Spectral Response File which is on of the input to Optical calibration module.I followed the link https://www.orfeo-toolbox.org/CookBook/Applications/app_OpticalCalibration.html#authors


texts: User-specified stop points for network analysis in ArcPy?

texts:
I started trying to teach myself Python/ArcPy a couple of weeks ago in an attempt to someday be able to convert my plethora of models to more shareable and user-friendly formats (script tools, add-ins, etc.) and it's been going super well so far, but a general topic I am still hung up on is receiving user-defined parameters in my scripts.

Specific example I'm seeking help for: I need a way for the end-user to define stop points based on network junction attributes (my ND has custom junctions) and use those inputs to solve the route. I have scoured the internet for answers and I'm still coming up just short. Here's some sample code of what I think needs to happen. Remember, I'm still super new to this, so there may be some rookie mistakes in this code. Also, I did not complete the code for finding the routes, but included enough to get my point across.

import arcpy, os, datetime, time

#check out NA extension
arcpy.CheckOutExtension("Network")

#set environments - not a real path here, obviously
arcpy.env.workspace = arcpy.GetParameterAsText(0) #user selects gdb where network junctions are located
Dir = arcpy.env.workspace
arcpy.env.overwriteOutput = True

#get parameters for stop location selection
networkJunctions = arcpy.GetParameterAsText(1) #network junctions feature class
stop1 = arcpy.GetParameterAsText(2) #first stop
stop2 = arcpy.GetParameterAsText(3) #second stop

#define variables
expression = " NAME IN ('stop1', 'stop2') " #selection expression
date = time.strftime("%d%m%y")
outputFCname = Dir + "\\RouteStops" + date

#create layer from network junctions FC
arcpy.MakeFeatureLayer_management(networkJunctions, "networkJunctions_lyr")

#Select the two stops used to solve the route
arcpy.SelectLayerByAttribute_management("networkJunctions_lyr", "NEW_SELECTION", expression)

#new FC of selected stops
arcpy.CopyFeatures_management("networkJunctions_lyr", outputFCname)

#solve routes - incomplete
arcpy.na.FindRoutes(will worry about this part later)

This code successfully runs up until the FindRoutes part, but there is no output. I have a hunch that I may be making my feature layer at the wrong point in the code, but I've reordered all of this and I still get a new feature class with nothing in it.


texts: Python - No module named '_gdal_array' only on virtual env

texts:
I'm trying to import gdal_array in python but I get ModuleNotFoundError: No module named '_gdal_array'.
The strange thing is that this problem does not occur if I use system's python 3.8. It only occurs inside python3.8 virtual environment
Code that works (on terminal):
python3.8
from osgeo import gdal_array

Code I used to test it in venv and doesn't work (on terminal):
virtualenv venv -p $(which python3.8)
source venv/bin/activate
pip install numpy
pip install osgeo
pip install gdal==$(gdal-config --version)
python3.8
from osgeo import gdal_array

Above code results in:
>>> from osgeo import gdal_array
Traceback (most recent call last):
  File "/.../venv/lib/python3.8/site-packages/osgeo/gdal_array.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_gdal_array', [dirname(__file__)])
  File "/usr/lib/python3.8/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_gdal_array'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../venv/lib/python3.8/site-packages/osgeo/gdal_array.py", line 28, in <module>
    _gdal_array = swig_import_helper()
  File "/.../venv/lib/python3.8/site-packages/osgeo/gdal_array.py", line 20, in swig_import_helper
    import _gdal_array
ModuleNotFoundError: No module named '_gdal_array'
>>>

(Exact output on terminal shown here)
My question is what might be the problem and how could I fix it?
Other answers suggest to install numpy first, which I do.


texts: How to hyperlink from polygon oncick in Leaflet?

texts:
I want to hyperlink from onclick of a polygon to new tab based on 'link' field in polygon json. When user clicks on polygon, a new browser tab is opened pointing to URL value of that polygon.

I am using the Leaflet Chloropleth demo map, edited for my own geojson data.

I need guidance on referencing the 'link' field in the geojson to the open url function. Whereas now onclick creates new empty browser tab.

        var geojson;

    function resetHighlight(e) {
        geojson.resetStyle(e.target);
        info.update();
    }

    function onclick(e) {
        window.open(this.options.win_url);
    }

    function onEachFeature(feature, layer) {
        layer.on({
            mouseover: highlightFeature,
            mouseout: resetHighlight,
            click: onclick
        });
    }

    geojson = L.geoJson(states, {
        style: style,
        onEachFeature: onEachFeature
    }).addTo(map);


texts: How to read or import shapefile into android studio in order to view the ArcGIS

texts:
I am developing an ArcGIS project with Android Studio IDE, to view some maps and information and I would like to read some shapefiles from another project. But I couldn't find a solution on how to do it yet. Anyone know how to do it?

I would like to add/read/import shapefiles into my ArcGIS map as a layer.


texts: I am trying to do a marker-controlled watershed segmentation. lidR package is updated and mcwatershed() has been removed in the latest release. How can I apply marker-controlled segmentation? Do you have any recommendations?


texts: Leaflet: How to enable pan & zoom while GeoJSON still rendering?

texts:
I've overlaid a huge GeoJSON geometry on top of my Leaflet map, covering about 20 countries' borderlines (about 1,5 million vertices) using "L.geoJson".

Each time I zoom in/out, the computer has to calculate the new amount of vertices before map interaction comes back. So the user has to wait 3-4 seconds after zooming until the map comes to resolution, before the user can zoom more or pan the map.

Looking at a previously asked question, I've simplified the geometries to reduce the number of vertices by 30% (now 1 million vertices), but that earned me just about -1 second of calculation time.

Instead of giving up on the GeoJSON geometry quality, is there a way to be able to pan/zoom the map while the vertices are not yet done calculating?

In other words, I want to be able to pan and zoom the map while the geometry is still blurry.

PS: Using TileMill is out of the question because I want interactivity for my GeoJSON data (eg. changing colors of countries later by js code), but TileMill will give me uneditable png.


texts: Is it possible to force labels behind a polygon dataset. In my case I want to put 50% transparent polygons onto areas, which are shown "inactive" on maps. Unfortunately, some feature labels are shown automatically above the "inactivity"-layer. Please have a look.


texts: Performing raster map algebra in open source web GIS?

texts:
Map algebra for raster is easy with ArcGIS Raster Calculator (or QGIS). I had thought this would be easy with web GIS servers such as GeoServer and MapServer plus OpenLayers etc. as well. What I want to achieve is to do simple things like dividing two images and generate a third, ratio image to be displayed in the webpage. I spent weeks to find a solution and it turns out to the pretty hard (for me).

I have tried a few things including:

PostGIS raster. I think raster algebra isn't a problem here.

But PostGIS raster is pretty difficult to load into GeoServer. There are many many questions repeatedly asked about how to load pgraster in GeoServer. See e.g. How to import GeoTIFF via postGIS into GeoServer?? , https://gis.stackexchange.com/questions/86006/publish-rasters-stored-in-postgresql-with-geoserver?, among others. Not a single answer here in GIS.SE or the GeoServer official website gives a complete list of steps that can be followed to work.
Loading pgraster into MapServer has reported success, but with very slow performance. Both seem to require some tiling, and a one-liner command to import a raster to either server seems to be out of the question.
GeoTIFF

GeoTIFF is easy to load into GeoServer and MapServer. But what can we do with it? Without a PostGIS like SQL, I turned to and briefly searched using WCS to do map algebra, but didn't find much. Is WCS a viable path for this with current servers?
Program it the hard way

Somehow use AJAX to call a PHP page or write a WPS using GeoServer for importing images into PostGIS, doing the map algebra and then converting the result pgraster to a format (e.g. GeoTIFF) that can be easily loaded and displayed in GeoServer/MapServer.
Of course, one can write code to read GeoTIFF's directly and do the map algebra without GIS support.

None of the above seems to be easy or reasonable to me considering the ease with which the same algebra can be done in Desktop GIS.

I was wondering if someone has had any experience doing Map Algebra in a web GIS environment, and can suggest a viable path?

I am interested in Open Source solutions (for political reasons inside my organization.) I am aware that ArcGIS Server can call python code of ArcGIS, but we don't have the license and the environment here is not favorable for acquiring one.


texts:
I am on QGIS 3.10.1-A Coruña. I want to create a buffer of 50.000 meters around the cities on my map.

When I am using the buffer tool I get a disproportionate result (first image).

My layer is in EPSG:32629 (as seen in the second image). And the project is also in the same projection (third image).

I've tried reprojecting both layers without success. How can I check if the buffer is making some sort of conversion?


texts: Adding additional columns of data to CartoDB table? (in-place / no merge)

texts:
Is there any quick way to add some data to a table without either a) merging / replacing the whole thing or b) having to do it one cell at a time ?

example: i have a table loaded now with the counties of Arizona.  I would like to add a few columns of county-specific data in-place.  I don't want to merge unless i can merge in-place.

the end result would be as if i exported the data, added columns to it (e.g. in google docs), and created a new table using that same data.  This is the thing to be avoided.


texts: GeoPandas save to shapefile issue: Unable to open EPSG support file

texts:
When I try to use to_file() to write a GeoPandas GeoDataFrame to a shapefile I get the following error.

df3.to_file('~/Desktop/testout.shp', driver = 'ESRI Shapefile');

  ERROR:Fiona:OGR Error 4: Unable to open EPSG support file gcs.csv.
  Try setting the GDAL_DATA environment variable to point to the
  directory containing EPSG csv files.

I don't know what it's talking about and can't seem to find anything online. Pls help.


texts: For the non-IT savvy GIS person (not great w/ Linux & Apache) could someone suggest how to set up PostgreSQL, Geoserver, and ISS/Apache?

texts:
I've heard of GeoCommon as being an easy GIS solution, but I'd like to host the data locally for internal users.  I know of a group called Open Geosuite - but the ongoing maintenance is something I'd like to avoid since I can do pretty well with maintenance and content management & web site publishing after the initial set-up.

Does anyone know of an out-of-the-box solution or a group/company that can help with initial set up for these types of map service stacks?

Thanks for any advice you can give for a noob!


texts: Change Header/Background Color For Attribute Popup Window (JavaScript Web AppBuilder)

texts:
After creating a web app and downloading it using the JavaScript Web AppBuilder for ArcGIS (Developer Edition), I was able to change the site header and widget popup color schemes via an existing style.css file (themes\FoldableTheme\styles). However, the header/background color for the attribute popup window (for the feature layers) remains the default light blue. Even when toggling between different style schemes, (black, cyan, green, purple) the attribute popup window color remained the same.

Is it possible to change this popup color to match the custom header? If so, where and what file would I alter the code in? I only want to change the blue shown below. The white and text color can remain the same.


texts: Meaning of error when using CartoDB to georeference spreadsheet?

texts: I linked my CartoDB map to a spreadsheet in Google Docs that has column headings of Name, City, State, and Pledge. However, when I try to georeference the spreadsheet, for the cities, I get an error that says "no polygon data available for your selection." What does this mean?


texts: Identifing specific plants out indexmaps (pixelgroups) and convert to .shp

texts:
I am working on a project where I have to identify a specific plant (it is toxic) in fields. I made a high resolution Orthomosaic (1,4cm7/px) and created a vegetation index where the plant I am looking for is isolated and marked red. So I got a geotiff file with red pixels (single or bigger pixelgroups).

Now I'm looking for a system to can convert all these pixel to a .shp file. I want to export every red pixel (or pixelgroup) as a geodata in QGIS.


texts: Remove non-intersecting rows from two polygon shapefiles

texts:
I am working on Arcmap 10.1.

I have two polygon shapefiles: S1 and S2
S1 has 4 polygons (rows): P1, P2, P3, P4;
S2 has 3 polygons (rows): Q1, Q2, Q3
From S2, I have to remove those polygons which do not have any intersection with any Pi, i = {1...4}.

I am new to Arcmap, I couldn't figure this out from the existing questions.


texts: DataTemplate not appearing in InfoWindow

texts:
For feature Layer in want to show user an info window for information. I m able show the infowindow but It is not loading with data. i can see the Attributes in Graphic which is setting in Content but still Nothing in visible in Info window.

I followed Using InfoWindow with Feature Layer and DialogWindowBase?

http://silverlightchina.net/html/tips/2011/0524/7863.html

Displaying information on a map using an InfoWindow

useful code in my ViewModel when FeatureLayer get generated

 private void mapLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e)
    {
        FeatureLayer amLyr = sender as FeatureLayer;
        Graphic selectedGraphic = e.Graphic;
        //HpmInfoWindow.DataContext = selectedGraphic.Attributes;
        MapPoint clickpoint = HpmMap.ScreenToMap(e.GetPosition(HpmMap));
        if (RouteLayerInforWindowAnchor != clickpoint)
        {
            HpmInfoWindow.Content = selectedGraphic.Attributes;
            HpmInfoWindow.Anchor = clickpoint;
            HpmInfoWindow.IsOpen = true;
            RouteLayerInforWindowAnchor = clickpoint;
        }

    }
    private InfoWindow _HpmInfoWindow;
    public InfoWindow HpmInfoWindow
    {
        get
        {
            return _HpmInfoWindow;
        }
        set
        {
            _HpmInfoWindow = value;
            RaisePropertyChanged(() => HpmInfoWindow);
        }
    }

in XAML

 <esri:InfoWindow x:Name="HpmInfoWindow"
                     Padding="5"
                     CornerRadius="20"
                     Background="BlueViolet"
                     Map="{Binding ElementName=HpmEsriBaseMap}"
                     ContentTemplate="{StaticResource InfoWindotemplateRoutes}">
        </esri:InfoWindow>

  <Grid.Resources>
            <DataTemplate x:Key="InfoWindotemplateRoutes">
                <Grid x:Name="incoLayoutRoot" Background="White" Width="200" Height="200">
                    <StackPanel Margin="7">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Route Info :  " FontWeight="Bold" Foreground="Black" />
                            <TextBlock Text="{Binding [ROUTE_ID]}" FontWeight="Bold" Foreground="Black"  />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Year: " Foreground="Black" />
                            <TextBlock Text="{Binding [YEAR_RECOR]}" Foreground="Black" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="State Code: " Foreground="Black" />
                            <TextBlock Text="{Binding [STATE_CODE]}" Foreground="Black" />
                        </StackPanel>
                    </StackPanel>
                </Grid>
            </DataTemplate>
        </Grid.Resources>

How I m binding my Xaml Defined infowindow to infowindow Property

at xaml.cs file

   public HpmsBaseEsriMap()
    {
        InitializeComponent();
        if (DesignerProperties.IsInDesignTool == false)
        {
            var dmv = ServiceLocator.Current.GetInstance<IHpmsBaseEsriMapViewModel>();
            dmv.HpmEditor = this.HpmsRoutesSelectionEditorNme;
            dmv.HpmMap = this.HpmEsriBaseMap;
            dmv.HpmInfoWindow = this.HpmInfoWindow;
            dmv.HpmMapTip = this.MyMapTip;
            dmv.BindingMap();
            DataContext = dmv;
        }
    }


texts: Exporting tiled raster assets within mask feature selection?

texts:
I'm familiar with a method of exporting everything within a selected feature within Global Mapper using - Export > Export Raster/Image Format.

This takes everything within that feature and exports to a single image even though the project contains a collection of tiled rasters (sat images)

However I really want to learn how to do the same operation within QGIS - but I'm struggling as the only feature I can see that comes close is - Raster > Extraction > Clipper

But the 'Input file' selection makes you pick a specific raster - rather than everything? I would prefer not to have to merge the tiled rasters as I've noticed some degradation of quality, and due to the total size of rasters - memory becomes an issue with the processing of merging.

Is there anything I'm missing re exporting entire raster contents within a selected feature?


texts: STContains on SQL Server vs ST_Contains on PostGIS

texts:
I am trying to run a basic point in polygon query against a table of polygons. In PostGIS this works:

SELECT *
FROM schema.table
WHERE ST_Contains(
  table.geom,
  ST_PointFromText('POINT(XXX.XXXXXXX YY.YYYYYY)',4283)
);

As I understand it, this is the equivalent in SQL Server:

SELECT *
FROM schema.table
WHERE column.STContains(
  geography::STPointFromText('POINT(XXX.XXXXXXX YY.YYYYYY)',4283)
) = 1;

Both tables are generated from exactly the same shapefile. For PostGIS I use shp2pgsql and for SQL Server I use ogr2ogr to convert the data. In SQL Server I need to run a query to MakeValid the 8 errors in the source data (confirmed in QGIS).

When I run the above query in PostGIS I am returned a single, correct polygon. When I run the other query in SQL Server I am returned a set of polygons, none of which is correct.

Can someone assist me in getting the query correct for SQL Server?


texts: Creating a fixed length segment of a line around a point on line

texts:
I've a layer of rivers as lines, splitted in segments by their size. I've created random points on those lines and selected some of them - 90 in total.
I'd like to take those selected points on lines, set them as midpoints, and get a segments of 5 km upstream and 5 km downstream from the given points on rivers. I managed to split lines at points but that doesn't give me much.
Some of the segments will be shorter than 10 km as some rivers are small and flow in the sea. On some those points are close to sea while the river is big enough to shift the 10 km segment upstream.
Is this doable or manual is the only option here to achieve this?


texts: Conceptual Question: Best Way to Map Multiple Layers

texts: I'm familiar with using QGIS, so this is not a technical question; it's more of a conceptual question. I'm mapping attendance of households at different meetings, and I specifically want to show which meeting or meetings households have attended. I've tried to show this using points, but the map is so large, it makes it look like the meetings haven't had many attendees. (We want to show that the meetings have been well attended.) Instead, I've been using polygons over each house parcel. The issue is that there are households that have been to multiple meetings but the map only shows whatever layer is on the top. I've also tried having the polygons with a line fill, but that didn't work too well. Does anyone have any suggestions for improving this?


texts: FME - Exploding Series of Attributes to Features for Each Combination

texts:
Given a unique identifier attribute (TYPE below), there needs to be the combination for each comparison between the identifier and (n) value attributes to be written as a new feature. See the example below:

Input Table:

Output Table:

Is this possible to do in FME?


texts: Rewriting query to match two points with linestring in different database table?

texts:
Suppose I have:

a table "gps_nodes" containing columns:

"EASTING" (containing longitude data)

"NORTHING" (containing latitude data)

"geom_point" (containing POINT geometry data, calculated from EASTING & NORTHING columns).

a table "linestrings" containing a "geom_line" column (containing LINESTRING geometry data, each linestring contains only 2 points).

Given a new long/lat position (eg -1.911782 53.26144), I need to select a point position from the "gps_nodes" table, where a linestring created between these two positions does NOT already exist in the "linestrings" table.

Something like this:

SELECT *
FROM gps_nodes
WHERE
(SELECT count(*) FROM linestrings
  WHERE ST_equals(geom_line, ST_GeomFromText('LINESTRING(gps_nodes.EASTING gps_nodes.NORTHING, -1.911782 53.26144)'))
) = 0
LIMIT 1

But the problem seems to be that I can't reference the row from the gps_nodes table in the WHERE subquery, as I think that subquery gets executed first, before the SELECT.
(Note that there may be minor syntax errors in that query example, as I've just quickly written it here to demonstrate the general issue)

How could I rewrite this query to get the data I need ?


texts:
I tried to export my Qgis projects to mapserver, using RT mapserver extension, because there is not any other extension in my version of QGis.(QGis 2.0.1 Dufour on ubuntu 12.04 LTS). After installing the extension, when i try to export, there is the error:

  Une erreur est apparue lors de l'exécution du code python :

Traceback (most recent call last):
  File "/home/jannes/.qgis2/python/plugins/rt_mapserver_exporter/plugin.py", line 65, in run
    from .mapfileexportdlg import MapfileExportDlg
  File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 453, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/jannes/.qgis2/python/plugins/rt_mapserver_exporter/mapfileexportdlg.py", line 30, in
    import mapscript
  File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 453, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named mapscript

Version de Python :
2.7.3 (default, Sep 26 2013, 20:26:19)
[GCC 4.6.3]

Version de QGIS :
2.0.1-Dufour Dufour, exported

Chemin vers Python : ['/usr/share/qgis/python/plugins/processing', '/usr/share/qgis/python', '/home/jannes/.qgis2/python', '/home/jannes/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', '/usr/share/qgis/python/plugins/fTools/tools', '/home/jannes/QGis workspace']

How can I solve this problem please?


texts: The drawing of Thiessen/Voronoi polygon boundaries - are the bisecting lines truly perpendicular?

texts:
I am concerned with how QGIS (version 2.8.1) and ArcGIS (version 10.0) draw "perpendicular bisecting lines" when Thiessen/Voronoi polygons are created.  When using either program to create these polygons, it appears the bisecting lines are NOT perpendicular to the line connecting two nearest points.  See attached image: Thiessen polygons were created from the "H Locations".  We created 3, 5, and 7 mile non-overlapping buffers around these "H Locations".  We expected the Thiessen polygon boundaries to line up with the buffer intersections (a perpendicular line drawn at the half-way point between two H locations), however they do not.  It appears the Thiessen polygon boundaries are at the half-way point between the two points, but are not perpendicular with the line connecting those two points.  Is this a projection issue??

In other words...

This (Thiessen Polygons either program created):

Doesn't look like this (what we expect them to look like):

Additional information:
The first step was creating the shapefile of these “H locations” using the program Alteryx.  I brought in an Excel document with names and coordinates of 6 locations (in Germany), and output to a SHP.  I did not select a projection in the output tool.  I also created non-overlapping trade areas/buffers around these 6 points, also in Alteryx.  I created 3 mile buffers and 200 mile buffers.  I brought all 3 files into ArcGIS, and the buffers looked like ovals.  I changed to layout view, accessed data frame properties > coordinate system, and selected “The World from Space” projection.  I modified this projection with the latitude and longitude of central Germany.  The buffers adjusted to a more circular shape as I expected.  I then created Voronoi polygons in ArcGIS, and the result was not as I expected.  In the attached image, you can see the intersections of the 200 mile non-overlapping buffers are showing perpendicular to the lines connecting two nearest points – you can see that the Voronoi polygon boundaries are not perpendicular to the lines connecting two nearest points.


texts: Selecting only canals that are connected to reservoirs?

texts:
I have a polygon layer of water reservoirs and a polyline layer of canals.

In my data, some canals are originating from reservoirs, and leading to other canals. On the other hand there are some canals that are isolated or not connected to anything. (How this came about is story for another day)

I need to delete the isolated canals and those canal networks(i.e. connected set of canals) that are not connected to a reservoir.

I assume that i will have to use some kind of network tracing, but I am not sure where to start.

I have ArcGIS desktop, along with Network Analyst  to solve this task.

How would you go about this task?


texts: Segmenting a feature class based on the geometry of a multipart feature class

texts:
I have a single feature class representing tree canopy over the span of several cities. I want to segment it so that I can calculate the percentage of canopy per census tract. I'm using ArcMap 10.7.1

In other words, I'd like to use the census tracts feature class to "cookie cutter" the single part canopy layer so that I can view it tract by tract. How would I go about doing this?


texts: Retaining resolution of MODIS data while reprojecting using gdalwarp

texts:
Can anyone help me to use gdal(gdalwarp specifically) for reprojection? I am using it to reproject MODIS data :

I originally have an hdf file - MCD43A4.A2005001.h08v05.005.2007351192333.hdf which has SDS of size 2400 x 2400 at 500m resolution.

I then reprojected it using :

gdalwarp -t_srs '+proj=latlong' -srcnodata 32767 -dstnodata 32767 HDF4_EOS:EOS_GRID:"MCD43A4.A2005001.h08v05.005.2007351192333.hdf":MOD_Grid_BRDF:Nadir_Reflectance_Band1 band1.tif.

This works fine but as I convert from sinusoidal to lat/long, the image size is now 3177 x 1194. I was wondering if this remains at 500m resolution?

To set the resolution manually I tried using the -tr option of gdalwarp:

gdalwarp -t_srs '+proj=latlong' -tr 500 500 -srcnodata 32767 -dstnodata 32767 HDF4_EOS:EOS_GRID:"MCD43A4.A2005001.h08v05.005.2007351192333.hdf":MOD_Grid_BRDF:Nadir_Reflectance_Band1 band1.tif.

This gives an error : Attempt to create 0 x 0 dataset is illegal, sizes must be greater than 0.

Can anyone please help me out figuring this - whether I need to manually set the resolution(and how to fix the error) or can I use the 3177 x 1194 image?


texts: Averaging multiple values to a single value by common field ID

texts:
I want to see how accurate/representative a centroid's datapoint value is compared to averaged multiple datapoints values for the same polygon. There are MANY polygons in the same shapefile.

I have a way to call an API based on lat lons. But I am limited in the number of API calls i can make. So I need to explore a few test cases - see the fewest number of points I need to get reasonable data representation.

I have used the QGIS centroid function (the big red dot) and the vector/random points functions (the 8 small white dots). I have put the values next to each:

Eg: the centroid value (red) = 52 and the avg of the 8 random points anywhere in the polygon using my calculator comes to 50.13

to make things a little harder, a very few of the data points are null. see below:

The above example shows there are not always 8 'good' values. In the above example 6 of the 8 are fine, so the equation would need to 'allow' for this somehow.

So this is for just showing 2 example shape files - But there are a LOT to process

QUESTION: I have many shapes, each with their own ID.  I have managed to connect each of the 8 smaller dataPoints to the shape ID successfully but how can i automatically evaluate the average of the 8 random points for EACH polygon against the value for the centroid, in a shapefile of multiple polygons?

Note: I'd like their average but maybe a max, min and spread would also be useful.

I'm using QGIS 2.6.1


texts:
I've noticed that SQL clients select the SHAPE column from SDE.ST_GEOMETRY in different ways:

select shape from roads

Toad: SDE.ST_GEOMETRY(1,1,666666.0,4444444.5,666666.0,4444444.5,NULL,NULL,NULL,NULL,0,0,300051,(BLOB))
SQL Developer: [SDE.ST_GEOMETRY]
MS Access: Error: Invalid field definition 'SHAPE' in definition of index or relationship. (I know MS Access isn't a real SQL client; but it helps demonstrate the point.)

Question:

What does the text that is returned from Toad represent? Is it the properties of the blob?


texts: Google Earth Engine: how to display the entire layers' names?

texts:
I imported many Landsat images through Google Earth Engine. The issue is that the windows to select the layers does not display their name entirely (see picture). How can I extend the window to see the complete names of my layers ?
This is how I name them:
for(var a = 1974; a < 2022; a++){
  Map.addLayer(finalCol.filterMetadata('year', 'equals', a), {}, ' '+a, false)
}

"a" is the year of the layer as a string.


texts: Determining resolution of specific image in PDF document?

texts:
Can GDAL be used to determine the resolution of an image embedded inside a PDF?  If not GDAL, is there another method?

I'm using gdal_translate to convert TIF+TFW files into geospatial PDF.  I know the resolution of the TIF, but I'm not sure that gdal_translate retains that resolution when it puts the image into the PDF file.  I need a way to examine the image in the resulting PDF to determine what gdal_translate is doing.

The motivation is that these geospatial PDF files are being developed for use in Avenza PDF Maps, and that app makes use of the embedded image resolution when initially importing and tiling the PDF.


texts:
I want to convert some .tifs to .asc to use in MaxEnt.

I have tried using both ArcGIS 10.5.1 (the "Raster to ASCII" tool) and QGIS 2.14.3 (Raster > Translate tool). Both give .asc files, but when I try to run MaxEnt I get this;

Error reading "File": java.lang.NumberFormatException: For input string "nan"

This happens even when I only include a single layer in MaxEnt, so I know it is not an issue about all layers having matching extents. I've seen another question with a similar issue, which suggested the files were still GeoTiffs, but I've checked them and they are definitely .asc

Is there an obvious thing I'm missing?

Edit

Here is the first few lines of the file, when opened in a text editor

Further edit

Link to the original multiband .tif is here. The single band .asc with Nan is here, and the band with the Nan corrected to -9999 is here


texts: Choosing datatype for holding Latitude, Longitude and Altitude in PostGIS?

texts:
I'm trying to take advantage of the many functions available in Postgis for dealing with latitude and longitude coordinate systems.
However, I would like to add some altitude information to my database and I can't find the proper answer for which datatype should be used for properly holding Latitude, Longitude and Altitude in Postgis?

I have found that Geometry type is capable of X, Y and Z, but the Geography type only holds Latitude and Longitude.
Is there and differences between both?


texts:
My goal is to calculate the volume of a room whose geometry is POLYHEDRALSURFACE.
First, I tried to use "ST_Volume" on my geom directly and got the following error  "ERROR:  function st_volume(geometry) does not exist".
Then, I checked my geom is solid or not by using "ST_IsSolid", still got error "ERROR:  function st_issolid(geometry) does not exist".

My PostGIS version is 2.5.


texts: Append different geometry to layer within GeoPackage

texts: I have a layer with lines - I export it qith QGIS to a new geopackage. A second layer with the same table structure  but containing polygons should go into the same geopackage and preferably into the same layer. When i go on Export, select the geopackage and type in the same layer name as before, it asks me if i want to: Overwrite File, Overwrite Layer, Append to Layer or Cancel. I pick "Append to layer" but the result does not contain the polygons. Am i doing something wrong or is this a bug?


texts: Transforming shapefile to WGS:84 (EPSG: 4326) in QGIS?

texts:
I received several shapefiles from an colleague that he told me is in WGS:84. If I look at the metadata in Qgis it tells me the following:

In layer spatial reference system units
xMin,yMin 3572722.82,5453423.31 : xMax,yMax 3582448.25,5462926.22
Layer Spatial Reference System
+proj=longlat +datum=WGS84 +no_defs

Now when I try to save it in another projection say WGS:84 Pseudo Mercator (EPSG: 3857) it gives me the following:

 Export to vector file failed.
    Error: Failed to transform a point while drawing a feature with ID '1'. Writing stopped. (Exception: forward transform of
    (62425.896446, 95242.109906)
    PROJ.4: +proj=longlat +datum=WGS84 +no_defs +to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs
    Error: latitude or longitude exceeded limits)

A similar message is returned in R with the rgdal package. I suspect that the initial projection is somehow wrong.

Is it truly WGS84?

The problem occurs with all shapefiles.

ogrinfo -so

tells me:

INFO: Open of `XXX.shp'
      using driver `ESRI Shapefile' successful.
1: XXXABC (Polygon)


texts: Digest authentification in Geoserver not working

texts:
I am trying to use Digest authentification in Geoserver. But when I send a Curl request I get the 401 error.

I followed this tutorial :
http://docs.geoserver.org/stable/en/user/security/tutorials/digest/index.html

Here is the request:

curl --digest -v -u admin:password -G "localhost:8080/geoserver/wms?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS"
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
* Server auth using Digest with user 'admin'
> GET /geoserver/wms?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 401
< X-Frame-Options: SAMEORIGIN
< WWW-Authenticate: Basic realm="GeoServer Realm"
< Content-Type: text/html;charset=utf-8
< Content-Language: en
< Content-Length: 1102
< Date: Sun, 13 May 2018 21:22:34 GMT
 <
<!DOCTYPE html><title>Apache Tomcat/8.5.5 - Error report</title>
HTTP Status 401 - Full authentication is required to access this resource

type Status report

message Full authentication is required to access this resource

description This request requires HTTP auth* Connection #0 to host localhost left intact entication.

Apache Tomcat/8.5.5

I am using Geoserver v2.13


texts: Can anyone provide the solution, how to call GeoWebCache tiles in openlayers as i have 20GB of tiles created in gwc folder.


texts: Show/mark not visible labels (colliding labels)

texts: If "show all labels, also colliding" is not active, some colliding labels will not show up. So far so good, but I would like to know, how often and where this happens and maybe why. Something like a red dot where the invisible label is, would satisfy me. Any ideas?


texts:
I've just installed the latest verion of QGIS (3.4.0) on a MacBook Pro 13" (3.3 GHz Core I7) MacOS 10.14. The application seemed to work fine at first.
On a certain point I've tried to open a recent project via Project/Open menu and had a system freeze for 12 seconds. During that time the whole system was not at all responsive (just mouse moves did work). None of the other applications worked in any way, I couldn't even move other app's windows, the system monitor didn't show any significant increase of activity and instead of the expected functional filemanager-window a tiny little inactive shadow of the filemanager-window was displayed ... as you might guess in the image below.

I was able to reproduce this behavior for several times - even after restart of QGIS.

The whole thing might be related to QGIS 3.4.0 Madeira: unresponsive but it is on a mac and it doesn't seem to affect the "rest" of QGIS.

... has anybody any idea how to handle that problem ?


texts: Trouble passing compatibility test on Windows. Video card meets requirements but still fails?

texts: I am having a rough time getting my computer to pass the compatibility test, even though it seems to meet all the requirements. I have 512 MB of dedicated video memory (the minimum), but I still fail the test. Any suggestions?


texts: Dynamically display popup based on location

texts: I would like to dynamically display a popup in leaflet. As you walk towards a point and get within a radius of 10 meters of a point, the popup automatically displays. How to do this?


texts:
Is there a way to create and apply non-destructive symbology to features in QGIS?

In ArcGIS, you can create 'representations' of a feature classes symbology, which allows you to make independent adjustments to appearance, position or visibility, without affecting the underlying data.


texts: Is it possible to change the name of a Stamen basemap in OpenLayers?

texts:
I'm adding a Stamen basemap to OpenLayers using the syntax below. Is it possible to change the layer's name, so that it appears in the Layer Switcher using this name (rather than "toner")?

The OpenLayers layer.setName method doesn't seem to work.

Thanks

    <title>tile.stamen.com: OpenLayers</title>


texts: Web AppBuilder Custom Widget - Function Executing Sequence

texts:
I am having a weired issue that func1(), which is coded in front of func2(), is executed after func2() in my custome widget.

The widget draws a buffer on a click event, and when a "Show Results" button is clicked, it counts the number of facilities within the buffer. Below is a code sample:

var totalFac = 0 // Store the total number of facilities globally
var globalGeometry = null; // Store the query geometry globally

onShowResultsClick: function() {
  totalFac = 0; // Initialize
  this.facLayer = new FeatureLayer("https://link/to/layer");
  var query = new Query();
  query.geometry = globalGeometry;
  this.facLayer.queryFeatures(query, function(result) {
    var features = result.features;
    totalFac = features.length;
    console.log(totalFac);
  });
  console.log(totalFac); // Executed first
},

The two console.log() functions are executed reversely. As totalFac is initialized as 0, the console shows 0 firstly. The the real value of totalFac is shown after the 0. In fact, if totalFac is initialized as 888, the console will show 888 firstly, then the real value. Apparently queryFeatures() is executed last, behind the second console.log().

How come that a function coded in front of the next function is executed afterwards?


texts: Using Replace Geometry to replace selected feature with circle in ArcGIS Desktop?

texts:
I have a polygon shapefile and I want replace every irregular polygon with a circle.

I think I can do it with the Replace Geometry tool. But once the Replace Geometry tool is selected, draw a polygon mode is immediately entered. If I select the circle tool in the Draw tool window, the Replace Geometry tool becomes inactive.

Is there any way to use the Replace Geometry tool to draw a circle polygon?