texts: Changing/adding information about QGIS plugin without causing errors

texts:
I developed my first plugin to QGIS and I want to upload it, but... to do this I have to change information about plugin (like description/add code repo link and bug tracker link) and that's where my problem comes in. I update my metadata.txt file, but doing so I cause an error. In plugins repository: "This plugin is broken. Error reading metadata." When I reload plugin:

Traceback (most recent call last):
  File "D:/Programy/QGIS/apps/qgis/./python\qgis\utils.py", line 364, in unloadPlugin
    _unloadPluginModules(packageName)
  File "D:/Programy/QGIS/apps/qgis/./python\qgis\utils.py", line 375, in _unloadPluginModules
    mods = _plugin_modules[packageName]
KeyError: u'<my_folder_cointains_plugin>'

but the weirdest thing is that plugin is working perfectly.

Maybe there is a better way to update info about plugin instead of modify metadata.txt file?


texts: Computing dominant area in polygon using ArcGIS Desktop?

texts:
First, I have a shapefile consisting of square grids and each grid has an ID. Second, I have a shapefile consisting of different zones (with IDs).

A grid ID in the first shapefile can contain many zone IDs from the second shapefile.

I want to know what is the dominant zone ID inside a grid and record that in a table. I only want to know the dominant zone (in terms of the area) and not the rest of the zones intersecting that grid. In the end, I would want a 2-column table with all the grid IDs in the first column and the corresponding dominant zone ID (or the largest zone in terms of area) in the second column.

Here is a sample figure.  By just looking at the figure, I could tell that in Grid ID 1, the dominant zone/area is Zone ID 1.  In Grid ID 2, the dominant zone/area is Zone ID 2.  And in Grid ID 3, the dominant zone/area is Zone ID 3.  I would like to have a table with two columns, with each grid showing only the ID of the dominant area.


texts: Is there a way to Export a layer/map list from AGOL

texts: We have just started using AGOL as an organization, and unfortunately it has gotten very disorganized fairly quickly. We were tasked with getting the layers/maps organized. It would really help if there was a way to export the the list of layers and maps that we have hosted on AGOL. Is there a way to do this?


texts: I have census block data polygons. I want to overlay them over Zip Codes (larger polygons) in order to estimate the population in the Zip Codes. Or overlay buffers around toxic waste sites over census blocks to estimate the population within the buffer. How is this done In QGIS?


texts:
Not sure if anyone else has encountered this error. I'm trying to use the kde command to generate some kernel density raster layers based on a shapefile. The error reads as follows:

Error: An important error has occurred. Please include the information below if you submit a query about this error. The owner SID on a per-user subscription doesn't exist (Exception from HRESULT: 0x80040207)

After some research, it seems like people encounter this error through other programs, but I couldn't find any posts related to GME.

Here's the code:

path<-"C:\Users\rweber\Desktop\GIS\"; uniquevalues(in="C:\Users\rweber\Desktop\GIS\BigAllSpr17.shp", field="Tag__"); for (i in 1:length(uniquevalues)){ kde(in="C:\Users\reweber\Desktop\GIS\BigAllSpr17.shp", out=paste(path, uniquevalues[i], "_kde"), bandwidth="LSCV", cellsize=3, kernel="GAUSSIAN", ext="C:\Users\rweber\Documents\ArcGIS\BigCreek\BigCreekOutline.shp", where=paste("Tag__='", uniquevalues[i],"'")); };


texts: Error when Merging building footprint files - Input feature falls outside of output geometry domains

texts:
When I attempt to merge the building footprint files for a city I'm working on, I get an error I've not experienced before. The Results readout says "The input feature falls outside of output geometry domains," and outputs only one of the 8 or so footprint files I'm trying to merge. I have attached a picture of the physical output and of the Results readout.

I have researched the error fairly extensively, and it seems like there may be a problem with the XY domain or something of that sort. I have tried a number of different solutions offered online and in this forum, but nothing has worked for me yet. There seem to be no issues with the projection of the footprints, and I'm wondering if the files were spatially corrupted when they were created. I'm working in MN, and have used building footprint files from almost a dozen other counties with no problem at all. Thoughts?
]2


texts: arcpy.da.insertCursor not saving output?

texts:
Referencing an answer to Interpolating points along line in Python for ArcGIS Desktop?, I have copied this code verbatim (swapping out my two feature classes; a line layer and an empty point layer) but for some reason it does not save the output (e.g. the point feature class is empty). I'm running it in IDLE and if I leave the Python shell open I can add (after the script runs) the following code:

outPath = r"C:\path\to\MyData\testGDB.gdb"
outName = 'test_points'
ftrCount = int(arcpy.GetCount_management(outPath + "\\" + outName).getOutput(0))

and then I can type

"> ftrCount"

and it returns "17"

So obviously there are seventeen features created that are not being stored in the output feature class.

This is similar to Insert Cursor fails to write results to table but my results ARE in tuple format so I'm failing to understand what is wrong.

If I print the xy variable in the loop I get my state plane coordinates ...

(617914.0259078296, 612215.8199066787)
(617894.1203419868, 612230.9450000166)
(617874.214776144, 612246.0700933544)
(617854.3092103013, 612261.1951866923)
(617834.4036444585, 612276.3202800301)
(617814.4980786156, 612291.445373368)
(617794.5925127729, 612306.5704667058)
(617774.6869469301, 612321.6955600437)
(617754.7813810873, 612336.8206533815)
(617734.8758152445, 612351.9457467194)
(617714.9702494018, 612367.0708400572)
(617695.0646835589, 612382.195933395)
(617675.1591177161, 612397.3210267328)
(617655.2535518734, 612412.4461200706)
(617635.3479860306, 612427.5712134085)
(617615.4424201878, 612442.6963067463)
(617595.536854345, 612457.8214000842)


texts: Help converting projection/coordinates to Google Earth

texts:
I'm trying to program a GPS style tracker for a simulation game but I'm having a hard time figuring out how to transform the game's coordinates into Google Earth's.

The game's world is flat and has the following map projection:

The game's current position data is:

Long: from -21,600,000 m to +21,600,000 m

Lat: from -10,800,000 m  to +10,800,000 m

Centered at 0m, 0m (0,0 degrees)

Distance between degrees is the same everywhere (120,000 m) for latitudes or longitudes.

I believe this is called an equidistant projection?

My problem is this, when using the formulas (180/21,600,000 * X position) and (90/10,800,000 * Y position) the game's coordinates don't translate correctly to Google Earth (like in this picture where red is the actual path in game, white is the path exported to GE)

I realize that the world in Google Earth is a 3D sphere so there's probably some more factors I need to take into account but since I'm a completely beginner when it comes to cartography/GIS, I'm kind of lost.

Is there a conversion formula I should be using to match the coordinates?


texts: Renaming rasters in directory based on field value of centroid feature class in ArcGIS Desktop?

texts:
I have a lot of rasters named like r001.tif, r002.tif and so on.

There is a point shapefile with centroids of these rasters and their real name in the attribute table.

I'm looking for a way or some tool/model to rename these rasters according to their real name in centroid point feature?


texts: Extracting tree stems from LiDAR point clouds using 'bottom-up' approach

texts:
Let me preface by recognizing that there are some previous questions that are related but different than mine because they are focused specifically on tree crowns rather than stems here and here.

I have some extremely dense (i.e. >1000 points/sq.m) point clouds of a forest that were created using a mobile LiDAR scanner attached to a pickup truck. Because the point clouds are created from the ground level rather than from above, I want to use a tree segmentation algorithm that models the stems from the ground->top, rather than from the top->ground.

There are many top->ground approaches available in the R package lidr including one point cloud-based approach that was developed by Li et al. . I have tried it on similar data and it does not perform well, which is unsurprising because it uses local maxima as inputs (tops of trees).

So, I have tried two options:

) Layer stacking as developed by Ayrey which has a github repo here. I have started working on applying this to my clouds but I'm not sure whether the inputs are supposed to be: a.) the normalized point cloud in .las format b.) slices of the normalized point cloud (i.e. 0-1 m, 1-2 m , etc..) or c.) gridded (tiled) normalized .las files.

I tried option a.), and I'm getting this error:

Error in readBin(con, "raw", n = pointDataRecordLength * numberPointRecords,  :
  vector size cannot be NA
In addition: Warning message:
In pointDataRecordLength * numberPointRecords :
  NAs produced by integer overflow

2.) The treeseg algorithm developed by Burt which has a repo here. There isn't much that I can find in the way of documentation about this package, but I've tried to install it and ran into problems related to being on Windows. I'm working on using an Ubuntu server to implement treeseg, but would like to know if it exists somewhere else.

If there are other options I would like to hear about those, particularly other RANSAC-based approaches such as #2. I am open to solutions in R, Python, or anaconda.


texts: Geoserver fid with database spatial views

texts: I created a database spatial view that performs a certain query on a spatial PostGIS table (Parcels layer), the view is working well, and I published it via Geoserver, and everything went well, except that the feature id generated by geoserver (Parcels.fid) is displayed in a strange format NOT in integer format as with regular PostGIS tables published with Geoserver as shown in the attached image. What might be the issue here?


texts: Error trying to split a Linestring in PostGis

texts:
I'm trying to split a group of Linestrings when they cross a Polygon shape, I'm using the following query:
SELECT
  v.*,
  c.name,
  (st_dump(st_split(v.geom, c.geom))).geom AS geom
INTO table
FROM
  linestrings v,
  polygon c

I get the following error:
"Splitter line has linear intersection with input"
SQL State : XX00

So far I've tried to check valid/invalid geometries, do a Dump first to the polygon shape and nothing changes.
To summarize, I need to Split the line when they pass trough the polygon so I get two lines, one with the information of the polygon and one without it.
EDIT: Sample data based on the comments

