texts: Raster from point data in R different from point data in QGIS

texts:
I have some point data, with longitude, latitude and a value, in .csv file format.

This is how the file looks in QGIS:

I wanted to create a raster of this map, with each of the points representing the center of a cell, in R, as practice. I first created an empty raster in R, and then added the values to the raster, like so:

##This is the datafile with the lon, lat and values:
        moisture_data <- read.csv("Suf_tab_lon_lat.csv", sep = ",", header = T)

        soil_raster <- extent(c(min(moisture_data$lon) - 0.0625,
                                max(moisture_data$lon) + 0.0625,
                              min(moisture_data$lat) - 0.0625,
                              max(moisture_data$lat) + 0.0625))
        soil_raster <- raster(soil_raster)
        res(soil_raster) <- 0.125
        projection(soil_raster) <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
        values(soil_raster) <- moisture_data$soil_moisture

However, when I plot the raster, this is how it looks:

I am unable to figure out why the data is getting flipped, and how to set this right. I am not sure how to post my original data, which might be more helpful, apart from simply emailing the CSV file to anyone who requests it.


texts: Why does exported map from print composer differ from map canvas? QGIS 1.8.0

texts:
I have a small project consisting of a Google maps satellite open layer with two new shapefiles overlaid on it. I have then used print composer to add a grid and some labels. I have also selected lock layers for map items and draw map canvas items in the map tab. However, when I come to import the exported map in to another document, the layers have shifted and the map has zoomed in to an offset position. This occurs in both pdf and image formats.
How do I ensure the map I produce in print composer does not alter when saved for export?

I hope someone can help as I have noticed another user asked this same question back in February without any response (User 15214 on Feb 15th).
Thanks in advance


texts: OGR and Shapely to query, dissolve, export polylines

texts:
I am trying to select lines from a shapefile using an IN statement, then dissolve these lines into one feature, and then export.

A simplified version of my script is here. It is not producing any output in the output shapefile, but I don't know why!

from osgeo import ogr
from shapely.wkb import loads
from shapely.ops import cascaded_union

# Input line shapefile
links_shapefile = workspace + r"/Input/Links.shp"
driver = ogr.GetDriverByName("ESRI Shapefile")
links_ds = driver.Open(links_shapefile)
links_layer = links_ds.GetLayer(0)

# Output shapefile
output_file = workspace + r"/Output/Output_test.shp"
output_ds = ogr.Open(output_file)
output_layer = output_ds.GetLayer(0)

# Query input shapefile to a list of link IDs
link_attributes = ['1001_10002', '1002_1003', '1003_1004']
file_name = links_shapefile[:-4].split('/')[-1]
sql = "SELECT A_B FROM " + file_name + " WHERE A_B IN " + str(tuple(link_attributes))
selection_layer = links_ds.ExecuteSQL(sql)

# Loop selected lines and append geometry to a list
selection_feature_count = selection_layer.GetFeatureCount()
lines = [] #list to store line geometry
for index in range(0, selection_feature_count):
      feature = selection_layer.GetFeature(index)
      geometry = feature.geometry()
      lines.append(loads(geometry.ExportToWkb()))

#Dissolve list of lines
u = cascaded_union(lines)

#Export dissolved lines to output shapefile
defn = output_layer.GetLayerDefn()
feat = ogr.Feature(defn)
feat.SetField('UniqID', 9999)
geom = ogr.CreateGeometryFromWkb(u.wkb)
feat.SetGeometry(geom)
output_layer.CreateFeature(feat)

Please let me know if you see any issues with this script or if there is a better way to do something! I am new to using Python.


texts: How to import a .sid Raster File in QGIS 2.6.0 On Linux Mint 17

texts:
I need some help importing MrSID Raster files in QGIS. I am running 2.6.0 on Linux Mint 17. After an internet search I have found a couple of resources that are perhaps outdated. The most promising is found here :

http://trac.osgeo.org/ubuntugis/wiki/TutorialMrSid

However when I attempted to follow the instructions my terminal and I could not find the file "libgdal-mrsid-src" on either the stable or unstable Ubuntu GIS repos. Has anyone had success or could lead me in the right direction?


texts: 3D visualisation with open source GIS software

texts:
I'm searching for QGIS (or other open source GIS software) tools that can analyse XYZ data.

Also I'm interested to hear about if anyone have migrated to non commercial software regarding geological 3D analysis and thereby what is your experience - do's and don'ts?


texts: Knowing the polygon id and getting the extent

texts: I have a text box where I have the polygon Id like, "id_of_the_polygon_12345". Is it possible to get its extent and zoom onto it? I have figured out how to do it upon clicking on the map. But could not figure how to do the same knowing my poly Id.


texts: Creating Affine for 2D Linear Transformation of Fixed Bounding Box

texts:
I am currently trying to create an Affine which can transform data from longitude and latitude to a custom CRS that a client is using. Unfortunately the person who originally made this CRS has left and they have no metadata relating to their custom coordinate system.

They have provided me a number of points with coordinates in both their custom CRS and longitude and latitude. They have told me it is a true projected coordinate system and I have managed to identify a local CRS which is fairly close to it.

Currently I am manually trying to calculate the rotation and stretching for the Affine manually.

Are there any quick methods available when the fixed corners of each grid are known?


texts: Using Group By with Summarize on alphanumeric field in ArcGIS Desktop?


texts: Error when trying to bind popup on geojson, failed to execute 'appendChild'

texts:
I'm trying to load more than 13 thousand points in leaflet from a geoJson file, everything seems to work just fine except the Popup function. I've looked everywhere for a solution and most answers out here do not work in my case. Here is an excerpt of my code:

//calling the geoJSON
        var SaoPaulo = L.geoJson(SP_ResSinglePoint, {

            pointToLayer: function (feature, latlng) {
                var popupContent = feature.properties.Time;
                console.log(popupContent);
                return L.circleMarker(latlng, Style(feature)).bindPopup(popupContent);
            },

        });

When I click on a given point I get the following message on the console:

Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

But I do get all the info I'm looking for through the console.log so I'm assuming that that my popup parameters are correct, but yet no luck in the map.


texts: Very slow response when requesting shapefile from GeoServer

texts:
I face a speed issue related to GeoServer. More specifically in my web application when I click the following URL, it takes several seconds in order for the browser to receive the file. This happen with files which are of the size of 60mb or more.

http://domain?format_options=charset:UTF-8&typename=workspace:layer_name&outputFormat=SHAPE-ZIP&version=1.0.0&service=WFS&request=GetFeature

I tried to check the log file of GeoServer, by setting the logging to developer option. The only warnings I got are the following and I don't thing is related to this:

2017-05-09 15:04:04,491 DEBUG [org.geoserver.web] - cannot convert url: jar:file:/home/sdi/tomcat/webapps/geoserver/WEB-INF/lib/gs-web-core-2.5.1.jar!/org/geoserver/web/css/blueprint/print.css to file (URI is not hierarchical), falling back to the inputstream for polling
2017-05-09 15:04:04,491 DEBUG [org.geoserver.web] - cannot convert url: jar:file:/home/sdi/tomcat/webapps/geoserver/WEB-INF/lib/gs-web-core-2.5.1.jar!/org/geoserver/web/css/geoserver.css to file (URI is not hierarchical), falling back to the inputstream for polling
2017-05-09 15:04:04,491 DEBUG [org.geoserver.web] - cannot convert url: jar:file:/home/sdi/tomcat/webapps/geoserver/WEB-INF/lib/gs-web-core-2.5.1.jar!/org/geoserver/web/css/blueprint/ie.css to file (URI is not hierarchical), falling back to the inputstream for polling
2017-05-09 15:04:04,492 DEBUG [org.geoserver.web] - cannot convert url: jar:file:/home/sdi/tomcat/webapps/geoserver/WEB-INF/lib/gs-web-core-2.5.1.jar!/org/geoserver/web/js/jquery-1.2.6.min.js to file (URI is not hierarchical), falling back to the inputstream for polling
2017-05-09 15:04:04,492 DEBUG [org.geoserver.web] - cannot convert url: jar:file:/home/sdi/tomcat/webapps/geoserver/WEB-INF/lib/gs-web-core-2.5.1.jar!/org/geoserver/web/js/jquery.inline-info.js to file (URI is not hierarchical), falling back to the inputstream for polling

I wonder if this is an issue of the tomcat configuration. Perhaps increasing the heap memory would speed things up? Do you have any recommendation on this or hint what could cause this slow behaviour?


texts:
I want to calculate the mean and standard deviation of a raster image. In QGIS zonal statistics, we can calculate it within a polygon or a vector. But I want to calculate for the whole image. In Python, I'm getting the same value for an image that I'm giving as input. How can I resolve this one...?

import numpy as np
from osgeo import gdal
g = gdal.Open('ndvi.tif')
ndvi = g.ReadAsArray()
ndvi = np.array(ndvi, dtype = float)
M_ndvi = ndvi.mean()
Std_ndvi = ndvi.std()

I tried this for different images, but the mean and standard deviation output is same for all.


texts: Calculate values to represent bus route attribute

texts:
I'm working with bus routes and looking for a way to represent some values in this system.

I want each street to be represented by thickness based on value returned in SUM or COUNT. I don't have big issues with Symbology process but some getting those values.

I have two layers:

Streets/roads. No overlapping lines. Topology OK. Attribute table with STREET_NAME, ID.
Bus lines. One feature per bus line/direction. Attribute table with variables for these lines like number of passengers, name, direction. Some lines, or part of them, are overlapping.

What I did until now in ArcGIS:

Spatial Join with this two layers (one to many, match option WITHIN)
Dissolve by street’s name+ID. Trying to SUM some fields and COUNT another.

Results:

Ok for SUM fields (p. ex. number of passengers)
COUNT return 0 when COUNT using LINE_NAME field (text). Solved by create a field (double) and fill with value “1” for each feature. Now COUNT or SUM function returns the number of bus routes over each street.

Any help in this process, alternative or optimized way?

I’m using ArcGIS and QGIS in this project.

Thanks.

UPDATE

Attached some images with results using SUM on Dissolve function. I achieved what I wanted but I'm interested if there some better other option in this process.
I´m not planning to build a Network now. Maybe in the future as I don't know if is possible to represent these infos in a Network Dataset.

Thanks again.


texts:
I apologize in advance for my lack of knowledge. I don't know a great deal about working with this program, so I'm learning as I go. I am wanting to take the free Landsat data that I have downloaded and turn it into a NDVI shapefile for use in another agriculture program.

I have downloaded the data and imported Bands 4 and 5 into QGIS. Since this is for a particular field, I used a shapefile of the field boundary to clip the image.  I then used the Raster Calculator to generate a GeoTIFF using the expression (Band5-Band4)/(Band5+Band4).  I also changed the layer properties so that I can visualize the data on a RedYellowGreen scale. This looks good so far.

I now need to turn this clipped GeoTIFF into a shapefile so that I can import it into my other program.  I have tried the polygonize (Raster to Vector) but this doesn't seem to give me what I am needing.  Could someone point me in the right direction, please?


texts: Convert linear ring to multilinestring and split into segments of x length

texts:
I have a linear ring created from points. I would then like to create a multilinestring from that and subsequently split that into segments of 7 metres each.

I tried the following but got 'LinearRing cannot be cast to class org.locationtech.jts.geom.MultiLineString'.

