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

learn more… | top users | synonyms

2
votes
2answers
35 views

Assigning a vector to a field in feature class (UpdateCursor)

I don't know if my mistake is of a general nature. I come from R where it is very easy to store a vector in a matrix column. So now I (new to coding with arcpy) am desperately trying to do the same ...
2
votes
1answer
83 views

Clipping Line shapefiles within extent of Polygon shape?

My question is an extension of Vertical lines in a polygon shapefile. Kindly refer to that question first. What you shall see there is a method of generating vertical lines with respect to the ...
1
vote
0answers
20 views

Ungenerate command in ArcGIS for Desktop? [duplicate]

I am searching for the ungenerate command in argis10 desktop. I get to know that is available only for workstation. But i don't have workstation. Is there any way to use this command or any other way ...
2
votes
1answer
72 views

ringer: help convert simple plugin to new QGIS 2.x

I have been trying to get this simple plug-in to work on QGIS 2.x. So far i got it to load, but it does nothing! all that it is supposed to do is place a polygon where a hole (ring) is. The code is ...
1
vote
1answer
68 views

How to calculate unique IDs starting from highest current ID

I have been using a python script in field calculator in ArcGIS 10.2 to add unique IDs automatically, however there are two things I would like to improve this process: Each ID also has letters at ...
3
votes
0answers
26 views

Overriding the QGIS Feature Dialog

We are developing a QGIS plugin and would like to override the QGIS Feature Edit Form with our own Dialog. Have explored using setEditForm and setEditFormInit, but the init process appears to want to ...
0
votes
0answers
36 views

ArcPy PointToRaster memory locking error solution?

RasterToPolygon ArcPy tool fails on generated raster (PointToRaster) with large(?) dataset. Not sure the size threshold, but fails on 78559 x 33544 raster, completes on smaller datasets so I know ...
0
votes
0answers
90 views

Transforming between epsg:3857 and Google Maps Tile coordinates

