Python is an open source interpreted programming language used in many GIS programs.

learn more… | top users | synonyms

0
votes
0answers
4 views

How to Use Fiona to Convert an ESRI GDB to PostgreSQL / PostGIS?

Is there a way to use Fiona instead of OGR to convert a GDB over to postgresql / postgis within Python? If so, how or where can I look? I cannot seem to find this within the Fiona site or by simply ...
0
votes
0answers
14 views

Gdal_merge doesn't work

I have gdal installed and (I though) working fine. I use a lot rasterio and sometimes gdal directly, but today I wanted to do a mosaic and I wanted to try gdal_merge.py, but when I try to launch the ...
0
votes
0answers
17 views

How to call a Windows Batch Script (BAT file) with Python in QGIS

I have a windows batch file (.bat) which executes some Oracle Queries. I want to integrate this Batch Script in a QGIS Plugin. How can I do this with Python? The cx_Oracle Python extension module ...
1
vote
1answer
15 views

SVG to PNG in plugin code - python

I am making a plugin and what I want to do is display a preview of image in widget. I have previews saved as SVG files. I found a way to show it in plugin window but I must convert them to PNG first. ...
2
votes
0answers
24 views

Dynamically load symbols preview to plugin

I am working on plugin which combines two *.qml files into new one. Now I'm trying to generate something like "list" in plugin interface. What I have done so far is saving repeated in both files keys ...
0
votes
0answers
27 views

How to transfer x, y, and z values from LAS/LiDAR file to GeoTiff using Python?

I have LAS files containing x, y, and z coordinates from LiDAR point cloud data, and with python I can get one single attribute (elevation, or z points) to transfer to a GeoTiff via interpolation and ...
0
votes
1answer
17 views

How to calculate next point given two gps coordinates and speed? [on hold]

If an entity is traveling in a straight line and at a known speed of 1km/min, how can I calculate the next point at time t given two gps locations? The altitude does not matter. The gps format is in ...
0
votes
1answer
33 views

Missing qgis icon resources for symbology dialog

I'm trying to call QgsRendererV2PropertiesDialog from a standalone Qgis python script. It mostly works, except there's some "unknown error" messages related to SVG files when I trigger the dialog: ...
0
votes
0answers
37 views

Shortest path between some points in QGIS

I'm using QGIS software to calculate shortest distance between 750 points (rental stations of the bike sharing of London) on OpenStreetMap. The lines should follow the streets of the map downstairs. ...
0
votes
0answers
20 views

Getting HTML webpage into QGIS layers panel

I have created a webpage that capture information from heremaps and write to DB using Heremaps API and PHP. How do i run this webpage into QGIS like other WMS or WFS and do the same mechanism which it ...
2
votes
1answer
87 views

Finding the coordinate system info from a LAS/LiDAR file with Python?

