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

learn more… | top users | synonyms

6
votes
5answers
3k views

How to interpolate points along a line in Python for ArcGIS 9.3?

I am building a Python geoprocessing script for ArcGIS 9.3. In the script, I have a simple LINE feature class with one row, one line. How can I use a linear referencing system to interpolate a point ...
1
vote
3answers
318 views

How to place points along a line in a specific offset using python / arcpy?

I have a street shapefile with information about the street name, house number from / to on the left side and house number from / to on the right side. My aim is to create a point shapefile that ...
2
votes
0answers
27 views

Error inserting new column in ArcSDE table (ERROR 999999)

I am using a python script to populate a table with values I get from rasters files. I use arcpy.AddField_management to add a new column and arcpy.CalculateField_management to insert the values for ...
1
vote
1answer
72 views

How to call Exelis ENVI tools with python and ArcGIS?

I am writing a script for geopocessing landsat data using ArcGIS 10.3. But ArcGIS doesn't have tools for landsat calibration (converting from DN to reflectance) and ENVI have this tool called ...
0
votes
0answers
29 views

Python error in array declaration

I am getting a error as follows File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy__init__.py", line 2292, in NumPyArrayToRaster return _NumPyArrayToRaster(*args, **kwargs) ValueError: ...
2
votes
1answer
160 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
3answers
2k views

Possible to add multiple fields in single arcpy statement?

I'm trying to add multiple fields to a table using arcpy and am wondering if it's possible to have multiple fields declared in the AddField management, and their values, separated by commas or ...
2
votes
1answer
60 views

How to configure a available feature types in GeoServer using python gsconfig

How to configure a available feature types in GeoServer using python gsconfig? I have created work space and data store using gsconfig. Now , how i can configure available layers in a exist data store ...
3
votes
2answers
113 views

methods for converting coordinate datum and format in python?

Related to an earlier Q&A of Missing grid shift files for cs2cs.exe? ... what are the various methods to convert coordinate datum and format in python? (Windows Vista, python 3.4) For example, ...
2
votes
1answer
263 views

Setting up pycharm and pyqgis

I wanted to set up PyCharm the way this blog post explains: Setting up PyCharm for PyQGIS and Qt. I did everything as instructed but when it comes to adding project interpreters I got this error ...
2
votes
2answers
1k views

How to calculate volume from a raster file?

I have a raster file containing the depth of water. I need to find the volume of water using that raster file. I need to find the area of each cell and multiply with the depth. How can I do it in ...
0
votes
1answer
25 views

How to convert GeomSHP to WKB

I have imported a point shapefile called site_locations.shp into a personal geodatabase. Now I'm trying to retrieve the data from the database using SQL: dbpath = ...
0
votes
1answer
679 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 ...
5
votes
1answer
124 views

GDAL (or other open-source) equivalent of Arc's Point To Raster Tool

I'm trying to convert a python script that relies on arcpy into one that only relies on open source modules, but I'm having some trouble. The bulk of my processing lies in one Arc tool "Point to ...
0
votes
0answers
24 views

Never get the information about obective interpollation and optical interpollation

I have point data want to interpolate it and convert it into 3d grid format but i am not get any proper information which interpolation i have to used objective / optical. please let me know any ...
9
votes
1answer
202 views

The role of '#' in a python 'if':

I recently exported an ArcGIS model to python and was reviewing the script and am confused by the following line: if TRU_W_DatableFeatures == '#' or not TRU_W_DatableFeatures: I can't seem to find ...
0
votes
0answers
27 views

arcpy.da.Walk not adhering to datatype filter “Locator”

I have a file gdb containing feature classes and address locators. I am listing and storing the names of the datasets using arcpy.env.workspace = "C:\input.gdb" (root, fds, ftrs) = ...
4
votes
1answer
153 views

ArcGis Python Security Concerns

I’m working for a large organization which are using ArcGis Desktop on some (windows) clients. The security requirements for the system is very strict, and a part of that is prohibiting the users the ...
3
votes
2answers
148 views

