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

learn more… | top users | synonyms

-3
votes
1answer
260 views

How to calculate altitude with given lat,long position?

I'm new to GIS. I want to calculate the elevation of any point on earth giving lat, Long (for example like google elevation Api, or the earth tools: http://www.earthtools.org/webservices.htm # ...
4
votes
3answers
2k views

Why does arcpy.ImportToolbox() not work in ArcGIS 10 (SP5) when calling custom model for topology?

I have an arcpy/python script using ArcGIS10 and using a custom toolbox and model. The toolbox has an alias of defaultTopo and my model within the toolbox is called AddRuleToTopologyModel. This model ...
4
votes
1answer
1k views

How to create polyline of varying distance from origin point using azimuth?

I am looking for a Python script that does the following: Uses a point (from a point shapefile) as the origin. Creates about 3 km line from point Based on an azimuth provided in the original point ...
6
votes
1answer
520 views

pyproj, proj4 doesn't return same coordinates after inverse conversion

I'm trying to interpolate between coordinates, as a step in that process I convert latlong to UTM so I can work in metric. I don't get the expected latlong when converting back, reproduced below: ...
6
votes
2answers
264 views

Python scripting- compute statistics

I'm new to Python but I've heard is a good way to automate tasks. I have thousands of point shapefiles and need to extract the maximum value of each one and put them in a new table. I'll appreciate ...
4
votes
1answer
61 views

How to deliver an additional Python Library with own Plugin?

For my own plugin I need a special library (pyexiv2) to write a comment into a jpg file (PIL does not do that). When I want to share my plugin in one of the repositories in the future, what would be a ...
2
votes
1answer
200 views

ArcGIS Desktop's registry value under “software” key[CLOSE] [duplicate]

Possible Duplicate: How can I programmatically get the path of “Python.exe” used by ArcMap I am trying to get some information from registry about ArcGIS. I am using ArcGIS Desktop 10.0 and ...
10
votes
1answer
1k views

Is it possible to take automatically a “screenshot” of my selected feature in QGIS using Python?

