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

learn more… | top users | synonyms

1
vote
0answers
12 views

QGIS: Action on group of features from layer

I need to implement a rename action on a selected group of features in a certain order. The idea is that I would rename one feature and then select the features that are 'next in line' and execute a ...
1
vote
1answer
19 views

How to convert from .shp to .csv using python and either gdal_translate of ogr2ogr

I am trying to convert .shp files to csv using either gdal_translate or ogr2ogr and python but its not work. if i run the following from qgis its not giving an error but at the same time its not ...
1
vote
1answer
43 views

why does my script not save a layer when it encounters a “ \” character in the string

i have some code that takes a field and finds every unique value in that field. it then creates a layer for each unique value. The code is working ok , but it is failing when there are \ characters ...
0
votes
0answers
36 views

Not matching schema problems when appending a list of CSV's into an existing FGDB table

So far I have the following code for creating the FGDB table and defining fields which works just fine. But when I try to append a list of csv's to this table I always get a matching schema error. Do ...
1
vote
2answers
21 views

Identify Census blocks inside urban areas (using pyshp or similar)

I am trying to find the Census blocks that are inside specific urban areas or urban clusters. The Census Bureau provides a list of urban areas/urban clusters with the following information: | ...
1
vote
1answer
26 views

Writing out comma separated values inside a single cell in a spreadsheet using python

Please excuse the long subject header. I have gotten pretty good at writing data out to csv files but i seem to have stumbled into this block. Anytime a ',' (comma) is used to join values, it shifts ...
0
votes
1answer
26 views

Combining and extracting attributes from 2 columns to populate a third (Concatenate)

I am working with a FEMA flood zone shapefile which contains a FIELD_ZONE field and a SUBTY field. I created a third field called ZONE_TYPE that needs to be populated by combining or extracting ...
0
votes
0answers
18 views

Wrap Legend Text in ArcMap using Python

Is it possible to use Python to wrap text in a legend in ArcMap so that the entire legend element will fit on a page? Here's a screenshot of my problem: http://s21.postimg.org/ss1x2rgpz/before.png ...
0
votes
0answers
16 views

A very small percent of script results come back with “None” instead of Geometry objects?

I have a script that generates a mesh network from vertex and centroid inputs, and it works for almost all my points. But for some records that get created in the feature class for the script, their ...
1
vote
1answer
33 views

Odd Error in Metadata Script

So I developed a script that traverses through a root directory, and any subdirectories and catalogs layers files. Then exports these layer files' FGDC metadata and outputs them to a folder. The code ...
1
vote
0answers
16 views

How to control QGIS from within Anaconda's Spyder (Continuum Analytics Python distribution) in Windows

I would like to control QGIS from within Anaconda's Spyder, in particular use the QGIS core modules. My config: Windows 7 Anaconda 64x for Python 2.7 Spyder 2.3 Postgresql 9.4 PostGIS 2.1 QGIS 2.8 ...
2
votes
1answer
133 views

Python Error while installing Cartogram

I am quite new to GIS and qGIS especially. I would like to install cfarmers cartogram plugin. From what I understand, this has to be done manually - so I 've followed the instructions from ...
0
votes
0answers
14 views

Closest raster VALUE to a given x,y point [duplicate]

Is there a way in ArcGIS to find the closest VALUE in a raster to a given x,y point? There might only be NoData at a certain point, in which case I want to find the closest pixel value. I cant seem ...
2
votes
0answers
16 views

How to access Landsat bucket from Amazon?

I tried to access amazon Landsat S3 bucket with the following python code import boto import boto.s3.connection from boto.s3.connection import S3Connection access_key = <userid> secret_key = ...
2
votes
1answer
56 views
+100

Implement r.cross / ArcGIS Combine with GDAL

I am using GDAL to process a lot of rasters. I then need to combine all the arrays to create a single output raster that represents all the unique combinations of values. I.E the same thing as ...
0
votes
0answers
48 views

UpdateCursor not iterating as desired, updating erroneously

(EDIT BELOW WITH WORKING CHANGES) I have a script in which I am trying to compare attributes in row n to row n+1. If all the attributes match, I want row n+1 to have a field ([Modifier]) updated to ...
1
vote
1answer
288 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 ...
1
vote
1answer
63 views

