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

learn more… | top users | synonyms

8
votes
2answers
433 views

What are mystery green lines in Layout View produced during ArcObjects script execution?

Could any of ArcObjects guru tell me, what are these green lines on my Page Layout and what to do, or not to do, so they do not appear? See image attached. I do used ArcObjects from Python. My script ...
8
votes
2answers
386 views

Python script to read CAD data to find polygon extents

I have Civil 3D 2012 with ArcGIS for AutoCAD 300. I want to read the extents of a polygon in the drawing. Feature Class in A4A300 = Boundaries, the CAD layer is PROP-BNDY, there is only one polygon on ...
8
votes
5answers
189 views

How to set ArcGIS for Desktop license to lower level for testing whether Python script still runs?

I have a Python script that will need to be given to a client. We are currently evaluating what license level the client will need in order to run the script for their software acquisition purposes. ...
8
votes
2answers
334 views

How to remove spikes in polygons with ArcGIS 10/Python?

In the picture below you can see a polygon layer, representing steep slopes, extracted from a TIN. The polygons have a lot of spikes in them. I would like to remove these spikes while the rest of the ...
8
votes
2answers
2k views

Convert an ESRI File GDB Table to Access 2007 ACCDB table programmatically

Does anyone know of a method to convert an ESRI File Geodatabase Table into Access 2007 Table programmatically. I have been trying using the PYODBC library and a series of insert statements but am ...
8
votes
0answers
301 views

Two machines running the same arcpy based software - only one is leaking memory [closed]

Ok, so I'm running a rather large Python application based on arcpy on two separate machines - one of them is leaking memory and one is not. Both are running the same operation in the software. The ...
8
votes
0answers
364 views

Using a different Python IDE/debugger for ArcGIS [duplicate]

Possible Duplicate: How can I effectively debug arcpy Python scripts? I prefer to use PyScripter over IDLE as my IDE/debugger for writing GP scripts in Python. In ArcGIS, however, when I ...
7
votes
3answers
400 views

How to extract the number of vertices in each polygon?

I have ArcGIS Desktop 10.2 and my challenge is how to extract the of number vertices in each polygon for all features like this: I have many parcels in my feature class and I want to extract ...
7
votes
6answers
12k views

How to get X Y coordinates and cell value of each pixel in a raster using Python?

I’m really new to Python and I would like to know whether there is a quick method to get cell values of a raster pixel by pixel and the coordinates (map X Y coordinate of centre of each pixel) using ...
7
votes
2answers
6k views

Converting projected geoTiff to WGS84 with GDAL and Python

Apologies if the following question is somewhat stupid, but I am only VERY new to this whole GIS thing. I am trying to convert some projected geoTiff images to WGS84 using gdal in python. I have ...
7
votes
5answers
11k views

Full list of ISO ALPHA-2 and ISO ALPHA-3 country codes

I'm searching for a full list of countries with their country codes. Like on this page (need full and valid): http://www.nationsonline.org/oneworld/country_code_list.htm Thanks.
7
votes
2answers
1k views

How to read an Excel sheet in ArcPy script

I'm writing a python code to convert X,Y points in excel to shapefile. In this process i have toread xy points from shhet1. What is the step i have to include in my process to read data from sheet1 of ...
7
votes
2answers
2k views

Generating GeoJSON with Python

Hi I want to programatically create a GeoJSON file using polygons from a shapefile but adding attributes from my own application. This is easily done for a shapefile: def ...
7
votes
4answers
2k views

How to remove numeric characters from alphanumeric value in field calculation?

I have a field containing alphanumeric values in the following format: A-AA00 Sometimes they are also A-AAA0 I need a Python script I can put in the field calculator in ArcMap 10 that will at ...
7
votes
2answers
3k views

Basic Field Calculator Python Question

I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why. I'm trying to create a ...
7
votes
5answers
582 views

python.multiprocessing and “FATAL ERROR (INFADI) MISSING DIRECTORY”

While trying to do multiprocessing with arcpy, I am occasionally running into this error: FATAL ERROR (INFADI) MISSING DIRECTORY I have no clue what is triggering this error, and it crashes the ...
7
votes
6answers
4k views

