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

learn more… | top users | synonyms

0
votes
1answer
161 views

How to resolve encoding errors in python geoprocessing?

I have a simple python script that reads a string from a text file and inserts it into an Oracle database. When I run the script with Eclipse using Pydev plugin I get no error and the message is ...
4
votes
1answer
1k views

Compare fields of two tables and calculate field

Can you help me to compare fields in two tables? I have two tables, which contain ID and Measure fields. I need to take stroke by stroke values from field1(table1) and find all values in ...
12
votes
3answers
6k views

How to list feature classes with active “attribute domains”?

I have an Esri file geodatabase with attribute domains defined. I need to delete some of the attribute domains but can't because "The domain is used by an attribute rule.". How might I discover which ...
2
votes
1answer
876 views

How to import sextante(processing) for QGIS 1.9 (2.0)

In the current QGIS development snapshot the SEXTANTE toolbox has been merged into QGIS and is now known as "processing". This is a good step, but the previous import command doesn't work anymore. ...
1
vote
1answer
375 views

Problem with encoding UTF8 chars in Windows with pyQGIS

I have the problem to show characters (äöü) in a utf8 format in Windows. In Linux there is no problem and everything is displayed correctly. I use at the second line: # -*- coding: utf-8 -*- and ...
1
vote
1answer
773 views

List Map Services and Publish/Delete Map Services using Python in ArcGIS 10.1

I looked at the link http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000004s000000 which describes listing of map service for 9.3, how can we do this in 10.1, moreover I am trying to ...
2
votes
1answer
67 views

arcgisscripting in CGI script

I'm trying to write a Python script that imports arcgisscripting (stuck on 9.3.1 here) which is then run as CGI by a web app. It runs fine from the Windows command line but as soon as I drop it into ...
7
votes
2answers
2k views

Convert timeseries stack of GTiff raster to single NetCDF

Moving from gdal-dev mailing list: On Mon, Sep 2, 2013 at 7:09 PM, David Shean wrote: Hi list, I'm trying to package a timeseries of GTiff rasters with identical projection/extent/resolution as a ...
5
votes
3answers
1k views

How to repair paths of an unmanaged raster catalog in file GDB?

I'm using ArcGIS 9.3.1 and I have an unmanaged file geodatabase with raster catalogs in it. Tiles are loaded inside the catalog and each tile has a "Full Path" property which is environment specific. ...
5
votes
2answers
621 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. ...
4
votes
1answer
341 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 ...
3
votes
1answer
161 views

How to set waste water gravitational flow direction using DEM automatically?

I have a Geometric Network of Waste Water and I need to set line digitize direction according to the gravitational flow direction using a DEM. I'm trying to avoid flipping manually 1000 Km of ...
8
votes
1answer
303 views

Python with GDAL and PostGIS as a replacement of ArcGIS

Few times ago, I worked with daily land surface temperature satellite images of an area with the size of Alaska. I had to process around one thousand images. I downloaded them, mosaiced, projected, ...
1
vote
1answer
143 views

Running a QC check for gaps between vertices on a polyline

I'm checking polylines to make sure power pylons were correctly extracted from imagery. Is there a way to find all of the gaps or missed pylons in the database? Currently, I'm manually making a ...
1
vote
0answers
39 views

Need to Export 60 pdfF files from each MXD in ArcGIS 10.1? [duplicate]

I need to export 60 PDFs files so I am thinking if there is a way around to export 60 without having to open each MXD file at a time ? I am using ArcGIS 10.1 SP1 Build 3143 . Thank you !
0
votes
2answers
151 views

Python ogr: why is GetFeatureCount() so slow?

I did some profiling for a program I wrote and discovered that ogr's layer.GetFeatureCount() is significantly slower than just using python's BIF len(). Here are my test results def test(): ...
1
vote
1answer
141 views

How to iterate through maps & add new layer to data frame and legend of each using ArcPy?

Newbie for Python and wondering if the following is doable. Problem is like this: I have two sets of data: one mxd file for each of multiple cities (all stored in the same folder) containing ...
3
votes
1answer
211 views

Get features in order they are selected using QGIS

Is there a way of establishing the order that a user selected features using QGIS and Python? By example: we have a network of line features representing a road network, and the user defines a route ...
3
votes
1answer
429 views

How to get spatial reference of a shapefile using python?

I always use arcpy.GetParameterAsText to get the spatial reference from the user. There should be a way to decide what is the spatial reference of a shapefile but I can't find it. Something like ...
0
votes
3answers
304 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.
3
votes
0answers
85 views

Is it possible to access individual pages within an existing pdf using arcpy.mapping?

I've used the arcpy.mapping module for some time now to create mapbooks and other pdf documents, using a combination of Data Driven Pages and Python. I would like to take an existing pdf and save each ...
3
votes
1answer
127 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 ...
1
vote
1answer
242 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 = ...
1
vote
0answers
184 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, ...
14
votes
6answers
3k views

Pure Python Library for Geometry Operations

Does anyone know of a pure Python (no C or Java dependencies) library for doing geometry operations such as buffer, union, intersects, etc? I'm looking for something that Google AppEngine compatible. ...
53
votes
10answers
4k views

Alternatives to using Arcpy

I seem to use ESRI's Arcpy site package for virtually all of my python geoprocessing. To ESRI's credit, these are an incredible suite of tools that can help accomplish a great deal. However, I would ...
1
vote
2answers
410 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 ...
1
vote
0answers
64 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 ...
3
votes
1answer
972 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 ...
1
vote
0answers
264 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 ...
3
votes
2answers
735 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 ...
4
votes
2answers
814 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
1answer
150 views

Find the next vertices at the intersect line

I'm Trying to calculate the angle between two intersected lines at geometric network (simple edge)in order to check if the lines are close to be perpendicular. I already have an Array of the ...
3
votes
0answers
220 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 ...
3
votes
2answers
638 views

Automating script to set geodatabase?

I got some good help here yesterday. I'm basically trying to set up my script in such a way that once the user just puts in the workspace in the script tool in ArcGIS the script will do the rest. I ...
2
votes
0answers
68 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 ...
1
vote
3answers
475 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 ...
0
votes
2answers
1k 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 = ...
1
vote
2answers
944 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 ...
1
vote
0answers
202 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
1answer
563 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 ...
1
vote
1answer
195 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? ...
2
votes
2answers
1k views

How to make editable polygons in Google Maps?

I've just recently started learning Google maps, JavaScript, etc., and have a few questions about a project that I'd like to do. I'm wanting to take some ESRI shapefiles, convert them to KML, and then ...
1
vote
0answers
59 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
202 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 ...
9
votes
4answers
788 views

How to use PostGIS to handle complex geoprocessing workflows?

Our organization is considering moving our geoprocessing workflow to PostGIS. We are currently using ArcGIS, with a plethora of custom Python tools used in ModelBuilder. We're moving most of our data ...
1
vote
1answer
244 views

How to make a virtual layer from ogr geometry?

I know how to do this: nodes = driver.Open(node_nav,0) node_lyr = nodes.GetLayer() node_lyr.SetSpatialFilter(None) But how do can use the layer methods on a geometry I created from scratch? ...
3
votes
1answer
227 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
2answers
293 views

Python Delete point in a distance of x meters

I took this code from this source Select maximum number of points more than x meters apart It seems to work for other users, but for me it's an endless loop. I do not understand why, though the code ...
2
votes
0answers
313 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 ...