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

learn more… | top users | synonyms

3
votes
1answer
475 views

How Can I Calculate Time from Coordinate?

For my application I am searching for an API or an algorithm for clicking point time and time zone. I dont know how I can do this but after getting time I want to calculate giving coordinate sun ...
28
votes
4answers
4k views

Performance of ArcGISScripting and large spatial data sets

I am currently writing a python script using the arcgisscripting module to process a reasonably large data set (~10,000 records in total) normalised over a small number of tables, 8 in total. The ...
5
votes
2answers
434 views

SelectLayerByLocation not Selecting

I have been trying for some time now to create a script to extract the polygons within an extent, but am unable to get the same result as when I use the user interface manual method. Maybe someone ...
1
vote
1answer
259 views

.Net to Python - ArcGIS Add-in

Background: I have been tasked with porting a 9.3 .NET toolbar to ArcGIS 10 / 10.1. I am a dyed in the wool Python programmer and, while digging through someone else's .Net is interesting, it isn't ...
1
vote
1answer
338 views

Cannot install TimeManager 0.7: no module named six

I was able to extract and copy dateutil to C:\OSGeo4W\apps\qgis\python\dateutil and the error saying that dateutil wasn't found disappeared. But now I am getting the error no module named six. Tried ...
2
votes
2answers
1k views

“The tool not licensed” ERROR on a geoprocessing service on ArcGIS Server 10.1

I have a python script which runs well as geoprocesing tool. When published on ArcGIS Server 10.1 as geoprocessing service, however, it throws the following error: Unable to complete operation. Error ...
2
votes
2answers
753 views

Couldn't load plugin fTools due an error when calling its classFactory() method

When I start qgis I get a python exception: Couldn't load plugin fTools due an error when calling its classFactory() method ... 309, in _import mod = _builtin_import(name, globals, locals, ...
2
votes
2answers
240 views

How do I automate performing analysis (intersection) between objects within different feature classes, for a large number of objects?

I have two tables of roads - the same roads, from different sources, and am trying to compare how similar their positions are. I'm wanting to buffer each road in one of the feature classes and ...
0
votes
1answer
664 views

Points in Polygon Count: Error with arcpy.selectLayerByLocation_management

I'm working on generating some multivariate hexbins and am running into a problem with the initial step of counting the number of points (for the first variable) that are within each hex polygon. Here ...
12
votes
4answers
496 views

Mirror of Michigan State University's Python geoprocessing course materials

Been learning geoprocessing with Python using MSU's GEOG 825 ( python geoprocessing ) course. Unfortunately the link is dead now. I know this is a long shot but does anybody have a copy of the ...
5
votes
1answer
1k views

Export each layer in map to a separate image

I have a mxd file with multiple layers I have to export to PNG/JPG. I would like to create a script which turns on layers one at the time before they are exported. So far I have come up with the ...
3
votes
3answers
1k views

How do I apply Dijkstra's algorithm in Python with PostGIS data?

I have currently parsed OSM data, from a PBF file, into a pgRouting database with the use of osm2po, an excellent parsing tool. I don't however want to use the algorithms provided by pgRouting and ...
5
votes
2answers
2k views

Split a shapefile into multiple shapefiles based on a particular Field [duplicate]

I have a shapefile where there are 3 fields OBJECTID, NAME , LOCALITY. I want to create new shapefile that contains the geometry, projection etc. of the parent shapefile and according to the locality; ...
1
vote
2answers
530 views

Python Mapscript 6.0.1 layer.getShape API

I am attempting to follow the mapscript example described here - http://trac.osgeo.org/mapserver/wiki/RasterQuery but ran into some trouble with s = layer.getShape(result.shapeindex, ...
5
votes
2answers
2k views

arcpy.UpdateCursor for multiple fields

I've hit a wall trying to loop through multiple fields with arcpy.UpdateCursor. I have a list of files (2) with multiple fields (10-15'ish) that have its own error check in SQL, and an error value to ...
2
votes
1answer
279 views

Copy two datasets that particpate in the same relationship class

I have an ArcSDE GDB that looks something like this: ++ GDB +++++ Dataset1 ++++++++ FeatureClass1 ++++++++ FeatureClass2 +++++ Dataset2 ++++++++ FeatureClass3 ++++++++ FeatureClass4 +++++ Table +++++ ...
2
votes
1answer
1k views

QGIS Python version

