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

learn more… | top users | synonyms

2
votes
1answer
254 views

Creating a model to run a complex query

I'm just a rookie when it comes to creating models in ArcGIS. I have two shapefiles from which I need to calculate an AVG and a MAX erosion rate for individual properties. The two shapefiles are: ...
2
votes
1answer
373 views

How to create new layer within a DXF file?

Using OGR in Python, I'd like to create some geometries within a DXF file, but not in the "0" layer, but in new ones. I tried with: import ogr, os, osr, sys ds = ...
2
votes
1answer
1k views

Add AutoCAD .dwg annotation file to Arcmap using python (Same as +ADD Data button)

I would like to add an AutoCad .dwg file to Arcmap using python the same way that the +ADD Data button does. I can add an Annotation layer with python but only as a feature layer not as an annotation ...
2
votes
1answer
527 views

How to include mapnik lib in python 2.7

I am using python 2.7 now in want mapnik to be included in python. I have use exe file to include other library file like GDAL, and other. But for Mapnik can any one suggest me any exe like that so it ...
2
votes
1answer
114 views

Generate a global view Image of where a Lat-Long location is

I would like to automatically generate an image which highlights a location from a global view. Here is an example of what I would like to achieve: I am debating using python utilities such as ...
2
votes
1answer
147 views

Any reason NOT to convert to a single projection when loading GIS data?

I have been given the task of: Loading a list of properties with lat/long coordinates into a SQL Server 2008 database. Loading points and areas (polygons) of interest from a variety of shapefiles ...
2
votes
1answer
839 views

How to use SQLite db with QGIS plugin?

Hi I would like to use SQLite for storing some information in my plugin for QGIS. I have a problem: if I put the db let say test.db among the resources as file, after compilied the resorce.qrc file, ...
2
votes
1answer
340 views

How to add Real Attributes to Shapefile using pyqgis?

I created the Qmarxan plugin using the fTools plugin as an example base. When I create a new shapefile using the QgsVectorFileWriter function I don't have any difficulty specifying a "Real" field with ...
2
votes
1answer
473 views

Removing duplicate features in PyQGIS

I'm trying to remove duplicate features from PyQGIS. Manually I can do it by using "Edit -> Merge Selected Features" and then "Multipart to Singlepart" from fTools in QGIS, but can this functionality ...
2
votes
1answer
641 views

How do I change a raster's geotransform with GDAL?

I'm trying to use GDAL to set the geotransform of a new raster that I've created by following the steps outlined in the GDAL API Tutorial. # create the new dataset driver = ...
2
votes
1answer
208 views

clipped data not going into the folder

I created a model in python that clips and converts different data sets into DWG based on the the grid number. I will like the DWG data (Output) to go into the folder I created as part of the ...
2
votes
1answer
629 views

How to save and reload legend settings using Python?

Maybe you can help me with maybe a strange question. I know how to change settings of a legend individually by arcpy (like: Patch, Title, Items, Columns, Frame, Element Size&Position, etc.), but ...
2
votes
2answers
472 views

QGIS 1.7.3 and pyqt4 version mismatch

I installed QGIS 1.7.3 using OSGeo4W installer.I have python 2.7 and pyqt4-py2.7 installed on my system.My system paths are: ...
2
votes
1answer
479 views

The minimum bounding circle of geometry that crosses the 180th meridian

Background: I've been given a task where I have to calculate the minimum bounding circle of Alaska (for the purpose of running a Roeck test). I'm using the Census' state level geometries available ...
2
votes
1answer
2k views

how to calculate RMS 2D and RMS 1D, using python?

I would like to calculate: RMS 2D: standard deviation for the two coordinates of flat (67% confidence level) and RMS 1D: standard deviation for height (67% confidence level) What is the formula and ...
2
votes
1answer
292 views

OWSLib vs shp2img output of MapServer Layer

I'm working on a map layout engine using Python and ReportLab and have come across a problem and was wondering if anyone can give me some insight. Scenerio: I'm trying to generate an image using ...
2
votes
1answer
466 views

IZ.InterpolateZsBetween, how to use it for multiple parts in polyline

