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

learn more… | top users | synonyms

5
votes
2answers
418 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 ...
0
votes
4answers
427 views

Resolving Arcpy “GetObject not point” Error

I'm new to Python (v 2.6.5) and am trying to write an ArcMap (10) script that reads the vertex coordinates of a polygon shapefile which includes a small hole (doughnut polygon). I've been working ...
0
votes
1answer
587 views

How to create a report of all feature classes in a geodatabase?

I am not getting any response from this script and no error displayed at all I am writing this script to help me display the feature classes in my geodatabase Here is my script import arcpy ...
16
votes
1answer
5k views

How do I get the pixel value of a GDAL raster under an OGR point without NumPy?

I am working on a computational model of the abundance of wild pollinators across a landscape. The model itself is complete, and I am now struggling with a post-processing step. I have my GDAL ...
0
votes
0answers
93 views

Create Vertex and add empty attributes to it

How can I create a vertex(and then a point feature on the vertex) on a polyline and give it some empty attributes(create fields), move an existing vertex, delete vertex? I am in ArcGIS environment and ...
1
vote
0answers
303 views

Problems running zonal statistics - not all zones represented

I have been working on a Python script to automate the steps illustrated by whuber here:Create points around the edge of viewshed results I am trying to create a horizon graph illustrating the ...
2
votes
1answer
1k 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 ...
14
votes
3answers
3k views

Can i use ArcPy to get layer symbology?

Hello all Since ArcGIS 10 comes with ArcPy package, i'm wondering it is possible to use ArcPy functions to get Symbology (i.e color, width...) of a layer? Thanks in advance
1
vote
0answers
153 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 ...
0
votes
0answers
39 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: ...
2
votes
1answer
517 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 = ...
3
votes
1answer
229 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 ...
0
votes
1answer
93 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() ...
4
votes
0answers
4k views

How to inserting script into ArcGIS ModelBuilder? [closed]

I am looking for some tips about inserting a script in the ModelBuilder... I am actually building a model in the ArcGIS ModelBuilder. At one point I would like to insert a script that crosses ...
0
votes
2answers
86 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 ...
8
votes
1answer
234 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
1k 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
824 views

Tile script (Mapnik) with OpenLayers - Problem with projection (900913)

I use Mapnik python bindings in a geodjango application to render tiles in openlayers with datasource stored in postGIS in 900913 projection. The feature seems to be rendered correctly in the ...
4
votes
2answers
426 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
103 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
1
vote
1answer
463 views

spatialite.dll with Python and QGIS - the specified module could not be found

I'm having a bit of a nightmare getting to the bottom of this DLL loading problem. The stand alone script works absolutely fine but the exact same code does not work within QGIS. import sys from ...
0
votes
0answers
264 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
2answers
202 views

Set Extents of MXD to new layer data source?

Alright here I go again this forum has been good to me. I add a layer and replace its data with a shapefile I created using the following bit of python: layer = ...
2
votes
2answers
793 views

r.mapcalculator and python again

I've been trying to write a script creating binary maps: a=raw_input ("enter a threshold") b=float(a) grass.run_command('r.mapcalculator', formula="**'base_map'>=b**", outfile='map'+str(a), ...
1
vote
1answer
418 views

How to use QgsOverlayAnalyzer class in pyQGIS?

