texts: Python plugin development. how implement merge functionality in a window

texts:
I want to create a plugin and in a window I need to make the same functionality as the toolbar advance digitize (merge, split features ...).

Is there any possibility of calling the functions already implemented in QGIS (merge, split features ...) without having to create them from scratch?

If so, I seek documentation.


texts:
I need to import a complex polygon shape file into AutoCAD (AutoCAD map 3D 2015).
I can import using Mapimport command, I can use the shp attributes to split into different drawing layers etc.
What I am having problems with is that all the shared boundaries are creating duplicate lines in the drawing. The reason I am importing into CAD is to create topologies and for this there must be a single line between adjacent polygons,, not 2 shared lines on top of each other. Is there any way to prevent the duplicate lines during import or is there a way to get rid of it after import. I imported polygons as closed polylines.


texts: Does anyone use TRS (Township, Range, Section) data?

texts:
I recently had a request for TRS/PLSS data and I didn't know anything about it.  I have researched it and it looks like it is purely mathematical (for the most part) based on geo-coordinates but I'm wondering if anyone would actually benefit from this information.

For example, in our address verification service, we could provide the TRS data as well as the lat/lon data for each address.

Im wondering what industries actually use the TRS/PLSS data scheme.


texts:
I recently uploaded to AGOL a feature service layer with a relationship table (many to many). While configuring the layer, I found out that for some reason the table counts more records than what really exists. Selection of the records does correspond to the actual number of features.

Has anybody encountered something like this?