I want to interpolate Z values for the vertexes in the polyline. Shape file contains few polylines. Polylines do have certain vertexes with correct Z value, others do not have Z value (set to ie. 0). ...
2
votes
1answer
332 views

How can I remove WMS layers from mxds using arcpy?

I'm trying to remove WMS layers from an mxd using arcpy. I can successfully remove "MapServer" type services using the below code, but not WMS? Here is an example mxd (zipped) with two different WMS ...
2
votes
1answer
2k views

Issue with Mosaic to New Raster tool

I am having a major issue with the Mosaic to New Raster tool when importing ASC files. It processes the first few files but not all of them. I thought it was a space issue and tried to split the input ...
2
votes
1answer
1k views

Using a geodjango PointField with geography=True, my distance calculations are wrong

Here's my model: class ExchangeArea(models.Model): """ An Exchange Service Area, calculated from a phone exchange and surrounding census tracts. """ coordinates = ...
2
votes
1answer
167 views

Limits to processing files from a list of rasters

I have written a script which selects all files that are within or subset by an area of interest polygon. This works fine but when the file list it's working has more than 150 records it stops ...
2
votes
1answer
185 views

ArcGIS 10 SP2 issue with AggregatePoints

Esri persuaded us to upgrade to SP2 and now we cannot use the code we have, as it doesn't work. According to the download material, NIM063853 is when AggregatePoints doesn't create the derived ...
2
votes
1answer
316 views

Enumeration Problem with Eclipse and ArcGis 9.3

i'm recently using Python for my Processing work that I do with ArcGis 9.3. I figured out, that using Eclipse (with PyDev) could be helpfull for debugging purpose. The geoprocessor is starting as ...
2
votes
1answer
418 views

How can you make RasterToASCII_conversion observe environment setting output cell size?

I have two rasters (an ESRI grid and an IMAGINE image) that differ in projection, extent and cell size. I want to convert the IMAGINE to an ASCII, and want it to have the extent, cell size and ...
2
votes
1answer
673 views

Create a Python script to merge broken polylines from a microstation CAD file in ArcGis

I have tried using the dissolve tool with unsplit_lines option but it does not merge the lines... maybe there is a step I am missing?
2
votes
1answer
854 views

Export from SDE to SHP in ArcGIS 9.3.1 - problem: not exporting all fields

I'm exporting a layer from SDE to SHP by python script, and I'm doing it in 2 phases: the first includes select by location (for picking the relevant features) and the second phase includes the Select ...
2
votes
1answer
67 views

Access ArcCatalog Window through ArcPY

I want to create a button in ArcCatalog that takes the metadata from the selected file in ArcCatalog and prints it to a text file. The metadata extraction part is done, and I have succssfully tested ...
2
votes
0answers
46 views

Help with Python/GDAL documentation

The instructions from the url http://gdal.org/gdal_tutorial.html give the following example: dataset = gdal.Open( filename, GA_ReadOnly) with the following description: It's interpretation is ...
2
votes
0answers
51 views

Iteratively exporting from Table to .txt in Model Builder (ArcMap) not appending correctly

I am solving a location-allocation type of problem where I use a loop to go through several specifications of the problem. The model runs fine, and produces the vizualization outputs just as expected. ...
2
votes
0answers
26 views

Programmatically Harvest and Disapprove Metadata - GeoPortal Server

Is it possible to synchronize an existing metadata catalog in esri's GeoPortal Server? I have access to the server, and have a script to add an XML file to our web accessible folder. After this script ...
2
votes
1answer
37 views

netCDF4 Python climate algorithm

I have been working in Python with the Acaconda Python distribution to create code that accomplishes the following algorithm: I have multiple variable netCDF4 files [NCEP Reanalysis tmax(K), tmin(K), ...
2
votes
0answers
24 views

QGIS Python install question

Apologies for the 101 question; however, in trying to ramp up on python/QGIS I've seen mentioned that python.exe is the key executable in a python install. I have both Python 2.6 and 2.7 installed on ...
2
votes
1answer
35 views

Merge tif files with python

I'm also having problems with running gdal_merge.py within another python script and I cannot run it. I already checked a similar problem here. My example is as follows: First I set my workspace and ...
2
votes
0answers
56 views

Raster to polygon using R [closed]

I am trying to convert a raster object to a polygon object using R but I am running into some problems using my Windows 7 machine. I originally tried to use rasterToPolygons (package: raster) but it ...
2
votes
1answer
89 views

How to print 2 maps in the same PDF page using PyQGIS?

I am trying to generate a one-page PDF document containing the following items: 1) On the left half, a full state map (say, New York State). 2) On the top right quadrant, a map that zooms in to one ...
2
votes
0answers
33 views