I am very new to Python scripting in QuantumGIS, so bear with me please. I am trying to use the QgsOverlayAnalyzer class in QuantumGIS (http://www.qgis.org/api/classQgsOverlayAnalyzer.html#details) ...
3
votes
2answers
390 views

run r.stats as a quiet module in GRASS-Python script

Has anyone else used r.stats as a quiet module in a GRASS-python script? As part of my program I'm using: grass.run_command("r.stats", flags='l', input=<file>, output=<*.csv file>, ...
3
votes
1answer
276 views

How to see print commands through Python Script while programming plugin for QGIS?

This might sound like a silly question. Is there a way that from running a custom plugin made for QGIS that a Python Shell can appear along when the plugin is run, like a debug screen. I'm asking ...
1
vote
1answer
59 views

How to keep specified separation distance between features in printout from ArcMap?

Does anyone have a solution to select features using attribute values and print only the selection keeping a specified separation distance between the features in the printout in ArcMap.
0
votes
0answers
36 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..
0
votes
1answer
253 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
1k 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 .
10
votes
2answers
815 views

Metadata -auto build using python

We have a large (10,000 plus) repository of spatial data (shp/gdb/tab vectors and ecw/tif rasters and also las, xyz and DEM data) where some have metadata records in xml using anzlic metadata editor. ...
1
vote
1answer
293 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?
1
vote
2answers
425 views

ArcGIS 10.1: “ERROR 000223: Cannot extract event table properties” when iterating through multiple files/folder

I am trying to convert ~270k csv-files with lat/long-data to layerfiles. The files are split into folders by year, i.e. ~30 folders with ~9k csv-files in each. I have written a script to iterate ...
8
votes
1answer
642 views

How to address the new “Task-Completed” QgsMessageBar in Python?

I am really amazed what huge steps the QGIS development has taken in the last months. The new iconset, the improved Print composer and many more changes to be seen in QGIS 2.0 are really awesome! ...
0
votes
1answer
1k views

How to insert values from one table into another?

I am trying to write a script that iterates through each row of a table, calculates for this row something. The result of this calculation is finally stored in another table (with just one row). Now I ...
0
votes
0answers
18 views

QGis non blocking notifications with pyqgis [duplicate]

I'm searching for the way to use the new QGis non blocking notification system with the QGis python wrapper. I found informations on this fonctionnality but nothing on how to use this especially with ...
0
votes
1answer
267 views

arcpy.setValue for Condition from Dictionary

Hi: I am trying to create a function to update multiple fields based on different criteria. I want to pass the field name and condition thru' a dictionary (please see the function description in the ...
0
votes
0answers
30 views

using python and arcpy , how can I compute the direction and angle of a line segment? [duplicate]

if start_point_x < end_point_x and start_point_y > end_point_y: slope = ((end_point_y - start_point_y)/(end_point_x - start_point_x)) radian = math.atan(slope) degrees = ...
1
vote
0answers
456 views

Calculating the Centroid of polygon in modelbuilder (VBA to Python) [closed]

Got an easy one, that's got me stuck. I'm moving some models that were created in 9.3.1 to work in 10. Part of the model is calculating the X coordinate of a polygon to a specified field. The code ...
1
vote
1answer
215 views

Python GDAL: find out spikes and pits in DEM

I'm working with on a DEM (Geotiff) in Python GDAL, and I'd like to find out the spikes or pits in my terrain. I have no idea how to proceed, does anyone have good algorithm to help me out? Thanks, eo ...
2
votes
2answers
838 views

Field calculator or update cursor?

I have a feature class in which one field (let's call it "Field_A"), as yet empty, is to be populated by the contents of another field ("Field_B") multiplied by a certain number (I'll call it the ...
1
vote
1answer
161 views

Creating prepared geometries with OGR from Python

Is it possible to create a prepared geometry object using the Python SWIG geos.ogr module? It seems that Shapely and GeoDjango both have this functionality, but I can't see any mention of it in the ...
2
votes
1answer
175 views

Python script to update attributes crashing during loop

I have a script to update a field in one feature class from a selected record in another feature class. This is done through looping through records in one feature class selecting appropriate the ...
1
vote
0answers
117 views

Python GDAL/OGR: check lines geometries connectivity

I'm working with shapefiles representing roads, so basically it's stored as (poly)lines. I need to perform a road connectivity checking. In other words, I want to ensure that roads meant to ...
1
vote
1answer
921 views

Make Route with Python and network analyst in ArcGIS 10

Good Day, I'm having trouble debugging my python code to create a network analyst layer in ArcGIS 10.0. Basically when run from a script tool the code completes successfully without actually doing ...
2
votes
3answers
337 views

How to test if geometry is inside another?

I need to tell whether geometries from a shapefile are inside other geometries or not. For example, I want to test if there are trees (represented as points in trees.shp) inside the urban areas ...
0
votes
0answers
73 views

Congressional Redistricting

I have a project coming up where I need to create new congressional district looking at only total population data. I am planning on using the census tract level of data, but I am having some ...
0
votes
1answer
223 views

How to access the button on the form?

I have a form that appears when you start the plugin.How do I properly apply to the button on the form, so that when you click on the button performed "function". import sys,os import win32api from ...
1
vote
1answer
1k views

How to set Marker Line symbol for QgsVectorLayer by using Python?

QgsVectorLayer Right click->Properties->Style->Single symbol->click on simple line in tree node ->symbol layer type -> Marker line Kindly help me to set marker line symbol programmatically by using ...