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

learn more… | top users | synonyms

3
votes
1answer
893 views

Multiline VBScript Label Expressions in Arcpy

I am able to set simple label expressions, but when I try to set multiline expressions (which all VBScript expressions are) it does not get copied into the expression box properly. I have tried using ...
2
votes
1answer
56 views

Is it possible to render a large number of shapefiles to a pdf document using Python?

I'm extremely new to GIS, and recently made a map by loading a bunch of shapefiles into QGIS using a python script. However, it took 15 mins to scroll in or out on the image, and the pdf export ...
3
votes
1answer
262 views

Python SQL connection causes crash in ArcMap

I have the following code which I have striped down to just included the part that is causing a crash in ArcMap. import pymssql # Connect to the Research db using Windows Integrated Authentication. ...
1
vote
0answers
19 views

How to find QGIS or QT or Python object definitions

I am attempting a simple plugin, on QGIS 2.6, using the available QT Designer installed I have successfully loaded a plugin, and can display a dialog box with widgets, within, and now attacking ...
0
votes
1answer
76 views

Calculate Field based on two fields using python

I'm trying to calculate new values for a field based on two other fields. In VB I don't have any problem, but I need to use python to publish my gp service.
6
votes
2answers
1k views

Getting unique value of second field using arcpy.da.SearchCursor?

I have a feature class and using arcpy.da.SearchCursor I'm getting unique values of a field (e.g. Name). How can I use this method to get the associated row value of a different field (diff field = ...
0
votes
1answer
135 views

Spatial ETL Tools won't run “AttributeError: 'module' object has no attribute, etc.”

I have a python script that runs 5 Spatial ETL tools that I wish to run as a scheduled task. Each of the tools will run successfully from ArcCatalog and also from the ArcCatalog Command line. If I ...
4
votes
3answers
2k views

Creating collection of polygons from collection of points?

I have a set of points, which are spread over a wide geographical area. I need to be able to create a set of polygons which best represent the clustered points. In parts, some points may simply lie ...
1
vote
1answer
115 views

How to calculate monthly maximum values from daily data in a 365 band grd?

I have a MINT2005.grd file which has 365 bands representing days of year from 2005. Each band is a 32x35 matrix representing the temperature at different latitude and longitude pair. How do I ...
2
votes
1answer
206 views

Python problem visualization .tif image

I am trying to read a hyperspectral image in Uint16 .tif format and visualize it. I use GDAL in Python to read the data and everything works perfectly when I use matplotlib to show one band of the ...
6
votes
5answers
3k views

Programmatically edit/update metadata in ArcGIS 10

Has anyone succeeded in programmatically updating metadata in ArcGIS 10? Considering using Python/arcpy but ArcObjects (C# or Python/comtypes) is also a possibility. I need to update both the FGDC ...
1
vote
1answer
38 views

QGIS Deployment in Citrix XenApp - How to Remove Pyramids from the image “properties”

I'm working on deploying QGIS 2.4 into a XenApp 6.5 desktop environment. We've tested QGIS to see if it will run in our environment on a test server and have found that building Pyramids with ...
1
vote
3answers
59 views

Determining Y coordinate for Create Fishnet from desired Angle of Rotation in Python/ArcPy?

On the ESRI website it says: How_Create_Fishnet_works Calculating a value for the y-axis coordinate If you know the angle of rotation, you can compute a value for the Y-Axis Coordinate parameter as ...
3
votes
1answer
116 views

Export Model to python script in QGIS 2.6?

I just wanted to ask where the export model to python script option has gone in QGIS 2.6.0? Thanks
1
vote
1answer
157 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
1answer
36 views

arcpy geometry difference method fails randomly, not reproducible

Has anyone used the arcpy geometry difference operator and seen unexplained errors like what I describe below? This is a weird one. I have a script that calculates wave fetch distance in the ocean ...
0
votes
0answers
43 views

Fiona write crashes

I am trying to write a new shapefile with fiona but after creating the features, i keep getting this output after the program crashes: The program '[6668] python.exe' has exited with code -1073741819 ...
2
votes
2answers
68 views

Python Add-in- Message Box to display area of selected polygons

I am looking to create a Python AddIn which calculates the area of selected polygons. I would like to be able to select the features, click a button on the toolbar, and a Message box displays the sum ...
1
vote
1answer
35 views

Qgis Python console print statements not working

I have a small problem with the Python console in Qgis. I am working through some introductory tutorials on Python scripting for Qgis. I have a script that loads layers, then queries the canvas for ...
-1
votes
3answers
56 views

Insert layer file to specific data frame

I have a folder that contain mxd's projects. Each mxd has 3 and more data frame. I want to insert layer file to a specific data frame with position in the TOC. I don't know how to do it. I'm trying ...
1
vote
1answer
47 views

Calculate value from an equation using Field Calculator Python/VB Script

I wanted to calculate a result value from 3 fields using an equation. VBScript or Python codes are also accepted..:-) the equation is RESULT= [(R^2/3)(S^1/2)]/n..
0
votes
0answers
259 views

