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

learn more… | top users | synonyms

0
votes
0answers
8 views

python code doesn't preserve original range of values from my raster colormap template

I'm working towards an animation or movie of some distributed model output so I need to use a batch process for several hundred rasters that applies a consistent colormap and value range, however the ...
3
votes
0answers
13 views

Send signal when attributes modified - QGIS 2.6

For a QGIS 2.6 python plugin, I am trying to send a signal when an attribute value is changed (values for an existing feature are updated or added and the attribute form dialog is accepted). This ...
3
votes
1answer
29 views

Python output for batch “FeatureToRaster” in ArcPy

I am trying to batch process the conversion of shapefiles to rasters. I am stuck on how to specify the name for each output raster file. Part of the trick is that my input shapefiles are the names of ...
1
vote
1answer
12 views

Why use QgsFeatureRequest() when iterating?

I am unclear on why one should use QgsFeatureRequest() when iterating over a file’s features. Let’s say I would like to print out all IDs in my currently active dataset. Now, most examples will ...
0
votes
1answer
30 views

problem with adding 64-bit background geoprocessing to ArcGIS 10.2.2

My code written in python language using Arcpy works perfectly with small to average size datasets; however, with a big dataset, the script stops in the middle of execution which most likely is due to ...
1
vote
2answers
70 views

Insert.da.Cursor, Error - Sequence size must match size of row

So I'm working on this script which creates a table within a geodatabase. It then grabs the unique values from a list and attempts to insert them into the table using an Insert Cursor. I get the ...
2
votes
1answer
15 views

Python-OGR how update the geometry of a point

I need to change the coordinates (geometry) of some points in a shapefile. I can't find the good method. if ( zone[best_y, best_x] >= ( nb_pixel_area - toler) ) and ( zone[best_y, best_x] <= ( ...
0
votes
0answers
18 views

K-means cluster analysis with initial centers with ArcGIS

I am trying to figure out a way to make a K means cluster analysis using initial centers for the clusters, and only classifying, no iteration, for the features in a feature class. Having a feature ...
3
votes
1answer
34 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, ...
1
vote
1answer
22 views

Adding Origin to Geotiff using Python GDAL?

Alright, so I'm getting closer to figuring this out but I'm stuck at one (that I know of) thing... how do I use GDAL to apply a known origin of a GeoTiff to another that has been processed in ...
2
votes
0answers
24 views

Efficiently generate Voronoi layers in qgis via Python

The following python commands both appear to function when called in qgis 2.6 to generate Voronoi diagrams: processing.runalg("qgis:voronoipolygons", pointLayer, 1, None) ...
1
vote
2answers
29 views

GeoTiff to ndarray

What is the most elegant way to import a multiband GeoTiff as a ndarray using Python? The most common approach I've seen is as follows: from osgeo import gdal arys = [] ds = gdal.Open('sample.tif', ...
2
votes
1answer
63 views

Run processing toolbox outside QGIS in standalone app

I am developing a standalone app in Python, using QGIS libraries including processing algorithms. I am developing in Linux environment and I put the libraries in a folder. Also I put the processing ...
1
vote
0answers
11 views

Ogr Python API: set null values in feature

Im trying to convert OGR geodata from one driver to another, like the command line tool ogr2ogr do, but using the python API. My problem is, that the NULL values in the input data are converted as ...
1
vote
0answers
22 views

Longest Common Subsequence for trajectory matching in Python

Is there any fast implementation of the Longest Common Subsequence algorithm for trajectory matching in Python? Ideally it would work with trajectories of different length in 2d spaces.
1
vote
1answer
31 views

Error using arcpy.da.SearchCursor and MakeFeatureLayer

im trying to write a script that allows me to iterate through my map layers, and for each layer, iterate over each feature and add a field that gives the location of the feature using my index layer ...
0
votes
1answer
46 views

Add field to feature class by location

im trying to write a script that allows me to iterate through my map layers, and for each layer, iterate over each feature and add a field that gives the location of the feature using my index layer ...
1
vote
1answer
47 views

Edit attribute table for shapefiles in folders and subfolders with arcpy?

Continuously to Merge shapefiles in folders and subfolders with arcpy I try to edit attribute table for 20 shapefiles that spread in big a folder and are divided to a lot of sub folders. All ...
0
votes
0answers
10 views

