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

learn more… | top users | synonyms

0
votes
0answers
20 views

Drillhole Plan Trace in Arc [duplicate]

I'm struggling to find the math to do what I want. I want to plot a top down view of a drillhole in ArcMAP 10.0. I have the beginning UTM coordinate and then for every place in the hole that was ...
1
vote
1answer
100 views

How to reach a field value of a record in field calculator in ArcGIS 10.1

I have two fields showing number of people in two age groups "young" and "old". these people also live in a cell (point) whose distance to a specific facility is calculated. then I categorized these ...
1
vote
1answer
670 views

Trigger a python script to run after a row is added to the feature class

I have a Python script which runs on a SDE feature class daily (as a scheduled task). I would actually like this script to run whenever a new row is added to the feature class (data is captured in the ...
13
votes
1answer
471 views

Creating nanoscale DEM with GDAL

A bit of a strange question perhaps, but let me give you a breif explanation of the background before my actual questions: Atomic force microscopy (AFM) is a method that, in short (and to my limited ...
2
votes
2answers
2k views

How to convert field values from lower case to upper case in ArcGIS 10.1?

Using the Field Calculator in ArcGIS 10.1, I am able convert the first letter in a value from lower case to upper case. How do you convert the entire value to upper case, though? I can't seem to ...
4
votes
3answers
2k views

How can I convert a ascii file to geotiff using Python?

I have a ascii raster format file. For example: ncols 480 nrows 450 xllcorner 378923 yllcorner 4072345 cellsize 30 nodata_value -32768 43 2 45 7 3 56 2 5 23 65 34 6 32 54 57 34 2 2 54 6 35 45 65 34 ...
4
votes
1answer
525 views

Does anyone use both ArcGIS and Python(x,y)?

I'm trying to get ArcGIS 10.1 and Python(x,y) to peacefully co-exist with a unified installation of Python. Surely someone else is using both these tools... right? Pointers would be much appreciated. ...
0
votes
0answers
180 views

SEXTANTE runalg and QgsVectorLayer issue

I'm trying to make a script for converting polygons to lines. But I'm having some issues while generating temporary layers. In this script, I iterate through all the features of the input layer to ...
1
vote
1answer
361 views

Python GDAL/OGR: WGS84 & meters units

I'm dealing with shapefiles projected in: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_84",6378137,298.257223563]], PRIMEM["Greenwich",0], ...
3
votes
1answer
960 views

How to use a feature set as an output parameter in a Python Toolbox?

I'm having trouble setting a "Feature Set" output parameter from a .pyt .. I'm using ArcGIS 10.1 SP1. Here’s a short script that can be invoked either from a classic toolbox (thru the main() ...
1
vote
1answer
351 views

How to add layer/raster with specific position in the QGIS layer list?

I use addRasterLayer(rast,'Name') but this adds the raster to the top. It is possible to set position when I add raster at once? Is it possible??
2
votes
0answers
371 views

Use GDAL/Python to add rasters (tiff) to an ESRI File Geodatabase

I'm using GDAL python to create a bunch of tiff files from a netcdf file. def modelout_to_geotif(netcdfile, outdir, VarName): """ Given the path to the netcdf output, produces geotiffs for ...
1
vote
1answer
325 views

Creating an Origin/Destination (OD) cost matrix using ArcPy

I have created a python script that runs an OD cost matrix over five years from 1999 to 2004. I have set up an OD cost matrix for each year, which I think is very cumbersome. Is there someone who can ...
0
votes
0answers
290 views

Create a polygon shapefile using point as boundary

Following have two problems: I am now have 4 point in a shapefile and I want to set the point's coordinate for boundary of a polygon The points are xmin, xmax, ymin, ymax that can just be a ...
1
vote
0answers
295 views

Python Addin toolbar- Environment mask parameter not being recognised?

I've created a button on a python addin toolbar which uses the selected features from the selected layer in the TOC, creates a feature layer from that selection and uses that feature layer to set the ...
2
votes
2answers
98 views

How to reproject all featureclasses in a database to another database?

I am very new to arcpy and have ArcGIS 10.0 I would like to make a script where I would only have to change two variables in a script (database_input and database_output) so that I can reproject all ...
2
votes
1answer
189 views

How to store attributes of a large shapefile in a list?

I am trying to store the attributes of a shapefile into a list. With following code it works for smaller shapes: addA = [] While provider.nextFeature(feat): attrs = feat.attributeMap() for ...
1
vote
1answer
698 views

Python GDAL: degrees to meters without reprojecting

I am trying to get senseful results in my Python script. I want to measure distance between features in a shapefile. I'm working with the SRS: GCS_WGS_1984, so my units are in degrees. But for the ...
0
votes
0answers
156 views

Dynamically generating data for map tiles from Python function

I'm brand-new to GIS and relatively new to web services. I've found a ton of great resources on the web, but I'm having trouble addressing one specific issue: One of the data layers on my planned map ...
0
votes
0answers
84 views

Sextante script for statistic info

I want to generate a script for getting statistic information window from selected feature. For example i have two layer building(polygon) and railway(linestring). By using this tools i got a window ...
1
vote
1answer
435 views

ARCGIS Python script (needs a raw input line to let the user choose the output file name)

I just need a quick fix here. Having trouble finding a way to allow the user to input the new output file name (the one that is created after the buffer function completes). Any ideas? I am also not ...
20
votes
3answers
5k views

Simple thematic mapping of shapefile using Python?

I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map. On the internet I found how to make a thematic map using Python: Here is some code that I tried: ...
1
vote
0answers
302 views

How to write vector layer to csv file with geometry by PYTHON?

I use Python try to write vector layer file to csv file with this code QgsVectorFileWriter.writeAsVectorFormat(mylayer, r'c:\temp\xyz.csv', "utf-8", None, "CSV") It can export to xyz.csv but only ...
1
vote
1answer
215 views

how to loop grass command in python and put variable in output file

anyone, first day Grass programming with python scripting; first prob; simple I want to reclass the same raster several times; and save the file with the value loop variable at the end ... can not ...
0
votes
1answer
297 views

Apply Symbology to a group layer

I currently have around 200 features that all need have the same symbology applied to them. I have used the ApplySymbologyfromlayer_management however this takes much to long to process, at least a ...
4
votes
1answer
661 views

How to set up Python 2.7 to work in both QGIS and ArcGIS?

I have both ArcGIS 10.1 and QGIS 1.8 installed and both include Python 2.7 in slightly different setups and in different folders (c:\Python27\ArcGIS10.1\ and c:\Program Files (x86)\Quantum GIS ...
1
vote
1answer
155 views

How to iterate all input folders (containing coverages) using Python with ArcGIS 9.3?

I'm trying to write python scripts to batch convert thousands of coverages to shapefiles in arcgis 9.3. The coverages files are in different folders: d:/area_A/building d:/area_B/building ...
1
vote
1answer
180 views

How to set a spatial filter with Python/GDAL?

Is there a way with GDAL (Python) to set a spatial filter (bounding-box) on a raster before I process it? I want to read it as an array. BandReadAsArray(band, xoff=0, yoff=0, win_xsize=None, ...
6
votes
4answers
1k views

How to check via Arcpy if ArcMap is currently in an edit session or not?

I've created a Python add-in button that helps speed up my coworkers workflow by copying one feature class attribute to another. It uses the arcpy.UpdateCursor function to update a row in the target ...
5
votes
2answers
331 views

How to create a point along a line given a distance from another point

I'm trying to figure out a point(D) on B-C that is a specific distance from A. I really don't have any idea on how to proceed with the ellipsoidal math so I figured I'd ask here. How would I figure ...
1
vote
1answer
199 views

OD cost matrix Arcpy [closed]

I'm trying to create an OD cost matrix python script. I'm doing an OD cost matrix analysis. I'll find out the average time with patients to hospitals over 10 years. When I do this analysis, the ...
2
votes
2answers
370 views

Python Code: “Compare two fields and select missing records”

The code I wrote is not right!! It's selecting more than what is actually missing. I think I'm wrong on the matched code line. I need the script to make a list of the "FLAG" field and a list of the ...
2
votes
3answers
787 views

Efficient algorithms to split and join lines?

Referring to the Figure below: How to efficiently join segments into lines? How to efficiently break lines into segments? The above will be applied million times.
3
votes
1answer
167 views

ArcObjects (VB.Net) Python Integration with object passing?

This link illustrates one method for calling python scripts from within an ArcObjects environment. The results of these tasks are returned as strings. I wonder if it is possible to call a python ...
1
vote
0answers
150 views

Change ArcGIS License using Script [duplicate]

I am using ArcGIS Desktop 10 and we have three different servers for accessing concurrent use licenses of ArcView, ArcEditor and ArcInfo. So, whenever I need to switch to other product, I have close ...
2
votes
1answer
327 views

Combining polygon geometries with python and QGIS segfaults

I am trying to combine polygons, using Qgis 1.8, and every time I run this script in the python console, I get a segmentation fault. Here is the script: from PyQt4.QtCore import * iface = ...
0
votes
0answers
36 views

How to change value of an Line edit dynamically

I create a form in QT4 and compile with pyuic4. it create an form.py I want to modify the value of the line edit dynamiclly with code. I put this code in the form.py but never happen: ...
0
votes
1answer
90 views

Make many lines in one layer (Python)

I what to create many lines with this code: v_layer = QgsVectorLayer("LineString", "cable", "memory") pr = v_layer.dataProvider() seg = QgsFeature() ...
8
votes
1answer
179 views

Difference between python window and toolbox

Are there differences in performance or other potentially critical area between running a python script in the python window versus running it from the toolbox in ArcGIS 10.0? I am asking in cases ...
5
votes
1answer
855 views

Python - OGR: Transform coordinates from meter to decimal degrees

I have a point in a shapefile. The shapefile is in a WGS_1984_Web_Mercator Projected Coordinate System. I want to get the coordinates of that point in decimal degrees with GDAL/OGR in Python. I am ...
0
votes
2answers
83 views

Python to get ids from shp dont return all records

I have some Python code to get the ids and georeference from a shapefile: canvas = qgis.utils.iface.mapCanvas() allLayers = canvas.layers() nos = QgsFeature() for i in allLayers: if ...
0
votes
1answer
100 views

How to convert geometry of SHP to decimals

I try to create a line with two points. These points are obtained in a SHP layer. How can i convert that points to decimals? Thank you
13
votes
1answer
318 views

Watermarking photos using their geotag and create a shapefile

I have geotagged photographs and I would like to place a watermark of the photos location on the front for easy reference as well as creating a shapefile from the coordinates. Does anyone know of any ...
0
votes
0answers
213 views

python script to calculate and return values based on several conditions

I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid considering the attributes are species name, grid code, ...
1
vote
1answer
823 views

How to use CURRENT map document in Python tool?

I am attempting to use this code in a tool that I am working on: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] XMIN = df.extent.XMin YMIN = df.extent.YMin XMAX ...
0
votes
0answers
29 views

How to get Perpendicular cross section along the river using python and Arc Map 10? [duplicate]

I need to draw the perpendicular line segment along the river at a regular interval. How can i obtain like this output using Python and Arc Map 10 ? I would be very grateful if you give some idea..
4
votes
2answers
255 views

Python split table by “State” field and export to individual tables?

So I have never posted here before. I have used the site a lot for help so many thanks to all the great contributors. So, I have used ArcGIS online to perform batch geocoding (18,000) records and it ...
0
votes
1answer
173 views

QGIS Python - Convert geometry from Postgres to QgsPoint()

I have made a query in Postgres to get some points to use with python. This points are in geometry data. How can I convert that geometry in decimals to use QgsPoint() in python? Thank you
-1
votes
1answer
690 views

How can i draw a perpendicular line in a stream segment in a regular interval of 30m? [duplicate]

I have a stream segment which is polyline feature. Now I want to draw a line which is perpendicular to stream segment at a interval of 30m. How can i do it using python ? Do you have idea on this .
1
vote
1answer
187 views

Can I open a form in layer action?

I want to open a form (made in QTDesign) in the layer action. It is possible?