Change field names automatically

I have an attribute table with over 2500 fields. About 2000 fields start with the name "All_txt_" (eg "All_txt_Watermelon"). Is there a way to remove this "All_txt_" from all the fieldnames ...
1
vote
1answer
43 views

What defines where the files will be saved?

Hi I have a script I am using to save out layers automatically I have posted another question here ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where ...
0
votes
1answer
31 views

How to read landsat images from Amazon S3 using python?

I would like to read and process landsat images from Amazon using pyton thanks,
1
vote
0answers
30 views

How to call QGIS modules (qgis.core) from python idle as I can call arcpy

I was trying to set up path to be able to call qgis modules as it defined in their website Introduction and set PYTHONPATH=c:\qgispath\python . I also try to follow suggestion in link below How to ...
1
vote
1answer
16 views

Using pyQGIS transform a layer of polygons into a layer of holes inside a bbox

I'm using python in QGIS. I have a layer of polygons (its a result of some earlier dissolving and has no overlapping polygons but some holes and islands in holes etc). I want to build a new layer ...
2
votes
2answers
27 views

Controlling default value of arcpy.AddField_management

I have a large collection of shapefiles that use text fields to hold numerical values. I have created new fields, and populated them with the numerical equivalent of the text field. When adding the ...
0
votes
0answers
31 views

ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where Clause

I am putting together some code that makes a layer for each unique attribute within a given field. So if I had a shapefile that contained point data for locations of say postboxes in every city , for ...
2
votes
4answers
87 views

How to get values of last row in table with ArcPy/SearchCursor?

I would like to base my query on the last row of a table? I know the basic syntax/functionality for my search cursor, how do I query only the last row; Below is an example of my search criteria, ...
0
votes
0answers
13 views

OSGeo4W and GDAL - gdal2tiles.py error

Wondering why gdal2tiles is throwing errors, I've added the gdaldata and gdalplugins environmental variables and my python is at Python27/ArcGIS10.3/, and am wondering if that is messing with the ...
1
vote
1answer
19 views

Cleaning shape file with multiple boundaries defined more than once

I have a shape file which contains a lot of polygons which define airspace. These polygons overlap and this is fine (e.g. different airspace configurations for the same airport). My problem is that ...
1
vote
4answers
149 views

Python script for Field Calculator. ArcGis 10.2.2

I have a point shapefile with two columns i want to process. The first column is aspect and the second is aspect_m60, there is only one row with the aspect of my point. I have tried to write a script ...
1
vote
2answers
50 views

Convert a string field to a number field using arcpy

Accidentally posted this in the general stack overflow forum first. I have a large (>1000) number of shape-files in which there are fields containing numbers that are defined as text fields. I need ...
2
votes
1answer
137 views

Loading features attributes into numpy array

I am currently working on an add-on that relies on the user choosing fields of tables (that can be from shapefiles, csv or dbf) that are open in QGIS and then making computations with such data. ...
0
votes
0answers
16 views

Arcpy MakeGraph “Parameters are not valid”

I have a Python add-in that should create a graph based on the location ID of a water quality testing station. The user clicks on the point and a relevant graph should be created in the layout window. ...
0
votes
2answers
39 views

Convert a tiff Float32 image to 8bit tif (or jpeg) image using GDAL and Python

I need to convert a Float32 tiff image to 8bit format in order to display the image in a web page. In order to do that I need a jpg image but this conversion is not correctly done with GDAL because ...
0
votes
0answers
18 views

how to compile a python script (proxy.cgi) in ubuntu?

I want to know please how to compile a python script ubuntu 14.10, I have a file proxy.cgi I want to compile in order to access to the geoserver. when I type localhost/cgi-bin/proxy.cgi, it displays ...
1
vote
1answer
41 views

PyQgis, styling vector layers in different canvas

I'm developing a QGIS plugin and I need some help with styling layers in different canvas objects. In my dialog window I've got two QgsMapCanvas objects canvas1 and canvas2. Layers from registry are ...
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
316 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
24 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
28 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
54 views
+50

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
261 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
23 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 ...