GeometryFactory gf = new GeometryFactory();
LinearRing outer = gf.createLinearRing(coords.toArray(new Coordinate[] {}));
Polygon polygon = gf.createPolygon( outer, null );
MultiLineString mlslr = gf.createMultiLineString(new LineString[]{polygon.getExteriorRing()});


texts: I am faced with the following issue. I got a raster map showing the position and extent of land parcels within a 35 sq Km area. The number of parcels is about 200. In anticipation of the following step, which would be to digitize the parcels and perform further analyses, I wish to select a sample that is random spatially speaking. What would be a viable strategy to achieve that? If the parcels were already digitized, it would be easy for me to take a random sample from the attribute table. But my situation is different, since what I have right now is just a raster map showing parcels position and extent. An idea that I had (but which I am not sure about) is to generate x random points in ArcMap, buffering them (say, 1 km buffer), and select the parcels which for example fall inside the buffer. But I wonder if this could be considered a random sample...


texts:
I'm unable to install QGIS on lubuntu (LXDE desktop). This is what it says on the terminal:

Package qgis is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'qgis' has no installation candidate

On previous attempt of installation the problem was in absence(?) of QT environment (if I understood correctly).


texts: Getting Feature Attachments using ArcObjects .NET (using AttachToMemory)?

texts:
I am trying to retreive the Attachment of a Feature using ArcObjects in C#. The data is correct, I am able to dump the attachments to the disk using SaveToFile.

I want to work in memory and not dump to the disk and re-read the bytes as this is terribly wrong.

Also, I cannot "hack" in the database and select the BLOB directly.

Here is the relevant piece of code that I have up to now and the operation AttachToMemory which I believe is the way to go but I am unable to get it working.

IEnumAttachment enumAttachment = table.AttachmentManager.GetAttachmentsByParentIDs(ids, false);
IAttachment attachment = null;
while ((attachment = enumAttachment.Next()) != null)
{
    // THIS DOES NOT COPY THE DATA, DATA = \0
    byte[] data = new byte[attachment.Size];
    attachment.Data.AttachToMemory(ref data[0], (uint)attachment.Size, 0);

    // THIS INDEED CREATES THE PROPER FILE WITH DATA
    attachment.Data.SaveToFile("C:\path");
}

After the AttachToMemory operation, the data does not contain the bytes, it is initialized to null bytes.

I have tried to work with unmanaged memory portions but then I get some very strange results (the few first bytes are non-null then the rest is null bytes) :

IntPtr pointer = Marshal.AllocHGlobal(attachment.Size);
byte first = (byte)pointer.ToPointer(); // <---- this looks very wrong
attachment.Data.AttachToMemory(ref first, (uint)attachment.Size, 0);
Marshal.Copy(pointer, data, 0, data.Length);
Marshal.FreeHGlobal(pointer);

One of my issues in understanding how it is supposed to work is that the AttachToMemory method accepts a ref byte as first argument. This seems very strange to me.

The reference of the ArcObject is here : http://resources.esri.com/help/9.3/arcgisengine/arcobjects/esriSystem/IMemoryBlobStream_AttachToMemory.htm


texts:
I'm using QGIS 3.4.1, and I'm trying to print 61km x 61km area map of somewhere South Korea. Then I need to send this map with west / east latitude and north / south longitude info to other person, who need to do some work on that map. Here's what I did.

First, I set project CRS to EPSG 32652, WGS84 - UTM zone 52N, because most of South Korea is in the zone 52N.

Second, I load maps from Quick Map Service plugin, ESRI map from ArcGIS Map Server layer, Openlayers plugin. I also downloaded SRTM data using SRTM downloader, and also from CGIAR-CSI for double check.

Third, I found out that all of layers that I loaded or downloaded have CRS of EPSG 3857, WGS84 - Pseudo Mercator. I intuitively thought that they should have the same CRS with project CRS. So I changed CRS of all layers to project CRS, which is EPSG 32652, WGS84 - UTM zone 52N.

Then I found out something gone wrong seriously. Distance is distorted, grids, scale bar, and ruler show unusually shorter distance than it should be. In addition, I found that lat long coordinate shown from Lat Long tools plugin is really really off from real Lat and Long coordinate. For example, typical Lat Long position of Seoul is around 37.55 N, 127.03 E. However, Lat Long position from map after map CRS conversion shows around 8.45 N, -151.53 E. Moreover, all SRTM data layer moved to really strange position.

Just in case, I repeated the same procedure from QGIS 2.18 with on-the-fly CRS transformation option on. But the same symptom occur.

I think major problem here is the CRS, project CRS and layer CRS. I think my "I intuitively thought that they should have the same CRS with project CRS. " this part is wrong, but I can't understand.

Why should I need to use WGS 84 Pseudo-Mercator CRS for layers, while using WGS 84 UTM 52N CRS for project?

And I don't know what to tell my coworker, which CRS I used for this 61km x 61km area  map.


texts: Populate a value in one feature class from value in another feature class using SearchCursor

texts:
I have two feature classes:

COH_Address (points)

TAXLOTS_NOAT (polygons)

I am trying to find the best code for using a cursor to run through TAXLOTS_NOAT, grab the value for TLNO, and populate the field TLNO_GIS in the COH_Address feature class the TAXLOTS_NOAT feature class field TLNO

import arcpy
# Local variables:
COH_Address = "C:\\Users\\mclbr\\Desktop\\AddressTest.gdb\\Places\\COH_Address"
TAXLOTS_NOAT = "C:\\Users\\mclbr\\Desktop\\AddressTest.gdb\\TAXLOTS_NOAT"
arcpy.MakeFeatureLayer_management(TAXLOTS_NOAT, "TAXLOTS_NOAT")
rows = arcpy.SearchCursor("TAXLOTS_NOAT", "", "", "TLNO", "")
arcpy.MakeFeatureLayer_management(COH_Address, "COH_Address")
for row in rows:
    arcpy.SelectLayerByLocation_management    ("COH_Address", "HAVE_THEIR_CENTER_IN", "TAXLOTS_NOAT", "", "NEW_SELECTION")
    arcpy.CalculateField_management("COH_Address", "TLNO_GIS", "%(row.TLNO)", "PYTHON")


texts: QGIS symbology: where are simple markers located in the system?

texts: I would like to know, where are simple svg-markers (for example the one that is defined as "regular_star" in .qml file) are physically located in the system? I searched the system and looked inside the symbology-ng-style.db, but with no luck.


texts: Why in ArcMap, batch processing with custom model, gives each output identical name?

texts:
In ArcMap 10.7, I'm trying to use batch processing on a custom model. The problem I'm having as seen from the picture below, is that the output files are given the name of the first output file, even though I explicitly name them based on their input file, each of which is unique.  You can see in the picture that even though the output file names are different on process 1,2, and 3; when I actually open the tool it assigns the output name of each file as the first name on the list.

In the picture below, I've opened process #3 on the list.  In the list the output name is correct, but when I open that item its names after the first process.  It's the same no matter how many process iterations I add.

When I run the tool it appears that the first process writes a file with the output name, then each subsequent process writes over that file.

There's also a picture of my model:


texts:
How can I check if a point belongs to a polygon? I want to create a custom identify tool with edit option. I am using C# and ArcMap 10.

My idea is to click on the polygon (building/park/etc) in ArcMap and if the cursor coordinates belongs to polygon, get its parameters from building_layer for further checking (number of building, street name).


texts: What should this projection be in OpenLayers?

texts:
This is ESRI rest prj, "spatialReference":

  {"wkt": "GEOGCS[\"GCS_WGS_1984\",DATUM[\"WGS84\",SPHEROID[\"WGS84\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]"}

Does anybody know what it should be in OpenLayers?


texts: Mapwindow and XTools error: XSI is an undeclared namespace

texts:
I have tried MapWindow and XTools and have gotten this same error both times when trying to import a KML file into Shapefile format. Does anyone know how I can eliminate this error message?

"There was an error opening the KML file
'xsi' is an undeclared namespace. Line 3, position 34."


texts:
I am having trouble batch downloading all of the individual images within an input collection within the GEE Python API. I know there is a function that is callable within the main GEE API using Rodrigo Principe's tool via
     var batch = require('users/fitoprincipe/geetools:batch')

(Export each image from a collection in Google Earth Engine)
but I am having trouble calling this function within Python.


texts: Problem with checking for Valid Geometries for PostGIS in Azure

texts:
I have used this PostGIS in different environments many times without issue:

update my_table set geom = ST_MakeValid(geom) where ST_IsValid(geom) = false;

However in Azure I keep seeing the following response:

ERROR:  GEOS isvalid() threw an error!

This is using PostGIS 2.3.2 r15302 and GEOS 3.6.1-CAPI-1.10.1 r4317

In case it was because geom was null I tried the following:

update my_table set geom = ST_MakeValid(geom)
where geom is not null and ST_IsValid(geom) = false;

However I get the same error.

The above was in psql.  I tried DBeaver as well (I have given up on PgAdmin4) and there I see the following slightly different output:

SQL Error [XX000]: ERROR: GEOS isvalid() threw an error!

Googling GEOS threw an error seems to point to invalid geometries and suggests the user use ST_IsValid() but in this case that is the function causing the issue.

How do I fix the issue when ST_IsValid() itself throws an error?

Update:

Through searching through hundreds of thousands of entries in the table, I found two with errors.

If I try

update my_table set geom = ST_MakeValid(geom) where id in (1234, 5678)

then I see the following error

ERROR: GEOSisValid(): IllegalArgumentException: Exponent out of bounds

How do I fix either error?


texts:
I am learning to use GeoExt and OpenLayers, and I want to reproduce one of the examples given at the GeoExt website. The script calls a GeoJSON file containing the position of Alp summits. I downloaded it via wget and put it in data/summits.json.

I copy pasted the JavaScript file in a local folder, but when I run it in Firefox, I get a not well formed error. I got the same error with several other examples involving a JSON file. I looked for similar problems on the web, but couldn't find an answer. What am I missing?

The part of the script adding the layer from the JSON file is

var summits = new OpenLayers.Layer.Vector("Summits",{
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: "data/summits.json",
        format: new OpenLayers.Format.GeoJSON()
    }),
    styleMap: new OpenLayers.StyleMap(new OpenLayers.Style({},{rules: rules}))
});

I used the same bit of code in several other examples provided by the website (modulo the styleMap part) with always the same error.


texts: Error configuring Oracle datastore in GeoServer

texts:
I want to configure an Oracle datastore in Geoserver so I copied gt2-oracle-spatial-2.3.1.jar and ojdbc14.jar into GeoServer webapp (in WEB-IF/lib folder); then I restarted and try to create new data store; I found " Oracle NG - Oracle Database" but when I click on Save I have this error in the log:

  Caused by: java.lang.ClassNotFoundException: org.geotools.data.DataStoreFactorySpi$Param
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
        at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
        ... 102 more

Where can I find the JAR file for this file?


texts: Finding vertices that osm_source_id refers to

texts:
I've been reading through this post from many years ago, and I have a similar issue.
Namely, I'm assuming that the osm_source_id and osm_destination_id columns in hh_2po_4pgr refer to vertex ids of OSM nodes. Is this assumption correct?
If so, I've noticed that I only find a couple osm vertex ids that match with the ones given for the osm_source_id and osm_destination_id of a particular edge (row of the hh_2po_4pgr table). This behavior seems counterintuitive given that osm2po references osm vertex ids specifically and works from the same OSM XML that I give osm2pgsql to isolate vertex ids.
Any thoughts?


