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

learn more… | top users | synonyms

1
vote
0answers
4 views

Use Gdal from Python IDE

I am just starting to experiment with writing python scripts. I have been using QGIS and the Osgeo4w shell for sometime now. I would like to be able to call Gdal from the python IDE i have installed ...
0
votes
0answers
8 views

Calculating Odd and Even side of road using PyQGIS and GRASS

I'm trying to programmatically and automatically assign odd and even sides of a road to number homes using QGIS and GRASS. I noticed this other post, which gives a solution using PostGIS and I have ...
0
votes
0answers
11 views

Are there any Python scripts are available for Hydrology to compute watershed Basin from csv file?

Let's say I have surface data available in CSV format (x,y,z). In order to create a watershed basin from surface data, there are some intermediate steps we need to follow. ASCII to surface raster ...
2
votes
2answers
384 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 ...
3
votes
2answers
955 views

How do I remove hyphen from field column

I want to use the Python field calculator to remove the hyphen from a field column. For example, I would like to parse out the hyphen from an entry like "123-45-6789" and read "123456789".
0
votes
0answers
53 views

How to update only non-empty fields with a user input value in a model?

I have a model which iterates through a GDB, populating the same attribute field in every feature class with a parameter value. In this way I can mark all FC's in the geodatabase as to what project ...
0
votes
1answer
35 views

Vector to Raster using GDAL (gdal.RasterizeLayer) : Error in Output Raster(generating output raster with NAN values)

For rasterizing a vector layer, I have tried gdal.RasterizeLayer method for converting vector(shapefile) to raster(tiff). But its giving raster output with NAN values(complete black image). I need ...
2
votes
1answer
42 views

Creating a really large shapefile without eating all the virtual memory

I am doing something similar to below to create a really large (large than memory on my machine) shapefile: shapes = shapefile.Writer(shapefile.POINT) shapes.autoBalance = 1 shapes.field('MyId','N') ...
1
vote
1answer
184 views

Rendering points and polygons with Mapnik

I've tried to render a few maps in Mapnik and I have a little problem. I want to render a map that contains two layers: point and polygon. I've used this script: import mapnik rule = mapnik.Rule() ...
1
vote
2answers
42 views

Arcpy: how to use lists but have differing spatial ref depending on input file?

This is my first arcpy script attempting to use lists. Input: 4 dif Excel files, each with a dif spatial reference Output: 4 dif feature classes (in same geodatabase), each with original spatial ...
1
vote
1answer
27 views

How do I add packages to Standalone Qgis's Python?

I have installed the QGIS 2.8 on my Windows 8.1 system, using the Standalone Installer. I now wish to install the VectorBender plugin. The docs for this plugin say, that I need to install matplotlib ...
1
vote
0answers
93 views

Python code to determine the position on a map using Geo-Tagging

What is a proper python code, which enables to scan photographs (when captured from a series of snapshots) and match it with a geo-tagged image database. Based on the extent of similarities existing ...
0
votes
1answer
6 views

Can you force cartoDB to read a file as a synced table

I'm writing a script that downloads from a data source every hour. I then do some processing on it and convert it to a kml saved in my google drive. As the data is updating every hour I want to be ...
2
votes
1answer
26 views

problems overwriting files in ArcSDE with python script

I'm having a great deal of difficulty overwriting files when using ArcSDE. The usual 'arcpy.env.overwriteOutput' method doesn't seem to work. When I run this script: import arcpy from arcpy import ...
1
vote
0answers
1k views

Using multiple fields for a Reclass calculation in ArcGIS Field Calculator [closed]

I am trying to create a dummy variable from an existing dataset using ArcGIS's Field Calculator tool with a Python script. My conditions require the use of multiple fields to determine the output ...
2
votes
2answers
199 views

ArcGIS Calculate Value tool - Python syntax error

I have a feature class within a file geodatabase. I am using the "Iterate row selection" iterator in Model Builder to read each row in the FC. I am then using the "Get Field Value" tool to read the ...
2
votes
1answer
151 views

ArcGIS Python syntax error using nested if else

I am trying to use the field calculator in ArcMap 10.2 to fill an empty field based on the contents of two exiting fields usint this python script in the Pre-Logic Script Code. def ...
4
votes
3answers
5k views

ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script

I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...
7
votes
2answers
4k views

Troubleshooting ERROR 000989 Python syntax error from ArcGIS Field Calculator?

I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why. I'm trying to create a ...
1
vote
1answer
35 views

Field Calculation Python acceleration of gravity [on hold]

In my problem i have a column DISTANCE and a column TIME and i want to calculate with python in field calculator how much time it needs to make that distance (for example 1000m) if you are moving with ...
1
vote
0answers
105 views

Automated attribute update geometric network

