Tagged Questions

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

learn more… | top users | synonyms

0
votes
1answer
85 views

Help with Point on Polygon overlay in ArcPy

I am trying to do this simple task but not sure how to do this in Python. I have a point shapefile and I want to overlay with polygon layer to get all the polygons for each point. After this would ...
1
vote
1answer
41 views

How to handle a UnicodeEncodeError with sampling tool?

I'm using qgis and I keep getting an error when using the point sampling tool, its keeping me from getting the sampling done. Does anyone has an idea what is it about? Thanks!
3
votes
0answers
219 views

Is there a Python WMS client (thin client analogue of OpenLayers)?

I'm making a geoportal based on (Geo)Django 1.5, PostgreSQL 9.1 + PostGIS 2.0, QGIS MapServer and OpenStreet Map or Google Maps WMS services for the base layer. It seems like there is no problem, but ...
6
votes
0answers
310 views

Histogram Matching Python

I am trying to do histogram matching using Python to improve the mosaicking process of multiple overlapping rasters. I am basing my code on that found at: ...
0
votes
0answers
62 views

detect signal where delete polygon in qgis?

I am working with QGIS and i want when i delete a polygon and then i commit this action I detect the signal of this operation and use it in python script, I tryed this but dont work: def delete(): ...
3
votes
1answer
131 views

Is There a Way to Emulate the Identity Tool in ArcGIS?

I work at several different companies each with different license levels of ArcGIS. I got used to using the Identity tool at a company which had access to the ArcGIS Desktop Advanced license. ...
0
votes
1answer
98 views

OD Cost Matrix Settings (Arcpy)

I have what is hopefully a fairly simple question. I am trying to run an OD cost matrix for every minute of a day for research I am performing. All of the settings will be the same for each run, ...
0
votes
1answer
132 views

connect signal to function with arguments

Hello I have this function on python that take 2 arguments: def niveau(controName,idNiveau): ........ I want to connect it to this signal: ...
3
votes
2answers
400 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 ...
1
vote
2answers
2k views

How to set workspace as Python script tool variable/parameter?

I'm pretty new to Python. I'm trying to write a script and as I want to automate it as much as possible, I'm wondering is it possible to set the workspace as a variable so that when it's run as a ...
1
vote
2answers
149 views

Erase method using ogr

I'm trying to find the erase geoprocessing method as i am familiar with in ARC, but i can't seem to find it in OGR using Python. I have looked through the module ogr documentation but perhaps i missed ...
4
votes
1answer
333 views

QGis Zonal Statistics Plugin NoData included in Calculations

I have been trying to use the QGIS zonal statistics plugin. My raster has a nodata value of -99999 and all other values are positive. After computing the mean zonal statistics there are a number of ...
3
votes
2answers
686 views

Python Search cursor: Error handling

I have a search cursor that using a SQL query to match addresses and then returns the associated roll number with that address. However, some addresses do not match the roll number and then I believe ...
1
vote
1answer
150 views

Raster extent, just clipped by geomtery, slightly differs from a given geometry

The raster using arcgis geoprocessing is cliped with a feature, reading it's geometry and as a result, rasters extent slightly differs. Extent of geom: str(row.shape.extent) '570600,537958652 ...
-1
votes
1answer
393 views

How to calculate the length of clipped lines using buffered points using ArcPy? [closed]

I need to create a buffer around each point of a points feature class. I would then want to use the point buffers to clip the streets feature class to calculate the length of the clipped streets using ...
1
vote
2answers
216 views

How to place points along a line in a specific offset using python / arcpy?

I have a street shapefile with information about the street name, house number from / to on the left side and house number from / to on the right side. My aim is to create a point shapefile that ...
2
votes
1answer
100 views

Is there a quicker way of checking if a feature exists with OGR

I'm writing lot's of features to a FileGDB using OGR. The slow point in my script is checking that the feature isn't already in the Feature Class, based on the ID. Currently I'm using a function ...
0
votes
1answer
1k views