How to convert a raster file (*.tif) into a composite geodataset by using Python in ArcGIS 10.2.1

I created geotiff rasters (approximately 6000 rasters) in .tif format by using Matlab Mapping Toolbox. When I examined the properties of the data, I realised that it is 64 bit double type. I need to ...
2
votes
2answers
50 views

ArcGIS are two rasters the same? - including null values

I am working on a task to calculate Height Above Nearest Drainage (HAND) - that is the height above the nearest point along the flow path that is on a drainage - not the geographically nearest ...
2
votes
1answer
63 views

Is it possible to render a large number of shapefiles to a pdf document using Python?

I'm extremely new to GIS, and recently made a map by loading a bunch of shapefiles into QGIS using a python script. However, it took 15 mins to scroll in or out on the image, and the pdf export ...
2
votes
0answers
83 views

Matplotlib error when installing Molusce or lifemapper in QGIS Brighton

I am installing plugins via the QGIS desktop internal interface, and have had twice now messages associated with matplotlib. The first error was for something called lifemapper and now for MOLUSCE. ...
2
votes
0answers
51 views

How to add column to attribute table using field calculator with $length function?

I used the following code to add a separate column to the attribute table with the length of features. from PyQt4.QtCore import QVariant from qgis.core import QgsField, QgsExpression, QgsFeature ...
2
votes
1answer
119 views

How to load a WMS layer using PyQGIS?

Although there are some posts on this matter, there is no answer in anyone of them. This is why I am asking it again. One post I found was Raster layer invalid I read information from the following ...
2
votes
1answer
44 views

How can I extract the data showed in Version Changes before reconcile/post process?

I want to make a script in python to extract the data about version changes before make the reconcile/post process. Is that possible? I trying to avoid use C# or VB script.
2
votes
1answer
44 views

GDAL Warp to clip a .tif: Works fine standalone, won't work in Python

I am trying to use the subprocess module to call gdal warp and clip a .tif using a shapefile. When I try the command in GDAL it works fine, but when I attempt to call it into a Python script it will ...
2
votes
0answers
30 views

Diminishing performance of gdal_polygonize in a python subprocess for GRASS to PostgreSQL

I have written a python script to polygonize GRASS rasters into a PostgreSQL database using the gdal utility gdal_polygonize: sub.call('gdal_polygonize.py -8 gdb/quercus/{0}/cellhd/{1} -f ...
2
votes
0answers
70 views

Python script for dark object subtraction on Landsat 8 Imagery

Does anyone know of any python scripts that will allow me to conduct such a process? I am limited to open source software and have minor experience in Python.
2
votes
0answers
41 views

What is the issue with geopdf format?

I'd like to add the geopdf format as output of a library that I am working on. After have looking around, I have not been able to find a (c, c++, python) library that meet my license requirements ...
2
votes
1answer
186 views

Error with da.UpdateCursor and SDE feature classes

I am making my first attempt at editing an ArcSDE feature class with python through a da.UpdateCursor. I'm essentially taking code I've written for a file geodatabase feature class and applying it to ...
2
votes
0answers
67 views

Iterating between two layers using QGIS python

I will try and explain my situation as clearly as possible. I just created my first plugin that is being used to analyze between various layers and give back quantities to the user. Most of it is ...
2
votes
1answer
185 views

calling gdal_merge.py into another python script running GDAL processes

Good Afternoon All, I am wanting to use gdal_merge.py to merge a series of .tif files prior to clipping the merged file to a shapefile boundary, but want to do so as part of another larger script ...
2
votes
0answers
52 views

Correcting addresses with Python or Model Builder

I am trying to make a script in Python (or Model Builder in ArcGIS) for correcting addresses. I have a point shapefile with the addresses (it has X and Y, and fields for "number", "street name", and ...