texts:
I am trying to run the raster process in QGIS 2.18. and every time I am getting an error as "Data source is invalid". What should I do?

Python error that I am getting:

2018-09-24T13:56:09 1   warning:C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py:607: ImportWarning: Not importing directory 'C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32\test': missing __init__.py
          mod = _builtin_import(name, globals, locals, fromlist, level)
        traceback:  File "<string>", line 1, in <module>
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 298, in loadPlugin
            __import__(packageName)
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
            mod = _builtin_import(name, globals, locals, fromlist, level)
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\__init__.py", line 29, in <module>
            from processing.tools.general import *              # NOQA
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
            mod = _builtin_import(name, globals, locals, fromlist, level)
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\tools\general.py", line 31, in <module>
            from processing.core.Processing import Processing
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
            mod = _builtin_import(name, globals, locals, fromlist, level)
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\core\Processing.py", line 62, in <module>
            from processing.algs.saga.SagaAlgorithmProvider import SagaAlgorithmProvider
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
            mod = _builtin_import(name, globals, locals, fromlist, level)
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\algs\saga\SagaAlgorithmProvider.py", line 33, in <module>
            from SagaAlgorithm import SagaAlgorithm
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
            mod = _builtin_import(name, globals, locals, fromlist, level)
          File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\algs\saga\SagaAlgorithm.py", line 20, in <module>
            standard_library.install_aliases()
          File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\future\standard_library\__init__.py", line 483, in install_aliases
            import test


texts: Making seamless and consistent quality of Landsat image after cloud masking and mosaicking/ median composite in Google Earth Engine

texts:
I am trying to remove cloud and composite all Landsat 5 TOA images available in a given year and region into a composite of final image. However, I noted that the quality of final composite image is not consistent and seamless over the large area after cloud masking and median composite.

I have also tried with Landsat 5 surface reflectance, but it is not much improved and the edge of each overlapping image is not consistent and seamless. Anyone can help me would be much appreciated. Here is my code https://code.earthengine.google.com/b58c843a3c1118495f53a88498089fdd:

/// Data Preprocessing: Landsat 2000

var LS2000=LS5.filterBounds(VN).filterDate("2000-01-01","2000-12-31")
.filterMetadata("CLOUD_COVER","less_than",70)// Filter the study area, cloud and date range
// Dissplay the raw image
Map.centerObject(VN,9) // Zoom in the given study area
Map.addLayer(LS2000.median().clip(VN),{bands:["B3","B2","B1"],min:0.06,max:0.3},"Landsat 2000",false)

/// Cloud Masking
var threshold=50 // Set threshold for cloud masking

var cloudmask=function(image){
  var cloudscore=ee.Algorithms.Landsat.simpleCloudScore(image)
  var cloudlikelihood=cloudscore.select("cloud").lt(threshold)
  return image.updateMask(cloudlikelihood)
} // Function to isolate cloud pixels each image

var LS2000_CloudMask=LS2000.map(cloudmask).median().clip(VN)
// Display Landsat cloud masked

Map.addLayer(LS2000_CloudMask,{bands:["B3","B2","B1"],max:0.20,min:0.09},"Landsat 5 Cloud Masked")

// 'Samples' geometry region is just example showing the inconsistency
// and unsmoothness of the image after cloud masking and median composite.

// What technique could I improve the quality of consistency and seamlessness of composite image?


texts: Orthophoto land use classification in QGIS

texts:
I am using a CIR orthophoto and tried to make a land use classification with the use of Semi-Automatic Classification Plugin in QGIS.  I work in QGIS 3.2 but I get errors that my ROI are too small (error creating signature), but my these areas are quite large. Furthermore, the classification does not work at all.
I want to know the built-up area on the orthophoto, so if there is another methodology in QGIS, I would love to know.

You can find the orthophoto on this website: http://www.geopunt.be/download?container=omz15vl&title=Orthofotomoza%C3%AFek,%20middenschalig,%20zomeropnamen,%202015,%20Vlaanderen#


texts: Google earth image appears flat and in the wrong location when georeferencing in QGIS

texts:
I've been working on data from OpenStreetMap in QGIS. I've been trying to add an image of my site which I got from Google Earth Pro so I could continue adding information that isn't available on OpenStreet Map. But I can't seem to georeference it properly.

I'm just starting to use QGIS so I've followed the georeferencing tutorials and tried a bunch of things to try to sort it out but I've run out of ideas. I've tried with different CRS (WS84, WSG/Pseudo Mercator). I've input the coordinates that I got from Google Earth, trying both DD and DMS and including the "-" for the Y since I'm in the South. I've also tried different transformation types, tried disabling or enabling "on the fly" projection etc. But when georeferencing, the image and the openstreet data do not correspond. Most of the time, the image appears in the wrong location (next to my site), a lot bigger than it should, and completely flat.

Has anyone got any idea of what I might be doing wrong or what I've missed in the georeferencing procedure?


texts: Generally accepted root mean square (RMS) error for rectifying topographic maps

texts:
This is a generic inquiry on the common practice/standard for determining the acceptable values of RMS when georeferencing topographic maps.  Is there an absolute value?

Some literature suggests that it should be "less than or equal to 1/2 of the side of a cell which make up the total resolution of the image."


texts:
I have a topographical map of the Netherlands from Esri. I was hoping if somebody could tell me how I could add this map to my QGIS.

The map can be found on:
https://www.arcgis.com/home/item.html?id=7aea6fa913a94176a1074edb40690318

It even has its own URL:
https://www.arcgis.com/home/topo_basiskaart__28in_rd_29_-_webmap_1334843157778

Is there any way that I can add this map in my QGIS project?

I am using Qgis 2.18.7


texts:
How can I show the flow coming from an Origin-Destination matrix as desire lines?
I need a result like the one in the picture below.

I need to scale them proportionally to its value (coming from a linked MDB) and I like that the lines are a bit curved (but I can use straight lines too).


texts:
I have an irregular polygon which is a spatial object.

I want to divide it into multiple polygons (say, n=25) with equal height. To show how I want to divide it, I've plotted grids on the background using:

grid(NA,25)

If it is not possible, can anyone at least tell me how I'd be able to get the coordinates of the intersection points between the gridlines (which is not a spatial object, however) and the polygon's boundary?


texts: Can you use the pixel weighting values when exporting a Google Earth Engine image asset to a GeoTIFF?

texts:
I am exporting image assets to my google drive as GeoTiffs. Each asset was originally created by clipping an image to a feature and then reprojected to a slightly coarser resolution. Therefore when using the inspector in code editor, pixels not fully covered by the polygon have a weighted value shown in brackets after the absolute pixel value.
I am aware reductions like reduceRegions uses these weightings (unless you specify an unweighted() reduction). But I was wondering if there is a way to use the weightings when exporting an image asset to drive?
Ideally, for this analysis, if the absolute value of a pixel in code editor is 1000 and the pixel weighting shows as 50%, then the value exported to the GeoTIFF in my drive would be 500, whereas currently it seems to remain 1000.
Hopefully the description is clear enough, but say if you need a code example.


texts: Drawing coordinates next to grid crossings in QGIS map composer

texts:
In the QGIS map composer, the options to draw coordinates along the grid are great.
But is it possible to draw the coordinates to the grid crosses in the map?
I can only see options to draw them along the frame. Is there any way to accomplish this via the GUI or an extra plugin? scripting?
I could not find any answers or topics related to this.
Update: anyone has any clue on how hard would this be to implement to QGIS? a plugin perhaps?


texts:
I'm new to QGIS and trying to deal with on the fly reprojection. I have three layers :

a shapefile in EPSG:4326
a raster in EPSG:3395
that same raster reprojected in EPSG:3857 (with QGIS via the "Save as..." contextual menu available when right clicking on the layer. I manually set the right extent in the options)

I want to show them in QGIS in EPSG:3857 and EPSG:4326. The three layers' CRS are set correctly in their properties window.

If I set the project CRS to EPSG:4326, the shapefile is shown correctly but  the rasters are not (they are not visible at all).

If I set the project CRS to EPSG:3857 :

the shapefile is correctly displayed
the original raster is show at the right place, but not entirely (seems like the on the fly reprojection is not reprojecting the extent correctly) -> see screen 1
the reprojected raster is displayed correctly -> see screen 2

If I set the project CRS to EPSG:3395 :

the shapefile is correctly displayed
the original raster is displayed correctly
the reprojected raster is show at the right place, but not entirely (again, seems there is a problem with the extent)

Does someone know what's happening here? Is there any way to have everything displayed correctly in EPSG:3857? Is that normal that QGIS is unable to reproject (on the fly) from EPSG:3857 (and EPSG:3395) to EPSG:4326?

Screen 1 (shapefile and EPSG:3395 raster, the raster is cut):

Screen 2 (shapefile and reprojected raster, everything OK):


texts:
I am trying to perform some rounding operations on rasters. I have used GDAL to convert the raster to an integer which is fine but now I want to /100 which should be simple in raster calculator but there seems to be some resampling or something going on, if I do 5431/100 I get 54.310001373291016 which doesn't make sense unless there is something I am missing.  My Question is what could be causing this introduction of digits that I can't account for?

Qgis 2.14 OSX 10.11.1 KyngChaos

Sample file I am using


texts: Columns in random order in attribute table?

texts:
First, I'm well aware of multiple ways to rearrange the order of the columns in the attribute table. I've used the refactor tool plenty to change permanently the structure of the table and I know I can right click on the headers and select organize columns (my traduction might be a little off since I use the French version, but you get it).

Anyway, My problem is I have layers and tables with around 150 attributes, which I need to be in a specific order. I used refactor on vector layer with great success. But now, for some reason, when I load tables from csv files, the order of the attributes is all messed up. I know my tables are right because when I get into the properties, under field, the fields are in the right order, with their ID number associated. That order is the same as in the csv files.

Why would QGIS mess up the attribute order when I load a table? I don't have time to re-order 150+ fields every time I load a table.


texts: I am trying to set a default value for a combobox to speed a highway survey. The default value doesn't work have tried various scripts but I can't get them to work.


texts: Creating non-curve circles in ArcGIS for Desktop?

texts:
How can I create circles that do not contain curves in ArcGIS 10.2?

I am capturing data into a personal geodatabase. Using the create circle tool. The data is later exported from the personal geodatabse using ogr2ogr, which does not support the extraction of curves from personal geodatabases into shapefiles.

So is there a way to draw circles as a series of lines rather then as a single curve?

Or is there a way to convert the circles into polygons later?


texts: How can I manually cut existing polylines at a point of my choosing in MapInfo?

texts: I want to edit polylines so that only the part of the polylines that fall within a certain area are remaining. SQL queries highlight the whole polyline if it falls within the desired area and hence does not achieve the goal. Thanks


texts: Vector Layer Label is truncating/rounding value

texts: I cannot figure out how to keep OpenLayers from truncating my vector layer label. For example, I have a value of 0.00 and want to show both significant digits, but it always makes it an integer 0. Is there a way to do this?


