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

learn more… | top users | synonyms

1
vote
2answers
438 views

Cannot get arcpy.MosiacToNewRaster to work with list

Below I have a snippet of a much larger code that I cannot get to work and I am not sure why. It seems that I always have trouble using arcpy functions with rasters. Can anyone help me get this code ...
0
votes
1answer
319 views

python calling def __init__(self, uri=None): method

I am working on python plugins for QGIS. I have my QueryBuilder.py and postgis.py files. I connected it to database using Connection class and under def __init__(self, uri=None) in postgis.py file. I ...
1
vote
0answers
367 views

Cannot merge dbf tables (problem with lock files???) [closed]

I am new to Python and to this community as well, hope someone could help me. I am running script to extract and merge toghether the tables of some Raster. Each Attribute Table presents only one row ...
6
votes
1answer
1k views

Python script to convert Lat Long to ITM (Irish Transverse Mercator)

I am currently working on a python script that converts Lat Long (WGS84) to ITM. The formulas used are based on a paper published by OSGB (Appendix B): ...
4
votes
2answers
2k views

Create temporary files as intermediate output to be used as input in concatenation

Q_PART_I I need to merge many (MANY) tables in one unique output table by means of the arcpy.Merge_management. Anyway, I'd like to avoid the creation of tons of intermediate files as my script ...
4
votes
3answers
4k views

How do I export attributes with Python scripting in ArcGIS 10?

How do I export an attribute table to dbf or txt format by use of Python in ArcGIS 10?
3
votes
1answer
89 views

> - operator and “Shape_Area” field in a geodatabase

this might be a pure python problem or a problem with arcpy. please help me out: min_area = float(GKPROZ_functions.min_of_field(out_name,"Shape_Area")) print area_max if min_area > ...
6
votes
1answer
470 views

Using python, how do you “reload cache” an opened Attribute Table

Used python to update a shapeFile through cursors. The Shapefile is updated, but there could be an opened Attribute Table. Manually you can hit "reload cache" to update the Attribute Table and see ...
1
vote
1answer
284 views

Setting Script Tool Parameters Using Python and ArcGIS 9.3.1

Can't quite figure this out and i'm sure it's a simple fix. I have a script that utilizes the AGSSOM tool. It first stops all published services, allows for databases to be tidied up by ...
3
votes
1answer
652 views

Calculate bounding box + buffer for rendering a map tile with mapnik library