I have a Network Dataset of a storm water system containing two feature classes of points and lines. (All data is topologically sound with pits and pipes snapped and linework captured in direction of ...
-4
votes
1answer
55 views

Python script working incorrectly?

i am writing script which uses different Tools of arcgis and implementing different functionalities .. My script consists in different Functions running in an order. Each function is connected to ...
0
votes
0answers
67 views

Auto-populating more than one other attribute field with values based on value of field within same record? [on hold]

Based on value selection from one attribute field, would it be possible to auto-populate many fields within the same record with predefined values either from a range of values within another field or ...
1
vote
0answers
23 views

Update Data Driven Pages Index layer via Python

I am trying to find a way to update the index layer for data driven pages through arcpy. I understand that to access DDP from arcpy.mapping you need to be referencing a MXD that has DDP enabled. My ...
0
votes
1answer
20 views

How to update raster color ramp with new min/max values using PyQGIS?

I'm trying to update a single band psuedo color renderer with new min/max values from the python console. All the code samples i have been able to find deal with constructing a renderer from scratch, ...
0
votes
0answers
21 views

Checking if Terrain Model has pyramids or data sources using ArcPy/Python?

I asked this question in the Esri forums and got nothing but a lesson on LAS point cloud classifications—not even remotely what I had asked. I’m hoping someone here can point me in the right ...
1
vote
1answer
27 views

Can I mimic the “open” action in QGIS with python and manipulate the field content used for the action?

I am using QGIS actions (type: "open") to link ECM searches to objects on the map. The basic syntax is very simple: protocol://searchterm1=[%"field1"%]&searchterm2=[%"field2"%] However, some ...
-1
votes
0answers
23 views

Flood fill in python

I am quite new to python and programming in general and I am trying to execute some code from a book. The code I am having troubles with should execute a flood fill function on an elevation raster ...
0
votes
0answers
4 views

Load and View Layers with Specific Symbology in QGIS form

I want to create a form to access my desired layers with defined symbology through some push Buttons in QGIS. when you click a button, specific layer with a defined symbology will be shown, Could you ...
3
votes
2answers
1k views

Constructing file path within Python for Feature Class within Feature Dataset?

Based on my understanding of the ArcGIS path structure, a feature class inside a feature dataset inside a geodatabase can be accessed by the following: C:\Menu\Lunch.gdb\Sandwich\Cheese Where ...
2
votes
3answers
2k views

Using if/elif/else statements in ArcGIS Field Calculator?

I have no experience with Field Calculator in ArcGIS 10. I have a very simple calculation I would like to perform that I could do easily via pure SQL but just can't seem to get my head around it in ...
0
votes
0answers
13 views

Populate field by numbering different types of roads using field calculator [duplicate]

I am trying to populate the Func_class field by numbering each type of road in my attribute table. I have different road types such as 'secondary road','local road','main road' see picture etc I ...
1
vote
1answer
134 views

geotiff conversion to coordinate system with gdal

I would like to get the coordinates X Y Z from a geotiff file. I am using the gdal translate for the conversion. Which output format is the more adequate for containing a 3 numpay array X Y Z ?
4
votes
2answers
109 views

How to Parse Unique Address Data

I'm trying to parse some funky address data into separate fields either using ArcMap's Field Calculator or a Python Script. Currently, my address data including street number, street name, and ...
-1
votes
1answer
25 views

NumPy Array to Feature Writes only first array object to feature class

I am consuming a json web-service with NumPy Array to Feature, I have many nested try/except blocks to consume the data/find errors/etc. The script is functional, however I am having trouble seeing ...
3
votes
1answer
252 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 ...
5
votes
3answers
176 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 ...
5
votes
1answer
189 views

How to create a python plugin in QGIS 2.4.0?

While I am learning to create a python plugin in QGIS 2.4.0, I have followed the proceedure expalined in ...
1
vote
1answer
134 views

How to select and zoom in features from a QGIS Python Plugin

I'm very new to Python. I'm trying to find a way to select and zoom to the features from a QGIS layer. I've created a plugin and built a custom form. I have 3 values from the form which I need to ...
2
votes
2answers
1k views

Qgis - Couldn't load plugin 'processing' - name 'QsciLexerCustom' is not defined - Manjaro

UPDATED I receive the following error when I start Qgis: Couldn't load plugin 'processing' from ['/usr/share/qgis/python', '/home/v/.qgis2/python', '/home/v/.qgis2/python/plugins', ...
4
votes
1answer
167 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
1answer
104 views

Is there a quick way to see the fields in a table via arcpy?

I frequently find myself in Python debug mode, trying to examine the fields of a layer or table. arcpy.Describe(lyr).fields returns an array of <geoprocessing describe field object> which isn't ...
0
votes
0answers
31 views

How to reshape a polygon with a hole in qgis automatically?

I am new to qgis and appreciate any help/advice. I have a polygon shp file and some of my polygons are within another polygon (again:they are on the same layer). So I want to split the big polygon ...
0
votes
1answer
724 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
16 views

Can I use Redfearn's formula to convert between WGS84 and UTM?

I have GPS data at 1 point per second for several weeks in WGS84 latitude/longitude form. It was collected using a UBLOX GPS in 2015 in Australia (Zone 55s) Would it be correct to use Redfearn's ...
2
votes
1answer
484 views

How to re-project the EASE (Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree?

I have nc files. from the metadata ,the projection is cylindrical and the resolution is 25 km: indrical NC_GLOBAL#ease_resolution=25 ...
1
vote
1answer
124 views

Python Stand Alone ArcGIS toolbox output feature class becomes input feature class within same tool?

Developing a script in toolbox. I have a table that I use to make X Y layer (input 1) I am saving that created layer as a point feature class. (output 1) I then want to run kriging on that newly ...
1
vote
0answers
56 views

Python vs R for analzing spatial data [on hold]

I am relatively new to both the python and R programming languages, having a small amount of exposure to both. Which language has the edge when working with spatial data and when would you use R over ...
1
vote
0answers
29 views

I am building QGIS 2.6.1 from source code on windows 7, 32 bit and after successfully building all projects I get this error

Couldn't load PyQGIS. Python support will be disabled. Traceback (most recent call last): File "", line 1, in ImportError: No module named qgis.core Python version: 2.7.4 (default, Apr ...
2
votes
2answers
251 views

How to automate performing analysis (intersection) between objects within different feature classes, for large number of objects?

I have two tables of roads - the same roads, from different sources, and am trying to compare how similar their positions are. I'm wanting to buffer each road in one of the feature classes and ...