texts:
Suppose a polygon layer in QGIS with differently shaped polygons (no multi-geometries, let's keep it simple). Is there a way to calculate some kind of roundness characteristic of the individual polygons. I imagine a value of 1 would be a perfect circle and 0.01 would be some kind of lengthily stretched out polygon (and the edge case, 0 would be a line). In the Field Calculator, it would probably look something like this:
 exterior_ring( geom ) / $area

but I don't know what to put in geom to get a useful number. Of course, if there is a more elegant solution to get some kind of measure of shape, I am open for suggestions.
I need this to get rid of really thin polygons after a clip operation. I put that in bold, because I just noticed that's a really useful information!
I'd need a solution I can use in Field Calculator or with some plugin.


texts: Snapshot command not producing high-res image

texts:
I'm trying to export an image of my project with a size of several hundred megapixels (32768x16384) via the snapshot command and all I get is an output file with 0 KB and no error message. I can export 16384x8192 just fine, but apparently 32768x16384 is too much.

I have 8 GB RAM but according to perfmon.exe QGIS doesn't even use half that when attempting to export the image. A 32768x16384x24 bitmap is still only 1.5 GB in size anyway.

Trying to narrow down the issue I also noticed that there is some other weird stuff going on when exporting images with very large dimensions. I exported the same narrow horizontal strip of a world map both in 16834x1024 and in 65536x4096, and in the larger image everything east of the prime meridian is just missing:

16834x1024
65536x4096

The images above use the global GADM database with a Miller projection (EPSG:53003).

Possibly related to this is a similar issue I have where all raster images (e.g. from Natural Earth) are cut off east of Okinawa. This happens regardless of resolution, but only with some projections. For example, it happens with EPSG:53003 (Sphere_Miller_Cylindrical), EPSG:54003 (World_Miller_Cylindrical), EPSG:54004 (World_Mercator) and EPSG:3395 (WGS 84 / World Mercator) but not with EPSG:4326 (WGS 84).

Edit: I still have these issues with QGIS 2.14.3 Essen and now 24GB RAM; can someone please try to reproduce them on 64-bit Win 7?


texts: Which WMS is easiest to work with when using QGIS?

texts:
I'm using QGIS to style shapefiles.

Currently I'm running GeoServer but not all the QGIS styles are imported to GeoServer (although its really easy to maintain it because of the layer preview and the integrated tile cache)

What is your recommendation for free WMS that is easy to integrate with QGIS shapefiles (and caching tiles - working with different kinds of projection)?


texts:
I have the following situation: i display points and point informations in popups. the points are added to a layer. The popups are added to the map, with map.addPopup function. It works great.
The problem is that i want to control the visibility of the popups. For example, if i should be able to add the popups to a layer, then i should be able to hide/show that layer with LayerSwitcher (OpenLayers.Control.LayerSwitcher). But i haven't found any example when somebody adds a popup to a layer. Every example uses the map.addPopup function. Any idea?


texts: GRASS unable to download any extension from GRASS Addons

texts:
I'm trying to install some add-ons to GRASS, but each time I try to download an addon, I'm getting the same error:

g.extension.py extension=v.autokrige svnurl=http://svn.osgeo.org/grass/grass-addons/grass6
Downloading precompiled GRASS Addons <v.autokrige>...
ERROR: GRASS Addons <v.autokrige> not found
(Fri Feb 05 11:29:55 2016) Command finished (1 sec)

Anyone can help me ?


texts:
UPDATE trajectory_maritimes a SET id_traj_day= (SELECT CONCAT( imo_ship_no,
'-',EXTRACT(doy FROM arr_date_ts), '-', EXTRACT (year FROM arr_date_ts) )
FROM trajectory_maritimes b WHERE a.gid=b.gid);

I got this message:
ERROR:  more than one row returned by a subquery used as an expression
SQL state: 21000

What is wrong here?


texts: Recommended Eclipse Plugins for development with OpenLayers and GeoExt?

texts:
we plan to create an map oriented online application and muse about the 'best' / helpful plugins for Eclipse.
The used technology is OpenLayers and GeoExt.

For example is the Javascript development tools (JSDT) helpful?
Or - are there any other tools, not necessarily Eclipse plugins, which help during development?

Can you share your experiences?

D3


texts: Exporting shapefile layer to KML and CRS specification in QGIS

texts:
I've been trying to learn the ins and outs of QGIS for several years now. I am somewhat familiar with the software but certainly not an expert.

I have recently downloaded a section of the Canadian Dominion Land Survey from the province of Manitoba. For example, this file:
http://mli2.gov.mb.ca/quarter_sec/shp_zip_files/reynolds_shp.zip

I can import a layer (for example: sec_line_line.shp) and it asks me to specify the CRS. the one that is selected by default is WGS 84 - EPSG:4326. If I use this CRS I can export the new layer as a KML file. But when I import the KML file into google earth I see lines all over the globe.

I then try adding the OpenLayers Google Maps satellite raster and it complains that "Error: latitude or longitude exceeded limits". I assume this is because google maps rasters want to be in EPSG:3857. So I change the CRS of the project to EPSG:3857, select on-the-fly CRS transformation and add the OpenLayers map source. The map source loads fine, but now I can't see the original DLS data I loaded before (sec_line_line.shp)

I don't understand why this is, or what I can do to fix the issue.

I'm using QGIS 2.18 on Ubuntu 16.4 (Ubuntu 14.4 also does the same thing)


texts:
I am new to QGIS and using version 3.0. I have written below code to join population data with Building Layer. I am using Python Console within QGIS.
I didn't get any error but the target files doesn't show update on fields.
I need to join FID_1 field of CSV file with FID field in shapefile.

vectorLyr=QgsVectorLayer("C:/Test/demand/Demand.shp", "BuildingLayer", "ogr")
vectorLyr.isValid()
uri='file:///C:/Test/data.csv?delimiter=,'
infoLyr=QgsVectorLayer(uri,'Population', 'delimitedtext')
infoLyr.isValid()
QgsProject.instance().addMapLayer(vectorLyr)
QgsProject.instance().addMapLayer(infoLyr)
info=QgsVectorLayerJoinInfo()
info.joinLayerId=infoLyr.id()
info.joinFieldName="FID_1"
info.targetFieldName="FID"
info.memoryCache=True
vectorLyr.addJoin(info)

QgsVectorFileWriter.writeAsVectorFormat(vectorLyr,"C:/Test/joinedata.shp", "CP1250", vectorLyr.crs(), "ESRI ShapeFile")
joinedabcLyr=QgsVectorLayer("C:/Test/joinedata.shp", "joinedata", "ogr")
joinedabcLyr.isValid()
vectorLyr.dataProvider().fields().count()
joinedabcLyr.dataProvider().fields().count()

There are 10 fields in shapefile and 4 in the CSV, but even after joining Target Object shows 10 fields instead of 14 fields.


texts: Function to count pixels within polygons with a given attribute in Google Earth Engine

texts:
I am working with the Hansen Global Forest Change loss year layer. This raster tells us the year a 30m pixel transitioned to zero forest cover (2000-2014), if relevant (otherwise zero).
I am producing zonal statistics over tiles and am trying to get the within-tile count of pixels that transitioned in 2001, 2002, 2003, ...2014. These counts must be stored as separate properties (ex: count_2001 = x, count_2002=y.
I can execute this over my tiles year-by-year using a remap function and then counting the non-NA values using a reducer function. For example, for 2001:

var gfcLoss2001 = gfcLossYearMasked
.remap([1], [1], null);

//Need to change band name so future bands do not overwrite each other
var gfcLoss2001Clean = gfcLoss2001.select(
  ['remapped'], ['loss2001']);

var loss2001 = tiles.map(function(feature) {
  return feature.set(gfcLoss2001Clean.reduceRegion({
    reducer: 'count',
    geometry: feature.geometry(),
    scale: 100,
  }));
});

I am trying to transform this into a function that I can feed a vector of dates [2001, 2002, ...] and corresponding reference numbers [1, 2, 3] (where 1=2001 in the raster) that can execute this code over the 13 years. The main challenge I encounter is with variable naming. We need to give the generated properties (counts) unique names, but I don't know how to incorporate this into GEE.
If you have alternative strategies for producing these zonal stats, please let me know as well.


texts: Calculating multicollinearity from predictor variable in logistic regression process in terrset

texts: I am using Terrset to find which factors are lead to built land development. There are some factors that I input in the logistic regression process in Terrset, but after finishing the process and got the logistic regression equation, I can't find how to calculate/check multicollinearity between factors/variables. Is it possible to check multicollinearity in Terrset, if possible how to find it?


texts: Releasing locks to temp files after ArcPy script crashes in ArcMap?

texts:
Sometimes when I'm testing an ArcPy script and it ends with exception, ArcMap is still holding locks to some temp files (I run my scripts through ArcMap).

I cannot run the script any more, because it cannot delete/overwrite the temp files and in the end I have to restart ArcMap to release the locks.

Is there a way to do in a more clever fashion?


texts: Getting index of active data frame in ArcPy?

texts:
I am a little surprised to see that there seems to be no way to get the index of the active data frame in ArcPy, or did I miss something?

For example, what if you want to add a tool’s output to the active data frame? Here is the workflow I came up with to solve the problem:

Reference the MXD
Get the data frames
Get the name of the active data frame
Loop through all of the data frames, and check if the current one matches the name, if so, add the dataset

And here is the code:

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd,"*")
activeDfName = mxd.activeDataFrame.name

i = 0
for d in df:
    if d.name == activeDfName:
        finalDf = arcpy.mapping.ListDataFrames(mxd,"*")[i]
        newlayer = arcpy.mapping.Layer(addlayer)
        arcpy.mapping.AddLayer(finalDf, newlayer,"BOTTOM")
    else:
        i +=1

Although this works fine I feel like this is way too much code to do such a simple thing. Is there really no out of the box way to get the index of the active data frame, or can anyone suggest other ideas, perhaps more compact, how to approach this?

PS: parts of my question can be found here, but I think that my question is more clearly about whether this is possible at all, and it asks for alternatives, as it is always interesting to see what others come up with.


texts: Setting Up Python Script tool ( ESRI arcpy ) to download files from table

texts:
It's been years since I have worked with ArcPy and I'm having trouble setting up the parameters in my script tool.

What I'm trying to do:

I have a layer file (.lyr) that is a state wide index grid of available elevation model tiles.  The layer's attribute table has a field "URL" that contains the download link.  In my map document, I want to be able to make a selection of records in the layer and download the elevation model image tiles in my selected project area.

Here's the layer file. And the data table at the bottom:

What works:

I can run the script tool successfully but it's downloading all 15,000 files in the table not just my selected records.

this is the .py behind my script tool:

`

import urllib

import os

import arcpy

#where am I saving the download?
path = (str(arcpy.GetParameterAsText(1)))
os.chdir(path)

#path to my index layer...stil unsure how to get this as a dropdown menu item in my tool
fc= r"C:\Users\Z\Desktop\LiDAR_Index.lyr"
cursor = arcpy.SearchCursor(fc)

for row in cursor:
    field ="URL"
    link =(row.getValue(field))
    head, tail = os.path.split(str(link))
    print "Downloading: "+ tail
    download=urllib.urlretrieve((str(link)), tail)

`

I'm lost as to how to only make this act on the selected records and not the whole feature class or shapefile.

Current UI on left and tool properties on right:


texts:
I have a Python filter to handle a few endpoints to do some configuration and calculation. For that I use the HTTP-GET method. Now, I want to use HTTP-POST to send some data to the Python filter.

Here is my example Request:

curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:8081/cgi-bin/qgis_mapserv.fcgi?SERVICE=POST_TEST

In the QGIS log file I can clearly see that the request is getting handled somehow:

[1303][12:28:26] REMOTE_ADDR: 172.23.0.1
[1303][12:28:26] CONTENT_TYPE: application/json
[1303][12:28:26] HTTP_USER_AGENT: curl/7.47.0
[1303][12:28:26] QgsPostRequestHandler::parseInput
[1303][12:28:26] QgsHttpRequestHandler::readPostBody
[1303][12:28:26] length is: 35
[1303][12:28:26] {"username":"xyz","password":"xyz"}
[1303][12:28:26] inserting pair SERVICE // POST_TEST into the parameter map
[1303][12:28:26] Error at line 1, column 1: error occurred while parsing element.

But it is not possible to access the parsed information. I tried it with the same code-snipped which I use to retrieve information from a HTTP-GET Request:

request = self.serverInterface().requestHandler()
params = request.parameterMap()
service = params.get('SERVICE', '')
body = request.body()

Well, I think that there are simple no bindings for Python to handle a HTTP-POST Request?

Version:

Apache/2.4.10
load library /usr/lib/qgispython (2.18.4)


texts:
I have drawn a vector circle with "Add circle from 2 points".

How do I remove a segment of this circle? In essence, I want to edit a circle and convert it into an arc.


texts: MapServer on Windows Server 2019 from MS4W

texts: I have installed MapServer from MS4W on a Windows Server 2019 machine on port 8081 but it won't find the home page http://127.0.0.1:8081/ for some reason.  8081 is not in conflict and has been opened both directions in the firewall too.  Please help.


texts: Different Icon per feature with Leaflet Ajax

texts:
How can I have a circle marker or one of a selection of icons depending on a feature's properties using LeafletAjax?

https://github.com/calvinmetcalf/leaflet-ajax

function pointToLayer(feature, latlng){
  console.log(feature.properties.shape);
}

var features = new L.GeoJSON.AJAX("/features.json?circuit=555",{
    pointToLayer: pointToLayer,

    onEachFeature:onEachFeature,

    style: function (feature) {
      return feature.properties && feature.properties.style;
    },
});

I've started to try to build this, but Point to layer is only called once.  The console log shows just the first feature's shape.

I have also tried to add the code to the onEachFeature function:

function onEachFeature(feature,layer){
    if (feature.properties.shape == 'point'){
    feature.marker =  L.circleMarker(latlng, {
      weight: 1,
      opacity: 1,
      fillOpacity: 0.8
    });
  }else if(feature.properties.shape == 'tree'){
    feature.marker =  L.marker(latlng, {icon: treeIcon});
  }

  if (feature.properties){
      layer.bindPopup(feature.properties['popup_content']);
  }
}

Which doesn't work - I have made up the "feature.marker =" bit.

How do I set the marker?


texts: Creating an in memory rasterio Dataset from numpy array

texts:
I am reading in a raster using rasterio, and then upsampling the raster as per the example in the documentation:

def upsample_raster(raster):
    return raster.read(
        out_shape=(raster.height * 2, raster.width * 2, raster.count),
        resampling=resampling.bilinear,
    )

This seems to work fine, except that this method returns the data in a numpy array.

My current application workflow includes operations such as masking which takes as input rasterio's DatasetReader class.

Thus, I am searching for a way to resample a raster and get the result as a DatasetReader or, without dumping the data to disk and re-opening the file, convert a numpy array into a valid DatasetReader.


texts: Check if a Polygon Feature is completely enclosed by another GeoJSON features in OpenLayers 4

texts:
I have a map which is implemented using Openlayers 4. It loads a GeoJSON vector which defines the boundaries of a particular country. The user is allowed to draw and edit polygons to define subregions of this countries which will be saved to DB as GeoJSON data. I need to check if the polygon drawn by the user is completly within the boundaries of the country. How can i achieve this. I am adding the code snippet where i capture the subregion layer polygon drawn by the user here.

feature.on('change', function(event) {
          var format = new ol.format.GeoJSON({featureProjection: 'EPSG:3857'});

          var subregion_features = format.writeFeatures(vector.getSource().getFeatures());

          //code to check if the newly drawn polygon is inside the master layer (whole country layer)

        });


texts: Starting out in QGIS with CSV containing country names and attributes

texts:
I would appreciate a pointer on how to start learning QGIS in order to satisfy this particular use case. I've looked through some tutorials, but I haven't found anything yet that describes what I'm trying to do.

I have a CSV with a column for country names and other columns for attribute variables about the countries. The variables are categories. Let's say one column is diabetes rate. The levels of the category in this case might be:

1 = 0 to 0.24
2 = 0.25 to 0.49
3 = 0.50 to 0.74
4 = 0.75 to 1.00

I want to make a world map with each country color-coded to one of the 4 levels. I think that's called a chloropleth map.

I think I need to start out with a shapefile that has the world geometry in it. I looked at some examples, and it appears I can use those as starter kits. Is that correct?

My data file with the country attributes has no coordinates, just country names. When I try adding that CSV to my QGIS project, QGIS wants me to indicate the columns in my file that contain the X and Y coordinates. The file isn't structured like that. It just has the name of the country.

I trust there is a way to map the country names I have to the location structure in whatever shapefile I'm using. Is that the workflow?

I know what I need to do is just learn how to use this program. I'm hoping someone can tell me how correctly to describe the task I'm attempting so I can find an appropriate tutorial that focuses on this explicit mapping objective.


texts:
This works:
http://mrdata.usgs.gov/services/sc?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=256&HEIGHT=256&FORMAT=image/png&BBOX=-83.4,32,-78.4,35.3&LAYERS=South_Carolina_Lithology&SRS=EPSG:4326&STYLES=

This does not (blank image):
http://mrdata.usgs.gov/services/sc?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&WIDTH=256&HEIGHT=256&FORMAT=image/png&BBOX=-83.4,32,-78.4,35.3&LAYERS=South_Carolina_Lithology&CRS=EPSG:4326&STYLES=

Notice the 1.1.1 -> 1.3.0 and SRS->CRS are the only changes.  Is this a problem with the service or is my second URL incorrect?

I've observed the same issue with other WMS services:

Works:
http://mesonet.agron.iastate.edu/cgi-bin/mapserv/mapserv?map=/mesonet/www/apps/iemwebsite/data/wms/goes/conus_ir.map&SERVICE=WMS&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=256&HEIGHT=256&FORMAT=image/png&TRANSPARENT=TRUE&BBOX=-126,24,-66,50&LAYERS=conus_ir_4km_900913,conus_ir_4km&SRS=EPSG:4326&STYLES=

Does not work (blank image):
http://mesonet.agron.iastate.edu/cgi-bin/mapserv/mapserv?map=/mesonet/www/apps/iemwebsite/data/wms/goes/conus_ir.map&SERVICE=WMS&REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&WIDTH=256&HEIGHT=256&FORMAT=image/png&TRANSPARENT=TRUE&BBOX=-126,24,-66,50&LAYERS=conus_ir_4km_900913,conus_ir_4km&CRS=EPSG:4326&STYLES=

So I'm assuming it's an issue with my 1.3.0 URLs.


texts: Most efficient way of passing values from OGRGeometry to ModelField in geodjango

texts:
I am writing a custom parser that maps shapefile data to a geodjango model in a Django 1.6 project. To read the shapefile I use the DataSource object from django.contrib.gis.gdal, which provides access to the shapefile data through OGRGeometry objects.

In my loop I want to map the geometries into my model as follows

dt = DataSource('path/to/my/shapefile')
lyr = dt[0]
for feat in lyr:
    MyModel.objects.create(
        geom = feat.geom.FOO
    )

My question is, what is the most efficient conversion for FOO in that loop?

The feature geometry can be extracted in several ways, for instance

wkt, wkb, hex, etc.


texts: Prevent arcpy.Append from crashing if data is too long for field

texts:
We're appending a bunch of information from somebody else's database into ours. Much of it is text information, and the origin database doesn't appear to have much limit on the length of those strings. Ours was set up largely with default limits of 50 on the text fields.

So naturally it will sometimes fail to import, throwing an error like:

  ExecuteError: ERROR 001156: Failed on input OID 69838, could not write value 'James Island - Subdivision not indicated, no marker' to output field SUBDIVISION
  Failed to execute (Append).

SUBDIVISION can take 50 characters, and ArcPy just tried to push 51 characters, and so it failed and crashed.

Short of increasing the length of all our database's text fields (which seems like it's going to work great until I encounter the next super-long string that exceeds the newly expanded limit), is there an elegant way to handle such cases and still get the data to append? In other words, is there a way to tell the Append function I'd like it to just truncate strings that don't fit (ideally while throwing a message letting me know that happened)?