Display a georeferenced DEM surface in 3D matplotlib

I want to use a DEM file to generate a simulated terrain surface using matplotlib. But I do not know how to georeference the raster coordinates to a given CRS. Nor do I know how to express the ...
0
votes
0answers
36 views

How to use na.Solve() on layers already created?

I am fairly new to arcpy and I am having troubles recreating the following set of instructions with a python script. Open the KeyChainTest.mxd Enable the Network Analyst extension. Click solve on ...
3
votes
3answers
183 views

Count the number of characters in a field (Python)

I have a field that contains street names and a second field called COUNT. I need to perform a Python field calculation on the COUNT field that counts the number of characters in the STREET_NAME ...
5
votes
3answers
196 views

Do Label Expressions Slow Down Drawing Speed?

Further to my earlier question about using different fonts on the same PC, I am wondering if label expressions would slow down drawing speed for a MXD? Here is my label expression: def FindLabel ( ...
-1
votes
1answer
105 views

How to find the most east or west longitude around the date line

I've got a python script that is comparing extents of rasters in various projections. Generally it works, but sometimes, especially when the rasters are global in extent or cross the dateline it ...
1
vote
0answers
205 views

Add metadata to dataset (feature class, coverage or shapefile) from a .csv using arcpy?

I am looking for a script that will take metadata information provided in an excel table, convert it to a .csv and import the values to populate some of the dataset's ArcGIS metadata elements. I came ...
2
votes
1answer
215 views

Programmitcally Change Text Font for all Labels on MXD

I'd like to know if there is a way to change the text font for all layers and all label classes within a layer on a MXD. I use a font not often found on all computers for created maps. I love the ...
1
vote
1answer
134 views

Python: Grabbing X,Y coordinate from matching fields

Here is my table. What I am trying to do is write a python script to go over the Zip_Crid values. If there are matching values, I need to grab x1, y1, x2, y2 and put it in a new field. Haven't ...
1
vote
0answers
92 views

QGIS GPS bluetooth connection

I have setup a Haicom bluetooth gps on a machine running Windows8 and have used GPSGate to create some virtual COM ports. I have valid data arriving at the COM port, but then I run QGIS and try to ...
2
votes
3answers
364 views

Polyline selection of features with angle turns up to a specified angle

I'm looking for an automated way to select line features that have specified angle between vertexes. That in order to check water mains layer -steel pipes can have only 45 or 90 degrees turns and I ...
2
votes
1answer
496 views

Distance of points in polygon to nearest polygon edge

I have a polygon shapefile with about a dozen polygons (Area.shp). I have an equation that calculates a value for points (or small areas) as a function of distance to the edge of these polygons. I ...
2
votes
3answers
156 views

Software needed to recreate VBA forms using python for Arc 10.0

I'm new to programming and need to convert VBA scripted tools for the 10.1 upgrade. I need to recreate the forms and use Python scripting. How do I do this? I need the form to function in 10 ...
1
vote
1answer
88 views

Stop custom attribute form from resizing in Qgis

When I open a custom attribute form for a feature in Qgis it always gets resized to the default size of the original Qgis attribute form. I've tried to set the sizePolicy in QT Designer to Fixed ...
2
votes
1answer
147 views

Stumped on python looping and data dictionaries

I have been stumped getting my python code to work for a while now. I've been using python for the last several years on and off for simple things, but I am far from an expert in python. I am trying ...
6
votes
1answer
261 views

Geometry Projection Speed Test

Lately I've been using the OGR projection classes that come with ogr/gdal, but pyproj was recommended to me, so I thought I'd give it a try. To help me decide if I should make the switch, I did a ...
0
votes
1answer
1k views

How to fix “import qgis.core ImportError: DLL load failed” [duplicate]

I am trying to develop a GIS application in QGIS using the Python language. Unfortunately, I encountered a problem from the outset is that of import and qgis.core qgis.gui. the Problem in the python ...
5
votes
1answer
4k views

How to convert shapefile to SVG keeping internal data?

I am very new to GIS. I found a tutorial on how to make a choropleth using Python tools. I want to follow it but use my own data and map. However the tutorial uses a US map SVG file and I need to use ...
1
vote
1answer
165 views

Batch Aggregate Raster using Python

Trying to write a python script to batch Aggregate a bunch of different rasters. get a Parsing Error Syntax error for line 11. # Batch Aggregate raster tool import arcpy from arcpy import env from ...
0
votes
1answer
99 views

Custom forms and location of python code

I'm working with custom forms for the attribute table of various qgis-object and it works realy well, but I would like to have my forms and their python files separated from the projects. This is not ...
4
votes
1answer
195 views

extend line to feature. programatically

Thanks in advance for any help. I'm trying to programmatically extend hundreds of lines (blue in image) to a single polyline feature (red in image). Sometimes the lines intersect each other, but I'd ...
2
votes
1answer
186 views

Using update cursor on a field with a domain

I have been replacing field calculations with python update cursors in many of my work flows and today I ran into a problem. The fields being updated have an attribute domain. so now, when I ...
4
votes
2answers
627 views

Execute SQL in File Geodatabase

Is there a way to execute SQL queries on file geodatabase from Python? I'm looking for the same functionality provided by arcpy.ArcSDESQLExecute for SDE databases. Thanks,
1
vote
1answer
158 views

Can I append to different tables using ogr2ogr?

I have been through many related questions and links but I am still confused as to how/if this is achievable. So, I have defined tables in my postgis database and I would like my ogr2ogr commnand to ...
1
vote
1answer
211 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
3answers
1k views

How can I translate Modis HDF To GeoTiff

I've a MODIS04 L2, and I want to extract band 8:Image_Optical_Depth_Land_And_Ocean. I use Quantum GIS to open this band, because Quantum GIS see this is not coordinates so this allow me to select ...
2
votes
2answers
120 views

Determine ArcCatalog's currrently selected folder using Python

Is there a way to get the current directory opened in ArcCatalog 10.0 using Python? Something like os.getcwd() but instead gives the selected folder on the catalog tree. Cheers
1
vote
1answer
96 views

How do I change the isNullable property for a field?

Once in awhile I encounter a field in my featureclasses that have their isNullable property set to No. Is there a simple way using python to correct this? I came up with this code, but ...
5
votes
1answer
552 views

Subsetting GeoTIFF with Python

I'm sub-setting a GeoTIFF with the GDAL Python binding and numpy. Essentially, I am providing a central location (coordinates of a flux tower) from which I produce a subsetted image. I then want to ...
2
votes
2answers
563 views

Python GDAL/OGR: retrieved feature is NoneType

I'm doing some scripts in Python to deal with shapefiles, and I have an issue I don't understand. I'm looping over a shapefile, and I want to retrieve the geometry of each feature, but very often I ...
2
votes
1answer
631 views

How to zoom to a selected feature with pyQGIS

I want to create a function that selects a feature and zooms to it (similar in QGIS). Therefore there is following function: QgsMapLayerRegistry.instance().addMapLayer(self.vlayer) def zoomTo(self): ...
0
votes
1answer
524 views

How to read attributes in pyQGIS and QGIS 1.8 without setSelectedFeature

I add a vector layer to a map with QgsMapLayerRegistry.instance().addMapLayer(self.vlayer) later the attributes are read with def select_all(layer): layer.select([]) ...
2
votes
1answer
512 views

Tool to convert Mike Urban network (shapefiles) to EPAnet network

This might be a too localized question, but I hope I'm not the only one here doing pipe network analyses in Mike Urban. I have a model in Mike Urban, and the client wants it in EPAnet format (since ...
0
votes
3answers
287 views

Why does CalculateField set values to <Null> when output extent is in a different coordinate system?

I'm quite new to ArcGIS, and now I have to work on a script that goes through a list of feature classes to: add a field to their attribute table and fill that field with a number that I retrieve ...