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

learn more… | top users | synonyms

3
votes
2answers
390 views

Reading multiple grid data with Python and ModelBuilder

How can I read grid data (3 or 5 sources of grids) like slope, soil, cover, etc.? My goal is to build a simulator based on multiple grid data for harvesting decisions.
9
votes
3answers
2k views

ArcGIS Python Tool - Importing Custom Script Into ToolValidator Class

I had posted a question last week about customizing a ToolValidator class and got some very good answers. In working with the proposed solutions, I have created a custom module that performs queries ...
4
votes
2answers
493 views

Finding Band Count in Rasters using ArcPy

I'm having troubles finding the band count for my raster files using ArcPy. I need to first list all the raster files in a directory, and then display the band count for each file. I am able to list ...
3
votes
1answer
535 views

Disaggregating multiring polygon for editing, then recombining

BUMP? We have many rows of multi-ring polygons, displayed on a Flex front end. We need to be able to select a polygon (a row), split the rings for editing, edit them, then combine into one polygon ...
4
votes
1answer
2k views

Model Builder - unique name segment creation

Is it possible for us to give each output of a process a unique name segment (inline name). So for example I have a process that dissolves, then eliminates and buffers a single input file. I need to ...
4
votes
2answers
225 views

Append Point Shapefile Location by GPS'd text file

In my industry it is common to create preliminary design maps for point locations that have a unique identifier. Upon the actual construction on the design, points change location based on ...
7
votes
2answers
3k views

How can I turn a shapefile into a mask and calculate the mean?

I have been using python to process huge arrays stored as netcdf files. I would like to calculate the mean of an area defined by a shapefile. I have just installed GDAL but if there are other tools I ...
2
votes
1answer
251 views

Query for Selecting only Selected Fc's from a GDB

I need to version n number of fc's which start with sde."ENT-QA". I need to select only those feature classes and run versioning for it. Can anyone help me in writing the query for selecting only fc's ...
8
votes
2answers
153 views

File naming for Enterprise GIS database?

I'm designing the guidelines for an Enterprise GIS database. Part of this database will include customized geoprocessing tools using a variety of software. I'm interested in knowing whether anyone ...
9
votes
2answers
944 views

GeoTIFFs made in GDAL don't have min/max range when loaded in Arc/QGIS

I'm creating some floating point rasters in GDAL with the GeoTIFF driver. When I load the resulting images into QGIS or Arc the default symbology puts the min at -3.40282e38 and max to 3.40282e38, so ...
5
votes
1answer
545 views

Why does a TIF file lose projection information when a pixel value is changed?

I am trying to change the pixel value of a tif file (containing projection information) but after the pixel value is changed it is losing projection information. I am using the Python imaging ...
5
votes
2answers
3k views

How to convert PostGIS table to Shapefile in Python?

I want to convert a PostGIS table into a shapefile (without using pgsql2shp). In order to create a geometry in the shapefile I have to give the Xmin,Ymin and Xmax,Ymax, and the geometry which I have ...
9
votes
1answer
1k views

Arcobjects in Python: assign interface to objects with feature (shape) geometry

I am trying to use ArcObject in Python. I do have problem with assigning an interface (i.e. IZ.InterpolateZsBetween) to my object with geometry data, code is: from Comtypes.client import ...
12
votes
4answers
2k views

Python module to delete SHP features (without Desktop GIS installed)

I have a piece of software (not Arc) that runs nightly on a non-production machine which updates shapefile features from an external database. Periodically I would like to delete all of the features ...
2
votes
2answers
3k views

How to automate point-in-polygon queries in ArcView?

Layer1 = point shapefile (multiple points, geocoded) Layer2 = polygon (1 attribute; (1,2,3...)) I want a non-gis person to be able input a single address and be told the attribute of the polygon ...
3
votes
1answer
165 views

Anyone have a link for IN-DEPTH ArcGIS Toolbox documentation

I am looking for in-depth links for docs on parameter datatypes for adding custom scripts to a custom toolbox. For example, a parameter data type "Extract Values". What does this do? What config ...
3
votes
2answers
1k views

Ensure relative path in Arcgis layer files

I'm looking for the arcgis python equivalent of the VBA How to save a layer file with a relative path. I'm using a script to change the paths in a collection of about 75 layer files before ...
4
votes
1answer
410 views

How to write code for downloading a file in ArcGIS 10?

I have an offline database which has lat & long coordinates. The functionality I need to provide is to have a (latitude, longitude) point which will have country and city in it. Once the user has ...
0
votes
1answer
2k views

Create HTML report using Python

i want to create Analysis report after createing model for generating cut/fill. Once it will done , basedon this cutfill/table, would be display statics in html formate using python. is it possible. ...
5
votes
1answer
647 views

Is there a way to get layers from a .msd using arcpy?

I need the name of each layer in an .msd, but I could not find support using arcpy (ArcGIS 10.0). Is there a method I missed? In the current workflow, since I am publishing the document, I use the ...
6
votes
2answers
4k views

How to calculate a field in ArcGIS using Python?

I'm trying to calculate a field based on the values of others in the same layer in a calculation. I can't work out why its not working. I've even cut everything down to just be based on one field and ...
3
votes
3answers
569 views

writing a 3D polygon (arcpy)

I currently working on some scripts with 3D polygons using arcpy (arcgis10). Reading and data manupulation works fine, however writing the output back into a shapefile doesn't seem to work, it only ...
2
votes
1answer
489 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). ...
3
votes
1answer
2k views

update a field based on another field in python