How can I calculate the orientation of each side of a polygon in ArcGIS 10?

I want to examine the orientation of each line in a polygon so that I can calculate their solar exposure. Each polygon represents a building, and has an associated height. For the moment, I just want ...
7
votes
2answers
2k views

How to find the mid-point of a line in arcpy

How can the mid-point of a polyline be calculated using the geoprocessing framework, eg in a Python script? The polyline.centroid property returns The true centroid if it is within or on the feature; ...
7
votes
3answers
2k views

Problems setting up eclipse (with PyDev) for ArcGIS 10

I'm trying to use eclipse with PyDev to program in python. In Windows 7 x64, I've added a PATH environmental variable (PATH C:\Python26\ArcGIS10.0\python.exe;) and what I thought were the relevant ...
7
votes
3answers
1k views

GDAL and Python: How to get coordinates for all cells having a specific value?

I've got an Arc/Info Binary Grid---specifically, an ArcGIS flow accumulation raster---and I'd like to identify all cells having a specific value (or in a range of values). Ultimately, I'd like a ...
7
votes
2answers
1k views

selecting by attribute and specific value replace

I want to select all of the features by attribute where the attribue in myattrib is like... Selection "criteria H". That is not a problem. However then I need to replace (myattrib," H", "") except ...
7
votes
1answer
211 views

Is Python essential for working in QGIS?

I am a beginner in QGIS. I Generally have a doubt: to work in QGIS is it necessary to know Python? whether i am asking we should know to write python programs to make certain modules run?
7
votes
1answer
142 views

How to save python session in QGIS?

After running a lot of scripts in QGIS' python console, I have more than 10 dictionaries and lists, and I need these for further analysis. Is there a way to save python session, with all these ...
7
votes
3answers
319 views

Using ESRI geoprocessing services from a non-ESRI client (Python)?

I'm thinking it should be possible to consume an ESRI Geoprocessing service from a python script without invoking ArcPy or needing an ESRI installation on the client machine. For example I create a ...
7
votes
4answers
399 views

Joining lines when direction is not known

I am struggling with this problem. I have a polyline made up of several segments. Each segment is made up of points, each point identified in 3D space by coordinates and elevation. Together, if ...
7
votes
2answers
181 views

Finding specific pixel values ​​in ArcGIS using Python

I have a raster file containing some integer values. I need to find all pixels whose values are not defined in list like this one: l = [1,2,4,8,16,32,64,128]. Is there any easy way to solve that ...
7
votes
2answers
347 views

How to create a solar intensity map for a garden plot?

I'm interested in creating a raster surface that depicts the average solar intensity per unit area for a small garden plot. I imagine the inputs into the model would be the following: Plot ...
7
votes
1answer
894 views

How to perform a table look-up using Python in ArcGIS 10.0?

Using ArcGIS 10.1 the arcpy module has a TableToNumPyArray command, which converts a table into an array. Unfortunately I don't have access to 10.1 on my work PC. Is there a workaround which will ...
7
votes
2answers
800 views

Process a raster with multiple geoprocessing tools in arcgis 10 using python - flow between processes

I'm writing a short python script that includes processing rasters with different geoprocessing tools in ArcGis 10, for example, the three processes below, is this best way to use multiple tools ...
7
votes
5answers
5k views

update one shapefile attribute table with values from another dbf table

I try to explain here what I am trying to do: I have one shapefile and one independent dbf table with the same fields. In the dbf table all the fields are populated but in the shapefile attribute ...
7
votes
4answers
514 views

What python web-mapping framework to use?

I am interested in developing a web-mapping application. I am relatively familiar with Python and so i'm looking for a python framework. What are my options? what are the pros and cons of each option? ...
7
votes
1answer
313 views

How to address the new “Task-Completed” QgsMessageBar in Python?

I am really amazed what huge steps the QGIS development has taken in the last months. The new iconset, the improved Print composer and many more changes to be seen in QGIS 2.0 are really awesome! ...
7
votes
7answers
4k views

How to Remove return/newline (\n) character from Field using Python and Field Calculator?