mapserver python mapscript WFS RAW POST data

I installed mapserver-6.2.2 and python mapscript in a Openshift gear (Red Hat cloud). But I can't work with WFS RAW POST data. This is my configure line ./configure --prefix=$OPENSHIFT_DATA_DIR ...
0
votes
0answers
36 views

Tool to create triangle buffer using Python in ArcGIS Desktop?

I want to make a tool to create triangle buffer by python script in ArcGIS, like circle buffer that we use it in ArcGIS Desktop? I need a tool that allows user to input the length of sides of the ...
1
vote
1answer
50 views

Tool to delete all data from a shapefile

I am looking for a tool that deletes the data in the shapefile, and then copy and pastes all the features from a layer into the blank layer. We get updates to our layer from a separate organization, ...
2
votes
0answers
42 views

Overwriting layers in a geodatabase maintaining its position in a feature class list

I'm working with ArcGIS 10. I work on ecological habitat mapping. I have some features classes inside a geodatabase which represent years of data on a specific area. Each has a reliability field with ...
3
votes
1answer
38 views

specifying extent in GDAL's WriteArray

Is it possible to specify the extent when creating an empty raster in GDAL? I looked everywhere, but can't seem to find anything. The portion of my script where I write the raster would look something ...
2
votes
5answers
138 views

Field Calculator expression to replace string only if it occurs

I have two fields (STREET1 & AKA_STREET_TEST1). I'm having a problem creating a simple IF THEN Python statement in the Field Calculator box. I've been searching the threads for a similar ...
1
vote
2answers
41 views

Is it possible to toggle draft mode in ArcGIS with Python?

I'm curious if it is possible to toggle on and off 'draft mode' in layout view in ArcGIS using python scripting. Does anyone have any ideas? Python is preferred, but if there is another solution in a ...
1
vote
0answers
15 views

pymodis download issues

I'm trying to download and process MODIS imagery using pymodis. I have Python 2.7.8 (Spyder), numpy 1.9.1 and gdal 1.11.1. I've also installed WXPython. I originally tried to use the ...
0
votes
1answer
50 views

Python Scripting Error (Adding a Field)

I'm using this code as a python script tool in ArcGIS 10.1: import arcpy, os arcpy.env.workspace = r'W:\S&P\s&p techs\Emily\Errors.gdb' #Looping through dissolved feature classes, adding ...
0
votes
2answers
35 views

Field calculator to copy numeric values from other fields

