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

learn more… | top users | synonyms

0
votes
0answers
5 views

kriging interpolation of many z

I have similar questions with Iterating through z-values in ModelBuilder. I want to interpolate my z's with my specific interpolation extent raster and extract each value to specific grid points (I ...
0
votes
0answers
4 views

Central Feature Tool Key Error u'M'

I was trying to execute two tools (Mean Center Tool and Central Feature) when suddenly it gave me a error that I couldn't find the resolution too no matter what I tryed. The code is here (along with a ...
1
vote
1answer
40 views

Python script to export .csv tables from GDB

I am very new to Python programming and have been tasked with writing a program to export a csv file from a file geodatabase feature class. The csv should contain only certain fields and the records ...
1
vote
1answer
26 views

Python Geospatial development book error?

I am currently reading Python Geospatial Development by Erik Westra but I am stuck at the first hurdle where the book suggests that the easiest way to install gdal onto a windows machine is using ...
1
vote
0answers
16 views

geotiff conversion to coordinate system with gdal

I would like to get the coordinates X Y Z from a geotiff file. I am using the gdal translate for the conversion. Which output format is the more adequate for containing a 3 numpay array X Y Z ?
3
votes
1answer
33 views

Which parameter data type is used in the Integrate geoprocessing tool for ranking?

I'm trying to figure out which parameter data type is used in, for example, the Integrate geoprocessing tool. It looks like this: I'd like to use it in a geoprocessing tool I'm making, but can't ...
0
votes
0answers
25 views

Python comtypes and ArcObjects: Snippets GetApp() fails at 10.2

I have been experimenting with Python's comtypes module to access ArcObjects. We are still using ArcGIS 10.0 as we are in the process of upgrading our ArcGIS for Server to version 10.2.2. I am ...
0
votes
1answer
27 views

Editing KML breaks icons

Edit: Solved it. When I was creating my new zip/kmz my code was creating various folders within the zip/kmz. Changed: NewZip.write(addedfile) to: NewZip.write(addedfile, newfl) /Edit I have KMZs ...
1
vote
1answer
22 views

Adding a graphic line element to open mxd using python comtypes to access ArcObjects

I attended a pretty awesome demonstration from Jeffrey Barrette at the Esri UC a few weeks ago on creating dynamic tables in ArcMap. This functionality will greatly benefit the aviation department at ...
4
votes
4answers
520 views

How to optimise and speed up Python code?

Again my lines of surface runoff... I made a script, solving the issue when lines cross other lines. Something like generalization. Like on the picture below. The problem is that I have to solve 30 ...
1
vote
1answer
31 views

Con() does not recognize raster values

I have a problem when using the con() argument. What I want to do is to remap all raster of a raster file ("Red_SL") cells with values larger than 40 to the new value 5. All other values should be ...
0
votes
2answers
32 views

Check layer data type in gdb

I have path to layer or feature C:\base.gdb\test How to check is table or feature class by arcpy?
1
vote
1answer
32 views

Write layer from QGIS to PostGIS

I am looking for an "elegant" solution to write, from a python script, a layer from qgis and into a new table of a PostGIS database. I thougth that this might be solved by QgsWriteVectorLayer, but I ...
0
votes
0answers
26 views

Is there a way to take control of the mouse pointer using python in QGIS?

i would like to take control of the mouse pointer in QGIS (for example constraining it to a given extent...) Is there any way to do that using PyQGIS ? Thanks !
1
vote
1answer
21 views

Iso Cluster tool in script failing to open clip raster

I have been coding in Python for only a few months, so maybe I'm just overlooking a minor detail as a newbie. I have written the script below for a class project. It is supposed to clip two rasters, ...
8
votes
2answers
220 views

How is the data access cursor performance so enhanced compared to previous versions?

The data access module was introduced with ArcGIS version 10.1. ESRI describes the data access module as follows (source): The data access module, arcpy.da, is a Python module for working with ...
0
votes
1answer
32 views

How can I efficiently use a list comprehension on an ogr.layer inside a loop in Python?

Problem statement I'm using python 2.7 and ogr 1.11.0 on Windows 7. I have two shapefiles: one for streets and one for junctions. The streets shapefile has fields listing the IDs of the start and ...
1
vote
2answers
26 views