I found several examples of how one can query and manually set a coordinate system on a tif/raster file (GDAL/Python: How do I get coordinate system name from SpatialReference? or Is it possible to ...
1
vote
0answers
20 views

Compare symbols in pyqgis

I'm working with renderers and I want to compare symbols from two different renderers. Is there any way to do it in pyqgis/python? Here is how I get symbols: renderer = layer.rendererV2() category = ...
0
votes
1answer
28 views

GeoDjango - faster way to use polygon.crosses?

I have a polygon and a line segment. I want to know if the line segment is both inside and outsize the polygon. Using "prepared" has helped but it's still no where near fast enough. how can i speed ...
1
vote
1answer
33 views

How do I connect my Python script external to the Grass GIS 7 program in Windows 10?

I've tried to find resources online to link and run my Python script externally from Grass GIS 7, however, I have not been successful. I found resources here that provide instructions (e.g., https://...
2
votes
1answer
20 views

Does the GDAL GeoJSON driver read or write multipart geometries?

In the documentation for the GDAL GeoJSON driver, I can only see mention of primitive geometries. Does the GDAL GeoJSON driver read multipart geometries like MultiLineString? If not, is there ...
1
vote
2answers
35 views

How to force ogr to treat JSON mapserver query as “Multiline” instead of “Line” geometry type?

I have a script that obtains feature data from a JSON output of an ArcGIS REST MapServer. At present my script treats the JSON data as a "LineString" Geometry type, but, the JSON data is in fact a "...
0
votes
1answer
11 views

tilestache url format

Documentation at http://tilestache.org/doc/#over-http says this is the format of requesting your tile /{layer name}/{zoom}/{column}/{row}.{extension} Now, my question is what column and row stand for?...
3
votes
1answer
22 views

How do I use mapbox tiles with folium?

I cannot find correct usage for using custom mapbox tilesets with folium. From the documentation, "Folium also supports Cloudmade and Mapbox custom tilesets- simply pass your key to the API_key ...
0
votes
1answer
23 views

Problems with conversion xml -> dict -> xml - python

I want to convert xml (qml) file to dictionary, then convert this dictionary to new xml. (Also want to edit something, but first lets just convert it in both way without it.) I'm using xmltodict ...
0
votes
1answer
30 views

Create ShapeFile from CSV Using OGR and Python

I want to convert a CSV file of point coordinates to a ShapeFile using OGR and Python. The example.csv file looks like this: ID,X,Y 1,240007.000,647756.000 2,240008.000,647756.000 3,240009.000,647756....
0
votes
1answer
36 views

Plotting large shapefiles with matplotlib

I'm writing a little GIS tool in Python and I want to display shapefiles. I've successfully gotten matplotlib working using this answer, but it is very slow and heavy to load any shapefile that ...
-1
votes
0answers
15 views

water framework directive python script [closed]

Does anyone of you, know where I can get from python script (open source tools) to convert/transform hydrologic data into appropriate standards (water framework directive, INSPIRE, etc)?
0
votes
1answer
22 views

Copy features from one layer to another with ogr and python

I have two layers with the same feature definitions named lyr and lyr_add. These layers were populated from a JSON based mapserver. I would like to append all of the features from lyr_add to lyr, ...
2
votes
1answer
42 views

Selecting features from shapefile where field=“value” using Geopandas?

I don't understand the difference between OGR and Geopandas librairies. I have checked the documentation of GDAL as well as http://geopandas.org/ but I still don't get it. I just started learning ...
2
votes
1answer
29 views

Update EVLR header info for .LAS file using laspy

I'm trying to change the header info for a LAS file using the python 2.7 (64-bit) laspy module (version 1.2.5). I'm attempting to follow the example shown here (in the section "Writing Data + EVLRS"): ...
0
votes
0answers
12 views

Problem with dicttoxml module import

I have python 2.7 and I have just installed (via pip) a module named 'dicttoxml'. This module should work with 2.6+ python version. I am importing it to my *.py file and using it in my plugin code. ...
0
votes
0answers
17 views

QGIS python pyd extension and execute python command from pyd

I create python extension as pyd in visual studio. This test made in Delphi. Extension run python command use PyRun_SimpleString or any RUN function. If this extesion import from python console ...
0
votes
1answer
38 views

Converting polyline coordinates to lat/lon for use in google maps

I am given an ArcGIS polyline (or polypoint) from a WFS service (e.g. 1693669.5143, 5672605.5392), and am looking for a function (python, java, whatever) to convert it to a lat/lon so I can use it in ...
2
votes
1answer
52 views

Python if, and, or to compare field values and assign new value

I have 3 fields in a table that i need to evaluate and return a new value based on the results using the field calculator (PYTHON) They are: SETSPAID (long) This field must = 0 TYPEOFSERVICE (string)...
0
votes
0answers
22 views

Finding intersections in multiple files and exporting to single shapefile using OGR

I saw this solution using Shapely, but unfortunately I can't get Fiona to work with my Python IDE nor with OsGeo4W. I have a single shapefile that has a 500m buffer on about 350 trail polylines. I ...
1
vote
1answer
59 views

Resample SMOS dataset using cKDTree and Bilinear interpolation

I have three datasets now. One is SMOS level3 soil moisture dataset which is in EASE grid 2.0 ~25km cylindrical projection. (EPSG: 6933). TRMM precipitation dataset which is in 0.25 degree. SMAP soil ...
0
votes
1answer
32 views

How to determine when the map has finished rendering

I have written a few functions to compare QGIS performance to MapInfo. Most of them involve doing some analysis then dumping the results on the map, as such the process would be considered 'finished' ...
0
votes
0answers
15 views

Click to copy Co-ordinates From QGIS

I have a created some point data using CRS ESPG:4326 and added Google basemap from Open-layers plugin. While adding the Google maps imagery i have changed CRS to ESPG:3857 in project properties. ...
1
vote
1answer
30 views

C-based implementation of Djikstra's or Fast Marching for QGIS/Python?

I need an algorithm to find least cost paths between points on a discrete grid, allowing for the direction of transport to affect the cost of transport, allowing for different modes of ...
0
votes
1answer
27 views

Orfeo Toolbox Python scripting problem

I am working with QGIS and the OTB plugin (Orfeo Toolbox). I trained the SVM classifier by "hand" (mouse clicks) and it worked. Then I tried to do it with python scripting, because I have a lot of ...
0
votes
2answers
61 views

Calculating distance between latitude and longitude Python and CSV

I wanting to compare the distance between two sets of lat/long and I need help inputting my lat/long fields into the Haversine formula. I am able to print my two sets of lat/longs (print floats1, ...
1
vote
1answer
28 views

How to enable “Label every part of multi-features” with pyQGIS?

Regarding the 'Label every part of multi-features' check box located in the 'Labels // Rendering // Feature Options' layer properties UI... Can this be done with pyQGIS? These two commands enable ...
0
votes
0answers
15 views

Write correct BandDescriptor expression - calculate the difference between bands in two geospatial products from Python

I need to calculate the difference of the bands stored in two files saved in the NetCDF. Both products used in the calculations describes exactly the same area, i need just the difference between them....
0
votes
0answers
48 views

Python Error when loading QGIS on Windows 10 [duplicate]

I used the standalone installer (QGIS-OSGeo4W-2.14.4-1-Setup-x86_64.exe) to install 2.14.4 however 2.16.0 was also installed. Have I done something wrong to get 2 versions installed? Also 2.16.0 ...
0
votes
0answers
8 views

How to programmatically update data in WFS geoserver layer

I am building an application where the user retrieves all the features of a geoserver layer (store: postgres) and display them on a table. For doing this I use the OWSLib (get_feature). Now I need to ...
3
votes
2answers
54 views

How to rename a QGIS plugin?

I updated a plugin such that now it does more operations than the original title suggests. Is there an easy way to change the name without going through all of the files line by line?
1
vote
1answer
17 views

PyQgis show SVG Symbol on differnet value of specific attribute

I am working on a QGIS plugin. Main feature of this plugin will be changing the icons on a specific layer partly based on a specific attribute (it will be more exciting but you have to start somewhere)...
1
vote
0answers
32 views

What is the easiest way to write C extensions to Python for use in QGIS?

I would like to write some functions in C to call from the Python console in QGIS. What is the easiest way to do this? Does there exist anything comparable to Matlab's MEX?
1
vote
0answers
36 views

Split polygon using points and their directions with python

I`m new for the python but want to split Voronoi polygons using points and their directions as input. Voronoi polygons were created by in-built tool: Vector>Geometry Tools>Voronoi Polygons from layer ...
0
votes
0answers
20 views

Creating neat map in basemap using simplified boundaries?

Is it possible to create a neat map like using basemap (mpl_toolkits.basemap)? I am particularly curious to know if there's a way to "simplify" the boundaries as they are rather edgy in the current ...
0
votes
2answers
70 views

When buton clicked, open new window - pyqgis

I'm making a plugin which has two windows. What I want to know is how to refer pushButton in one window to method which opens new window. I have dialog *.ui files for both windows and their *.py. ...
1
vote
1answer
31 views

PyQGIS: How to get field values from a vector layer based on an array of field names

I have a list with the field names and i am getting the values from the vector layer shp = "D:\file.shp" from osgeo import osr,ogr, gdal driver = ogr.GetDriverByName('ESRI Shapefile') dataSource = ...
0
votes
1answer
38 views

Use OGR and GDAL in Python outside OSGEO4W shell

I have QGIS installed, therefore it installed the OSGeo4W with all functionalities and that works great. I added all the environment variables as proposed in this post: Is there a way to use gdal ...
5
votes
2answers
229 views

Problem installing new version of Qgis under windoss 10 64 bits

I installed twice Qgis 2.16 using OSGeo 4w install. First I uninstalled all the previuos version and installed 2.16. Everything worked fine but when I open Qgis I have a warning message `Couldn't ...
2
votes
2answers
60 views

Add attributes to layer

I'm trying to add a new attribute to a vector layer in my plugin. But it does not work.. Why? selectedLayerIndex = self.dlg.comboBox.currentIndex() selectedLayer = layers[selectedLayerIndex] name = "...