3
votes
1answer
40 views

Are the functions in OGRPolygon accessible through the python bindings?

I'm currently trying to use the OGR python bindings to process some shapefiles. I want to obtain the number of interior rings in a polygon feature. Unfortunately I'm unable to use the documented ...
0
votes
0answers
35 views

Getting “Segmentation fault: 11” with ogr in Python

This is the code I'm trying to run: In [1]: from osgeo import ogr In [2]: datasource = ogr.Open('testdata.shp') In [3]: datasource.GetLayerCount() Out[3]: 1 In [4]: layer = ...
0
votes
1answer
223 views

OSX 10.9 + QGIS 2.0.1 - Missing osgeo module

Running the following: QGIS 2.0.1 (via Kyngchaos) OSX 10.9 GDAL/OGR 1.10.1 (via Homebrew). Recently, I've become unable to use the OpenLayers plugin, which is complaining that I'm missing the ...
2
votes
1answer
276 views

Clip and copy files to same directory structure using OGR/GDAL with Python

We need to clip all our data (many TB) by a new boundary and save it while maintaining the same data structure. I want to use OGR/GDAL as the data is in shp/tab/kml/geoTif/ecw etc. I can find the ...
2
votes
1answer
146 views

OGR CreateLayer returns TypeError

I'm trying to create a shapefile layer based on the spatial projection of an already existing raster. (Ultimately, this will be used in gdal.Polygonize to get a shape from my raster data.) However, I ...
8
votes
1answer
303 views

Is there a way to properly have GDAL raise exceptions in Python?

I am working with GDAL in Python and have wanted to get GDAL to raise exceptions so that I can do something useful with them. For instance if a file cannot be opened with gdal.Open() I would like to ...
5
votes
2answers
2k views

Point-in-polygon using Python and OGR

I want to use OGR in Python to write a simple point-in-polygon test: def point_in_polygon(point, polygon): """ point : [longitude, latitude] polygon : [(lon1, lat1), (lon2, lat2), ..., ...
4
votes
2answers
506 views

Issues with osgeo - qgis.core and arcpy modules

Is it possible to have the python shell from either qgis or argis to load (import) both qgis.core and arcpy? I am developing a metadata creation tool and have completed the core functionality using ...
10
votes
2answers
2k views

How to add custom Feature attributes to ESRI Shapefile with Python?

I am seeking a way to take an existing ESRI Shapefile that has a Feature set of 200 countries. Each country Feature has an attribute of "NAME." My objective is to create a Python script that adds an ...