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

learn more… | top users | synonyms

3
votes
2answers
148 views

How do I know if I am running 64-bit background geoprocessing on ArcMap 10.2?

I'm running ArcMap 10.2 and just set up 'ArcGIS for Desktop Background Geoprocessing (64 bit)' and now I have both the ArcGIS10.2 folder and ArcGISx6410.2 folder inside my python folder. I have ...
1
vote
1answer
38 views

Reinitialize ArcGIS10.0 Python installation

I am developing a Python script for a Toolbox that required a few libraries which I installed manually into C:\Python26\ArcGIS10.0\ and it worked just fine. To make the distribution easier, I dived ...
1
vote
1answer
39 views

How to covert gridded (gnomonically projected by distance) data to lat/long data

I have a grid of data that is in a gnomonic projection, centered on a lat/long point (WGS-84). The grid has a 1km spacing. Given this I can easily obtain the x,y coordinates/distances from centre ...
3
votes
2answers
49 views

FME - Conditionally make parameters visible

I have an FME workspace in which the user sets several parameters before running. The first parameter is a multiple choice where the user selects which layers they would like to process. Depending on ...
0
votes
2answers
34 views

FME - Filter Parameter choices to only projected coordinate systems

I have an FME workspace in which the user sets several parameters before running. One of the parameters is a Coordinate System. I would like the user to choose only Projected Coordinate Systems as ...
0
votes
2answers
38 views

Can't get dataProvider object outside of QGIS python Interpreter

Within PyCharm import qgis.core as qgis vector_lyr = qgis.QgsVectorLayer("Point", "distance nodes", "memory") pr = vector_lyr.dataProvider() print pr prints None Within Python Interpreter in QGIS ...
0
votes
1answer
57 views

Howto create complex polygon with pyshp

