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

learn more… | top users | synonyms

0
votes
2answers
1k views

No ogr module despite having gdal installed?

I am trying to use the mapping component of the wonderful PySAL package, but for some reason I do not have the ogr module. I was under the impression that it came packaged with gdal. Am I missing ...
3
votes
1answer
102 views

Join is deleting fields in arcpy

I'm working on a script to automate the conversion of CAD .dwgs of rooms to feature classes, I'm nearing completion and am now working on the second portion of the script (I've seperated it into two ...
4
votes
1answer
315 views

Problem: Arcpy Graph function empty graph output

Background: I have some python code that I need help with parameter passing into the MakeGraph_management arcpy function. I would like to create a two-series vertical line graph for every pair of ...
1
vote
0answers
71 views

How to create a schematic view of a line feature?

DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far… I have a line feature (polyline with curves) in ArcGIS Desktop, and I want to create a linear representation (straigth line) of the ...
1
vote
1answer
339 views

Failed to convert polygon to raster

I have two steps here. First select layer by attributes. Second convert polygon to raster. It failed when it goes to second step and kept giving me error 999999: Error executing function. I pasted my ...
1
vote
1answer
151 views

OGR: How to best use GetFeature on a selection?

I think the following is very confusing sel_str = "ND_14 = '108'" l.SetAttributeFilter(sel_str) l.GetFeatureCount() >>> 1 In a for-loop this gives me for f in l: g = ...
0
votes
0answers
104 views

ImportError: dynamic module does not define init function on MAC

I want to import a lib compile from C (liba.pyd) on MAC mountain lion(OSX 10.8) but mac can read .so .pyc but not pyd So I change the extend file name to .so manually and my python is 2.7.3 I ...
0
votes
0answers
102 views

How to use the QgsMapToolIdentify in PyQgis?

I'm trying to implement the QgsMapTollIdentify class in a stand alone app but I can not. I am a newbie in Pyqgis and would like to ask how do I implement this class in Python? Thanks! Completing, ...
1
vote
0answers
39 views

Qgis 1.9 commitChanges() and Redraw a temporary layer

Using QGIS 1.9 and writing a python plugin. I have a function that connects points into polylines and draws them as a temporary, in memory layer. Membership in a polyline is determined by a field in ...
4
votes
1answer
176 views

Scheduled Task - calling python through BAT

I'm using ArcGIS 10.1 and setting up some scheduled tasks to run on our server. I am calling a python script in a .bat file. When it runs, the connection to our SDE database is "invalid" or do not ...
4
votes
2answers
725 views

How to use map composer in a stand-alone script?

I'm trying to follow the map rendering section from the pyqgis cookbook, but I'd like to test this as a standalone application. I can do the first part, using simple rendering, but I'm a bit stuck ...
1
vote
0answers
179 views

Calculating the closest distance between two points in ArcMap 10.2

I am looking for a script to calculate the closest meter to a set of addresses. I have a feature class of meters and a feature class of addresses. I have populated the address with fields for ...
1
vote
1answer
486 views

How to create a QGIS Action which loads a raster?

I am following an article here:Actions HowTo , specifically the piece about an action to load a raster: Python type Add Raster Layer ...
5
votes
2answers
267 views

How to perform Intersection using ModelBuilder iteration?

I would like to take the intersection of two areas (one randomly generated), and do this n times. I can do it and get one result, but I can't save all the intersection areas to a file at the end. ...
0
votes
2answers
266 views

How to add a dynamic timeline to the QGIS canvas?

I am using the plugin Timemanager which works really great but there is one thing I'd like to improve. Instead of displaying the date and time on each frame, I would like to display a timeline ...
2
votes
0answers
111 views

How to call ArcPy script from Windows Service? [closed]

I'd like to call arcpy script from Windows Service. Here (Calling arcpy/python from .NET?) I read that I can load python script. What do I need to load arcpy script?
3
votes
0answers
120 views

How to create a Typographic Map with Mapnik

So i am trying to make a typographic map using mapnik. I want the street names along a particular street not to overlap, but I want an intersection between two streets to over lap. Currently some ...
1
vote
1answer
210 views

reclassify vector data from multiple source data fields (ArcGIS) (ModelBuilder)

I am using ArcGIS 10.1 and ModelBuilder. I am not familiar with Python. My question is very similar to ReClassify Vector Data Between Values . However that question is about reclassification using ...
4
votes
3answers
1k views

Delete duplicate points in ArcGIS 10.1

Recently was doing some work on an old layer and found that when I selected one point, or used the identify tool I was returning SEVEN points when it should just be one! I am currently using an ArcGIS ...
1
vote
0answers
74 views

Automated attribute update geometric network

I have a Network Dataset of a storm water system containing two feature classes of points and lines. (All data is topologically sound with pits and pipes snapped and linework captured in direction of ...
3
votes
2answers
302 views

TopoJSON: how to calculate scale and translate?

Context: I'm using the topojson file format along with d3. Since I could not find a library in Python that handles this format, I'm writing one. I've got the topojson to other formats working. ...
0
votes
2answers
190 views

Arcpy Insert Cursor

The below code quits at the "cur = " line. Is it an error with arcpy module, my other scripts have worked with importing arcpy. I cannot determine if it is not recognizing the 'InsertCursor'. Any ...
2
votes
0answers
54 views

Loading a layer into the same position as an existing layer in QGIS

I understand that it is not possible to directly reload a shapefile layer in QGIS using the reload method in Python, since this method is not implemented for shapefile data providers. Thus, the ...
0
votes
0answers
16 views

Problems loading PyQGIS Español [duplicate]

No se pudo cargar PyQGIS. El soporte para Python estará deshabilitado. Traceback (most recent call last): File "", line 1, in RuntimeError: the sip module implements API v9.0 to v9.2 but the ...
1
vote
3answers
278 views

Invoke FME batch process/Process using c#

I want to invoke FME batch process and general FME processes using c#, I have no idea about FME, can anyone please let me know if anything like this is possible?or is it possible in python, any help ...
1
vote
0answers
63 views

How to rotate u and v components of wind in rotated gribs?

I have a grib message of a rotated hirlam product. The gribmessage states, that the u and v component contained are relative to the rotated grid. How can I unrotate them?
0
votes
2answers
681 views

Date Time format in ArcGIS 10.1

I have a Date column in my feature class and I want the date to appear in "dd MMM yyyy" format as a label to a polygon. I am using Arc Map 10.1. I tried taking Jscript. var Dt = new Date(); Dt = ...
0
votes
0answers
134 views

proj/pyproj converted coordinates offset

I'm using pyproj to convert some coordinates from WGS84 to OSGB36. When mapped out the converted and unconverted don't map to the same places on a map. The OSGB36 coordinates are mapped about 100 ...
0
votes
0answers
117 views

Error in Select Numeric type column in pyodbc with ArcCatalog

I created a python script that uses "pyodbc" plugin to connect a SQL Server database and write out data. It was imported in an ArcGIS 10.1 tool and run from there. try: arcpy.AddMessage('FLAG 0') ...
7
votes
3answers
588 views

Antipodal distance (or polygon fetch or polygon diameter) for concave polygons

I am working on some class examples in Python implemented within ArcMap to calculate the antipodal distance within a polygon. This is fairly routine for convex polygons, however, for concave ...
0
votes
2answers
90 views

What queries can I use to select data?

Which queries can I use to select the following information: How many towns are within a distance of 3km of both a road and a railway and are within 6km of the coast? And any towns that have both a ...
3
votes
2answers
397 views

Script or model to create random points having multiple minimum distances within a polygon

Given: A single part polygon, total number of points to place inside that polygon, and table specifying the size of each subset (number of subsets n >= 1) of that total number of points and each ...
1
vote
2answers
332 views

Conditional Labeling based on attributes in ArcGIS 10

I am trying to label a street centerline layer with a condition based on street width. I am using the Python parser and I can't figure out this simple logic. Neither of these questions address how ...
0
votes
1answer
128 views

QGIS Extend Toolbar (GUI) Button Functionality via Python Plugin?

Is it possible to piggyback onto the QGIS split method via a python plugin? Are toolbar buttons accessible via the python API? This looks like the class that I need to access. Access ideas? ...
1
vote
0answers
43 views

Deleting network features in python script doesn't create net junctions

I have a script that makes a copy of a network dataset for a 3rd party app to use. One of the junction feature classes causes problems with the app. The ideal solution would be to remove it from the ...
1
vote
0answers
128 views

Can ModelBuilder be used to export different versions of the same mxd with various constraints?

I am currently trying to use modelbuilder to go through each row in an attribute table, select the streets that intersect the polygon (which is the row in the attribute table), zoom to the selected ...
2
votes
1answer
240 views

Only perform Near analysis on selected rows

I am writing a Python script to perform a near analysis on features from two different shapefiles with common attributes. This is happening in a Search Cursor. However, whenever I tried to use the ...
0
votes
1answer
102 views

Code in python for arcgis to select multilines (path) and vertexes

I am learning to write a python code for ArcGis 10.2. Need help! I have some shp poly lines file, need to learn how to write multiple selection of those lines, even if a cursor of mouse pressed not ...
3
votes
1answer
1k views

If Then Else in ArcGIS model builder

I have a model which iterates through feature classes in a geodatabase. For each feature class, it runs the check Geometry tool. I then use the "Get Count" tool to count the number of rows in the ...
0
votes
2answers
709 views

How to get the maximum value from a multiple values output (list of numbers) using calculate value in ModelBuilder

I have an output from a sub model that iterates through feature classes, each with a row count. The row counts are passed to a collect values, which is a model parameter and is used outside the sub ...
0
votes
3answers
282 views

Python: best practise to ceate a large shapefile

What is the best approach to create a create a very large shapefile (close to the max of 2GB) using python? Best approach means: robust and fast. Above all fast.
0
votes
1answer
206 views

How to export multiple MXDs to PNG without using VBA?

Okay, so I can feel that I am so close to solving this issue with the help of Jason (below) but I have modified to use as a script. The GetParameterAsText returns the following error when trying to ...
0
votes
0answers
18 views

QGIS & python: returning value from shapefile dbf [duplicate]

I'm trying to work out the python code in QGIS to return a value from a shapefile dbf. E.g. if I have a shapefile named "vlayer" how would I find the value in row 0, field 3? Sorry for such a basic ...
1
vote
1answer
138 views

OGR: How to save layer from AttributeFilter to a shape filter?

I select a subset of features from my shape file like so: node_lyr = nodes.GetLayer() q_str = "%s = %i" % (field, value) node_lyr.SetAttributeFilter(q_str) What is the best way to make a shape file ...
0
votes
1answer
231 views

Copying/Projecting featureclass into a database and featuredataset of the same name fails

I've written a script in Python for ArcGIS 10.1 in order to migrate from an outdated coordinate system to a newer one while at the same time updating from personal geodatabases (.mdb) to file ...
2
votes
1answer
110 views

Can one expose variables to the Python console from a plugin in QGIS?

I have a QGIS plugin that performs a long-running operation, eventually producing and loading new shapefiles into QGIS. (I have this as a plugin rather than just a function that can be called from the ...
0
votes
0answers
223 views

GDAL/OGR to extract pixel values

I want to use GDAL/OGR to extract pixel values from a raster file. The extraction should be based on polygons, stored in a shapefile. My thought was to iterate over the features in the shapefile, ...
1
vote
2answers
148 views

Optimising Min/Max temporal raster search in python/gdal

I need to search across ~100 1200x1200 raster tiles and produce a min and a max raster. Along the way i also want to exclude values that are over 1 or less than 0. What would be the quickest method to ...
1
vote
0answers
225 views

Loop though records in PostGIS (using PL/PYTHON or PGSQL)

I've seen many example of loops, but I can't get that one to work. I work for a regional transit agency and each year, we conduct several surveys. I geocode everything to the house level for internal ...
2
votes
0answers
166 views

PyProj/Proj4 convert geographic to projected coordinates for Geostationary Data

I am trying to convert geographic coordinates (in degrees east/north lon lat) to projected coordinates in meters for geostationary full disc data (GVAR Goes East data from CLASS). To do this, I tried ...