texts:
I'm trying to convert my GRASS/Bash script into the Phython Shell. Now I have a raster dataset (test.01) which I want to convert in 1 or 0. In GRASS I used the command r.mapcalc

r.mapcalc test.new.01="if(test.01/test==1,1,0)"

Now in the Python Shell I figured just the first steps, but I don't get the concept how to return the calculation into a new raster dataset.

import grass.script as grass
import grass.script.setup as gsetup
for rast in grass.list_strings(type = 'rast'):
    print rast
...
...
test.01@mapset

Now I tried to use the Python function grass.raster.mapcalc() but without success, it kills my GRASS GIS process.

expr = "if(test.01@mapset/test.01@mapset==1,1,0)"
output = grass.raster.mapcalc(expr)

The question is also how to write the result into a new raster dataset.


texts: In ArcGis 10, spatial join of a hot street value to a fishnet cell is counting multiple values for same street segment

texts:
So, I am working on a fishnet, so that we can attribute multiple values to points within different cells (i.e., ranking light poles as optimum for traffic cameras based on the number of speeding tickets, accidents, etc) so that all poles in a high value cell would be ranked as prime candidates.

To do this, we have assigned numerical counts of accidents to street segments (sections between intersections) and are attempting to join those values to the fishnet through a spatial join. The issue is, if a street segment runs through the cell, and has a value of 5, it is counted 15 times (or whatever for each cell) and the cell then has a value of 75 instead of 5). Any way to fix this and get one value from each unique street segment in the cell?

(averaging as a run around doesn't work, as some cells have different street segments and if one street has a 0, we don't want that to discount the value of the other street that may have a higher value.) We've tried dissolving, interection, multi to single, and none of them seem to make each street segment unique or with only the requisite value display once.

Here is a shot of the image. the issue is, and this example actually accidentally illustrated it clearer than I'd seen, is that for the horizontal street near the middle, with a "3" (there are only two dots because one has 2 values) looks correct, but if one tried to join that "3" value to a cell intersecting that street segment, it would likely join the value "45." This is demonstrated a street over where one street has a "3" a "0" and a "7." This seems to demonstrate the single street is actually 3 segments to arcgis. I can't figure out how to make, for example, that street equal "10" and then join it's value to a cell so the cell would only have "10" as the joined value, not "30" or "150" or however many times it joined.


texts:
I am using Google maps for my application. For getting some custom private map data, I have set up a WMS using Mapserver.
How can I add this Custom UMN Mapserver WMS layer over Google API (without using Openlayers)?


texts:
How can I make my tooltips update when I change years on this map?

http://argis.ualr-iea.org/dash_new_design/uninsured_map.html

Using the select box, I can get the style to change but I can't figure out how to update the numbers in the tooltip.


texts: Setup QGIS 3 and Visual Studio Code plugin development (Windows)

texts:
I try to setup QGIS 3 with 2 bat file like that

@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W64
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass76\etc\env.bat

path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass76\lib
path %PATH%;C:\OSGeo4W64\apps\Qt5\bin
path %PATH%;C:\OSGeo4W64\apps\Python37\Scripts

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37

set PATH=C:\Program Files\Git\bin;%PATH%

cmd.exe

and

@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W64
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass76\etc\env.bat
@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass76\lib
path %PATH%;C:\OSGeo4W64\apps\Qt5\bin
path %PATH%;C:\OSGeo4W64\apps\Python37\Scripts

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37

set PATH=C:\Program Files\Git\bin;%PATH%

start "VisualCode QGIS" /B "C:\Microsoft VS Code\Code.exe" %*

but when I try to import qgis.core by standalone VS code I got error like that

Traceback (most recent call last):
  File "c:\Users\KTLab\.vscode\extensions\ms-python.python-2019.6.24221\pythonFiles\ptvsd_launcher.py", line 21, in <module>
    import ptvsd
  File "c:\Users\KTLab\.vscode\extensions\ms-python.python-2019.6.24221\pythonFiles\lib\python\ptvsd\__init__.py", line 13, in <module>
    from ._vendored import force_pydevd
  File "c:\Users\KTLab\.vscode\extensions\ms-python.python-2019.6.24221\pythonFiles\lib\python\ptvsd\_vendored\force_pydevd.py", line 18, in <module>
    pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
  File "C:\OSGEO4~1\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "c:\Users\KTLab\.vscode\extensions\ms-python.python-2019.6.24221\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_constants.py", line 180, in <module>
    from _pydev_imps._pydev_saved_modules import thread
  File "c:\Users\KTLab\.vscode\extensions\ms-python.python-2019.6.24221\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydev_imps\_pydev_saved_modules.py", line 8, in <module>
    import socket
  File "C:\OSGEO4~1\apps\Python37\lib\socket.py", line 49, in <module>
    import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.

Internal error detected. Please copy the above traceback and report at
https://github.com/Microsoft/vscode-python/issues/new

Could you please explain it for me?


texts: What is the difference between a N96 and N96e grid space?

texts: Global land-use and meteorological raster datasets are often gridded using N96 or N96e grids. I suspect that they are slightly different but I cannot find information on how they differ. Both split the world into 192 x 144 cells. Do they have the same origin (i.e. Greenwich)? How are they defined?


texts: Error in polygonising raster data with QGIS on Mac

texts:
I'm using QGis Chugiak on a Mac and I'm trying to converting a raster layer in a vector data by: Raster/Conversion/Polygonize. So, I select the layer needed from the drop-down menu, I give a name to the output, layer but every time an error heppens.
Probably there's something that doesn't work in GDAL.
I leave there the error informations:


texts: ArcGIS 10 add-in: Top-level exception handling

texts:
The ArcGIS 10 add-in I'm working on is pretty simple -- just a tool control and a dockable window. I'm handling the specific exceptions I anticipate occuring at the source and throwing everything else, but what is the best practice for handling those unexpected exceptions in the add-in framework?

I'm currently just doing a catch (System.Exception ex) and showing it in a MessageBox in every method that doesn't have a higher-level method I could handle it in, but this doesn't seem like the best practice (and of course, FxCop is whining about it).

Is there any facility in the ArcGIS 10 add-in framework for a top-level exception handler to be hooked up, for example to the Application.ThreadException or AppDomain.UnhandledException events?

Seeing as add-ins are just class libraries and not applications with no access to the underlying application's startup code (from what I gather, those events have to be hooked up very early in the startup process), my guess is no, but I thought I'd ask if any experts out there had any suggestions on how "unexpected" exceptions should be handled in add-ins.


texts: Using wildcard to select field by suffix and do a condition (endswith)

texts:
With this validation I get the fields from my active Layer and put into the parameter after select the layer

if self.params[0].value:
  self.params[1].filter.list = [f.name for f in arcpy.ListFields(self.params[0].value,
                                                                wild_card='APH*')]
return

My operations depends only from the year (suffix) (considering I already choose only the fields I need by Validation).

I tried many ways to solve this, but always get errors like:

Traceback (most recent call last):
  File "F:\Agro\Scripts\PercAPH.py", line 19, in <module>
    if field1.name('*2003') and lyr.symbologyType == "GRADUATED_COLORS":
AttributeError: 'list' object has no attribute 'name'
Failed to execute (PercAPH).

I know it`s very clear that the object do not have this function, but I read some documentations from ESRI website and the code examples uses field.name for example. In my last attempt I use the 'endswith' but the same error appears.

Here is my last code attempt. I will repeat this code for N years from my attribute table.

TabelaP1 = arcpy.GetParameterAsText(0)
Ano = arcpy.GetParameterAsText(1) #field 'Ano' list all year fields using Validation
IndexL = int(arcpy.GetParameterAsText(2))
SiglaProduto = arcpy.GetParameterAsText(3)
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "")[0]
lyr = arcpy.mapping.ListLayers(mxd, "", df)[IndexL]
Layer1 = arcpy.mapping.Layer(r'F:\Agro\Layers\PercAPH.lyr')
field1 = for f in fields arcpy.ListFields(TabelaP1)

arcpy.AddMessage('Calculando Porcentagem de Area Plantada')

if field1.endswith('*2003') and lyr.symbologyType == "GRADUATED_COLORS":

NovoCampo1 = 'Perc_'+SiglaProduto+'_APH2003'
Campo1 = 'Ano'
arcpy.AddMessage('Campo selecionado: {0}'.format(Campo1))
arcpy.AddField_management(TabelaP1, NovoCampo1, 'Float')
arcpy.CalculateField_management(TabelaP1, NovoCampo1, '(!Ano!/!AreaTotalHec!)*100', "PYTHON_9.3")
lyr.symbology.valueField = NovoCampo1
arcpy.mapping.UpdateLayer(df, lyr, Layer1, True)
arcpy.RefreshActiveView()
arcpy.RefreshTOC()


texts: Can I select a subset of pins in Google Earth and export the attached data to a csv file?

texts: I have a large set of pins, each with an associated ID and lat/long. Is it possible to select a small group of these pins and then export the associated info into a CSV file?


texts:
I am using ArcMap 10.4.

I have an attribute table of shapefile with more than 20 millions rows stored in gdb. That table has a column with postcodes (that are often repeated) and column with values. I want to sum all values that refer to each unique postcode and for that I used Summary Statistics toolbox. But something went wrong. As result I have values for 2426 postcodes, when I know that there are 4709. Half of the values are missing in statistics table.

Does anybody know how to solve this or might know what has happened?


texts: How to create a tile from a TIFF stored in PostGIS using Mapnik in nodejs

texts:
I stored TIFF in the database using:
raster2pgsql -c -C -s 4326 -f geom_raster -F -I evapo_01_201.tif -t 200x200 public.rasters | psql -U postgres -d gaaf -h localhost -p 5432

I think it's alright because I can import the raster into QGIS through a connection with PostGIS and everything works.
So the error must be in the nodejs code:
export class MapnikGetTileDatasource implements GetTileDatasource {
  private readonly _proj4: string

  constructor () {
    mapnik.register_default_input_plugins()
    this._proj4 = '+init=epsg:4326'
  }

  async getTile (schema: string, table: string, x: number, y: number, z: number): Promise<Buffer> {
    try {
      const dbConfig = {
        host: env.postGreHost,
        dbname: 'gaaf',
        user: env.postGreUser,
        password: env.postGrePass,
        type: 'postgis',
        geometry_field: 'rast',
        table: `${schema}.${table}`,
        extent: '-61.6333829819999863,-18.0415982405563007,-50.2247189819999846,-7.3471822405563003'
      }

      const map = new mapnik.Map(100, 100, this._proj4)
      const layer = new mapnik.Layer('tile', this._proj4)
      layer.datasource = new mapnik.Datasource(
        dbConfig
      )
      map.add_layer(layer)
      map.extent = [-61.633382981999986, -18.0415982405563, -50.224718981999985, -7.347182240556301]
      const image = new mapnik.Image(map.width, map.height)
      return await new Promise((resolve, reject) => {
        map.render(image, { image_format: 'png' }, (err, im) => {
          if (err) return reject(err)
          resolve(im.encodeSync('png'))
        })
      })
    } catch (e) {
      console.log(e)
    }
  }
}


texts: Basic If/Then in Python Parser of ArcGIS Field Calculator?

texts:
I am using ArcGIS 10.2 for Desktop, and I've been looking through this site, and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with ArcGIS.  I know I can do this the slow way with Select By Attributes, but It's time consuming.

I am attempting a spatial join between cases of a disease (points layer) and US Census Tracts (polygon layer). This requires count data. For each point/case, I have a field called YEAR with date ranges 2001 to 2012 depending on what year the case happened. I need a count column for each year. For example, the first one I'm calling COUNT01. If the case date in YEAR is 2001, then COUNT01 will have a 1 in it. If it is any other year (2002-2012), then there will need to be a 0. I will have COUNT02, COUNT03...COUNT12 columns. Can't have a "Null" value.

Here's what I've tried so far

And here is what the data looks like in Arc.


texts: How to get specific coordinate system to get arcGIS point shapefile in r?

texts:
I have a Point shapefile from arcGIS 10. I want to get it in r and also want to get it a specific predefined coordinate systen for my data. I can read the shapefile in R but summary in r Shows projectltion info like this `proj4string : [NA]' and if i want to transform the reference systen it Shows something like this:

