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

learn more… | top users | synonyms

0
votes
0answers
113 views

ST_MakePoint returns an error when using Python

I am trying to use ST_Point or ST_MakePoint to create points from a table of latitude and longitudes coordinates. However I am consistently getting an error even when trying the examples. For example ...
0
votes
0answers
44 views

Search Address (Geocoding), Analyze intersecting underlying layer and return text results

What would the process be for going about accomplishing something like this via a website. Say I just wanted a website form where the user would input their address. Then beneath the scenes it would ...
0
votes
0answers
75 views

Making QGIS custom form modal?

I have created a custom form for entering attribute values for newly added features / editing attribute values for existing features of a shape file. I chose the ui file as "Edit UI" and a python file ...
0
votes
0answers
48 views

How to raise exception from if statement in Python

This is a general python question, I would like to write a function that essentially states if data is available do this, if not raise an error, and a finally block which does something else. In ...
0
votes
0answers
73 views

Is PyQt4 'drag and drop' functionality available in Qgis Plugins?

In Qgis 2.8, is it possible to use the PyQt4 drag and drop classes (dragEnterEvent, dropEvent) to interact with items from a qtreeview, in a Python Plugin? Is it possible to hook into the ...
0
votes
0answers
27 views

How can I create text using Python in ArcMap 10.1

I am using data driven pages to create a map book and I want to create the neighboring labels. Is there a way to create the label with a background? And when there is a NULL value in the attribute ...
0
votes
0answers
38 views

Optimizing shapefile lookup time?