FieldA contains text: both numeric(123) and alpha-numeric(123a, 2-3, 3/2, '). FieldB is longstring. I want to use field calculator and codeblock on FieldB to bring from Field A only the numeric ...
1
vote
2answers
61 views

How to add 2 layers in qgis and display them at the same time

I added 2 layers in qgis using python but only one layer is shown on canvas. After clicking (anywhere on the canvas) both layers are displayed. layer = ...
2
votes
1answer
31 views

How to plot trajectory points on maps in python

When I read the paper Characterizing Urban Landscapes using Geolocated Tweets, I'm attracted by the figures illustrated in it, like this: And I want to know how to plot these figures for my own ...
1
vote
0answers
32 views

Connect to QGIS 2.6 Python Plugin function via button on custom feature form

I am trying to connect to a QGIS 2.6 Python plugin function via a custom feature form button. On my feature form, I'm attempting to do a few things : enable the updateButton only if the ...
1
vote
1answer
24 views

QGIS 2.6 : Programmatically setting key value pairs for ValueMap widget

Using QGIS 2.6 and Python 2.7 on Windows 7, I am trying to programmatically insert key value pairs into a ValueMap widget via a csv file. Issue is that some of the values are properly inserted and ...
-1
votes
3answers
55 views

Batch Re-projection script syntax error

import arcpy ... sourceWorkspace = "C:\\Users\\tx8p90\\Desktop\\Lesson2" ... targetProjection = "C:\\Users\\tx8p90\\Desktop\\python excercise data\\Lesson1\\contourlines.shp" ... listDataSet = ...
1
vote
0answers
29 views

Difficulty with python package mgrs by Howard Butler

I am developing an app in python and I am trying to import Howard Butler's mgrs package. I am using setuptools to install the package. It does not find the setuptools library module. I have tried ...
1
vote
3answers
40 views

Raster calculator to create single raster with 4 values from two binary rasters

I have two binary rasters showing habitat suitability (0 = unsuitable, 1 = suitable) under current and future climate scenarios. I am trying to create a raster showing: 0 = cells that are not ...
0
votes
0answers
34 views

Restrict text widget to only integer between 0 and 999 in IntraMaps Roam

I have created a form and added an attribute as a Text widget in the Roam manager. Now I'm trying to restrict the input to be an integer between 0 and 999. I want the field to stay "empty" (or ...
0
votes
1answer
52 views

How to show the attribute table of selected features using arcpy?

Is there a way to show the attribute table of selected features using arcpy? Maybe in the mapping module? I would like to be able to select some features and then have an Add-In button that ...
1
vote
1answer
46 views

Load the raster image which is in TIF format using QGIS API

I am quite new inthe field of GIS. I am interested in is to load the raster image which is in TIF format using QGIS API I have followed the steps given the in the follwing link to load shape file ...
1
vote
1answer
28 views

How to reduce area boundaries resolution?

I managed to plot zip codes boundaries for an entire US state using ArcGIS data and python tools such as arcpy and Bokeh. The result: The dataset has high resolution area boundaries so, I have like ...
0
votes
1answer
23 views

equation solving by using python or model builder in arcmap 9.3

I want to solve one formula in arcmap 9.3 by using Python or Model builder. I have one shape file, in that there is in attribute table for field A & B Solve the formula: A*B/Sum(A). where Sum(A) ...
1
vote
1answer
23 views

Couldn't load plugin PRISM due an error when calling its classFactory() method in QGIS1.8 inWin8

When I load a plugin in QGIS ,met some problems : I had tried copy other Python27's files to QGIS's Python 27 file but it still does't work. Couldn't load plugin PRISM due an error when calling ...
2
votes
1answer
37 views

conditional python script to delete records

I am new to python programming. I am wondering if someone could tell me how to write a python script that would find all records in an attribute table that have identical values in one field, then ...
1
vote
2answers
52 views

How do I convert a GeoTiff's neatline metadata from vector format to pixels using GDAL?

I have a GeoTIFF that produces the following when run through gdalinfo: Driver: GTiff/GeoTIFF Files: PAA_1.tif Size is 14400, 6600 Coordinate System is: ...
3
votes
1answer
45 views

Cemetery Grave/Person Locator

I'm a mediocre to intermediate ArcGIS user. I have created several point shapefiles, one for each section of a national cemetery, roughly 200-600 points in each section in a grid. Attached to these ...
1
vote
0answers
40 views

Create polygons enclosing same number of points on PostGIS

I have a geodatabase on Postgis with points representing customers, what i need is give a number of customers, lets say 100 and it need to generate polygons enclosing 100 clients each one. I only ...
5
votes
1answer
62 views

Why the order of imports matters in a standalone PyQGIS processing script?

I've come across a weird issue while running standalone PyQGIS processing scripts. The order of imports in the script affects its normal execution. You can reproduce the problem by opening a Python ...
2
votes
2answers
63 views

Can we no longer reference an ArcMap layer to get the spatial reference?

I'm currently using ArcGIS 10.2.1. In previous custom geoprocessing tools, I've used the following code to create a feature class in-memory, and set the spatial reference using an existing layer in ...
1
vote
0answers
23 views

Trilateration using 3 x,y points and 3 distances, all in cm [closed]

I want to find out the position (x,y) of a given point, knowing the distance from 3 x,y points. Below you can view the x,y coordinates and their given distances in cm. B1x = 795 B1y = 332 B1d = ...
0
votes
0answers
14 views

Adding features to rtree using multiple generators

I am using the Python Rtree library http://toblerity.org/rtree/ I know you can supply a generator function to the Index/Rtree constructor to insert features. How can I add features to an existing ...
0
votes
0answers
29 views

Batch Georeferencing in arcGIS 10.1.2 [duplicate]

I work for a government utility company. Our maps are broken down into 500x500 square meter grids. We have scanned images (TIFF) of these maps that we need to overlay and digize. The maps and the ...