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

learn more… | top users | synonyms

0
votes
0answers
15 views

Loop stops before expected without error message

I try to run a script that clips all the feature class of a geodatabase by the successive features of a clip layer (named pochoir). Thank to support here and here, the test of the intersection is ...
0
votes
0answers
6 views

Is there a faster alternative to arcpy spatial join?

I am wondering if there is a more efficient method than using arcpy spatial join in python. I am currently using intersect and closest methods (including a near distance field) so would need ...
0
votes
1answer
30 views

VB to Python for Labeling in ArcGIS 10.2.1

I am really new to Python and do not understand VB. I need to convert this VB script to Python. I think it may take me a few weeks to figure out but if someone helps me I would be grateful. The code ...
0
votes
1answer
89 views

Weighted Overlay - passing parameter as text error?

For some reason when hardcoding the save path for the wieghted raster just before runtime it works perfectly. Like such... arcpy.env.cellSize = "90" arcpy.env.workspace = r'G:\Xcel\Route ...
0
votes
0answers
19 views

gdalwarp hdf problem

I am working with some hdf files. The following command works on my Mac. command = gdalwarp -of GTIFF -tr 1000 1000 -tps -s_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs " -t_srs ...
2
votes
2answers
94 views

Accessing geometry with SearchCursor in ArcPy

I'm trying to write a script that clips all feature classes in fcList by the successive rows of a clip feature. I'm using arcpy with ArcGIS 10.0 The problem is that I need to verify whether the ...
0
votes
0answers
10 views

How to get linestringe from kml into shp or postgis [duplicate]

Im looking into extracting linestrings from a kml file into a shp file or postgis db. Each linestring would be a feature/row. How would I go about it usinge ogr2ogr or python? I'd like to get ...
11
votes
2answers
646 views

Why learn/use Python Toolboxes over Python Script Tools?

I've written a few Python Toolboxes (which are new at ArcGIS 10.1), but am yet to decide whether/when I should write them rather than Python Script Tools in a standard toolbox. I thought the Online ...
1
vote
0answers
11 views

Python problem during CADInput installation

I was trying to install CADInput (version 0.60) on 2.4 Chugiak and 2.6 Brighton as well. In both cases I got an eror message during installation. For me the following extract of that message might ...
0
votes
1answer
27 views

copy only selected with CopyFeature_management

I am trying to test if each feature of a feature class list intersect each feature of a shapefile (clip layer). I'm working with arcpy in ArcGIS 10.0 The arcgis desktop help says that if the feature ...
2
votes
1answer
51 views

How to query values from a list in Python?

I have a list like this... list = ['1','2','3','4'] how can I use arcpy.Select_analysis to select features that have the attributes in the list. qry = '"SECDIVNO" IN ' + str(tuple(list)) ...
0
votes
1answer
225 views

visualize bounding box to a polygon