Debugging SQL in arcpy.da.SearchCursor RuntimeError: An invalid SQL statement was used?

I am going through a python script in arcpy 10.1 to Select a field value (i.e. NEAR_DIST) based on three condition as 1) NEAR_DIST<=radius(i.e.500 or anything from user input) 2) ...
0
votes
0answers
26 views

Read large raster into lat/lon value pair to csv file using python and/or gdal?

I have rasters for all of the states in US and they are in 10m resolution. So they can be very large, containing a large number of pixels if you think of TX or AK. I want to create a csv file with ...
2
votes
1answer
39 views

How to return end of string up to a certain character using Field Calculator?

I am trying to accomplish this task: http://stackoverflow.com/questions/15851568/how-to-get-the-last-part-of-a-string-before-a-certain-character within the Field Calculator. I have the below but ...
1
vote
0answers
31 views

How do you duplicate a point within a shapefile using Python?

How do you duplicate a point within a single feature class using Python? I have a partial sample script below, but in a nutshell, I want to duplicate a point, copy it into the same shapefile, and ...
1
vote
1answer
30 views

Pyqgis 2.2 : How to allow editing on layer and features

I'm writing a pyqgis plugin with qgis 2.2 I succeeded in accessing and displaying vector data (geometries & attributes). Now I would like to allow editing for all my layers and all features ...
2
votes
2answers
33 views

Selection of lines that lays mostly in defined zone (majority overlap)

I have lines of surface runoff and I need to select the ones that are lying mostly in internal buffer of polygon. I'm trying to make some script in python, but it's very important to make the script ...
1
vote
0answers
21 views

How to sort a column in attribute table programmatically

Is there any way to sort ( alphabetically ) a column in the attribute table programmatically (without clicking on the column header) in QGIS ?
3
votes
1answer
78 views

PostGIS: Insert a Point using Python

What is the right way to insert a Point to a PostGIS database using Python?
2
votes
1answer
50 views

data source for worldwide cross-sections of topographic and bathymetric for woodworking art project?

i am a decent r programmer and statistician, i am able to work with data sets pretty well. i am less familiar with GIS tools, but if given a shapefile i can certainly plot political borders and ...
0
votes
0answers
40 views

Python + GME (Spatial Ecology) + Subprocess.call

I'm trying to run the following code to use GME commands in Python. import arcpy,os,subprocess from arcpy import env env.workspace=r"D:\Users\myname\Desktop\aviso" count=0 for raster in (f for f in ...
1
vote
0answers
39 views

ArcPy Multiprocessing 000714 - Working in Debug Mode

In an attempt to render an interactive window via matplotlib I am using an out of process script in a toolbox. If I debug the script, it is possible to step through and render the window as expected. ...
1
vote
1answer
23 views

Couldn't load SIP module (QGIS doesn't load Python)

I recently installed QGIS 2.4, but Python does not load. I am running on a Windows 64 bit machine. I receive the error message "Couldn't load SIP module Python support will be disabled". Traceback ...
1
vote
1answer
41 views

Controlling Python Version from ArcGIS?

I am writing a VB.net console application that calls ArcGIS Desktop 10.1 ArcToolbox geoprocessing tools from my code. Some of these tools use Python syntax and I am encountering a problem that I ...
0
votes
1answer
42 views

Cannot put a layer name as the same as the raster name just created by Python script

I have a question regarding Python script for making a Heat Map Tool. I am making a Heat Map Tool where users can set the map extent, the tool will read the current scale of the map, then make a ...
0
votes
0answers
28 views

Is it possible to rotate the geographic projection in QGIS?

I'm trying to create a Qgis plugin that can rotate a raster layer in the canvas so that the north is pointing at another direction. Unlike the thread below, I'm open to defining a custom projection. ...
-2
votes
0answers
30 views

Update fields in feature class [duplicate]

I am working on ArcGIS 10.2.1. I have a feature class containing more than 4000 records and a table having approximately 1000 records. Both feature class and table have some common fields however, ...
1
vote
1answer
48 views