I have a geodatabase table with a field that I'm trying to remove return characters (new line). I found this post (How can I remove (chomp) a newline in Python?) of how to do it, however it is not ...
7
votes
4answers
588 views

Visualization of satellite image - directly in python

Is there any way (a package or what not), to visualize a geotiff image directly in Python? I don't want to use ENVI or ArcGIS or anything else. Thank you in advance.
7
votes
3answers
891 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 ...
7
votes
2answers
351 views

Autoincrement field when New Feature added

I know that this is probably a very basic programming but I am brand new to Python. I have a layer in a geodatabase that I need a unique ID field (for joining). I can't use the ObjectID because that ...
7
votes
1answer
350 views

Reduce extent of raster processing

I need to reduce the processing extent of my raster by some sort of automatic procedure in python. Currently the borders of the dataset I've been using has anomalies (due to the classification of the ...
7
votes
1answer
801 views

How can I auto-increment output file-names in Toolbox ESRI ArcMap 10

I have a simple tool which outputs a file. I would like the filename to be a number which increments every time the tool is run. How would I go about implementing this using the toolbox in ESRI ...
7
votes
2answers
2k views

How can I iterate over map layers in QGIS python

I'm having trouble figuring out how to iterate over map layers. I can access the currently highlighted layer in the table of contents via iface.activeLayer() but I want my code to operate on all ...
7
votes
2answers
704 views

How to determine on which side of a line a polygon feature falls?

I have parcel data intersecting line data. In the parcel data there are some parcels that don't intersect the line. How could I programmatically figure out if the non-intersecting parcel is on the ...
7
votes
1answer
1k views

How to convert Shapefile geometries to WKB using OGR?

I got the geometry of a feature of the shapefile, and i want to save that geometry in the postgis (in WKB formats like it happens when we import shapefiles using shp2pgsql and psql commands). How do I ...
7
votes
1answer
419 views

What Lidar processing tools are available in Python?

I have been using FUSION and the command line FUSION Lidar Toolkit (LTK) to process Lidar data. A broad Google search ("Lidar Python") yielded libLAS and pyLAS as Python lidar libraries, however, ...
7
votes
1answer
954 views

How to get raster corner coordinates using Python GDAL bindings?

Is there a way to get the corner coordinates (in degrees lat/long) from a raster file using gdal's Python bindings? A few searches online have convinced me that there is not, so I have developed a ...
7
votes
2answers
709 views

Converting KML files for use with Python library Shapely

I am trying to get a KML-file (wijken.kml) into Shapely. The KML-file is validated against the proper XML schema, so I guess the input is correct. Routes I have tried: 1) Converting to WKT or WKB ...
7
votes
1answer
142 views

Reading shapefile tolerance in python

Is there a way to get the cluster or xytolerance from a shapefile into python using free/open source software? I'm currently using the pyshp package and can't see methods for this anywhere. Also it ...
7
votes
1answer
303 views

Migrate python scripts from 9.3 to Arcgis10

What changes are needed to migrate scripts from the ArcGis 9.x environment/gp-object to the ArcGis 10/arcpy environment? Can anyone provide a good overview what the changes are? Can someone share ...
7
votes
1answer
717 views

concurrent use of in_memory workspace in arcpy

i am using a python script that's eliminating small polygons from a feature class. this script creates temporary feature classes with fixed (hardcoded) names in the "in_memory" workspace. example: ...
7
votes
2answers
1k views

Calculating Field based on name of shapefile

I have multiple shapefiles to which I have added a field called "gname1". For each shapefile, I want "gname1" to be set to the name of that particular shapefile, for every feature within the ...
7
votes
3answers
743 views

python script error- with GetParameterAsText

I have a seemingly simple code which iterates through a list of feature classes and calculates an ID field in the attribute table that is equal to the first 5 characters of feature class name. The ...
7
votes
1answer
1k views

Help with PostGIS polygon geometry - non-closed rings

I've picked up a copy of the super-wicked book 'Python Geospatial Development' by Erik Westra (Amazon link), and I'm working through it. Currently, it's teaching me to load GSHHS coastline data from a ...