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

learn more… | top users | synonyms

1
vote
0answers
26 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
2answers
123 views

Create an X,Y latitude and longitude grid from an raster

I have a satellite image (LandSat 5), I want create a raster with X,Y coordinates, this is possible in Model Builder of ArcGis 10.0? or other option. I know that the option $$YMAP ($$XMAP) not work ...
1
vote
1answer
47 views

Python syntax error -can't figure out why? [closed]

This should be simple. I hope I don't get down votes! I just got the following code from an article about using Google Maps API and ArcGIS to calculate routes without network analysis and just can't ...
0
votes
0answers
44 views

How to read out the geoPDF data downloaded from USGS ned database?

I am new to GIS, so this might be a stupid question. Google foo din't get me anywhere, so here goes.. How do I read the geoPDF data that I download from the National elevation database from USGS? ...
1
vote
1answer
31 views

QGIS Map tools and Map canvas--QString errors

I'm trying to learn more about using QGIS Map Canvas widgets and creating custom map tools, so the information from the PyQGIS cookbook is very helpful. After trying to experiment with mywnd.py from ...
0
votes
1answer
44 views

Weighted Overlay - passing parameter as text error?

For some reason when hardcoding the save path for the wieghted raster just before runtime it works perfectly. Like such... arcpy.env.cellSize = "90" arcpy.env.workspace = r'G:\Xcel\Route ...
1
vote
1answer
58 views

empty file geodatabase error (nowhere feature class)using arcpy [closed]

i want to import a python(2.7) script to arcmap 10.1 my script has 2 inputs variables one for workspace and another raster dataset and i want o convert input raster as feature class polygon . i want ...
0
votes
1answer
324 views

OSRM API - nearest point fed into routing

I am using the OSRM API to (1) determine the nearest point on a road segment from a give random point with http://server:5000/nearest?loc=_lat_,_lon_ The returned coordinates are used then as an ...
0
votes
2answers
38 views

Output of RasterToPolygon not supported as shapefile

I made a python code for arcGis 9.3 which do the following step : 1) Convert all the raster (.tif) in a folder to polygon shapefile in another folder 2) Intersect all the converted ...
1
vote
0answers
52 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 ...
0
votes
0answers
16 views

How to select Qgis features through Python Plugin

Hi I am very new to Python so this may be a bit basic. I am trying to find a way to select and zoom to the features in a QGIS layer. I have created a plug in and built a custom form. I have 3 ...
2
votes
0answers
62 views

Python problem visualization .tif image

I am trying to read a hyperspectral image in Uint16 .tif format and visualize it. I use GDAL in Python to read the data and everything works perfectly when I use matplotlib to show one band of the ...
0
votes
1answer
62 views

Importing otb into Python

I have Python 2.7 (installed together with ArcGIS 10.1). Via OSGeo4W a have installed qGIS and otb application.I was able to connect qGIS and otb and it's working fine. Through OSGeo installer I ...
1
vote
3answers
114 views

Apply rotation before FeatureToRaster_conversion

I am converting polygon shapefiles to rasters. With arcpy I am using the function FeatureToRaster_conversion. gp.FeatureToRaster_conversion(InFeatures, InField, OutRaster, InCellSize) This function ...
2
votes
2answers
535 views

OSR Python testSR.ImportFromEPSG(4326) returns empty spatial reference

This is empty using Python .ImportFromEPSG(4326): import osr #this fails: testSR = osr.SpatialReference() testSR.ImportFromEPSG(4326) print testSR.ExportToPrettyWkt() #why did the import from EPSG ...
3
votes
2answers
133 views

What's wrong with my IDW interpolation function (Python)?

Original Question Can anyone see what's wrong with my custom IDW interpolation below? I know there are existing libraries that can do this for me, but for various reasons including educational and ...
0
votes
1answer
142 views

Orthographic reprojection with mapnik

I am trying to create a google earth like wep application. My problem is that I can't get to render a full view of the earth. The zoom_all() function generates the following error : RuntimeError: ...
0
votes
1answer
84 views