So, I have a ~1GB shapefile which is running circles around a ~5MB shapefile when it comes to feature look-up time (using python, with GDAL): def check(name, lat, lon, attributeFilter:'SQL ...
0
votes
0answers
194 views

Interpolation using GDAL

I am looking for some hints here. There is a shape file with point data of rainfall sampled at a regular grid, and there is a shape file with point data of soil attributes sampled at a regular grip ...
0
votes
0answers
97 views

How to import osm.pbf file into database with Python Imposm

I want to import a .osm.pbf file with the Python library Imposm. Currently my work flow is the following: import requests import os city_name = 'santiago_chile.osm.pbf' url = ...
0
votes
0answers
60 views

Calculating distance from PointGeometry object to polyline in arcpy

I created a PointGeometry object on ARCPY and I'm trying to measure the distance from that point to the closest point on a polyline table.. The PointGeometry object has an easy function for that ...
0
votes
0answers
81 views

Spatial Interpolation/Resampling of Point Surface Data - Axes @ Different Resolutions

I have a simple set of data points in x,y,z format. This was data collected from a ground penetrating radar over a physical distance of: 45m x 25m With a resulting grid of: 90 x 100 (9000 points) ...
0
votes
0answers
37 views

Stopping a route using attributed length

I am working in a project where I need to run routes from several points on a route network and have them stop at a specific length. I have worked out their max distance want to use this attribute to ...
0
votes
0answers
51 views

Mapserver Python Mapscript - Is There An Equivalent to Mapnik's Python Plugin?

I have been developing a sophisticated web mapping app using MapServer in conjunction with the Python MapScript bindings - and it has been working great. However, I am thinking a custom data provider ...
0
votes
0answers
39 views

Bulk Converting Ordnance Survey to Google Map lat lng

Apologies if this is a simplistic question, I am learning! I am attempting to use pyproj with Python. The coordinates I wish to convert came from the Ordnance Survey Integrated Transport Layer. I ...
0
votes
0answers
38 views

Programmatically Add Layer Definition Files (QGIS Python)

I would like to add the same Layer Definition File to QGIS desktop multiple times with a Python script rather than having to make multiple clicks each time I want to add that layer. Can someone ...
0
votes
0answers
44 views

Arcpy save command giving errors

I've been trying to get this to work but for some reason it just keeps failing. Here is a very simplified version of my script: import arcpy arcpy.CheckOutExtension("spatial") #Spatial Analyst ...
0
votes
0answers
140 views

How to read Sentinel-1 tiff images from ESA scihub with Python (and GDAL)?

I can read georeferenced tif images of Sentinel-1 downloaded from PolarView with Python / GDAL but I cannot read the SAFE format from ESA. I need it because PolarView (very nice web interface) keeps ...
0
votes
0answers
34 views

Creating raster from points that conforms to a reference geometry using PostGIS, python, QGIS

Please forgive my ignorance, I'm fairly new to processing GIS data. My bread and butter is statistics but I'm now working on a project that requires more data preprocessing and cleaning than I've ...
0
votes
0answers
56 views

How to query a WMTS layer with a point layer in QGIS?

With the "identify" tool it is possible to query WMTS layers. Then, you can copy the acquired attributes and afterwards the clicked coordinates, then create a CSV file with attributes/coordinates. Is ...
0
votes
0answers
44 views

How to merge grd files programmatically, ideally in Python?

We currently get LIDAR data from the field in grd format. Sometimes this data is overlapping. This data gets fed into a python program that does some analysis. What I'm after is some way of ...
0
votes
0answers
29 views

Password Caching in ArcMap using Oracle accounts

The issue I'm looking for help with is that we have several Oracle accounts through which we host data. For example we have ACCOUNT@ORAC and ACCOUNT1@ORAC (these are made up names as I don't to ...
0
votes
0answers
41 views

How to create custom input widget using Plugin builder?

I am trying to develop a plugin that takes in user input for the time, using the QGIS plugin builder. However, I want to specify the different times the user is allowed to select from when the plugin ...
0
votes
0answers
49 views

How to reload a raster file from the python shell

I do this in the QGIS python shell: # get the raster file (and data) of the active layer canvas = qgis.utils.iface.mapCanvas() rLayer = canvas.currentLayer() rLayerPath = ...
0
votes
0answers
70 views

standard way to write a netcdf4

What is the standard way to write a netcdf4? I'm using this guide http://netcdf4-python.googlecode.com/svn/trunk/docs/netCDF4-module.html but when I dump the output file with ncdump, I get the error: ...
0
votes
0answers
29 views

Suppress values from multiband rasters

I have a raster stack with 84 bands . It is a time series raster. It so appears that the cloud is causing error in my processing and hence i need to suppress or replace them by a NaN to eliminate them ...
0
votes
0answers
102 views

gdal ReadAsArray returning NoneType

I'm trying to read in several rasters as array using gdal in a python script, but I keep getting NoneType returned and can't figure out why. The process is this: 1. Use gdalbuildvrt ...
0
votes
0answers
301 views

Polygon of Voronoi cell using scipy.spatial?

I have points (e.g., lat, lon pairs of cell tower locations) and I need to get the polygon of the Voronoi cells they form. from scipy.spatial import Voronoi tower = [[ 24.686 , 46.7081], [ ...
0
votes
0answers
79 views

web2py - openlayers

I have used web2py and there is test.py under controllers which shows a map as below: and its code is: for url in [ 'http://dev.openlayers.org/theme/default/style.css', ...
0
votes
0answers
49 views

Is there any way to create user login for single project in QGIS?

Is there any way to create user login for single project in QGIS? I want to track changes on database when users update features. I know that I can do this on database level but is there way to do ...
0
votes
0answers
43 views

Invoke PostGIS geocode function using Python

I have a PostGIS Geocoder built with using Tiger data. Using SQL, I am able to execute all database functions and queries. I want to use it with my Python program. One of the option would be to write ...
0
votes
0answers
69 views

copy WFS features to featureclass or shapefile using python

I'm trying to copy the features from a WFS to a geodatabase but cannot use the ESRI WFS tool because the WFS in question only works with the 'prefer HTTP Post, if available' selected in the ...
0
votes
0answers
19 views

Importing XML Schema, Update/Delete Field Names

Presently, I am trying to write a script to import a XML workspace that contains the outline of schema. I want to create a tool/script that allows the user to import it, specify the number of certain ...
0
votes
0answers
31 views

qgis action html

I'm a newbie in QGIS and python. I made a QGIS Action with parameters [% attributename %] that works fine. import urllib2 req = ...
0
votes
0answers
120 views

Create feature class/layer with data in python list

I want to programmatically add a layer to an MXD. The data for the layer is a list of tuples. From I what see, I need to create a feature class with this data (called invalidDataList) Below is what I ...
0
votes
0answers
38 views

True Altitude of GPS cooridnates

Given two points a=(lat1, long1) , b=(lat2, long2). I want to divide the line between a and b into points with equidistant length. (for example 100 Points) For each of these points i need to ...
0
votes
0answers
139 views

Installing Python MapScript Bindings on Windows

I've run into an issue today getting the Python MapScript bindings to behave today. Traditionally, I just use the MapScript bindings that come with the ms4w package. They had been working, although ...
0
votes
0answers
135 views

How to deal with contour error “Exception encountered: invalid index”

I have include vector layer using postgis database with filter(data between two dates) it work fine but after adding when I trying to make a contour from it I get error Exception encountered: ...
0
votes
0answers
186 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 ...
0
votes
0answers
60 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
20 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
41 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 ...
0
votes
0answers
124 views

qgis python error mac yosemite

This problem started when I installed GRASS. I changed one environment variable and then I tried fixing, then I uninstalled egis, grass gdal, then I upgraded to Yosemite, and I still have the ...
0
votes
0answers
48 views

.tif image file cropping

following image has black portion on all side which value is [-inf], that what was showing in ENVI. How can I crop this black portion using that [-inf] value?
0
votes
0answers
38 views

Parameters for CreateFishnet

I´m about to create a fishnet. The CreateFishnet tool has several parameters, between them the origin_coord - The starting pivot point of the fishnetl. Data type of this parameter is Point Now there ...
0
votes
0answers
41 views

MakeXYEventLayer_management input problems

I have a huge excel data base and want to make with the tool MakeXYEventLayer_management a new Layer for my coordinates in my table. I found this code on ArcGIS help: try: # Set the local variables ...
0
votes
0answers
49 views

Training course for Fixing Data Sources

Is there any good training course or literature that pays some attention to automated processes for fixing map documents' data sources? Esri's little documentation on it is not helpful enough for me.
0
votes
0answers
84 views

Copy features to dataset in a loop

I'm trying to write script, that looks at the feature classes in a geodatabase and depending on what the feature class ends with, it creates a new dataset in the geodatabase and copies the file into ...
0
votes
0answers
31 views

increase gdal_polygonize's capacity

I have a very big PNG (82500x40900) with more than 5000 polygons. I want to use gdal_polygonize but the geojson output shows that gdal_polygonizer stopped after 4770 polygons and the geojson isn't ...
0
votes
0answers
31 views

Make qgsmapcanvas.extent().size equal to qwidget.size()

I am using Qt and QGIS to write a touch device application. Right now, I have a QWidget which is the child of qgsmapcanvas, and both of them are full screen. However, the qwidget size is (1920,1080), ...
0
votes
0answers
79 views

Rename open MXD using ArcPy

Is there a method in ArcPy that will rename the MXD you currently have open? I don't what to use mxd.saveACopy("newFileName") as it will just save a COPY with a new name, not rename the current MXD. ...