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

learn more… | top users | synonyms

0
votes
1answer
81 views

“EOFError: EOF when reading a line” Using raw_input() in ArcMaps Python Console [duplicate]

I am writing a python script to automate some ArcMaps data processing. I am getting hung up at raw_input(). I am using raw_input to get input from a user. A folder will be created with the folder ...
0
votes
0answers
27 views

How do I install PyProj module for Python 2.7 on Windows 7?

I am having trouble installing the pyproj module for Python 2.7 on Windows 7. I have tried both the 32 and 64 bit installers from this list but the install crashes each time I run it. I have the ...
1
vote
0answers
68 views

Using qgis modules in standalone application with PySide?

I want to make small standalone application using PySide and QGIS python modules to display satellite images and do standard GIS operations, like creating new shape file and placing polygons or points ...
0
votes
0answers
47 views

How to write a signal for 'QgsMapCanvas::xyCoordinates (const QgsPoint & p)'

I am very new to QGIS and python. I am writing some python codes and I want to capture the x,y coordinates when the cursor moves on the map layer. (same as the coordinates show in the QGIS status bar) ...
0
votes
0answers
18 views

Plugin Ui interation with user and Qgis

A downsized hydrogeology plugin ( GraphicGroundwater = GGW ), instilled the need of a reduced combination of Carson's 'fTools doVectorGrid' and Pryet's 'Qgridder' plugin(s). The GGW Ui is displayed ...
1
vote
0answers
28 views

Disable customized context menu for some cases using python

I create a python add-in tool to add new item to the context menu, but I want the new item enabled only when user right click on map when within a buffer of polyline feature. I haven't figure out how ...
1
vote
2answers
66 views

Edit Field Value of Feature Class Using Python in ArcGIS 10.2

I have a feature class whose attribute table looks like this: Latitude | Longitude | Area For the area column, all rows are null. I would like to put in a specific value for all rows using Python. ...
0
votes
1answer
46 views

Using os.walk to update broken links and save mxd

I've got code to walk through an entire directory and sub-directories repair broken links in each mxd and save the mxd. It works for the mxd's in the top directory but fails when trying to enter any ...
2
votes
0answers
40 views

Create a simple WPS client

It looks like the only way to get flat files/data from a WPS service is to use a client. I'm looking to create a super-simple WPS client in Python 2.6 (or other language) without any dependencies on ...
2
votes
0answers
39 views

how to make a list of features constructing the dissolved feature?

