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

learn more… | top users | synonyms

2
votes
0answers
46 views

Deployment of optical fiber QGIS Python

The subject that I’m working on is the deployment of optical fiber . I have a shapefile which represents a country containing homes. And I have another shapefile representing an infrastructure plan of ...
0
votes
0answers
25 views

IDE's that play well with python toolbox [closed]

I recently have learned about creating python toolboxes, and watched the video from ESRI. In the video I noticed that they were utilizing a pywin ide. Which brings me to my question can you use any ...
4
votes
1answer
35 views

Getting pixel values at single point using rasterio

To get a single pixel value at a point in a raster using rasterio, there is an example here: https://github.com/mapbox/rasterio/pull/275 However, is there a direct API within rasterio (and not the ...
4
votes
2answers
117 views
+100

How to render layer into png in a standalone application?

I would like to use standalone appliction to apply .qml style to a layer and use QgsMapRenderer() to save it as image on a hard disk. The are a lot of questions like mine at this site and it seems ...
3
votes
2answers
56 views

Label and symbol with condition in layer properties under style tab

I have forest areas. I want to put tree.svg with condition. Layer properties-> style-> background -> shape ->svg Something like this: if (myfield<1300 , then show, ...
0
votes
2answers
34 views

Trouble getting shapely to run

I downloaded the GDAL complete Framework von Kyngchaos which also includes the GEOS Framework and shapely for python. I can import shapely without a problem, but when I try to perform some "geo ...
0
votes
0answers
21 views

Py2exe Tkinter application using win32com.client - Receiving Dispatch error [closed]

I have created a py2exe application that uses Tkinter for creating a GUI application which uses the win32com.client module. I have successfully created an exe file using py2exe but when I to run the ...
-3
votes
0answers
26 views

How to convert list of rasters in 1 Numpy Array in python? [closed]

I met a problem: there are list of rasters in the same projection, but different place. To extract value of them for points in shp file I need create 1 Numpy Array from them. Is it possible to do ...
3
votes
3answers
49 views

How to get appropriate CRS for a position specified in lat/lon coordinates?

I have a set of city networks whose coordinates are specified in lat/lons. I wish to run an algorithm on each network that treats them as a planar graph. I'm using python and can use pyproj to project ...
5
votes
1answer
173 views

How do I include 64 bit python with ArcGIS 10.4 install?

I recently updated to 10.4 and was hoping the 64 bit python install was automatic, but apparently it isn't. I can't remember what I did in 10.3.x to get the 64 bit python. Does anyone know how to ...
0
votes
2answers
33 views

Casting between PostGIS types in GeoAlchemy

I'm working with OpenStreetMap data, and loading it into a PostGIS database using osm2pgsql. The issue that I am currently dealing with is that osm2pgsql stores the shape as a geometry type. I'm ...
0
votes
1answer
60 views

Why can't I run .tif file with GDAL?

I am trying to extract data from a geotiff file in the Ubuntu terminal. My professor used the command "gdal NDVI.tif" and was able to write the data to a text file. When I use that command, I get the ...
1
vote
0answers
24 views

Python GDAL open dataset in PostGIS with quotations

Error trying to use gdal to open a dataset in PostGIS with the following code: ds = gdal.Open("PG: dbname=nyc host=localhost user=postgres password=mypassword port=5432 mode=2 schema=public ...
1
vote
1answer
41 views

How to pythonically set a symbol as an ascii character (Font Marker) in QGIS

I need to set a point on a map as an ASCII symbol with python. I'd like to do this in a rule based renderer. something like: rule.setSymbolAsFontMarker("✫") So I'd have something like this in my ...
2
votes
0answers
18 views

Writing 3 channels to 8-bit TIF in Python using gdal

I have some Python code to write 3 channels to file. Here, channels is an array of 3 numpy 2D-arrays (RGB), outfile is the filename, and rows and cols are the image dimensions. def ...
1
vote
0answers
22 views

Using “Ruled Based Render” to display labels without the marker with python in QGIS

I'm writing a script to load and manipulate some shapefiles. Unlike my previous question I now need to display labels only on certain zoom levels. My usual result is that the previous formatting gets ...
1
vote
1answer
130 views

How to use gdal.openEx with flags and parameters?

I'm new in python. I have a class which opens SXF format, and i want the last string self.sxf_ds = gdal.OpenEx(self.sxf_path) to be opened with flag 'GDAL_OF_VERBOSE_ERROR' but the nOpenFlags is ...
1
vote
0answers
35 views

Python error in Qgis 2.14.0

I'm trying to build virtual raster (catalog) following instructions from the documentation in QGIS.. It appears the following error in python code: 2016-04-17T12:13:07 1 Traceback (most recent call ...
1
vote
1answer
16 views

Matching Python and GRASS projection

I have a colleague producing maps with the following Python Basemap projection: from mpl_toolkits.basemap import Basemap m = Basemap(width=6000000,height=3900000, ...
10
votes
1answer
204 views

Birch algorithm does not cluster as expected

I'm using Birch algorithm from scipy-learn Python package for clustering a set of points in one small city in sets of 10. I use following code: no = len(list_of_points)/10 brc = ...
3
votes
1answer
40 views

Generate 1 shape out of many GPX files

I have many GPX files and i want to show them as layer on mapbox tiles. I managed to create "simple polyline" from gpx and then build GeoJson which include many features. That GeoJson is pretty big, ...
2
votes
2answers
159 views

How to iterate over layers and export them as PNG images with PyQGIS in a standalone script

I would like to export specific layers as a png from a QGIS .qgs map. From the table of contents the script would first export the "boundary, climits, and Div1_Irrig_1956_0" layers as one png. The ...
-4
votes
0answers
30 views

Path used to save file

on another post, someone gave me some code to save a raster to .tif, but I was never able to save the files, and the person who shared the code said it worked for him. I noticed that in the path I ...
1
vote
0answers
17 views

QGIS plugin 'Module' object has no attribute 'classFactory'

I am trying to learn how to make QGIS plugins and have been trying to follow tutorials such as this one; https://anitagraser.com/2014/04/26/getting-started-writing-qgis-2-x-plugins/ but I keep ...
0
votes
0answers
15 views

How do I create a set of maps using QGIS atlas that has two maps in the print composer window?

I'm trying to use atlas to produce a set of 8 maps. I want 2 maps on each page, each showing different areas sequentially. So the output would have 4 pages, with maps 1 & 2 on the 1st page, then 3 ...
0
votes
0answers
25 views

Extracting weather data at multiple locations from NetCDF with python

I am trying to extract weather data from a NetCDF file at multiple locations using python. The file (AROME_MetCoOp_00_DEF.nc_20160128) is from met.no here File information: <type ...
0
votes
0answers
18 views

How to compute GLCM texture feature matrix with Skimage with a step of pixels?

I want to compute the glcm for a radar image, and in order to descrease the computing time and to have a better result, i want to compute it with a step (not for all pixels but every 10 pixels for ...
1
vote
1answer
25 views

Parameters for osm2po web service to route for walking

I have started the osm2po web service using the jar file. In the configuration file, I could see different parameters related to walking but not sure what each one does. I am trying to call the web ...
1
vote
0answers
32 views

ogr2ogr - Shapefile database SQL query; missing .cpg and .xml

I am using gdal and ogr2ogr to perform a SQL query on a database of shapefiles with the code below. The geoprocessing works and the appropriate shapefile is extracted from the query, but when I print ...
1
vote
1answer
19 views

AttributeError: SyncToDisk?

I want to save my 'feat' - selected by criteria polygons in shp.file to save in diferent shp.file on the disk by using SyncToDisk() in osgeo for vector. Code gives me error: ...
3
votes
1answer
60 views

Export raster layer in python to specific folder

I am trying to export existing raster layers as tif files. I just want to avoid saving each raster manually. this is the code I am trying to use, but it doesn't seem to work: from PyQt4.QtCore import ...
0
votes
0answers
19 views

Points within a circle in Python - geoindex

I'm trying to use the geoindex package to perform a nearest neighbor query. For example, I have this two coordinates (in the real case I have a lot more): (40.607255, -73.75083) (40.7261465 ...
0
votes
1answer
23 views

Replacing each point in a point feature with a specific shaped polygon

I have many random points in one layer. I want to replace each individual point with a specific shaped polygon like the image below illustrates. Kind of like applying some sort of irregular buffer to ...
-1
votes
1answer
23 views

Fix AttributeError in python code

I got some code that I think should work, but I'm getting this error: Traceback (most recent call last): File "", line 1, in File "c:/users/proxtr~1/appdata/local/temp/tmpgtrnqo.py", line ...
3
votes
1answer
41 views

How to add label to point without marker displaying in QGIS with python

I'm using a python script to manipulate the display of shapefiles in QGis. My code basically selects an active layer and sets a field as the label of the point. Like this: layer = ...
3
votes
1answer
45 views

Update ID Field Using Common Types

Not exactly sure how to word this, but hopefully I do it in a way that accurately conveys what it is that I'm trying to do... I'm using Manifold GIS for this particular project, but I'm open to any ...
0
votes
1answer
75 views

Python: Trying to figure out Geopy in python for reverse look ups

I am trying to test the following code on my system but I cannot get the correct output. Is this code correct for using geopy with GoogleV3? If so, how can I return country and continent name? ...
0
votes
1answer
70 views

Save raster layers in a python script

Is there a way to loop through every selected layer in qgis and save it as a .tif file with the same layer name using a python script? This is the code I am using, but it does nothing at all. It runs ...
1
vote
0answers
17 views

Python plugins not available, OS X 10.10.5, QGIS 2.8.4

I’m using OS X Yosemite 10.10.5 and QGIS 2.8.4 Wien. My mainproblem is that python support is disabled and I can’t use python plugins. QGIS seems to act fine and I’ve done a lot of work with QGIS. ...
1
vote
1answer
32 views

Geoserver ReST update ImageMosaic

I am currently experimenting with the GeoServer ReST-API andy trying to update the configuration parameters of an ImageMosaic Coveragestore. I've been using Python 2.7 with the requests package as ...
0
votes
1answer
20 views

gdal writeArray causes appcrash at end of python script

i'm using OSGeo4W64 (gdal 2.0.2-8) with Python 2.7.5 on Windows 8.1 64bit. Editor is PyCharm 2016.1.2. I want to save an image with gdal, but i always get an error when the python script is complete. ...
1
vote
1answer
43 views

Pythonic solution for changing shape files properties in QGIS

I'm loading several shape files into QGIS using the python console. The script works by reading a list of directories and a list of shapefiles to load from each directory, then it loads each file. ...
0
votes
0answers
21 views

How to create LayerGroup in GeoServer using Python?

I tried with gsconfig as mentioned here but got error while saving. I followed exact same steps but with error - Traceback (most recent call last): File "test_curl.py", line 75, in ...
1
vote
2answers
70 views

How to add dynamic text feedback for QGIS plugin?

I am building a plugin using Qt Designer which will initially allow users to select features for a chosen polygon layer and then when a feature is selected on the canvas, the area is printed out in ...
1
vote
0answers
23 views

Resampling netcdf file?

What is the best way to change the cell size of a netcdf file, keeping it as netcdf? I have looked into ArcGIS and GDAL and have not found anything yet. I prefer to use python if a solution is ...
6
votes
1answer
97 views

Adding GDAL as dependency to Python package?

I am trying to package a Python script that uses GDAL for PyPI. I started by including a direct reference in my setup.py: install_requires=['GDAL==1.11.2'], This way the package failed to install in ...
1
vote
2answers
45 views

Is it possible to round all coordinates in shapely?

Following on from this question, I'm hitting a problem where thanks to floating point representations, objects aren't precisely where I expect them be after they are moved using affinity.translate. ...
1
vote
0answers
32 views

QGIS python support disabled

I'm having a problem with the python support of my QGIS version. When I start QGIS, I get the error message: Traceback (most recent call last): File "", line 1, in ImportError: Module use of ...
0
votes
1answer
23 views

How can I add points to a LineString in shapely?

I have two Polygons which intersect along one edge as shown below. I need to add the red vertices at each end of the intersection to the blue polygon. I thought I could do this with by calling ...
5
votes
2answers
84 views

Why am I getting two different outputs from Python and C++ using GDAL?

I am trying to gather information from a *.tif file using the GDAL libraries. When I open the *.tif file using both the Python API, and C++ API, I encouter two completely different answers. Here are ...