Error on rendering linestring

I am using Mapnik 2.0.1rc0 on a Windows 7 with python 2.7 32bits inside a GeoDjango App using xml. The datasource come from spatialite 4.0. My tiling script can render polygon and point features ...
4
votes
1answer
139 views

QGIS - Changing Legend Size with Python

In QGIS, I use the python console to generate image files through the composer. In particular, I am creating a map with a legend. The legend is too big. It occupies about 1/8 of the image. I would ...
3
votes
1answer
51 views

Is there a tool to track edits that were made?

Is there a tool/report that keeps track of what edits were made that I could run prior to or after reconciling my versions? This would help me to know if there are any changes I need to make to any ...
0
votes
1answer
25 views

gdalwarp from within python script misbehaving

I'm trying to run gdalwarp from within a python script start = "gdalwarp -overwrite -ts 22 20 -r average -srcnodata 99 " input_file = filename[12:] output_file = "temp1.tif" print ...
3
votes
2answers
42 views

Add row and column name to square grid feature in ArcGIS

I have a square grid feature class of 250 x 250 tiles. This will serve as a tile index for a a project. They currently have no identifying attributes other than a unique ID. I need to add a field ...
-1
votes
0answers
34 views

Removing the same character from the middle of a string in Field Calculator [migrated]

This is the String I have in one column; CO060020N0650W0. I need it to say 2N65W. The second character is '5', sometimes it's '7'. I want to remove just that character from field calculator. How ...
7
votes
1answer
327 views

How to split two interscting polygons by the average linestring of the shared area (QGIS / python shapely)

I have two polygons, POLYGON((-5 -5,-5 5,5 5,5 -5,-5 -5)) POLYGON((1 1, 1 7, 7 7, 7 1, 1 1)) and wish to split them evenly. The result should be a split along the red marked line. I'm using ...
2
votes
3answers
270 views

Adding a new field and calculating area using Python

Using Python, how do you add a new field to your shape file and calculate the area in km2?
1
vote
1answer
255 views

Converting Tab to Shp Using OGR2OGR with Python on linux

First i downloaded http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2ogr.py and i am importing this. How can i get ogr2ogr to run in my script? nothing seems to be working and i not sure ...
0
votes
1answer
25 views

How do I use ogr2ogr with python GDAL? [duplicate]

I've just installed GDAL, but I don't know how to import/use ogr2ogr. I've tried: from osgeo import gdal from osgeo import ogr and searched both for ogr2ogr, but it wasn't there.
2
votes
1answer
47 views

Conditional SQL Query

I've been running a code that searches a desired field in a feature class and performs an specified SQL query based on whether the field is string or double. The variables are just temporary fillers ...
1
vote
1answer
40 views

QGIS 2.2.0.1 Valmiera, Windows 7 64 bit - copying out of GDALInfo-Window in QGIS not possible

When trying to copy information given out by GDALInfo with different kinds of raster data (DEM, normal georeferenced images etc.) through the interface of QGIS 2.2 by right-clicking and choosing copy ...
1
vote
1answer
88 views

How to Average neighboring county data and store in original?

I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
-1
votes
1answer
42 views

define error for python script to import arcmap [closed]

i want to create a simple python script for create one file geodatabase but show me define error # Import arcpy module Import arcpy import sys import os from arcpy import env from arcpy.sa ...
0
votes
1answer
24 views

Better ways to check if GRASS r.water.outlet works out fine output

I use my python script to call GRASS module r.water.outlet from outside, and here's my script(I perform this script in pyscripter): import os import sys #set up GRASS environment variables ...
7
votes
1answer
419 views

What Lidar processing tools are available in Python?

I have been using FUSION and the command line FUSION Lidar Toolkit (LTK) to process Lidar data. A broad Google search ("Lidar Python") yielded libLAS and pyLAS as Python lidar libraries, however, ...
0
votes
0answers
23 views