I need to simplify my road network using the dissolve function to remove nodes not occurring on the intersections. the following code is doing that. arcpy.Dissolve_management(self.address_cor_layer2, ...
3
votes
1answer
69 views

How to develop a Toolbox intended to be distributed in multiple version of ArcGIS?

I am currently developing a Toolbox for users who will use it in different versions of ArcGIS (10+ versions). Is there a recommended way to proceed in that situation? My main concerns about that are: ...
1
vote
1answer
46 views

Python geoJSON module create a FeatureCollection with CRS, QGIS doesn't recognize CRS

I am curious if my geoJSON created with the geoJSON python module has a valid CRS. The manual on github specifies a feature collection like so: from geojson import Feature, Point, FeatureCollection ...
0
votes
1answer
50 views

How to access the map coordinates show in QGIS status bar?

Is there a way to access the map coordinates show in qgis status bar? I found only this, iface.mainWindow().statusBar().currentMessage() But I know it's not the way. Or is there any way to capture ...
0
votes
0answers
19 views

ArcObjects open report wizard

ArcMap provides a function to create report and after the creation can save as different formats. Now I want to allow user to skip the intermediate steps. I want do the report function using ...
0
votes
0answers
26 views

SST process using just GDAL and python

I am trying to process AVHRR 4km SST using a module that uses only GDAL and Python. OSGEO4W, GDAL, Python 3.4.1. I borrowed the download code from http://grasswiki.osgeo.org/wiki/AVHRR. The rest I ...
1
vote
0answers
28 views

How to export the legend (Layers Panel) as an image in QGIS using the Python console?

I want to export the Legend (the Layers Panel) as an image using the python console.
0
votes
1answer
48 views

Cause of ArcGIS Raster Calculator Parsing error <type 'exceptions.SyntaxError'>: invalid syntax?

This is my first attempt at much code in the raster calculator of ArcMap 10.0, but I think I'm close. I have nine rasters (A-I below) and want a new raster with value = 1 where any of the rasters ...
1
vote
2answers
44 views

Running a Focal Mean or Low Pass Filter or 3 by 3 Mean Kernel in GDAL \ gdal_calc

Hi I am looking to run the equivalent of Focal Statistics in gdal_calc. Is it possible? It is a simple focal I require. I need to run a 3 by 3 kernel over the data (mean) and if possible only on ...
1
vote
2answers
34 views

finding the index of a field with its name using arcpy

I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop. import arcpy fieldList = ...
3
votes
2answers
115 views

How to select all files in a directory for merging in Processing?

I'm writing a generic script which involves writing shapefiles to a directory which are then merged together. After writing the files out to the Output folder, I'm trying to get the ...
0
votes
2answers
65 views

creating many shapefiles from one multi-polygonal shapefile

Does anyone know of a way to create a standalone shapefile from every entry (row) in the attribute table of a large set of polygons (4909 in total)? preferably using python in a way that the results ...
0
votes
0answers
22 views

Use python to execute GRASS module v.distance

I have successfully use python script to import a line shapefile and a point shapefile into GRASS, and the following are their attribute table in QGIS, line shapefile point shapefile Now I want ...
1
vote
0answers
238 views

How can I get all the latitude, longitude coordinates/points inside a rectangular polygon drawn in google maps?

Google maps lets you obtain a valid address by clicking on houses or buildings one by one, but it would be much easier if you could draw a polygon on the map and get a list of all valid addresses ...
0
votes
3answers
112 views

Calculating distance between points using ArcGIS Desktop?

I want to write Python syntax to calculate the distance from point to other points in the water network and so on for others, I have 21 points. I need distances have to follow the network That ...
2
votes
2answers
113 views

Convert a Toolbox (.TBX) to a Python script (.PY)?

I have a .tbx tool box, which runs a script that is incredibly slow. So what I want to do is to open the python script that is running below the .tbx and make some changes or perhaps write something ...
1
vote
1answer
69 views

Problem loading spatialite extension with sqlite3 Python connector

I am trying to load the Spaltialite extension using SQLite3 python module. I am getting the following error when I run my script. EOFError: [Errno 10054] An existing connection was forcibly closed ...
1
vote
1answer
57 views

How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?

My python application makes heavy use of the osgeo library. We're looking to upgrade from PostGIS 1.5 to PostGIS 2.1, and I'm having issues. I'm installing packages from the Ubuntu GIS PPA. Before, ...
0
votes
0answers
38 views

pyspatialite, cannot update geometry

I'm trying to update geometry column with pyspatialite but it returns error: spatialite.dbapi2.IntegrityError: mypoints.the_geom violates Geometry constraint [geom-type or SRID not allowed] My ...
0
votes
1answer
46 views

gdal_calc.py raster reclass equivalent of ArcGIS reclass or r.reclass in grass

Would like to achieve this in gdal_calc.Py if possible. I have a raster with a value of 0-7 in GTiff I would like one output raster where NoData = 0,1,2,3 1 = 4,5,6,7 So basically an ArcGIS ...
4
votes
1answer
96 views

Can I use a QGIS geometry in a Python PostGIS query?

I have a "Python Init function" for the attribute form in QGIS, which is called when I add a new geometry. I can access the geometry of the newly created feature like this geom = feature.geometry() ...
0
votes
0answers
40 views

How to delineate Watershed from DEM in python?

My question is that without help of arcpy how can I delineate watersheds from DEM? If anyone help me upto catchment delineation it will be very helpful to me
-1
votes
1answer
51 views

Convert Road layer shapefile into a graph

I'm going to use Astar algorithm to find a path between two selected points.And I used the following code for that.Is there any way I could convert my Road Layer shapefile into a graph, which can be ...
1
vote
0answers
92 views

QGIS 2.2.0 GRASS not worked

I use QGIS 2.2.0 on Windows 8 64 bit. I try to install use Standalone installer and OSGeo4W and still get the error And then i start GRASS C:\Program Files (x86)\GRASS 6.4.2>grass64 ╬╪╚┴╩└: ...
1
vote
1answer
79 views

flatten / collapse one-to-many table and keep the 'many' attributes separate

I have a data set that contains intersection data. Each intersection node has up to 6 links which is identified by IN_LINK and OUT_LINK attributes. I want to create a new dataset that includes the ...
1
vote
2answers
48 views

Problems searching for attributes

I've come across this problem a few times and have not been able to find a satisfactory answer. I am new to python though so perhaps I have not been looking in the right places! Anyway, In ArcGIS I ...
1
vote
1answer
38 views

How to add an interpolation raster from the python console in QGIS?

I'm trying to add an interpolation layer based on an existing vector layer by using the Python Console (initially in the menu Raster/Interpolation), but can't find anything related in the ...
0
votes
1answer
29 views

Set the parameter values retreved from database in Arcgis script tool in toolbox using python [closed]

I am now thinking a function to allow user to modify his information stored in the database. To do this, I developed 2 script tools in ArcGIS(10.2), One is the ask user to input his ID, the other one ...
0
votes
1answer
55 views

How to open QGIS using VBA?

Using VBA, I want to open QGIS (the actual GUI) and execute a simple script through the Python console or the editor.
0
votes
1answer
47 views

Change Attirbute Name (Fiona)

I have a shapefile that has 2 attributes named "X" and "Y". I want to change this to "Lon" and "Lat". My (limited) experience tells me that I should read in the original shapefile, preserve the ...
0
votes
0answers
31 views

Assigning a changing value to a variable in ArcMap using Python

I have two lists/strings/sets (the exact format can easily be changed) of values (u and v). I would like to do a cost distance analysis between each point in u and all points in v. For this, I need to ...
0
votes
2answers
109 views

How to make a routable graph from a Point and a Line shapefile, using Networkx?

I have one shapefile which consists of all the streets in the study area, and another shapefile which has points representing origins and destinations. I would like to know if it's possible to find ...
0
votes
2answers
66 views

Generating multiple visibility bearings in ArcGIS as automated procedure?

As a relative newbie to GIS, I'm quite sure there will be a way to do this in GIS (probably most efficiently by writing a python script!) but (to me anyway) this is a fairly complex thing to do and I ...
1
vote
1answer
102 views

How to make a Python script that does a task in QGIS?

When I run this code in QGIS Python console it works fine, but I want want to run it from an external Python script. What I want the script to do is: 1- Open QGIS 2- Run this code 3- Close QGIS from ...
1
vote
2answers
74 views

Open source, Python option for Arcpy's Con tool?

I'm wondering if there is a method to perform a function similar to Arc's Con tool, using open source options in python. I have two rasters, one that shows locations of clouds and the other is just a ...
0
votes
1answer
87 views

Writing shapefile with projection defined crashes fiona

I've just started trying to use Fiona to write out shapefiles. I found the example code below, which seems to work fine from shapely.geometry import mapping, Polygon import fiona # Here's an example ...
0
votes
1answer
32 views

QGIS Python - Executing functions for multiple directories

I would like the user to select 2 directories, each directory having their own defined algorithms. For example: First_Directory will add a column to all shapefiles in the chosen directory; ...
2
votes
1answer
114 views

Converting Matplotlib contour objects to Shapely objects

I would like to convert a Matplotlib contour collection to a Shapely geometry collection, in order to calculate the area contained within closed contour lines. it seems that all the information is ...
1
vote
1answer
51 views

how to assign keyboard key to python script in arcmap

I have a python script and I use it through my toolbox but I use it many times in a day. Is it possible to assign a keyboard shortcut to my tool ?
3
votes
1answer
63 views

Help with “projected XY to screen xy” conversion algorithm?

I'm trying to convert coordinates from any given coordinate system (be they the coordinates of a graph figure or a map, meaning they can span across both negative and positive values across any of the ...
6
votes
1answer
74 views

Competing approaches to line & polygon simplification

There seems to be a few theoretical options around at the moment for geometric simplification. Douglas–Peucker seems the most established, followed by Visvalingam's approach (used by d3.js). Now ...