Missing QGIS python plugin database connectors

I am working with python plugins for QGIS.I developed my plugin and inorder to incooperate the same into QGIS i copied the folder in C:\Documents and Settings\comp90\.qgis\python\plugins I opened ...
0
votes
1answer
18 views

Data frame index

Can anyone know how to make index ,in arcpy, for a several data frame in one mxd? That question related to this question : Insert layer file to specific data frame
-1
votes
1answer
47 views

What application server or web framwork to use

I'm looking to make a webmapping app, which gonna use Geoserver as carto server, and Postgres/postgis as Dabatase, and Extjs as client UI. but i'm in dilemma in application server side, between PHP, ...
0
votes
1answer
43 views

Writing shapefile with projection defined crashes Fiona part two

I have the same problem as this post. Writing shapefile with projection defined crashes fiona It says that was an issue with GDAL. I cleaned my site-packages of anything GDAL, fiona, six related. ...
1
vote
1answer
45 views

Using if else statement in Python Parser of Field Calculator in ArcGIS for Desktop?

I need help in writing the python script in the field calculator. I have three fields namely: CODE COMPLEX Map1 Map1 is an empty field that I want to populate. I have a number of conditions to cater ...
1
vote
3answers
115 views

Field Calculator - How to evaluate and sum multiple fields?

I'll do my best to describe the problem - my main issue isn't so much the python code but rather the logic I'm using. The file I'm working on is a polygon shapefile with forest attribute data. In the ...
2
votes
2answers
180 views

Issue while running grass from subprocess

I have a map based web application using geodjango. I needed to display the crime hotspots within a selected polygon area. I found that v.kernel is very good for generating heatmaps/hotspots. So in my ...
1
vote
0answers
35 views

ArcGIS script for mapping lat/long coordinates to boxes/rectangles? [duplicate]

Working on a project that requires me to take lat/long coordinates and map them as rectanglular boxes on ArcMap 10.1. To be clear, the upper left & lower right corners of each box/rectangle are ...
2
votes
1answer
89 views

Convert GeoPDF with GDAL

I'm attempting to convert a USGS US Topo GeoPDF in Windows. I'm using GDAL 1.11.1. My initial attempts were with this Python script, which automates the process by feeding a command to the Windows ...
3
votes
2answers
382 views

Load and display a layer using PYQGIS

I'm having a go at using pyqgis from within the QGIS python console to load a layer from SQL Server and display it. I feel like I'm part way there but I'm having a real issue getting the layer to ...
2
votes
1answer
85 views

How to create a Qgis python script to manipulate fields with some parameters?

I'm just beginning with QGIS. I have a shape file with 10 fields field1, ..., field10, and many thousands of data. I will like to automatize the next sequence (in a python script or a model): load ...
46
votes
6answers
4k views

When to use ModelBuilder over Python scripting and vice versa?

I am new to Python scripting in ArcGIS but not new to ModelBuilder. I would like to know the benefits of Python vs ModelBuilder. When should we write Python script for GIS automation rather than ...
2
votes
1answer
601 views

How to debug 'Layer is not valid error' from Python plugin?

I'm trying to understand what goes wrong with a QGIS python plugin. Basically I'm trying to render a series of POINT. The query works fine, at least giving it by hand from inside PostGIS DB: "SELECT ...
6
votes
1answer
420 views