texts: Spatial query ST_CONTAINS returns empty result

texts:
I want to create a database view in Postgres/PostGIS which returns a subset of the points stored in another table called locations. The subset is defined by an area stored in yet another table called district.

I came up with the following query inspired by this answer:

SELECT l.*
FROM
  public."locations" AS l,
  public."district" AS d
WHERE
  ST_CONTAINS(l.the_geom, d.the_geom);

This query returns an empty result.
I used QGIS to visually check that the district actually contains locations.

It might be that I store the district incorrectly. The data origins from OpenStreetMap. I hope the collection of way objects I exported from OSM is interpreted as a polygon by PostGIS. This is the command I used to import the Shapefiles into PostGIS:

$ ogr2ogr -update -append -f "PostgreSQL" \
  PG:"host=localhost user=username port=5432 \
  dbname=databasename password=password" \
  district.shp -lco GEOMETRY_NAME=the_geom -nln "public.district"

The database table district looks like this:

CREATE TABLE public.district
(
  ogc_fid serial NOT NULL,
  the_geom geometry(LineString,4326),
  name character varying(254),
  cmt character varying(254),
  "desc" character varying(254),
  src character varying(254),
  link1_href character varying(254),
  link1_text character varying(254),
  link1_type character varying(254),
  link2_href character varying(254),
  link2_text character varying(254),
  link2_type character varying(254),
  "number" numeric(10,0),
  type character varying(254),
  CONSTRAINT districts_pkey PRIMARY KEY (ogc_fid)
)

Do I need to SELECT the district table as a POLYGON first?


texts: Can QGIS plot coordinates in Degrees-Minutes format?

texts:
I have a .csv file of coordinates that looks like this:

Is there a way for QGIS to plot coordinates formatted like this?  I've tried Adding a Delimited Text Layer... in QGIS, but do not see any options appropriate for this format:

Nxx.xx.xxx Wxxx.xx.xxx

I am able to use a GPS Coordinate Converter website to convert that data to Decimal Degrees, Degrees, Minutes & Seconds, and UTM.  For example, inputting N39.56.854 W074.28.013 outputs a latitude of 39.947567, and longitude of -74.466883.  However, I would like to stay in QGIS and make the same conversion.

Things I've tried:

Created a new .csv that has formatting that matches the output of coordinate conversion site mentioned above, and with separated lat-long columns:

However, using the QGIS Add Delimited Text Layer... option yields no visualization of the points.


texts: How to divide polyline layer using shared vertex

texts:
I have a polyline layer with 1638 features representing a road network. Each feature is a line segment which may or may not share one or both endpoints (vertices) with an adjacent line segment.

I would like to somehow aggregate these segments where the vertices are coincident, where there are 4 features representing end-to-end polyline where the vertices of each segment touch, these should be aggregated into one feature.

How can I do this within QGIS?

I have tried SinglePart to MultiPart tool but this accomplishes something similar to a general dissolve where the individual LineString features become one big MultiLineString and I only get one record in my attribute table.

Instead, I would like for the LineStrings to get aggregated into yet longer LineStrings where coincident vertices occur. I am also open to python solutions, notably using the qgis library.

EDIT

It turns out that the correct sequence is:

Dissolve
MultiPart to SinglePart

Which also illustrates that there is a difference between Dissolve and SinglePart to MultiPart tools as addressed here. But unfortunately you run into another problem as shown in the following figure:

The line segments coincide at exactly the same point as proven by exportToWkt() method (see this question also)

371119.89580000005662441 4688236.42149999924004078
371119.89580000005662441 4688236.42149999924004078
371119.89580000005662441 4688236.42149999924004078

Yet somehow the algorithm gets "confused" here and isn't sure which lines to connect, (1 and 3, leaving 2 out? 2 and 3, leaving 1 out). The algorithm seems to also separate where more than 2 lines contain the same coordinate.

In my version I would like it to default to the "longest" line, such that 1 and 3 are merged into one feature, leaving 2 out (1 and 3 add up to a greater length than any other combination).

Is there an "enhanced multipart to singlepart tool that can help me accomplish this?


texts: Error while installing GeoPandas using pipenv "proj executable not found"

texts:
I tried to install GeoPandas using the following command:

pipenv install geopandas

But I had an error:
Installing geopandas…
Error:  An error occurred while installing geopandas!
Error text: Collecting geopandas
Using cached geopandas-0.9.0-py2.py3-none-any.whl (994 kB)
Collecting pyproj>=2.2.0
Using cached pyproj-3.0.1.tar.gz (168 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'

ERROR: Command errored out with exit status 1:
 command: 'C:\Users\mm\.virtualenvs\Python_Scripts-6r4YuOo9\Scripts\python.exe'

'C:\Users\mm.virtualenvs\Python_Scripts-6r4YuOo9\lib\site-
packages\pip_vendor\pep517_in_process.py' get_requires_for_build_wheel
'C:\Users\mm\AppData\Local\Temp\tmpojq98inx'
cwd: C:\Users\mm\AppData\Local\Temp\pip-install-xw_50bxm\pyproj
Complete output (1 lines):
proj executable not found. Please set the PROJ_DIR variable. For more information see:
https://pyproj4.github.io/pyproj/stable/installation.html
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\mm.virtualenvs\Python_Scripts-
6r4YuOo9\Scripts\python.exe' 'C:\Users\mm.virtualenvs\Python_Scripts-6r4YuOo9\lib\site-
packages\pip_vendor\pep517_in_process.py' get_requires_for_build_wheel
'C:\Users\mm\AppData\Local\Temp\tmpojq98inx' Check the logs for full command output.
    Installation Failed

What should I do?


texts:
How can I change the language of the keyboard in OSGeo live?
As described here https://live.osgeo.org/en/quickstart/internationalisation_quickstart.html does not do the trick for me.
I do not have Preferences ‣ Keyboard Input Methods. I only have Preferences ‣ Keyboard and Mouse. In there I cannot find anything useful... Preferences ‣ Languages does not help neither.


texts:
I am using the ArcGISDesktop student license. I want to work on versioning and geodatabase replication.

Is it possible to set up ArcSDE with the same license and work on versioning and replication?


texts: How to rename several layers at the same time?

texts:
I have got some GPS tracks (MultiLineString). As I import them to QGIS, they look like this:

I would like to merge them and to do so, I have to rename all of them like this (picture 2) otherwise an error occurs (all tracks become one single track at the same position).

I usually give numbers as names (e.g. 01-200).
Sometimes I have only a few tracks but sometimes a lot.

Is it possible to rename all the tracks (layers) without renaming them one-by-one by hand?


texts: How do I specify a CRS for a fictional game map in QGIS?

texts:
I am about to start playing a steampunk RPG game called The Iron Realm, which uses a fictional world map. I have recently started using QGIS v1.7 and have no real experience with GIS sysstems. I have imported the map as a raster layer into a new QGIS project and have created some vector layers from it, including a polygon layer for the regions, a point layer for the towns, and a line layer for some added railway tracks and roads.
The game master has just added a scale and some lat/long information to the game map:

I assume from this that I can now add a CRS to my QGIS project. I have no idea how to do this and would really appreciate some help, so that I can use my QGIS project with the game effectively. I assume that I will need to create a custom CRS, but I am completely ignorant about how to do this. I think it has something to do with proj.4 but I have no idea how to use it.


texts:
Background : I am making a raster + vector map navigation application using Qt4 and QGIS in C++. Map is loaded inside QgsMapCanvas, which is quite slow, mapcanvas is the part of QGraphicScene, QGraphicScene is a part of QGraphicsView.
According to the documentation QgsMapCanvas uses QGraphicsView's paint method for drawing map..
Issue: Processing of QgsMapCanvas is slow. Due to slow processing of QgsMapCanvas map rendering, the graphicview shows blank area for few milliseconds.
Question
Is there any way to speed up the rendering of QgsMapCanvas? Is there any way to re-render only one layer in QgsMapCanvas?
canvaslayerSet[7].layer()->triggerRepaint();

I have tried this. According to some forms it repaints only single layer. But it doesn't work.


texts: Synchronize Google Earth to ArcMap and vice versa

texts: I found this old script that worked okay in 9.3, but since I've upgraded to 10.1 the VB code can't work.  It basically allows you to quickly pan in Google Earth to find a feature, then you click on a button and it pans ArcMap to your current extent in GE.  Does anyone know of a python script that will accomplish this?


texts: Python Script that calls the Voronoi Polygons Function?

texts: I've been looking to see if there was a way to call Voronoi Polygons function found in Vector/Geometry Tools, directly from the code but I have not found one. Does this currently exist? Is there a way to call these functions within python coding?


texts:
I am trying to work with a shapefile using shapely, fiona and python. The original coordinate system is in latitude and longitude that I am trying to convert to state plane system. So I want an updated shapefile with coordinates as statePlane. I converted the json object:

fc = fiona.open("sample.shp")
geoJsonObj = shapefile_record['geometry']
array_coordinates = np.array(geoJsonObj['coordinates'])
array_newCoordinates = copy.deepcopy(array_coordinates)
for counter in range(0,len(array_coordinates[0])):
    long,lat = p1(array_coordinates[0][counter][0],array_coordinates[0][counter][1])
    #where p1 is a function to do the conversion
    array_newCoordinates[0][counter][0] = long
    array_newCoordinates[0][counter][1] = lat

geoJsonObj['coordinates'] = array_newCoordinates.tolist()

when i check the coordinates, i get state plane coordinates according to the transformation.

n. However, when i open the individual shapes/polygons within the shapefile, the coordinates are still latitude and longitude. why does this happen?

----EDIT 1-----

from pyproj import Proj, transform
import fiona
from fiona.crs import from_epsg

dest_crs = from_epsg(4269)
shape = fiona.open("Sample.shp")
original = Proj(shape.crs) # EPSG:4326 in your case
destination = Proj('+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25      +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83  +no_defs')
with fiona.open('new.shp', 'w', 'ESRI Shapefile',shape.schema.copy(),crs = dest_crs) as output:
    for feat in shape:
        print feat['geometry']['coordinates']
        for counter in range(0,len(feat['geometry']['coordinates'][0])):
            long,lat =  feat['geometry']['coordinates'][0][counter]
            x,y = transform(original, destination,long,lat)
            feat['geometry']['coordinates'][0][counter] = (x,y)
        output.write(feat)


texts: Interpolating Points on a Raster when Resampling

texts:
I have a coarse GeoTiff at 1km that I want to resample down (let's say 100m for this example).  I resample it using gdalwarp -tr 100 100 -r bilinear A.tif B.tif
This works fine, but it doesn't produce any smoothing of the values themselves, only a contouring effect where the original values are maintained.
Is there a way to use gdal tools to interpolate the points that get generated?  So that if two "coarse" pixels are next to each other and have values of 2 and 3, the inbetween values will be a gradient of 2.1, 2.2, 2.3, etc.?


texts: Geoserver shutdown after load big imagemosaic

texts:
catalina.log:
24.05.2013 15:33:38 org.apache.tomcat.util.net.JIoEndpoint processSocket
SEVERE: Error allocating socket processor
java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:657)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.start(JIoEndpoint.java:513)
        at org.apache.tomcat.util.net.JIoEndpoint.newWorkerThread(JIoEndpoint.java:744)
        at org.apache.tomcat.util.net.JIoEndpoint.createWorkerThread(JIoEndpoint.java:723)
        at org.apache.tomcat.util.net.JIoEndpoint.getWorkerThread(JIoEndpoint.java:757)
        at org.apache.tomcat.util.net.JIoEndpoint.processSocket(JIoEndpoint.java:789)
        at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:355)
        at java.lang.Thread.run(Thread.java:679)