I try to make plugin in QGIS that compare 2 bounding box data, ex: (-32.61442167739459, -32.017601026186576, 13.015663782506067, 13.428145228091406) and (-38.6102467739459, -38.017601026186576, ...
2
votes
1answer
109 views

Error with da.UpdateCursor and SDE feature classes

I am making my first attempt at editing an ArcSDE feature class with python through a da.UpdateCursor. I'm essentially taking code I've written for a file geodatabase feature class and applying it to ...
2
votes
3answers
71 views

Converting personal geodatabase .mdb file to .gdb

Is it possible to convert an MS Access personal geodatabase file to a SDE enterprise geodatabase file format? What kind of python scripting would it entail? I need to convert it in such way to ...
2
votes
1answer
33 views

How to create layer group in geoserver with gsconfig?

How can I create layer groups using python gsconfig ?
0
votes
2answers
227 views

Python Geoserver gsconfig create resource from Postgis store table

I've working Workspace and PostGIS store in GeoServer. I would like to use python and gsconfig to create new resource/new layer from existing PostGIS table, with: computing bbox, adding abstract, ...
6
votes
2answers
461 views

How to write scripts that can call on both Arcpy and PyQGIS?

I have spent quite a bit of time looking for a clear answer this topic and have still been unable to really accomplish my goal of accessing PyQGIS in a stand alone script. Parts of answers have been ...
3
votes
2answers
54 views

PyQGIS: Speed up for adding features and attribute arrays?

Context: I'm writing a dynamic import tool for QGIS (2.2 to 2.5) with python. Datatype: Binary Datasets with environmental simulations from HPC which might contain millions of features and terabytes ...
2
votes
2answers
45 views

ArcGIS are two rasters the same? - including null values

I am working on a task to calculate Height Above Nearest Drainage (HAND) - that is the height above the nearest point along the flow path that is on a drainage - not the geographically nearest ...
2
votes
1answer
128 views

calling gdal_merge.py into another python script running GDAL processes

Good Afternoon All, I am wanting to use gdal_merge.py to merge a series of .tif files prior to clipping the merged file to a shapefile boundary, but want to do so as part of another larger script ...
1
vote
1answer
152 views

QGIS Python Labelling

i want to label a point layer with those values exceeding a set of variables attribute table as follows 'loc field'(text),'a'(float),'b'(float),'c'(float) variables as follows vara = 5, varb = 3, ...
2
votes
4answers
65 views

Summarising all fields in attribute table using ArcPy? [on hold]

I was hoping to run a script that will iterate through all fields in an attribute table, SUM each field and produce the result in a table. The script below will essentially do what I want with one ...
1
vote
0answers
16 views

Set default values for value table in Python Toolbox tool

I created a Python Toolbox tool to reorder fields and create a new feature class with the reordered fields. The tool works nicely and I am able to use a value table to let the user arrange the fields ...
1
vote
1answer
112 views

Importing file geodatabase (GDB) to table of contents (TOC) of ArcMap?

I have a geodatabase with several feature dataset and feature classes associated with it respectively. I would like to create a .mxd where the Table of contents consist of group layer and each group ...
0
votes
0answers
27 views

Duplicate FID for points

I ran the script below to export feature vertices to points. The code works but after 10,000 points the same FID appears for 5 to 10 points. This continues for the rest of the dataset. There are ...
2
votes
2answers
67 views

Calling QGIS from MacOS python

I would like to import qgis.core and utils from my own copy of python. I do have PYQT4 installed there. I'd be happy to add to my PYTHONPATH or sys.path.append in my code, where do the qgis modules ...
11
votes
9answers
7k views

Python GDAL package missing header file when installing via pip

I asked this question on Stack Overflow before I realised this site existed. As this site it more appropriate, I'll ask it here too. I'm trying to install gdal from pip pip install gdal inside a ...
0
votes
0answers
22 views

Create polygon with predefined size

I need to create a polygon (square) with a predefined size to place it anywhere in a map. The size is given in centimeter (size in cm * scale = size in real). Is that possible with postgis/qgis?
1
vote
0answers
20 views

How to convert a raster file (*.tif) into a composite geodataset by using Python in ArcGIS 10.2.1

I created geotiff rasters (approximately 6000 rasters) in .tif format by using Matlab Mapping Toolbox. When I examined the properties of the data, I realised that it is 64 bit double type. I need to ...
1
vote
1answer
426 views

Converting Tab to Shp Using OGR2OGR with Python on linux

First i downloaded http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2ogr.py and i am importing this. How can i get ogr2ogr to run in my script? nothing seems to be working and i not sure ...
2
votes
1answer
234 views

Why shapefile loaded in canvas always appear in random color?

I created the simple frame .UI file, compiled with pyuic4, and tried the ShapeViewer.py to load the shapefile "world_borders.shp". However, the map is always loaded in different random colors every ...
1
vote
0answers
24 views

Arcpy addin editable textbox on tool bar

I would like to add an editable toolbox on an arcpy addin toolbar. This would be used to change values of a threshold but I don't think this is currently available. (What I would really like is a ...
1
vote
2answers
65 views

Removing leading zeroes (0) when labelling in ArcGIS Desktop?

I am trying to do a simple labelling exercise however bit confused how to on how to remove unwanted '0' values. I have field with road number displayed like: 0000647, 000652, 0000000236 I would like ...
2
votes
1answer
277 views

Configuring spatialite database access for Python 2.6.6

I'm working on a GIS project, and I would like to implement and test some geo-spatial algorithms in Python. For this purpose, I will not only need sqlite, but also spatialite, in order to store and ...
-4
votes
0answers
26 views

“UserAnswer” Invalid Syntax [on hold]

i having been making this for for just personal use, but when i run the program it seems to always come up with "Invalid Syntax" for the "UserAnswer" on everyone of them, please help... import ...
1
vote
1answer
32 views

How to save changes in Feature-Geometry with GDAL/OGR and Python? (Segmentation fault)

I have a problem with my code: driver = ogr.GetDriverByName('ESRI Shapefile') dataSource = driver.Open('merge.shp', 0) if dataSource is None: print 'Could not open file' sys.exit(1) layer = ...
0
votes
1answer
497 views

ArcPy SelectLayerByAttribute Error and how to control GP output layer name

I have a rather long script that first references an SDE feature class (non-versioned) to perform an attribute selection based on a SQL selection. I've been unable to figure out why the script will ...
2
votes
1answer
38 views

Python Geospatial Development Error

I'm working through some examples in the Python Geospatial Development book by Erik Westra. On page 439, about setting up a tile map server, he gives the following code for calculating a bounding ...
-4
votes
0answers
29 views

How do i create a simple square polygon from Python through arcpy? [duplicate]

I do not need a google search result because I checked. I need to see a code. This has been super difficult for me. Please help.
-1
votes
0answers
39 views

Error creating polygons with ArcPy [on hold]

Based on the example from this page, running the code below results in an error message. Can someone take a look and tell me what I am doing wrong? import arcpy # A list of features and coordinate ...
1
vote
1answer
92 views

How to export a set of layers into multiple PDF(orAI)files, one layer at a time?

I am completely NEW to PYTHON(only took a 3-hr entry course in ESRI tutorial. I have a dataset contains files named as "1_A, 1_B, 1_C....12_A,12_B, 12_c,....200_A, 200_B, 200_C..etc." I need to export ...
0
votes
1answer
210 views

Orthographic reprojection with mapnik

I am trying to create a google earth like wep application. My problem is that I can't get to render a full view of the earth. The zoom_all() function generates the following error : RuntimeError: ...
1
vote
1answer
24 views

What is a OGRGeometryShadow and why can't I use it in Intersects()-method?

I'm trying to script something with Python and GDAL/OGR and Shapely. What I have: two LineString geometries: "geom1" and "geom2" I made an Intersection: "intersection = geom1.Intersection(geom2)" ...
0
votes
1answer
509 views

OSRM API - nearest point fed into routing

I am using the OSRM API to (1) determine the nearest point on a road segment from a give random point with http://server:5000/nearest?loc=_lat_,_lon_ The returned coordinates are used then as an ...
0
votes
0answers
25 views

Has anyone been able to programmatically generate and post web map definitions to ArcGIS Online and create web maps?

I'm using Python to build an ArcGIS Online web map definition JSON string, and then trying to post the configuration to ArcGIS Online to create a web map. I am using an admin account to generate the ...
0
votes
1answer
49 views

Python Script to Identify and Flip Lines Digitized in the Wrong Direction

I have a river dataset that was digitized both in the direction of flow and opposite the direction of flow. I need to find an automated method to determine which lines were digitized from downstream ...
0
votes
1answer
19 views

With QGIS Plugins/PluginBuilder, how to prevent 2nd instance of Plugin from starting

I am using QGIS 2.6.0, with PluginBuilder 2.0.3 [checking the version, I just noticed that the 2.1.0 update is available] I am writing a plugin; it installs and runs. While running, I am able to ...
7
votes
1answer
236 views

Efficient Network Neighbors?

I would like to identify the Kth order neighbors of an edge on a network, specifically the neighbors of a large set of streets. For example, I have a street that I'm interested in looking at, call ...
11
votes
1answer
489 views

Teaching Python to Land Surveyors

Does anyone have any good examples of using Python to automate or simplify common surveying tasks? I'm teaching a Python/ArcPy lab this week for a GIS class. There are a number of surveying ...
0
votes
1answer
30 views

Python buffer in a line using GDAL

I am trying to make a buffer from a line using gdal. I use the example in the gdal Cookbook import ogr, os def createBuffer(inputfn, outputBufferfn, bufferDist): inputds = ogr.Open(inputfn) ...