The polygons are the pink lines (no background but it's a polygon) and green lines are the linestrings (streets) I need to split when they pass through the polygon.
Indeed, some of the lines equal the polygon I'd like to split from, how can I handle this? Because using ST_DIfference would kill the lines (streets) I also need
Appreciatte the help


texts: Changing layout element order in ArcGIS Pro?

texts:
I cannot find an option to change the order of Layout elements in ArcGIS Pro (1.3.1).  This is where you right-click > Order on a map element and choose from Bring to Front, Send to Back, Bring Forward, Send Backward.

Example from ArcMap:

Whereas in ArcGIS Pro there is no Order option in the right-click context menu:

Also no option in the Element Properties dialogs:

I have found that the order that I place the elements dictates the order that they draw (the elements I add last are drawn on top).  If I delete an element that is below another, then redraw it, it will be placed on top.

Is there somewhere else I should be looking to choose the draw order of layout elements in ArcGIS Pro?


texts: Creating weighted sum analysis using DEM and population data using QGIS?

texts:
I have a shapefile containing population points for Vietnam, and I am aiming to perform a weighted sum analysis using a Digital Elevation Model.
Basically, I'd like to combine elevation, population densities and slope to find the best areas for terraced cultivation. I have a full DEM for Vietnam, and population densities.

The ideal locations would be medium slope angles without high population densities.
However I'm a bit stuck on what path to follow.


texts: Creating shapefile and then edit it but get feature class does not participate in a network dataset?

texts:
I want to mark the drainage but cannot do it as it gives an error saying:

  The create feature task could not be completed. The turn feature class
  does not participate in a network dataset.


texts:
I am having this error message from ol3-wms(-Geoserver) routine:

Uncaught TypeError: Cannot read property 'closure_uid_477334679' of undefined ol.js:17
Uncaught TypeError: Cannot call method 'hf' of undefined ol.js:180

Here is the related code:

wms_depivmLayer = new ol.layer.Image({
   extent : [ 2857613.741389, 4274927.875099 , 4989786.191152 , 5176940.449967],
   source : new ol.source.ImageWMS({
       url: 'http://localhost:8181/geoserver/work1/wms',
       params: { 'LAYERS' : 'work1:depiv3_3857' },
       serverType : 'geoserver',
       format :'image/GeoTiff'
   })
})
map.addLayer(wms_depivmLayer);

I tried new ol.source.TileWMS({..., but it fails.

Bur when I use curl :

curl --trace -i -X GET -H "Content-Type: application/image" http://localhost:8181/geoserver/work1/wms?service=WMS&version=1.0.0&request=GetMap&layers=work1:depiv3_3857&styles=&bbox=2857613.741389,4274927.875099,4989786.191152,5176940.449967&width=780&height=330&srs=EPSG:3857&format=image/GeoTiff" > out.png

it is OK.

Where am I doing wrong?


texts: Routing - How to deal with polyline with fork?

texts:
I currently work on a routing system for kayak tours.
In ArcGIS I have a polyline shapefile with each polyline representing a route with a description.

The problem I experience is with routes that include forks / parting of ways, as can be seen in the figure. It is basically one route, but is splitted in the middle (with different difficulty levels) then discharging again into the same route.

What is the easiest, best, non-problematic way to deal with this situation? Do I have to create two separate routes?

What should be considered for the solution is that the final result should be a WebGIS, with the possibility for the user to select a specific route and get information about it. If two routes are created, and the user clicks on the first segment of the route, would he be able to see that there are two different routes (as it works with the Identity tool in ArcGIS)?


texts: Why do Landsat 8 grayscales have a range of (0, 2^16-1) while the screen colors are (0, 2^8-1)?

texts: The grayscale levels in Landsat(0-65535) are more than that can be displayed on a standard display screen(0-255). The use of Landsat reflectance values must be more than just display purposes, which is my assumption(for drawing the graphs etc.). Because all the levels can't be shown using RGB color gradient.


texts: How to use CQL to return a geometry type?

texts:
I would like to use CQL in a URL call to return only a particular geometric type from a WFS that broadcasts multiple geometries.  I have been going over this:

http://docs.geoserver.org/latest/en/user/filter/ecql_reference.html

and cannot see where it says "Here is how you build the URL," or "Here is how you return only geometries matching a given type."

Here is a non-working call that expresses what I want to do on a GeoServer instance with a WFS 1.0.0 feed:

http://server/geoserver/ows?service=wfs&version=1.0.0&request=GetFeature&typeName=dataset:layer&cql_filter=(geometry='Point')AND(WITHIN(geometry,POLYGON((10.00 20.00,...))))

This call works:

http://server/geoserver/ows?service=wfs&version=1.0.0&request=GetFeature&typeName=dataset:layer&cql_filter=WITHIN(geometry,POLYGON((10.00 20.00,...)))

So all I need to do is add in the geometric type limiter.

My geometry token on GeoServer is geometry

I know how to do the geometric limitation using OGC XML, but I do not know how to add in the polygon WITHIN statement using OGC XML.  So I would accept an answer that clearly defines how to construct the XML version of this same thing, or a CQL solution for the same.  I tried a coarse bounding box:

<ogc Filter xmlns:ogc='http://www.opengis.net/ogc'>
    <ogc:And>
        <ogc:BBOX>
            <ogc:PropertyName>geometry</ogc:PropertyName>
            <gml:Box srsName="EPSG:4326">
                <gml:coordinates>10.0,20.0,30.0...</gml:coordinates>
            </gml:Box>
        </ogc:BBOX>
        ---other queries---

This ends up yielding:

Attempted to construct illegal filter - I don't understand the tag: gml:Box.


texts: How to install everything "geo" in Ubuntu?

texts:
I am new to Ubuntu SAUCY and I must confess the transition from Windows has not been really easy for me. On Windows everything seems pretty much straight forward but I am getting frustrated because It seems when I try to install either pyproj, GDAL, Mapnik, proj4, PostgreSQL/PostGIS and other Web GIS packages they probably don't work together and their dependencies aren't the same.

My question is isn't there an easy way to get all these packages to work together?

When I install QGIS it removes something else same goes to Mapnik.

I install Mapnik the other day it even crashed and messed up my system, had to do a clean OS install all over again.

Here's the error I'm getting now:

libmapnik-dev: Depends: libmapnik (= 2.2.0-ubuntu1~saucy1) but 2.2.0-ubuntu1~saucy1 is to be installed
               Depends: mapnik-utils (= 2.2.0-ubuntu1~saucy1) but 2.2.0-ubuntu1~saucy1 is to be installed
               Depends: libpng-dev but it is a virtual package
               Depends: libtiff-dev but it is a virtual package
               Depends: libltdl7-dev but it is a virtual package
               Depends: libicu-dev (>= 4.2) but 4.8.1.1-12ubuntu2 is to be installed

Here is the last link(help) have have used.
https://github.com/mapnik/mapnik/wiki/UbuntuInstallation

All the GIS packages I have tried installing are throwing this same error message.

I really need help on how to go about getting these installed because I can't work without all of them.


texts: Preserving metadata after processing shapefiles

texts:
This is really my first time working with metadata and I just have a few concerns in regards to it.

Hypothetically, if I were to merge two shapefiles together and then, explode them back to individual shape, what would the status of the metadata (xml file) look like ? WIll the metadata get altered? Or will it stay the same?

My other question is what would be the best way if I like to preserve the metadata in their original even if the shape has gone through some geoprocessing?


texts: I draw the circle on the map. The circle tool is taken from ArcGIS API for JavaScript draw tool. How can I convert that circle into JSON string.


texts: Putting multiple lines of Python into ArcGIS 10's Field Calculator

texts:
Entering these lines of Python one at a time works like a charm... Just need one more seemingly simply issue solved...

How do we place multiple lines of Python code into ArcGIS's Field Calculator without producing Error 000539 or syntax error?

I've tried several different syntaxes with colons and various spacings / returns .... screen shot:

   multiple lines of Python code here:

'1201-LT 210A' if !sc2! in (12013,11999,11998,12016,12015,12004,12012,12011,12001,12002,11997,12017,12009,12003) else !March_Proj!

'1201-LT 210B' if !sc2! in (12074,12076,12078,12072) else !March_Proj!

'1201-BO' if !sc2! in (20052,20053,20044,20045,20039,20050,20051,24157,24158,22927,24783,24785,24784,24782,24035,22924,23923,24154,22528,21912,23164) else !March_Proj!

'1202-LT 21F' if !sc2! in (1067,1066,1078,1060,1052,1075,1068,1051,1079,1062,1070,,1071) else !March_Proj!


texts: How to upload a YSLD style via cURL / REST API to GeoServer

texts:
I'm trying to create and upload YSLD styles with cURL and REST API. According to this example and this thread I'm able to add corectly style in my workspace:
curl -v -u admin:pass -XPOST -H "Content-type: text/xml" -d "<style> <name>BARIERY</name> <format>ysld</format> <filename>BARIERY.yaml</filename> <languageVersion>  <version>1.0.0</version> </languageVersion>  </style>" http://SERVER:8082/geoserver/rest/workspaces/WORKSPACE_NAME/styles

Then I try to upload this style:
curl -v -u admin:pass -XPUT -H "Content-type: application/vnd.geoserver.ysld+yaml" -d @BARIERY.yaml  http://SERVER:8082/geoserver/rest/workspaces/WORKSPACE_NAME/styles/BARIERY

with error:
null; mapping values are not allowed here;  in 'reader', line 1, column 19:
    name: BARIERYtitle: BARIERYabstract: BARIERYfeatur ...
                      ^* Connection #0 to host SERVER left intact

Adding &raw=true to cURL line command:
curl -v -u admin:pass -XPUT -H "Content-type: application/vnd.geoserver.ysld+yaml" -d @BARIERY.yaml  http://SERVER:8082/geoserver/rest/workspaces/WORKSPACE_NAME/styles/BARIERY&raw=true

Adds style but it has only one line and won't validate:
name: BARIERYtitle: BARIERYabstract: BARIERYfeature-styles: - rules:   - name: wszystkie     scale: [min,5000]     symbolizers:     - line:        uom: metre        stroke-color: '#4c0e6a'        stroke-width: 0.2        stroke-linejoin: bevel        stroke-linecap: butt     - line:        uom: metre        stroke-color: '#4c0e6a'        stroke-width: 0.3        stroke-dasharray: 0.3 0.5        stroke-linejoin: bevel        stroke-linecap: butt

My YSLD file content which validates and working fine when pasting it to GS web interface directly:
name: BARIERY
title: BARIERY
abstract: BARIERY
feature-styles:
 - rules:
   - name: wszystkie
     scale: [min,5000]
     symbolizers:
     - line:
        uom: metre
        stroke-color: '#4c0e6a'
        stroke-width: 0.2
        stroke-linejoin: bevel
        stroke-linecap: butt
     - line:
        uom: metre
        stroke-color: '#4c0e6a'
        stroke-width: 0.3
        stroke-dasharray: 0.3 0.5
        stroke-linejoin: bevel
        stroke-linecap: butt

What am I doing wrong or missing? My yaml file is directly copied from workspace/styles folder.


texts: Stack rasters with different extents and band count with python and gdal.BuildVRT

texts:
I'm trying to create a 5band raster. To do this, I'd like to stack a composite image of bands R, G and Nir, a raster of 1 band representing the NDWI and the last one that is a slope raster. My final raster would be a composite of R,G,Nir,NDWI,slope. All bands are in uint8 and WGS84.
The problem is that they do not have the same extent so I can't directly stack them together (see image below).

To go around with it, I created an empty raster that has the same extent of the slope raster and I merged it to the RGNir and NDWI raster. Now the outputs have the same extent, but they look green or blue depending on the visualizatiuon software. What did I do wrong? I guess that's something to do with the bands that where not well taken in account with gdal.BuildVRT.

Here is my piece of code to stack the RGNir image with the empty raster. I did the same for the NDWI.

from osgeo. import gdal

empty_raster = report_folder + "\\" + "empty.tif"  # 1 band raster filled with np.nan
RGNir_raster = report_folder + "\\" + "rgnir.tif"  # 3 band raster, Red, Green and Near Infrared

outvrt = '/vsimem/stacked_rgnir.vrt'  # /vsimem is special in-memory virtual "directory"
outtif = 'stacked_rgnir.tif'
tifs = [empty_raster , RGNir_raster]

outds = gdal.BuildVRT(outvrt, tifs, separate=True)
outds = gdal.Translate(outtif, outds)


texts: How do I find points that are NOT within a list of polygons using MS SQL?

texts:
I have a table of points, and and a table of polygons. I have managed to build queries (MS SQL) to get the containing polygon for a given point, as well as listing all the points within a specified polygon, but I cannot work out how to find all points that are not within any polygon.

The following query lists all points with the containing polygon. My initial thought was to just look points that are not contained (i.e. STContains() <> 1), but this returns all points too, seem there are always polygons that do not contain a given point.

    SELECT points.name, polygons.name
    FROM points CROSS JOIN
    polygons
    WHERE  (polygons.shape.STContains(points.shape) = 1)

How do I find those points that are not within any polygons?


texts: Use laspy to create las file from scratch without opening an existing las file first

texts:
I have found instructions for creating a las file by opening an existing file, modifying it, then re-saving it.

This re-uses the headers from the original file.

But how do I create a new file from scratch without loading another in the first place? I cannot see any documentation on the required format for the file, points, or headers.

I only need the bare minimum: x,y,z position for each point.

Here is how I assumed it might work...

import numpy as np
import laspy
import laspy.header
import laspy.file

points = []

#x,y,z values
points.append([0,0,10])
points.append([1,0,10])
points.append([2,0,11])

header = laspy.header.Header()
outFile = laspy.file.File("./output.las", mode = "w", header = header)
outFile.points = np.array(points)
outFile.close()

This fails with:

-> outFile.points = np.array(points)

/laspy/file.py
-> self._writer.set_points(new_points)

laspy/base.py
-> self.data_provider._pmap[:] = points[:]

ValueError: could not broadcast input array from shape (3,3) into shape (3)

Could anyone kindly point to some sample code or tips to get this working?


texts:
I've been through associated answers but cannot quite seem to find something which works!

I'm having trouble getting TimeManager to recognise a simple data field (this is in QGIS2 - but I've had this error in earlier versions). I have these fields formatted in what appears to be one of the acceptable formats:

... here is a screenshot of the field properties:

The format appears to be recognised in QGIS as I've worked out days difference between two dates (the "Time on Market" field shown in the image).

However ... I always end up with:

The Twitter.shp file works fine as a test, so I don't think this is an issue with the install / phyton conflict.

Any thoughts welcome!


texts: Offset Expressions Dynamic QGIS - Unique non-repeating Numbers

texts:
I am trying to create a layer style that shows line features that share the same geometry, an exploded view for line Features.

What I have done so far via the Offset expressions in QGIS 3.6

("Length"  -  "Length"  + rand(0,count('Cable_13260270_443e_46e6_9da1_39282a8c86d7',  intersects( $geometry ,@map_extent))))

This is the view with 'Single Line' with multiple Features sharing the same geometry:

This is after style with Offset and expressions:

I had to add the "Length"-"Length" to force it to run the Expression for each Feature, if not I ended up with just 1 random number. Perhaps there is a better way?

The issue I am facing is that some of the random numbers repeat, which then hides the line Feature as they then share the exact Offset. I don't mind the changing views when the map changes, as it should based on how many lines are within the map extent. So in a 'busy' area there would be more Offsets and with only 1 line there would be None or just 1 Offset.

How can I make the Offset Expression pull from a list, such as 1,2,3... Array or string or how can the random number be set to non repeating?


texts: Does it help uploading s QGIS minidump file when reporting a bug?

texts: Is it helpful for the developers to upload the minidump file (.dmp) at hub.qgis.org when QGIS is crashing?


texts: Help with PostGIS polygon geometry - non-closed rings

texts:
I've picked up a copy of the super-wicked book 'Python Geospatial Development' by Erik Westra (Amazon link), and I'm working through it. Currently, it's teaching me to load GSHHS coastline data from a shapefile into a PostGIS database, in preparation for building a geospatial web app.

My problem is this: when I try to import the GSHHS data into PostGIS, it is rejected due to the coastline polygons not being considered 'valid'. Specifically, I am given an error message described some (but not all) of the coastline polygons as being 'non-closed rings'.

I understand that this error is trying to tell me that the first and last points of the polygon are not the same. However, this is simply not true. I have examined the WKT representation of many of the polygons, and they are correct. They definitely begin and end with the same co-ordinate.

The polygons are extracted from the shapefiles using the OGR library, and exporting each polygon feature to WKT. I've tried reconstituting the polygon via Shapely, and experimented with WKB, but to no avail. I have been able to load the same data into PostGIS as a MULTIPOLYGON table, using the shp2pgsql loader.

I was wondering if anybody out there had:
(a) perhaps used the same book, got stuck at the same problem, and has the answer for me?
(b) has encountered a similar problem, and found a solution?
(c) failing that, has some 'best practice' advice for ensuring valid geometry before loading into PostGIS?

UPDATE: a colleague has suggested that the 'non-closed rings' problem may just be a symptom of another problem. It is possible that my PostGIS/PostgreSQL configuration has size limits (on insert transactions, packets received, text strings, etc).

As I'm using very long WKT polygons as input, PostGIS may be cutting them too early to allow each polygon to complete. I will test it out tomorrow, but it does sound likely. My insert of country borders was only accepting some records and not others. From memory, the accepted geometries were for small island nations like Antigua (and so probably had short WKT representations).

So this could end up being more of a PostGIS database admin thread, rather than an invalid geometry thread.


texts: ArcMap redraws every layer when changing just one

texts:
I have 10 layers or so loaded in a data frame in ArcMap 10.2. Some are complex such as NHD hydrology and Tiger roads.

Why does ArcMap redraw all layers when I change the symbology of just one? Is there a way to stop ArcMap from doing this behavior?


texts: Change Layer name when converting from GeoJSON

texts:
I am converting GeoJSON files to other formats (including KML) using ogr2ogr.

As you may know, there is no field in a GeoJSON file to specify the name of the layer, causing every conversion to have the name OGRGeoJSON. For example the following GeoJSON file:

{ "type": "FeatureCollection",
  "features": [
    { "type": "Feature",
      "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
      "properties": {"prop0": "value0"}
      }
     ]
   }

is converted as follows in KML:

<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document><Folder><name>OGRGeoJSON</name>
<Schema name="OGRGeoJSON" id="OGRGeoJSON">
    <SimpleField name="Name" type="string"></SimpleField>
    <SimpleField name="Description" type="string"></SimpleField>
    <SimpleField name="prop0" type="string"></SimpleField>
</Schema>
  <Placemark>
    <ExtendedData><SchemaData schemaUrl="#OGRGeoJSON">
        <SimpleData name="prop0">value0</SimpleData>
    </SchemaData></ExtendedData>
      <Point><coordinates>102.0,0.5</coordinates></Point>
  </Placemark>
</Folder></Document></kml>

I've read this blog post from 2007 explaining why this occurs and I know that GeoJSON does not have the concept of layer name in its specifications.

I would like to know if there is a simple way to rename the layer on the fly using OGR, or if I should generate the output with ogr2ogr and programmatically change the output layer name, depending on the output file format with another program since, as far as I know, the OGR API does not have a function to rename the layer.


texts:
I have problem with building advanced stacked labels in ESRI arcMap 10.2. The example is below. As You can see on the beginning there is a letter which is in the middle of two line after it.

How to do it in one label class?

I am able to build this kind of label but I need two classes for that:

first with offset showing only first letter
second with underlined nominator part and denominator line.

Problem is when I change it to annotation in map every label is build from two parts (each for class) and if further movement of anno is necessary its problematic - You need to remember to select two labels, sometimes they overlap extensively and selection is almost impossible.


texts: I am a novice to arcgis 10 so please forgive my ignorance.I have this 2000 survey points shapefile and I was told to , I guess is dislocate, generate new survey points, each new should be 500m west and 500m south from the original point. How can I do that in arcgis 10? I remember there use to be in a move button, but I canot find it now. Can you help me?


texts: hibernate spatial DDL creation with maven hibernate3 plugin

texts:
This is a very special question, I hope that somebody here already worked in a similar project setup.

I am working with Netbeans and started a maven web project based upon the maven HS 4.x tutorial on http://www.hibernatespatial.org/tutorial-hs4.html

This compiles fine using maven.

Next I want to use the maven hibernate3 plugin from MOJO (http://mojo.codehaus.org/hibernate3-maven-plugin/index.html), so I can create SQL Scripts and the database schema out of my java entitiy classes. So the workflow should be

code java entitiy classes with spatial (postgis) fields
compile
create DDL out of entity classes
create/update database schema with DDL
run app

The problem is, when I run

mvn hibernate3:hbm2ddl

The plugin does not search for hibernate spatial in the remote repo on www.hibernatespatial.org like the compile plugin does, but searches for it in the central repo. Due to the fact, that the hibernate-spatial.jar does not exist there, DDL creation fails. This is what the maven output looks like:

[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl ... Plugin org.codehaus.mojo:hibernate3-maven-plugin:2.2 or one of its dependencies could not be resolved: Could not find artifact org.hibernate:hibernate-spatial:jar:4.0-M1 in central (http://repo.maven.apache.org/maven2) -> [Help 1]
...
Caused by: ... Could not find artifact org.hibernate:hibernate-spatial:jar:4.0-M1 in central (http://repo.maven.apache.org/maven2)
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

As I already mentioned, maven compile goal works and resolves hibernate-spatial correctly.

Is there an alternative way to create database schema out of java entity classes without the maven hibernate plugin?


texts:
This question may be off topic, in which case I apologise.

I have a problem where water level is important and I have two water levels defined, Trinity High Water and Mean High Water springs (MHWS). I understand what MHWS is but I don't understand what Trinity high Water is and how it relates to MHWS.


texts: Converting QGIS vector layer to single track that can be used in Garmin Basecamp

texts:
I would like to export a vector layer from QGIS into a GPX file consisting just of a single track. I can export the layer, which in QGIS shows a cycle route, i.e. a single line, in GPX format. I think I need to set GPX_USE_EXTENSIONS to yes. I also set FORCE_GPX_TRACK to yes. The export works fine, but when I open the file in Garmin Basecamp, it shows hundreds of single points and not a single line/track.

How do I export the layer so that it shows just a single track in Basecamp and not hundreds of points?


texts: Expression Builder shows only NULL for "Fields and Values"

texts:
Trying to buffer a point layer based on distance, expression builder shows null value for fields.

Points layer based on CSV and imported into QGIS, showing correctly. I created this CSV in Excel and maybe I have done something wrong.

Is there any solution for this issue?


texts: Is there any character limit in st_union and array_agg?

texts:
I want to make a geometry array or a new geometry which is combination of few other geometries. I have one table with id column, geometry column and start_cls column. So, I want to group my ids and geometries based on start_cls value. So, I executed following query.

SELECT array_agg(gid), st_union(geom), start_cls FROM public.edge_table_original group by start_cls limit 20

But in most of the cases, the union of geometry is giving null. I also tried with array_agg(geom) instead of st_union(geom). But the result is same. And I observed when the number of elements in the array is small, then it is giving the value of array_agg and st_union. But if the number of elements are significantly high, then it is not giving. May be there are some character limit problem. How to overcome this problem? I have added the screen shot of data output.

I also checked ST_AsTWKB. But this function returns bytea. But I need geometry or geometry[] output. As I shall use st_makeline on this geometry or geometry[].


texts: SelectLayerByAttribute_management - Python string syntax

texts:
I am having trouble getting my syntax correct, currently I have

arcpy.SelectLayerByAttribute_management ("SpatialSCRIMNet", "NEW_SELECTION", RtyF LIKE 'D%' OR RtyF = 'S1' )

RtyF is a defined attribute using GetParameterAsText, "SpatialSCRIMNet" has been created via MakeFeatureLayer_management

I have tried:

arcpy.SelectLayerByAttribute_management ('  "SpatialSCRIMNet", "NEW_SELECTION",' RtyF LIKE 'D%' OR RtyF = 'S1' ')

and as above but with "

Can somebody advise please?


texts:
I have a set of lon/ lat coordinates that locates lines. Each line is characterized by 3 points, the start, center and end which were measured using a handheld GPS. Since the individual coordinates are very much likely to be imprecise (which would give me crooked lines), I want to get an "corrected line" with a given length (50m), centered on the center coordinate and with the average direction of the vectors start-center and center-end.
The lines should subsequently be buffered by 2m to generate rectangles, but at first I need the lines to start with.
I tried to implement this in R. It's been some time since I last had vector geometry and I don't know how this all works on a spherical surface. Maybe someone has an idea?

Edit: I have the following code so far (it only uses the first row of the dataframe, i.e. the first line, and will be looped once it works)

# Calculate the length of a 1 degree difference
earth_circumference <- 40075016.7
for(i in 1:nrow(coords)){
  coords$d_m_lon[i] <- earth_circumference/360*cos(abs(coords$c_lat[1])*pi/180)
  coords$d_m_lat[i] <- earth_circumference/360
}

# Claculate the difference in degree that 1m at the surface makes
coords$m_d_lon <- 1/coords$d_m_lon
coords$m_d_lat <- 1/coords$d_m_lat

# Calculate average transect directions
points <- data.frame(
  x = c(coords$s_lon[1], coords$c_lon[1], coords$e_lon[1]),
  y = c(coords$s_lat[1], coords$c_lat[1], coords$e_lat[1])
)
mod <- lm(points$y ~ points$x)
a <- coefficients(mod)[1]
b <- coefficients(mod)[2]

# Calculate polygon points
center <- c(coords$c_lon[1], coords$c_lat[1])
direction <- c(b-a, 1)/sqrt((b-a)^2 + 1)
start <- center + 25*c(coords$m_d_lon[1], coords$m_d_lat[1])*direction
end <- center - 25*c(coords$m_d_lon[1], coords$m_d_lat[1])*direction

dx <- end[1] - start[1]
dy <- end[2] - start[2]
ortho <- c(-dy, dx)

A <- start + c(coords$m_d_lon[1], coords$m_d_lat[1])*ortho/sqrt(ortho[1]^2+ortho[2]^2)
B <- start + c(coords$m_d_lon[1], coords$m_d_lat[1])*ortho/sqrt(ortho[1]^2+ortho[2]^2)
C <- end + c(coords$m_d_lon[1], coords$m_d_lat[1])*ortho/sqrt(ortho[1]^2+ortho[2]^2)
D <- end + c(coords$m_d_lon[1], coords$m_d_lat[1])*ortho/sqrt(ortho[1]^2+ortho[2]^2)

where coords is a dataframe with the coordinates of the measured start, center and end points of the lines.
Each row of the dataframe contains the points of one line, so e.g. s_lat[1] is the latitude of the first start point, c_lon[1] is the longitude of the first center point, e_lat[1] is the latitude of the first end point and so on.

Now, the problem seems to be somewhere in the calculation of the polygon points: I want to generate the new start and end points of each line by going 25m in each direction along the regression line given by the linear model, starting at the center (subsequently, to get corner points A-D of a rectangle, I want to go 1m from there, in a direction orthogonal to the regression line). However, 25m is not the same length in latitude and longitude, because they have to be scaled with the values m_d_lat[i] and m_d_lon[i] for each line i. It somehow shifts my points and I don't know yet why and how I can solve the problem.


texts: Can OGR handle Esri's Geodatabase extensible markup language (XML) files?

texts:
The USDA Forest Service distributes GIS data as Esri Geodatabase extensible markup language (XML) files. I downloaded one in the hopes that I would be able to convert it to something less esoteric using OGR. However:

$ ogrinfo ~/Downloads/S_USA.National_Trails.xml
FAILURE:
Unable to open datasource `/Users/martijnv/Downloads/S_USA.National_Trails.xml' with the following drivers.

Unfortunately, neither the FileGDB driver nor the OpenFileGDB driver's pages explicitly mention this XML format. It seems to be defined here on ESRI's website.

Any way to read / convert this with FOSS4G tools?


texts: QGIS: How do I combine/summarize information from several attributes to one specific attribute?

texts:
I have a pretty specific question and I dont know how to approach this.
I have a polygon layer for subbasins in the Danube area (HydroShed) which also contains information for water discharge.
The first picture shows the attribute table. Each subbasin has a "Hybas_ID" which contains information for the Pfafstetter Code. Most of these subbasins have information for downstream neigbours, which is portrayed in the "Next_Down" (showing the Hybas_ID of the specific subbasin it flows into) column.
Some of these subbasins also have more than one upstream neighbour, so for example subbasin "2080452200" and "2080452210" flow into the subbasin "2080453270" (Picture 1).
My question is: Can I combine/summarize the water discharge information (column "TD") from the first two subbasin and attach it to the subbasin these two flow into (into a new column i.e.)? This has to be done for every subbasin which has upstream neigbours, is there a possibility/tool or function to do this in one go? There are over 1300 subbasins, so to do it by hand wouldn't really be an option.
Unfortunately I'm not really frequent in SQL.


texts: Simple mathematical operations using R script in QGIS

texts:
I have used several interpolation methods to create digital elevation models from a trainings data set. Now, I would like to assess the quality of each DEM by calculating the Root mean square error using an independent validation data set. I have already used the "Point sampling tool" which created a new shapefile with extracted heights from a DEM.

In the past, I have used an R script to calculate the RMSE and would like to use this script in QGIS. However, I am struggling with defining the parameters, can someone help here?

This is my R script that I would implement in a QGIS Rscript:

dif2 <- array(NA, c(dim(val.data)[1], 2))
# creates an array with 2 columns and n rows (length of Validation data)

for (i in (1:dim(val.data)[1])) dif2[i,1] <- val.picked[i,4] - val.data[i,4]
# calculates the differnce between grid value and measured value and saves it result into first column of array "dif2"

for (i in (1:dim(val.data)[1])) dif2[i,2] <- dif2[i,1]^2
# calculates the square of the difference and saves it into second column of array)

RMSE <- sqrt(mean(dif2[,2],na.rm=T))


texts: How to export subset of data in QGIS to DXF

texts: I have QGIS loaded with multiple layers. I want to save to .dxf but the map is so massive it results in a very large file. I only need a small portion of the map, so I was wondering how I can crop the map into a smaller file.


texts: draw a line with a single point and length (leaflet)

texts:
How can I practically  draw a line in leaflet with following info:

1)its length,

2)starting point,

3)angle.

i.e., there is NO end point information.


texts: ArcGIS imagery analysis difference raster errors

texts:
I have two DEM rasters from the USGS NED dataset.  One is from 2013 and one is from 2017, the extents should, and appear to, be 100% identical.  I ran the difference function on the ArcGIS Imagery Analysis window on these two rasters and got a resulting difference raster that appears to be accurate (via spot checking the input raster pixel values).  However when I zoom out past a certain point the difference raster symbology becomes incorrect & in contradiction of the identified pixel va
lues. (which remain accurate and in contradiction of the symbology)
The left image is at 1:250000 scale, the right 1:30000.  The error remains as I zoom out past 1:300000.  Classified in the attached as: Black = no difference (within a small tolerance), red = values decreased, green = increased.

Any ideas why might it be doing this and how can I get it to stop?  I'd like to get a single view of the entire difference raster but this problem is preventing that.  One input raster was in .img format, the other .flt, and both were single band & in the same unprojected GCS.


texts:
I have a set of ~100,000 polygons (.shp format). Using python and ogr I would like to dissolve them to one feature class to speed up other downstream operations. The command I am using is:

ogr2ogr -f "ESRI Shapefile" dissolved.shp input.shp -dialect sqlite -sql "select ST_Collect(Geometry),common_attribute from input GROUP BY common_attribute"

The command takes some time to run (now over an hour, likely significantly longer). Doing the dissolve in ArcGIS and grouping by the common field results in the desired output in just a few seconds. My questions are (1) Why is ArcGIS so much faster? (2) How can I speed up this operation


texts: ring buffer code not working with pyqgis

texts:
QGIS version 2.18

I am trying to code a function that creates some multi ring buffer. The algorithm is as below:

Take a feature
Buffer it by a set of distances
Do a difference of the buffer geometry minus the feature's geometry to keep the "ring" only
Replace the initial feature by the "ring" and start again

the code is below throw works fine during the first buffer but then fall into error

def addRing(feature):
    distances = [5,10,15]
    geom = feature.geometry()
    buffer_features = []
    for distance in distances:
        buffer = geom.buffer(distance,10)
        new_feature = QgsFeature()
        new_feature.setGeometry(buffer)

        new_feature_geom = new_feature.geometry()
        new_feature_clipped = new_feature_geom.difference(geom)

        new_buffer = QgsFeature()
        new_buffer.setGeometry(new_feature_clipped)
        #Add some fields and attribute data to the ring
        buffer_features.append(new_buffer)

        geom = new_feature.geometry()
    return buffer_features

The first ring is created but then I get the error:

QgsFeature.setGeometry(QgsGeometry): argument 1 has unexpected type 'NoneType'

Why? What is the correct way?


texts:
I have QGIS Map Server, when I load WMS layer it takes 20 seconds to prepare it and only 30ms to download. How can I speed it up?

Can I do this without changing QGIS projects? How to do that?


texts: Recalculate extent for versioned featureclass

texts:
I try to recalculate extent for FC (versioned). I deleted some objects with null geometry, or with wrong location and reconcile every versions. But I still cannot recalculete extent to new proper values. Values are still the same - wrong. Do anybody know where could be a problem?

When I export FC (sde.default) to fgbd, extent is correct.


texts: Dumping Points from Polygon and do st_makeline with these?

texts:
I want to manipulate Points from a (Rectangle) Polygon. First, I dump the points using st_dumppoints, then aggregate the points again using st_makeline(case when ... then ... else). Then I use st_makepolygon to create a polygon again.

In some cases that gives me an error "ERROR:  lwpoly_from_lwlines: shell must be closed". That tells me that the first and last point of my created line is not equal.

First I checked my input polygons. They are Good!
Second I checked my condition inside st_makeline by just leaving it out => problem still exists.

Then I tried to break it down, and the problem exists with this code:

select fid from (
  select fid, st_makeline(geom) line from (
    select fid, (st_dumppoints(the_geom)).geom from index
  ) a group by fid
) b
where not st_equals(st_startpoint(line),st_endpoint(line));

I receive a list of fid's. Now the interesting part:
The problem does not occur, if I add one or multiple specific fids FROM THAT LIST to the where clause anywhere in any stage.

select fid from (
  select fid, st_makeline(geom) line from (
    select fid, (st_dumppoints(the_geom)).geom from index
  ) a group by fid
) b
where not st_equals(st_startpoint(line),st_endpoint(line))
and fid = 44511
-- and fid in (44511,44524,44529)
;

(also works with multiple fids (and fid in (1,2,3))

I'm lost .... What's happening here ?

UPDATE

I made some further research:

select fid, point_numbers from (
  select fid, string_agg(((points).path[2])::varchar,',') point_numbers
  from (
     select fid, (st_dumppoints(the_geom)) points from index
  ) a group by fid
) b
limit 3;

 fid | point_numbers
-----+---------------
   1 | 5,4,3,2,1
   2 | 1,2,3,4,5
   3 | 2,4,5,3,1
(3 rows)

vs.

select fid, point_numbers from (
  select fid, string_agg(((points).path[2])::varchar,',') point_numbers
  from (
    select fid, (st_dumppoints(the_geom)) points from index
  ) a group by fid
) b
where fid=3;

 fid | point_numbers
-----+---------------
   3 | 1,2,3,4,5
(1 row)


texts: QGIS - How to add a geometry to an existing feature that has NULL geometry?

texts:
I have a PostGIS table with some polygons having NULL geometry. The rows are correctly displayed in the attribute table in QGIS. As expected, there is no geometry draw in QGIS.

My question is how can I add a geometry to a row that have a NULL geometry in QGIS. I know I can do some SQL code for that, but I want a end user be able to do this in QGIS.

I have tried different things in QGIS. The logical one for me was to use the tool "Add part" in the advanced editing toolbar. Unfortunately this hasn't work.

Thanks!


texts: Can a 9.3 MSD be created with ArcGIS 10?

texts:
I know that we can save to a 9.3 MXD document using ArcGIS 10.

Is it possible to export to a 9.3 MSD (optimized map document) using ArcGIS 10?


texts: SQL for proportional overlap in PostGIS returns successful; no affected rows

texts:
I have two tables one with block group+data and another with geometries of communities. I want to calculate the intersection area so I can later calculate the proportion of each block group in a given community

I wrote this query, which runs successfully but says no rows are affected--they should be. Basically, some block groups fall entirely into a community, and others are bisected by the community boundaries.
What is causing this?

SELECT
  ST_Intersection(bg_pop.geom, com.geom) as new_geom,
  ST_Area(ST_Intersection(bg_pop.geom, com.geom)) as new_area
FROM
  laco_pop_by_bg as bg_pop, laco_community as com
WHERE
 ST_Intersects(bg_pop.geom, com.geom)


texts: Save all temporary and permanent files in just one folder while running a model using ModelBuilder in ArcMap

texts: Is it possible to save all temporary and permanent files thats derived from a model created in ModelBuilder using ArcMap in just one folder thats predefined but with relative path. I am asking this question as I wish to run my model on different laptops.


texts: Seeking Android app to be GPS Logger and POI recorder, with offline map?

texts:
I am looking for a good app that can do one or many of my below listed requirements. They are listed with the most fundamental functions first. Preferably the app can do all of it, but it should at least pass the first requirements.

Have track logger and capability of making own POI
Use offline maps to display position/track/POI using OSM or something else
For the twist: I want to use the app for outdoor surveying of habitat/wildlife. Where a POI  is recorded I want to be able to select habitat/species from a list of predefined values, so I dont need to type in the value myself. Later I want to export that information into a shapefile and build up a database with observations.

I have not been looking into it too much, but I think ArcMap collector could do this? But I am looking for a free app to easy distribute it to volunteers etc.

Any ideas for this?


texts:
I still working on my big project, big at least for me, but I am currently stuck on this:

I have a lots of .shp, that I want to move to a gdb. While creating a feature class, I want
to add date (YMD) before the name: test.shp -> _120706_test

Possibly the creation date of the SHP but also the importing date will be ok.

I created a list of feature and tried: _fc  = '' + fc but it is not working.

# Import system modules
import sys, arcpy, datetime, os, traceback, time
from arcpy import env

# Load required toolboxes...
arcpy.AddToolbox("C:\\Program Files (x86)\\ArcGIS\\Desktop10.0\\ArcToolbox\\Toolboxes\\Data Management Tools.tbx")

# Get the active map document
import arcpy.mapping
mxd = arcpy.mapping.MapDocument ("CURRENT")

# List broken links
# arcpy.mapping.ListBrokenDataSources(mxd)

# Set environment settings
ws = "C:\\PARK"
arcpy.env.workspace = ws
print("env.workspace completed successfully")
installdir = arcpy.GetInstallInfo("desktop")

#check GDB exist
gdb_nam = "test.gdb"
gdb_full_path = os.path.join(ws,gdb_nam)
if os.path.exists(gdb_full_path):
    arcpy.Delete_management(gdb_full_path)
print("GDB checked")

# Execute CreateFileGDB
arcpy.CreateFileGDB_management(ws, gdb_nam)
print("CreateFileGDB completed successfully")
outWorkspace = gdb_full_path

# Create a list of SHP in mxd
list = []

for df in arcpy.mapping.ListDataFrames (mxd):
    for fc in arcpy.mapping.ListLayers (mxd, "", df):
        if (fc.supports("DATASOURCE")) and (fc.dataSource.endswith(".shp")):
                    list.append(fc)

# Check for borken datasource
for fc in list:
    if arcpy.mapping.ListBrokenDataSources(fc):
        list.remove(fc)

# Check for projection

# Move fc to gdb
for fc in list:
    rename (fc,'_'+fc.name)
    arcpy.FeatureClassToGeodatabase_conversion(fc, gdb_full_path)


texts: Geo-referencing historical topographical in ArcMap using the original grid

texts:
I am trying to geo-reference a series of maps of the German Military service in ArcMap or ArcGIS Pro using the coordinate grid (in red) provided by the German Military during the WWII. The attached map is an example of the maps (125 in total) which I would like to digitize. While I have some experience in geo-referencing maps, it is the first time I am using an original grid of the map to do so.
As far as I understood so far,  in order to enter the coordinates displayed on the map. I should first understand the original georeferencing system. However, unfortunately so far I have not been able to find its history.
Are there perhaps other correct methods to digitize these maps?
How would you go about digitizing these maps?


texts:
If a (printed) map is created with an small map in the corner showing the extent of the main map frame in relation to the state/province etc. with a box. What is the proper cartographic term to label this box? I am specifically referring to the red box in attached picture.

Map Extent?
Inset map?
Anything else?


texts:
I'm using QField on a Samsung Active 3 Tablet which is connected with a Trimble R1. The GNSS Status App provides the mock location.
Previously I had some problems with the R1 positioning me not correctly in the QField. After several attempts, the position matches the georeferenced layer in the field. The accuracy is sometimes less than one metre, sometimes more.But now the position marker jumps back and forth. This is especially a problem when I want to record a polygonal area using the tracking mode. A rectangular area looks very shapeless. More like a star. What could be the cause of the problem? Our previous GPS device (+years) works much more accurately than the Trimble R1.


texts: Using ArcPy to convert .txt to shapefile with coordinate system?

texts:
I tried to define my coordinate system on creating the shapefile but when I zoom to layer I don't see my features and ArcGIS crashes. I know it's not in the coordinate system I defined for it but it shows the coordinate under properties but doesn't reflect when I zoom to layer. Here is my python code:

import arcpy

newfcName ="newfc.shp"

outpath = r"C:/FLOOD/IKEJA AND KOSOFE"

# Declaration
arcpy.env.overwriteOutput=True

arcpy.env.workspace= outpath

# Create new Shapefile and add FIELDS
newfc = arcpy.CreateFeatureclass_management(outpath, newfcName, "Point")
# get the coordinate system by describing a feature class
dsc = arcpy.Describe("newfc.shp" )

coord_sys = dsc.spatialReference

try:
   # run the tool
   arcpy.DefineProjection_management(newfcName , coord_sys)

   # print messages when the tool runs successfully
   print(arcpy.GetMessages(0))

except arcpy.ExecuteError:
   print(arcpy.GetMessages(2))

except Exception as ex:
   print(ex.args[0])

arcpy.AddField_management(newfc, "X", "STRING", field_length = 50)
arcpy.AddField_management(newfc, "Y", "STRING", field_length = 50)
arcpy.AddField_management(newfc, "Z", "STRING", field_length = 50)
arcpy.AddField_management(newfc, "I", "FLOAT", field_length = 50)

# Reference Cursors
cursor=arcpy.da.InsertCursor(newfc, ["X", "Y", "Z", "I"])

# Read File
a = open("C:/FLOOD/IKEJA AND KOSOFE/DEM/532722.txt","r")

inputF = a.readlines()

for line in inputF:
    xCoordinate, yCoordinate, zValue, iValue = line.split(" ")

    newRow = (str(xCoordinate), str(yCoordinate), str(zValue), float(iValue))

    cursor.insertRow(newRow)

a.close()


texts: Making ArcGIS Online gallery completely public?

texts:
I have created a map gallery in arcgis.com.  All the content is public, but when I send my friend the link, he is unable to access it and it looks private.

Can arcgis.com galleries be totally public?


texts:
Is there a way to make the controls on QGIS android larger? e.g. When typing text into a field in the table view it is currently very small.

I also have a issue/bug where the panels (layers, gps controls) go very small (smaller than usual) and toggling them on and off, restarting QGIS android doesn't make them come back to their usual size.


texts: Working around ERROR: Unknown geometry type: 11 - MultiCurve

texts:
Basically I have a polygon layer and I need to create a view which extracts about 100 different columns from about 10 tables with polygon, line and point geometry, that intersect with the said polygon.
The problem is that after creating the view, when I try to run it, I keep getting this unknown geometry type and it doesn't tell me where the error is located
ERROR: Unknown geometry type: 11 - MultiCurve

I've tried using st_isvalid(r.geom) = true on every single table as a where condition because one of the layers definitely had some invalid geometries, but I keep running into this error.


texts: Running Focal Stats on specific values in Python?

texts:
I'm a beginning programmer.

I'm trying to recreate a raster calculator operation using python scripts but am having a hard time getting it to run properly.

I want to : check a raster for null or 0 values and use focal statistics to patch holes only on those values. In ArcGis 10.3 my raster calculation looks like this and works fine:

Con( IsNull(Rasterin.tif),FocalStatistics(Rasterin.tif,NbrRectangle(5,5"Cell"), "MEAN")Rasterin.tif)

In Python I have tried to approaches to try to recreate this.

I've tried a while statement to find these values but it does the entire raster instead of patching only the values I want ( in this case 0 so the cursors can find it in the raster table:

cursor = arcpy.da.SearchCursor("BadRaster.tif",['Value'])
neighborhood = NbrRectangle(5, 5, "CELL")

while True:
    try:
        for row in cursor:
            for value in row:
                    if value == 0:
                        print 'Patching......'
                        outFocalStatistics = FocalStatistics("BadRaster.tif",     neighborhood, "MINIMUM","")
                        print 'Saving stats....'
                        outFocalStatistics.save("PatchedRaster.tif")
                        print 'Checking...'
                        break
                    break
    except:
        break

print "Finished Patching"

del cursor

And I've tried using it with map algebra :

neighborhood = NbrRectangle(5, 5, "CELL")
con = Con(("BadRaster.tif" < 1,0,0),FocalStatistics("BadRaster.tif", neighborhood, "MEAN",""))

arcpy.gp.RasterCalculator_sa(con,"PatchedRaster.tif")


texts: Launching hyperlinks using non default Windows Viewer in ESRI Web Applications

texts:
We have developed a custom Python based image viewer, which we would like to deploy in Portal for ArcGIS for viewing hyperlinked images (through attribute tables). We can't use the native Windows Photo Viewer as it does not work with this specific image format.

At the moment, the default for the popup in web maps uses Windows Photo Viewer.

Is there a way to change this either in the hyperlink field directly, so that we can click on a feature and pass a field value (in this case file path) to a python script, or in the JS code of the web application?


texts: Advanced Python Field Calculator - QGIS Processing Toolbox

texts:
I'm trying a very simple task. I want to write the layer name in a new attribute column. I managed to do this using Field Calculator. But I need to do the same for a lot of files in batch mode, only available in Advanced Python Field Calculator. In Advanced Python... algorithm I inserted in the Formula field the same expression I used in Field Calculator: value = @layer_name. Unfortunately, python (from Advanced Python... algorithm does not recognize the variable @layer_name.
Any ideas?


texts: latitude/longitude to linestring or points

texts:
I have a gps file that I have converted to csv, I would like to convert a longitude/latitude to linestring if the next row have a diferent longitude/latitude (if the car mooved) and if not convert it to points.

I know how to convert a longitude/latitude but how can I do this test?
If possible with a script for qgis

Here is my file .xlsx

What I would like to do automatically, is add to qgis two layer (points and lines with the same column as the .xlsx) or create two csv (again, points and the other file, lines). Like this two pictures:
 and

To resume...  I'm trying to get the result of those images in csv using the .xlsx via pyqgis to have one layer points (car stoped) and one layer polylines (car mooved).


texts: Combining rasters using weighted average

texts:
I am using ArcGIS 10.3 with spatial analyst. I have a series of several rasters that I am trying to combine into a single raster layer. The rasters are all different sizes (different extents) and were produced using different sample sizes. I need to combine all these rasters using a weighted average based on sample size. Some of the rasters overlap, and others don't. At least one of the rasters is large enough to encompass all of the others. All have the same cell size and floating point values. I have tried using the Raster Calculator (i.e. (([raster1]*weight1) + ([raster2]*weight2))/sum of weights) as well as Weighted Sum. In either case, the output is reduced to the extent of the smallest raster, even when setting the processing extent to the same as the largest layer.

Are these approaches (raster calculator, weighted sum) appropriate to do a weighted average and combine these rasters?
What do I need to do to get the output to encompass the entire study area, and not just the extent of the smallest layer?


texts: Managing large numbers of raster DEMs for QGIS

texts:
I have a large number of (say 9000) 2km x 2km raster DEMs in ASC file format that I am trying to manage, in order to use in QGIS.
I've been looking for way of storing them, ideally on the filesystem, but in a way that they can be searched/queried geographically. Also, so that they can be added to over time. Then loading the DEM data into QGIS as necessary to do ad hoc processing, usually around 10-20 at a time.
Is there a way of doing this using say GeoPackage format, or any other method readable by QGIS?
The files could be converted to GeoTIFF if that makes any difference.
Also, if there's no way of storing them on the filesystem, but there is a way of storing the data in the file, that would be helpful. I have stored one file in a GeoPackage, but trying to then add additional files ends up with the original being overwritten.
I have also had limited success in storing data in a Rasterlite (SpatiaLite) DB. While QGIS will load the data, it doesn't seem to have an option to select what area of the data is loaded, and this would seem to be impractical for a large data source when you only want to operate on a small part of it.


texts: Calculating proportional data for polygon by taking attributes from other polygon

texts:
I have a features class which has polygons in it. I also have a Block group level data for demographic variables like population. Now when I overlay the polygon on the block group level data to find out the population of that polygon.Now it would happen that the polygon boundary may not overlap exactly with the Block group boundary.It would intersect at different places with the block group data.

In such case how can you calculate the proportional population value to be considered for that polygon?


texts: How to render data from ona.io in leaflet

texts:
I want to consume data from ona.io into a leaflet map on another server. I guess using the api with the format: jsonp, might be a way. I'm not sure how to use e.g. leaflet-ajax to parse the data into something useful. Since I'm not a programmer I having hard times to figure it out.

I want however data from following address:

https://ona.io/api/v1/data?owner=Kajakplatser
ona.io/api/v1/data/119605?format=jsonp

into this map as a layer:

https://kajakplatser.se/karta

Is there someone out there having done this or done it in some similar/different way that want to share their ideas?


texts: How to download tile from Amazon’s Sentinel-2 service

texts:
How do I access Sentinel-2 imagery via Amazon?

I'm new to GIS and have been relying on USGS earth explorer and EO Browser but would now like to access satellite imagery with higher resolution. I read that I could do so using Amazon’s Sentinel-2 service.

I found this guide https://registry.opendata.aws/sentinel-2/ I have an AWS account - is there a guide for users who have never used Amazon?

The guide for Sentinel-2 L1C says,

the files for individual scene are available in the following location: s3://sentinel-s2-l1c/tiles/10/S/DG/2015/12/7/0/

Where exactly is that?

To provide a specific example, I'd like to download tiles of central Hong Kong at <10m resolution, anything newer than 2012

xmin 114.1399
ymin 22.2708
xmax 114.1835
ymax 22.2930


texts: Validating file geodatabase information against spreadsheet?

texts:
I have a spreadsheet from our master records office that contains thousands of entries for different types of facilities (building, signs, canopy, fences).

I need to validate that we have all of these features in our file geodatabase, but they are grouped by feature datasets and feature classes based on what they are (building feature class, fence feature class, sign feature class).

There would be at least one, possibly two, unique fields that can be matched for every single facility in both areas.

I would like to know what the most efficient method would be for validating the data we have in our GIS with our master spreadsheet.

The options that seem available to me are to either start with the master spreadsheet at building #001, find which feature class it belongs to, open the attribute table and find the entry, or tackle it by feature class (all buildings first, then signs, etc). I have any tools available within ArcGIS available and some python knowledge (but not enough!).


texts: Map IDs to add Mapbox basemaps to Leaflet or OpenLayers

texts:
I would like to add Mapbox basemaps to Leaflet or OpenLayers, but I am missing the map IDs.

Before Mapbox Editor was deactivated, one could easily create and save a map, copy that map's ID and your personal API token and then include the map in Leaflet or OpenLayers by using the following URL, replacing my.map and your < access token here >:

http://a.tiles.mapbox.com/v4/my.map/{z}/{x}/{y}.png?access_token=<your access token here>

This still works. But only if you have existing maps from before Mapbox Editor was deactivated on January 31, 2017.

How do new users, who cannot save maps and therefore do not have a personal map ID, go about formatting the URL? New users get an API token but they cannot save maps anymore and thereby get a map ID.

So, how can the following Mapbox basemaps be accessed now:

Classic
Light
Dark
Satellite
Satellite Streets
Wheatpaste
Streets Classic
Comic
Outdoors
Run, Bike, Hike
Pencil
Pirates
Emerald
High Contrast

I found a post on Stack Overflow, which shows that the URL can be formatted this way:

 https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}

So, you do not necessarily need a personal map ID as every public Mapbox basemap seems to have an ID.

I have tested this and it works, you just need to replace {id} with a map's name, such as streets-v9 but I am unable to find the IDs of the above maps.


texts: How to display custom context menu during create feature task?

texts:
I have a created a custom context menu using ICommandBar and am displaying it on create feature mouse-down right click. I am constructing a point collection on each mouse down and then creating a polyline. For each point I am refreshing using EditSketch.RefreshSketch().

On right click, I created a custom context menu to finish the sketch.  Sometimes, I get the  default "Sketch Tool/Select Elements" context menu, which I do not want to get on right click.

The code that I'm using to display the context menu:

public override void OnMouseDown(int Button, int Shift, int X, int Y)
{
  if (Button == 2)
  {
    _objContextMenu.Popup(0, 0);
  }
}


texts:
I'm developing a map application (Several shapefiles with OpenstreetMap or BingMap on background and some dynamically generated features on the map). I'vs created some part of it with Telerik RadMap for silverlight. but I'm far more comfortable with Javascript and HTML (I'm mainly a web developer).

So, is there any advises on how to choose the right technologies for a web based map application? is there Any shortcomings for Javascript components that support GeoJSON (leafletjs, KendoMap, ...)? Any comparisons between GeoJSON and HTML/JavaScript vs Shapefile and Silverlight?


texts: Geometry Errors with Imported Shapefile, Unable to Fix

texts:
Software Used

QGIS 2.18.10
MS Excel 2016

GitHub Repository With Files (link)
Update 3
Blank file when reprojecting
1. Open the layer

2. Double-click Reproject Layer

3. Select Reprojection Parameters

4. Reprojected layer is blank

5. Error when attempting to import to Excel 2016 Power Map

6. Directory of shapefile

Update 2
Unable to find Processing Tools
Here is something close, but none of the three sub-categories ask for output shapefile.

Update 1
Here are steps ... it appears correct in QGIS but there are still Invalid Geometry Errors in Excel Power Map
NOTE: Just for grins, in Step 5 I saved using NY projection instead of WGS 84 projection and I get same error.
1. Add Delimited Text Layer

2. Select options > OK

3. Select NY Projection

4. Right-click > Save As

5. Select WGS 84 Projection (what Excel accepts)

6. Output

Original Question
I am trying to create shapefile with DSNY_Graffiti_Information.csv
Created Layer from delimited text file
Then I select New York Projection (EPSG:2263)
Finally I save as shapefile in NY_Graffiti_Shapefile.zip
When I attempt to import shapefile to MS Excel 2016 Power Maps I get Invalid regions error

Attempted to use Topology Checker Plugin, but no errors are detected.
How do I fix this?


texts: NDVI in landsat image not in range(-1,1)

texts:
Using ENVI 5.3. I have done a radiometric calibration(radiance) and flaash atmospheric correction then a seamless mosaic and subsetted data from ROI. I then calculated the NDVI. My results in May 2017 were correct but I have a problem in May 2018.

Some results are out of range (-1,1). I used (float(b5)-float(b4))/(float(b5)+float(b4)).


texts: Viewsheds and Observer Points in ArcGIS Spatial analyst

texts:
I am trying to understand the viewshed and observer points tool in spatial analyst.

I want to show which areas of land can see a wind turbine, or put another way, from where can the wind turbine be seen!

In my simplified model I have just the DEM and a point shp which contains the following fields: OFFSETA and OFFSETB.

I have read the ESRI Documention and OFFSETA is the height of the observer over the DEM and OFFSETB is a height of an object over the DEM.

If I calculate the viewshed as follows: OFFSETA= 1.65 (Eye-level) and OFFSETB = 50 (the top of the windturbine) what am I actually calculating? Could it be all cells which the observer (at a height of 1.65m above the DEM) would observe if a 50m tall wind turbine would stand in every cell?   in other words... these are the cells in which a 50m tall wind turbine could be seen from the observation point?

OR

Because I want to know from where the turbine is visible, I thought I should put the observer´s eye-level on top of the wind turbine (50m). Now I can just calculate all cells that I can observe on the DEM + 1.65. If I can see then from the top of the turbine then I am assuming they can see me, right?

Now the practise: I created two viewsheds as above described.

Image 1: OFFSETA= 1.65 & OFFSETB=50

Image 2: OFFSETA50 & OFFSETB= 1.65

The two approaches gave two very different pictures
When the OFFSETA = 50m I get these straight lines.

I am trying to understand why?


texts: Layering up road and rail bridges from OpenStreetMap data in QGIS

texts:
I am using QGIS 3.

I am creating a topographic map using OSM data downloaded as shapefiles. Obviously of I put the railways layer under the roads layer, all railways show as passing under roads. Or if I put the rail layer on top, railways always show as passing over roads.

Is there a way to make roads, bridges and railways layer up correctly automatically: so that they go over or under as appropriate without my having to check and, where necessary force, each crossing to render correctly?


texts: Dissolve or unsplit lines on common attributes in PostGIS or GRASS?

texts:
I have a road centerline shapefile that has roads split at every intersection.  However, I would like to join LINESTRINGs that have a common set of attributes into a single LINESTRING. So long as the name, speed limit, etc, do not change, I want to merge them together. This is for eventual conflation into OpenStreetMap.

Esri's ArcGIS for Desktop software seems to allow this with the Dissolve command and the UNSPLIT_LINES option.

I also found a Dissolve command in QGIS but it seems to only work on polygons and single fields.

Assuming nothing exists for QGIS, does anyone know how to do it in PostGIS or GRASS?


texts: Converting raster band to .txt file using GDAL in QGIS

texts:
How do I convert a raster band on my map in QGIS to a .txt file?
I have tried several things.

I have tried using the gdal2xyz function in QGIS. However, this outputs the data in a .csv format which for some reason truncates the decimal values when I try and resave it as a .txt file. The decimal values are important for my project.

I have tried using the translate function in QGIS which converts the map into a .xyz file which I was hoping to resave in a .txt format. However, this does not allow me to choose a specific band to convert to a .xyz file. Rather, the function only converts the first band on the map.

I have tried doing this in python:
import processing
layers = QgsProject.instance().mapLayersByName('wc2.1_2.5m_bioc_BCC-CSM2-MR_ssp126_2021-2040')
layer = layers[0]
output = 'C:/Users/NAME/Desktop/QGISOuputs/2021BIO19NEWNEW.xyz'

 result = processing.run("gdal:translate",
     {'INPUT': layer,
     'Band': 19,
     'TARGET_CRS':None,
     'NODATA':None,
     'COPY_SUBDATASETS':False,
     'OPTIONS':'',
     'EXTRA':'',
     'DATA_TYPE':0,
     'OUTPUT': output})

 print('Your file was created: {}'.format(result['OUTPUT']))

When I tried doing this, the output was once again the first band of the map even though I specified in the parameters that I wanted the 19th band.


texts: If I were flying over a flat world at constant elevation, taking aerial photos, how would I patch them into a mosaic?

texts:
Restating the question: If I were flying over a 2 dimensional world, at a constant altitude, how would I patch those images together?

I'm using some tools right now that assume I'm doing a panorama ("AutoStitch", works for 2 images sort of) or am taking real aerial photos ("MapTiler") and thus somehow screw this up for me. That "somehow" is, I think, the coordinate reference system (CRS) being used by those programs as the model for patching those images together.

The algorithms that use image recognition to patch the photos together are being misinformed in these latter two programs. The first one, AutoStitch works wonderfully for 2-3 images compared with other programs I've used. I can't actually get MapTiler to work, but it appears to be for real aerial mosaic patching. I need one for a 2D world at constant zoom ("altitude").

Thanks

BOUNTY UPDATE:
StackExchange is only allowing me to keep this bounty offer up for 2 more days as of Monday night. I do not have a workable answer yet.

EDIT: To imagine what exactly it is I'm trying to do, consider this. You have a very high resolution image that takes up multiple monitors, you take screenshots of the the different areas of the photo and then want to stitch them together. Its purely rectilinear, no curvature. all 90 degrees down same zoom/distance.


texts: Prevent export to shapefile from postgis table in QGIS

texts:
I have created a centralized database using postgreSQL and created multiple users assigned with different roles i.e. SELECT, UPDATE, MODIFY and DELETE etc.
Example:

CREATE USER hasan WITH PASSWORD 'hasan'
GRANT SELECT ON pois TO hasan

For user 'hasan' i have granted SELECT privileges on pois table which means he can only select and view the data. It works perfectly both in postgres and QGIS environment. The user can only run select query on the table and view the data in QGIS environment and cannot update or delete any record as i expected.
But the problem is in the QGIS environment, when the user right click on the table, he can easily export the table into a shapefile and then edit or update whatever he wants to do.
So my question is what can i do to stop the user from exporting the postgis table to a shapefile in QGIS?


texts:
As it mentioned on the official doc
we can download a nightly build for QGIS-dev-2.99.

I did, but the version is actually outdated QGIS_2-99-0_2016-09-20_cd1d44b.dmg it's the 2.15 dev version instead of the 3.0.

How can I get and install the QGIS3 on MacOSX 10.11.6 El Capitan?


texts:
I'd like to use a MongoDB database from GeoServer. There seems to be a GeoTools plug-in available (http://repo.opengeo.org/org/geotools/gt-mongodb/), and I've dropped the latest version (8.2) into the webapps\geoserver\WEB-INF\lib folder and restarted, but it doesn't show up in the new data source list within Geoserver.

Any ideas?

I'm using GeoServer 2.2 on Windows 7 64-bit.


texts: Screenshot every layer from a geoJSON object, failing to zoom to extents of each layer correctly

texts:
What I've been trying to do is I have a ton of geoJSON files (a few thousand) and I need to load them, change the colors of the Polygons and background to white and black, then export them as an image. Like the one below...

Though I've had a lot of trouble, I now can load all the geoJSON layers (though some of the geoJSON layers have nothing in them...so it loads up as Unknown in QGIS). I add the geojson layer to a LAYERS list that I use later, add the symbols, set the extent to that layer, and repeat.

Then, to screenshot each image, I iterate through the LAYERS list, set my extent to each layer, and screenshot it.

However, the screenshots are not correctly viewing the layer.

My code is below.

I'm not very familiar with QGIS and PyQGIS

from PyQt4.QtGui import *
from PyQt4.QtCore import *
from qgis.core import *
import os
import sys
from time import sleep

NUMBER_OF_GEOJSON_FILES = 580
GEOJSON_DIR = "C:\\path\\to\\geojson"
IMAGE_DIR = "C:\\path\\to\\destination"
FILENAME = "filename_format_img"

#Set canvas color to black
iface.mapCanvas().setCanvasColor(QColor.fromRgb(0,0,0))

print GEOJSON_DIR
print IMAGE_DIR
print FILENAME

LAYERS = []

def loadGeoJSON():
    i = 570
    while i <= NUMBER_OF_GEOJSON_FILES:
        #Load geojson
        print(GEOJSON_DIR + FILENAME + str(i) + ".geojson")
        layer = iface.addVectorLayer(GEOJSON_DIR + FILENAME + str(i) + ".geojson", "layer", "ogr")
        LAYERS.append(layer)

        #Set symbol colors, if no symbols do nothing
        try:
            symbols = layer.rendererV2().symbols()
            symbol = symbols[0]
            symbol.setColor(QColor.fromRgb(255,255,255))
        except AttributeError:
            print "No symbols"

        #Zoom to layer
        iface.mapCanvas().setExtent(layer.extent())
        i = i + 1

def exportImages():
    i = 1
    for j in LAYERS:
        sleep(3)
        #Zoom to layer
        iface.mapCanvas().setExtent(j.extent())
        # Take screenshot
        print("Screen Shotting:  " + IMAGE_DIR + FILENAME + str(i) + ".png")
        iface.mapCanvas().saveAsImage(IMAGE_DIR + FILENAME + str(i) + ".png")
        i = i + 1

loadGeoJSON()
exportImages()


texts:
Quite new to using GIS and have a (probably very simple) question.

I want to see if there is a greater occurrence of a species around a certain feature.
i.e. is there a greater density of a species occuring within 50 metres of a river.
I have gotten as far as creating the buffer around the feature, how do I analyse the points that occur within the buffer?


texts: Editor Tracking: What is the mechanism behind this functionality?

texts:
I have Editor Tracking enabled on a table in an Oracle enterprise geodatabase (versioned):

Tracking an editor's changes to data says:

  ArcGIS automatically records new editor tracking values whenever a
  feature or record is inserted or modified in any way. This includes
  modifications to user-defined attribute columns, system columns not
  defined by the user, and the shape column that stores feature
  geometry.

What is the mechanism behind this functionality?


texts: Automation KeyError using Search Cursor / Data Dictionary

texts:
I recently received help in modifying a previous code for structures as part of project.  The first time I ran it the code worked fine, but when I went to double check it. I keep receiving:

  Runtime error

  Traceback (most recent call last):

  File "string", line 36, in "module"

  KeyError: 2

Line 36 in the code reads:

if valueDictOfficialPipes[2] != ("null" or " "):

Could anyone please help me in understanding how and why this is occuring.  The table I am using one that has been joined so I am attempt to have it read through 2 columns for both the Collection Company and the Date while ignoring  values and whitespace(" ").  I am not sure if the cursor is registering the the second column.

import arcpy as ARCPY
from arcpy import env as ENV
#**TEST ENV**
workspaceTEST = r"C:\Users\Jim\Desktop\TESTSTRM_SWR.gdb"
ENV.workspace = workspaceTEST
#Variables
#=========
#**TEST**
pipes15096 = workspaceTEST + "\PIPES_15096"
pipesOfficial = workspaceTEST + "\OFFICIAL_PIPES2015"
fieldsPipesOfficial = ["ID_NUMBER","DATE_","COMPANY","COLLECTION","COLLECTED_"]
#                         ID        DATE_L1   BY_L1     DATE_L2       BY_L2
# The table is a join between two tables, but I do not have access originals
#L1 = Table 1 ; L2 = Table 2
#====================================================
#CURSOR CREATION AND UTILIZATION
#===============================
# Used list comprehension to build a dictionary from a data access SearchCursor
valueDictOfficialPipes = {readRow4[0]:(readRow4[1:]) for readRow4 in ARCPY.da.SearchCursor(pipesOfficial, fieldsPipesOfficial)}
fieldsPipes15096 = ["ID"  , "COLLECTION_DATE" , "COLLECTED_BY"]
with ARCPY.da.UpdateCursor(pipes15096, fieldsPipes15096) as updateRows_Pipes15096:
    for updateRow2 in updateRows_Pipes15096:
        # store the Join value of the row being updated in a keyValue1 variable
        keyValue2 = updateRow2[0]
        # verify that the keyValue1 is in the Dictionary
        print "keyValue2:             ", keyValue2
        print "updateRow2:            ", updateRow2
        if keyValue2 in valueDictOfficialPipes:
            print "keyValue2 -V2:         ", keyValue2
        # transfer the values stored under the keyValue from the dictionary to the updated fields.

        # IF BY_L1:"COMPANY" COLUMNS HOLDs VALUE UPDATE CELL
            if valueDictOfficialPipes[2] != ("<null>" or " "):
                for nullNoMore in range (1,len(fieldsPipes15096)):
                    updateRow2[nullNoMore] = valueDictOfficialPipes[keyValue2][nullNoMore-1]
                    print "updateRow2[nullNoMore]:  ",updateRow2[nullNoMore]
            # IF BY_L2:"COLLECT_" COLUMNS HOLD VALUE UPDATE CELL
            elif valueDictOfficialPipes[4] != ("<null>" or " "):
                for nullNoMore in range (1,len(fieldsPipes15096)):
                    updateRow2[nullNoMore] = valueDictOfficialPipes[keyValue2][nullNoMore-1]
                    print "updateRow2[nullNoMore]:  ",updateRow2[nullNoMore]

            # IF DATE 1:"COLLECTION" COLUMNS HOLDs VALUE UPDATE CELL
            if valueDictOfficialPipes[1] != ("<null>" or " "):
                for nullNoMore in range (1,len(fieldsPipes15096)):
                    updateRow2[nullNoMore] = valueDictOfficialPipes[keyValue2][nullNoMore-1]
                    print "updateRow2[nullNoMore]:  ",updateRow2[nullNoMore]
            # IF DATE 2:"COLLECTION" COLUMNS HOLD VALUE UPDATE CELL
            elif valueDictOfficialPipes[3] != ("<null>" or " "):
                for nullNoMore in range (1,len(fieldsPipes15096)):
                    updateRow2[nullNoMore] = valueDictOfficialPipes[keyValue2][nullNoMore-1]
                    print "updateRow2[nullNoMore]:  ",updateRow2[nullNoMore]
            #UPDATE VALUES IN THE TABLE
            updateRows_Pipes15096.updateRow(updateRow2)
            print "updateRow2:  ",updateRow2
del valueDictOfficialPipes


texts: ArcPy Field Calculation with special characters

texts:
I'm trying to calculate a string field, using "µSv/h".  Running this in the manual field calculator works just fine, but I've tried this in the Python window in ArcMap as well as the IDLE, but both fail.  For the line below it says invalid syntax.

arcpy.CalculateField_management(tblTempAssayImportName,"Dose_units",""""µSv/h"""","PYTHON_9.3")

When I try to remove the additional three quotes, it comes up with a 000539 error.

I've tried using r to escape, The line above comes straight from the snippet after running the field calculator manually.  Not sure why this isn't working, but I'm assuming it's the special characters.


texts:
I'm searching for an approach as someone who just started to work with geodata recently.

It's about the following situation: I received several XML files. I need to perform a geometric difference task between 2 objects, and export it afterwards to XML or GML again.

Using QGIS doesn't seem to work here as for no proper export, also for having no automation when the same tasks need to be repeated for new source data. I read about the GDAL library and PostGIS database, I can just make a guess that this is what I'm looking for, I cannot really say it for sure as I'm not able to overlook it all.

Can someone tell me if this is what I'm looking for and give general steps on how to proceed?


texts:
I'm running ArcMap 10.3 and having a bit of trouble with a series of dot density maps showing population. There seems to be a glitch with some of the map files, as whenever I open them, the dot density value changes automatically and to some obscure, non-round value. For instance, my map of population should ideally show a ratio of 1 dot = 1,000 persons (as I originally set it), but sometimes when I close and then re-open the map, the value has shifted to 1 dot = 946.5467 persons or some random floating point value like that. It doesn't do this for all the maps and not even every time I open the same map...just some of the time for some of the maps. If there were a pattern to it, I'm sure I would have figured it out, but it seems totally random.

Has anyone else experienced this problem and/or know of a work-around?


texts: Can't select points with a rectangle (ArcMap)

texts:
I am using ArcGIS 10.2, ArcMap and I have a shapefile point layer in which I can't select any points.  (I'm having the same problem this person describes but none of the suggested solutions work:
Why is select by drawing a rectangle not working in ArcGIS?)

To simplify things, I have removed all other layers from the map.  I have highlighted the layer in the table of contents.  I have also done: right-click > Selection > 'Make this the only selectable layer in the table'.  I have tried lasso, rectangle, polygon, with no luck.  When I add a polygon layer to the map, I'm able to select polygons with these tools. I also added a different point layer to the map and was able to select those points.  But there's something about this point layer. It's in GCS_WGS_1984, not that that should have anything to do with it (also the polygon layer that I can select is in in GCS_WGS_1984 too).

Any additional suggestions?


texts: Marking start point for multiple lines in Google Earth

texts:
I have a collection of lines in Google Earth from a KMZ file.  I'd like to get the direction of each line so I can verify some data.
How would I style this in Google Earth?


texts: Attempt to install QGIS 2.8 on Ubuntu 15.04 installs old version instead

texts:
I previously had installed QGIS 2.8 with the GRASS plugin on Ubuntu 14.04.  Through a chain of events I ended up having to do a clean install of Ubuntu 15.04, and am attempting to re-install QGIS 2.8.

I have followed the instructions on the QGIS install page:  my /etc/apt/sources.list is updated with the following lines:

deb (insert http header)qgis.org/ubuntugis vivid main
deb-src (insert http header)qgis.org/ubuntugis vivid main
deb (insert http header)ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu vivid main

My software ppa (displayed in the 'Other Software' tab of my "software and Updates" settings box) is set to "(insert http header)"
"ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu"

The signing key in my settings 'Authentication' tab reads
"DD45F6C3 2014-08-19
QGIS Archive Automatic Signing Key (2014) "

When I do an apt-get update followed by an apt-get install, however, it only downloads the old qgis 2.4 files.  There's nothing I can find in my sources.list that calls for 2.4.  How can I bypass the old software and make sure it downloads the new?


texts: What is proper succession of coordinates while specifying TopLeftCorner in TileMatrix in WMTS?

texts:
While exploring various WMTS services, I've observed that sometimes x, y pair displayed in TopLeftCorner tag of TileMatrix tags defined in TileMatrixSet have succession changed to y, x.

There are at least two samples of AFAIK wrong succession. See for example:

http://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/TOPO?REQUEST=GetCapabilities&SERVICE=WMTS

(for EPSG:2180 TileMatrixSet and EPSG:4326 TileMatrixSet), and

http://ext-webbgis.lansstyrelsen.se/sverigeslanskarta/proxy/proxy.ashx?http://maps.lantmateriet.se/topowebb/v1/wmts?request=GetCapabilities&version=1.0.0&service=wmts

(for 3006 TileMatrixSet and WGS84 TileMatrixSet).

In the latter example, succession used in definition of TopLeftCorner:

<TopLeftCorner>8500000.000000 -1200000.000000</TopLeftCorner>

is in contradiction with definition of BoundingBox a few lines above:

<ows:BoundingBox crs="urn:ogc:def:crs:EPSG:6.3:3006">
    <LowerCorner>-1200000.000000 4305696.000000</LowerCorner>
    <UpperCorner>2994304.000000 8500000.000000</UpperCorner>
</ows:BoundingBox>

despite the fact that LowerCorner, UpperCorner and TopLeftCorner should use the same ows:PositionType definition from schemas-opengis-net-ows-1.1.0-owsCommon.xsd:

  Position instances hold the coordinates of a position in a coordinate
  reference system (CRS) referenced by the related "crs" attribute or
  elsewhere.

I wonder how to copy with such discrepancies when processing WMTS GetCapabilities response automatically. Is this problem addressed in some way in existing software packages?


texts: Tornado Data Points: Linking 2 Points in QGIS on the Same Row

texts: So I've got these tornado .csv files that have two latitude & longitude entries with the left-most in the table being the beginning point and the right-most being the ending point of the tornado, as is described here. I'm wondering, how can I link these two points in QGIS, so I get a line?


texts:
I was wondering if there is a way I can code the TOC control so that I can select multiple layers and GROUP them together. So if i uncheck the group, all layers will be unchecked and be invisible.

Thanks and Regards,
Kevin


texts: Transformation Parameters from ETRS89 (2004) to WGS84

texts:
I have XYZ coordinates of a point measured in year 2004 in ETRS89 coordinate system and I need to transform it to geodetic coordinates in WGS84.
Since ETRS89 changes yearly, so do the transformation parameters.
-As far as I understood there is about 2.5 cm change per year.

I am wondering where could those transformation parameters for the year 2004 be found in order to perform the needed transformation.


texts: Create a start and endpoint on a highlighted feature

texts:
I have a highlighted line feature as shown:
function highlightFeature(e) {
    var layer = e.target;

        layer

        layer.setStyle({
        weight: 10,
        opacity: .4,
        color: '#FF0099',
        dashArray: '',
        fillOpacity: 0.7

    });

    if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge && !L.Browser.mobile-web-app-capable) {
    layer.bringToFront();
    }
    }

        function resetHighlight(e) {
        geojson.resetStyle(e.target);

            layer.setStyle({
            weight: 5,
            color: '#0000ff',
            dashArray: '',
            fillOpacity: 0.7

        });
        }

I would like to add a start and endpoint marker on my line.  I would like each marker to be different (starter point green, endpoint red).  I have 40 lines (trails) to add this to.


texts: ArcGIS JavaScript API 3.13 error with Measurement setTool() function

texts:
When upgrading to 3.13 the following code to disable the measurement tool returns an error:

measurement.setTool("distance", false);

Here is the error:

  Uncaught TypeError: Cannot read property 'domNode' of undefined

When I switch back to 3.12 it works fine. I'm thinking it's a bug in 3.13, but wanted to see if anyone else has run across this?


texts: Convert a column of a polygon with float values to a raster by using arcpy.da.SearchCursor

texts:
I have a polygon feature and i want to convert it to a raster but i dont want the polygon as a whole , i just want each column to produce a different raster.The first problem starts that the values are float.
I have tried to write a python to do this but I am still getting errors, below is my table and I would like to have a raster for the S10 and S100 respectively.

the code is as follows:

import arcpy
import os, sys
import numpy as np

outputfolder = arcpy.GetParameterAsText(0)
featuredata = arcpy.GetParameterAsText(1)
createdRaster = arcpy.GetParameterAsText(2)

#cursor = arcpy.da.SearchCursor(fc,['S10','S100'])

rows = arcpy.da.SearchCursor(featuredata,['S10','S100'])
#for i in range(2,7,2):
    #arcpy.AddMessage("When i is {0}".format(i))
#rows.reset()
for row in rows:
    if row[1]:
        #fid = row.getValue('FID')
        query = str(row[1])

        arcpy.Select_analysis(featuredata,"in_memory")
        arcpy.FeatureToRaster_conversion("in_memory",row[1],createdRaster,10)

arcpy.Delete_management("in_memory")

And the error that  I get :

Traceback (most recent call last):
  File "C:\Python27\featureToraster.py", line 21, in <module>
    arcpy.FeatureToRaster_conversion("in_memory",row[1],createdRaster,10)
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 001000: Field: Field 0.405 does not exist