How to get QGIS to play with pandas (Windows)?

has anybody been successful getting pandas to work with QGIS's Python installation, on Windows? I've used the OSGeo4W installer to install QGIS2.2, which comes with Python 2.7 and Numpy 1.5.1. Any ...
1
vote
1answer
42 views

Stand alone - Python Append (multiple shps from a folder to one dataset)

I have users creating data (shp) daily into a specific folder, I already know how to invoke GP tools to append these data sets into one. What I am trying to do is run a task (which I already know) to ...
2
votes
1answer
147 views

How to split filenames for their first word in Python? [closed]

I have 2 shapefiles, each one placed in a different folder: "C:\...\Folder O\Germany (O).shp" "C:\...\Folder P\Germany Berlin (P).shp" The following script finds the shapefiles and contains a ...
2
votes
1answer
32 views

Clip Point Features to Polygons with Model Builder/ArcPy

Here is the context of my question: I have point features for about 2000 individual trees spread throughout 50 different tree districts. The tree districts are polygons in a polygon feature class and ...
0
votes
2answers
67 views

QGIS from console: raster algebra

I'm newbie to programming in pyqgis. I need to perform a simple "GeoTiff * A" type of calculation(where A is a constant), but I am struggling to do so. I tried ...
0
votes
1answer
28 views

enter coordinates into web form and retrieve results with python

There is a web site that will take XY coordinates and return the closest county/route/postmile within california. I'd like to be able to access the site, enter XY values and retrieve ...
8
votes
6answers
1k views

How to integrate SAGA Python Modules into ArcGIS Desktop?

