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

learn more… | top users | synonyms

1
vote
0answers
26 views

Link to pdf file through mouse clicking

I need help in identifying the feature attributes displaying a pdf file when click in that feature. I see many examples but I don't have success. I try this code: command = "firefox"; imagerelpath = ...
1
vote
0answers
26 views

Using python libary simplejson and urllib in PostGIS

I installed PostGreSQL9.3 and want to create a Pl/Python function using simplejson library and urllib. First I use OSGeo4W Shell to test the similar python script, it works. Then in PostgreSQL, it ...
1
vote
0answers
19 views

How to write a custom map canvas item by subclassing QObject and QgsMapCanvasItem?

I'm writing a QGIS python plugin where I place some QgsVertexMarkers on the canvas like this: marker = QgsVertexMarker(self.canvas) marker.setCenter(QgsPoint(point[0],point[1])) Now i would like ...
1
vote
0answers
28 views

Why does this python OGR code for creating a layer and then adding a field not work?

Spot the difference! So this works... fp = "C:\\LiDAR\\MyLayer.shp" layer = "MyLayer" driver = ogr.GetDriverByName("ESRI Shapefile") data_source = driver.CreateDataSource(fp) srs = ...
1
vote
0answers
21 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 ...
1
vote
0answers
19 views

Doesn’t cal AGSSOM program to manage AGS mapservices from python script

We are using ArcGISServer 10.0 on a windows server. Because of database management we need to stop several ArcGISServer Services. For this purpose I use the AGSSOM program, which is called from the ...
1
vote
0answers
26 views

Python error message after download (QGIS 1.8.0/ Windows 7)

Hello to all members of the forum, I downloaded from the OSM website a small area in the neighborhood of Strasbourg, France: X (longitude): 7.6808 7.8216 Y (latitude): 48.5075 48.52 I got the two ...
1
vote
0answers
21 views

ExtractByMask with one mask and multiple layers ArcMap

I have a multiple cost distance rasters and multiple feature layers. I need to find and join the feature layers (or associated shapefiles) that lie within a threshold of costs on the cost rasters. For ...
1
vote
0answers
69 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 ...
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
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.
1
vote
0answers
240 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 ...
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
0answers
28 views

Is is possible to run the QGIS python module server side?

I'm pretty new to programming but I want to use the QGIS python module on a server. Basically I am trying to create a JPEG map programatically on a server. I already have a python script to create ...
1
vote
0answers
31 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 ...
1
vote
0answers
46 views

Highlight paths between two points

I'm new to qgis and very sorry if this is a simple question to ask. IS there a way to highlight the available paths (roads) between two selected points in a road map(in qgis) ? I want to find the ...
1
vote
0answers
48 views

QGIS API changes from 2.0 to 2.2

I have the same program running on two different machine, one with Qgis 2.0 and the other Qgis 2.2. The machine running 2.2 doesn't seem to render the map canvas. I thought it was how I has creating ...
1
vote
0answers
62 views

Batch Zonal Statistics to Spreadsheets?

I have a pretty immense amount of Zonal Statistics as Table computations to do, and would love to find a way to grab mean and variance values from the little .dbf tables ArcGIS creates and put them ...
1
vote
0answers
39 views

PyQGIS: How to color raster layer with existing colorBrewerMap

With pyqgis I have added multiple new raster layers to the legendinterface(). Because i like the ColorBrewer style i want to color some of them with the "Spectral" gradient. How can I do this in ...
1
vote
0answers
28 views

Programatically export labels to CAD based on another field value

The problem: I have a fairly simple procedure to export both the polyline features (architectural cad layer) and the ID's (attribute fields from polygon features that fill the rooms in another layer) ...
1
vote
0answers
78 views

Converting GRIB to Geotiff with gdal_translate in Python

I want to extract each band from a GRIB (gridded binary from http://data-portal.ecmwf.int/data/d/interim_daily/) in a single Geotiff image. I´m using Python with gdal_translate in a QGIS backround, ...
1
vote
0answers
64 views

Problem with polygon overlay in raster stats using gdal

I am using the raster_stats module in python to calculate the mean carbon value for different sets of polygons. Here is the code that I am using: africa_sat = ...
1
vote
0answers
74 views

How do I smooth edges of polygons in QGIS?

Is there a built in function or plugin I can use to achieve smooth lines for my polygons instead of the blocky ones I have now?
1
vote
0answers
71 views

Decompress a LZW-compressed GeoTIFF

I have a LZW-compressed GeoTIFF file and would like to split it into several smaller regional files and change the format to png. I tried to do the spliting with gdal_translate -srcwin. I only get a ...
1
vote
0answers
57 views

How can a script tool share (dynamic) variables among different modules?

I'm running a python script from the toolbox window (as a script tool). I have a second python (tkinter) module that I use as an input interface. Now, I know that the script tool can call the ...
1
vote
0answers
56 views

using arcpy to query sde database in python

I have three variables: view_name, column_name, and column_content. column_name contains id, name, address, etc. column_content contains 123, John, 200 King st, etc. user specifies the column_name ...
1
vote
0answers
42 views

model to connect points with line and set the digitize direction according to height

I'm trying to develop a tool that connects a point layer (manholes) with lines (waste water pipes) and sets the line direction according to an height attribute acording to gravity(from high to low). ...
1
vote
0answers
98 views

Running python script outside of Arcmap's python console

My codes works fine in Arcmap's python windows. But when I try to run it in a command promt windows, It says that; ERROR 000837: The workspace is not the correct workspace type. But it works fine ...
1
vote
0answers
70 views

How to use GDAL on Heroku?

I have a geospatial python app that I want to use on Heroku. This is my requirements.txt file: Flask==0.10.1 Jinja2==2.7.2 MarkupSafe==0.19 Werkzeug==0.9.4 gunicorn==18.0 itsdangerous==0.23 ...
1
vote
0answers
125 views

Editing QGIS point layer: retrieve attributes of intersecting line layer

I'm creating a custom editing form using QGIS 2.0 and would like to modify the mouse event when creating a point. I've gotten a start by reading this thread: How to programatically check for a mouse ...
1
vote
0answers
36 views

Changing the symbology of layer when converting from Layer to KML using Python

Is it possible to change the symbology of a layer file using Python? I have a script that creates a layer file and converts it to kml, but every time I run it the symbology color in the kml of the ...
1
vote
0answers
53 views

Batch Clip (Editing Session)

I'm trying to correct some topology errors in my geodatabase, now focusing on two feature classes: grass and buildings. They must not overlap. However, there are plenty of spaces where the grass was ...
1
vote
0answers
73 views

PyQGIS Dialog Plugin not resetting

I have written a PostGIS search plugin that works pretty well, except two things that I just cannot figure out a solution 1) When the dialog closes and then is reopened the previous query is still in ...
1
vote
0answers
72 views

