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

learn more… | top users | synonyms

1
vote
0answers
10 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
0answers
3 views

Sentinel-1: calibrate images on python

I work with Sentinel-1 imagery (Interferometric Wide swath SLC VV and VH polarisation). How to calibrate this 2 images to get this images in right projection(not on this rotation and pixel values) ...
1
vote
0answers
14 views

How to find 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 ...
2
votes
1answer
140 views

QGIS crashing/failing when dissolving multiple shapefiles in a Python loop

I am using QGIS 2.10 (but I've also tried 2.8) to loop through all the shapefiles in a folder (those ending in .shp) and perform a dissolve function on each of them. However, when I run the following ...
2
votes
2answers
50 views

Clip raster with shapefile and set a value outside the mask

I want to clip a raster using a shape file with the command: gdalwarp -cutline INPUT.shp INPUT.tif OUTPUT.tif from this answer. However I want to set the pixels outside the mask to a particular ...
3
votes
3answers
378 views

Refreshing display for newly added labels with ArcObjects from Python?

I've added a shapefile to an MXD and Edited the symbolization of it with ArcObjects. Now I'm trying to edit the labeling with ArcObjects. I've successfully been able to edit the default class in the ...
1
vote
1answer
275 views

gdal_proximity distance to meters

I followed the answer given in this topic for searching the distance to the nearest coastline given a lat/lon coordinate. The distance output obtained is in degree (I think) but I need the distance ...
0
votes
1answer
19 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. prepared works but is VERY slow. using prepared has helped but it's still no where ...
0
votes
1answer
24 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
0answers
20 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://...
4
votes
1answer
527 views

How do I link OGR with spatialite?

Problem & Evidence: I'm trying to create a spatialite file with the code snippet below. However the outDataSource object gets assigned NoneType and all subsequent (unshown) code fails. I'm ...
2
votes
1answer
17 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 ...
0
votes
1answer
35 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 ...
1
vote
1answer
36 views

Obtaining something like NDVI value from Sentinel-1 product

Is there a way to get the some data about biomass from sentinel-1 product? Then try to convert it to NDVI value. Maybe have some way to get RGB value?
0
votes
0answers
19 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 ...
8
votes
2answers
4k views

Converting PostGIS table to Shapefile in Python?

I want to convert a PostGIS table into a shapefile (without using pgsql2shp). In order to create a geometry in the shapefile I have to give the Xmin,Ymin and Xmax,Ymax, and the geometry which I have ...
3
votes
1answer
18 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
10 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?...
0
votes
3answers
461 views

How to make line with arrow head in QgsVectorLayer using python?

I need to draw line with arrow head or after drawn the line i need to make it as arrow head line by using python. or can we set any arrow head symbol for line features by using python? Kindly help me ...
2
votes
1answer
24 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"): ...
3
votes
2answers
126 views

Changing pixel size in 'asc' file using Qgis?

I have soil data and BioClim data from Australia soil data: rows 2200 columns 1400 pixel size 0.0025, -0.0025 255 BioClim data: rows 660 columsn 420 pixel size 0.00833333, -0.00833333 I am ...
0
votes
1answer
576 views

Polygon Neighbors Analysis script (ArcPy 10.1) producing erroneous results?

I'm struggling with a python script that is supposed to calculate a field for a polygon feature class. The calculation is of the average of a field value (P_TOT_DEV) for each of a given polygon's ...
0
votes
1answer
19 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
20 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
3answers
2k views

installing exifread for photo2shape plugin

I've already seen Error loading plugin photo2shape even after installing exifread module and Error installing Photo2Shape QGIS 2.6 for Mac, and other forums, but can´t make it work. First I installed ...
0
votes
1answer
25 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
31 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 ...
6
votes
6answers
3k views

How to get arcpy to work with Anaconda?

I am trying to follow the step-by-step directions in the answer to "how to separate Python installation with ArcGIS" but cannot find the path file, DTBGGP64.pth, in C:\Python27\ArcGIS10.2\Lib\site-...
6
votes
2answers
215 views

Distribute QGis plugin which depends on certain Python packages

I developed a plugin for Qgis which depends on some Python packages. On Linux and Mac, this is not really a problem because I can easily install them with the system pip command. Windows is another ...
2
votes
2answers
1k views

Using arcpy.Describe Method on Annotation layers

I'm testing layers in the current document using the Describe function. My code is: for lyr in arcpy.mapping.ListLayers(df): if(lyr.isGroupLayer == False and lyr.isRasterLayer == False): ...
-1
votes
0answers
13 views

water framework directive python script [on hold]

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)?
1
vote
1answer
195 views

Adding Origin to Geotiff using Python GDAL?

Alright, so I'm getting closer to figuring this out but I'm stuck at one (that I know of) thing... how do I use GDAL to apply a known origin of a GeoTiff to another that has been processed in ...
2
votes
1answer
40 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 ...
0
votes
0answers
21 views

run multiple scripts within one script. [closed]

Im new to python but was wondering if there is a way to run multiple scripts within one script. Using the result ( name) of the first script to be used for the second script...and so on?
1
vote
1answer
38 views

How to count attributes from line intersections with polygons on QGIS?

So I have a line layer with 1300 features and a polygon layer with 19,000 features that represents buffers of points. I need to determine how many polygons does each individual line intersect. And ...
19
votes
2answers
6k views

How to make a separate Python installation that can call ArcGIS' arcpy?

I see a lot of threads asking how you can create a separate Python installation (e.g. the Anaconda or Python XY distribution) that can use arcpy, while not 'breaking' the original ArcGIS python ...
0
votes
0answers
11 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
16 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 ...
-3
votes
0answers
41 views

Can I open windows task manager with Python? [closed]

I want to make a program that can open task scheduler. Is it even possible? If so - what is the code for it?
0
votes
1answer
225 views

How to connect mouseclick to map canvas in QGIS?

How to connect mouse click to map canvas in QGIS using python script? I have two lines of code to connect mouse click to map canvas: button.clicked.connect(self.onClicked) self.areapushbutton.clicked....
2
votes
1answer
51 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
45 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
1answer
35 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 ...
1
vote
1answer
305 views

Calculate tree cover over certain area from raster data

Last year Hansen et al. published Global Forest Change map as set of raster data available in TIFF format. Basically those are 30-meters resolution satellite images with pixel values ranging from 0 (...
3
votes
2answers
526 views

GDAL with GEOS support, pandas and VTK using python on Windows?

So far I have been using OSGeo4W shell (or OSGEO install) as really convenient way to use python together with additional packages, namely gdal, shapely, numpy, scipy and matplotlib. I was happy till ...
0
votes
0answers
21 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
208 views

How to set time field when generating a GPX track with Python OGR?

I want to generate a GPX file with Python OGR. In particular I want to generate a tracks (layer of features of OGR type wkbMultiLineString) My script is below. I get the error ERROR 1: No such field: ...
1
vote
1answer
55 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 ...
3
votes
2answers
52 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?
2
votes
1answer
341 views

Using Spyder IDE to develop python for Grass GIS, get 'ImportError: No module named grass.script'

I am trying to use Spyder IDE to develop a python script using python library from grass-6.4.3. I run the script below, and get 'ImportError: No module named grass.script' I am using python 2.7, ...