Hio, I used to use a simple python project (https://github.com/hrldcpr/mercator.py) to convert between wgs84 and google maps tile coordinates. This project doesn't have a license, and looks like it ...
1
vote
1answer
54 views

Migrating data from Python to PostGIS

I have pandas DataFrame with these columns: point datetime value 1 Point(-24.6064453125 26.3683280945) 2014-09-11 19:00:00 24.885258 2 ...
2
votes
1answer
51 views

How do I link OGR with spatialite?

Problem & Evidence: I'm trying to create a spatialite file with the code snippet below. However the outDataSource object gets assigned NoneType and all subsequent (unshown) code fails. I'm ...
2
votes
1answer
56 views

Python Use SearchCursor/InsertCursor to split attributes in fields

I download data daily and create a geodatabase table. Fields: Company, Customers_Active, Customers Total, County, State Example Data {CompanyA,CompanyB}, {141,424}, {1000,3421}, Cook County, ...
0
votes
1answer
26 views

Is there a method to determine the sources that are used in a model in ArcGIS?

I have a model that I have had to go through to model parameters in order to create a geoprocessing service. Is there a way to check all sources that are being used in the model via python? I am ...
0
votes
0answers
23 views

imposm2 to imposm3

I am using imposm2 to import osm data to postgresql database but recently moved to imposm3 which is still in development phase I want to know is there an easy way to convert imposm2 mapping file ...
1
vote
1answer
37 views

Programmatically access HTML Popup in Layer Properties ArcGIS 10.2

Is it possible to access HTML Popups (found in layer properties) programmatically in ArcGIS 10.2? I can't find any reference but thought I'd ask to double check.
1
vote
0answers
23 views

cadtool and spline plugins not working

Am trying to edit a line shapefile using a spline tool in QGIS 2.4.0 .Its drawing but the ok button is inactive. what could be the problem? Generally am trying to create a curved line.
1
vote
2answers
79 views

Vertical lines in a polygon shapefile

I am working with a GIS problem using a single input of a polygon shapefile. Consider an irregular polygon. I want to draw vertical lines across the extent of the polygon at equal spacing. How I ...
1
vote
2answers
57 views

How to concatenate double with string in field calculator with Python expression?

I'd like to concatenate my lat/lng with a few string fields in ArcGIS. What is the correct expression to use, avoiding VBA. I don't want to convert the lat/lng fields to string either. my 4 fields ...
1
vote
0answers
17 views

Python Script calling custom model failing during model execution

I have a python script that calls a model I built in model builder. If I run the model by itself it runs perfectly. If I call the model in the python script, the model errors in various locations. ...
0
votes
1answer
139 views

'List indices must be integers not tuple' Error

I'm using an insert cursor to write rows to a destination feature class where the input Shapefile field names do not match the destination FC names. To accomplish this, I'm trying to use the indices ...
1
vote
1answer
45 views

Load feature class with tab delimited file that is missing Lat/Long

I am working on a Python script that receives a nightly tab delimited flat file. This flat file has Latitude and Longitude fields and the script loads the data using the gp tools Make XY Event Layer ...
12
votes
5answers
2k views

Python is only using one core at a time to work

I noticed recently that python is only using one core at a time to work. Is there a way, maybe special builds or commands, to make it use all resources (second core)?
1
vote
1answer
50 views

How to properly import QImage from PyQt4.QtGui?

I am starting with QGIS python console. Naturally, I came across the PyQGIS Developer Cookbook. While trying to cut my way through it, I encountered a lot of problems with "undefined attributes and ...
1
vote
2answers
71 views

Error "unsupported operand type(s) for +: 'int' and 'NoneType' for variance in python

I recently came up with an error in a script I am working with in Python for ArcGIS 10.1. The strange thing about it is that this script works for some files and not for others. Any ideas as to why ...
4
votes
2answers
64 views

How to programmatically delete all inner rings of a polygon layer?

I have many polygon layers, each layer containing many polygons with inner rings. I know that you can delete a ring manually with QGis (Edit -> Delete ring). I need the python equivalent to ...
1
vote
0answers
30 views

Orthographic projection in Python Basemap

I'm trying to plot a GeoTIFF in Python using Basemap. I can do so correctly with cyl projection like this: m = Basemap(projection='cyl', llcrnrlat=LL[1], urcrnrlat=UR[1], ...
2
votes
2answers
116 views

Join Field works in ArcMap but not in Python

I am trying to join a field of values found within a DBF to a multi-polyline shapefile. They share a common field name (filename) and the values found within each are identical. I was able to run Join ...
3
votes
2answers
67 views

Script for numbering roads based on Cardinal Direction

I am kind of new to python, and am attempting to write a script that will give me a unique identifier for roads based on the cardinal direction. Ultimatley, I would like to have a system set up such ...
2
votes
1answer
57 views

How to detetmine county of GPS coordinate?

I have a SHP file that contains all counties in the USA. I also have roughly 100 million GPS locations. I need to tally the number of GPS locations per county. A linear search through the counties ...
2
votes
0answers
50 views

Run a large model by calling it in a python script?

I've created a rather large model containing a sub-model that calculates the volume of water basins(playas) in a relatively flat area of Texas. The volume is taken from one foot slices of each each ...
1
vote
1answer
84 views

List layer names from Map service using python

I am trying to get a list of layer names within our rest services for all services and folders. I have two codes that I am trying to put together and for some reason the layer code doesn't seen to ...
5
votes
1answer
110 views

Is it possible to drive one mxd (pan) using a different mxd with python?

I have 2 mxd's. mxdA and mxdB They both show different data, but are both in the same coordinate system. I want to be able to sync mxdB with mxdA, so that if I pan / zoom in mxdA, I can then, with ...
3
votes
0answers
57 views

Problem with performance when loading PostGIS layer using pyQGIS

I'm having a question on loading a PostGIS layer into the project from my QGIS plugin. The code is like this: uri1 = qgis.core.QgsDataSourceURI() uri1.setConnection(str(host), str(port), ...
2
votes
0answers
23 views

Run an ERDAS Imagine pmdl (or bcf) via Python?

How (or is it) possible to run an Erdas Imagine .pmdl model from a Python script? I have successfully run .eml models but cannot get the syntax right for .pmdl Here is what the line I want to run ...
2
votes
1answer
50 views

Python loop with address locator

I was given a list of addresses without any zip codes, and I'm trying to write a python snippet that will loop through a set of possible zip codes and make a set of geocoded shapefiles that I will ...
1
vote
1answer
77 views

Using GDAL to read dted files

How do I get the elevation at a certain point using gdal to read in a dted file? I don't see much useful information out on the web. I'm sorry I should have been more specific. How would I ...
4
votes
3answers
129 views

How to get a list of attributes in FME when there are no records in table?

How to get a list of attributes in FME when there are no records in the table? I try use a PythonCaller but when there are no records, FME passes over this table. In PythonCaller I write: import ...
0
votes
1answer
49 views

Create Georeferenced Raster For JPEG file with Mapnik Python

I am able to use Mapnik generate_image.py to generate image with a BBOX and projection. Also, I have added a python script to generate a JGW file. But to completely georeference the generated image. ...
1
vote
1answer
46 views

Error on FeatureClass To FeatureClass conversion arcpy

I am currently working on a python script where I am trying to copy selected features into a feature dataset. Basically I have an mxd containing some layers, and for each layer I select features by ...
3
votes
1answer
126 views

Why is this field calculator expression evaluated incorrectly when using Python syntax?

I have a polygon featureclass containing an integer field 'gridcode'. I've added 2 new float fields VB_calc and Python_calc, both of which should be equal to gridcode / 1,000,000. If I calculate the ...
1
vote
1answer
116 views

Installing Pandas in ArcGIS 10.2 for Desktop?

I followed the very clear directions in the answer to Installing pandas with Esri's python? and created the Esri101 build and added a "conda.pth" file to my ...
1
vote
0answers
33 views

How to write in only a file .csv (or .txt) the values contained in several rasters?

I am an beginner in Python programming but I would like to write in only a file .csv (or .txt) the values contained in several rasters. For example, I built several rasters by using a loop. The ...
1
vote
1answer
30 views

Point input for polyline not acceptable?

Input QgsPoint(s) are returning an error in a Polyline creation routine. Any clues?! processing.runandload("qgis:polygoncentroids", Base, "memory:CenterNode") ...
1
vote
0answers
29 views

GeoDjango WebMapping Application Update

According to the below GIS.SE questions, GeoDjango was the preferred framework for creating simple and quick webmap applications. But these questions are now all 2-3 years old. Can we verify whether ...
1
vote
1answer
64 views

How to delete features/records in ArcGIS Server using Python

How can I use python to delete records from a table, or features from a featureclass, when they are stored in ArcGIS Server? using REST "delete features" in arcgis api for javascript shows ...
1
vote
1answer
53 views

Extract Values to Points between rasters and point shapefiles of the same name

I have a task of extracting raster values to point shapefiles, which is simple enough, but only where the raster filename is identical to the shapefile. For example, I have shapefiles "G1", "G2", ...
1
vote
0answers
45 views

How to load style from postgresql?

Is there any way to load a postgresql style for a vector layer using python? There is a function: loadNamedStyleFromDb (const QString &db, const QString &theURI, QString &qml).Does it ...
3
votes
1answer
40 views

Merging .dbf Tables in Python w/o merging all fields of same name

I'd like to merge several tables together using Python. They all have the same field names: "TIME", "X", "Y", and "VALUE". I would like the "VALUE" fields to remain separate when merged, so that the ...
1
vote
1answer
42 views

Problem with variable for arcpy.select_analysis whereclause

I have a problem with the whereclause on python for arcpy.Select_analysis. I try to use a variable for condition: for row_stat in rows_stat: % for calculated the variable"maxi" ...
2
votes
0answers
38 views

Python and gdalwarp: change resolution of raster

I am new to GDAL and have been having some hard time figuring out how to change a raster's resolution and how to align it to another existing raster. I have come to the point where I have a raster ...
1
vote
2answers
30 views

Parcel Map - How Many Acres of Feature X fall Within Each Parcel

Can someone recommend a good tool for ArcGIS that would help summarize how many acres of a polygon feature occur within each parcel in a separate layer. I have a layer containing a few hundred ...