texts: QGIS 3.0 Convert a text field to a numerical field retaining the number but losing square brackets?

texts:
I tagged all my drawing objects with a identifier which includes square brackets. eg [302] [303] [509].

Edit to add further information.

Not all objects are tagged with brackets.
A few are tagged with just numbers eg 425, 359.
A few are tagged Furrow
A few are tagged Z
a few are tagged I
A few are tagged G?
A few are tagged multiple ditches
There may be a few others sometimes.

Is there a code which could read the [number] from the text field and paste the number (without the brackets) into the numerical field?

Edit - if possible the tags that are already numbers would transfer as they are, while any purely text can be left blank.

If there is such a code, how and where would I input it?


texts:
I am trying to do a simple 3D scene with orthophoto raster mosaic and DEM. The problem is that not all orthophotos render (are visible). Only approximately 50%. If I have 9 orthophotos in a mosaic, only 4 or 5 (closer ones) will be presented. I was trying with a different setting (low quality, etc.), but haven't been successful yet.
Does anyone have any ideas?
Is there any limitation in ArcGIS Pro regarding RAM usage or something?
I have 48 RAM and I can see in the task manager that this is not an issue.


texts:
I have just been introduced to GIS and GraphHopper. I am trying to create a route plan for indoors which I can feed to GraphHopper. I am trying to figure out how GraphHopper selects the best route for a point if that point is not on the route. It seems to me (I tried it out on a map I created) it selects the path nearest to the point. What happens if the nearest path is not reachable (say there is a ditch between the point and the path)? In general is there a way to specify that only certain paths may be chosen for a point. In my case, say I am trying to find the shortest path from any point within a room to another room. There are two exits from the room. Any path has to use those two. But the nearest path from the selected point is the one passing near the room just on the other side of the wall. GraphHopper seems to always choose that one because I have not told it about the wall. Is there a way to model this either in GraphHopper? If not, how do I handle it at application level. The way I can think of is to create a layer with all my enclosed areas and their exits and for any point first figure out which area it is in and draw the rout from the exit point of that area. Is that feasible?

Update: Adding a picture (a very badly made map of an office floor) to illustrate the problem. From both marked positions 1 and 2, GH will choose the lines marked in green as they are nearer but the correct paths are the ones marked in blue.


texts:
I am trying to run the following code
import os
directory_in_str='/Users/name/Desktop/test/'
directory = os.fsencode(directory_in_str)
tre='?type=csv&quote=&escape=&trimFields=Yes&skipEmptyFields=Yes&maxFields=10000&detectTypes=yes&xyDms=yes&xField=lon&yField=lat&crs=EPSG:4326&spatialIndex=yes&subsetIndex=no&watchFile=no'
start='file:///Users/name/Desktop/test/'
for file in os.listdir(directory):
     filename = os.fsdecode(file)
     if filename.endswith(".csv"):
        path_to_csv=start+filename+tre
        processing.run("qgis:joinattributesbylocation", {'INPUT':path_to_csv,'JOIN':'/Users/name/Desktop/gis/NUTS_uppdelade/NUTS_ID_SE11.gpkg|layername=NUTS_ID_SE11','PREDICATE':[0,5],'JOIN_FIELDS':[],'METHOD':0,'DISCARD_NONMATCHING':True,'PREFIX':'','OUTPUT':'/Users/name/Desktop/gis/regn/vikter/NUTS_ID_SE111900Q1.gpkg'})

My intention is to get the script to run the join attributes by location for all files in folder test. However, it returns the following error:
exec(open('/var/folders/ks/1x_p2hz95jldm5xvpjfg0gmm0000gn/T/tmpdq2z8ia3.py'.encode('utf-8')).read())
Traceback (most recent call last):
  File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "<string>", line 10, in <module>
  File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/tools/general.py", line 106, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
  File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/core/Processing.py", line 137, in runAlgorithm
    raise QgsProcessingException(msg)
_core.QgsProcessingException: Kan inte köra algoritm
Kunde inte läsa in källager för INPUT: file:///Users/name/Desktop/test/1900Q1.csv?type=csv&quote=&escape=&trimFields=Yes&skipEmptyFields=Yes&maxFields=10000&detectTypes=yes&xyDms=yes&xField=lon&yField=lat&crs=EPSG:4326&spatialIndex=yes&subsetIndex=no&watchFile=no ej hittad

Meaning that the layer could not be found. I can't really get my head around why I get this error message since it works when replacing path_to_csv with a copy paste of the strings it is supposed to combine.
So I assume that I specify the path_to_csv wrong in some sort. Any advice?
Edit 1:
If relevant, this is the code I have been successful running:
processing.run("qgis:joinattributesbylocation", {'INPUT':'file:///Users/name/Desktop/test/1900Q1.csv?type=csv&quote=&escape=&trimFields=Yes&skipEmptyFields=Yes&maxFields=10000&detectTypes=yes&xyDms=yes&xField=lon&yField=lat&crs=EPSG:4326&spatialIndex=yes&subsetIndex=no&watchFile=no','JOIN':'/Users/name/Desktop/gis/NUTS_uppdelade/NUTS_ID_SE11.gpkg|layername=NUTS_ID_SE11','PREDICATE':[0,5],'JOIN_FIELDS':[],'METHOD':0,'DISCARD_NONMATCHING':True,'PREFIX':'','OUTPUT':'/Users/name/Desktop/gis/regn/vikter/NUTS_ID_SE111900Q1.gpkg'})


texts: QGIS 3, iterate shapefiles to export mulitple pdfs from a standalone python script

texts:
I would like to load my qgis project, and a template I made into my stand alone script (in pycharm).

I have a folder with shapefiles and I would like to iterate over them, plot each one with the same symbology. Then export each map to a pdf.

I unfortunately have found very little on how to do this even in Qgis 2, and especially cannot figure it out with Qgis 3.

I have my qgis and pyqt5 paths working fine in pycharm, just don't know what to do next, or where to find info.


texts: How do I enable lineweights for my symbology?

texts:
I imported an OSM shapefile of roads data. In the layer properties, I classified  the roads based on type (motorway, trunk, residential, etc.). I can assign colors but cannot assign lineweights. I can go through the motions of changing the lineweight but when I go back into the dialog to check the lineweight, it is reverted to a default value (0.26). How do I change  the lineweight based on feature type?

QGIS 2.10

Update 1 - Steps to reproduce...

Create a new document.
Import the roads OpenStreetMap shapefile (roads.shp).
Right-click on the roads layer, select Properties.
On the Style page, select Categorized.
From the Column list, select type.
Click Classify.
Right-click motorway, select Change width.
Set the width to 2.0 (type it).
Click OK.
Again, right-click motorway, select Change width.

The width is not 2.0. It's 0.26, the default value.


texts:
So the GPS Week Number rollover has been all over the news lately. I don't really know anything about GPS, but my first thought upon reading up on this topic was: why use a week-based format in the first place?

It seems like it would have been much more intuitive to use, say, the number of seconds since the GPS epoch. I realize that there's some degree of arbitrariness to all formats, and that there's usually some historical baggage that plays in, but counting weeks seems like a very unusual choice even then.

Is there some practical or historical reason for this design?


texts: Converting RasterBrick object to im object in R

texts:
During script execution I need to convert 'RasterBrick' to 'im' object. Package 'geostatsp' is supposed to do this job:
library(geostatsp)
myraster = raster(matrix(1:100,10,10), xmn=0,xmx=10,ymn=0,ymx=10)
class(myraster)
>[1] "RasterLayer"
>attr(,"package")
>[1] "raster"

myIm = as.im(myraster)
class(myIm)
>[1] "im"

But when I try it with real data I catch an error:
library(geostatsp)

b <- brick(some_file)
r <- raster(b)
class(r)
>[1] "RasterLayer"
>attr(,"package")
>[1] "raster"

bim <- as.im(r)
>Error in .local(x, ...) : 'x' has no values

What causes this?


texts: Creating polygon from lines, using the lines' attributes?

texts: I'm trying to transform lines into polygons with the attributes. The lines are from a dwg file. I tried to use "feature to polygons" but doesn't preserve the attribute. I tries to transform lines to points and than use them in the "feature to polygons"... still doesn't preserve the attributes.


texts: Converting Date field to string using ArcGIS for Desktop?

texts:
I'm working with two data sets that require a compound key to join or relate.

The two fields are:

'Node_ID' which is a long integer field referring to a particular electrical substation [887932]
'Date_ID' which is a date field and refers to a specific time stamp. [1/13/2014 9:00:00 AM]

Since ArcGIS doesn't allow for compound joins I'm left to improvise. The solution that I would like to use is to combine these two fields into a single field. I'm thinking that a text field may be easiest but a long integer may be better for performance (this is a large amount of data) (also I'm not 100% confident that text can be indexed).

The question that I have is:
  How would I convert an ArcGIS date field to a numeric (or text) representation?

This is the part that's stumping me. I'm fairly well versed in Python but once I start mixing ArcGIS datatypes things get a bit confusing.

To get you started here are some resources:

Converting string or numeric time values into date format (This is the inverse of what I want to do)
Best practices for storing temporal data
(Note: my reputation isn't high enough to post more than 2 links)

Also, there is a pure python function that allows this conversion to happen easily. Its methods in the datetime module. Here is a quick example:

>>>import datetime
>>>current_datetime = datetime.datetime.now() # Current system time
>>>print(current_datetime.strftime('%m/%d/%Y %H:%M:%S')

>>>'01/11/2015 09:38:22'

Once in this format, I can easily manipulate it to create the join-able field that I need.


texts:
Trying to use ogr2ogr to import a shapefile in PostgreSQL. Here is my command:

ogr2ogr -append -f "PostgreSQL" PG:"host=localhost user=postgres dbname=routing " C:\Users\rizagha\Documents\ex_RWg2cV8o94r6J4c1zMUeEcSAZSvkA_osm_line.shp -nln edges -lco geometry_name=geom -t_srs EPSG:4326

ERROR 1: Unable to find driver `PostgreSQL'.

but I have used ogr2ogr to import fileGDB's into PostgreSQL and it has always worked... not sure what's wrong with my command.

I took out append and it still doesn't work.


texts: How can I set which layers are visible by default in a geoPDF?

texts: I'm using the latest QGIS version 3.10 that has the option to export to geoPDF. Currently the output has all layers visible. I'd like to set which layers are visible by default, so that the user is not overwhelmed with many layers turned on. I know I can do this with Adobe Acrobat Pro but is it possible to do this directly from QGIS?


texts: I am trying to import QgsComposerMap in my QGIS3 plugin but I always get this error:ModuleNotFoundError: No module named 'QgsComposerMap'. My import looks like this: from qgis.core import QgsRectangle, QgsComposerMap, QgsPointXY as QgsPoint The API changes don't say anything about changes of this module. What am I missing?


texts: Plot statistics of a raster dataset by latitude in GEE?

texts:
How can I plot some statistics of a raster by latitude (see bottom picture) in GEE?
Some pictures of a paper are attracting, so I want to know how to reproduce this in GEE or ArcGIS or QGIS or some simple code.

the picture is from "High-resolution mapping of global surface water
and its long-term changes"
I have not written some code, below is my idea. the raster data is annual maximum NDVI of American in 30m resolution

creating shapefile in ArcGIS by 1° X 1°
using "reduceRegion" function in google earth engine to statistic the mean value of each latitude area
making statistic pictures by R


texts: Maximising cluster density around geo points using qgis

texts:
I am looking for some advice for clustering points around other defined centres while maximising the density i.e. I need to identify clusters but constrain the cluster densities to be >= MinRequired and <=MaxCapacitywhile also keeping the clusters as compact as possible

The following discussion pointed out a way to create a buffer around my Centres and spatially join that with my points dataset to see where they overlap but is there a way to add the cluster density constraints to the method?


texts: Populating list widget in IntraMaps Roam?

texts:
How do I add values (items) in a list widget in IntraMaps Roam (2.3.1 release)?

I'm trying to add values (items) to a list widget in a form with Python code (ver. 3.3.2)
I have created the form and added attributes and controls (widgets?) in the Roam manager.
The items in a list no. 2 (veg1-2) depend on which item is selected in a list no. 1 (veg1-1).

(I have manged to base the populating of list no. 2 on the selected item in list no. 1 in QGIS ver. 2.6.1 by modifying the code I found here: How to automatically populate fields instantly?).

I would like to implement something similar in __init__.py of the form (Test) in my project (Vegetasjonstest) created in Roam Manager.

I have read the Roam's "wiki", but how do I code

self.boundwidgets['veg1-2'].setvalue(…)

correctly so that veg1-2 list is populated with items?

From my C:\IntraMaps Roam\projects\Vegetasjonstest\Test\__ini__.py file (aere I'm using a change in a text widget "anna1" to change the value of another text widget "tre1" (this works fine) while changing the item in the list widgets fails, i.e. nothing happens. However, the showpopup functions works. Just using it as a test.):

def uisetup(self):
    """
    Called when the UI is fully constructed.  You should connect any signals here.
    """
    self.boundwidgets['anna1'].valuechanged.connect(self.handler)
    pass

def handler(self, value):
    liste1 = ['a','b','c']
    if ( self.boundwidgets['anna1'].value() == "b" ):
        self.boundwidgets['veg1-2'].setvalue("blomst ; blume")
        # self.boundwidgets['veg1-2'].showpopup()
        self.boundwidgets['tre1'].setvalue("Gran")

I have tried several ways like e.g.

self.boundwidgets['veg1-2'].setvalue("blomst")
self.boundwidgets['veg1-2'].setvalue("a,b,c")
self.boundwidgets['veg1-2'].setvalue(liste1)

without any luck.


texts: Convert feature class names to lower case?

texts:
I'm simply trying to loop through the first immediate set of folders in a directory, then the GDB's, and finally the feature classes, however, now I get "ERROR 000840: The value is not a Data Element. Parameters are not valid" for random feature class names that are being converted. For instance, it will convert one feature class named "S_WTR_LN" to lower case but will recieve the error with a feature class named "S_GEN_STRUCT". This happens when it reaches line 25, at the first arcpy.Rename_management.

UPDATE: Somehow there was a lock in arc catalog. After reseting everything, it worked -_-  Final working code is below for reference.

import arcpy
import os

rootdir = r'\\server\test\ARCHIVE\\'

for subdir in os.listdir(rootdir):
    path = rootdir + subdir
    arcpy.env.workspace = path
    databases = arcpy.ListWorkspaces("*", "FileGDB")

    for database in databases:
        arcpy.env.workspace = database
        fcList = arcpy.ListFeatureClasses()
        for fcName in fcList:
            if fcName.islower():
                pass

            else:
                fcLCName = fcName.lower()
                arcpy.Rename_management(fcName, 'TEMPNAME', 'FeatureClass')
                arcpy.Rename_management('TEMPNAME', fcLCName, 'FeatureClass')


texts:
Line style in leaflet always are solid ,I want the line to be
 -1)Dashed line style  -2)Train line style

  var L2 = new L.geoJson(L2, {
  style: function(feature) {
    return {
      color: 'black',
      weight: 7
    };
  },
  onEachFeature: function(feature, layer) {
    layer.on({
      'mousemove': function(e) {
        e.target.setStyle({
          weight: 7,
          color: 'red'
        });

      },
      'mouseout': function(e) {
        L2.resetStyle(e.target);
      },
      'click': function(e) {
        mymap.fitBounds(e.target.getBounds());
        L2.bindPopup("<b>" + feature.properties.Nom);
      }
    });
  }
}).addTo(mymap);

Here is  my code result


texts: Can't get georeferenced Autocad DXF to right coordinates

texts:
I am not a frequent Autocad user.

I wanted to export some floorplans from Autocad 2016 DWG to a final GeoJSON file to be loaded in a Google maps JS app.

My steps are:

1)in Autocad set a location of one of the drawing points with Edit location-> From map, choosing an arbitrary SRS (Mercator, pseudo mercator, local)

2)save as DXF

3)open in QGIS setting the origin SRS, or convert with ogr2ogr setting source and dest SRS or load in https://mygeodata.cloud converter

4)view the shape: the shape is correct in both proportions and shape, but it always gets placed between Latin America and Africa ((0,0)???)

I don't know actually if i'm doing something wrong in Autocad or elsewhere but i have no more ideas left.


texts: Legend text not printing with Mapfish print

texts:
I am using GeoNode 1.6.11 and GeoServer 2.7.4. I am configuring Mapfish Print's config.yaml file to show the legend, but it is not working properly. I have the icons showing up on the PDFs, but the layer text is not appearing. This is my legend entry in the config.yaml:

    - !legends
      backgroundColor: #0033cc
      horizontalAlignment: left
      borders: false
      layerFont: Helvetica
      layerFontSize: 10
      layerSpace: 5
      maxIconWidth: 50
      maxIconHeight: 50
      classFont: Helvetica
      classFontSize: 20
      classSpace: 5
      classIndentation: 20
      fontEncoding: Cp1250

The result is a legend with all icons, but no text labels. How can I get the legend text to appear on the PDF output? Is this a geoserver/style issue or a print module/config.yaml issue?

UPDATE: when a layer only had 1 category, the layer text does not appear on the legend. When the layer has multiple categories, it does appear, but it is very tiny (with the settings above). Note that the styling was done within GeoNode.


texts: With QGIS Plugins/PluginBuilder, how to prevent 2nd instance of Plugin from starting

texts:
I am using QGIS 2.6.0, with PluginBuilder 2.0.3 [checking the version, I just noticed that the 2.1.0 update is available]

I am writing a plugin; it installs and runs.  While running, I am able to initiate a 2nd instance of MyPlugin by hitting the MyPlugin Icon on the toolbar, or selecting it with the menu item.

I could add code to remove/disable the icon and menu item at the head of the def run(self) function, and restore it before gracefully exiting the plugin.  However, if there is a crash, or non-graceful exit, I won't have access to the icon.

Instead, I wonder if I may test for an already existing instance (say, by discovering the named mainDialog on a list, somewhere?  Or some other scheme?) and, if the prior instance exists, bring that existing instance's dialog box to the front and then close the second instance.

MyPlugin's dialog is not modal, by choice, so I would like to prevent a user from initiating two instances.

Suggestions ?


texts: Creating Shapefiles from MS SQL using ColdFusion/Java?

texts: A client wants to export, from their MS SQL server, data into Shapefiles. I've looked around for a starting ground and have heard Ogr2Ogr mentioned and it seems intimidating. So I was wondering if there were any libraries out there that did this or if anyone could suggest a place to start?


texts:
I am trying to create a spatially enabled PostGIS database. I am following the PostGIS documentation, http://postgis.net/docs/manual-1.5/ch02.html#id2648455.

In the short version, i executed,

createdb yourdatabase
createlang plpgsql yourdatabase

But I did not execute the last three commands,

psql -d yourdatabase -f postgis.sql
psql -d yourdatabase -f postgis_comments.sql
psql -d yourdatabase -f spatial_ref_sys.sql

Is my database still spatially enabled? If not, then can you tell me where these .sql files are located so I can execute those last commands, since I am getting the following error,

postgis.sql: No such file or directory

I am using Ubuntu 12.04


texts: I can't tell if my GeoJSON file is too large for openlayers

texts:
I am a bit new to this GIS thing. I have shapefile that I fed to geoserver in order to retrieve a GeoJson file. I was attempting to display this on openlayers, but it won't show anything. The file is a feature collection of  2450 multipolygons, that is about 2.2 mb big. I tried reducing it to only 3 features, but it does not seem to show anything at all.
However, if I open the browser console, I can see that I did load 3 features, even though they are not painted in the map. I am not sure if they are too small be visible, or if I have to supply a special style for multipolygons.
When I try to load my whole geojson file, it still won't show anything, but in the console I can see that only 50 features were loaded. Moreover they were loaded in a very odd order. Probably because it is stored as a tree.
[42, 34, 24, 36, 33, 31, 22, 43, 44, 21, 28, 47, 16, 49, 32, 40, 39, 19, 38, 50, 25, 37, 27, 1, 2, 3, 9, 8, 12, 10, 11, 7, 5, 18, 20, 45, 41, 23, 35, 30, 26, 4, 17, 48, 15, 14, 29, 6, 13, 46]

So, how can I get it to load more than 50 features? I am using this example  as a template, which loads 176 features just fine.
So, what's wrong with those 50 features that won't show up in the map?
Am I missing something? Would a PostGis connection solve this? If so, could you please point me to the right tutorial? I am feeling quite overwhelmed by this :s
UPDATE:
It turns out I wasn't able to see any of the 50 features that actually got loaded because I set the wrong projection in geoserver. I still don't know why I am only getting 50 features though.
Better Update:
It turns out that geoserver has a setting for maximum number of features set to 50. I disabled that and got the whole set of features that is about 123 mb big!
I am guessing this is a very poor way to get my data read.


texts: GDAL: How to build an image pyramid starting from the base

texts:
Normally I would create an Image Pyramid using gdal_retile.py on one large image or a set of large images.

I want to do the opposite. I have all the zoomed in tiles on the base level and I want to build (mosaic) my tiles into the rest of the levels required to build a pyramid. As GIS-Jonathan assumes I want to have the lower resolution tiles for zooming out.

                      ^      <- I want these
                     /_\     <-      :
                    /___\    <-      :
                   /_____\   <-      :
                  /_______\  <- I want these
                 /_________\ <- I have this level!

Can this be done using GDAL or similar?

I guess this would be the same as interupting gdal_retile.py just when the lowest level is finished and telling it to continue from the next level. But I don't know if this is possible?


texts: Creating new layer that shows income demographics for US by zip code in ArcMap?

texts:
I am trying to create a map to plot specific points on the US and compare information such as income, race, religion, and so on.

I am using the shapefile Zip Code Tabulation Area from Census.gov and have pinpointed my info to the specific locations.

Is there a way I can create a new layer that shows the income demographics for the US by zip code?


texts: Spatial join with GeoPandas with two geometry columns

texts:
I have one GeoDataFrame which contains two geometry fields - one is polygon and one is the polygon centroids. The table has also other fields.
I have run spatial join between the gdf and another shapefile of the regions (e.g the shapefile has many polygons of different regions). I have used "op='within' in order to speed it up (and it did):
join=gpd.sjoin(gdf, regions, how='left',op='within')

The problem is that the join didn't work when the polygons touched the borders of the regions' polygons.
For example, here you can see that polygons that are inside specific region have a peach color, the ones outside are green but the ones touching the border are purple:

I believe that if I would use the centroids instead of the full polygons, I could get better results.
Is it possible to tell GeoPandas which geometry column to use?
I have tried to use the set geometry, then do the spatial join and then change it as well:
df.set_geometry('centroids')
join=gpd.sjoin(df, regions, how='left',op='within')
join=join.set_geometry('geometry')

but I still got the same results.


texts: Select specific layers from a WMS using URL link

texts:
I have a WMS from the Scottish Natural heritage which contains multiple layers:

https://cagmap.snh.gov.uk/arcgis/services/snh_habitats_and_species/MapServer/WMSServer?request=GetCapabilities&service=WMS

I am wanting to put this as a service into ArcGIS Online, but I only want one layer imported from the service. The layer is “Special Areas of Conservation” I understand that you can add GetRequests into the above link to select the layers, but I cannot get it to work.

I have tried putting the WMS into QGIS, and I can see all the layers, but I cannot get the URL for just the one layer I need.

Can anyone help? I know its probably quite simple and its been frustrating me for a few hours.


texts: Linking Leaflet Js GeoJson Data to a Chart

texts:
I am looking for a way to link the drawn polyline to a chart with leaflet js. I want the position in the chart to be highlighted, when I hover over the polyline and vice versa. Basically what runtastic does on their website (I linked an image in the bottom). Right now I am using HighCharts and am quite satisfied with it. I discovered Linking polyline features on web map to Google Chart?

However it wasn't really answered and the link in the comment leads to a 404 page.


texts: Are .mbtiles supported in the current GeoServer REST API?

texts:
Saw that there was a pull request for GeoServer to support .mbtiles in the REST API.
Is this currently supported?


texts: What is the advantages\disadvantages of applying the “allow clients to export cache tiles” in the ArcGIS server

texts: I couldn’t figure out what is the advantages\disadvantages of applying the “allow clients to export cache tiles”in the ArcGIS server when setting advanced cache settings.


texts: Show count of same attribute in feature (on visible map or by same field)

texts:
In QGIS 2.14 I have a feature with two fields;
Element Type (TF1, TF2, TF3, TF4)
and
Trail Nº (1, 2, 3, 4, 5, 6)

Each Trail has multiple Elements. I.E. Trail 1 may have 6* TF1 and 2* TF2, while Trail 2 may have 0* TF1 and 2* TF2

I am trying to report on the number of Elements on each individual trail with a feature count.

At present in a print composer I can show what Elements are on the trail through an attribute table. I am doing this by Categorising the feature by Trail Nº and then having layer settings showing only one trail (i.e. trail 3). This allows me to show a map with only a single trail and its elements. I am then using an attribute table with the "Show features only visible within map" turned on to show a full list of attributes on that map / trail.

This shows a list like
Element Type
TF1
TF3
TF3
TF3
TF9
TF9

I am also using the "remove duplicate rows from table" to show like this
TF1
TF3
TF9

This is great but what I would like it to do is display the elements and the number of elements on that trail, I.E.

TF1 - 1,
TF3 - 3,
TF9 - 2

It would be easier if I was only trying to count the number of elements in the feature, but because I am trying to count the number of elements on each specific trail I am having trouble. I am happy for this to be either calculated and added to the feature by way of new column or calculated in an attribute table on the composer. Either is fine. Most important I don't want elements that are not on the trail showing in the list - I.E I don't want '0' counts to show.

some trails will have up to 70 of the same element so difficult to do this manually.

Have looked at Group Stats but not familiar enough with how to write expressions to make all this work.....


texts: Is it possible to prevent Google Earth to set 3D buildings ON with a KML tag on the file that I'm opening?

texts:
I often generate a KMZ file with an overlay that, in Google Earth, appears like this:

The cut on the raster image are caused by this setting on Google Earth:

I wonder if there is a way to prevent/bypass Google Earth 3D Buildings setting directly in the KML/KMZ file that I'm opening.


texts: ArcMap "Unique values, many fields" styling in QGIS

texts:
I would need to reproduce an ArcMap cartography project in an equivalent QGIS project.
in the ArcMap version the symbolization of some layers is done through the "Unique values, many fields" method, ie:

how can i "translate" this method in QGIS?


texts: Could the result of GWR regression be valid when the number of feature class used in the analysis is not up to 30

texts:
I am using Spatial Statistics tool (GWR regression)of the ArcGIS 10.3 for my PhD research, the smallest geographical area in the study is called a ward. There are 27 wards in the study area, these wards formed the polygons while industries (SMEs) and their coordinates formed the points.  After I have aggregated the point data and the polygons and ran the GWR regression, I always get results from the analysis. However, in all the results ArcGIS suggested feature class be not less than 30. Meanwhile, the number of my polygons (feature class) is 27.

What do I do?


texts:
I have created a model that takes a point layer that contains elevation data, then interpolate it using TIN and then clip the results according to shapefile.
The problem is that the model works and does the TIN, but for some reason the clip failed all the time.
I made sure everything is on the same projection so that's not the problem.

here is a screenshot of the model error message-

I know it says that the error is with the tin. but whenever I run the model without the clip it works.

this is my model-

Edit-

this is the error message I get after clip the raster manually-


texts:
The code below was working, but now it is not. This isn't my actual production code, just my KML test document to make sure everything is working. I got this document as a working example from stack exchange.  I saw it working earlier today and yesterday. There is a div at the bottom for the KML status and it even says: OK!.  I hate it when things do not work, but there is not error returned.

    <!DOCTYPE html>

When the code is working, red fire hydrants should appear on the map.


texts:
I have a raster attribute table associated with an IMAGINE .img raster that I build and open with:

IGPUtilities utils = new GPUtilities();
IRasterDatasetEdit2 raster = (IRasterDatasetEdit2)
    utils->OpenRasterDatasetFromString(path);

raster.BuildAttributeTable();
ITable vat = (raster as IRasterBandCollection).Item(0).AttributeTable;

I need to add new column to the table and populate with values. However, calling AddField on the table throws "The method or operation is not implemented" exception.

IFieldEdit field = new FieldClass();
field.Type_2 = esriFieldType::esriFieldTypeString;
field.Name_2 = "Name";
vat.AddField(field as IField);  // Throws

Is there a direct way how to modify the existing attribute table or do I have to create one on my own and assign it to the raster using IRasterDatasetEdit2::AlterAttributeTable()?

I'm using ArcObjects .NET SDK with ArcGIS 9.3.1.

Edited

Once again ArcMap behaves curiously: When I open the raster in ArcMap after my code failed to add the field, I can open the attribute table but the 'Add Field...' option is disabled. If I remove the raster and open it again, I can add fields from ArcMap and also my code works!

Everything works fine with GeoTiff images.

I do not think this is a locking issue since I'm releasing all COM instances (via System::Runtime::InteropServices::Marshal::ReleaseComObject())


texts:
Right now I am stumped on how to get two layers to interact. I have one layer that is just a map with town borders, with attributes for town codes. My other layer are data for businesses, wages for example. I setup a relate in the project properties menu between them using town codes, and I can see in the attribute table the the map layer knows what businesses exist in each town now.

However, I can't seem to make use of it. If, for example want to select by expression to just select towns where the average wage is over a certain level, I can't even begin because I can't write an expression using values from both layers, even though I set them up in a relation.
How would I really go about doing this?

I am trying to figure out how to query, select, or anything using attributes from two related layers.


texts: Adding nodes to multiple, stacked features

texts: Am am working in QGIS on a dataset with multiple, overlapping polygons, often sharing borders. Sometimes I want to adjust a border, and need to add more nodes. Normally I would doubleclick a line to insert a node, but if I need to adjust multiple, stacked features, it would be nice to be able to do that for the whole stack. Is it possible to work on a number of stacked features simultaneously, and e.g. add a node to every “layer”?


texts:
I have table which I need to get all the OID's from it.

I tried this code :

List<int> OIDList = new List<int>();
IQueryFilter queryFilter = new QueryFilterClass();
queryFilter.SubFields = "OBJECTID";

for (int i = 1; i <= table.RowCount(queryFilter); i++) {
    OIDList.Add(i);
}

But the problem is there is some values were skipped, e.g. the table contains 60 row but the OID for the last row is 100.

In the code above, I can not catch any OID more than 60.

How can I get all the OIDs?


texts: Which bins should be used for demographic data for a choropleth map?

texts:
I'm currently working on a project which produces a choropleth map similar to a map like this: http://dl.dropboxusercontent.com/u/54512470/Telefondaten_VIZ/index.html

That map has 2x5 classifications (5 for positive migration numbers, 5 for negative ones.)

I have different underlying numbers than the one I linked. How do I decide the following things:

Linear or Exponential increase of the break points (10, 20, 30, 40, 50 vs. 10, 20, 40, 80, 160)? Or even square-root-shaped?
related: If linear(ish), when is it ok to make some bins larger than others?
'final break point', i.e. what would be the equivalent of -500 and 500 in the linked example

Is there generic advice on these things which can be given without looking at the data?

Edit: The reason I don't want to post the data here is that I'd like to use some kind of algorithm to automatically create bins and resulting choropleth maps. Unlike the linked project, I don't have the migration data for a fixed timespan, but I have data for 2007, 2008, and so on up to 2011. I'd like a radio button to switch between the years (can combine several years).

I don't want the colors to be consitent between different different settings (i.e. + 5000 in year 2007 may have a different color than for 2010 + 2011), but to be informative for a fixed year.

One approach I was thinking of is: Take the largest absolute migration number (e.g. 1200) and round down to the nearest 50, 100, 500, 1000 and so on. This is the lower border of the dark orange, let's call this threshold number T (i.e. 1000 in this example). The threshold for the dark blue is everything below -T (i.e. -1000). The binning points of the linked project are T/10, T/5 and T/2 (in the example 100, 200, 500). I'm unsure about these particular break points. Why not T/10, T/4, T/2 (100, 250, 500)?


texts: How to install QGIS with OpenGeo Suite on Ubuntu

texts:
I was wondering how should one install QGIS after installing OpenGeo Suite on Ubuntu Linux?

I installed OpenGeo 4.1 on Ubuntu 12.04 following the instructions on the official website http://suite.opengeo.org/4.1/installation/ubuntu/install.html, which involves adding the OpenGeo repository

echo "deb http://apt.opengeo.org/suite/v4/ubuntu/ precise main" > /etc/apt/sources.list.d/opengeo.list

I installed QGIS following this GIS.SE answer, which involved adding

"deb http://qgis.org/debian precise main"

Both packages seem to be functioning. But there seems to be a conflict in the Ubuntu's repository system after installing these two. When I tried to apt-get install curl, I was told that there is a conflict, and I need to use 'apt-get -f install'.

I had to restore my OS to the previous state without QGIS.

I also tried to apt-get install qgis after installing opengeo, without adding the qgis.org repository, and I got an error like this:

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

E: Package 'qgis' has no installation candidate

My question is, what's the proper way to install QGIS and OpenGeo together?

-- Update --

I have tried to download boundless's version of GIS, as suggested in one of the answers. But their package are for windows and mac only. No Linux version is provided.


texts: Mapping points from total station data in Angle, Horizontal Distance, Vertical Distance

texts:
I am working on creating a contour map from total station topo points in ArcGIS 10. The points were collected using H angle, HD, VD instead of XYZ points. I need to create points from these measurements with elevations. I have tried using the Bearing Distance to Line Tool and then creating points from the vertices of lines (see https://gis.stackexchange.com/a/31956/18682) but the Bearing Distance To Line Tool does not recognize the angles in my input file (I've tried .csv, excel, and attribute table from feature class created from the excel file). My angles are in Decimal Degrees, which is the default for the tool. What might I be doing wrong? Does anyone have any suggestions for a better method?

Also, I am trying to use COGO to create these points. Can anyone help by explaining how to use COGO in ArcGIS Desktop 10 with a table of Distance and Bearings?


texts:
I am very new to ArcGIS and have the following problem: I have a shapefile with around 1500 regions worldwide and want to calculate for each region the distance up to the coastline of its own country (or if the country has no access to the ocean, the nearest coastline).

I have a shapefile with data on all coastlines worldwide. However, the lines forming the coastlines are not country-specific (i.e. there is not 1 line feature for the coastline of each country).

Is it possible to extract national coastlines from this data? How could I proceed?


texts: QGIS printing shift on WGS 84 Pseudo Mercator base?

texts:
I've had this problem before but I'm not succeeding in fixing it using what I thought worked before.  This has been brought up as an issue previously, but I'm stuck when I apply the previous answers.  There must be numerous people doing the same thing.

I am running QGIS 2.8.2 on Mac OS X (10.10 Yosemite) with OpenLayers 1.3.6

I start off a new project by using the OpenLayers plugin to connect to Google or Bing Maps.
I confirm or set the project projection to EPSG3857 for WGS 84 Pseudo Mercator.
Then I add a layer in a different project (happens to be IRENET95).
Zoom to the new layer and everything fits very nicely on the screen.
Open a new Print Composer and add a map.  Things look good on the screen still.
Export as a pdf or image and the image base seems to have shifted.

Am I missing something simple or obvious here? In case this is not all clear I've attached two images below.  The first is the screen (of Print Composer) and the second is the exported file.


texts:
I noticed a strange behavior when creating a new QgsFeature object and adding it to a layer, inside a QGIS plugin. Let me first briefly explain the structure of my plugin: I have a main function that iterates on the features of a layer and calls two subfunctions at each iteration (let call them subfunction1 and subfunction2). Basically, this can be seen as:

main function
| for …
| | subfunction1
| | subfunction2

In subfunction1, I create a new QgsFeature:

newFeature = QgsFeature() # newFeature.id() gives 0, which is normal
newFeature.setGeometry( … )
newFeature.setAttributes( f1.attributes() )
…
dataProvider.addFeatures( [newFeature] )

Now, here's the issue: after adding newFeature to the dataProvider, newFeature.id() keeps giving 0 in the rest of subFunction1 and in subFunction2. However, in the next iteration, newFeature.id() gives a correct, incremented id in all subfunctions.

Note that if I choose a specific id for newFeature (e.g. if I write newFeature = QgsFeature( 99 ) instead of newFeature = QgsFeature()), the problem remains the same. The specified id is overwritten by an automatic id, in the next iteration only. Everything else (geometry, attributes) is fine.

So my question is: when is newFeature's id supposed to be set by the QgsFeature class (or anything else)? Clearly, it is not immediate but has to wait some trigger. I googled the issue and tried to browse the C++ source, but it didn't help me much.


texts: How can i filter on ID's through WFS Post request?

texts:
I want to select a set of features from my GeoServer (its Running 2.0.0) and use a query using multiple ID's to get their values. For this i send XML in a post message to the Geoserver:

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" service="WFS" version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" maxFeatures= "7000" >
    <wfs:Query typeName="*:MyFeatures_df16" xmlns:feature="http://www.openplans.org/topp">
        <ogc:Filter>
            <ogc:And>
                <ogc:OR>
                    <PropertyIsEqualTo>
                        <PropertyName>ID</PropertyName>
                        <Literal>98400005701</Literal>
                    </PropertyIsEqualTo>
                    <PropertyIsEqualTo>
                        <PropertyName>ID</PropertyName>
                        <Literal>-1</Literal>
                    </PropertyIsEqualTo>
                </ogc:OR>
                <ogc:And>
                    <ogc:PropertyIsLessThanOrEqualTo>
                        <ogc:PropertyName>MH_DATUM_INGANG</ogc:PropertyName>
                        <ogc:Literal>2015-02-27T00:00:00Z</ogc:Literal>
                    </ogc:PropertyIsLessThanOrEqualTo>
                    <ogc:Or>
                        <ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyName>MH_DATUM_EINDE</ogc:PropertyName>
                            <ogc:Literal>2015-02-27T00:00:00Z</ogc:Literal>
                        </ogc:PropertyIsGreaterThanOrEqualTo>
                        <ogc:PropertyIsNull>
                            <ogc:PropertyName>MH_DATUM_EINDE</ogc:PropertyName>
                        </ogc:PropertyIsNull>
                    </ogc:Or>
                </ogc:And>
            </ogc:And>
        </ogc:Filter>
    </wfs:Query>
</wfs:GetFeature>

The filter based on the date (MH_DATUM_BEGIN/MH_DATUM_EIND) is working as expected. But the filter using  is completly ignored.
One of the returns includes:

<gml:featureMember>
      <ws_df16:MyFeatures_df16 fid="MyFeatures_df16.fid--7d7f79e6_14bcb33c65d_161">
         <ws_df16:GEOMETRIE>
            <gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#28992">
               <gml:outerBoundaryIs>
                  <gml:LinearRing>
                     <gml:coordinates decimal="." cs="," ts=" ">197089.235,393933.984 197059.285,393941.753 197057.851,393936.587 197061.768,393935.646 197059.436,393926.758 197062.756,393925.888 197062.109,393923.534 197071.095,393921.174 197072.634,393927.002 197074.054,393932.378 197084.891,393929.538 197087.87,393928.757 197089.235,393933.984</gml:coordinates>
                  </gml:LinearRing>
               </gml:outerBoundaryIs>
            </gml:Polygon>
         </ws_df16:GEOMETRIE>
         <ws_df16:ID>98400007766</ws_df16:ID>
         <ws_df16:MH_DATUM_INGANG>2010-01-01</ws_df16:MH_DATUM_INGANG>
         <ws_df16:GIS_ID>288830</ws_df16:GIS_ID>
      </ws_df16:MyFeatures_df16>
   </gml:featureMember>

In this part of the response, the Date is correct(like all of the answers) but it returns all of the thousands of features in GeoServer.
I want to select that specific ID because it is used in other parts of a larger application.

How can i make sure that my filter query is used as well?


texts: Why is ReduceRegions returning null values when I reduce using a feature collection?

texts:
I am running a landtrendr script which returns some disturbance-related values (year of disturbance, duration... among others) for an area.  I would like to reduce the result of the area by a large feature collection, containing approximately 50 geometries, but whenever I try reduceRegions using a feature collection the landtrendr values come back as NULL.  Using reduceRegions using a single geometry yields expected results.  I have used reduceRegions in similar landtrendr scripts with success.

https://code.earthengine.google.com/653980324a2b05f8060a8d3ea1e5d0da

var features = [
  geom1, geom2
];
var featColl = ee.FeatureCollection(features)

//print(featColl);
// define collection parameters
var startYear = 2001;
var endYear = 2012;
var startDay = '06-20';
var endDay = '09-20';
//var aoi = ee.Geometry.Point(-122.8848, 43.7929);
var aoi = AOI
var index = 'NDVI';
var maskThese = ['cloud', 'shadow', 'snow', 'water'];

// define landtrendr parameters
var runParams = {
  maxSegments:            6,
  spikeThreshold:         0.9,
  vertexCountOvershoot:   3,
  preventOneYearRecovery: true,
  recoveryThreshold:      0.25,
  pvalThreshold:          0.05,
  bestModelProportion:    0.75,
  minObservationsNeeded:  6
};

// define change parameters
var changeParams = {
  delta:  'loss',
  sort:   'greatest',
  year:   {checked:true, start:2002, end:2012},
  mag:    {checked:true, value:200,  operator:'>'},
  dur:    {checked:true, value:4,    operator:'<'},
  preval: {checked:true, value:300,  operator:'>'},
  mmu:    {checked:true, value:11},
};

//##########################################################################################
// END INPUTS
//##########################################################################################

// load the LandTrendr.js module
var ltgee = require('users/emaprlab/public:Modules/LandTrendr.js');

// add index to changeParams object
changeParams.index = index;

// run landtrendr
var lt = ltgee.runLT(startYear, endYear, startDay, endDay, aoi, index, [], runParams, maskThese);

// get the change map layers
var changeImg = ltgee.getChangeMap(lt, changeParams);
print('changeImg', changeImg);

var reducedCI = changeImg.reduceRegions({
  reducer: ee.Reducer.max(),
  collection: geom1,
  scale: 30
});
print('reducedCI', reducedCI)

/*Export.table.toDrive({
  collection: reducedCI,
  folder: 'Test_Folder',
  description:'reducedCItest',
  fileFormat: 'CSV'
});
*/

In the script I am trying to reduce the image "changeImg" by a test feature collection containing two geometries, with the output being a feature collection "reducedCI".   Any idea why only null values are being returned?


texts: Geotiff downloaded with same coordinate system don't overlap

texts:
I am a beginner usign ArcGis, i downloaded two geotiff with the same cellsize and with the same GCS ( GCS_WGS_1984)  but it seems that the two images don't perfectly overlay. Looking at the extent of these images i noticed that:

Geotiff1:

extent left: -180,008333334
extent right: 180,008333275

While the other one:

Geotiff2

extent left: -180
extent right: 180,000033063

So for both the right extent is greater than +180 while for the first one the left extent is lower than -180. I know that the problem is related to the coordinate system but i can't understand where i make the mistake


texts: How to perform tree birthrate and mortality research with GIS

texts:
I'm using QGIS 2.6 and have 4 layers of polygons. Each of these polygons describes the outline of a tree, based on airborne imagery.

My goal is to find the relations between every synchronously sequential couple of layers. For every tree in every couple of layers I need to tell whether it survived, was born or died with respect to previous layer.

How can I do this?


texts: Attribute Table not showing newly created features

texts: I'm using ArcMap. I have a File Geodatabase Feature Class stored in a network geodatabase. I have approximately 30 feature classes on our "Master" mxd file, but one of them has a major issue. When I use editor to create a new feature in this class, the new feature is shown on the map. However, the new feature is not shown in the attribute table. I've tried sorting by ascending and descending on the ObjectID, and it is nowhere to be found. Any suggestions?


texts: Connecting every point with each other with line in ArcMap

texts:
I have a dataset of points and I would like to make lines connecting each point with all the other points of the dataset.
It is similar to Creating all possible line segments between all points using QGIS but I want to do it in ArcMap.
Is this possible?


texts: GeoJSON maps created with D3 appear flipped/inverted

texts:
I am learning how to convert ESRI shapefiles to GeoJSON and then work with it in D3. I am following Mike Bostock's tutorial on Medium (https://medium.com/@mbostock/command-line-cartography-part-1-897aa8f8ca2c#.8jny46gjo) to help me as I go. The tutorial overestimates my ability a bit, however.

First I went to get a shapefile. I decided to use Australia. In this case I used the "Postal Areas" shapefile from http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.003July%202011?OpenDocument

Then I opened it in QGIS to get a sense for what to expect. I noted that it uses EPSG:4283 and looked that up on Spatial Reference (http://spatialreference.org/ref/epsg/4283/html/). I tried, but failed, to use this to get some kind of understanding of what projection to use in D3 but decided to move forward anyway.

I dug around a little more and found an Australian Albers projection (http://spatialreference.org/ref/epsg/3577/html/) that looked a bit more like the California Albers that Bostock used in the tutorial and ran with that.

Next I moved on to converting my shapefile to GeoJSON. I deviated from the tutorial a bit here by using ogr2ogr because I had some trouble with shp2json. I ran the following command using the shapefile name provided in the zip file:

ogr2ogr -f GeoJSON -t_srs epsg:4283 POA_2011_AUST.geojson POA_2011_AUST.shp

Update: If I put that into mapshaper.org, I get the following, which looks correct. I think my problem has to do more with what I am doing in D3, below.

Since I had the Australia Albers projection information from EPSG:3577, I used that in geoproject as follows:

geoproject 'd3.geoConicEqualArea().parallels([-18,-36]).rotate([-132,0]).fitSize([960,960],d)' < POA_2011_AUST.geojson > aus_postal-transmerc.json

I took the output, aus_postal-transmerc.json and dropped it into mapshaper.org to see what I had achieved.
Its something, but not much - I basically have an upside down map of Australia.

I have spent hours but I cannot seem to hit on a lead that gives me an idea of what I am doing wrong. I thought perhaps the original shapefile might be a problem so I tried the same test for a shapefile of Japan. I used d3.geoTransverseMercator() in that case but ultimately ended up with the same problem - the result was an upside down map.

The only thing I have not tried yet is just throwing things at the wall to see what sticks - randomly using different projections until something just works. That seems wrong, though. I imagine that there must be recommended projections for each shapefile but I am completely stumped.

Am I missing something terribly obvious?


texts: Creating multi-ring buffers around points in a single layer and for each point selecting neighbors within a specified radius in R

texts:
I have a CSV file of data on a set of 3000 points (locations) with respective coordinates and a number of attributes. I want to perform a regression analysis that takes cognizance of any spatial relationships among the points(locations). As such, I want to arrange the data in a dataframe in a way such that for each well, I will have the following:

A list of points (location IDs) within the specified radius of the buffers around each point(location), where the specified radius are for example:  0.5, 1, 2, 3, 4, 5 miles.
The sum and/or average of the values of given attributes(eg. population_size) of the point (location) that fall within each of these specified radii of each point (location).

I want to write the resulting table to a CSV file.

Below is what I tried based on some online resources.

library(raster)  # for handling geographic raster data
library(dplyr)
library(ggplot2)
library(stringr) # for working with strings (pattern matching)
library(rgdal) #For checking available CRSs interactively.
library(lwgeom) #Needed for distances
library(geosphere)
library(data.table)
#library(maps)
library(reshape)

#Load Data:
data<- read.csv("Loc.csv")

#Set as sf object
datatosf=st_as_sf(data,coords = c("lon", "lat"))

#Then set appropriate geometric CRS as
datatosf_geo = st_set_crs(datatosf, 4326)

#Then project into UTM
data_projected = st_transform(datatosf_geo, 26913) #26913 is for NAD UTM Zone 13

# create all possible pairs of origin-destination in a long format

newdata <- expand.grid.df(data_projected ,data_projected)  #Uisng the sf object data or projected data here gives me erro below:
Error in lapply(x[i], as.numeric) :
 'list' object cannot be coerced to type 'double'

#But when I use the original csv data, data, I do not get this error

newdata <- expand.grid.df(data ,data)
names(newdata )[28:29] <- c("lat_dest","lon_dest")

# calculate distances in miles:
setDT(dtt)[ , dist_km := distGeo(matrix(c(lon, lat), ncol = 2),
                                 matrix(c(lon_dest, lat_dest), ncol = 2))/1.609]

#Write results to a csv file
write.csv(newdata,'newdata.csv')

Now, clearly I did not create buffers. Instead what I have is a table with each point(location) and the distance from it to all other point s(locations) (including itself) -- that is a 9,000,000 rows of data. And my CSV file could return or load only about a million rows.

Additionally, since I couldn't use the projected data, I am not even sure if the resulting distances are correct. Apart from zero which makes sense for distance between a point (location) and itself, the least distance is around 277. I

I am new to using R, especially to do spatial analysis. I understand I need to create a distance matrix with the buffers around the points(locations). How can I achieve my aim using R?


texts:
I am trying to calculate a sum for a set of raster but before I need to disregard  No Data values (that are equal to -9999 for my rasters) by using SetNull function. It gives an error.

What could be the problem?

Here I'm attaching the function.

def __calc_seasonal_cumulative_raster(self, data_lst):
    print "\nCalculating seasonal cumulative raster."
    with open(self.log_file, 'a+') as f:
        f.write("\n\nCalculating seasonal cumulative raster.")
    outSetNull = sa.SetNull(data_lst, data_lst, "Value = -9999")
    cumu_ras = sa.CellStatistics(outSetNull, 'SUM', 'DATA')
    print "Calculated seasonal cumulative raster."
    with open(self.log_file, 'a+') as f:
        f.write("\nCalculated seasonal cumulative raster.")
    return cumu_ras

I am using arcpy. The error message is also attached.

Calculating seasonal cumulative raster.
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pydev\pydevd.py", line 1741, in <module>
    main()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pydev\pydevd.py", line 1735, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pydev\pydevd.py", line 1135, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "H:/FEWS/KnowledgeBase/bin/global/yearly/chirts/global_yearly_chirts_products.py", line 228, in <module>
    main()
  File "H:/FEWS/KnowledgeBase/bin/global/yearly/chirts/global_yearly_chirts_products.py", line 201, in main
    calc_cumu(years, seasons, temp_dir)
  File "H:/FEWS/KnowledgeBase/bin/global/yearly/chirts/global_yearly_chirts_products.py", line 51, in calc_cumu
    my_global_season.create_seasonal_cumulative_raster()
  File "H:\fews\knowledgebase\lib\yearly_chirts_global_processes.py", line 199, in create_seasonal_cumulative_raster
    cumu_ras = self.__calc_seasonal_cumulative_raster(seasonal_rasters)
  File "H:\fews\knowledgebase\lib\yearly_chirts_global_processes.py", line 795, in __calc_seasonal_cumulative_raster
    outSetNull = sa.SetNull(data_lst, data_lst, "Value = -9999")
  File "C:\ArcGIS\Desktop10.6\ArcPy\arcpy\sa\Functions.py", line 340, in SetNull
    where_clause)
  File "C:\ArcGIS\Desktop10.6\ArcPy\arcpy\sa\Utils.py", line 53, in swapper
    result = wrapper(*args, **kwargs)
  File "C:\ArcGIS\Desktop10.6\ArcPy\arcpy\sa\Functions.py", line 335, in Wrapper
    where_clause)
  File "C:\ArcGIS\Desktop10.6\ArcPy\arcpy\geoprocessing\_base.py", line 510, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))
RuntimeError: Object: Error in executing tool


texts: How Can I Calculate Time from Coordinate?

texts:
For my application I am searching for an API or an algorithm for clicking point time and time zone. I dont know how I can do this but after getting time I want to calculate giving coordinate sun rise/set time... I prefer python but javascript is okay.

I know EarthTools gives the information you need but I want to use it for local needs. In EarthTools I noticed that the given time is wrong, it is approximately one hour back...

Thank you in advance.


texts:
This is somewhat of a broad question. I'm basically looking for the best or easiest way to control the layout of a page with a Leaflet map. Say I want the map to be located on the right side of the screen, mobile friendly and resize responsively. I've been playing around with Leaflet for a little while and haven't found a convenient way to control the maps location and size on the page. Am I better off with traditional CSS or maybe something like Bootstrap? Could there be a plug-in I've overlooked?

Like I said, it's a broad question. Not looking for specifics. Just a sense of direction, so I don't run down unnecessary rabbit holes.


texts: Nesting filename in composer without file extension

texts:
I just want to supress the file extension (.qgs) on my file name: srv1245_d005.qgs.

[% substr(@project_filename ,1,12)%] works although sometimes our filename will be 13 characters long or more so to supress the extension only would be the ideal solution.


texts: Scaling georeferenced image to half of its size using QGIS

texts: I want to rescale a georeferenced image half of its size using QGIS. I tried the Freehand georeferencing Plugin. It is not working properly i.e no option to enter scale factor(0.5). I want to do it as I do use AutoCAD i.e by entering a value scale factor 0.5.


texts:
Maybe this is more of a PDF question than a GIS question.

Today, I received a layered PDF map shown as a landscape A3, with a square map on the left, and with the map title, the legend, the scale, a tiny overview map etc. on the right-hand side. However, each legend item had two tick boxes beside it: one for switching on/off the symbols and one for switching on/off the labels. It also contained radio buttons to switch between various background maps. I thought this was really elegant, and would like to create something similar.

I know how to create a layered PDF in ArcGIS, and then go to the Layers toolbar in Adobe Reader to switch on/off layers in the map. However, I'd like to know how I can embed the layer control inside the map.

(Note: I am not looking on how to draw individual tick and radio boxes, as I feel it's done by some application (semi-)automatically)

EDIT:
Here is a picture of it, cut down to the bare minimum for copyright reasons


texts: Using variable (input parameter) as out_name to create feature class?

texts:
I have a dilemma, I am trying to create a new feature class, but I want the user to be able to input the name of the new fc.

I have created the variable 'newFC' as getparameterastext(2), but how do I enter the variable into the CreateFeatureclass_management line (as the out_name)?

If I enter it as below I get an error, if I enter it as "newFC" i get a feature class named newFC.

import arcpy
from arcpy import env
import csv
from arcpy import da

env.overwriteOutput = True

env.workspace = arcpy.GetParameterAsText(0)
inputText = arcpy.GetParameterAsText(1)
outpath = arcpy.GetParameterAsText(0)
newFC = arcpy.GetParameterAsText(2)

textfile = open (inputText, "r+")

fc = arcpy.CreateFeatureclass_management(outpath, newFC, "POLYGON")
arcpy.AddField_management(newFC, "Parcel", "TEXT")
cursor = arcpy.da.InsertCursor(newFC, ["SHAPE@","Parcel"])
array = arcpy.Array()
point = arcpy.Point()

parcel = ""

for line in textfile:
    splitline = line.split(" ")
    if splitline[0] == "Spatial":
        sr = int(splitline[2])
        spatialreference = arcpy.SpatialReference(sr)
        print "Spatial reference is", spatialreference.name
    elif splitline[0] == "Name:":
        parcel = splitline[1]
    elif splitline[0] == "\n":
        polygon = arcpy.Polygon(array)
        cursor.insertRow([polygon,parcel])
        array = arcpy.Array()
    else:
        ex = splitline[0]
        point.X = ex[:-1]
        point.Y = splitline[1]
        array.add(point)

textfile.close()
del cursor

arcpy.DefineProjection_management(fc, spatialreference)

mxd = arcpy.mapping.MapDocument("CURRENT")
df=arcpy.mapping.ListDataFrames(mxd, "*")[0]
layer_name = newFC

arcpy.MakeFeatureLayer_management(fc, layer_name)
add_layer = arcpy.mapping.Layer(layer_name)
arcpy.mapping.AddLayer(df, add_layer)

print "Success!"

edit:
I am adding getparameterastext(2) as a string and the error message I get is:

  Traceback (most recent call last): File "\SNHU-LABS-UTIL2.snhu-labs.com\userprofiles$\william.herzig\Documents\programming\module_7_data\module_7_data\week7final\week7ba.py", line 17, in  fc = arcpy.CreateFeatureclass_management(outpath, newFC, "POLYGON")
  File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 2019, in CreateFeatureclass raise e ExecuteError:
  ERROR 000354: The name contains invalid characters Failed to execute (CreateFeatureclass).


texts: We have KMZ files of different satellite images. We want to check which cities these satellite images belong to. Is there a way to do it automaticly? Like a tool in ArcGIS or QGIS or whatever?


texts: What's the value of being GISP certified?

texts:
I was wondering if someone could relate instances where being GISP certified helped : finding employment, getting promoted, drumming business up, noticed by your peers, the authority to sign off on deliverables, being the minimum requirement at your place of employment  etc...  ( for e.g a PE and a PMP help with these requirements)

This is an interesting thread
http://www.thegisforum.com/forums/t/608.aspx?PageIndex=1

Is this a marketable certification?
There is no test involved, its a review of your employment function, coursework and community participation as it pertains to GIS and if you make the cutoff you get to add GISP after your name.
Go on a job portal and search GISP for all of US, you would find no or 1 at best returns.
Its no where as respected as being a PE or PMP


texts: Warning: implicit list embedding of S4 objects is deprecated

texts:
From this code:

na_cells <- as.data.frame(extract(r_temp, poly_contour, cellnumbers = TRUE))

Why do I get this warning?

Warning in `[<-`(`*tmp*`, cnt, value = p@polygons[[i]]@Polygons[[j]]) :
  implicit list embedding of S4 objects is deprecated

Here are some details on my raster and shapefile:

> r_temp
class       : RasterLayer
dimensions  : 4876, 9864, 48096864  (nrow, ncol, ncell)
resolution  : 30, 30  (x, y)
extent      : 188384.5, 484304.5, 4914481, 5060761  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
data source : C:\Users\Pierre\AppData\Local\Temp\RtmpKWmDgF\raster\r_tmp_2016-05-16_204325_10956_97931.grd
names       : layer
values      : 1, 8  (min, max)

> poly_contour
class       : SpatialPolygons
features    : 1
extent      : 189644.5, 483014.5, 4914961, 5060761  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

Recently, I have installed a new version of R (version 3.3.0). Before that, my code has worked. Is it possible that this warning is caused my version of R ?


texts: In arcgis10.2, can I access arcobjects using python?

texts: I am using python in Arcgis 10.2, but it seems Python cannot meet all my developing demands, from the forum, others recommend to use python to access arc objects,but what they mentioned is the old version, so I want to confirm whether I can make it in 10.2, any extension needed? If can, I can use vb.net and c# right? Everybody has experience on it?


texts: GeoExt: Excluding some of the layers from the legend

texts:
Openlayers and GeoExt for producing a web map. The map has a legend panel generated by GeoExt. By default, GeoExt grabs the details of every layers from the map and create a legend for all the layers. However, I would like to exclude some of the layers to be displayed from the legend, what should I do to achieve this?

    legendPanel = new GeoExt.LegendPanel({
    map: map,
    title: 'Legend Panel',
    renderTo:'description',
    border: false,
    autoScroll: true,
    defaults: {
        style: 'padding:5px',
        baseParams: {
            FORMAT: 'image/png',
            LEGEND_OPTIONS: 'forceLabels:on;fontName=Verdana;fontSize:11'
            }
        }
    });

Thanks!


texts: Does the "Quick-TRANSfer stage steps exceeded maximum" warning message affect my unsupervised classification results?

texts:
A similar version of this question has already been asked here, but there was no satisfying answer yet.

I get the following warning for some of my satellite images: Quick-TRANSfer stage steps exceeded maximum (=5000000).

How do people usually deal with this warning?

(I am using the unsuperClass function from the RStoolbox package.)


texts: Reclassifying rasters using GDAL and Python?

texts:
Using @SS_Rebelious very useful answer, I am trying to reclassify rasters using GDAL and Python.

I have a grayscale raster (with values ranging from 0 to 255) and I want to reclassify it to a binary raster.

From the answer I referenced, I'm using the following line:

# reclassify raster values equal 16 to 7 using Numpy
temp = numpy.equal(raster, 16)
numpy.putmask(raster, temp, 7)

I'm experimented with something like this:

temp = numpy.greater_equal(raster, 1)

This seems to work fine, but is this best way of reclassifying a raster using Python?


texts: Export multiple shapefiles to one DXF file using Python

texts:
I'm trying to convert shapefiles into one DXF file using pyqgis, I started with one layer, the problem is that I can't open the DXF file after conversion.

I've tried two approaches but still getting the same problem.
First approach: based on this answer

from PyQt4.QtCore import QFile
dxfExport = QgsDxfExport()
layers=[QgsDxfExport.DxfLayer(iface.activeLayer())]
settings = iface.mapCanvas().mapSettings()
dxfExport.setMapSettings( settings )
dxfExport.addLayers( layers )
dxfExport.setLayerTitleAsName(True)
dxfExport.setDestinationCrs(26191)
dxfExport.setForce2d( True )
dxfFile = QFile( 'C:\\Users\\Desktop\\test\\file.dxf' )
dxfExport.writeToFile( dxfFile, 'utf-8')

second approach : based on this answer

I converted my shapefile to geojson then used FWtools to convert the geojson file to dxf.

ogr2ogr -f DXF test.dxf test.geojson

Is it possible to access source code of 'project>DXF export' funcionality ?


texts: Syntax for "fields to keep" of Intersection tool in graphical modeler

texts:
I'm working with QGIS 3.2 Bonn and try to set up a workflow with the graphic modeler.

The model uses the Intersection Tool from the QGIS Geoprocessing Tools. The model works, but I don't want to keep all fields from the intersection process.

In this case, the tool provides the possibility to set "Input fields to keep" from the input feature layer and "Intersect fields to keep" from the intersect feature layer. I was able to define just one field to keep, but in case of several fields to keep in the output, I couldn't find any solution yet.

I tried different syntax possibilities:

[attributefield1, attributefield2, ...]
["attributfield1", "attributefield2",...]
"attributefield1", "attributefield2", ...
'attributefield1', 'attributefield1',...

In the QGIS online-manual I found only this information:

Input fields to keep [tablefield: any] [list]
Optional
Choose here the field(s) of the input layer to be kept. If no fields are chosen all fields are taken.

https://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vectoroverlay.html#intersection

How do I set the list of fields there?


texts: Export dojo datagrid results to csv in javascript web application

texts:
I have created a web application using the esri javascript web api.  I populate a dojo datagrid with results returned from a querytask.  My question is, how do I export the results to a csv file?

I have been able to loop through the datagrid and add all the results to a csv string, but have not been able to figure out how to actually write it to a document and prompt the user to download the file.

Any help would be greatly appreciated.

Thanks,
Mark


texts: Grouping lines together to form one line after a distance threshold is met

texts:
I have lines on a map showing the most direct way from point data to the coastline (polygon).

I would like to group the lines if they are close to each other by a distance that I can set.

Where the clusters are, I'd like them all to group together when they get close enough to each other to become one line.

What would be the best way to do this?


texts: Installing QGIS plugins inside container

texts:
I am looking to setup a QGIS container equipped with a particular plugin, in order to handle some processing.
I have pulled the offical QGIS Docker image. However, I have run into problems attempting to make use of the pyplugin_installer inside the container. When attempting to load the plugin repository, I get this:
>>> pyplugin_installer.instance().fetchAvailablePlugins(False)
/usr/lib/python3/dist-packages/qgis/utils.py:792: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  mod = _builtin_import(name, globals, locals, fromlist, level)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/share/qgis/python/pyplugin_installer/installer.py", line 125, in fetchAvailablePlugins
    fetchDlg = QgsPluginInstallerFetchingDialog(iface.mainWindow())
AttributeError: 'NoneType' object has no attribute 'mainWindow'

Is it possible to install plugins without invoking the GUI? Perhaps this should be built into the pyplugin_install install.py script if not possible.


texts: Google.maps.ImageMapType getTileUrl maximum length

texts:
I am using google.maps.ImageMapType to render a GeoServer WMS to Google Map. When a request is made, it uses GET.

I am concern the WMS getMap length might exceed 4k in length due to a requirement to embed very long sld_body in the GetMap request. Is there anyway to change this to a POST instead of a GET?

Due to network restriction, I can't use the SLD& parameter and provide a URL instead. It has to be sld_body& which can potentially be long.


texts:
I have some troubles displaying a WFS layer with OpenLayers and hope someone here can give me a hint. Before moving on, I precise that I have already checked other posts, like here and here but, for any reason, it hasn't solved my problem yet (and by the way, thank you to the contributors to those posts, they made me understand a little bit better already)... The WFS layer appears in the layer switcher, but not at all on the map.

So, here is the configuration of my data:

Workspace: luma_project (this is the default workspace)
Workspace URI: http://localhost:8080/luma
URL for WFS: http://localhost:8080/geoserver/wfs
Layer name: adresspt
SRS: 4326

and here is my OpenLayers code:

var adresspt_wfs = new OpenLayers.Layer.Vector("Adress points WFS", {
  strategies: [new OpenLayers.Strategy.BBOX()],
    protocol: new OpenLayers.Protocol.WFS({
    url: "http://localhost:8080/geoserver/wfs",
    featurePrefix:"luma_project",
    featureType: "adresspt",
    featureNS: "http://localhost:8080/luma",
    srsName: "EPSG:4326",
    geometryName: "the_geom",
    version: "1.0.0"
  })
});
map.addLayer(adresspt_wfs);

Do you see anything missing here? As my data is stored in a (local) PostGIS database, should I refer to it as workspace:store:layer? or workspace:layer?

Also, I precise that I have no trouble to display this layer as WMS in OpenLayers and that I can even display it as WFS in Quantum GIS. The problem thus doesn't come from the data or the Geoserver, but really from my OpenLayers code.

Any help will be greatly appreciated!

EDIT:

Here is the full code:

var map;

function init() {
var bounds = new OpenLayers.Bounds(
    13, 55.67, 13.5, 55.8
  );

 var options = {
    projection: new OpenLayers.Projection("EPSG:4326"),
    displayProjection: new OpenLayers.Projection("EPSG:4326"),
    maxExtent: bounds,
    units: 'degrees'
  };

  map = new OpenLayers.Map('map');

  var transportation = new OpenLayers.Layer.WMS(
    "Lund transportation network", "http://localhost:8080/geoserver/wms",
    { layers: 'lu_transportation',
      format: 'image/png',
      srs:'EPSG:4326',
      transparent:'true',
      zoomOffset: 11,
   },
   {isBaseLayer: true, opacity: 0.4});

  var adresspt_wfs = new OpenLayers.Layer.Vector("Adress points WFS", {
    strategies: [new OpenLayers.Strategy.BBOX()],
    protocol: new OpenLayers.Protocol.WFS({
      url: "http://localhost:8080/geoserver/wfs",
      //featurePrefix:"luma_project",
      featureType: "luma_project:adresspt",
      featureNS: "http://localhost:8080/luma",
      srsName: "EPSG:4326",
      geometryName: "the_geom",
      version: "1.0.0"
    })
  });

    map.addLayer(transportation);
    map.addLayer(adresspt_wfs);

  map.addControl(new OpenLayers.Control.Navigation());
  map.addControl(new OpenLayers.Control.LayerSwitcher());
  map.addControl(new OpenLayers.Control.Scale($('scale')));
  map.addControl(new OpenLayers.Control.MousePosition({element: $('location')}));

  map.zoomToExtent(bounds);

}

And then the HTML code:

    Coordinates of the mouse:
...

EDIT (2)

Just to try out, I have added another WFS layer, from a remote server, and still nothing displays... I took the exact code of this page, which is:

var test_wfs = new OpenLayers.Layer.Vector("WFS", {
  strategies: [new OpenLayers.Strategy.BBOX()],
  protocol: new OpenLayers.Protocol.WFS({
    url: "http://demo.opengeo.org/geoserver/wfs",
    featureType: "tasmania_roads",
    featureNS: "http://www.openplans.org/topp"
  })
});

I really don't understand... this layer displays perfectly on this page, but not on mine... with the same code...


texts: Which plugin can draw topoJson right within Leaflet without conversion?

texts:
I already have asked how to reduce file size and increase performance for publishing spatial data on the web using Leaflet, here.

A conversion to TopoJSON has reduced the file size by approximately 10x, which is awesome, and I thought that would solve both of my problems and world would come to peace.

Never have I been so wrong. (in the voice of Bilbo Baggins)

The problem is, when the map is zoomed, I have to wait a while before my polygons come to resolution. Until then, the map freezes and cannot be panned or done anything for about 3-4 seconds. If I overclick the map in this interval, the Chrome tab crashes.

This also happened when using GeoJSON, because I am using this client-side API that converts TopoJSON into GeoJSON within the browser. Thus, using TopoJSON reduces transferred data but does not increase the performance, because basically the browser is still reading data from the bulky GeoJSON, but I just don't see it. It's still taking up 10 times the file size of TopoJSON in the RAM, which explains the freezing.

Which Plugin can draw TopoJSON right within Leaflet without conversion, so that a lot of space frees up on RAM?

Thanks in advance.

EDIT: Although I upvoted R.K.'s answer, I still am in search for a decent plugin.


texts: PostGIS: floating point representation problem with ST_AsText

texts:
I have a table with geometries, all with about 13 digits of accuracy. While trying to represent them with ST_AsText though, most vertices come out in decimal notation, but some come out in scientific notation. Problem is, I'm extracting these geometries in a python script and parsing them to arrays through regular expression, and the e- notation is screwing this up.

This does not happen frequently, but once is enough to halt the entire process (or more precisely, generate incorrect results for the remainder of the geometry). I have tried truncating the coordinate values to less digits, but it matters not, the same vertices get modified by some reason. ST_AsEWKT turns up the same problem, as expected.

Why is this happening? Any solutions I could use to either solve this problem or work around it?


texts: I can't get infowindows to display in the public version of my Carto map

texts:
I've got a fairly basic map with 3 layers: https://open-data-charter.carto.com/viz/844cc5da-34a9-11e6-810e-0e3ff518bd15/public_map.

For countries and cities I have selected infowindows to come up when you hover over either the countries or cities. In the Carto editor the infowindows appears for both cities and countries, however, in the public version of the map it only works for countries.


texts: WGS1984 polygon labels incorrectly located in web mercator projection?

texts: I have polygons for states/provinces (wgs1984). When I label these polygons in ArcGIS (web mercator) some of the labels occur in random locations. For example, texas might show up in southern canada, while ontario and quebec will show up in virginia. Any suggestions?


texts: Exporting map frame to JPEG with world file (or GeoTIFF) using ArcPy for ArcGIS Pro?

texts:
Is it possible to export a Map Frame to JPEG with a world file (JPW) that respects its extent?

Using ArcGIS Pro 2.0.1 (and I think the behaviour at 1.4.1 was the same) I have noticed something that seems odd.  Using the GUI it is possible to have a Map active and Share | Export Map to produce a JPEG (*.jpg) file with an accompanying world file (*.jpw) that appears to be what is seen in that Map at the time it is exported.

To see this:

Create a new project called TestProject in C:\Temp using Map.aptx as a template.
Run the ArcPy code below to write a test feature class (fishnet) into its file geodatabase.

import arcpy
testFC = r"C:\Temp\TestProject\TestProject.gdb\TestFC"
if arcpy.Exists(testFC):
    arcpy.Delete_management(testFC)
arcpy.management.CreateFishnet(testFC,
                               "152 -25", "152 -24", 0.1, 0.1, 10, 10, None,
                               "NO_LABELS", "DEFAULT", "POLYGON")
sr = arcpy.SpatialReference("Geocentric Datum of Australia 1994")
arcpy.management.DefineProjection(testFC,sr)

In ArcGIS Pro add the feature class to the project's only Map
Insert a Layout into that project (I used A4 Portrait)
On that Layout insert a Map Frame using the Map (not at the Default scale)
Make the Map active, and use Share | Export Map to C:\Temp\Map.jpg and tick the Create world file box. This makes C:\Temp\Map.jpw as well

The Map looks like this in ArcGIS Pro:

The Layout looks like this in ArcGIS Pro:

When I use ArcMap 10.5 to check whether the world file is working I need to edit the coordinate system (Geocentric Datum of Australia 1994) onto Map.jpg using the Catalog window first, but then I can display it against the OpenStreetMap basemap to see:

which does not look great but it was quick to make and looks like it is the area I am after.

In contrast, when I try to do the same thing using ArcPy for ArcGIS Pro there is not a method to export from a map object but there is one to do it from a map frame:

import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\Temp\TestProject\TestProject.aprx")
lyt = aprx.listLayouts("Layout")[0]
mf = lyt.listElements("MapFrame_Element", "Map Frame")[0]
mf.exportToJPEG(r"C:\Temp\Map2.jpg",96,True)

This took 10-20 mins to complete and produced this when I viewed it in ArcMap and gave it the same coordinate system (Geocentric Datum of Australia 1994):

I have no idea why it produces an image over such a large extent, and I am assuming that it is doing that which causes it to take so long to export.

The behaviour is the same with ArcGIS Pro 2.1.2 when trying to exportToTiff and create a GeoTIFF.


texts: OpenStreetMaps: what are the !pixel_width! and !pixel_height! in the queries

texts:
The Github repository containing the CartoCSS styling for the OpenStreetMaps dataset also defines queries for the different layers (see this file).

An example of such a query is

SELECT
    way,
    "natural",
    waterway,
    landuse,
    name,
    way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
  FROM planet_osm_polygon
  WHERE
    (waterway IN ('dock', 'riverbank', 'canal')
      OR landuse IN ('reservoir', 'basin')
      OR "natural" IN ('water', 'glacier'))
    AND building IS NULL
    AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real
  ORDER BY z_order, way_area DESC

Running this query against my local database fails with

ERROR:  column "pixel_width" does not exist
LINE 7:             way_area/NULLIF(!pixel_width!::real*!pixel_heigh...

as error message. This is on Ubuntu where psql --version outputs

psql (PostgreSQL) 9.3.10

Anybody has any idea what those pixel_width and pixel_height values are, and what I need to do with my local PostGIS database to run those queries ? The steps on the OpenStreetMap Wiki do not list anything special.

The closest match I found is the ST_PixelWidth function but this is for rasters, and the syntax used in the examples does not match the syntax used in OSM. So it is obviously not that


texts: Importing a CSV with EWKB field into Postgres

texts:
I have a csv that I'm trying to import in postgres with postgis enabled but can't seem to get the EWKB field to work. I have created a table:

CREATE TABLE sample_data (
    id character varying(200) NOT NULL,
    uid character varying(200) NOT NULL,
    point_geom geometry(Point,4326) NOT NULL);

and then copied the data from the csv into it:

COPY sample_data FROM 'D:/Workspace/sample_data.csv' DELIMITER ',' CSV;

Sample CSV:
"id","uid","point_geom"
"1953642","12359234","0101000020E610000030629F008AB937407D2079E750FC4240"

Error I get from Postgres is:
ERROR: parse error - invalid geometry
SQL state: XX000
Hint: "point_g" <-- parse error at position 7 within geometry
Context: COPY sample_data, line 1, column point_geom: "point_geom"

Anyone have any ideas? That error is not exactly the clearest to me...


texts: problem after merge shapefiles, can't show it on OpenLayers with GeoServer

texts:
I have 5 .shp files, after merge it with geomerge, I can't use it on OpenLayers with GeoServer. it's only show white layer and when i click it, it show error message:
Internal error occurred ShapeType changed illegally from Arc to Point . what should I do?