How do I call external files in Python Geoprocessing Service?

I have created a Python script which calls an R script and then reads the output back into Python. I can run this tool in ArcGIS Desktop (10.2.1) and it works fine. When I publish as a geoprocessing ...
2
votes
0answers
59 views

Developing workaround to arcpy.asShape truncating all values to 3 decimal points?

I've read a few questions\answers about converting a GeoJSON Shape into an ESRI Object. Unfortunately most of the answers pointed to decoding the dictionary's manually. Im a bit more lazy ^_^ The ...
1
vote
0answers
106 views

update cursor to calculate field [closed]

This is my first post, so any help is greatly appreciated. I'm trying to use an update cursor to calculate a field. Basically, I'm trying to avoid division by 0 by looking in row[0] and see if it's 0. ...
3
votes
1answer
228 views

How to clip a Oracle query layer directly in a Python script?

I have a query layer directly running from ORACLE database in a MXD. I want to clip this layer with a layer being created in another MXD in a Python based tool. My question is to do this clip ...
2
votes
0answers
53 views

Matplotlib error when installing Molusce or lifemapper in QGIS Brighton

I am installing plugins via the QGIS desktop internal interface, and have had twice now messages associated with matplotlib. The first error was for something called lifemapper and now for MOLUSCE. ...
1
vote
3answers
478 views

More Efficient Spatial join in Python without QGIS, ArcGIS, PostGIS, etc

I'm attempting to do a spatial join much like the example here: Is there a python option to "join attributes by location"?. However, that approach seems really inefficient / slow. Even ...
0
votes
1answer
36 views

Get shape file polygon attribute value at a specific point using Python (e.g. via PyShp)

I have a shape file comprising multiple polygons. These polygons have attributes. I am trying to write a script in Python that takes a co-ordinate point, determines in which polygon it falls, and ...
-1
votes
2answers
63 views

Convert shapely polygon coordinates

I am trying to work with a shapefile using shapely, fiona and python. The original coordinate system is in latitude and longitude that I am trying to convert to state plane system. So I want an ...
1
vote
2answers
28 views

QGIS 2.4 crashes when symbolizing QgsComposerShape in Python with ScriptRunner

I'm attempting to use ScriptRunner to output a jpeg of a red rectangle using QGIS Composer to understand the QgsComposerShape. Everything works except QGIS crashes when the symbol is applied. The ...
1
vote
1answer
213 views

Creating grid polygons from coordinates using R or Python

I have locational data with north-south and east-west coordinates, with a resolution of 100 meters squares. Each data point's location is somewhere within the 100 meters square which centre is given ...
0
votes
1answer
422 views

How to run an AML in Python?

I am trying to run an AML in a python program I am writing and haven't been having much luck figuring out the correct way to run the AML. The AML requires ArcInfo Workstation to be from the GRID ...
1
vote
0answers
50 views

Link QGIS to Anaconda Python Distribution: Spyder, iPython Notebook, pip, scikit-learn

I have Anaconda as my primary Python distro, and want to route Python related QGIS scripts through it. With Anaconda, I have Spyder, can easily install packages with pip, and can launch a iPython ...
2
votes
1answer
315 views

View HTML field data with QT4 browers as a QGIS Run Feature Action Tool

I've successfully populated a sqlite table with an HTML-encoded-table as a field attribute, and so there is literally a Table within a single field value in sqlite, for each record. This is going to ...
0
votes
1answer
51 views

Transform lat long to state plane coordinates

I am trying to convert a set of lat long to state plane coordinates using python and pyproj. The location is Tennessee and this gave me information about the central meridian, lat origin and the proj ...
1
vote
0answers
16 views

How do I make arcpy exclude frozen / off layers while importing a DWG file?

I'm attempting to update existing GIS feature classes (SDE) using master AutoCAD files but end up importing ALL features present in the AutoCAD drawing regardless of the visibility settings (frozen / ...
1
vote
2answers
460 views

Using reader Feature Type Name as Writer Feature Type Name in FME

I've search and searched for a way to do this, but no method seems to work. Basically I want to use the input feature class name (feature type in FME) as the output name. This normally works, ...