Mapnik library has a Projection object (I'm using Python bindings): spherical_mercator = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null ...
3
votes
2answers
2k views

Is there a way to automatically populate attribute values in Qgis?

We are using a Qgis/PostGis combo, where Qgis is used for adding features with attributes into a PostGis database. Is there a way to automatically fill the attribute data values with some ...
11
votes
4answers
3k views

Programatically split a polygon with a line

In looking at this question, it occurred to me that I am not sure how one would go about using geoprocessing tools in ArcGIS to split a polygon with a line programatically. Manually, you would use ...
1
vote
0answers
579 views

Looping multiple feature classes in python for ArcGIS 10

I currently have a large list of feature datasets and dbf tables in a geodatabase. I would like to join each shapefile with its matching DBF file using the "Make Query Table" tool and then "Copy ...
3
votes
3answers
2k views

How do I access a multivalue output parameter from a python script in modelbuilder in ArcGIS 10.0?

How do I access a multivalue output parameter from a python script in modelbuilder, in ArcGIS 10.0? That is, I have a python script that loops through several input layers (working through a script ...
4
votes
1answer
198 views

Using “Time” in PostgreSQL/PostGIS

I'm loading gtfs into a PostGIS database but I have a problem when loading my stop times. The data is in time format "00:00:00" and for 1:30 AM, my data is "25:30:00". I'd like to keep it that way ...
2
votes
1answer
192 views

Import 3D Analyst Functions With ArcPy

This really seems like I should be able to do this, but I am running into some problems. I want to import 3D Analyst with python, in the same way I import Spatial Analyst, but it returns an error. ...
0
votes
2answers
1k views
1
vote
0answers
195 views

Reclassify ESRI raster using variables from a SQL Server table (connecting with pyodbc)

I am trying to reclass a raster file (representing vegetation and land cover types) using values stored in a SQL Server Express table. I have a set of ~400 species records in the table, with each row ...
6
votes
1answer
235 views

Is it possible to install ArcPy on a server for use in a geoprocessing web application?

I have a website on my intranet and would like to add some geoprocessing tools to it with Python. Many Users will not have Arc installed on their machines, so I think I need to have the scripts set ...
3
votes
1answer
625 views

Is it possible to create a new ArcGIS toolbar with new tools using Python?

I have written a number of fairly-simple python functions using arcpy which help a user significantly when performing a certain workflow using various tools (both ArcGIS toolbox tools and external ...
2
votes
1answer
682 views

Passing Python List into Layer Definition Query

I am trying to cursor search through items in a field in a feature class. I then append them to a list called 'distList'. I want to pass the list into layers definition query as follows: "Field1" in ...
9
votes
3answers
1k views

How to populate an undirected graph from PostGIS?

This question is more related to resources that I might not have identified yet, although I've been searching the web for a while. In the project I'm working at the moment I need to run a ...
1
vote
1answer
353 views

python qgis.core import error caused by spatialite libraries

I have an error when trying to import qgis.core to python: >>> import qgis.core Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: ...
3
votes
1answer
223 views

Make feature layer based on date, problem in python

I have a script that runs, that takes the current date and puts into a variable, which is then used to calculate the date field for the Feature class. Further in the script, the updated data is loaded ...
1
vote
1answer
523 views

Move Extent Locator Display python error

I am trying to use ESRIs generated python code to move around my Extent Data Frame based on location of my Main Line shapefile, as to not have the Data Frame over top of the main line when developing ...
4
votes
1answer
354 views

Controlling time slider using arcpy

I am trying to control the time slider object through my code in the python console. As given in couple of examples, the time property of a data frame could be controlled by Data frame time property. ...
1
vote
1answer
77 views

Is there a way to access ps.map in python?

i am wondering whether its possible using python interface to load layers and edit them in Print/Cartographic Composer without displaying, and finally export to PDF? something that can be done via ...
9
votes
1answer
764 views

Arcmap Select by Attribute with Python

I would like the following to select (highlight) the "project" layer that intersects the grid, and then pull a record from the selected "Grid". I do not need to save the layer. Note: Running the ...
2
votes
2answers
487 views

QGIS 1.7.3 and pyqt4 version mismatch

I installed QGIS 1.7.3 using OSGeo4W installer.I have python 2.7 and pyqt4-py2.7 installed on my system.My system paths are: ...
5
votes
3answers
2k views

Add 3rd party repositories button not in version 1.8.0 Lisboa

The available manuals and other help sources all refer to the 'Add 3rd Party Repositories button' in Plugins>Fetch Python Plugins and then the Repositories Tab. My problem is that the installation of ...
4
votes
2answers
3k views

How to create reports in ArcGIS using Python?

Does anyone have experience in creating reports from your ArcGIS data (geodatabase, map exports) using a python reporting engine? In my current project, we are using Jasper Reports in the following ...
3
votes
1answer
818 views

How to implement signals on add or modify feature?

I've created a test plug-in in QGIS successfully, but have had a hard time implementing a signal on a vector layer event (add or modify feature). I've add this to my initGUI method: ...
4
votes
1answer
557 views

raster algebra in python with rasters of different extents

I am trying to find out how to use GDAL & numpy modules to average a set of rasters....which are Sigma0 values from satellite passes at different times within a year. Each raster has been ...
10
votes
1answer
696 views

How to visualize azimuthal data with uncertainties?

I am trying to make a figure showing azimuthal data with a different range of uncertainties at each point. This oldschool figure from a 1991 paper captures the "bowtie plot" idea that I'm aiming for: ...
1
vote
1answer
550 views

installing module in embeded python in qgis

I'm newbie to Quantum GIS and Python. I'm using QGIS in windows platform. How I can install module for python embedded in QGIS? Also, how can I run embedded python from windows directly? Thanks
2
votes
1answer
214 views

clipped data not going into the folder

I created a model in python that clips and converts different data sets into DWG based on the the grid number. I will like the DWG data (Output) to go into the folder I created as part of the ...
1
vote
1answer
573 views

ReportLab integration into QGIS returns error message “no module named reportlab”

I want to use ReportLab in my own plugin which I have written for QGIS. I have installed ReportLab for the python versions 2.4, 2.5 and 2.6. The package is respectively installed into the ...
3
votes
1answer
360 views

ArcMap 10.1 Python split inconsistent string

I converted a kml file to a feature class. All of the fields from the kml were combined into two fields in the feature class. One of them contains information delimited by "/" and the other contains ...
9
votes
1answer
504 views

Is there a way to properly have GDAL raise exceptions in Python?

I am working with GDAL in Python and have wanted to get GDAL to raise exceptions so that I can do something useful with them. For instance if a file cannot be opened with gdal.Open() I would like to ...
5
votes
1answer
2k views

How can i obtain the data of one selected feature in QGIS using python?

I have a problem / question regarding python and QGIS. Is it, and yes how, possible to get the data of one selected feature in QGIS using python? In my example I have a layer which shows some parcels ...
2
votes
2answers
2k views

How to access attribute data type in QGIS?

I've been developing a plugin on QGIS platform using PyQGIS. So far plugin does the following: You can select any feature of the already loaded vector layer in QGIS. After selection, plugin displays ...
9
votes
1answer
2k views

When iterating over a vector layer with pyqgis, how do I check whether a feature is selected?

While iterating over a vector layer using the following code (summerized from the example in the pyqgis cookbook), is there a way to check whether a feature is selected? provider = ...
2
votes
3answers
290 views

Simple script in ArcPy to analyze building proximity to restaurants

I am trying to make a script that will go through buildings in a shapefile row-by-row and do a count of points within .25, .5,...1 mile of it. The other points are restaurants. import arcpy ...
0
votes
2answers
939 views

trouble with UpdateCursor where clause in arcgis 10.1

I'm trying to use UpdateCursor in arcpy, but the where clause I'm using seems to be causing trouble. However, when I open up the table in ArcMap and use Select By Attributes with the exact same clause ...
3
votes
2answers
729 views

Comparing two shapefiles based on ID and spatial

I have two shapefiles that contain position information for individuals, one is their reported location (line segments) and the other is their high-frequency recorded location (point data); they have ...
2
votes
1answer
570 views

Field Calculate Degree Minute Second in Different Format

I have a field that is in degree minutes seconds, populated from ET Geowizards COGO Inverse tool. It populates the values as 90-12-28.15 where 90 is the degree, 12 is the minutes and 28.15 is the ...
1
vote
1answer
2k views

Setting a query loop

I am looking to apply a Select By Location protocol to my data, but need to first query individual IDs in my target and source layer (the same ID in each table, one at a time). How do I loop through a ...
6
votes
3answers
2k views

How to smooth / “reinterpolate” a raster with GDAL?

Short: I want to change the resolution of a raster and smooth the gray ramp like shown in the images bellow. The preference is to use GDAL, PIL or Numpy. Description: I'm kriging points into rasters ...
3
votes
1answer
395 views

Update Arcpy version?

This is probably the answer to my previous question. The version of arcpy that I am using does not include GetNAClassNames naClasses = arcpy.na.GetNAClassNames(serviceAreaLayer) ...
2
votes
0answers
62 views

How do I make a path cross the most possible classes in a raster?

I want to create a function and possibly use Arcmap tools to create something similar to Cost Path. Instead of just choosing the LCP, it must cross through the most different integers. Let's say I ...