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

learn more… | top users | synonyms

4
votes
2answers
964 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
669 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
5k 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 ...
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 ...
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 ...
0
votes
2answers
457 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
545 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
989 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
665 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
4k 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 ...
35
votes
7answers
6k 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
536 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
972 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
346 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
743 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 ...
1
vote
0answers
253 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 ...
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
4k 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
781 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", ...
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 ...
2
votes
2answers
2k views

GDAL tools for QGIS on OSX - what is the exact directory for gdal binaries?

When I try to use the gdal raster tools, eg clipper, I get the message "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the ...
8
votes
6answers
5k 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 ...
5
votes
3answers
3k views

Python: Combine multiple Shapefiles

i have got a lot of Point-Shapefiles (r20010101.shp, r20010202.shp, r20020101.shp...). Each of them has the same amount of points at exactly the same location. In a column that is named after the Date ...
4
votes
2answers
915 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
716 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
863 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
447 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
3answers
2k views

Read KML file with GDAL/OGR for Python

I have file : test.kml and I try to open it with GDAL/OGR (1.6) librairie in Python (2.5). But I don't succed can you help me ? This is my code : from osgeo import ogr adresse = 'test.kml' ...
6
votes
2answers
591 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, ...
5
votes
1answer
368 views

Combined area of all features within features of another layer

I have a grid shapefile (basically, a half-degree grid of the world, where each cell has a unique id number), and a set of files with features. I want to record for each grid cell, all the areas ...
3
votes
1answer
151 views

Using ESRI Python's Geoprocessor Via mod_python

I am working on a number of geoprocessing services to be accessed solely by web clients. The traditional method of encapsulating this type of stuff in toolboxes and then publishing the toolbox just ...
1
vote
1answer
905 views

Convert old ArcGIS 9 VBA tool to new Python script tool for ArcGIS 10

I have an ArcGIS .mxd file with an imbedded VBA script that is executed from a tool bar button. I would like to convert this VBA script tool to a python script tool for use in ArcGIS 10. Is that ...
5
votes
1answer
596 views

Determining ESRI File Geodatabase release version?

Is there any method in Python, ArcObjects, or the File GDB API for determining the release version (9.3, 10.0, etc.) of a file geodatabase? There is a need to find all of our shared 10.0 version file ...
0
votes
2answers
343 views

FME API Module null?

I try to convert my geodatabase to Excel. And i have a strange message: FME API version of module 'XLS_ADO' matches current internal version (3.6 20101014) Trying to find a DYNAMIC plugin ...
5
votes
1answer
2k views

Python Field Calculator ArcGIS 10 expression for a RANGE

what is the python expression for defining a range of numbers? I have tried numerous combinations but cannot get a simple range of angles (100 -200) to compute correctly. Screen shot : screen shot ...
1
vote
0answers
248 views

Validate Python Fme

i have a problem with my script for convert GDB to Excel. if s=='xls': reader=FMEReader("GEODATABASE_FILE") reader.open(param_filename_gdb) writerXls= FMEWriter("XLS_ADO") ...
1
vote
2answers
1k views

Creating and serving pdf files from ArcGIS server 10.0

I am tasked with sending map data from the Flex client to an MXD then to serve that as a PDF to the client and/or a server side location. Creating the PDF isn't an issue, however, I am having trouble ...
2
votes
1answer
323 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 ...
3
votes
1answer
2k views

Grouping points by location

This is ArcGIS specific. I do have surveyed points (sections). There will be 200 sections, each section 20-30 points. I want to create polylines (sections) out of the points. In order to do so, they ...
0
votes
0answers
266 views

How to read a feature table empty with FME / Python?

I would like to convert a feature table Geodatabase (empty) to MapInfo, but my feature table is empty. I would like to write the schema of feature table in MapInfo file. Is it possible to force the ...
2
votes
1answer
1k views

How do I insert a DATAFRAME_ELEMENT value into a dynamically generated shape file containing its extent?

This is for ArcGIS 10, Python 2.65. I have code which captures the extent of dataframes within all mxd's in a directory. I also want it to add the dataframe name, scale and the name of the mxd it ...
1
vote
1answer
378 views

FME Feature Type with Python

Here, the python for create a list of feature type but.... import sys from pyfme import * try: log=FMELogfile("shapeToTAB.log") log.log("Opening reader",FME_INFORM) ...
1
vote
0answers
280 views

getting the correct location data with user input

I have some code others have provided, which I modified in order to run a Python script in a toolbox in ArcMap which accepts user input for a starting point, distance, and angle to create a shapefile ...
3
votes
2answers
844 views

How to get a list of features from FME? Python?

I would like to get a list of geodatabase feature tables from FME. Is it possible with Python? Or another transformer? Thanks.
8
votes
6answers
956 views

How do I generate thumbnails images from lots of shapefiles?

A colleague and I recently released an Open Source project called Mapoteca which is a set of Python Scripts that integrates with a GDAL/FWTools installation allowing a full walk-through of directories ...
5
votes
4answers
1k views

Changing image projection using Python

Image corner coordinates are known: Top left: (70.20315, 20.92749) Top right: (70.20315, 31.45240) Bottom left: (59.70571, 20.92749) Bottom right: (59.70571, 31.45240) (Basically map over Finland ...