using the pyshp library (https://code.google.com/p/pyshp/) I am trying to create a "complex" polgon with one hole inside the main-poly plus one island-poly. It should look like this: I used the ...
0
votes
1answer
76 views

Iterative raster calculation script using NumPy arrays breaks after ~10 rasters, returns: “TypeError: Cannot create raster for numpy array.”

Here is my code: #Generate Cumulative Thresholds #5/15/14 import os import glob import arcpy import numpy as np #Enable overwriting output data arcpy.env.overwriteOutput = True ...
1
vote
1answer
43 views

Calculating average of 3 fields where nulls are present

I have created a new field to calculate the average of 3 other fields in a table where nulls are present. Using python as the parser(with no code block) I used this: (!Slope_PCT! or 0 + !Flood_PCT! ...
0
votes
1answer
75 views

How to create a grid after merging shapefiles?

Follow up question to QGIS Model Builder Script - Possible to merge layers in a folder? I think I'm missing something very obvious here but can't seem to find it. After merging shapfiles in a folder, ...
1
vote
1answer
39 views

How to count the number of entries a user has selected in a multivalue field of a tool dialogue using Python and ArcGIS 10.2.1

I am currently creating a script that will read data in one (to many) Excel spreadsheet(s) and would like to know how to get a count of the number of spreadsheets entered by the user. The script will ...
0
votes
0answers
48 views

gdal commands cannot import gdal — possibly ArcGis conflict with separate Python?

I installed ArcGIS 10.1 yesterday (Windows 7 64-bit), but have a separate Python 2.7 installation. Now my gdal does not work correctly anymore. It looks like all commands without the ending "*.py" ...
0
votes
0answers
31 views

Running algorithm from Processing takes much much longer time than doing it from Qgis GUI

I have a road layer with 32000 features, and I want to find all the intersections. when I use processing->SAGA -> convert polygon/line vertices to points, it is all done in less than 5 seconds. ...
1
vote
1answer
66 views

Raster calculation in for loop returning exit code -1

I've put together a python script that does some calculations on rasters by converting them to NumPy arrays, doing the math, then converting them back to Raster and applying all the same spatial ...
0
votes
1answer
103 views

ArcGIS 10.2.1 Table To Table tool in Python script gives ExecuteError: ERROR 001156?

I work for an organization that just upgraded from esri arcmap 9.3.1 to 10.2.1 and I'm currently in the process of updating the python scripts. When running a script I'm getting hung up on a portion ...
0
votes
0answers
25 views

QgsFeatureRequest and QgsVectorLayer are missing in the QGIS

I am trying to use part of my friend's code in eclipse written in Python using QGIS APIs. I have installed the QGIS 2.2.0. now before running the code, it seems that something is missing here. All ...
1
vote
1answer
97 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 ...
1
vote
1answer
43 views

How to open most recent directory using PyQGIS?

For example, when I add a vector layer, next time that I want to add another layer it opens up where I chose my last layer from. How would one implement this in Python and/or PyQgis? I'm writing a ...
0
votes
1answer
40 views

Changing $id in a shapefile in QGIS

I need to change the id (feature.id() in the python API or $id in the field calculator) of for features in shapefile layers in qgis, and I need to do it in Python. Is there a way? I tried something ...
0
votes
0answers
26 views

Using GDAL and Python to replace the Spatial Analyst TabulateArea method

Has anyone tried to phase out the use of ESRI's Spatial Analyst extension by replacing it with GDAL in Python? I have a script that only uses the TabulateArea and Statistics analysis but not much else ...
1
vote
1answer
84 views

ToolBar icon images missing

very early build ~ zip file I am getting blank outputs for button images in a custom toolbar. Although the button information populates the dockable toolbar, they lack respective icons [see Fig.1] ...
0
votes
1answer
67 views

QGIS Model Builder Script - Possible to merge layers in a folder?

I would like the user to select a folder via the interface in which all the vector shapefiles inside that folder would be merged. I have been using the Model Builder and looking at example scripts ...
1
vote
1answer
58 views

How to change attributes with QGIS python?

I have this piece of code which I would like to use for inserting values into column. It does not throw an error, the changes are not written to the source (shapefile). from qgis.utils import iface ...
0
votes
1answer
56 views

no viewable feature when creating line with ogr in python

the python code below produces the expected line shapefile viewable in QGIS import os from osgeo import ogr drv=ogr.GetDriverByName('ESRI Shapefile') if os.path.exists('test.shp'): ...
1
vote
2answers
151 views

Autoincrementing Python Script is over writing all fields versus just fields that are null

Using ArcMap and the Field Calculator I have a python script that should autoincrement the FacilityID field if it is null. It works the first time through but the second run causes it to overwrite ...
4
votes
2answers
166 views

Is it a bad idea to convert a File Geodatabase table to a dictionary?

First, what am I trying to do? I am building a Python script that should be called from an ArcMap 10.0 toolbox. This scripts uses (among other inputs) data contained in huge gdb tables. It processes ...
2
votes
0answers
163 views

Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error

I am trying to set the Python IDLE 2.7.6 x64 to run the arcpy module from ArcGIS x64 bit geoprocessing (10.2.2). I copied the file DTBGGP64.pth from C:\Python27\ArcGISx6410.2\Lib\site-packages to ...
1
vote
1answer
96 views

Comparing Features in Python

What I am trying to do is, compare attributes in a shapefile to another updated version of that same shapefile just in a different folder. Right now I am just using the Compare Feature tool, which ...
3
votes
0answers
50 views

Arcpy in Python Plugin for SPSS

Is it possible to run the arcpy module in the Python for SPSS plugin to run the search and update cursors?
2
votes
0answers
67 views

Convert a classification image to aggregated polygon in shapefile using gdal/python

My goal is convert a 2D numpy array to shapefile. The matrix results from a classification, so the numbers have a meaning. I solved my problem, but the solution is somehow involuted and complicated. ...
0
votes
1answer
62 views

How to calculate/record attachments' file names using Field Calculator?

I have a point feature class containing attachments corresponding to jpg files (sometime more than one jpg per feature). I would like to use the "field calculator" to calculate/record a new field that ...
2
votes
0answers
54 views

Can't remove the little islands when creating a svg map with kartograph.py

I'm new to python and to kartograph. I'm using it to create a map of France, Italy, Portugal and Spain. But I don't want the little islands (mainly the French ones ), causing the generation of a big ...
0
votes
0answers
20 views

Is it possible to compile a grass addon into a commandline app?

As the title says, I'm wondering if it's possible to take the source of a grass add-on and compile it into a commandline app. Or, alternatively, use the add-on in a python program. Basically, I ...
0
votes
0answers
35 views

Shapely tolerance overlapping layers

Is it possible to define a tolerance by applying a overlapping layers function in Shapely?. I'm trying to make an intersection between lines but the results are different with other GIS. regards.
2
votes
2answers
113 views

Comparing 2 fields using Python

I am trying to compare 2 fields(double) using python. I want to round to the nearest 10th and flag those with a "1" that are not equal. Here is what I have at the moment: def Qcontrol(old, new): ...
2
votes
0answers
219 views

Split a Polygon that Crosses International Date Line, ArcPy [closed]

I have a lots of existing data in WGS-1984 (too much to manually edit). I need to split these lines and polygons by the international date line. More projection information: ...
0
votes
1answer
99 views

Batch renaming of shapefiles using ArcPy and folder name where shapefile is stored?

I am very new to Python and wondered if anyone had any idea how to do this? I have ~100+ shapefiles named 'land boundary' within the folder of their site name. Is this possible using Python in ...
4
votes
2answers
78 views

ArcGIS Toolbox, parameters for python script not as positional arguments

I have an ArcGIS Toolbox with a bunch of parameters. A python script is used to perform some raster operations, based on this parameters. I am using Python argparse in the script to get the ...
1
vote
1answer
43 views

Calling QgsProjectionSelector from QGIS Python plugin?

I am trying to create a dialog that allows the user to select a coordinate system from either the recently used projections or a general list of all available projections. This would basically offer ...
0
votes
0answers
34 views

when using arcpy.mapping.ListDataFrames, python.exe crash

Has anybody had this problem? this drive me crazy. what is wrong with my code? import arcpy mxd = arcpy.mapping.MapDocument(r"D:\Project\Project.mxd") df = arcpy.mapping.ListDataFrames(mxd, ...
0
votes
1answer
74 views

How to select a feature and get its fields by mouse click using Python Addin in ArcGIS?

I'm building a python addin tool in arcgis and I would like to click a feature, say a polygon on the map, and get the polygon's attributes,i.e. ID=3,NAME = "CITY3"...It's similar as the arcmap tool ...
-4
votes
1answer
34 views

how solve this proplem :NoneType' object has no attribute 'start' [closed]

patternRE = re.compile('(^|\s|\")([^\s]+?)\",{'+str(HeaderLineIndex)+'}') #patternRE= '\n("."){'+str(HeaderLineIndex)+'}' #patternRE=re.compile('(^|\s|\")([^\s]+?)\",') Buffer = ...
1
vote
0answers
62 views

Batch Zonal Statistics to Spreadsheets?

I have a pretty immense amount of Zonal Statistics as Table computations to do, and would love to find a way to grab mean and variance values from the little .dbf tables ArcGIS creates and put them ...
0
votes
0answers
76 views

GRASS “Argument list too long” with run_command

I have a python script that uses the grass.script.run_command function to read in, process, and export a bunch of raster files. On projects where I have a large number of rasters (>1,000), it fails ...
0
votes
0answers
16 views

Is it possible to override default QGIS error messages?

From my QGIS plugin I would like to override/replace one of the the default QGIS error message ("The layer layer_url is not a valid layer and can not be added to the map") with my own message. I have ...
3
votes
1answer
39 views

How to choose workspace when uploading SLD to Geoserver with the REST API

I have 200+ SLD's I would like to upload to Geoserver using the REST API. I successfully uploaded an SLD using the gsconfig Python module. However, I would like to be able to set the workspace when ...
0
votes
0answers
39 views

leaflet.js ImageOverlay projection bug

We are trying to display a image over the leaflet map using "ImageOverlay" layer, but it does not work according to expected. In Google Maps works perfectly. Apparently Leaflet just stretches the ...
0
votes
0answers
19 views

Using file directories from a table

I have a toolset that will be using a set of file directories as input (shapefiles, raster etc.).The table can be stored as CSV or DBF. Is there a way to read a specific cell (row,column) of the ...
0
votes
3answers
78 views

Python QC field calculator

I am new to Python and am trying to run a simple QA/QC on a particular set of fields. I basically want to verify that fields x and y add up to z, I may have to incorporate rounding since a small ...
0
votes
0answers
47 views

Accessing CRS info with pyqgis in a standalone application

I'm currently having trouble accessing and defining CRS information in a standalone application. I've read the API documentation and have tried it in the python console in QGIS 2.2.0. The python ...