Error in spTransform(xSP, CRSobj, ...) :
  No transformation possible from NA reference System
What can I do to deal with this Problem. Thanks a lot:-)


texts: Missing attributes after DXF import in QGIS

texts: I use "add vector layer" to import my dxf file in QGIS. But, when I open the attributes tables of the layers (point, polyligne, polygone), I see that the majority of the attributes (color, ...) of the layers has disappeared !!! Do you have any idea of this problem ?


texts:
I'm trying to configure a popup for a polygon feature class so that when clicked attributes from a point feature class show up. For example, if I had 10 clients living in the USA, if I clicked on the USA polygon, the names of those 10 clients would appear in the popup.
So far, I can only get it to display the first value of only the firstname (first and last names are in different fields of the point layer):
var intersectLayer =Intersects(FeatureSetByName($map,"Origins"), $feature)

for (var f in intersectLayer){
return f.first_name; " "; f.last_name;
}

right now it returns:
custom: John

but I would like it to return:
 John Smith
 Lucy Stone
 Sam Addams
 Butch Cassidy

And so on.
Tried gleaning something from this but the code provided doesn't seem to work with my layers:
https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/pump-up-your-pop-ups-with-arcade-and-the-living-atlas/


texts: Multiple input shapefiles for ogr2ogr sqlite spatial operations

texts:
I'm running up against an issue doing a spatial operation requiring multiple input shapefiles using ogr2ogr and sqlite.

I have:

ogr2ogr -f "ESRI Shapefile" output.shp input.shp -dialect sqlite -sql "CREATE VIRTUAL TABLE 'overlap' USING VirtualOGR('overlap.shp'); SELECT ST_SymDifference('input','overlap')"

Where 'output' is my output shape, 'input' is one input shape and 'overlap' is the other input shape. I can't seem to get any output, or if I do, it's just a DBF file? Any assistance?

I suspect it's to do with the Virtual Table not having any geometry but I can't seem to do a "RecoveryGeometryColumn" that actually works.

Both 'input' and 'overlap' have the same projection and overlap nicely in QGIS.

I'm on version "GDAL 1.10.0, released 2013/04/24"

Thanks!

Edit: Fixed typos in my sqlite command

Edit2:

ogr2ogr -f "ESRI Shapefile" output.shp input.shp -dialect sqlite -sql "SELECT ST_SymDifference(GEOMETRY,'overlap.sqlite.GEOMETRY'),* FROM input"

Just returns the input shape. I think I've completely missed something obvious...


texts: Point appears in wrong place, seems like wrong SpatialReference

texts:
I'm using the code below to render a point on the map but the point is in the wrong place. The coordinate system is 28992 which is a local system for the Netherlands.

Instead of the point being rendered in the Netherlands, it's rendered off the coast of Africa (near, but not on, (0,0) lat/lng). I suspect that maybe the web mercator system 102100 is applied instead of the 28992. I have a new theory: in the definition of 28992 there is: "Central_Meridian": 5.38763888888889, "Latitude_Of_Origin": 52.15616055555555, it's like this is 0,0 instead. So the point renders with the wrong offset.

I'm fairly new to using ESRI/arcGIS so maybe I made a very basic mistake.

var map;
map = new Map(container_div_id, {
    basemap: "topo",
    locale: "nl",
    center: [5.523682, 52.150892],  // center of NL
    zoom: 1
});
map.on("load", function (event) {
    var point, graphic, markerSymbol;
    markerSymbol = new PictureMarkerSymbol({ ... });
    point = new esri.geometry.Point(140255.23099999875, 398772.03599999845,
        new esri.SpatialReference(28992));
    graphic = new esri.Graphic(point, markerSymbol);
    map.graphics.add(graphic);
});

Rendering points in other systems (ie. 102100 WGS84-projection and 4326 WGS84-geographic) works just fine.

References:

List of projections
esri.geometry.Point API

Edit: using jbchurchill's suggestion:

map.on("load", internal_utils.try_catch(function (event) {
    map.spatialReference = new esri.SpatialReference(28992);
    ..
    point = new esri.geometry.Point(140255.23099999875, 398772.03599999845, new esri.SpatialReference(28992));
    ..
}));

This has the same result.


texts: How to store GeoSMS into a PostGIS table?

texts:
I wish to import GeoSMS messages into a PostGIS table.

Any suggestions or helpful API to be used?


texts: Cannot deploy geoserver.war on Apache Tomcat

texts:
I'm very new to this so bear with me. I am trying to deploy geoserver.war through Apache Tomcat, but I keep getting the following page whenever I do:

I have tried moving geoserver.war into the Tomcat webapps folder, but still continue to get the same problem. How would I go about fixing this?


texts: Displaying direction arrow on pointstopath in QGIS?