No data appears when using gdal_calc.py but source had data values

I'm in the process of calculating topographic exposure using a mix of GDAL, grass, R and python in Windows. I need to process a very large tiff file using the following calculation: ...
0
votes
0answers
22 views

TileStache : Unknown geometry type in geoJSON file

I'm currently trying to set up a TilSstache server on Ubuntu 12.04 to serve some GeoJSON tiles from a shapefile/JSON file (administratives boundaries) for a web mapping project using the Leaflet ...
0
votes
1answer
44 views

How to disable “Simplify geometry” via Python?

After I've loaded a layer from a table in my db I'd like to disable the 'Simplify geometry' (found in Layers/Properties/Rendering) programatically using Python. I've tried several versions of ...
1
vote
2answers
94 views

How to extract X Y coordinates and RGB from pixels using python in QGIS?

I'm trying to white a Python plugin in QGIS (2.2) to get, for each pixel of a raster image, its X Y coordinates, as well as, its RGB (3 bands) values. At first I opened the raster file using: rlayer ...
0
votes
1answer
26 views

registering or unregistering as versioned a future dataset with python

As you know, you can store feature classes in arcsde in two ways. Firts, in the root path: sde_conn_file.sde/FeatureClass Second, in a dataset: sde_conn_file.sde/DataSet/FeatureClass How can I ...
1
vote
0answers
60 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 ...
0
votes
0answers
22 views

UnicodeEncodeError when using arcpy.gp.TraceGeometricNetwork_management() [closed]

I am creating a python tool (run through ArcMap) which will eventually go through a feature class selected by a downstream trace and use the obtained values to do some function. I am trying to follow ...
1
vote
1answer
29 views

GeoDjango Scale/Layers issue?

I've been having issues visualising data from a shapefile in GeoDjango using OpenStreetMaps. I believe it's some sort of a scale issue because of how it appears(as you can see in the screenshot of the ...
4
votes
3answers
261 views

Is there any way to get an email when ArcGIS Server services are stopped/down?

Occasionally, but all too often unfortunately, my AGS services just stop for no reason. I don't usually notice this until the users call me and ask why their maps have no data. Is there any way (I ...
0
votes
1answer
55 views

Layer relations via Python

Is it possible to, through Python, to create the relations that it's possible to create in Layers/Properties/Fields/Relations, and if so how? I first thought these were saved in the styles, but that ...
-1
votes
2answers
243 views

How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?

I have a proplem with arc hydro in arcpy,i want to create a simple script where automated some tools from archydro in arcpy.. I use arcmap 10.1 and python 1.7,my import is one dem and my export is a 6 ...
1
vote
0answers
35 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
1answer
112 views

Compare field values and assign a new field to store value ArcMap 10 python

I am currently doing an analysis in Arc Map 10 using python, as I am not familiar with this tool, hence I come here to ask your help. I actually have two shape layers, one is a point layer and the ...
3
votes
2answers
106 views

Fiona: get each feature extent (bounds)

I was looking in Fiona to get for each feature its extent but I didn't find how. I have try to far to do something like below import fiona with fiona.open('countries/ne_10m_admin_0_countries.shp', ...
1
vote
2answers
51 views

Mask image based on no-data pixels in another image with different projection - GDAL or Python

I've got a land cover image which covers the whole globe, and a satellite image which covers a very small part of the globe. These two images have different projections, co-ordinate systems and pixel ...
1
vote
1answer
104 views

How to save after using fet.setFeatureId in pyQGIS?

By using the following code, I want to change the id of the line when saving the line. But the setFeatureId command, gives a false when doing the commitChanges(). Any idea how to change the id? vl = ...
5
votes
1answer
387 views

Does anyone use both ArcGIS and Python(x,y)?

I'm trying to get ArcGIS 10.1 and Python(x,y) to peacefully co-exist with a unified installation of Python. Surely someone else is using both these tools... right? Pointers would be much appreciated. ...