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

learn more… | top users | synonyms

1
vote
2answers
30 views

Parcel Map - How Many Acres of Feature X fall Within Each Parcel

Can someone recommend a good tool for ArcGIS that would help summarize how many acres of a polygon feature occur within each parcel in a separate layer. I have a layer containing a few hundred ...
3
votes
0answers
83 views

How to compute (X,Y,Z) of a point from given attributes

Is there a way to compute the geodetic coordinates (Earth Centered) of a satellite S(x,y,z). The original problem is to compute the footprint of an antenna, given the following information: ...
1
vote
0answers
20 views

Problem Loading Plug-Ins in QGIS 2.2 on Mac

I'm trying to load the 'processing' module in QGIS (2.2.0-Valmiera on Mac OSX 10.8). However, this module and others (e.g. GarminaCustomMap) re failing to load with a message: ImportError: No ...
0
votes
2answers
78 views

GDAL for Python: extracting subdomains from NetCDF file?

I need to make a script that processes a NetCDF file that contains 3 days of hourly forecast data from the norwegian meteorological office. The NetCDF file contains various data I need ...
3
votes
0answers
59 views

Create vector grid from canvas using script

I've modified "Hex grid from layer bounds" script to my need. Just added cellsizex and cellsizey. Changed the hexagonal - 3 to "1" to make it as a square grid. Is it possible to include an option to ...
1
vote
1answer
34 views

Standard SQL with ArcGIS

Is it possible to use Python to run actual standard SQL on an enterprise geo-database? Think about batch deleting, joints, etc moving beyond just the cursor objects in Arcpy. Note that one can ...
0
votes
1answer
22 views

Detecting Runtime Errors in Arcpy Loops [duplicate]

I am looping over a feature in Arcpy and doing several geoProcessing tasks on each feature/iteration. The loop runs pretty well but crashes on some of the features. I dont really know why but its ...
2
votes
1answer
62 views

Basin numbering according to Pfafstetter Method?

I would like to divide my basin into subbasins and numbers according to the Pfafstetter method. Is there an easy way to implement this in Python using ArcPy? Or are there some freely available ...
0
votes
0answers
52 views

ArcPy loops/cursors faster without background processing?

I am running loops via cursors and raw Python in Arcpy. Within the loop several processes take place, selecting shapefiles and converting to raster, clipping, running euclidean distances, extracting ...
5
votes
1answer
116 views

Pause ArcPy script until feature class lock goes away

My script needs to copy data into a feature class to an SDE geodatabase that might have a lock on it from another application. I shouldn't break the lock (that app has priority over a data update), ...
2
votes
2answers
59 views

Batch Conditional Test - For Loop with a Group of Rasters

Edit: Question was answered. Please scroll to see fixed script. Thank you everyone who helped! How do I ask a “for loop” to operate on groups of three files folder (e.x. files A, B, C), then files ...
1
vote
0answers
31 views

Mapping from one plane on the other plane despite of masking regions

have a set of data given here, where in the first and second columns there are the sky coordinates (ra,dec) e.g. right ascension and declination, respectively and in the third and forth, the ...
0
votes
1answer
63 views

Cannot load postgis layer from sql string in pyqgis

I'm trying to load a layer using the following code in qgis python console: sql = "(select the_geom, ID from mytable)" uri = QgsDataSourceURI() ...
1
vote
1answer
71 views

What's the reason for this Invalid Layer “Cannot open GDAL dataset …” error

When adding a rasterfile with QGIS python console there appears an error when the first letter of a rasterfile to be added is not written in capital letters. Why this behaviour? Example case1: ...
0
votes
1answer
54 views

D8 algorithm to get the flow direction in ArcGIS

I am using ArcGIS 10 for the get the flow direction from DEM. I wonder about the algorithm they have used while calculating flow direction. It is mentioned there that it is using D8 model. D8 model ...
3
votes
2answers
91 views

Converting huge multipolygon to polygons

I have a shapefile with some huge multipolygons, with 100.000's of parts. What would be the easiest way to split them to singlepart polygons? I'm looking for something like QGIS ”Multipart to ...
1
vote
0answers
53 views

Creating symbology by category in python?

I'm trying to create a python script that creates color-coded symbology by county for multiple maps with different data. I've never created a layer file for the purposes of symbology before, but I ...
2
votes
2answers
42 views