What is the inverse of QgsGeometry.asGeometryCollection() in qgis python?

What is the inverse operation of QgsGeometry.asGeometryCollection() as documented here: http://qgis.org/api/classQgsGeometry.html#a7cb1cbf8cfa441456067a66ad3a25a94 I'd like to do something like: ...
0
votes
1answer
49 views

Updating a feature class

I am working on ArcGIS 10.2.1. I have a feature class containing more than 4000 records and a table having approximately 1000 records. Both feature class and table have some common fields however, ...
2
votes
0answers
19 views

How to snap dangling nodes with prescribed angle?

I have got a streets shape file, to snap the dangling nodes in ARCGIS. But, I have to snap only some nodes(of feature) with a prescribed angle (green node in the image, and the angle marked in ...
2
votes
1answer
23 views

raster overlap count

Would it be possible to simply detect and count overlaps between raster files, i.e. not polygons against rasters, using arcpy? By default I don't have the spatial analyst extension for ArcMap 10.1 but ...
0
votes
0answers
20 views

ArcGIS 10.2 with MatPlotLib Non-Blocking Plot

ArcGIS 10.2 ships with MatPlotLib 1.1.1 installed. I am trying to display a non-blocking plot window. Trials: Launch an interactive plot in a Tk window from a toolbox. This causes the plot to ...
0
votes
0answers
12 views

Placing Pins and following transformation on zoom map d3

So I am using this http:// bl.ocks. org/mbostock/4699541 framework on D3.js and I just figured out how to append circles to the map. However when you click on a state the circle moves out of place ...
0
votes
1answer
16 views

Adding a Vertex To Exisiting Feature(linear) Using OGR Python

I am working on a project that involves finding the intersection of linears in a shapefile, if that vertex(the found intersection) doesn't already exist for each(or one) of the features, then that ...
0
votes
2answers
41 views

gdal2Tiles output differs from MapTiler

I'm in need to process a large batch of Landsat images with MapTiler and since the version I'm using (1.0 Beta 2) does not support multiple input files, I created a simple python script that calls ...
1
vote
2answers
56 views

Raster' object is not iterable

I'm trying to calculate the percentage of cell counts in new raster and the new raster is created from an old raster based on the Value > 14. In my code, 1st for loop is for original raster and ...
1
vote
0answers
29 views

How to go about creating a custom tool/adding special functionality for a web app

In my soon to be developed web app, I will have an image service and also a feature service that is essentially an index to the image service, with all kinds of attributes. I would like for the user ...
6
votes
4answers
314 views

How to split single address field into 4 fields (House No., Direction, Name, Suffix)

I have to do some massaging of our parcel data to make it usable by a program in sheriff helicopters. The program requires one of the following address formats within the fields: Our addresses are ...
2
votes
0answers
23 views

Polygon parcel division in python

Is there an open source tool or module in python that does parcel division of polygons like in ArcEditor?
1
vote
0answers
34 views

PyQGIS: Editable Combobox for Value Map widget isses

I am having issues with an editable combo box in QGIS 2.4. The edit widget is set to Value Map with an uploaded CSV. However, if a new values (not included in the key value pair list) is added, the ...
1
vote
1answer
88 views

How does one modify selected geometry with a function in qgis python console?

My example use-case is that I want to redistribute vertices along lines as in: Redistribute linestring vertices to specified distance How to create points in a specified distance along the line in ...
2
votes
1answer
32 views

How to do loops on raster cells with python console in QGIS?

I'm new here and beginner with python. I'm looking for a solution to my problem for some hours but now you are my last chance... I'm using the python (2.7.5) console in QGIS (2.4.0). Is there a ...
1
vote
1answer
41 views

Import arcpy using PyScripter or IDLE gives No module named RuntimeError?

I'm trying to figure out this problem. Yesterday I installed PyScripter and since then, scripts doesn't work. When I run any script (in PyScripter or IDLE) which uses "import arcpy", I get this error ...
0
votes
1answer
83 views

How to write output from subprocess to disk (using multiprocessing)

This code was developed from another question I posted about how to kill an arcpy tool if it takes longer than a specified time. See How to cancel tool execution in python. Using the multiprocssing ...