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

learn more… | top users | synonyms

0
votes
0answers
17 views

Search and Select in Arcpy with Cursors

I'm working on a tool that identifies features and repairs them using an existing tool. At the moment I am struggling to put my idea into code however. The purpose is to use a search cursor from a ...
1
vote
0answers
9 views

Calculate invariant moments for a each polygon in shapefile

I am working in python and have polygon shapefile created from polygonized binary raster. I populate the attribute fields for each polygon in a loop. I need to calculate the invariant moments fr each ...
1
vote
2answers
26 views

Syntax error in parameter formula of field calculator funtion

I'm using a QGIS 2.8.1 in windows. Have some doubts with syntax when use string in python console. I want to use the field calculator funtion like: processing.runalg('qgis:fieldcalculator', input, ...
-2
votes
0answers
16 views

Interpolate precipitation Data on fly and save result in text [on hold]

How to spatially interpolate on fly large daily(365 days) rainfall data and save the resultant precipitation of particular desired point(lat, lon)
0
votes
1answer
14 views

Python: ogr2osm create osm file from WFS

Does anyone know if ogr2osm can use WFS Layer as input source to create a osm file i could not find anything in the documentation expect that it should support all ogr file formats. If so how can I ...
0
votes
1answer
30 views

Update record based on series of conditionals using Python

I have a feature class which I've been using a relate to compare duplicate field values and was thinking of a way to eliminate the manual process of checking these duplicate values and making a ...
1
vote
0answers
22 views

write python ndarray to raster

I think I understood the steps to write an array to a raster file using python. however it doesn't work in my case and I don't know why. I have an array that I want to write to a Geotiff with Swiss ...
1
vote
3answers
37 views

Loop a Select by Attribute on all features (ArcPy)

I have a really basic script that selects an input Polygon by an Attribute and then does a series of Buffers on that, a select by location and then appends the result into a final output. I need to ...
1
vote
1answer
25 views

Add date field to imported csv file

I am using a script written by John to import a csv file and make a point feature class. My table looks like this: "timestamp_pretty","mmsi","imo","shipType","lat","long","month","week" "31/12/1969 ...
2
votes
0answers
34 views

How to display selected features in a map to exporte as PDF

I've already managed to select feature by ID in a layer and zoom to it using pyqgis. The canvas considered this changes but the map that I exported as PDF do not consider this changes, any idea to ...
1
vote
0answers
21 views

Is there an equivalent of GeoDjango for Flask or other Python web frameworks?

I have experimented with GeoDjango, but I think nobody would be surprised if I said there's quite a steep learning curve. I prefer Flask, which I also know much more than Django anyway, but I couldn't ...
2
votes
0answers
48 views

ArcMap Label Help - Label from X/Y Coordinate

Edited: This picture might help explain my question. Here I have a point at the line with an X/Y coordinate. It also has a leader line to it. This leader line has an X2/Y2 coordinate. Both of ...
1
vote
0answers
22 views

qgis python: select on screen and change (pre-set) properties accordingly

I have a map with different zones where I have drawn isochrones -where I will arrive within 15 min, within 30 min and so on. The picture attached shows the 15-120 min isochrones. This is set as a ...
0
votes
1answer
32 views

reading GRASS vector map in python

I know similar questions have been asked several times, but none of the solutions seems suitable for my problem or don't work.. I computed flowlines using the r.flow tool from GRASS GIS, then I ...
-2
votes
0answers
35 views

How can i make image of shape file using python in QGIS? [on hold]

Here I am trying to below code, but it give me error. import shapefile import Image, ImageDraw # Read in a shapefile r = shapefile.Reader("K:\TM_WORLD_BORDERS-0.3\Mississippi\mississippi") # ...
0
votes
0answers
26 views

Update Spatialite table with Python

I wish to update a column in a Spatialite table from a dictionary object using the pysqlite module in Python 2.7. I am accustomed to executing this operation on ordinary, i.e., non-spatial SQLite ...
-1
votes
0answers
36 views