......................

and

Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.font.FontManager
        at sun.java2d.SunGraphicsEnvironment$2.run(SunGraphicsEnvironment.java:179)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.java2d.SunGraphicsEnvironment.(SunGraphicsEnvironment.java:163)
        at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:253)
        at sun.reflect.GeneratedConstructorAccessor109.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at java.lang.Class.newInstance0(Class.java:374)
        at java.lang.Class.newInstance(Class.java:327)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
        at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1152)
        at javax.media.jai.TiledImageGraphics.getBogusGraphics2D(TiledImageGraphics.java:266)
        at javax.media.jai.TiledImageGraphics.(TiledImageGraphics.java:192)
        at javax.media.jai.TiledImage.createGraphics(TiledImage.java:755)
        at javax.media.jai.ROIShape.getAsImage(ROIShape.java:1148)
        at com.sun.media.jai.opimage.MosaicOpImage.(MosaicOpImage.java:374)
        at com.sun.media.jai.mlib.MlibMosaicOpImage.(MlibMosaicOpImage.java:49)
        at com.sun.media.jai.mlib.MlibMosaicRIF.create(MlibMosaicRIF.java:74)

...................

and more

ERROR [geotools.map] - Call MapContent dispose() to prevent memory leaks

..............

After run layer preview(big imagemosaic) geoserver(and other opengeo) send error 502.


texts: My Leaflet map doesn't appear on my webpage

texts:
Currently my Leaflet fails to fill the whole parent div on my page, in fact it doesn't appear at all.

Here is my Leaflet snippet:

const Wrapper= styled.div`
  width:${props => props.width};
  height:${props => props.height};
`;

const location= [34.0522, -118.2457]
export default class Map extends Component{
  componentDidMount(){
    // Map = require('react-leaflet').Map
    // Marker = require('react-leaflet').Marker
    // Popup = require('react-leaflet').Popup
    // TileLayer = require('react-leaflet').TileLayer
    // Tooltip = require('react-leaflet').Tooltip
    // this.setState({ showMap: true })
    this.map= L.map("map", {

      center:location,
      zoom:12,
      zoomControl:true
    })
    L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {
      maxZoom: 20,
      attribution: '&copy; Openstreetmap France | &copy; OpenStreetMap contributors'
    })
    .addTo(this.map)
    var placeholder = L.icon({
      iconUrl: "/static/assets/icons/placeholder.svg",
      // shadowUrl: 'leaf-shadow.png',
      iconSize:     [47, 47], // size of the icon
      // shadowSize:   [50, 64], // size of the shadow
      iconAnchor:   [47, 47], // point of the icon which will correspond to marker's location
      // shadowAnchor: [4, 62],  // the same for the shadow
      popupAnchor:  [-25, -50], // point from which the popup should open relative to the iconAnchor
      tooltipAnchor:[30, -2]
  });

    var marker = L.marker(location ,{icon: placeholder}).addTo(this.map);
    setTimeout( ()=> {
      marker.bindPopup("Come see us, it would be awesome!", {maxWidth: "500"});
      marker.openPopup();
      marker.bindTooltip(`West 2nd Street , <br/> LA 90018`, (-20, 0)).openTooltip();
     }, 1000)

   this.map.setView(location);
  }

  render(){
    return (
      <Fragment>

          <link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.4.0/images/marker-icon-2x.png"/>
          <link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.4.0/images/marker-icon.png"/>

          <link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css"
   integrity="yyyy"
   crossorigin=""/>

        <Wrapper width="100%" height="100%" id="map"/>
      </Fragment>
    )
  }
}

I assumed the map would fill the entire parent div, maybe someone have an idea to handle the situation.


texts:
I'm an intern at a small local history museum. We have a budget of $0.
Project overview:

I've got a bunch of old paper maps. When I say old, I mean 1800s and up. They've been scanned into TIFFs. I geo-referenced them and exported as GEOTIFFs. I've digitized the components of the maps we are focusing on (railroads, roads, etc).
The goal is to construct a web application (I've used ESRI's ArcGIS Online for a different web map project with CSV data) that allows a user to select layers (of years past) to view how transportation has developed in our county. Aside from a layer selector, layer opacity needs an option to be changed.
I've looked into MapBox API, but it lacks opacity sliders. QGIS Web Client looks promising and similar to the ArcGIS Server Client, but I wonder if it is too complicated for our end-users. I don't have much time to get this together, nor do I have much in the way of heavy programming experience.


texts:
I have the latest QuantumGIS-1.9.0-master from Github with python-modules support and full GRASS-integration (GRASS-4.6.3-RC2) on Linux.

When opening the GRASS-tools plugin, it only displays six tools. But there are more like 300 installed.

The QGIS-Wiki tells me to add new tools to the GRASS toolbox menu using some xml file in:

qgis/src/plugins/grass/config/default.qgc

But where to find this file and how to update it? Isn't the src-directory only used prior compiling QGIS?

And why are my GRASS modules not included in QGIS by default?

Update 1: Ok, at least I found the file:

~ $ find / -name default.qgc 2> /dev/null
/usr/local/share/qgis/grass/config/default.qgc

But the contents look good. How to trigger QGIS to load the tools? What's the point I'm missing here?

Update 2: Okay, using Sextante-plugin seems the way to go. But this is pretty much broken. I keep getting Error-Messages like this one. I tried reinstalling, but this didn't solve it.


texts: GPS with external antenna. Which piece of hardware is the limiting factor for accuracy?

texts:
We have a Trimble Geo 7x (cm edition) which can operate with it's own internal antenna.
It's spec sheet states that it can theoretically achieve 1.5 cm + 2 ppm VRMS vertical accuracy.
We also have a Trimble Zephyr 3 external antenna.
It's spec sheet states that it can theoretically achieve 3.5mm + 0.4ppm RMS vertical accuracy.
The internal antenna on the Geo 7x is small and is heavily influenced by site conditions like nearby trees/canopy/buildings.
The Zephyr 3 external antenna is larger, mounted higher up, and has built in shielding to help reduce multipath error etc. So the Zephyr 3 used with the Geo7x improves our reception in sub-optimal site conditions.
Now, if we use the Zephyr 3 external antenna with the Geo 7x in optimal site conditions, the best results (RTK or post-processing) were  reported at ~0.5 inches (~1.5cm), but more usually 1"-2". Again, in optimal site conditions.
which piece of hardware is the limiting factor for accuracy when the Zephyr 3 is used with the Geo 7x?
I suspect that it is the Geo 7x that limits the accuracy since the best observed results are in line with  the Geo7x specs. And the improved external antenna only helps the Geo7x  acquire a signal that then gets reduced in quality by the 7x's software limitations.  To phrase it differently, I suspect that the external antenna lets the Geo7x perform better in sub optimal conditions, but still only to the level at which the Geo7x could on its own in perfect conditions. Effectively, in optimal conditions, the external antenna offers no improvement to the Geo7x because its signal is fed to a less accurate/precise piece of hardware/software


texts:
Have made the move to QGIS 3 but am having trouble locating the AutoTrace/Trace tool.

I have enabled advanced digitizing tools where the magnet button sat in QGIS 2.18 but it is not there in QGIS 3. I also can't find any AutoTrace plugins in the QGIS 3 plugin manager.


texts: Is there Export All Features in View Extent equivalent with ArcPy?

texts:
I would like to dynamically classify a layer's symbology based on the current view extent. As in, quantities of a specified field will be classified into quantiles based on the range of values of the visible features. Since the symbology tab does not appear to support this out of the box, I need to instead limit the layer's values to those within the visible extent. I know ArcMap supports exporting data to those features limited to the view extent.

Is this possible with ArcPy?


texts:
I'm wondering if there is a way to decipher the headers for this census data for a project I'm working on?

I've tried googling and I cannot find much info on it.


texts: Fade out effect for QGIS Temporal Controller?

texts: I am currently trying to animate wildlife movement data through the new QGIS temporal controller.  Basic animations are working well. However, I would like the tracks to fade out over time but could only find advice on how to do it through the old time manager. Has someone tried fade out effects with temporal controller or has some recommendation where to look for advice?


texts:
Is it possible to create a circle shapefile feature in QGIS, like it is possible to do in ArcMap?

I am trying to digitise a map wich features roundabouts, which I'd like to be part of the same polyline as the rest of the road. I've done this quite easily in Arc, but cannot work out how to create nice, polyline spherical features in QGIS.

Can anyone advise me of an editing tool that I'm hopefully missing?


texts:
I have an ArcObject Dissolve procedure that creates a shp in a directory.  This dissolved layer is a temp layer and is not added into ArcMap.  I would like to delete it when the user clicks a button again, however it will not delete because their is a lock file (Dissolved.shp.6H8Z5D1.3448.1520.sr.lock) in the directory that happens after the dissolve gp runs:

pSumTable = pGeoProc.Dissolve(pInputTable, True, "ROUTE", "Dissolve.Shape, Minimum.ROUTE", pdatasetname2)

I looked at Using Scheme Locks, however I'm not using this layer to perform any edits.  I also found this post on GIS SE, however it too does not seem to apply for my situation.  How do I remove this sr lock file (my entire code below), while keeping the ArcMap session open?