texts:
I found Displaying direction of movement with points2paths in QGIS? which should work but it doesn't.  It looks as though it's an older version of QGIS (I'm using Madeira).  Arrow gives a very strange output with big circles appearing (the track crosses itself and returns to the same point frequently).

I would like a simple arrow between each line point, is this possible?


texts:
I have CSV file with have ID which is repeating, something like:

ID     other values..
1       njhb
1       njhb
2       njhb
2       njhb
1       njhb

Anyway, I have in shapefile that ID which is not repeating:

ID2      geoemetry
1          g1
2          g2

....

I want to merge that values, something like Descartes multiplication, so the output will be:

ID     other values..     ID2    geometry
1       njhb                1      g1
1       njhb                1      g1
2       njhb                2      g2
2       njhb                2      g2
1       njhb                1      g1

Join function in QGIS don't merge it, just take first corresponding value from each and join and rest ignores.


texts: Removing ArcGIS Online icons in Mac menu bar?

texts:
I'm running ArcMap via VMware and each time I open it, an icon gets added to the menu bar.  They never go away when I quit the program, so I wind up with quite a little collection until I reboot.

Can I prevent these or close them?  They don't show in Force Quit.  Is each one constantly trying to connect to ArcGIS online?


texts: Choosing projection for Continental United States?

texts:
I'm working on some code that maps data across the continental US.

I need to project things with a unit length of feet, ex: EPSG:26916.

Is there a projection like 26916 that works for all of the US?

As far as I can tell there are longitude limits for accuracy with 26916.


texts: 3D buffers according to landscape surface in ArcMap

texts:
Using ArcGIS (10.3.1), is it possible to create a buffer zone according to the surface with a variable radius (i.e. 5-10-15 Km)?

With surface/terrain I mean the landscape, so the buffer would be adapted on the true landscape surface. Therefore, the buffer zone should display the reachable distance (within the chosen radius) according to the cost surface.

I tried using the buffer wizard, but the result achieved is "flat", which means that it does not respect the surface changes.

@User2009  With surface/terrain I mean the landscape, so the buffer would be adapted on the true landscape surface. Therefore, the buffer zone should display the reachable distance (within the chosen radius) according to the cost surface.
sorry, I hope having been more clear now.


texts: What file format is this? Can I get a bounding box out of it?

texts:
I am dealing with a PNG map that has an associated text file with this exact content.

  PROJCS["WGS 84 / UTM zone 32N",GEOGCS["WGS
  84",DATUM["WGS_1984",SPHEROID["WGS
  84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32632"]]
  638154.25966967,4.23419760,0.00000000,5132648.32927090,0.00000000,-4.23419760
  5846,4016

The first line is quite long and I recognize it as SRS information.
The rest is likely a bounding box, but I am having an hard time realizing how woud it work, considering that there are six values rather than eight. So those would define three points rather than four according to my understanding.

And there's the last line which lets me totally clueless being it apparently in a different format (no decimals).

My end objective is to convert the pair into a GeoTIFF file.


texts: Convert from shapefile to GPX with selected attributes

texts:
I have a points shapefile that originally came from a GPX file (imported using QGIS). The original GPX file contained waypoints only and has disappeared.

The shapefile has many attributes, but only some have data. Below are these attributes with two example data records (some decimal values discarded  to fit onto one row).

  TYPE    IDENT    LAT     LONG      Y_PROJ        X_PROJ          COMMENT
WAYPOINT    JS    -31.6    22.6    -23610488.1    8084542.7    29-AUG-09 13:56
WAYPOINT    PS    -31.6    22.7    -23610333.7    8084487.4    29-AUG-09 14:01

A client of mine would like to convert the shapefile back into GPX, retaining the IDENT attribute as the label for each waypoint; he wants to use the GPX file in Garmin's Basecamp software. I have exported the shapefile sucessfully from both QGIS and ExpertGPS, but when I open the files in Garmin's Basecamp softare, each waypoint has only a sequential number as label.

When I look at the GPX files in a text editor, all the atrribute information is there. For example:

<wpt lat="-31.695305019999999" lon="22.647454610000000">
  <type>WAYPOINT</type>
  <extensions>
    <ogr:IDENT>JS</ogr:IDENT>
    <ogr:LAT>-31.69530502</ogr:LAT>
    <ogr:LONG>22.64745461</ogr:LONG>
    <ogr:Y_PROJ>-23610488.11619880</ogr:Y_PROJ>
    <ogr:X_PROJ>8084542.75904646</ogr:X_PROJ>
    <ogr:COMMENT>29-AUG-09 13:56</ogr:COMMENT>
    <ogr:DISPLAY></ogr:DISPLAY>
    <ogr:SYMBOL></ogr:SYMBOL>
    <ogr:UNUSED1></ogr:UNUSED1>
    <ogr:DIST>0.00</ogr:DIST>
    <ogr:PROX_INDEX></ogr:PROX_INDEX>
    <ogr:COLOR></ogr:COLOR>
    <ogr:ALTITUDE>1382.49</ogr:ALTITUDE>
    <ogr:DEPTH>0.00</ogr:DEPTH>
    <ogr:TEMP>0.00</ogr:TEMP>
    <ogr:WPT_CLASS></ogr:WPT_CLASS>
    <ogr:SUB_CLASS></ogr:SUB_CLASS>
    <ogr:ATTRIB></ogr:ATTRIB>
    <ogr:LINK></ogr:LINK>
    <ogr:STATE></ogr:STATE>
    <ogr:COUNTRY></ogr:COUNTRY>
    <ogr:CITY></ogr:CITY>
    <ogr:ADDRESS></ogr:ADDRESS>
    <ogr:FACILITY></ogr:FACILITY>
    <ogr:CROSSROAD></ogr:CROSSROAD>
    <ogr:UNUSED2></ogr:UNUSED2>
    <ogr:ETE></ogr:ETE>
    <ogr:DTYPE></ogr:DTYPE>
    <ogr:MODEL></ogr:MODEL>
    <ogr:FILENAME></ogr:FILENAME>
    <ogr:LTIME></ogr:LTIME>
  </extensions>

Does anyone know how I could achieve this?

Thanks
Hanlie


texts: Using memory layer as input with processing runalg? (QGIS 3)

texts:
My first processing runalg creates a memory layer as output.
I need to use this layer as the input for second runalg.

#first
processing.run("qgis:fieldcalculator", {'INPUT':'test_1_f08f5cd1_13ea_445b_9778_6ee0ab919030','FIELD_NAME':'1.3-field','FIELD_TYPE':0,'FIELD_LENGTH':10,'FIELD_PRECISION':3,'NEW_FIELD':True,'FORMULA':'((length(shortest_line(centroid($geometry),boundary($geometry)))))*1.3','OUTPUT':'memory:'})

#second
processing.run("qgis:fieldcalculator", {'INPUT':?????','FIELD_NAME':'1.3-field','FIELD_TYPE':0,'FIELD_LENGTH':10,'FIELD_PRECISION':3,'NEW_FIELD':True,'FORMULA':'((length(shortest_line(centroid($geometry),boundary($geometry)))))*1.3', 'OUTPUT':'memory:'})

I have found this links but none could help me.

Using memory layer as input and/or output with runalg?
Using processing using other output (result from another algorithm) as input


texts: Troubleshooting VBScript for labeling in ArcMap?

texts:
I am trying to add FIPS codes to my county name labels and want to add either one or two zeros to the number unless it is over 100. i'm hoping someone can find the error in my code:

Function FindLabel ([Name], [FIPS])
    if ([FIPS] < 10) then
  FindLabel = [Name] & vbNewLine & FormatNumber (00,[FIPS])
 else
    if (9 < [FIPS] > 100) then
 FindLabel = [Name] & vbNewLine & FormatNumber (0,[FIPS])
  else
   FindLabel = [Name] & vbNewLine & [FIPS]
  end if
End Function


texts: OpenLayers 3 - Cesium (ol is not defined)

texts:
I am trying to get Cesium working in my OpenLayers 3 application.

I am using ol3-cesium-v1.7 from: https://github.com/openlayers/ol-cesium/releases
My application was using OpenLayers 3.82.

I removed the call to ol.js and replaced it with this:

<script src="/resources/api/Cesium/Cesium/Cesium.js"></script>
<script src="/resources/api/Cesium/ol3cesium-debug.js"></script>

In my code I have this:

                map = new ol.Map({
                    target: 'map',
                    renderer: 'canvas',
                    layers: mapLayersArray,
                    controls: ol.control.defaults({
                        attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
                            collapsible: false
                        })
                    }).extend([mousePositionControl]),
                    view: new ol.View({
                        center: ol.proj.transform(defaultCoordinate, fromProjection, toProjection),
                        zoom: defaultMapZoomLevel,
                        minZoom: 2,
                        extent: olExtent
                    })
                });

                var ol3d = new olcs.OLCesium({map: map}); // map is the ol.Map instance
                ol3d.setEnabled(true);

I am getting these errors:

goog.require could not find: ol.layer.Group

Uncaught Error: goog.require could not find: ol.layer.Group
    at Object.goog.require (ol3cesium-debug.js:475)
    at ol3cesium-debug.js:1705

ReferenceError: ol is not defined
    at new <anonymous> (mapService.js:11)
    at e (angular.js:4112)
    at Object.instantiate (angular.js:4123)
    at Object.<anonymous> (angular.js:3981)
    at Object.e [as invoke] (angular.js:4112)
    at angular.js:3944
    at d (angular.js:4071)
    at e (angular.js:4103)
    at Object.instantiate (angular.js:4123)
    at Object.<anonymous> (angular.js:3981)

What am I missing?


texts: GDAL/OGR- OGRLayer.Intersection() with C# bindings

texts:
I was trying to perform intersection on two feature classes (shapefile
format) using OGRLayer.Intersection(), but have problems making it work
with C# bindings. I am not able to figure out on how to pass the
arguments SWIGTYPE_p_GDALProgressFunc callback
and OSGeo.OGR.SWIGTYPE_p_void callback_data.

Can someone please help me figure out on how to handle these. I keep getting the error: "Attempt to dereference null GDALProgressFunc".

I am not sure what that means.

Please share an example on how to call Intersection routine or some other
routine which takes above mentioned argument types.


texts: ArcGIS: Extract portion of a geometric network that exists 30 mi downstream of intersection with another layer

texts: I have flow lines for streams. I've made them into a geometric network. The streams intersect with a rail network. I want to find all of the points of intersection and then get all of the flow lines 30 miles downstream of those points. The idea is to be able to mitigate any hazardous waste spill from the rail. We think 30 miles downstream is a good starting point for planning. How can I create a layer for all of these 30 mi downstream segments? I have included an example of what we're hoping the final product will look like. The rail is the black line and the streams are the blue lines.


texts: OpenLayers - ModifyFeature - How to label vertices with a progressive number

texts:
I am quite new in OpenLayers and JavaScript.

I have a control ModifyFeature on a path vector layer.

I would like the vertices to be rendered with a stylemap label showing their progressive number (1,2,3,4,etc..), the same sequence they are stored within the linestring.


texts: How do I get a result's status description instead of a status integer?

texts:
This code snippet outputs 4 when the run was successful. Great! But how is displaying a number useful to anyone unless that person knows how / where to look up the status integer? I could perform a lookup but why recreate the wheel, right? Is there any built-in way to display the word "Succeeded", or the other 9 words found here depending on status of an operation?

result = arcpy.FeatureClassToFeatureClass_conversion(inputTable, outLocation, outFeatureClass)

print result.status


texts: Grass GIS 6.4.3, How to create a .PTS file

texts:
I'm trying to export a raster map in order to use it in the Flo-2d program.
This program needs a .pts DTM file, do you know how I can create it?

Alternatively, I can use a XYZ file looking like this one:

6413334.59 1936112.79 81.81
6413388.62 1936112.00 81.57
6413500.78 1936108.47 81.29
...........

but if I use the r.out.xyz command, I get a confused file, looking like an endless row in which the x value is fixed, while the y and z ones changes.

I hope I made it clear, thanks in advance for your help!


texts: Dynamic Profile Graph for Data Driven Page Atlas

texts:
I used Strip Map Index Features tool to create a Data Driven Page set of maps and I would need to create a new data frame that will contain a dynamic profile graph that will be modify depending on section of line for each page of the map Atlas displayed.

I have my 3D line and DEM and know how to create a profile graph for the whole line with 3D analyst. But I'm lost when I have to create a graph for each page of the book and make that data frame dynamic at the same time.


texts: Comparing GPS absolute positioning receiver accuracy?

texts:
I have two different types of GPS modules which are in absolute positioning mode (pseudorange data)

Lets say one of them is attached in microcontroller (such as arduino, rasbpy, etc) and the other one is attached on smartphone

The spec of those modules are same and there's no clock offset of both devices

How can I determine which one has a better accuracy from the other one?

Can anybody give me some explanation for this?

Or give me some research paper?


texts:
I've got some GeoTIFF files that have wrong bounding box extent and wrong CRS associated to.

Fortunately I know the right CRS, but even associating it to the files (I've tried both with QGIS and ArcCatalog) their extent remains the wrong one.

So I was wondering if there's a way to completely erase the GeoTIFF header file, then assigning the CRS and obtaining the correct bounding box.


texts: Google Earth Engine: Sampling through image collection

texts:
I am trying to get samples from each image in an image collection and merge them into a single feature collection. So, I wrote the following code (https://code.earthengine.google.com/6797070d93452804e9e0003233039ad8), but It keeps returning the sample from the first image and avoiding the rest.
Do you have any suggestions?


texts: Combine Leaflet with DataTables to show attributes based on map extent

texts:
I've seen a great implementation of both Leaflet and DataTables at the UK Centre for Ecology and Hydrology's National River Flow Archive (see here https://nrfa.ceh.ac.uk/data/search).

How might it be possible to implement a solution which updates the contents of the DataTable beneath depending upon which features in the map are visible?

Note how as you zoom in the DataTable beneath live updates.

This is probably the best implementation of both of these libraries together which I've yet come across. Might it be related to the extent of the map portal?

I'm not looking for any wholesale code here - but an understanding of how to link the two up. Or other examples of where this has been implemented.


texts: Add one-way streets to network data in postgis

texts:
I want to create a routable network.
Doing that, I downloaded OSM data and created a topology with pgr_createTopology() (http://docs.pgrouting.org/2.0/en/src/common/doc/functions/create_topology.html).
However, I wonder: How would I add the information of the flow of direction to the streets? Somehow I must tell pg_routing that a street from this vertice to to another is a one-way-street.
I know these to sources: http://www.webrian.ch/2011/07/set-up-pgrouting-with-openstreetmap.html
http://pgrouting.org/docs/howto/oneway.html but it does not say how I in which direction the traffic flows.


texts:
I am learning some literature of works and came across a beautiful representation of image in chessboard form.  That misaligned  is not my current concern. We are group of bachelor students and are trying mostly in 'Python' to achieve such representation of stack of images.

We tried dicing image and stack/overlay but cannot generate output like this one. Anyone having idea how to do this? I am asking for other image processing software too. **link is provided **

Important Note
We are now trying for blending the two images via tiles. Let us see if we can solve this. Anybody with idea to our problem Please help.


texts: Exporting Raster and Vector Layers within ArcMap

texts:
I am looking for a geoprocessing tool or script that I can run within ArcMap that will extract all raster and vector layers by polygon shapefile and export them to a file.

This should give 609 exports since there are 609 distinct attributes of my polygon shapefile.

All my data layers are in one coordinate system. I wish for all the exports to carry this coordinate system as well.

I do not have the Spatial analyst extension.


texts: Data is lost after merging selected features and pressing save

texts:
I've run into this problem multiple times. I'll merge features and the data will appear. Then when I hit the save button, all my merged data are replaced with null.

This is in QGIS 2.14.1


texts: Using ModelBuilder to get Max and Min Values from raster to raster calculator?

texts:
I'm building a model (ModelBuilder) at ArcMap 10.3.1. How can I get an output (can be a string) of the maximum and the minimum value of a raster to use it on raster calculator?

Actually I'm using the Get Raster Properties tool, and the result I'm putting on raster calculator like this:

-> Square("%raster%" - "%raster_max%"/"%raster_max%" - "%raster_min%")

My problem is that the Get Raster Properties does not export a string with the value. I would like to know if there is a tool or a way using ModelBuilder to extract to Max and Min value of a raster to directly apply on Raster Calculator.

edit: I tried to use Calculate Value tool, with the code:

import arcpy
#Get the geoprocessing result object
maxValueResult = arcpy.GetRasterProperties_management("c:.../..", "MAXIMUM")
#Get the MAX value from geoprocessing result object
maxValue = maxValueResult.getOutput(0)

But it keeps exporting the number only in the results, and it does not convert into a string to use on raster calculator.


texts: Connect to Web Feature Service using python/C#

texts:
I want to connect to WFS using either python or C#, it would be great if anyone can tell me how to connect and extract features from the service. I'm very new to this. Any help on this is most welcome.

Thanks


texts: Confused about ST_DWithin function postgis

texts:
First Time here. Anyway, I have a database that I want to use to store user locations. I want to be able to get all the users with in say 15 miles. How do I do this. I'm using PostGIS 2.1. My SQL query is SELECT * FROM locations WHERE ST_DWithin(usercoord,  ST_GeomFromText('POINT(%s %s)', 4326), %s) AND NAME!=%s;
 usercoord is he geometry table with a SRID of 4326. I tried I'm using Python to execute the query. %s is just a place holder. The third %s is for the distance. I tried reading but I got even more confused. should the distance be in radians or should the distance be in km? I tried making it into radians. However, it didnt look like it worked. I put in 3959 in distance and got all of the users in then table. I have Users in Michigan, US and Pompei, Italy so that can't be in Km or Mi. But then I tried to convert the miles into radians and that didnt select the people with in 15 miles. So how should I get all the users with in x miles?


texts: Use Esri Geoservices REST as backend for Python web framework (Django?)

texts:
I would like to know if it's feasible to use an existing Python web framework such as Django/GeoDjango as a frontend to work with Esri's Geoservices REST API? I envision developing a database engine that hits REST endpoints in JSON as database "tables". Django Admin and Django Forms are very well designed and I think they could serve as great interfaces for adding, changing and deleting both spatial and non-spatial tables, especially those with relationships.

EDIT: As I think more about this, maybe it isn't about changing the source code of Django, but instead designing the web application to support the needs. Models provide storage of map service links and Views provide the CRUD functionality through calls to the REST endpoints.


texts:
I'm writing a plugin that interacts with external software (hydrological models).

One of the dialogs has a lot of entries (parameters to pass to the hydrological software).

Once the user has set up all the parameters and the dialog is closed, when the same dialog is re-opened all the previous parameters are gone and the user has to type them again.

What I'd like to achieve is to save all the entries in the dialog so the user knows the old parameters added.

Plugin QGIS2threejs has this functionality but I'm not able to add the code.

And, is it also possible to store the UI parameters (a kind of screenshot) in an external file to that another user can load it and automatically all the fields will be filled?

I saw this answer but I'm not sure I can solve my problem in the same way.


texts: Drawing 3D line from x,y,z coordinates of start and end points of 2D line for trajectory modelling?

texts:
I have a polyline shapefile with over 13,000 lines which I want to display in 3D to crudely model the trajectories of particles being erupted from a volcano.

I have 2D lines which extend from the x,y coordinates of where each particle was ejected to where it lands. The Z coordinates for the start and end points of each line are also in the attribute table.

The end goal  is to have lines which are tilted down to the ground at the correct angle and location so I can find out how many of the particle trajectories intersect with buildings (which I've already extruded in 3D).


texts: Does anyone know if there is a way to move a group of individual cadastral parcels as a block? I do not wish to merge the parcels.


texts: Loading graph (.grf fle) into MXD using ArcPy?

texts:
I have hundreds of pairs of FGDB and associated MXD files.  I need to insert a graph in each mxd linked to its corresponding FGDB. No problem creating graph, but stuck on how to get graph into mxd file using arcpy. If the graph creation code is run inside the mxd manually, the graph appears, but I need to do it in the python script loop.

import arcpy

workspace = r'C:\gdb_dir'
workspaces = arcpy.ListFiles('*.gdb')        # list of files to process

for workspace in workspaces:
    name_prefix = workspace[0:-4]
    current_MXD = name_prefix + '.mxd'       # this file will already exist

    dataSrc = r'C:\name_prefix\Sample.gdb\DetailFeatures'
    fieldX = 'NEAR_X'
    fieldY = 'NEAR_Y'
    graph_template = r'C:\temp\ScatterGraphTemplate.tee'
    out_graph_name = "ScatterTest"
    out_graph = r'c:\graphs\' + name_prefix + '.grf'   # How to insert this into mxd?

    graph = arcpy.Graph()

    graph.addSeriesScatterPlot(dataSrc, fieldY, fieldX)
    graph.graphAxis[0].title = "Near Y"
    graph.graphAxis[2].title = "Near X"
    graph.graphPropsGeneral.title = "Test of Flake Property Graph"
    arcpy.MakeGraph_management(graph_template, graph, out_graph_name)

    arcpy.SaveGraph_management(out_graph_name, out_graph, "MAINTAIN_ASPECT_RATIO", 600, 375)

How do you insert out_graph into current_MXD?


texts: QGIS: SVG rotation based on attribut and symbol scaling in Legend tree

texts:
I´m trying to rebuild this SLD rule (the env part can be ignored)in QGIS 2.14:

<sld:PointSymbolizer uom="http://www.opengeospatial.org/se/units/metre">
            ...
            <sld:Graphic>
              <sld:ExternalGraphic>
                <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="file:./position.svg"/>
                <sld:Format>image/svg+xml</sld:Format>
              </sld:ExternalGraphic>
              <sld:Size>10</sld:Size>
              <sld:Rotation>
                <ogc:Add>
                  <ogc:PropertyName>rot</ogc:PropertyName>
                  <ogc:Function name="env">
                    <ogc:Literal>rotation</ogc:Literal>
                    <ogc:Literal>3</ogc:Literal>
                  </ogc:Function>
                </ogc:Add>
              ...

Questions:

Is it correct to choose mapunits and 10 as size to fulfill the UOM metre definition?
Is the rotation convert correct by use the expression builder next to rotation -> choose edit and use "rot" + 3 as expression? (ros is the name of a postgres attribut)?
When choosing mapunits as SVG size the symbol gets also scaled in my layertree window when zooming in and out. How can I prevent this and show all symbols in layer-tree in one size?


texts: Buildings missing texture in 3d web scene exported from ArcScene

texts: A random sampling of buildings are missing textures. The models were made in Sketchup 8 and exported to COLLADA, then dropped in ArcScene. All of the textures are .jpg files. The models look fine in ArcScene the issue is only in the exported web scene.


texts: Database Connections folder is empty when viewed with ArcGIS tool

texts: I'm trying to create an ArcGIS tool which accepts an SDE connection file as an input. I made a new interface with an input parameter and set the type to Database Connections. When I open the tool and click the "browse" icon, the dialog opens to the Database Connections folder but there is nothing in it. If I navigate to Database Connections in the ArcCatalog window however I see all my usual connection files. Does anyone know why the tool would not be displaying those?


texts: How can I use the Eckert IV projection with GeoServer WMS?

texts:
I'm trying to request a map in the Eckert IV using a WMS hosted by GeoServer. When I set srs=EPSG:54012 in my query string, I just get a sad XML response:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://172.17.0.2:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1" >
  <ServiceException code="InvalidSRS">
      Error occurred decoding the espg code EPSG:54012
No code &quot;EPSG:54012&quot; from authority &quot;European Petroleum Survey Group&quot; found for object of type &quot;IdentifiedObject&quot;.
  </ServiceException>
</ServiceExceptionReport>

What am I doing wrong?


texts:
Example situation: a raster map that denotes various provinces in a country, each indicated with a unique value.

Goal/question: quickly (for 'preview' purposes, not making a publishable map) assign different colors to each value in the map. So not along a gradient. How do I do that?

Background: in previous versions of QGIS (pre-2.4? maybe pre-2.0?) you could set 'render type' to 'singleband pseudocolor' and, IIRC, the default behaviour was to load the list with value/color mapping from the data (i.e., if there are 10 unique values, put those in the list) and assign random colors to them. Which is perfect (well, 'good enough', 4-color theorem and all) for my purposes.

However, in recent versions of QGIS it seems I can only use the 'generate new color' on the right. Which only does gradients. Furthermore, I can't seem to automatically load the values in the map into the value/color list. 'Load color map from band' only works on data formats that explicitly support 'embedded legends', so to say.

So, is there a way to do what I want?


texts: Table to Table converting ArcMap table to CSV file in external location cuts column names short?

texts:
I am having a strange problem with the ArcPy Table to Table function. For some reason, when I use the function to create a CSV file in a folder that exists outside of my python project folder, several columns in the CSV file have their headers cut short. For example, I have a column titled "PASSING_400_MICROM" that gets truncated to "PASSING_400_MICR'.

Thus far, I have discovered the following about the problem:

The truncation of the same column headers appear to occur in any folder, both on my shared network and local machine, that isn't the python project folder. All the headers are truncated to 16 characters in length.
No truncation occurs if I place the CSV within my project file. (However, I can't do this for the final code, as people on other computers will use my code)

I've done a lot of searching, and I still don't understand why this is happening and how to fix it. I am relatively new to Python and ArcGIS, so I don't even know if I'm searching for the correct things.

What might be causing this problem, and how I can fix it?

Here is an example of the function I am using:

arcpy.TableToTable_conversion(in_rows=DatabaseLocation + '\\Table',
                                  out_path=CSVLocation,
                                  out_name='Table.csv',
                                  where_clause=whereclause)

The same thing happens when I run the tool from it's dialog.


texts: Fixing polygon with incorrectly defined hole in R

texts:
I've been given this polygon as a SpatialPolygons object from the sp package.
It looks like there is a problem with how this was created, there is an unwanted line connecting the hole to the outer boundary.  How can I remove this line?  I'd like to do this within R, I don't have any other GIS software installed on this machine.  I only have this object, I don't have this information in any other format.
Here is a summary of the polygon object:
> str(bnd)
Formal class 'SpatialPolygons' [package "sp"] with 4 slots
  ..@ polygons   :List of 1
  .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
  .. .. .. ..@ Polygons :List of 1
  .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
  .. .. .. .. .. .. ..@ labpt  : num [1:2] 324832 6242992
  .. .. .. .. .. .. ..@ area   : num 2.26e+09
  .. .. .. .. .. .. ..@ hole   : logi FALSE
  .. .. .. .. .. .. ..@ ringDir: int 1
  .. .. .. .. .. .. ..@ coords : num [1:1495, 1:2] 305672 306611 307040 307702 307709 ...
  .. .. .. ..@ plotOrder: int 1
  .. .. .. ..@ labpt    : num [1:2] 324832 6242992
  .. .. .. ..@ ID       : chr "1"
  .. .. .. ..@ area     : num 2.26e+09
  ..@ plotOrder  : int 1
  ..@ bbox       : num [1:2, 1:2] 299008 6194218 358295 6294754
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "x" "y"
  .. .. ..$ : chr [1:2] "min" "max"
  ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
  .. .. ..@ projargs: chr NA


texts: Gaps and overlaps appear after cutting a previously topologically clean shapefile?

texts: I'm using QGIS 2.2 and I have a polygon shapefile which was created by someone else. I have managed to get the shapefile to a topologically clean state by running v.clean but when I tried to cut the existing polygons to show a corridor (for a new powerline) gaps and overlaps then appear when I run topology. I have 'enable topological editing' crossed and snapping on and avoid intersection. Each time I try to cut the polygons new gaps and overlaps appear in different places.


texts: Raster Calculator in the Graphical Modeler of QGIS 2.18

texts:
How to convert this expression from raster calculator

("noise_heatmap_clip@1" <= 50) * 5 +
("noise_heatmap_clip@1" > 50 AND "noise_heatmap_clip@1" <= 100) * 4 +
("noise_heatmap_clip@1" > 100 AND "noise_heatmap_clip@1" <= 150) * 3 +
("noise_heatmap_clip@1" > 150 AND "noise_heatmap_clip@1" <= 200) * 2 +
("noise_heatmap_clip@1" > 200) * 1

in Graphical Modeler for QGIS 2.18 ?


texts:
I need to "translate" raster information to a set of polygons.
The raster to polygon tool will not work.
I created a fishnet with the same resolution of the raster and converted it to polygons.
I now have a "Grid" of polygons with the same resolution as the raster.
I would like to populate the attribute table with the value of the cells in the raster data

In the images below you will see my "Grid" of polygons and my raster with the "grid" overlay-ed.
Now how do i get the raster values into the attribute table of the polygons?

Any Suggestions?


texts: How to remove empty classes from legend in ArcGIS Desktop?

texts:
I have a classification image with only 12 classes. I'm preparing layout using this image. when I add legend into layout page, a lot of empty classes loaded together with these 12 classes. Totally 255 classes added to layout page. Then I tried to delete them in Symbology tab of data Properties window. How to remove these empty classes from legend.

Is there any way to do this?


texts:
I'm implementing the option to return to the last position with cookies but I don't know how to set the last resolution.

Here part of the code:

if (setPos) {
  var setPos = sessionStorage.getItem('mappos').split(',');
  view.centerOn( [setPos[0], setPos[1]] , map.getSize(), [($(window).innerWidth()/2), ($(window).innerHeight()/2)]);

 view.setResolution(setPos[2]);

} else {
    var tmp = getUserPrefs();
    if (tmp != null) {
      var urlpos = window.location.search.replace( "?", "" );

    if (urlpos.search('defpos') == -1) {
            sDefPos = tmp;
            var setPos = sDefPos.split(',');
        }
  } else {
      var setPos = twSettings.defpos.split(',');
  }
}

view.setResolution() it works but then if I move the zoom the map disappears and I have to delete the browser history to have it back.

There is a way to set the last zoom level and maintain the resolutions array I have in the view and be able to continue exploring the map?


texts:
This statistic report shows the scale after done the MNDWI index process by using software ENVI 5.1.

Normally expect result have to be -1 to +1 scale.

How to get which scale?


texts: Outputting results message from spatial statistics tool to text file using Python?

texts:
I'm using the following tool in ArcGIS 10 - Calculate Distance Band from Neighbor Count (Spatial Statistics). I'm using a python script to execute this tool several times on different shapefiles:

    import arcpy
    arcpy.env.workspace = "c:/data"
    mindist, avgdist, maxdist = arcpy.CalculateDistanceBand_stats("Blocks1", 1, "EUCLIDEAN_DISTANCE")
    mindist, avgdist, maxdist = arcpy.CalculateDistanceBand_stats("Blocks2", 1, "EUCLIDEAN_DISTANCE")
    mindist, avgdist, maxdist = arcpy.CalculateDistanceBand_stats("Blocks3", 1, "EUCLIDEAN_DISTANCE")

At the moment, this outputs the 3 result values to the Results-Messages window in ArcMap 10, overwriting the past results each time. Is there any way I can write these values to a text file after each execution of the tool using python code. If possible I would like to run this on many shapefiles and write the output values to the same text file. If a text file isn't feasible, then anything that can store this information will suffice.


texts:
I am simply trying to ingest a logo of my institution as an ee.Image asset in Google Earth Engine. The original file was a *.jpg. I loaded that into QGIS, and exported it as a *.tif file, applying a EPSG:4326 datum (no projection). In QGIS, I used QGIS > Raster > Translate (Convert Format) to convert the initial *.jpg into a *.tif. However, something must still be wrong as I am unable to ingest this image as a GEE asset. I have failed in multiple attempts to ingest this image, and have been getting the following error messages when the ingest Tasks fail in ~ 40 seconds.

Error messages:
Error: Image extends outside the [-90, 90] latitude range by more than one pixel. Found Bounding box (x=0..1390, y=0..862)

I attach the initial *.jpg for reference.

Initial *.jpg


texts: Dynamic colouring of SVG-icons in OpenLayers 2

texts:
I've got an OpenLayers 2 map with a lot of point features that need to be represented using a number of different SVG-symbols. Unfortunately, the marker  icons need to be displayed in different colours that I read from a config file. However, until now I couldn't figure out how to achieve a dynamic colouring. For a number of reasons, switching to a more recent version of OL is not possible.
Does anyone now, how to colour SVG-Icons in OL 2?


texts: FeatureClassToFeatureClass_conversion taking too long

texts:
I wrote a python script in order to get all features near a point and its distances. To reach that, I'm using LocateFeaturesAlongRoutes_lr, then performing a join with a feature layer and finally using a field mappings object to rename and remove attributes. This last step is done using FeatureClassToFeatureClass_conversion, which accepts field mappings as parameter.

My problem is that FeatureClassToFeatureClass_conversion is taking about 1'20'' to complete, what is too much considering that only a few features remain after the join.

The issue becomes even more weird when I realized that TableToTable_conversion consumes just a few milliseconds.

Can I speed up FeatureClassToFeatureClass_conversion? Or use another method to rename and remove attributes (field info parameters from MakeFeatureLayer_management could just remove fields)?

def renameAttribute(fms, old_name, new_name):
    index = fms.findFieldMapIndex(old_name)
    fieldMap = fms.getFieldMap(index)
    output_field = fieldMap.outputField
    output_field.name = new_name
    output_field.aliasName = new_name
    fieldMap.outputField = output_field
    fms.replaceFieldMap(index, fieldMap)

points_fc = arcpy.GetParameterAsText(0)
radius = arcpy.GetParameterAsText(1)
lines_grf_fl = arcpy.GetParameterAsText(2)
view_lines = arcpy.GetParameterAsText(3)

distance_table = arcpy.LocateFeaturesAlongRoutes_lr(points_fc, lines_grf_fl, 'ID_LOGRADOURO', radius, 'in_memory\\distance_table', 'ID_LOGRADOURO POINT MEASURE', route_locations='ALL').getOutput(0)
distance_table_view = arcpy.MakeTableView_management(distance_table, 'distance_table_view').getOutput(0)
arcpy.AddJoin_management(view_lines, 'ID_LOGRADOURO_24', distance_table_view, 'ID_LOGRADOURO', 'KEEP_COMMON')
distance_fl = arcpy.MakeFeatureLayer_management(view_lines, 'distance_fl') .getOutput(0)
fms = arcpy.FieldMappings()
fms.addTable(distance_fl)
fieldMapsToRemove = \
    ['CODIGO_MUNICIPIO', \
    'NOME_MUNICIPIO', \
    'ABREV_PREFIXO', \
    'DESC_PREFIXO', \
    'ABREV_TIPO', \
    'DESC_TIPO', \
    'DESC_PREPOSICAO', \
    'ABREV_TITULO', \
    'DESC_TITULO', \
    'NOME', \
    'ID_LOGRADOURO_INICIO', \
    'ID_LOGRADOURO_FIM', \
    'HISTORIA', \
    'STATUS_CANCELAMENTO', \
    'FAIXA_VISIVEL', \
    'BAIRROS', \
    'tabela_distancias_ID_LOGRADOURO', \
    'tabela_distancias_ObjectId']
for name in fieldMapsToRemove:
    index = fms.findFieldMapIndex(name)
    fms.removeFieldMap(index)

renameAttribute(fms, 'ID_LOGRADOURO_24', 'ID_LOGRADOURO_GEO')
renameAttribute(fms, 'ID_LOGRADOURO', 'ID_LOGRADOURO_ALFA')
renameAttribute(fms, 'tabela_distancias_Distance', 'DISTANCIA')
renameAttribute(fms, 'tabela_distancias_MEASURE', 'MEASURE')
renameAttribute(fms, 'CODIGO', 'CODIGO_LOGRADOURO')
renameAttribute(fms, 'NOME_COMPLETO', 'NOME_COMPLETO_LOGRADOURO')
renameAttribute(fms, 'SHAPE_LEN', 'COMPRIMENTO_LOGRADOURO')

results = arcpy.FeatureClassToFeatureClass_conversion(distance_fl, 'in_memory', 'results', field_mapping=fms).getOutput(0)
arcpy.SetParameter(4, results)

[EDIT 1]

I modified the script to use CopyFeatures_management instead of FeatureClassToFeatureClass_conversion but the it is taking a long time to finish yet.


texts: Automatically add vertex to polygon where vertex of another polygon touches it?

texts:
The polygons that I use in ArcMap 10.2 are drawn so that they snap to each other, but never overlap. I've described a general case in the following image:

A polygon is defined by the minimum vertices. Both green and pink polygons are constructed of 4 vertices. When drawn snapping is used.

My problem is that I am now required to add a new vertex were the vertex of one polygon meets the line of the other polygon. As seen in the lower part of the image, the green polygon is required to have a 5th vertex were the vertex of the pink polygon touched it. Similarly the pink polygon will also have a 5th vertex added.

To automate this process I thought of selecting each polygon and running the Clip command. This will add the needed vertex on the other polygon. But there are too many polygons to work with; are there other ways of achieving the same result?

Something like:

Detect polygons that touch.
Check if where the vertex of the pink polygon touched the line of the other polygon the green polygon has the needed vertex. If not, return the id or write something in a column.


texts: Count pixels inside a polygon with Google Earth Engine

texts:
i'm pretty new on GEE, so i hope someone can help me with this. As the title say, i'm looking for a way to calculate how many pixels i have inside a polygon. I tried to do it with reduceRegion and ee.Reducer.count() but this always give me error trying to do it with my collection.
I also tried to do it with ui.Chart.image.series using the same reducer. The result is a graph showing a constant number, which represent the number of pixels on the polygon, but it looks like most of the times is wrong because i checked the number of pixels manually, and both numbers doesn't match.
Here's the code. It's used to calculate the annual NDVI of a certain region, which is selected by the geometry (which is drawn with the map menu). Originally i used it to calculate the mean annual NDVI of the region (that's why i select the NDVI on the second line) changing the Reducer.count by Reducer.mean, but now i want to use it to know how many pixels are inside that polygon:
var dataset = ee.ImageCollection('MODIS/006/MOD13A1').filterDate('2019-1-1', '2019-12-31');
var ndvi = dataset.select('NDVI');

var chart = ui.Chart.image.series(ndvi, geometry,  ee.Reducer.count(), 500, 'system:time_start').setOptions({
      title: 'Annual NDVI',
      vAxis: {title: 'NDVI'},
});

print(chart);

On the other hand, i tried to use this, but it gives error, saying that "dataset.reduceRegion is not a function":
var c = dataset.reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: geometry,
  scale: 500,
});
print(c);


texts:
I am in the middle of trying to create my first PostGiS database and seem to be running into problems developing scripts to automate importing the various spatial formats so I can use them in my analysis.  I am writing today trying to develop a way to batch import shape files into separate tables.  From my research, it looks like i need to have empty tables created before i can batch shp2pgsql command from postgis.  In an effort to make this question tractable and leave some learning for myself, I am trying to create empty tables in my database using the structure from a table named test in my PostgreSQL database from a unix shell.  Here is script I have been developing:

#!/bin/sh

for FILE in c:/workspace/CM/mb_sed_class/output2/*.shp
do

   echo $FILE
   filename="${FILE##*/}"
   nakedname="${filename%.shp}"
   (cd C:/Program\ Files/PostgreSQL/9.4/bin; psql -h localhost -d mb_sed_class -U postgres -v name='&nakedname' -c "CREATE TABLE name AS SELECT * FROM test WHERE 1=2;")

done

This script creates a table named 'name' and isn't passing the variable into the sql statement.  Any ideas  on how to pass a variable from the shell to a sql statement?


texts: Populating label x and y columns to manually move labels

texts:
I'm trying to manually move labels in qgis.

I've added the two extra columns to the attribute data, X and Y, bothh decimal numer (real).

When I load the layer with the labels on, through the rendering button and selecting all labels to show, these all appear on the screen.

However, when I move down to the data defined placement, I select the X and Y.  Then press apply, and all the labels disappear off the map.  Though the move label button does appear at the top of the screen, but there are no labels to move?


texts: When will QGIS be available on Yosemite ?

texts:
Does anyone know when QGIS will be available on later Versions of Mac OS?

I am on Yosemite and prefer not to go back to Mavericks.

Also, for various reasons I am unable to partition my hard disk and install an older OS version (or Windows).


texts: Calculating centroid for polygon layer with several features?

texts: I need only 1 centroid point for the whole layer (more than one polygon) instead of 1 centroid point per feature that you get with the menu -> Vector -> Geometry tools -> polygon centroid tool. Its position doesn't have to be based on area or weight of any kind.


texts: Join.Field_management extremely slow in arcpy stand-alone script

texts:
I have an arcpy script that joins two tables together based on the FID field. This slows down my script considerably. The joining process takes several tens of minutes.

import arcpy
import os
from arcpy.sa import *
arcpy.JoinField_management("Selection_median_direction.shp", "FID", "Selection_median_length.shp", "FID", "length;Median_len")

I've found this tool which takes input from geodatabases (I have shapefiles): ArcGIS Online Tool.
I can't get it to run as an arcpy stand-alone script. Is there another approach to fasten up the join field step? I am running several tasks such as e.g. the clip, erase and intersect tools and the join field command is only a part of my final script which takes up most of the processing time. This is why I was wondering if anyone has a faster solution for standalone arcpy scripts to speed up this process?


texts: Digitizing custom road for ArcGIS Network Analyst?

texts:
I've built my network and now I am creating custom bus routes. However, one of my bus routes makes a stop on a private road that I had not realized was included in my network.

How should I go about adding this private road into my network?

I created my network from a geodatabase, created the feature dataset and then imported two cities road shapefiles as feature classes into my dataset.

Is digitizing my original shapefile my next route or is there an easier way?


texts: Get Coordinates of Voronoi Polygon Vertices

texts: Is there any chance to get the exact coordinatas of the voronoi polygons? I am using Qgis software and I have the "center" (redpoint) of the polygons and I would like to export the polygons corners coordinates.


texts: Cannot get plot() in geopandas to produce a map of the GeoDataFrame

texts:
I have installed all the necessary and optional modules for geopandas (with the exception of rtree) as listed at http://geopandas.org/install.html

I am following the tutorials from this site and also from a couple of other bloggers such as https://borealperspectives.wordpress.com/2016/03/07/plotting-polygon-shapefiles-on-a-matplotlib-basemap-with-geopandas-shapely-and-descartes/

Here they simply use .plot() to produce a map. However when I follow I get

>>> world.plot()
<matplotlib.axes._subplots.AxesSubplot object at 0x0BB0F910>

No window with a map pops up. Here's the code snippet that should work.

>>> import geopandas as gpd
>>> world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
>>> world.plot()
<matplotlib.axes._subplots.AxesSubplot object at 0x0BB0F910>

List of versions:

Python 2.7.13 on Windows 7 Professional
geopandas 0.2.1
numpy 1.11.3
pandas 0.19.2
shapely 1.5.17
fiona 1.7.1
six 1.10.0
pyproj 1.9.5.1
geopy 1.11.0
psycopg2 2.6.2 (dt dec pq3 ext)
matplotlib 1.5.3
descartes 1.0.2

Any suggestions?


texts: Compensating lat/long offsets after conversions

texts:
In my application I am doing conversions between two different formats of data.
First format is a simple one containing NE and SW coordinates for a given rectangular area:

area = {
    "sw": {
        "lat": -1234.5678,
        "lng": -8765.4321
    },
    "ne": {
        "lat": 1234.5678,
        "lng": 8765.4321

    }
}

The second format needs to be  ETSI EN 302 931 V1.1.1 compliant, which, instead of SW/NE pairs, has a center coordinate pair and the distances to the rectangle's long and short sides. To convert, I measure the distances to the long/short sides using the haversine formula

var R = 6371; // km
var φ1 = lat1.toRadians();
var φ2 = lat2.toRadians();
var Δφ = (lat2-lat1).toRadians();
var Δλ = (lon2-lon1).toRadians();

var a = Math.sin(Δφ/2) * Math.sin(Δφ/2) +
    Math.cos(φ1) * Math.cos(φ2) *
    Math.sin(Δλ/2) * Math.sin(Δλ/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));

var d = R * c;

and find the center using simple mid-point calculations:

var centerLat = (this.ne.lat + this.sw.lat) / 2;
var centerLng = (this.ne.lng + this.sw.lng) / 2;

When converting the ETSI compliant object back to the simple format I'm using this formula to calculate coordinates after moving a distance(to long/short) in a certain direction in order to recreate the SW/NE pairs. The problem is that the resultant coordinate pairs are slightly off from the original ones with offsets up to 1000s (e.g. 0.00667).

My question is if there is any way to compensate or remove the errors. Also any methodology or formula suggestions are welcome.


texts: Best Platform to develop QGIS Python Plugins

texts:
I am currently developing QGIS Python Plugins in a Windows 7 64-bit environment.

Having said this I am stumbling across various issues which from what I have been able to gather have a less tendency of happening in the other platforms (i.e. Linux and OSX Mac).

I would like to ask the community to answer the following question:

What is the best platform to develop QGIS Python Plugins?

Thanks


texts: How to auto-generate multiple maps with different features in QGIS?

texts:
Anyone can explain me how can i auto-generate multiple maps with different variablies using Atlas tool in QGIS?
So i have only 1 layer which consists of 10+ features, and i want select some of that features to auto-generate different maps, with different ranges too for each one (e.g 0-100 ; 100 - 500 ; 500 - 1000).

At moment im just be able to do one by one, but anyone know how to generate in one step?


texts: Width and Height of GetFeatureInfoUrl request with Openlayers 4.x and Geoserver

texts:
When I make a getGetFeatureInfoUrl request with OpenLayers 4.x, Geoserver 2.10.1 and WMS 1.3.0 with the code below, the width and height returned default to 256.

var url = lyr.getSource().getGetFeatureInfoUrl(
evt.coordinate, viewResolution, viewProjection,
{'INFO_FORMAT': 'text/html', 'FEATURE_COUNT': 50, 'WIDTH': 500,
'HEIGHT':500});

If I set the popup I display it in to dynamically resize, it too is always 256x256, leaving empty space if there are only a few fields or long scroll bars if there is a lot of data.

Am I setting the params wrong?  Do I have to change the html formatting with a .flt file in the Geoserver templates directory?  Ideally, I'd like to know the actual width and height or not pass them at all.


texts: How to import geopackage(. gpkg) files to GeoServer PostGIS datastore by Axios?

texts:
I am going to upload some GeoPackages files to my PostGIS datastore in GeoServer 2.18.1, I did learn this work is avaliable through curl as Ian Turan answered here I can upload my gpkg files via curl like this:
curl -v -u admin:@dmin9901 -XPUT -H "Content-type: application/zip" --data-binary @woods2.zip "http://localhost:8080/geoserver/rest/workspaces/b0BcSYZnQb2Tf1EcqL2zC7ePe5DeS4QDk15bFeZsEk6UZ2prHC/datastores/b0BcSYZnQb2Tf1EcqL2zC7ePe5DeS4QDk15bFeZsEk6UZ2prHC/file.gpkg"
it will be successful, However when I want upload my GeoPackages files by axios.put method I will get
 status: 202,
  statusText: 'Accepted',
  headers: {
    connection: 'close',
    'x-frame-options': 'SAMEORIGIN',
    server: 'Jetty(9.4.18.v20190429)'
  },
  config: {
    url: 'http://localhost:8080/geoserver/rest/workspaces/U0BcV4Fcxeh4Zypgz80IQmj9JcLtKzDccFpWt76Oaqdqr7d1Uo/datastores/U0BcV4Fcxeh4Zypgz80IQmj9JcLtKzDccFpWt76Oaqdqr7d1Uo/file.gpkg',
    method: 'put',
    data: FormData {
      _overheadLength: 0,
      _valueLength: 0,
      _valuesToMeasure: [],

this is my axios code also:
axios.put(`http://localhost:8080/geoserver/rest/workspaces/${storeName}/datastores/${storeName}/file.gpkg`,
                            formData,

                            {
                                maxBodyLength: Infinity,

                                maxBodyLength: Infinity,

                                headers: formData.getHeaders(),
                                auth: {
                                    username: 'admin',
                                    password: '@dmin9901',

                                },

                            }

                        ).then(function(response) {
                            console.log(response)
                         }).catch(function(error) {
                            console.log(error);
                        }).finally(function() {
                            // always executed
                        });

full log is here response returned by axios put method
Although I got status: 202,statusText: 'Accepted', my datastore is empty!,
I'll know how I can upload my geopackages via axios to my GeoServer PostGIS datastore?
I read GeoServer importer extension documents, But I didn't find any method demonstrate how user can upload GeoPackages files through GeoServer Importer REST API
This is my GeoServer Log


texts: How do I create a polygon with an ArcGIS 10.1 python addin

texts:
I'm looking for some code samples, or help with code to get me started.   I've built a python addin menu which I would like to use to create polygon features in a specific layer in my edit session.

So for example I would click 30x60 and a 30m x 60m rectangular polygon would be placed where I click.
I can't seem to find much on creating geometry within a python addin.
Thanks in advance for any comments or suggestions.
Frank


texts: Converting the level.dat file from Minecraft to a map

texts:
Minecraft backups are saved to a local folder on your computer.

C:\Users\USERNAME\AppData\Roaming.minecraft\saves

How can such a file be utilized from FME? Turning it into a map will require a rule set where one decides if the map/visualization should be done using the surface of the model, a cross section or a selection of features. What tools could be used.

Which transformers could be used?


texts: Weird output from hillshade tool in ArcGIS

texts:
I am quite new to working with ArcGIS 10.7.

I have a .grd Raster which I interpolated from some data in Surfer (see first picture below). Cell Size is 1m, it is projected in DHDN_3_Degree_Gauss_Zone_4, with linear units in meter. In the Layer Properties in ArcGIS it says under Format: GS7BG (I don't know what that is) but I exported it as a .grd raster from Surfer.

When I want to make a hillshade from it, I get a weird output raster (see second image below). How can I get a real hillshade?
I already tried to export the raster as a .asc and .dem file but got the same bad hillshade results.