How can I draw features on GeoTIFF in Python?

I have a set of data (coords + value) and want to turn it into a heatmap in GeoTIFF. Should I calculate pixels and set them as array, or there are shortcuts? This is what I do now: driver = ...
1
vote
0answers
21 views

Able to circumvent QgsCredentials script called from Pre-execution

I've got a stored project that, when opened is connecting to my PostgreSQL DB, and is loading several layers. All good. I'm using a script that is called from Pre-execution (Processing/Options and ...
1
vote
0answers
69 views

ArcGIS Geoprocessing Service fails on data loading

I have a Desktop Script tool that works fine when run on desktop, but does not work when the results are turned into a geoprocessing serice. Running ArcGIS 10.2 on Desktop and 10.2 on server. I have ...
1
vote
0answers
191 views

How to use paths with non ASCII characters for subprocess calls with ArcGIS

I know that it is possible to create calls using unicode character encoding like \xf8 for non ASCII characters but how do I do it writing a path in a script just like: 'e:\gis\python_ø\notepad.exe' ...
1
vote
0answers
66 views

Install PyQGIS in virtualenv

Is it possible to install PyQGIS in virtual environment? I want to use rendering capabilities in my own application which runs using virtualenv.
1
vote
0answers
109 views

Publishing esri geoprocessing service - upload custom python modules?

I have an esri geoprocessing service which causes problems when publishing to arcgis server. The python scripts behind the service are structured as a custom python module, in a folder with an ...
1
vote
0answers
37 views

Using the geocode function with cursors

How do I use a cursor with a geocodeaddress function? I want to be able to: 1) read from a table 2) only geocode addresses(from table1) whose street number is not 0 using a cursor 3) then update a ...
1
vote
0answers
50 views

header information is missing from image, after writing using opencv

I am doing complement of an image using open-cv python, while writing the image, open-cv is not writing the header information in the complemented image. my image data are in TIFF format. i am doing ...
1
vote
0answers
242 views

smoothing results from scipy griddata interpolatioin

I am using the griddata interpolation package in scipy, and an extrapolation function pulled from fatiando: import numpy as np import scipy from scipy.interpolate import griddata import ...
1
vote
0answers
54 views

Automate data entry into Access from ArcMap

I have an Access 2007-2010 database that I'm currently working on by manually searching for roads in a defined set of areas in ArcMap 10.1 and then filling in the area's ID in an empty column in the ...
1
vote
0answers
189 views

Watershed delineation; how to program

I've been trying to roll my own watershed delineation program, taking a flow direction grid and pour points as input. I coded up a quick search algorithm in Python which inspects the flow direction ...
1
vote
0answers
65 views

Where are dynamic hyperlinks stored?

A while back (ArcGIS 10.0 times, or maybe even 9.3) a colleague of mine created a mxd with a few hundred manholes and attached dynamic hyperlinks to them (pointing to photos of them). (I know this ...
1
vote
0answers
62 views

Write raster with its attribute table and symbology

I am classifying lots of rasters and I'd like to automate the legend creation and symbology displaying for easy manipulation. Here is the kind of raster I'm dealing with: library(raster) r <- ...
1
vote
0answers
51 views

how to open a layer's table in a map document

Trying to create a map document programmatically. Added a featureclass as a layer. When I open the map document in ArcMap, I want the table for that layer to be open. Found TableView (doc) and ...
1
vote
0answers
138 views

How to utilize GPSQLExpression data type in Python Toolbox

I am trying to write my first Python Toolbox for ArcGIS (neat stuff by the way). The tool is simple enough - it connects to SQL Server and downloads data for the user. The trick here is, I want the ...
1
vote
0answers
156 views

Folium GeoJSON Overlay Not Appearing

I am in the midst of a task which involves the clustering of assessment neighborhoods into larger neighborhoods (data link). The goal is build these neighborhoods in a manner consistent with major ...
1
vote
0answers
93 views

Create custom “Export To” context menu tool using selected feature in ArcCatalog

I'm trying to create a custom "Export To" script similar to the Right-Click Export Content menu item "To Geodatabase... (multiple)". I have a 3 feature classes in a file geodatabase. I selected two of ...