I have brewed python 2.7.3 onto my Mac (Lion), and installed shapely via pip install shapely. The Polygonizer plugin, however, does not find the shapely library. I see when QGIS loads a Python ...
1
vote
2answers
833 views

Can you use arcpy.Copy_management() with in_memory tables?

I have a table in an ArcSDE GDB I'd like to step through using Python. For performance reasons I wanted to load it into memory like so: arcpy.Copy_management('C:/GDB.sde/MyTable', ...
0
votes
1answer
69 views

Error while publishing a mxd as service uing python

I have created an Excel file with Lat/lon values. I added this data tas a layer in the ArcMap. And I "used Display XY data" otion available on right click. I selected the GCS_WCS_1984 co-ordinate ...
1
vote
1answer
125 views

Script to buffer 2 shapefiles within each folder of a root folder

I need some help with ArcGIS python script My folder tree is like this: /Testing location C1 POIS.shp STREETS.shp C2 etc, etc I'm trying to make a script to run from arcgis that would ...
4
votes
2answers
598 views

What's the best projection for rasterization of random latitude and longitude data in the northern Atlantic?

I have a dataset in the WGS84 geographic coordinate system that I would like to interpolate along a grid using Python. It appears gdal_grid is not available through the Python bindings, so I plan to ...
0
votes
3answers
2k views

Why is SQLite python command not working?

I am fairly new to python and am writing a code to read imagery and insert them into an SQLite database but I get the following error cur.execute(statement, (index,fullpath,filename)) ...
12
votes
4answers
5k views

Clustering Trajectories (GPS data of (x,y) points) and Mining the data

I've got 2 questions on analyzing a GPS dataset. 1) Extracting trajectories I have a huge database of recorded GPS coordinates of the form (latitude, longitude, date-time). According to date-time ...
4
votes
1answer
145 views

How to create list from table

I have performed a spatial join on some data and now I would like to take that data and create a list. I'm trying to do this dynamically so that it can be easily repeatable via a script or model. I ...
1
vote
0answers
131 views

Is there an inbuilt arcpy method to insert a new line? [duplicate]

I need to extract a list of all the files and folders within a top level folder. My first thought was to use os.walk in a small python script as it is a simple task. However, I cannot run scripts on ...
3
votes
0answers
347 views

Importing matplotlib basemap and shapely

I'm not sure if this is the right place to ask this, but here we go. I have a python script that uses matplotlib's basemap and another part that uses shapely to do an intersection of 2 polygons. If ...
4
votes
4answers
676 views

Unable to save selected layer by attribute for ArcGIS Geoprocessing

I am troubles using the SelectLayerByAttribute() function for arcgis geoprocessing. I have a layer and I want to select everything that matches on a particular attribute. I call MakeFeatureLayer() ...
2
votes
1answer
662 views

Using Python in the Field Calculator, how do I refer to a field in another shapefile?

I want to compare the changes in geometry between two shapefiles (of election districts in NYC. One is from 2001 and the other 2005). I am attempting to calculate a new field in the 2005 shapefile ...
1
vote
0answers
223 views

Why is not ST_GeomFromEWKB() working?