Rename las files with Python [closed]

I have a bunch of LAS files that have been delivered with different naming conventions. I want to rename the files to all have the same uniform naming - based on the easting and northing coordinates ...
3
votes
1answer
29 views

How to find the distance between start of line and start of raster with arcpy/python?

I'am creating a python script tool for ArcGIS Desktop 10.1 to extract profiles. I’m using stack profile to extract values to a table but stack profile only outputs values where the line and raster ...
0
votes
1answer
37 views

QGIS Python console - save image from bounding box

I want to save an image from QGIS but the save image functionality feels limited. My question is if it's possible to use the python command line to save an image at a specific zoomed in scale and to ...
1
vote
1answer
29 views

pyQGIS - Data Source is Invalid

Why I am getting Data Source is Invalid in python console of QGIS when running: vlayer = QgsVectorLayer("home/sanjayr/Desktop/india-latest.shp/buildings.shp","sanjay","ogr") I am using QGIS 2.4 on ...
2
votes
1answer
73 views

Unicode Decode Error for shapefile in Python

I have Python script for converting shapefiles to Geojson. My code works well if I use some usa data, but when I want to use some other encoding, it gives me this error: Traceback (most recent ...
0
votes
0answers
74 views

Proxy.cgi for OpenLayers reading from GeoRSS but not from WFS

I'm having trouble with the standard proxy.cgi written in Python for OpenLayers. Here's my code: #!C:/Python27/python.exe -u """This is a blind proxy that we use to get around browser restrictions ...
9
votes
5answers
361 views

Raster diff: how to check if images have identical values?

Is there a means to check to see if any 2 given raster layers have identical content? We have a problem on our corporate shared storage volume: it's now so big that it takes over 3 days to conduct a ...
2
votes
3answers
60 views

How to increase raster extent by filling extent with no data using ArcGIS Desktop without Spatial Analyst?

I am using feature to raster to rasterize water polygons. It only makes a raster the extent of the features in the polygons, whereas I would like it to be the extent of another existing .tif image. ...
2
votes
0answers
53 views

Where is my Polygon?

I created this script to merge all of the polygons in a shapefile into a single polygon. I am using Python 2.7.5, Shapely 1.3.0, and Fiona 1.1.5. def merge(path_in, path_out): #Import Libraries ...
1
vote
0answers
40 views

Clipping between features within a single vector?

Is it possible (via the Qgis API and friends), to clip polygonal features within a single vector layer? The hope is to accomplish this without having to duplicate the feature into a new layer. ...
3
votes
0answers
64 views

Performing buffering and intersection with script in PyQGIS

I wrote a script that performs the intersection of two layers: The first Layer -> layer1, represents the rivers The second Layer -> layer2, represents a set of circular dots distributed in a ...
2
votes
2answers
115 views

How we can get output for os.system() in python?

I wrote the following command in Geoserver rest-api using curl: cmd=curl -v -u admin:geoserver -XGET -H "Accept: text/xml" ...
1
vote
1answer
41 views

Overwrite option on a standalone ZonalStatisticsAsTable using ArcPy

How can I code an "overwrite option" on a standalone ZonalStatisticsAsTable using ArcPy? I don't see any overwrite option from a Esri example. # Execute ZonalStatisticsAsTable outZSaT = ...
2
votes
0answers
39 views

Any solution to mosaic Modis MOD13Q1 using batch file?

I have a Modis MOD13Q1 product for Pakistan, four tiles cover my complete area and I have data consisting of 14 years, after every 16-day interval. I want to mosaic them using a batch file which ...
1
vote
0answers
38 views

FWTools Python ImportError: DLL load failed:parameter is incorrect [duplicate]

Please, can anyone help me solve this issue? Please find the attached snapshot for your reference. I am working on a Windows 7 Professional, Service Pack 1, 32-bit laptop.
1
vote
2answers
46 views

How to skip over errors created by cursors running through empty tables?

I am trying to automate the creation of many different feature layers were their content is created by a cursor. Sometimes during the automation, a feature layer may be empty, this is okay, but as the ...
0
votes
2answers
28 views

Aggregating rasters with GDAL

I have a set of files that have been mosaiced into a global VRT in a particular projection and resolution. However, I have a need to report statistics on a (say) one degree grid, where the reported ...
2
votes
1answer
63 views

How do I rename rasters in an mxd by using my csv?

I have the following data in a csv: RasterName First name Raster 1 Aaron Raster 1 Paul Raster 2 Bryan Raster 3 Cranston Raster 3 Vince I have added these ...
1
vote
1answer
113 views

UnicodeDecodeError: While installing gdal in a new Python Virtual Environment

I was trying to create a Python Virtual Environment for some initial GIS development. I installed pip and virtualenv and then tried the following commands from the Linux-Terminal to accomplish the ...
2
votes
3answers
154 views

Clipping faster (i.e. in bulk/batch) in ArcGIS for Desktop?

I have 100 different input vector layers and one clip feature vector layer. I have to clip them 100 times but its a large amount of work. Is there any Python script (ArcPy) in ArcGIS for Desktop ...
2
votes
1answer
62 views

QGIS way to import OSM/Google Maps but remove or exclude extraneous areas, limit geographically the use of OSM

GIS Newbie question, perhaps: But I am looking to place an Open Street Maps/Google Maps layer underneath the rest of my shapefiles for referencing purposes. Let's say for instance, that I am looking ...
1
vote
1answer
56 views

Copy Parallel editor tool - python script / modelbuilder [duplicate]

Is it possible to use Copy Parallel tool in a python script or in modelbuilder for ArcGIS 10.2? Does anyone have a workaround or script for a tool that essential does the same thing as Copy Parallel. ...
2
votes
1answer
159 views

Python Syntax Error when running Python Snippet of successful geoprocess

I am having an issue with a simple python snippet. Here's the background: I wanted to include an additional step in a nightly update script that replaces characters in a field that simply do not play ...
0
votes
0answers
28 views

Importing OGR from OSGEO Issues

I am trying to run: from osgeo import ogr and I get: Traceback (most recent call last): File "", line 1, in from osgeo import ogr File ...
4
votes
2answers
84 views

How to access raster NoData value?

I am trying to programmatically access the NoData value in a raster dataset as shown in the screenshot. Two tools that come to mind to describe raster properties do not seem to be able to describe ...
0
votes
1answer
67 views

Field Calculator If/Then in ArcGis 10.1

I've been looking through these threads, i found something similar and thought it could be the answer, but it doen't seem to work for me... I could do this the slow way with Select By Attributes, but ...
1
vote
0answers
74 views

Cause of Field Calculator UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 5: ordinal not in range(128)? [closed]

def Befahrung(value1,value2): if value1 is ' ': return ' ' else: return "G:\\Example\\" + str(value1) + "\\File_" + str(value2) + ".pdf" I try to create a field with a hyperlink. It works ...
1
vote
0answers
37 views

lat/lon of intersection between line of sight from a given lat/lon and altitude above ground

Given a starting latitude, longitude and altitude, and a line of sight defined by azimuth and elevation, I want to find the latitude and longitude (assuming spherical Earth, WGS84 or other) where the ...
1
vote
1answer
96 views

Why is feature.geometry() None in my user-defined expression function?

I'm trying the user-defined expression functions for QGIS, as listed on Nathans blog: http://nathanw.net/2012/11/10/user-defined-expression-functions-for-qgis/ I always get the feature.geometry() as ...
0
votes
0answers
32 views

gdal_grid performance issue — alternatives?

I use gdal_grid within a Python script, but for my large files the calculation time is enormous. Apparently this is a gdal_grid issue http://trac.osgeo.org/gdal/ticket/2411 Does anyone have an advice ...
1
vote
0answers
42 views

Scaling features based on an attribute

I would like to scale polygon features by a specific factor I have calculated for each feature in a feature class. I know of the Scale tool, however it only allows for manual entry of a scale factor ...
2
votes
2answers
40 views

Performing a Python scripted tool based on whether a field is populated or not

My question is if I'm running the ArcMap Dissolve tool through a Python script, how can I tell it to check for attributes in one field, and if that field is empty, to perform the tool on another ...
1
vote
1answer
20 views

Python version of MAP_2POINTS

I think I may have stumbled onto an IDL function which does not have a python equivalent... :'( I am working with a Whiskbroom imaging radiometer (Terra/Aqua MODIS), with a corresponding bounding box ...