Thanks

 Try

            'delete all temp files
            Dim s As String
            For Each s In System.IO.Directory.GetFiles("J:\20111030\GIS\Scripts\TempData2")
                System.IO.File.Delete(s)
            Next s

            'dissolve route layer
            Dim pMap As IMap

            pMap = mxdoc.FocusMap

            Dim pInputFeatLayer As IFeatureLayer

            pInputFeatLayer = featurelayer

            If pInputFeatLayer Is Nothing Then

                MessageBox.Show("The testinline layer was not found")
                Exit Sub

            End If

            Dim pInputTable As ITable
            pInputTable = pInputFeatLayer

            If pInputTable Is Nothing Then

                MsgBox("Table QI failed")
                Exit Sub

            End If

            If pInputTable.FindField("ROUTE") = -1 Then

                MsgBox("There must be a field named MUSYM layer ")
                Exit Sub

            End If

            Dim pInputFeatClass As IFeatureClass
            pInputFeatClass = featurelayer.FeatureClass

            Dim pfeatureclassname As IFeatureClassName
            pfeatureclassname = New FeatureClassName

            With pfeatureclassname

                .FeatureType = esriFeatureType.esriFTSimple
                .ShapeFieldName = "Shape"
                .ShapeType = pInputFeatClass.ShapeType

            End With

            Dim pNewWSName As IWorkspaceName
            pNewWSName = New WorkspaceName

            pNewWSName.WorkspaceFactoryProgID = "esriCore.ShapefileWorkspaceFactory.1"
            pNewWSName.PathName = "J:\20111030\GIS\Scripts\TempData2\"

            Dim pdatasetname2 As IDatasetName

            pdatasetname2 = pfeatureclassname
            pdatasetname2.Name = "Dissolved"

            pdatasetname2.WorkspaceName = pNewWSName

            Dim pGeoProc As IBasicGeoprocessor
            Dim pSumTable As ITable
            pGeoProc = New BasicGeoprocessor
            pSumTable = pGeoProc.Dissolve(pInputTable, True, "ROUTE", "Dissolve.Shape, Minimum.ROUTE", pdatasetname2)
            Dim pOutputFeatClass As IFeatureClass
            pOutputFeatClass = pSumTable

            If pOutputFeatClass Is Nothing Then
                MsgBox("FeaturesClass QI Failed")
                Exit Sub
            End If

            Dim pOutputFeatLayer As IFeatureLayer
            pOutputFeatLayer = New FeatureLayer
            pOutputFeatLayer.FeatureClass = pOutputFeatClass
            pOutputFeatLayer.Name = pOutputFeatClass.AliasName

            ' CLEAN UP
            featurelayer = Nothing
            pInputFeatLayer = Nothing
            pInputTable = Nothing
            pInputFeatClass = Nothing
            pfeatureclassname = Nothing
            pNewWSName = Nothing
            pdatasetname2 = Nothing
            pGeoProc = Nothing
            pSumTable = Nothing
            pOutputFeatClass = Nothing
            pOutputFeatLayer = Nothing

            pMap = Nothing
            mxdoc = Nothing

        Catch ex As Exception
            MessageBox.Show("Caught an unspecified error in the calling code: " & vbCrLf & ex.ToString)
        End Try


texts:
I'm trying to display data from OSM (with the QuickOSM plugin) and getting strange results.

This is the normal result that I have got until today:

But I've installed QGIS in a brand new computer, and when I ask for the same data, I obtain strange results:

The points seems to be grouped in a grid.

I'm thinking in some QGIS option with the decimal places, or some locale option.

I've changed the locale settings to spain_es, but still remains the problem.

Any suggestion?


texts: Retrieving attachment table previously created during geoprocessing and renaming attachments using ModelBuilder, ArcPy and ArcGIS Pro

texts:
I've created a model in ModelBuilder (ArcGIS Pro 2.7.2) and I'm trying to retrieve an attachment table created previously in the model using feature class to feature class. I'd then like to run the following python script to rename attachments in the table
fields = ['REL_GLOBALID', 'ATT_NAME']
featureClass = 'DFE__ATTACH'
update_dictionary = {}

with arcpy.da.UpdateCursor(featureClass, fields) as updates:
    for row in updates:
        if row[0] not in update_dictionary.keys():
            update_dictionary[row[0]] = 1
        else:
            update_dictionary[row[0]] += 1
        row[1] = 'Photo ' + str(update_dictionary[row[0]]) + '.jpg'
        updates.updateRow(row)


texts: Uncaught Type Error p = l.Db(f) Open Layer 4.6.4

texts:
I have searched everywhere but I have not found any results.

Currently I am trying to load a Vector Tile layer with MVT format hosted by geoserver using OpenLayers 4.6.4. When creating the map, I get a "Uncaught TypeError: l.Db is not a function" and the map does not appear.

    this.tileLayer = new ol.layer.VectorTile({
  declutter: true,
   source: new ol.source.Vector({
     format: new ol.format.MVT(),
     url: `https://domain.com/geowebcache/service/tms/1.0.0/OpenMapTiles/{z}/{x}/{y}.pbf`,
   })
});
this.map = new ol.Map({
    layers: [this.tileLayer],
    target: targetId,
    view: this.view,
  controls : ol.control.defaults({
    attribution : false,
    zoom : false,
  })
});

Any Ideas?


texts: Administrative country boundaries over the years

texts: I am using natural earth's Admin 0 Countries dataset and it works great, but need to plot some data going back to 1962. Any idea how I could handle the national border changes? (In fact, I only need base maps for 1962, 1988 and 2014.)


texts: How to export every record of a SQL query to its own KML file using ogr2ogr?

texts:
I'm querying an MSSQL database and then using ogr2ogr to reproject and save the output as a single KML. Areas.sql has output like:

DRAINAGE
FLOODTYPE
GEOM

Creek #1
Nuisance
0x3C0B000...

Creek #1
Catastrophic
0x3C0B000...

Creek #2
Nuisance
0x3C0B000...

Creek #2
Catastrophic
0x3C0B000...

The ogr2ogr looks like:
ogr2ogr ^
-f "kml" "Areas.kml" "MSSQL:server=GISServer;database=GISDB;Integrated Security=SSPI;persist security info=True;trusted_connection=yes;" ^
-sql @".\Areas.sql" ^
-overwrite ^
-s_srs "EPSG:2876" ^
-t_srs "EPSG:4326"