I have been having a look at SAGA (http://www.saga-gis.org/en/index.html) and it seems to have some nice tools for geoprocessing. I was wondering if anyone out there has had any luck bringing SAGA ...
0
votes
1answer
20 views

raster to point in batch mode using Python

I have a list of raster files in tiff format and I want to convert that tiff to point using raster to point conversion (tool of ArcMap). This tool will convert the raster into a point shape file. I ...
1
vote
1answer
23 views

Plot points on map using Fiona and/or Shapely

I have written a parser in Python that extracts the coordinates out of a GPX file and I would like to view those points on a map. I have done a little research and it seems like either Fiona or ...
2
votes
1answer
46 views

How to use the math tool (“times”) in ArcGIS modelbuilder to multiply two raster sets while using an iterator?

I have two sets of rasters (in the same gdb), representing "loss" and "forestmask". I would like to multiply each forestmask raster (value 1 = forest) with its corresponding loss raster (value ...
2
votes
1answer
143 views

Import error when utilizing QGIS's Python Init function

Based on the answer to Referencing Qt UIs external to plugin with python. I'm trying to utilize the "Layer Properties / Fields / Python Init function" to execute a file (test_file.py) that is located ...
1
vote
0answers
33 views

RGB satellite image in Python with Basemap

Can anyone recommend a workflow or python library that will let me work with RGB images and BaseMap (or something equivalent - could be CartoPy). I have Landsat 8 images, and can load one in python ...
4
votes
1answer
33 views

Dump a GeoJSON FeatureCollection from Spatialite query with Python

Given a Spatialite database, holding a table with a geometry column and some other attribute columns. I want to query that table in a Python script and get a GeoJSON FeatureCollection string in return ...
1
vote
1answer
51 views

Add layer to mxd files ignoring specific item- arcpy

I try to add layer (abc) to several mxd files with arcpy and ignoring mxd file which called "land use" . I work with arcview 10.3 : import arcpy,os,sys,string,datetime import arcpy.mapping from arcpy ...
0
votes
1answer
23 views

Radiometric Indices error

I have successfully included otbApplicaton in my python code. Tested the otb inclusion it is working fine. I am using the following code to generate NDVI output from the landsat image. from sys ...
4
votes
1answer
1k views

gdal ImportError in python on Windows

Trying to import gdal for Python 2.7.3 on Windows XP: >>> import gdal Traceback (most recent call last): File "<stdin>", line 1, in <module> File ...
3
votes
1answer
70 views

Alternative to an arcpy script for points to lines to polygons?

I'm relatively new to arcpy and python, so I feel like I could be missing something obvious in regards to tool options for what I'm trying to achieve. I have a script that creates triangular ...
1
vote
1answer
46 views

Converting multiple File geodatabase (.gdb) into multiple Personal geodatabase (.mdb)

Individually I will Export the gdb to XML Workspace then import that into the personnel geodatabase and all Domains go over fine. But... Let's Say I have several file geodatabase in a folder and Each ...
1
vote
2answers
1k views

Getting print statements in Python script to print through a batch file

I'm starting to learn Python and batch files. I have a Python script which selects data by location and exports the selection to a new feature class. The script runs just fine - included in this ...
1
vote
1answer
151 views

How to do supervised image classification in saga with the help of R script or Python script

I am using Ubuntu 12.04 and want to do image classification in SAGA. SAGA has numerous classification algorithms which is not present in GRASS and QGIS. I am new to SAGA, but more accustomed to work ...
8
votes
3answers
4k views

Using variables from one Python script in other Python scripts?

I want to set up a single python file containing variables that have the locations of all my data sources. This would then be used by all my other scripts, then as a data source changes, I only have ...
4
votes
2answers
206 views

How to access raster NoData value?

I am trying to programmatically access the NoData value in a raster dataset as shown in the screenshot. Two tools that come to mind to describe raster properties do not seem to be able to describe ...
2
votes
1answer
71 views

(How) can I write string data to a raster with Python/GDAL?

In Python, I have a NumPy array of string values (categories of some variable) that I'd like to write to a raster file (.tif or .img) using GDAL. The impression I get is that it's not possible to ...
7
votes
2answers
559 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 ...
4
votes
4answers
501 views

How to get arcpy to work with Anaconda?

I am trying to follow the step-by-step directions in the answer to "how to separate Python installation with ArcGIS" but cannot find the path file, DTBGGP64.pth, in ...
6
votes
1answer
466 views

Histogram Matching Python

I am trying to do histogram matching using Python to improve the mosaicking process of multiple overlapping rasters. I am basing my code on that found at: ...
2
votes
1answer
181 views

Is it possible to run a search cursor on a multipart feature class?

I have a multipart feature class of cities. I want to run a search cursor on a cities feature class where: one city is selected and a select layer by location is run to select all parcels that are ...
1
vote
3answers
3k views

No ogr module despite having gdal installed?

I am trying to use the mapping component of the wonderful PySAL package, but for some reason I do not have the ogr module. I was under the impression that it came packaged with gdal. Am I missing ...
1
vote
0answers
28 views

Identify, get, recover ArcGIS for Server (AGS) user?

Has anyone tried or succeeded in recovering the ArcGIS for Server (AGS) user name used in the connection? I need this because I'm doing some edits to a Enterprise GDB, SQL Server with the same user ...
0
votes
0answers
16 views

How can I create text using Python in ArcMap 10.1

I am using data driven pages to create a map book and I want to create the neighboring labels. Is there a way to create the label with a background? And when there is a NULL value in the attribute ...
1
vote
2answers
54 views

How to assign a unique ID to groups of items in the attribute table in ArcMap?

Using arcmap's field calculator I need to programatically loop through all of the entries in the field and for each name it gets its own unique id. So names that are the same would get the same ...
0
votes
0answers
24 views

What driver should I use when trying to open a Geospatial PDF with OSGEO and Python?

My code is as follows: from osgeo import ogr from osgeo import gdal dso = ogr.Open('myfile.pdf') print dso dsg = gdal.Open('myfile.pdf') print dsg driverGeoPDFogr = ogr.GetDriverByName('PDF') ...