The following SQL is working fine from the terminal: SELECT MIN(ST_Distance( ST_Transform(ST_GeomFromText('POINT(-3.163916 55.926528)',4326),32630), ...
12
votes
5answers
3k views

How can I programmatically get the path of “Python.exe” used by ArcMap

I am working with an add-in of ArcMap in c#. From c# code, i have executed some python scripts. Now, to run those script, I have hard-coded python path. But this is not portable. So, I want to get the ...
6
votes
3answers
618 views

Zero filling attributes using python

Being the AML dinosaur that I am, I am just learning python and I need to convert a 2 digit numeric attribute in a table to a 2 digit zero-filled attribute in a script. Example 9 needs to be 09. Any ...
2
votes
2answers
2k views

How do I construct a file path within Python for a Feature Class within a Feature Dataset?

Based on my understanding of the ArcGIS path structure, a feature class inside a feature dataset inside a geodatabase can be accessed by the following: C:\Menu\Lunch.gdb\Sandwich\Cheese Where ...
1
vote
2answers
676 views

How do results from a Python script get added to an ArcGIS map? [duplicate]

I have a Python script for ArcGIS that makes a new feature class. I can add this to ArcGIS as a new Script (without parameters), however the resulting feature class is not automatically added to the ...
6
votes
1answer
361 views

Efficiently identifying overlapping polygons with Python

I'm parsing the NOAA severe weather alert feed and using it as a datasource for a weather alerting system. In the feed, I occasionally find a polygon entry for an alert. Unfortunately, counties that ...
1
vote
1answer
96 views

sa.fill creates NoData raster in standalone script ArcMap 10.0

I am trying to put together a geoprocessing workflow in Python, and I've hit a stumbling block with sa.fill. When run as a standalone script, the tool produces a raster composed entirely of NoData ...
4
votes
1answer
399 views

QGIS - Add a combobox to a toolbar

Is there a way to add a combobox to a toolbar for QGIS? So far I can only find examples that add buttons. I found this tutorial which seems to explain how to do this with general PyQT but haven't had ...
1
vote
0answers
128 views

Extract an ArcSDE datasets (rasters/shape files) using python?

I would like to write a python script to extract/export a dataset (rasters/shape files) in ArcSDE. I saw this posts to connect to the server: Define Workspace for SDE Connection in Python But how ...
0
votes
1answer
1k views

Find and Replace data source script

The following script is supposed to find and replace all shapefiles in a mxd (that exist in the folder) to the new SDE data source. No errors when running the script however, when I open the MXD in ...
2
votes
2answers
460 views

Using osgeo modules in ArcGIS10.1 and QGIS 1.8 python shells

This is related to an old question of mine - Issues with osgeo - qgis.core and arcpy modules Now in new versions of all the software QGIS Lisboa (1.8), ArcGIS 10.1 and pyScripter 2.5.3. They all use ...
1
vote
0answers
58 views

How to clip Raster using multiple polygons and Python? [duplicate]

Possible Duplicate: clipping a raster by multiple datasets or polygons I have polygon layer and DEM and I want to write a program using python to cut the raster into multi-raster based on ...
5
votes
2answers
1k views

Why does this simple Python OGR code create an empty polygon?

Please excuse my ignorance...I am new to Python OGR. I am trying to create a simple square polygon and fail...this produces an empty polygon. Where did I go wrong? from osgeo import ogr driver = ...
2
votes
1answer
1k views

GRASS Geoprocessing in Python Script

I´m trying to get some GRASS geoprocessig tools running in a python script outside GRASS. I´m able to import grass.script, but I´m not able to get the tools running yet. Does anybody know what I´m ...
2
votes
1answer
131 views

How to get a list of all projections that are currently available in QGIS via the PyQGIS-API

i'm building a QGIS-Plugin and i want the user to choose a CRS out of a combobox in which the coordinates he would enter into some textfields are represented, so these can be converted into another ...
2
votes
1answer
350 views

Can you script publishing a GP service?

I have a geoprocessing service in ArcGIS for Server 10.1. I would like to share this service with a number of external organisations that also have ArcGIS Server 10.1. i.e I dont want them hitting ...
-4
votes
1answer
1k views

How to script a csv to file geodatabase tool?

I have many separate field data files in CSV format and I wish to automatically convert these CSV files into a geodatabase to be able to load them into a schema I created for them in my new ArcSDE ...
3
votes
1answer
928 views

Import functions in python Add-In logic script

I am running into an error. I have a set of functions which I want to import in the python Add-In script at the time of execution, but when I built Add-In with "import stats" line then tools are ...
1
vote
0answers
34 views

Script for populating field in ArcGIS 10 with consecutive numbers (where start numbers is decided by me) [duplicate]

Possible Duplicate: How to add automate values to attribute field? I need a script (for Arc GIS 10) by which I can populate a field against some selected polygons features. For instance, i ...
0
votes
0answers
189 views

using mapnik xml file to render tiles in python

Is it possible to use an xml file in python? without using the bindings for python for mapnik. basically i'm using django/geodjango, postgis and well i decided i'd try and design the map on tilemill ...
4
votes
3answers
1k views

Python OGR: convert a point geometry into polygon

I'm writing a routine for creating the convex hull envelop around shapefiles of islands. I could read the data, extract polygons vertices into a geometry and then compute the convex hull. Now I need ...
1
vote
2answers
204 views

What is the best quick way to populate a field (in ArcGIS 10)? (for rare language/font e.g. Guzrati numerals)

I have polygons generated from shapefile (esri) format I have a tiff image of plot/parcel map(this tiff has plot id scribed in somewhat consecutive in manner) of that polygon feature. I would ...