I am implementing a tool which allows the user to create a profile of a feature (in my case urban parcels). Is it possible to automatically take a screenshot of this feature (displayed in a QGIS ...
0
votes
2answers
705 views

Python module “shapely.wkb” missing

I am trying to follow a tutorial from here http://qgistips.spatialthoughts.com/2012/12/find-neighbor-polygons-in-layer-in-qgis.html#more I have downloaded the relevant python script and edited it as ...
0
votes
0answers
142 views

How to access the rules of QgsRuleBasedRendererV2 using python?

I can't get access to the rules of rule-based renderer, python says there's no attribute "rootRule", though documentation says it should be (http://www.qgis.org/api/classQgsRuleBasedRendererV2.html) ...
7
votes
2answers
502 views

How to create a solar intensity map for a garden plot?

I'm interested in creating a raster surface that depicts the average solar intensity per unit area for a small garden plot. I imagine the inputs into the model would be the following: Plot ...
0
votes
1answer
400 views

Parsing list object file paths for file name

I am trying to automate a naming process that takes the file name from a list of file paths to name other folders, geodatabases, zipfiles, etc. The problem I'm running into is that, I assume, I am ...
3
votes
0answers
65 views

Programatically reorder layers in qgis? [duplicate]

Possible Duplicate: Sort layers in QGIS table of contents? I write a qgis python plugin ,and i try to connect keybord keys to reoder layers in qgis . Are there a method in qgis allows me to ...
4
votes
1answer
167 views

How to select points within polygon constrained by field?

I've created a polygon from a raster dataset: arcpy.RasterToPolygon_conversion(RasterInt, "C:/arc/poly_int.shp", "NO_SIMPLIFY", "Value") The 'value' field has numbers 1-37, which map to the ID ...
2
votes
1answer
929 views

How to make a 'Make Table Query' script in ArcGIS?

I am trying to get the make table query running in a script. IF I simply export the script from a model, it works without a problem. However, I do have to change the variable names, as this will be ...
1
vote
1answer
68 views

Styling map elements based on their properties

I am currently generating tiles based on OSM data using Mapnik and Python and am quite happy using the XML styling but I am at a loss as to how to vary the styling on an element by element basis. I ...
3
votes
1answer
273 views

Join GPS points obtained from .GPX file in Python Console

Having loaded the .gpx file into a new layer from python console, I'm unable to access the gps points in the attributes table. Essentially, i'm unable to join these points to form a polygon ...
10
votes
2answers
2k views

How do you delete an in-memory Table View?

In a Python script, I'm cycling through thousands of Excel files and using arcpy.MakeTableView to create in memory table views from the first spreadhseet in each file. How do you delete the reference ...
1
vote
1answer
190 views

Why won't QGIS let me write to a file?

I am writing a QGIS Python Plugin. I am trying to write data to a file using with open("filename.txt", "w") as f: f.write("file text.") QMessageBox.information(None, "Test", "Written to file.") ...
9
votes
1answer
378 views

Is there a way to use ArcPy and PyGRASS tools in the same Python script?

I´m trying to write a Python script, that includes different ArcPy / ArcGIS commands and want to combine it with GRASS geoprocessing tools. Unfortunately importing the GRASS libraries doesn´t work. ...
3
votes
2answers
238 views

Create Table (Data Management), Unable to Save to Feature Dataset

I'm trying to create a table in a feature dataset and get the error: Parameters are not valid. The code works when I write only to the gdb. Am I not allowed to write to a feature dataset or am I doing ...
2
votes
0answers
69 views

Arcpy: Counting number of segments where altitude rises or decreases based on DEM?

I have a DEM of Sudety mountains and linear .shp with several hiking paths. I'm trying solve one problem: How to make a script based on input DEM and input line shapes that would count number of ...
2
votes
0answers
236 views

problem in read_shp() to generate a networkx.DiGraph from point and line shapefiles

I tried to use the Python module networkx and specifically the read-shp () to ensure the transformation of a graph to a file sharpe but I always find this error noting that this is the first time I ...
3
votes
2answers
1k views

Can't Select and Export from Python Script

I am a novice in python programming but I am trying to learn by doing. I got stuck with this function a while back and can't seem to find a solution or a workaround. I am writing a script that is ...
2
votes
1answer
302 views

Saving rasters in a Python for loop fails only on last iteration

I'm a newcomer to Python scripting and I'm having what's seemingly a very simple problem but one that's stumped me enough to send me posting to these forums for the first time. I'm using a for loop ...
3
votes
1answer
773 views

How Can I Clip a Basemap with an ascii file?

I'm new here but with many doubts.I work with ArcGIS 10 and I add a basemap layer from the ArcGIS online but I just want the continent coverage to my map,and the area that I wanted I have an ascii ...
3
votes
2answers
692 views

Checking if a point is in a circle

I'm using shapely to check if a point is in a polygon, but I also need to check if a point is in a circle. Checking the docs, I don't see how do that... Maybe I could create a circle? circle = ...
6
votes
2answers
277 views

How can I turn a vector layer into a graph G = (V, E)?

I have a number of rail networks, in the form of shapefiles of the "line" type. I want to turn them into a more abstract graph format, i.e. the kind with vertices and edges, not chart-type graphs. ...
7
votes
1answer
168 views

Reading shapefile tolerance in python

Is there a way to get the cluster or xytolerance from a shapefile into python using free/open source software? I'm currently using the pyshp package and can't see methods for this anywhere. Also it ...
0
votes
1answer
554 views

Invalid data source issue when trying to use lyr.replaceDataSource

When I run the following code in an open mapdocument, it executes and does what I want it to, replace the datasource of the Indianacounty_shp layer with the County_Boundary feature class. import ...
5
votes
2answers
787 views

Create subsetted multiband image from multiple files using gdal or python?

Given a time series of an area (single band), how you subset them and combine the subsets into a single multiband file (eg. vrt) using gdal or gdals' bindings for python?
0
votes
1answer
1k views

Runtime error <type 'exceptions.TypeError'>: 'unicode' object is not callable

I'm working on a script to replace a layer datasource, and I'm getting an error I cannot figure out. When I run the following code in a python window inside ArcMap, I get a "Runtime error : 'unicode' ...
3
votes
1answer
544 views

Relative Hyperlinks in QGIS without end user's software dependency

I am trying to work out how can I add a relative path hyperlink to a shapefile in QGIS. I have found several great tips on various forums but only one has so far potential to be implemented. The ...
2
votes
1answer
681 views

Raster operation with grass.mapcalc

I need to iteratively add each raster map of viewshed analysis obtained from a series of single observer locations. For this i used grass.mapcalc with Python (GRASS 7 for Windows). However, my ...
3
votes
2answers
267 views

“Hello World” introduction for ubuntuGIS?

Is the GIS equivalent of "Hello world!" = "You are here?" I installed ubuntuGIS recently, but I'm a little overwhelmed navigating the network of many packages to begin accomplishing simple things. ...
5
votes
1answer
160 views

GDAL/OGR Determine if dataset is raster or vector

I am writing a script using the GDAL/OGR Python bindings and it is possible that the user may provide a raster dataset or a vector dataset as input. If the user provides a vector dataset, the script ...
7
votes
1answer
182 views

Unable to load .gpx file from Python Console

I'm trying to create a plugin which will extract the gpx files and load them onto the active layer window in QGIS. While I'm able to load it using the QGIS GUI from Layer>New Vector Layer, I'm not ...
3
votes
3answers
498 views

ArcGIS Server 10.1 Python GP script shape as input parameter

I am writing a geoprocessing script that will need to accept a shape as an input parameter. This shape will be obtained by a user drawing the shape in a web application. The web application will ...
1
vote
1answer
415 views

arcpy JoinField_managment RuntimeError

So, I've been banging my head against the wall the last few days trying to figure out what's wrong with my script. It's suppose to pull weekly flu data from a department of health website, parse it ...
5
votes
1answer
198 views

Add “x” in attribute table if raster is georeferenced (ArcGIS and Python)

I have a new question and I hope somebody can help me with this. I have got a shapefile which shows the extent of every raster I have. Some of these rasters are georeferenced but some not. Now I ...
1
vote
0answers
68 views

Is it possible to script ISIS Mapper?

Does anyone have any experience of scripting or batch processing with ISIS Mapper? I am working on a large modelling and mapping project that will require the processing of significant numbers of 1d ...
5
votes
1answer
93 views

Global Basin Delineation Across Dateline

I'm trying to delineate all river basins on a global 1/16 degree grid. The algorithm that the Basin tool in the Spatial Analyst Toolbox works well (fast) except it doesn't know how to handle the ...
2
votes
1answer
512 views

Why does Merge then Dissolve return ERROR 000732: Input Features: Dataset … does not exist or is not supported?

I'm not sure why I'm running into this problem. I thought it might have something to do with the merged file being locked or open, but I don't see a "LOCK" file being created in Windows Explorer. ...
6
votes
3answers
246 views

Are there any open source Python modules compatible with arcpy that will allow complex SQL queries?

I am trying to handle string (non-geometry) duplicates in a large attribute table of a shapefile without having to convert to gdb and back or connect to a postgres db. I need to be able to use a count ...
4
votes
1answer
155 views

How to stack rasters for ecological analysis?

The attached image shows two different forest openings. Each opening has the following layers associated with it: Point shapefile 1 = A red X which represent a large "legacy" tree in the gap Point ...
2
votes
1answer
578 views

Integrated viewshed analysis

I need to do integrated viewshed analysis of a target with several observer locations. I am going to use r.viewshed analysis function in GRASS. With this function, it is possible to perform analysis ...
3
votes
4answers
583 views

Create a Menu Containing a List of Layers That Can be Added to an MXD Using arcpy.mapping

Is it possible to create a list of layers (residing in something like a menu) that can be selected and added to an mxd using arcpy.mapping. I've been using the bit of code below (there's someone I ...
3
votes
2answers
563 views

OSM Python Utils: Modifying generate_tiles.py to create 512 x 512 tiles?

[Edited to include example image outputs] SE folks, I'm wanting to modify generate_tiles.py to create 512 x 512 tiles. At om_henners' recommendation, I tried replacing 12 of the 13 instances of 256 ...
1
vote
1answer
943 views

Error code 500 at REST Endpoint of published geoprocessing service - Problem with output parameter type?

Using ArcGIS 10.1 (Server and Desktop) I've been trying to publish a geoprocessing service based on a python script I wrote. Of course, it all works flawlessly from ArcGIS Desktop but I run into all ...
11
votes
3answers
3k views

How to programatically check for a mouse click in QGIS

I want to know how to check for a mouse click in QGIS. I am trying to write a python plugin and want to provide functionality similar to the "Select Single Feature" tool that already exists in QGIS. ...