How can I execute the same SQL query but get a KML for each record with a name based in the query fields (e.g. Creek#1_Nuisance.kml, Creek#1_Catastrophic.kml, Creek#2_Nuisance.kml, etc)?


texts: Changing coordinate systems of asc file in Python

texts:
I am working with asc files and what I need to do is do change the coordinates from Lambert Equal Area to WGS 84.

I’ve tried a few things (xarray, rasterio, GeoPandas...) but nothing seems to work out. I can’t find any helpful example code for my situation, so does anyone have a tip or link for me?

Sorry for the lack of detail!

Since I have not much experience with GIS I don't know what my best attempt was but so far I have tried to convert using this function with rasterio:

def reproject_et(inpath, outpath, new_crs):
    dst_crs = new_crs # CRS for web meractor
    # open initial data
    with rio.open(inpath,crs='EPSG:102014') as src:
        transform, width, height = calculate_default_transform(
            src.crs, dst_crs, src.width, src.height, *src.bounds)
        kwargs = src.meta.copy()
        kwargs.update({
            'crs': dst_crs,
            'transform': transform,
            'width': width,
            'height': height
        })
        #print(src.meta)
    # create new tif file
        with rio.open(outpath, 'w', **kwargs) as dst:
            for i in range(1, src.count + 1):
                reproject(
                    source=rio.band(src, i),
                    destination=rio.band(dst, i),
                    src_transform=src.transform,
                    src_crs=src.crs,
                    dst_transform=transform,
                    dst_crs=dst_crs,
                    resampling=Resampling.nearest)

But I don't think that the reprojection worked. Also when I load the file using rasterio.open or gdal.open and want to print the initial projection I only get 'None'. I also wanted to try GeoPandas but I get an error when trying to load the asc file!


texts:
I have been hearing about ArcGIS Pro and its 3D abilities from here and there in the last few days. I haven't used it till now, but I am wondering if it is able to produce 3D animation of flow of surface water in a city, just for presentation purposes.

I have got a series of rasters depicting water depth values at different time instants from simulations and it would be really effective if I could show it in the form of an animation of flow of water over that time series with a background of a 3D city.

I would be glad to hear if anyone has tried similar things in ArcGIS Pro or if anyone has a better idea of doing it.


texts: QGIS snapping to the points of a line or polygon you are just creating

texts:
I have the snapping option enabled. I can snap to any point, intersection of created lines.

But I can't snap to any vertex of the linestring I am just digitizing.

Is there any option/plugin to activate this feature?


texts:
I need to generate tiles from shape files (which contain contour lines) I've loaded into QGIS.
I'm trying to use the QTiles plugin to generate these tiles, but when I run it, it only generates blank tiles.

Following settings used:
Output: Directory
Extent: Canvas Extent
Zoom: 10 - 12
Quality: Use TMS tiles convention

It almost looks like the canvas extent has not been selected properly?
It seems like I'm missing something small. Possibly a decent tutorial will also help.
I'm new to QGIS and I'm using 2.8.3-Wein on Ubuntu.

I've tried generating tiles with the natural earth oceans vector and it seems to work fine.


texts: Cannot see map display in Geocortex Essentials

texts: I am setting up a new site in Geocortex Essentials manager. I'm adding ArcGIS server map services which are published on the same server. I can add the connection and the map services to the site but they do not display on the map screen. Both manager and map services are being accessed via HTTPS. I tried testing using https://sampleserver6.arcgisonline.com/arcgis/rest/services as suggested in another thread but again I can't see the map display. Any help would be great!


texts:
I have a polyline defined on google earth. I want to create a flight path along the polyline so that I can create a video of how the topography changes along the polyline. Does anybody know how to do this?

Any help is appreciated.


texts: Trying to join a table to a shapefile. Identical key values will NOT join

texts:
I have a shapefile of all the addresses in a city and a table of survey results for a sample of addresses, with NO spatial aspect. I am asked to make the survey data spatial, so used a simple join based on address in the table to the address shapefile.

After I performed the join, I discovered that 2,558 of the ~30,000 survey results rows did NOT join. Some of these are due to misspellings in the survey address list, but the vast majority of addresses seem to be present and accurate in BOTH fields. When I search for the addresses manually, they are in both of the fields used to join, and are identical and accurate. I trimmed the fields in both ArcGIS and in Excel, so it shouldn't be leading or trailing spaces.

I am at a complete loss at what could cause identical join values to NOT join. Is there something obvious I'm missing here? Any ideas?


texts: Replace raster values by another raster in QGIS

texts:
I have a DEM raster (let's call it R1) and another smaller and recent raster R2. I want to have R1 but replace the cell-values in locations where I have more recent DEM-data R2.
Both R1 and R2 have values which range from 0 until to about 200.
Can this be done in the Raster Calculator or I need to write a specific script for this?


texts: Creating a spatial database using EXTENSIONS: error loading legacy.sql

texts:
I am using Postgres 9.3 and PostGIS 2.1, installed in a Docker container via

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y install postgresql-9.3 postgresql-contrib-9.3 postgresql-9.3-postgis-2.1 postgis

According to the docs I can spatial-enable my database just by executing these commands against my db in a psql console:

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;

It then says:

If you plan to restore an old backup from prior versions in this new db, run:

psql -d [yourdatabase] -f legacy.sql

Well, I need to import data dumped from Postgres 9.1 and PostGIS 1.5.3 so I guess I need to do this (I have tried not doing it and I get errors when creating a table with a geography column)

I don't know where to find "legacy.sql" though.

I downloaded http://www.postgis.org/download/postgis-2.0.2.tar.gz and found a "legacy.sql" in there but I get errors when I run it:

psql:/common/postgres_data/legacy.sql:11: 00-regress-install/share/contrib/postgis/legacy.sql: No such file or directory
(followed by lots more errors)

Looking at the source I think it's trying to include another file also called "legacy.sql" but I can't find it.


texts:
I have a raster dataset that is not visible in Data View, but it is listed in the Table of Contents.

I have tried viewing it in ArcCatalog but it is not visible there either.

Is there something I can do make it visible so I can perform further analysis?


texts: What are the main drawbacks of the AuthaGraph projection?

texts:
The AuthaGraph projection has recently been hyped as the "perfect projection" for a world map, since it (approximately) conserves area, shape and distances. It also tessellates, so that any point can serve as an equal center point for the map.

Apart from being a fairly recent invention (so that it did not have enough time to be widely adapted), what are the main disadvantages of this projection for everyday use?

One suggestion would be that longitude and latitude are not straight lines or ellipses. This would make it difficult to find the North direction on an arbitrary point without detailed grid lines.

To address the suggested similarity to this question: the deformed North Pole is only one of the symptoms of the disadvantages my question is about. My question is broader: Does this projection conserve angles? Can it easily be used for navigation with map and compass? Does it map geodesics to simple curves? etc.

Summary so far

Advantages:

preserves size
preserves shape
tessellates (center point can be arbitrarily chosen)
allows rectangular maps with almost 16:9 ratio
allows differently-shaped maps (triangular, parallelogram)
recurring paths (e.g. satellite orbits) can be mapped to a straight line on the tiled map

Disadvantages:

not strictly equal-area
lines of constant bearing are not mapped to straight lines or ellipses
unusual projection, unfamiliar (recent invention)
does not conserve location accurately


texts: Finding actual (field) link lengths in network using ArcGIS Desktop?

texts:
I have three layers of data: streets, intersections and start/end of links.

How can I get the actual (field) link lengths of every link in the network?

Here link is defined as the street stretch between every node pair.


texts: Loading legend of MapServer in ArcGIS Server with ArcGIS API for Silverlight?

texts:
I have published a mapserver on my ArcGIS Server 9.3. I am developing a silverlight application using ArcGIS Silverlight API. Now I can load my map into my application and also the list of my layers that I can toggle their visibility.
I just want to load my map legend in order to know the legend of each layer. The solution which I find in arcgis silverlight example is just as follow:

<esri:Legend Map="{Binding ElementName=Map}"
    LayerIDs="BaseLayer"
    LayerItemsMode="Tree"
    />

In visual studio 2010, I have an error for LayerIDs part which says that "Unable to cast from....". The definition of my map is also:

<esri:Map x:Name="Map"  Background="White" MouseClick="QueryPoint_MouseClick" IsLogoVisible="False">
    <esri:OpenStreetMapLayer ID="OpenStreetMap" Style="Mapnik">
    </esri:OpenStreetMapLayer>

    <esri:ArcGISDynamicMapServiceLayer ID="BaseLayer"
            Url="http://sina-pc/ArcGIS/rest/services/Test/MapServer"
    Initialized="ArcGISDynamicMapServiceLayer_Initialized" />
</esri:Map>

It also doesn't show any of my legends for BaseLayer map. Am I missing something or is there any problem with my map?


texts: Model Builder is not intersecting erased and selected files

texts:
I'm having trouble debugging my model that I'm creating in ArcMap 10.1 ModelBuilder.

The model is just a simple string of geoprocesses, but there's a point at which the model isn't exporting the expected features. Specifically, I've narrowed it down to a point at which the model takes a polyline file which had been erased (interim_erased) and intersects it with a selected polygon file (Inactive_ESA), and at this point the output file (interim_intersect) is empty.

The only thing I see that could be happening is that the "ESA" isn't getting selected at the "Select by Attributes" step (The output being "Inactive_ESA"), because the erased file "interim_erased" has the expected features in its table.

Also, I've double-checked the selection expression - it's correct and works fine outside of ModelBuilder. I also have the license to execute Erase.

Maybe, if someone knows how to look into ModelBuilder at what's actually getting selected at the "Select Layer By Attributes" point in the model?

++++++++++++ ADDED 2014-07-31 +++++++++++++++

The ESA polygons are broken down by active(green) and inactive(red), the polylines as well, active(green) and inactive(red). I'm selecting the green polygons in the ESA, and selecting the red polylines. Then I'm Erasing the red polylines with the green ESA. (This part works, and my intermediate data for this process outputs the expected result - red polylines only on the red ESA with no red polylines overlapping onto green ESA).

However, when this erased file of red polylines is intersected with my selected Inactive_ESA (which is where I'm selecting the red polygons), the table is empty. So this suggests to me that the ESA isn't actually getting selected by the "Select Layer By Attribute (9)" process. How might I see what's actually getting selected at this step? (because I've double checked my expression and it's correct and works fine outside of the model)


texts: QGIS not showing spatialite's timestamp values in Attribute Table

texts:
I opened in QGIS (3.14.16) spatialite's table which has timestamp type field, but values in this field are not visible (NULL) in Attribute Table.

In DB Manager view these values are visible.

but in Attribute Table they are NULL.

Does anybody know what's the problem?


texts: My TIFF files are placed on top of each other when imported to QGIS

texts:
When I upload TIFF images to QGIS, all of these are placed on top of each other. The files are "telling" me they dont have the right projection, but I have tried many (including the same as my World map is in) but its still messed up. I have managed to change the placement of the images, but never to the correct location. And they are still placed on top of each other. My goal is to make NDVI analyses from these.
How do I manage to place them at their correct locations? I have taken the images with a DJI Phantom IV RTK drone, and all images have GPS coordinates in their files.


texts: Arcmap record value is not displaying entirely

texts:
On this project i have a column composed of numeric and alphanumeric values. The data comes from multiple sources, so it is quite messy. Using python I am trying to filter the data and copy the values in new columns(were there are only numbers, copy the number in a new field; were there are only letters copy them to a new field, if alphanumeric split the numbers from the other characters etc.) I first filtered by "only numbers". I observed after running the script that a few "only numbers" were left behind. When I copied the value into Notepad a string appear after after the number. I stared editing and click-ed on that number, and sure enough the string appeared (only to vanish as i clicked somewhere else)
One co-worker suggested that some "n/" or a special command was used when entering that values. Simply copying the value to a new field wont reveal all. I am not allowed to alter the content of this column. What can i do to see all the content of that record?


texts: Setting extent and geographic projection in R

texts:
I have a raster and a shapefile that I am attempting to view and process in R. The shape file "ER_11.1" has the following specs:

> ER_11.1
class       : SpatialPolygonsDataFrame
nfeatures   : 22
extent      : -1989641, -1450736, -1748693, -208349.6  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs
nvariables  : 8
names       : NA_L2CODE,                NA_L2NAME, NA_L1CODE,                NA_L1NAME,                       NA_L2KEY,                     NA_L1KEY,   Shape_Leng,   Shape_Area
min values  :      11.1, MEDITERRANEAN CALIFORNIA,        11, MEDITERRANEAN CALIFORNIA, 11.1  MEDITERRANEAN CALIFORNIA, 11  MEDITERRANEAN CALIFORNIA,     331.1174, 1.483274e+08
max values  :      11.1, MEDITERRANEAN CALIFORNIA,        11, MEDITERRANEAN CALIFORNIA, 11.1  MEDITERRANEAN CALIFORNIA, 11  MEDITERRANEAN CALIFORNIA, 5417939.1114, 8.472524e+04
>

The raster file "bio_1" has the following specs.

# Set up a raster "template" to use in rasterize based on a enxisting layer extent
bio_1<-raster ('E:/Ecoregions Models/Border Bioclim/ModelVariables/bio_1.asc')
#add projection information to match the shapefile to the raster files
projection(bio_1) <- "+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs"

> bio_1
class       : RasterLayer
dimensions  : 324, 444, 143856  (nrow, ncol, ncell)
resolution  : 0.08333333, 0.08333333  (x, y)
extent      : -125, -88, 18.5, 45.5  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs
data source : E:\Ecoregions Models\Border Bioclim\ModelVariables\bio_1.asc
names       : bio_1

Its clear that the projection and extents are different but when I change the projection, the two files still do not map on top of each other.

Does anyone have a suggestion on how to get around this issue?


texts: What are possible values of iconSize in Leaflet Marker Icon Options?

texts:
I have a very standard script:

var redIcon = L.icon({
        iconUrl: '1.png',
        iconSize: [10, 10], // size of the icon
        iconAnchor: [5, 5], // point of the icon which will correspond to marker's location
        popupAnchor: [0, -5] // point from which the popup should open relative to the iconAnchor
    });

But I want the iconSize to be a variable in my script:

map.on('zoomend', function () {
var ZoomLevel = map.getZoom();
var x = ZoomLevel*0.5
var y = ZoomLevel*0.5

And then:

iconSize: [x,y],

Is this even possible?


texts: ST_Length(ST_ShortestLine()) equals 0, but ST_Disjoint = True

texts:
Recently, I encountered a very strange phenomenon. I have to split a multilinestring on the point of touching another line, sounds complicated but it is just preprocessing to build a graph.

Now the problem is - I calculate the shortest line to the MultiLineString(). I get a linestring now I take the point which is supposed to be on the MultiLineString(). But according to PostGIS it is spatialy disjoint! calculating the length to the MultiLineString() the result is 0.

Where does this Problem come from?


texts: Is there a way to keep track of Parent Joins in Spatial Joins? (Multiple Spatial Join)

texts:
In the attached Image, I would like to do a Spatial Join From Layer 2 to get the intersecting Layer 1's ID. Afterwards, I would like to get all of the Layer 2 that aren't initially spatial joined (non-parents) to connect to the one's that are spatially joined (parent) if they intersect with a parent or another line that intersects with a parent get the ID.  I was thinking of doing a spatial join intersect, and then a spatial join closest Parent; however, I think there would be limitations in the data as some of the lines could be closer to one that isn't actually connected.
PS: If there's also a way to get Layer 2 (all features) to have the Layer 1 ID instead, that works too (except for closest spatial join)


texts: Make a thematic/shaded map from excel data

texts:
I have ward boundaries as a layer in ARC and various data columns (Population, Age etc) in excel for each ward.

Objective is to create thematic maps at ward level based on values, at ward level, from excel data.

I can get the excel data into Arc, I can join to boundary table but then I can't see how I can get a map or a thematic map using my excel values.


texts: Results of layers created with a custom CRS are loaded with a generated CRS in QGIS

texts:
I have created a custom CRS for El Salvador using this parameters in a proj.4 string, based on this question:

+proj=lcc +lat_1=13.31666666666667 +lat_2=14.25 +lat_0=13.783333 +lon_0=-89 +x_0=500000 +y_0=295809.184 +k_0=0.99996704 +ellps=clrk66 +units=m +no_defs +towgs84=0,125,194,0,0,0,0 +wktext

I added +wktext to my string based on this answer. I set this CRS for my layers. I have also set the project CRS to this custom CRS. When I perform an operation using some tools, the result is loaded in the layers panel with a generated CRS. This is the generated CRS (sorry it's in spanish):

It's similar to the original, but without the +towgs84 and +wktext parameters.

It works when I save a shapefile or when I use some GDAL Tools that ask for a CRS. It doesn't work if I use some GDAL tools like GDAL Rasterize or some GRASS tools like r.surf.contour. Is there a way all the layers created with inputs with a custom CRS are loaded with this custom CRS?


texts: Exporting xy-coordinates from line segment

texts: I need an export of xy-coordinates of line segments in QGIS. I found an answer to a similar question here but that concerned only xy of the first and last vertex of a line segment. But I need the coordinates of all the vertexes. Can someone help?


texts: QField use main-detail tables from PostGIS/PostgreSQL

texts:
We are using QField for field data collection (forest survey). Our data is stored in a PostGIS/PostgreSQL database and we use QFieldSync to export and import data. This works fine as long, as we use data, that is stored in a single table.
During normalization of our database, we had to split up the original survey table into tree tables, one main table containing the static data of the site (including the geometry) and two detail tables (survey and planned actions) that are linked by an 1:many relation to the main table. In QGIS we can use the Data-driven Input Mask-plugin to work with the 3 tables. This seems to work quite well (after our first tests). But we don't know how to archive this in QField?
On way would be to go back to our original flat all-in-one table just for field survey and import the new data later to the 3 tables in the database.
Another way would be to create a huge view from the 3 tables and work with the view in the field. The view could then be imported to update the underlying tables (would need to create Trigger in order to make the view updatable).
But may be there is another more elegant and reliable path to follow, since it should be a common problem.


texts:
i wanna generate euclodian distance map for my road data. I 'll use it for multi criteria analysis. I can get it by using Arcgis Euclodian Distance tool but i wanna generate it in QGIS environment. I got Sextante plugin and enabled Grass and Saga tools. But i dont know which tool i must use ??? There is a link about ouput of this anaylsis (below image).

ESRI The Euclidean distance example


texts: Create NDSI from 'MODIS/006/MOD09GA' for given interval of time?

texts:
I created a masked NDSI from Modis Terra/500m reflactance daily product at a 10 days interval for given period. I adapted a function from previous posts  to iterate through my collection to create this NDSI. My problem is that for example if I give my code origin date to be 2002-02-01(date from where my iteration will begin) i get back a result for the first ten days in the interval (1-10 of the month, as i wanted) but the next result will be on the 2002-02-21 and another on 2002-03-03 but my desired result must be on 2002-03-01.
I want to have 3 NDSI per month, one for 1-10 period, one for 11-20 and last one for 21-through last of every month that I want (ignore their number of days, 28,30 or 31 days for months respectively). Can someone help me with some insights?

My code is here: https://code.earthengine.google.com/ad38d0f25d06048de8612a6225cc9cd6


texts: how to run a PostgreSQL query on CartoDB tables?

texts:
I want to run a VACUUM FULL on my table, but I don't think it's working.

Simply sandorl.cartodb.com/api/v2/sql?q=VACUUM&api_key={MYKEY} results in long output, apparently only repeating for various items that only superuser or database owner can vacuum it. I am the owner, of course.

If I try to specify the table (sandorl.cartodb.com/api/v2/sql?q=VACUUM%20FULL&table=location_of_winners25mb&api_key={MYKEY}), I get {"time":0.047,"fields":{},"total_rows":null,"rows":[]}

What is there to do?


texts: How do I sort text labels to be displayed in QGIS?

texts:
How do I select what country names the map display? It seems so obvious, however, I can't figure it out. I've used

"CNTRY_NAME" = "Denmark" AND "Sweden" AND "Norway"


texts: I have been trying by best to create a definition query which would select a group of municipalities from among the many in my state.  I have tried commands of all sorts of variations from "Name"='Chatham'AND 'Chester' AND 'Far Hills'..... to "Name"=('Chatham', 'Chester', 'Far Hills... and so on but I keep getting an error when I try to validate.


texts: Collector blue accuracy ring- what does it show?

texts: What, definitively, does the blue accuracy ring show in Collector. In the field it always seems too large to represent the accuracy that the GNSS app is stating (ie 50cm – 1m). The blue ring seems to be closer to 30 ft. It could be that Collector doesn’t know what to do with the GNSS accuracy yet or just shows a different, more conservative confidence interval.  I was just wondering if Collector is taking full advantage of the GNSS sub-meter accuracy. Perhaps Collector does not take into account the Real-time correction using SBAS?


texts: I can't open Oracle raster layer in QGIS

texts:
I can't open Oracle's raster layer in QGIS. When I load the layer it looks like this:

This layer works perfectly in Geomedia (Sisgraph), which is the software we used but we are migrating to QGIS. Can someone explain to me why it doesn't load the layer.


texts: Defining common symbology across multiple geometry types

texts:
I have two layers in QGIS; one points and one simple lines. Each have an attribute, community, which I'd like to serve as the category variable for assigning color. But I can't figure out any way to make these color-variable assignments identical between the two layers. I can't copy/paste styles, nor can I export a QML and apply it to the other layer, because of their different GeometryType.

Is there any way to do this short of exporting two QML files, one for each layer, and writing some sort of Python script to interchange the <prop k="color" v=" ... "/> in the points style definition, and           <prop k="line_color" v=" ... "/> in the lines style definition?

The community variable in both layers has >50 possible values, so it's too cumbersome to do this by hand.


texts:
Trying to create a Python script that processes some data. I'm running this on QGIS 3.01 on MacOS 10.12.6. Having trouble with it as every time I run the below code, it completely crashes QGIS.

All I'm trying to do is run a series of processing algorithms. If I comment out the processing.run line, QGIS doesn't crash but also I can't do anything.

import processing
from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import QgsProcessingAlgorithm, QgsProcessing, QgsProcessingParameterFeatureSink

class testAlg(QgsProcessingAlgorithm):
    OUTPUT = 'OUTPUT'

    def tr(self, text):
        return QCoreApplication.translate('testalg', text)

    def createInstance(self):
        return type(self)()

    def group(self):
        return self.tr('Test')

    def groupId(self):
        return 'test'

    def __init__(self):
        super().__init__()

    def initAlgorithm(self, config=None):
        self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Output'), QgsProcessing.TypeVectorPolygon))

    def name(self):
        return 'testalg'

    def displayName(self):
        return self.tr('Test Algorithm')

    def processAlgorithm(self, parameters, context, feedback):
        # Commenting out the next line stops QGIS from crashing, but it means I can't actually do anything
        processing.run('qgis:fieldcalculator', {'INPUT':'/Users/myusername/Documents/temp/test.geojson','FIELD_NAME':'test','FIELD_TYPE':0,'FIELD_LENGTH':10,'FIELD_PRECISION':6,'NEW_FIELD':True,'FORMULA':'( "count" / sum(  "count" )) * 100','OUTPUT':'memory:'})

        return {}

Am I doing something horribly wrong in my script or is this a bug in QGIS 3?

--

Edit: By crash, I mean that QGIS freezes and becomes unresponsive. I have to Force Quit it and reopen it before I can do anything else.

Edit 2: This also freeze/crashes Windows 10.


texts: Problems getting openlayers permalink working

texts:
I set up an openlayers permalink function. I set the code and it shows up. But the URL does not work. Where is
I get a link like this:
http://babkart.no/?zoom=9&lat=7016094.01622&lon=121216.28057&layers=BFFFTTTTTF

The only thing that works is the chosen layers. It does not show the correct zoom or boundingbox. What do I need in the code to get this to work? I can not see I have any variables like "lat", "lon" or "zoom". Any examples as how to get this to work? I also would like to put the permalink in the toolbar so that one can copy the URL. I am using ExtJS 2.2.
But this is another issue and I have to get the permalink to work first.

I add the permalink like this:

controls: [new OpenLayers.Control.KeyboardDefaults(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.ScaleLine(),
                new OpenLayers.Control.Navigation(),new OpenLayers.Control.Permalink()]

My app.js is here if anyone wants to take a look:
http://pastebin.com/AstbpBWV
The site is running here: http://babkart.no/

~asle

I got this to work this way. Don't know if it was good or bad but it seems to work:
I use a function to zoom in to a location and added functionality to just zoom in to the view. I use the OpenLayers.Permalink() function.

        // If URL contains ref. to a location:
        var args = OpenLayers.Util.getParameters();
        if (args.x && args.y) {
            var position = new OpenLayers.LonLat(parseFloat(args.x), parseFloat(args.y));
            map.setCenter(position, 14);
            var xy = map.getViewPortPxFromLonLat(position);
            xy.x = Math.round(xy.x);
            xy.y = Math.round(xy.y);
            info.getInfoForClick({xy: xy});
        } // read the permalink URL
        else if (args.lat && args.lon && args.zoom) {
            var position = new OpenLayers.LonLat(parseFloat(args.lon), parseFloat(args.lat));
            map.setCenter(position, parseFloat(args.zoom));
        }
        else {
                map.setCenter(new OpenLayers.LonLat(528277, 7188837), 3);
        }


texts: Looking for material for learning geospatial development in Java

texts:
I want to begin using Java for geospatial development. For the purpose of learning I am interested in suggestions on some books, web sites, etc. (i.e. reference materials) that would help me out.

Note: I am using JDk and am also looking for suggestions on what geospatial libraries are available in Java.


texts:
I'm pretty sure that a lot of people might have faced the situation where they search the internet for geographical basemaps on a global scale but can't hardly find the needed data in a short time and with sufficient quality and/or documentation.

I think especially for beginners it is hard to know where to download good data because their are just too many websites and data-sources out there of which some are for free and others are not, some are of good quality and others not...and often all of them lack proper documentation.

So my question is: Is there any specific website that bundles information on where to find good basemaps (such as administrational boundaries, cities, physical maps, relief maps, waterbodies, vegetation, soil and others) on a global scale that also include proper documentation and reliable data-quality?

For me a good starting point is Worldgrids.org. check out here:

http://worldgrids.org/doku.php

people interestet in soils should consider:

http://www.globalsoilmap.net/

some layers from the FAO:

http://www.fao.org/geonetwork/srv/en/main.home

(If you go to the portal make sure to do the advanced search and click on downloadable data as a filter option)


texts:
After trying turf.js with plain ole leaflet and getting confused because the most basic stuff wouldn't work, I'm thinking that turf.js requires Mapbox.js and access token.  Can anyone confirm or deny this??

If this is the case, I have either totally overlooked it on the turf github and the turf API site, or that information is nowhere to be found, which is kind of annoying.


texts:
This paper https://www.sciencedirect.com/science/article/pii/S1352231017300936 mentions using a 0.5° × 0.5° resolution grid, and I've tried googling to find out what that means in meters but I come across many conflicting answers.

Am I right to say this unit of measurement is called decimal degrees, the value varies depending on where you are on Earth, and for China, this 0.5° × 0.5° in meters is 55.5km x 55.5km?


texts: Loading multiple feature types as one layer in OpenLayers?

texts:
I have a kml file which contains some polygon and some point features in the same file. I am trying to load and view this layer on my basemap in OpenLayers. The problem is that the polygon features will be drawn on map but not the points.

Does this mean that a layer cannot contain both polygons and points in it at the same time?

I need these features in one layer and not separate.

The code for loading the data in OpenLayers:

Grid = new OpenLayers.Layer.Vector("grid layer", { eventListeners: {
            'featureselected': function (evt) {},
            'featureunselected': function (evt) {},
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: "sample.kml",
                format: new OpenLayers.Format.KML({
                    extractStyles: false,
                    extractAttributes: true,
                    maxDepth: 2
                })
            }),
                styleMap: new OpenLayers.StyleMap({
                "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
                    pointRadius: 6,
                    strokeWidth: 1,
                    strokeColor: "Black",
                    fillColor: "Gray",
                    fillOpacity: 0.4
                }, OpenLayers.Feature.Vector.style["default"])),
                "select": new OpenLayers.Style({
                    fillColor: "Blue",
                    fillOpacity: 1
                })
            })
        });
map.addLayer(Grid);


texts:
I am having a really hard time getting diagrams to render in QGIS 3.0. I have 5 points with 7 parameter values associated with each that I would like to depict as a histogram. I don't have "simplify geometry" selected under rendering options.

Could it be a problem with my field types?


texts: How to offset a polyline in Openlayers 3?

texts:
I retrieve ways from OSM with Overpass API and display them in an Openlayers3 vector layer. In the case of a highway with a cycleway along it (e.g. cycleway:right=track) I want to draw a green line with a slight offset to the right of the original way, like on this raster image created with mapnik:

As there is no method in Openlayers I had a look at JSTS. Polyline buffering is coming close to what I am looking for:

var bufParams = new jsts.operation.buffer.BufferParameters();
bufParams.setSingleSided(true);
var jstsGeom = parser.read(feature.getGeometry());
var buffered = jstsGeom.buffer(2, bufParams);
feature.setGeometry(parser.write(buffered));

What I need is a similar function which results in just one half of the buffer polygon. Is there anyway to do this with JSTS or any other javascript library?


texts: Incorporating terrain data to predict canopy cover using randomForest in R?

texts:
I  have a 5.8 m resolution satellite image (LISS IV by IRS-P6, in bands 4, 3 and 2) of a densely forested region in the Eastern Himalayas (altitude 700 m to 3200 m). My objective is to predict regions of canopy cover. Regions of canopy vs. non-canopy.

The R model 'randomForest' turns out to be a popular and a do-able method; now to understand how it works more thoroughly.

In the question Performing Random-Forest Classification of 10cm Imagery for species-distribution in R (no point-shapes)? the example training data has an ndvi and a class column.

Will the inclusion of terrain and NDVI datasets (elevation, aspect, slope) improve the predictive ability of the algorithm?


texts: Can't run 3D Analyst extension in custom script tool

texts:
I have custom python script in which I use 3D Analyst function "Add surface information", it works fine when I run the script through ArcCatalog Python Console, but when I try to run the script as Script Tool ArcGIS crashes without any reasonable error (program just exits). I continued to explore this problem further and concluded that I can't run any of 3D Analyst functions via script tool, but I can run them in python console.
For example:

import arcpy
#Get inputs from tool
lasdataset = arcpy.GetParameterAsText(0)
footprints = arcpy.GetParameterAsText(1)
#Calculate Z_MAX
arcpy.ddd.LasPointStatsByArea(lasdataset,footprints, "Z_MAX")

Basically ArcGIS crashes when I run this simple script with my custom tool, but completes it fine when I run it in Python console with the same input data and hard-coded paths.

I have the 3D Analyst extension and it's enabled;
I encountered this issue on my ArcGIS 10.3.1. with Advanced license
I tried to run different functions with my tool and it never crashed. It crashed only with 3D Analyst functions.

What could be the problem?

I am using ArcGIS Desktop 10.3.1.


texts: Managing large data files, vector and raster, in QGIS 3

texts:
I work for a local authority so use data covering a large area. Therefore some datasets I use become large and cumbersome.

For example I have a vector layer for contours and a raster layer for hillshade. As I am relatively inexperienced I created Booth of these of a series of tiled points and created a single file. I am happy with the results but performance is slower.

What are the main options available to improve the performance of the vector layers for a single user on one PC and for a team?  This should allow me to both display and analyse the data efficiently.

What are the main options available to improve the performance of the raster layer?


texts:
I am carrying out a nighttime light analysis on Nepal. I have searched https://ngdc.noaa.gov/eog/interest/gas_flares_countries_shapefiles.html to download gas flare shapefile for Nepal but couldn't find it.

I tried using the digital number analysis using the map algebra in the Spatial Analysis Toolbox in ArcGIS, using the formula
(0.00001*average_cvgfile -0.9), but the image seems to be same without actually removing the background noise on the image.

How else can I carry out noise removal?


texts: v.in.dxf not working properly in GRASS toolbox in QGIS 2.18.11

texts:
I am using the GRASS v.in.dxf tool from the GRASS plugin to import some contours in QGIS. Everything seems fine, but the tool does not import all the contours. There are no additional options in this tool. There are no selected features. Has anybody had this problem? I am using QGIS 2.18.11 in Windows 10 32 bits.

The reason I am using this tool is because with the "Add vector layer" option the polyline elevations are not imported, see for example (Importing 3D DXF file into QGIS with z information as attribute value?. I have donde this before using the v.in.dxf tool in the processing toolbox, but it seems is broken in QGIS 2.18.11

This is the original dxf, loaded using the Add vector layer option;

This is the imported dxf using the v.in.dxf GRASS tool:

The dxf file can be downloaded here: https://drive.google.com/open?id=0BxWWBxW4QOfdVWl3R3BMemJPTlk.

For the record, I created the file using ogr2ogr, because it seems it's the only way to export elevation to a dxf.


texts: Is there a RESTful way to cancel a GP Job?

texts:
I have an asynchronous gp service that I can successfully run and cancel from within Arcmap.

Using fiddler I see that arcmap communicates with the GP service via SOAP.

I'd like to cancel the job using a REST request.  However I don't see anything in the documentation for the GP Job describing how to do this.

Does anyone know if there's a RESTful way to cancel a job?

If not, would there be any bad side effects from writing another web service that scans the log file(s) to find the PID of the gp job then kills the process?  (The gp service is configured non-pooled).

Update
ESRI support confirmed no RESTful cancel method (incident #879881).  They suggested using the SOAP cancelJob method instead.


texts: Creating grid in ArcGIS Pro that looks exactly same as Corner Label Grid in ArcMap?

texts:
When creating a grid in ArcMap I would choose the Label Style Format of Corner label in the Grid Properties dialog box.

I am attempting to create the same grid in ArcGIS Pro, I understand you have to use Tags to alter how the grid looks. But I can not replicate the grid, so if X is 500000 and Y is 6265000 ArcMap would display it as Small 5, Large 00 followed by small 000 for the X and the Y coordinate would be displayed as small 62, large 65 followed by small 000.

The tags I have currently used to format the grid in ArcGIS Pro is as follows:

How would I replicate this is in ArcGIS Pro. I have attached two images to try to better explain.


texts: Deleting several features from shapefile using ArcPy?

texts:
I recently started working with ArcMap and Python.
I try to delete several objects from my shapefile in ArcMap. I would like to select for example the line which are too close together. I don't want to select each line separately...
Is there any chance to do this automatically using the ArcMap and Python tools?

The lines are about 5 meters apart.
I would like to get lines 10-11 meters away (so as not to change the overall shape).


texts: Why can't I define GDAL_DATA in PyQGIS script?

texts:
I created a PyQGIS standalone script in PyCharm my script use rasters layers but any time to try to run it I take this error message:

Warning 1: Cannot find pcs.csv
Warning 1: Cannot find datum.csv or gdal_datum.csv
Warning 1: Cannot find ellipsoid.csv
Warning 1: Cannot find prime_meridian.csv
ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.

But I have defined GDAL_DATA in the Windows environment:

I try to add path in PyCharm:

And I try to add path with sys.path.append and nothing again. I have checked all files in error message is in the GDAL PATH.

Any idea why I can't define GDAL_DATA?


texts: Copying an entire column between layers (tables)

texts:
I have a raster layer with probabilities as values and I process them using the Spatial Analyst extension. After the processing the values are modified, however I would like to also have the original ones stored in a separate column.

It would be nice (if possible) to avoid using two cursors (one to select data from the VALUE column and second one to insert data into a new column). Is there an easy way do that?

ADDED
OK, so actually the solution with two (or even one as suggested by Jason) cursors won't work, because the probabilities are in floats and I can't build an attribute table without converting them to ints.


texts: How do I select a group of nodes at once in QGIS? I want to draw a square and have all of the points in that square be selected; but the 'select feature by polygon' selects my entire polygon, not just the nodes.


texts: No intersection found between intersecting polygons

texts:
I'm using two geographies: one is made up of small areas (about 2200), the other large areas (about 70). Both cover all of Australia, and the small areas are not necessarily nested inside large areas. For the large areas, I was given a kml file, and a mapinfo file (both come from the Australian Bureau of Statistics). I converted both into .shp format, for use in R (using rgeos).

For each of the small areas, I would like the proportion that fits in each large area. This can be done with

gArea(gIntersection(small area, large area))/gArea(small area)

Which I execute inside a foreach loop that returns a 2200 by 70 matrix of weights.

My problem is that for some of the small regions, this method does not find any intersection (as in it returns zero for all larger areas). I have run it on shape files constructed from both the kml file and the mapinfo files, and areas with no intersection are different!

What would be the most likely cause of this sort of problem?

I have put together a little zip file containing my two shape files and the R script I'm using. I'm pretty fresh to this (3 days) so reading up on projections. The file is about 60 meg.

https://dl.dropbox.com/u/63100926/Example.zip

I now know that my small regions are in GRS80, and my big regions are in WGS84. I am having a bit of difficulty finding out how to change them.

Any pointers on where to look?