How to write python scripts for attribute tables in ArcGIS [on hold]

I am practising python scripts and a beginner. I get stuck and hope anyone else here can suggest me what commands/scripts i need to use to query: Classify accident types, % of each type over a total ...
2
votes
2answers
30 views

How to load stored composer from project file in standalone QGIS application?

I would like to load a .qgs file and get a composer from it, but I can't figure out how. Is there a way, or do I have to read the xml myself and individually set the appropriate values for the ...
0
votes
1answer
32 views

Point Sampler Python Error in QGIS?

I downloaded the point sampling tool for QGIS and I'm trying to run it. A few days ago it worked fine, but now it gives the following error: An error has occured while executing Python code: ...
1
vote
2answers
69 views

How to show variable values in message bar in QGIS?

I know that I can write custom text to message bar with the QgsMessageBar.pushMessage() method. But if I understand the documentation right, there's no room for variables added to a string where they ...
0
votes
0answers
8 views

Element retrieval in owl file format using python

I just created my ontology file for semantic relation using protege.My ontology file is in the foram of owl.I need to compare two relations doamin and range.But i dont know how to do it.
1
vote
1answer
19 views

How to register a broadcast on QGIS to start my plugin on start after loading plugins

I want to perform a default task when user opens QGIS but here I am building it as a python plugin so I want a signal or broadcast to call my plugin. I didn't build QGIS from source my plugin should ...
1
vote
0answers
37 views

Multiprocessing in python qgis?

When i try to do mutliprocessing in python Qgis it doesn't work from multiprocessing import Process,Lock import multiprocessing def name1(l,i): print i if __name__=='__main__': lock=Lock() ...
0
votes
0answers
15 views

show polygon from database in browser in geodjango

I tried to retrieve the polygon which I saved into postgis database. (all polygons) Here is my code: models.py from django.contrib.gis.db import models class MyMap(models.Model): name = ...
0
votes
0answers
14 views

how to rotate a symbol

I am working in c++/python/QT 4.5 with the api qgis 2.8.2 My application receive data from a communication port that indicate the change of position of an object diplayed on the map and represented ...
0
votes
0answers
12 views

Getting netCDF data into PostGIS database using Python?

I can read the netCDF file data with netCDF-python or with gdalinfo, but I am unsure of the easiest way to get it into a PostGIS database. It would be really easy if I could convert the netCDF file ...
1
vote
1answer
23 views

How do I batch input alias names from a table for a large dataset in ArcMap or ArcCatalog?

I would like to populate the alias names for the fields in the ACS 2014 5 year estimates file geodatabase (all 11439 of them). The ACS fgdb comes with the short_name and long_name in the metadata ...
0
votes
0answers
5 views

What is the default mosaic_method value for MakeMosaicLayer_management?

What is the default mosaic_method for MakeMosaicLayer_management (see help here)? Usually, the docs say This is the default after the default value. And that is usually first option listed. Is the ...
-5
votes
0answers
32 views

Drawing polygon on PDF in Python? [closed]

How can I draw a polygon on PDF in python? I am using http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/ for making PDF file.
1
vote
1answer
57 views

Python script to copy first row of certain attributes and paste in the newly digitised rows the copied features

Starting from this question, I need a script to be insterted in the processing graphical modeler that can copy some attributes from the first digitised row in all the newly digitised lines of a ...
2
votes
2answers
34 views

Store in a python list the attribute table of a vector in QGIS

I'm stuck with a very simple issue.. I've loaded in QGIS (through the py console) a csv layer (no geometry) made of 4 fields and 3 rows: #load the csv layer = QgsVectorLayer("path/to/the/csv", ...
3
votes
5answers
78 views

Is there any simple integration for counting points in polygon using python qgis?

Is there any simple integration for calculating count of points in polygon using QGIS-Python integration? In other words, are there any pre-defined functions for points in polygon of QGIS using ...
2
votes
0answers
42 views

Converting large rasters to NumPy

