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

learn more… | top users | synonyms

10
votes
3answers
582 views

How to download and process raster files in Python?

I am fairly new to python and seek guidance for a question which might sound trivial to many. Is there a way to use 'wget' in a python script to download raster files from a server and process them ...
3
votes
1answer
455 views

Want to use GDAL in Arc10 toolbox via subprocess call

I'm attempting to launch a version Python 2.5 that supports GDAL from an ArcGIS10 toolbox script. I'm doing this because I'm having loads of trouble importing the GDAL library directly into Arc, and ...
5
votes
2answers
2k views

GDAL Python bindings not picking up OGR PostgreSQL driver

I have a windows server (Microsoft Windows Server 2003) with: Python 2.7, PostgreSQL 9.04-1, GDAL 1.8.1 (installed from the windows installer (gdal-18-1500-core.msi) hosted at ...
3
votes
1answer
2k views

How do I 'select' using ArcPy?

When using a cursor to loop through an attribute table, is it possible to iteratively select each row? I want to clip a line to a polygon grid (see previous question); due to the size of the grid the ...
4
votes
2answers
904 views

How to merge street layers in QGIS for exporting to PostGIS?

Is there any way of merging lots of street data in QGIS and getting one layer for exporting it to Postgresql? I know one method using mmqgis "Merge Layer" tool. It works in Ubuntu but not in ...
0
votes
1answer
1k views

How to solve an installation problem involving QGIS, Python, and a plug-in?

In an attempt to get the plugin "Profile Tool" working, I installed geoslib and python Shapely 1.2.10 module as requested using following: sudo port install geos Then install Shapely once ...
5
votes
1answer
1k views

arcpy: Compare extents of rasters

I am writing a script that takes an input of an Area of Interest (AOI) and then walks through the base directories to find any file that has an extent that intersects with the AOI, clip it and ...
1
vote
2answers
428 views

How to translate (reposition) a raster in Python?

I tried to use QGIS GeoReferencer to translate a raster layer, but somehow failed. It just goes to somewhere unexpected. Now I decide to do it myself, with python. I think some libraries like GDAL ...
5
votes
2answers
263 views

Finding Raster Overlap within a Directory

Here is the scenario: I have a directory with 100+ map projected, single band, rasters that weighs in a 40GB+. I have used ArcMap's built-in mosaicing tools to create a raster mosaic. I am using a ...
5
votes
5answers
1k views

Python, shapely library: is it possible to do an affine operation on shape polygon?

I am trying to create a rotated rectangle in lat/lon coordinates. Basically I have the coordinates of the center and rotation angle around the center. Is it possible to do using, shapely or gdal, or ...
6
votes
1answer
3k views

In an arcpy script, how do I convert ArcGIS date value to a string reading in mm/dd/yyyy format?

I am writing an arcpy tool script in ArcGIS 10.0. In a fGDB feature class, I have a Date type field. I gather that the values in the Date field are stored as long integer dates, but they display in ...
6
votes
4answers
8k views

How do you test for a NULL string field in the Field Calculator with Python?

I am trying to perform an operation on a string field with a condition that it contains data. Referencing None with Python does not appear to work when the field is nullable and contains <Null> ...
8
votes
3answers
4k views

How to find the locations of the highest values in a raster?

Using ArcGIS 10, I have a raster where I would like to find the pixel with the maximum value in the raster and return its location (center of pixel) in decimal degrees. I would like to iterate through ...
5
votes
4answers
1k views

Does File Geodatabase performance degrade as it fills up?

I'm having a memory leak issue. Upon investigating this more, it seems the file based geodatabase I write to in a loop, is growing very large, and as it grows, it significantly degrades the ...
6
votes
2answers
830 views

How can you insert a table record without geometry into a feature?

I am working with ArcGIS and Python and trying to append table rows into a featureclass. You cannot use append and you cannot just make a tableview of the featureclass and then try to append it in. ...
0
votes
4answers
506 views

How to unproject a shapefile in Python?

I have one shapefile with XY coordinates in meters. Now, I want to develop one script in Python which converts meters to decimal degrees. Please help me to develop this. Thanks
9
votes
3answers
3k views

Setting parameters in Script Tool using Python

I hate to bug you all with the same problem over and over again but I run into a new problem everytime I make a slight change to the code. All I did to the code below was to replace field names to ...
4
votes
2answers
3k views

arcpy, “.lyr” file to shapefile or raster

i am using arcgis server 10 and python 2.6.5. i have created a "test.lyr" file, now i wanted to convert it either to shape file or raster file. i have created the "test.lyr" from "test0.tif" and ...
7
votes
3answers
1k views

Use Esri Geoservices REST as backend for Python web framework (Django?)

I would like to know if it's feasible to use an existing Python web framework such as Django/GeoDjango as a frontend to work with Esri's Geoservices REST API? I envision developing a database engine ...
3
votes
2answers
608 views

Arcpy: print to PDF with Vector shapefiles, text etc

I have a small python script which exports a set of data driven pages to PDF. This works fine, including appending each page to an 'all' pdf. My issue is that it creates rasters of each layer in the ...
3
votes
1answer
499 views

Adding Descriptions to custom ArcToolbox 9.3.1

I looked http://webhelp.esri.com/arcgiSDEsktop/9.3/index.cfm?TopicName=Setting_script_tool_parameters and couldn't find how to add Descriptions for each parameter in the script tool. I see how to add ...
7
votes
1answer
225 views

Efficient Network Neighbors?

I would like to identify the Kth order neighbors of an edge on a network, specifically the neighbors of a large set of streets. For example, I have a street that I'm interested in looking at, call ...
1
vote
1answer
340 views

How to tranform a column field into a list using Field Calculator

I'm trying to make a simple field calculation with ArcGIS 9.3: New field = Old field - Old field(first value) which in Calculate Field with python code should be Expression: !Old field! - first ...
1
vote
2answers
737 views

What changes will be made to arcpy in ArcGIS 10.1? [closed]

I heard that two big changes to arcpy will be add-ins and new, faster cursors. Also, new features include "the ability to administer your enterprsie geodatabase (ArcSDE) using Python scripting" and ...
4
votes
3answers
4k views

ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script

I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...
1
vote
0answers
246 views

arcgis server 10, vb.net, non pooled service, web adf

i am running arcgis server 10. i created a A.MXD file, then started arcgis server and successfully added non-pooled service using A.MXD. i also installed visual web developer 2010 express and created ...
7
votes
2answers
3k views

How to create a checkbox parameter in a ArcGIS custom Python tool?

I am working on creating an ArcGIS tool from a Python script I am writing. I am wondering if it is possible to have a checkbox parameter. Basically what I want to do is have a parameter where the ...
2
votes
1answer
177 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 table. ...
8
votes
2answers
856 views

ArcMap running scripts slower if you import Arcpy

I am finding ArcMap runs slower, if you have written a script, which imports arcpy. You may wish to write a script that can be operated in ArcMap, through the python window, or as a standalone ...
2
votes
0answers
249 views

RT Sql Layer plugin giving an error [closed]

I am trying to use the aforementioned plugin with QGIS 1.7 and Postgres 9.0/PostGIS 1.5. Added a PostGIS spatial layer w/out a problem and then clicked on the RT Sql layer button which displayed the ...
3
votes
1answer
1k views

How to update only a single vector layer in QGIS map canvas?

I want to update a single vector layer as I am working on 8 vector layers and they are getting fast data from serial port so for updating I use mapCanvas().refresh() which refresh all the layer and I ...
3
votes
2answers
525 views

PostGIS + pgRouting: Adding dummy links to a road network and performing routing analysis

I'm a beginner when it comes to postgis and pgrouting development. For a project I'm working on and a bit of the algorithm: I have a polygon layer that represents zones I have a line layer that ...
1
vote
2answers
3k views

Get extent of Georeferenced Rasters in Python and output to polygon shapefile

I would like to create a shape file containing the extents of each of the rasters in a directory. Is it possible to capture the extent of a raster using Python? I have tried ...
2
votes
0answers
578 views

Perfectly running python script gives error when run from web.py

I have the following python script which runs perfectly if run separately: import arcpy val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", ...
4
votes
2answers
671 views

arcgis 10, python update raster of mxd file

i wanted to update the raster file in a mxd file using python. for example, i created a.mxd which contains b.tif file in it. now, i obtained c.tif and want to update the a.mxd, i.e. want to delete ...
3
votes
2answers
3k views

Loop through records

I have written a python script that is supposed to basically loop through selected records of a feature class. Here's a sample of what a table looks like: OBID STID FL TL 1 1 0 9 ...
7
votes
1answer
203 views

Optimize GEOSGeometry's spatial operations by avoiding thread-safety checks

A ranking algorithm I'm developing for a Django webapp requires performing spatial operations (within, intersections, sym_difference, etc.) using a query against large number of geometry objects. ...
1
vote
4answers
1k views

Install other python distributions on top of ARCGIS installation ? - esp. Python(x,y)

I'm using ArcGIS 10 and would like to use various additional libraries that are not included in the delivered version of ArcGIS (esp. numpy and matplotlib). First I tried to install them manually as ...
8
votes
1answer
2k views

Polygon overlay with Shapely

I'm trying to capture all the non-overlapping polygons indicated below using Shapely (given polygons A,B & C). Moreover, I'm hoping to do so without iteration, testing for intersect etc. The ...
3
votes
2answers
2k views

How to create a feature class in a file geodatabase in ArcGIS 9.3 with Python?

I'm not entirely sure if I am using the correct terminology, so I apologize in advance. What I am looking to do is create a file geodatabase and add a feature class directly into that file ...
1
vote
3answers
504 views

python: Replace Variable in VB-Expression-File (.cal) [ArcGis 9.3]

I'm trying to modify a VB-Expression saved in a cal-file: dim out if [D19830701]=-9999 then out= [D19830501] else out= [D19830701] end if __esri_field_calculator_splitter__ out with this ...
6
votes
3answers
3k views

Insert Raster to MXD using arcpy.mapping (ArcGIS 10)

What i want to do seems simple. But again i can't even find a workaround... I have got a lot of Raster-files (ESRI-GRID) which i need to insert into a layout mxd-file and then export the map to ...
14
votes
1answer
2k views

Voronoi polygons that run out to infinity

I have been working on implementing the voronoi.py script (Bill Simon's translation of Steve Fortune's code). According to the QGIS link it is basically the same code that I am working with, but the ...
4
votes
2answers
1k views

how to create graphs while running python with ArcGIS 10

As Matplotlib seem not to work (what a drag it's such a nice tool) I'am looking for alternatives to create graphs while running python with ArcGIS 10. Besides regular pie and column charts I need in ...
4
votes
2answers
766 views

Using a bounding polygon, instead of a bounding box

I've got a large set of LAT/LON coordinates. Up until now, when I needed to select out those that fell within a certain region, I'd just create a bounding box using some MINx, MAXx, MINy, MAXy values ...
5
votes
2answers
613 views

Access to SpatiaLite .dumpshp via Python?

I'm trying to interact with a SpatiaLite database via Python on my Windows machine. I've managed to connect to the database and load the SpatiaLite extension, which means that I can pass SQL queries ...
1
vote
3answers
786 views

CreateFeatureclass_management doesn't add a layer to the TOC of ArcMap10

I created a python script for a toolbox and I am wondering about the fact that CreateFeatureclass_management doesn't add the feature-class as layer in the actual dataframe. This does not happen in the ...
1
vote
2answers
424 views

Adjust Picture Marker Symbols with Python? (ArcGIS 10 SP1)

I am working toward a map cache, and therefore have about 12 versions of the same datasets to be shown at different scales. Invariably, the symbol sizes I have set on highway shields (for example) ...
2
votes
1answer
2k views

How to populate a field with the max M value of a feature using Python in Field Calculator?

I need to calculate the max M value for a line feature using Python in ArcGIS 10 Field Calculator but I cannot figure it out. In 9.3 I used the follow VBA expression… **Pre-Logic VBA Script Code:** ...
6
votes
2answers
443 views

Disambiguate messy place names in python (preferably on local machine)

I have list with several million place names that come from Flickr profiles. Users provided these placenames as free text, so they look like this: Roma, Italy Kennesaw, USA Saginaw, MI Rucker, ...