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

learn more… | top users | synonyms

0
votes
0answers
10 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 = ...
2
votes
1answer
33 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
10 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
19 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.
0
votes
1answer
21 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
44 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
32 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
9 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
34 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
48 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
36 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
133 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
40 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
14 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
49 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
29 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
30 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
21 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
37 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
30 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
44 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
27 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
21 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
35 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
47 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 ...
0
votes
1answer
30 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 ...
4
votes
1answer
50 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
62 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
22 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 ...
0
votes
0answers
10 views

Loading Oracle Spatial Layers in standalone python qgis

I used below script to connect to postgres and load layers successfully.I want to aceive this using Oracle Spatial for both vector and raster loading.How can I achieve that?In other words what is the ...
1
vote
1answer
39 views

Write GeoJson into a .geojson file with Python

I want to write a geosjon object with the type <class 'geojson.feature.Feature'> into a .geosjon file. Therefore I tried to use with open(test.geosjon, 'w') as outfile: ...
1
vote
2answers
25 views

How can I disable logs being created in standalone python script?

When I run the following script in QGIS 2.6.1, it produces a folder called 'processing', which contains a log, in the directory it reads files from. And since the script reads files from several ...
0
votes
1answer
27 views

Add multiple GDB files in subdirectories to mxd using python

I have GDB files located in many sub-Folders and sub-sub-Folders. All Sub Folders are located in one large directory i asked it for layer file in Add multiple Layer files in subdirectories to mxd ...
0
votes
2answers
32 views

Python column checker-comparing 2 fields

One problem I am having is the following: I want to create an automatic program to see how well the automozation has been with comparing the results of 2 columns to each other in the same column. In ...
1
vote
1answer
19 views

Debugging ArcPy ImportToolBox AttributeError: Object: Tool or environment <ConcatenateRowValues_AA> not found?

First post here. I am trying to use the ConcatenateRowValues tool provided by ESRI. My overall code for my script is working fine except when it tries to use the ConcantenateRowValues Tool. I start ...
0
votes
0answers
29 views

Python scripting error (merge)

I've been trying to use this code to add a field to, merge, and sort multiple feature classes: import arcpy, os arcpy.env.workspace = r'W:\S&P\s&p ...
2
votes
1answer
47 views

How to get shapefile extent from standalone script?

I am trying to obtain the extent of a polygon in a shapefile. I am running a standalone script which will create a grid based on the extent of the polygon. I have tried 2 methods: one from the ...
0
votes
1answer
27 views

Merging multiple feature classes into one using Python

So I have feature classes from an ArcGIS database that I renamed using this Python code: But now I have to merge all the feature classes that are output from this into one feature class named ...
3
votes
1answer
34 views

How to add a column/feature with PyQGIS 2.x?

I'm using PyQgis 2.2 and I'm creating a plugin. I want to add one feature/column to a shapefile. But I get error.. I've tried to do this as it's shown in Cookbook: if caps & ...
1
vote
1answer
45 views

How to perform If Statement in Field Calculator of ArcGIS for Desktop? (Python or VB)

I've one field "MAXSPEED". I want a Field Calculation that will calculate an additional field ("noise"): If MAXSPEED > 40 then the term: (73.5 + Log ( 25 ) * ( [MAXSPEED] / 50)) should be used to ...