I have a geodatabase that contains a large number of raster datasets - there are two rasters for each country in the world, and they are very large, in some cases up to 3GB per raster dataset. I ...
0
votes
1answer
28 views

arcpy.da.SearchCursor, cannot read preceding zeros from csv

I'm using arcpy.da.SearchCursor to read a csv that has a column with preceding zeros, e.g.: myCSVColumn 0124578 12598 04589 012568 ... When using the arcpy.da.SearchCursor it returns the value w/o ...
2
votes
0answers
62 views

Can we create buffer analysis using python in qgis?

Can we create a buffer of distance 0.004 using python in qgis. I tried this link, but it isn't working for python in qgis 2.10.1-Pisa. The above is the diagram of buffer I am asking. It's located ...
2
votes
0answers
21 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, ...
2
votes
1answer
82 views

Creating subfolders in ArcPy's 'in_memory'

Is there a way to create a subfolder in memory in ArcPy? For example, instead of temporarily saving a dataset under: r'in_memory/bufferOne' I would like to save it under: ...
5
votes
1answer
94 views

How to exit QGIS after running a python script?

I would like to run a python script via qgis --code myscript.py and then immediately exit. I'm using iface.actionExit().trigger(), which kills QGIS when I run it from the python console, but not when ...
1
vote
1answer
22 views

Unable to update some of the attributes using PyQGIS

I'm trying to create new attribute and populate it, but for unknown reason some of the features does not update while others are updated normally. # scores - list of values which length is equal to ...
0
votes
0answers
18 views

Out of Memory and TIN internal processing error ArcGIS

So i have been developing a python script to streamline the process from converting a raw XYZ file to a full blown terrain file. However, in the intermediate process, I am performing a surface ...
1
vote
2answers
32 views

Python Installation and accessing Arcpy Libraries without ArcGIS Setup Installer?

As part of developing scripts and to save the other services/resources accessed by ArcGIS, is there a way or separate installer to install Python and ArcPy libraries alone without installing ArcMap?
1
vote
1answer
25 views

Dissolving a TIN using python/ogr binding

I have a TIN model where I remove some of the triangles (see fig. 1). Most of the triangles touch on one edge, some on one vertice. I would now like to generate a polygon shapefile containing the ...
1
vote
1answer
30 views

How to use “context” in rasterio?

Another rasterio follow-up question, after questions on reading and writing rasters. I've successfully made and reprojected an output layer, but while trying to use the overview module to build ...
0
votes
0answers
30 views

Error's while retrieving data from postgres to Qgis using python?

This is my code of python in qgis from qgis documentation docs uri = QgsDataSourceURI() uri.setConnection("localhost","5432","gis_data","postgres","vajja") ...
0
votes
2answers
40 views

Simplifying Ways in OpenStreetMap Data

Is there a (current) best practice to simplify ways? I have found: https://github.com/podolsir/osmosis-simplifyways But besides not being alive, here ...
0
votes
0answers
22 views

Landsat images from same path/row have different shapes

I'm starting to play with satellite imagery. In particular, I am using images of the Landsat 7 and Python. I open two TIF images of the same place but at different times to the numpy arrays and they ...
4
votes
1answer
66 views

Find shortest path between points avoiding shapefile?

I am an intermediate python developer with very limited GIS experience. I have a list of latitude/longitudes of a ship at sea. I need to join them into a polyline using the shortest distance between ...
1
vote
0answers
24 views

Creating Origin Destination Matrix from Station Locations

I am attempting to create an origin destination matrix in python for all of the London Underground Stations. I have the station name and the lat, lng of its location. It is in the following csv format ...
1
vote
1answer
42 views

Segmentation fault while writing an output raster by blocks with rasterio

With the answer on my previous question, I was able to set up reading a raster by blocks. I did some computation and now I try to write the result into another raster. However, the program fails with ...
1
vote
0answers
15 views

Rendering problem in qgis

I have fetch data from database and draw it on qgis 2.8 as vector layer it works fine with limited data but for large data it will not work and goes into not responding stage, I am unable to ...