I need to update a field based on another layers field. I could do this in arcmap manually by joining the two layers together and then using field calculator. Is there a way I can do it with a script? ...
1
vote
1answer
378 views

ctypes: bridge in python for a dll

I have a dll and I'd like to call it in python. The dll needs of parameters. Do you know how to pass a radiobutton parameter and a checkbox parameter? thanks
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:** ...
10
votes
5answers
2k views

Determine min and max values in an ASCII raster dataset using Python

I have a raster dataset in ASCII format. Using Python, I need to determine the min and max values inside the dataset. I've been told that the header information is key, which contains things like ...
5
votes
3answers
337 views

After running the Version Changes tool ..Export pre-reconcile/post records from parent

I would like to export those records identified as changes after running the Version Changes tool before running Reconcile and Post tools. Preferably with python or having python call a program to do ...
2
votes
1answer
382 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 ...
1
vote
2answers
675 views

Join/Relate in ArcGIS 9.3.1 ArcEditor through a python script - is it possible?

I'm working on a ArcGIS 9.3.1 ArcEditor and I want to write a python script that will do a Join or Relate. Problem is, that join table\join field are restricted to ARCINFO (higher license), and relate ...
7
votes
1answer
2k 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 ...
3
votes
2answers
3k views

How to create the custom tool in ArcGIS desktop with using of python script from model bulder?

I created some model builder for some customization to reduce time in our routine process. I exported my model builder to python script by availability of export options. It doesn't work if i bring to ...
0
votes
1answer
1k views

Import Error while Importing osgeo package [duplicate]

Possible Duplicate: How to install GDAL with Python on windows? I have downloaded Fwtools for python2.5 from http://fwtools.maptools.org(windows installer) after installing it, it was ...
3
votes
1answer
1k views

Update layer datasource in multiple map documents using ArcPy?

I would like to update the data source of a specific layer in multiple map documents using ArcPy, however I'm getting a <type 'exceptions.SyntaxError'>: invalid syntax error on this line: if ...
6
votes
2answers
1k views

calculate average slope along a line

I have a slope layer and I want to calculate the average slope along a line. This line isn't necessarily straight (e.g its a route, I would like to be able to input geographic coordinates along that ...
3
votes
1answer
213 views

getsubcurve from multipart polyline ArcGIS

I have code which analyzes multipart polylines (roads) from the beginning towards the end. The algorithm "moves along" the road. My multipart polylines include circular junctions and branches so they ...
3
votes
2answers
1k views

How to write a SQL WHERE Clause using Multiple Choice values in FME?

I published a parameter which is of Choice Multiple type. I wish to use values from this parameter for WHERE Clause when Reading Inputed Data in the begin of Workbench. So there is no problem if I ...
4
votes
2answers
726 views

How to automatically email interim results from model builder?

I want to get model builder to email me the results of processes at certain stages so that if there are issues I can remotely login and deal with them as I do with python scripts. I have a python ...
1
vote
1answer
666 views

arcpy Geometry tools give incorrect results

I'm new to python and arcpy but I've been trying to learn how to run geoprocessing tools using arcpy. I have (for this example) 2 shapefiles, a and b, which are both polygons. From plotting them in ...
3
votes
3answers
1k views

Using Python to combine middle parts of two fields into third field

Below is how I used the Update Cursor in my final script. As you can see getValue was used a few times, perhaps there is a cleaner way to do this? But my concatenated field wouldn't populate properly ...
0
votes
1answer
871 views

I think I have problem with basics about FME and Python

I try to learn from Oliver's corner instruction ftp://ftp.safe.com/fme/pyfme/OliversCorner.zip) . So for example I overwrite his #script 4 to StartupPython Script some below and set input data in ...
2
votes
1answer
2k 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 = ...
0
votes
0answers
103 views

Graphing with matplotlib [duplicate]

Possible Duplicate: Can you use arcpy.RasterToNumPyArray() to Graph a Raster with matplotlib? I ask this question, but didn't get any real bites: Can you use arcpy.RasterToNumPyArray() to ...
4
votes
1answer
493 views

script for automating insert scale bar, text, north arrow

I've always wanted an automatic process for these tools instead of having to click insert again and again. It seems easy but I can't do it in modelbuilder and I can't seem to find anyone making a ...
0
votes
1answer
190 views

Where should I save my external python script to be executed in FME? [closed]

I need a path, because there are so many folders and subfolders :) FME is installed C:\apps\FME\python Tnx,
3
votes
1answer
175 views

What are some lightweight python modules to convert LAS data formats to text formats?

I searched on the net and found pyLAS, but it seems to require quite a few other modules and I couldn't get the install right. Any pointers will be much appreciated. Thanks!
6
votes
1answer
1k views

How to filter wrong GPS readings?

I have absolutely no experience with GIS, it just so happens that one of the hobby projects I am doing at the local hackerspace includes tracking a model boat with a GPS... I hope this is the right ...
4
votes
1answer
424 views

A count of points within a set distance using updatecursor

I have a script that calculates the average distance between points. What I want is to rewrite it so I can input the point layer, input a distance, and the output field will tell me a count of the ...
1
vote
2answers
675 views

arcpy.sa.Viewshed with OFFSETA

This is using ArcGIS10 arcpy with spatial analyst. I need to call Viewshed, but with an observer height set. I have tried using a Z-aware point feature set, but that only throws an error. I am ...
2
votes
1answer
356 views

Why does “takes no arguments” error propagate from Arcpy example?

I was attempting to run Setup_Customers_Using_Tabular_Data , I modified the paths to fit my environment but when I run the program I receive SetupCustomersByTable() takes no arguments (6 given) ...