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

learn more… | top users | synonyms

8
votes
0answers
372 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 ...
2
votes
2answers
543 views

Convert CSV files into OSM with FME

I have a database which i've exported as individual csv files for each table. Below are some of the attributes which exist from two of the csv files: wayPointID linkID order x y z length ...
5
votes
1answer
243 views

Seeing QGIS Python Commands

When learning MapBasic I found the most useful way to learn how to do certain tasks was to do them using the GUI and then watch the MapBasic window in MapInfo to see how they were achieved in code. It ...
1
vote
2answers
998 views

Getting print statements in Python script to print through a batch file

I'm starting to learn Python and batch files. I have a Python script which selects data by location and exports the selection to a new feature class. The script runs just fine - included in this ...
2
votes
2answers
374 views

how to calculate a field from a shp currently sected in a arcmap session using a Python script in ArcMap 10?

Hi I nedd to create a script in Python for use in ArcMap 10. This script must be able to calculate a field from the shp currently selected in ArcMap. Any ideas?, I'm new to Python so any code example ...
2
votes
2answers
476 views

Parameterized insert query to PostGIS fails

I have a PostGIS database table that I need to insert data into. I'm using Python 3 and the pg8000 interface to Postgres. Somehow, parameterized inserts do not work. If I do iq="INSERT INTO ...
4
votes
4answers
4k views

Merge overlapping lines in ArcGIS

I have a polyline shapefile containing a number of lines, some of which overlap. By overlap, I mean that they follow exactly the same path for some of their route, but also have bits that are not ...
0
votes
1answer
848 views

It is possible to edit selected features with Python?

I'm trying to edit some fields of the selected features in ArcMap. It's possible to do this with Python (ArcPy)?
6
votes
1answer
124 views

Would it be possible to construct a stand-alone grass.script python package?

I would like to migrate dependency on ArcPy to grass.script without requiring the full installation of Grass. Would it be technically possible to have a portable directory containing grass.script and ...
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 ...
0
votes
1answer
172 views

How do I assign a variable to a SQL Server ArcSDE database's feature class?

I'm using ArcGIS Desktop 10 and have no experience using Python with a SQL Server ArcSDE database. When using a shp file or file gdb it is very simple to reference a given feature class by simply ...
5
votes
3answers
624 views

matplotlib does not work in ArcGIS 10 and Eclipse (Python)

I have installed matplotlib (v. 1.0.1) which works with iPython quite good. But if I insert the same script in ArcGIS 10 or Eclipse 3.7.0 (with PyDev) I get always errors. As I consider to use ...
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 ...
2
votes
1answer
471 views

Running C# code from a python tool (ArcMap 10)

It appears that the only way to copy individual rows of data while preserving GlobalIDs in code is by using C# or VB.NET. I need to run the C# code from the above link within a python tool, and I am ...
2
votes
1answer
461 views

How to determine area of pixel in meters with GDAL and Python?

I have a raster loaded in Python using GDAL bindings. I'd like to be able to determine the area of a pixel in meters although I'm not confident that the projection is in meters. On this page I see a ...
3
votes
1answer
1k views

How do you make a SQL join query for a NULL in a search cursor in ArcPy?

I am trying to learn how to do some error catching/avoiding in ArcPy. Here is a simplified version of what I would like to do. I would like to take some points, and then check to see if there is a ...
6
votes
1answer
678 views

Mapnik/Python Compatibility

Anyone know what versions of Python Mapnik is compatible with? I'm having trouble getting Mapnik to work. I'm thinking it might be because I am on 64-bit Win 7 and installed the 64-bit Python (v2.7) ...
4
votes
2answers
901 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 ...
10
votes
3answers
574 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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
1
vote
2answers
418 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 ...
3
votes
3answers
2k views

Using Mapscript to create a mapfile from scratch

Following a few online tutorials I have seen, I am trying to create a mapfile from scratch using mapscript. However, when I try to create the layer object, I get an error in the init of mapscript.py; ...
2
votes
1answer
2k views

Using python lookup table to compare records with existing geodatabases

I am trying to use python to look through an access table containing facilities that need to have geodatabases with geodatabases that already exist in order to generate a list of facility geodatabases ...
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 ...
0
votes
2answers
389 views

Read feature table with FME / Python

I try to convert a feature table Geodatabase to MapInfo with FME / Python But each test, my application crash. There is no geometry in my feature table in file geodatabase. Why my application crashes ...
0
votes
4answers
500 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
6
votes
2answers
819 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. ...
3
votes
2answers
600 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 ...
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
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
1answer
221 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 ...
35
votes
7answers
5k views

How can I effectively debug arcpy Python scripts?

I have written many Python scripts using arcpy in ArcGIS 10, and so far my only means of debugging is restricted to printing messages to the geoprocessing results window using arcpy.AddMessage(). Are ...
3
votes
1answer
496 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 ...
3
votes
1answer
795 views

Cropping an image with a map extent

I have an raster file in my server space, which has the same projection as my webmap, and I would like to crop the image by passing the visible extent of a webmap. I think the cropping function is ...
1
vote
1answer
338 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
736 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 ...
9
votes
7answers
5k views

How to get raster image as array in Python with ArcGIS

When starting to work with Python and ArcGIS 9.3, I assumed there would be a simple way to get a raster image into a Python array so that I can manipulate it before storing it back as another raster ...
2
votes
1answer
409 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 ...
1
vote
0answers
243 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 ...
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. ...
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 ...
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 ...
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 ...
2
votes
0answers
561 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", ...