The OGR Simple Features Library is a C++ open source library (and command line tools) providing access to vector file formats.

learn more… | top users | synonyms

5
votes
1answer
327 views

GDAL.RasterizeLayer not ported to the C# bindings?

I am trying to use the OSGeo.GDAL.Gdal.RasterizeLayer(…) from GDAL 1.9.2 and it requires some SWIGTYPE parameters: OSGeo.GDAL.Gdal.RasterizeLayer( OSGeo.GDAL.Dataset dataset, int bands, ...
3
votes
0answers
48 views

How do I get the domain from an OGRSpatialReference?

I would like to know what the projected bounds are for a spatial reference using OGRSpatialReference. Is there some way to use the GetProjParm method to get this information? An example of what ...
2
votes
0answers
69 views

Can OGR handle Esri's Geodatabase extensible markup language (XML) files?

The USDA Forest Service distributes GIS data as Esri Geodatabase extensible markup language (XML) files. I downloaded one in the hopes that I would be able to convert it to something less esoteric ...
2
votes
0answers
44 views

Append ArcGIS feature layer data using GDAL/OGR API

ArcGIS servers are configured with a maximum records count that they're allowed to return following a REST query. This maximum is usually 1000 records, which means that GDAL/OGR clients should ...
2
votes
0answers
269 views

ogr.GetDriverByName('FileGDB') returns None

I installed: gdal-110-1600-x64-core.msi GDAL-1.10.0.win-amd64-py2.7.msi gdal-110-1600-x64-filegdb.msi from www.gisinternals.com I can open my gdb on the command line: C:\data>ogrinfo ...
2
votes
0answers
101 views

traversing KML files with ogr python

i'm new to OGR processing and KML format so be gentle: i've got a series of KML files all containing multiple regions partitioning a larger area in each. i also have a series of geocoded points for ...
2
votes
0answers
84 views

Custom python datasource to QGIS

I'm working on a homebrew spatial feature data format, and using Python to write it's API. It occoured to me that use some tool like QGIS to display my data would be very nice to have, for debug/test ...
2
votes
0answers
125 views

Ogr: How to add layer description to dgn?

I have created a dgn-file using Ogr, but can't find a way to fill out the description for this layer programatically. (something like _dgnLayer.Description = "Highways") opts.Add("SEED=" + ...
2
votes
0answers
404 views

OGR VRT MSSQL example

I'm trying to import vector data into SAGA GIS from a SQLExpress 2008 server. Firstly is this possible? I would have thought using an OGR VRT layer would have been the way to do it, I've attached a ...
1
vote
0answers
27 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
10 views

QGIS view bounding box on Add vector layer GeoGSON protocol?

Our server can serve GeoJSON with an optional bounding box HTTP parameter. e.g. http://our_gis_server.org.au/layername?bbox=xmin,ymin,xmax,ymax In QGIS I can add this vector layer as a Protocol and ...
1
vote
0answers
11 views

Asking about OFTInteger data type in OGR/GDAL?

I created the shape file by using the feature field type: OFTInteger. But when I open the file in Arcgis (ArcCatalog) the data type is: Double (not integer). Do you know how to fix this (I want it ...
1
vote
0answers
85 views

Using ogr2ogr to download GeoJSON files from ArcGIS MapServer

I am trying to download as a GeoJSON file a line feature from a ArcGIS MapServer REST Service run by the National Park Service (link is here) so that I can open the data in QGIS. Using the guide ...
1
vote
0answers
30 views

Transformation of OGR style data

I have been using GDAL/OGR in a project and it is going quite well. I have been re-projecting data from various source formats into a single CRS (using the C# bindings), but one issue I have come ...
1
vote
0answers
84 views

How to compile QGIS with Oracle Spatial support for Linux?

I compiled it on Fedora and Ubuntu, but got error "Cannot get Oracle select dialog from provider." while trying to add Oracle layer. Packages in repositories don`t have oracle spatial support. Can ...
1
vote
0answers
304 views

Importing Census TIGER Shape Files to SQL Server 2012?

I've been doing my research on how to import shape files into Microsoft SQL Server 2012. and am still unable to figure out how to do it after hours of playing around with it. I'll document what I've ...
1
vote
0answers
61 views

What is the best way to handle geometries between Python functions?

What is the best way to handle geometries between different Python functions? For example: I have a function that exports a line from grass.script. The line will be a parameter of another function ...
1
vote
0answers
49 views

Why is the performance of ogr methods different on different OS?

This question actually comes forth from an earlier question of mine . A short introduction. I was writing a program that performs near analysis and creates buffers for a set of points. On my Linux ...
1
vote
0answers
81 views

How to join attributes by location with command line

I would like to joint the attributes of 2 shapefiles by location but with a command line (linux). This feature is easy in QGIS but it is VERY slow. Is there a way of doing this with ogr or pyqgis ? ...
1
vote
0answers
126 views

How to shift vertices of shapes in shapefile using FOSS python library?

I need to shift each vertice of shape in a shapefile (of any type:point, line, polygon, multiline etc.) with Python. I need to loop in all shapes, get the vertices, get it's coordinates and for each ...
1
vote
0answers
87 views

Gdal/Ogr - OGRLayer.Intersection() Question

I was trying to perform intersection on two feature classes (shape file format) using OGRLayer.Intersection(), but have problems making it work with C# bindings. I am not able to figure out on how to ...
1
vote
0answers
86 views

Python GDAL/OGR: check lines geometries connectivity

I'm working with shapefiles representing roads, so basically it's stored as (poly)lines. I need to perform a road connectivity checking. In other words, I want to ensure that roads meant to ...
1
vote
0answers
45 views

how to get correct geo reference system for a VMap

I am new to GIS, trying to read the GeoRef System for VMap by using the following code: OGRSpatialReference *ref = layer->GetSpatialRef(); if( ref ) { QString georefSystem = ...
1
vote
0answers
308 views

OGR-Driver GML axis order handling (GDAL, QGIS)

By default the OGR-Driver will swap the axis order to longitude, latitude for geographic coordinate systems. "Since OGR 1.8.0, the GML driver has coordinate system support. This is only reported ...
1
vote
0answers
189 views

Naming layers in DXF using OGR2OGR

We have been using ogr2ogr to export data from PostGIS into DXF. Using the default behaviour of the export, all data are put into layer '0'. We would put data into a layer name from the PG table name. ...
1
vote
0answers
585 views

How do you format an OGR VRT file to best convert a CSV to KML?

I am attempting to get a nice KML for simple review of POI/geocoding from a CSV. I a using ogr2ogr and a vrt. You can see the vet file below, with two attempts to get this right. Basically, the issue ...
1
vote
0answers
292 views

ogr2ogr failed to reproject shapefile error exceeds limits

I cannot get correct transformation from WGS84 to the Hungarian EOV EPSG:23700 (Hungarian Datum 72) using ogr2ogr. I am using ogr2ogr from the fwtools shell. I have a shapefile in GCS WGS84 (epsg ...
1
vote
0answers
121 views

Is Django's LayerMapping capable of putting a static value into all features?

I'm using GeoDjango's LayerMapping utility to try and import a set of features. The catch is that aside from the attributes in the source layer, I want all the destination features to have the same ...
0
votes
0answers
15 views

Exporting ArcSDE feature class to shapefile using OGR?

I'd like to export data from ArcSDE for SQL Server to SHP. I've tried first to run this python script in QGIS: http://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_sde.py But finally I've got ...
0
votes
0answers
25 views

SetSpatialFilter worked unexpected when using ogr by python

I am using ogr python binding to read the shapfile, this is the code: ..... bbox="POLYGON ((20.18164062 30.63867188,20.63867188 30.63867188,20.63867188 30.18164062,20.18164062 30.18164062,20.18164062 ...
0
votes
0answers
23 views

Comparing datums with GDAL/OGR

I have a bit of code in Java that takes in a SpatialReference object and checks that it is one of the acceptable datums (WGS84, NAD83, NAD83 HARN, NAD27), but because of the lack of standardization in ...
0
votes
0answers
26 views

GeoJson attributes encoding limitation

I have problem when trying to encode attribute values in latin1 using ogr GeoJson driver. Accent char are not displayed correctly. Is the geoJson encoding is limited to UTF-8? I cant find any info ...
0
votes
0answers
59 views

aggregate counts on a grid and determine grid adjacency

So here is the problem I am working on. I have a bunch of lat, long coordinates for event occurrences. I want to create a grid and then count how many points fall into each grid pixel. Once I have ...
0
votes
0answers
15 views

ogr: confusing results from `SetSpatialFilter()`

My layer is derived from a data source like this: l_131 = bounds.ExecuteSQL("select * from 'nam_l' where 'ND_5'= 131 ") feat = l_131.GetNextFeature() feat.GetFeatureCount() >>> 200 It is a ...
0
votes
0answers
25 views

Does a road connect one grid cell to an adjacent grid cell?

So here is the problem I am working on. I have an OpenStreetMap roadmap which I overlaid with a 2-D cartesian grid. So for a given grid square, I want to find out if a road segment continues from the ...
0
votes
0answers
60 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
0answers
77 views

GEOS assertion failed

The following script fails, if I import the 'rasterstats' library. import rasterstats import ogr geom1 = ogr.CreateGeometryFromWkt('POLYGON ((415924.806155724043492 ...
0
votes
0answers
160 views

Compiling MySQL and Sqlite drivers for GDAL/OGR 1.10.1

IF YOU WANT SHORT QUESTION GOTO QUESTION SECTION I have builded GDAL 1.10.1 with the instructions in BuildingOnWindow. By the default OGR drivers dont support MySQL, PostgreSQL/PostGIS, Sqlite, ESRI ...
0
votes
0answers
122 views

Running OGR conversion to dxf within QGIS

I would like to automate a conversion process which converts a polygon vector dataset (either sqlite or shp) to a dxf using a named column as layer name for the dxf file. The column / layer name is ...
0
votes
0answers
36 views

How to retain crs data when datum-shifting using ogr2ogr?

I'm converting a shapefile from OSGB36 to WGS84 using ogr2ogr like so: ogr2ogr -f "ESRI Shapefile" new.shp original.shp -s_srs EPSG:27700 -t_srs EPSG:4326 However, the original contains the ...
0
votes
0answers
32 views

How to split a feature using GDAL

I want a feature to be cut into 2 or more based on deviation of a segment i.e., the angle between 2 successive segments. At places, I may also require to merge 2 or more features.
0
votes
0answers
69 views

How to use projection of a shapefile in order to have a better view in OpenGL

As you see here, this is the code that I have used to extract vertices of ESRI shapefiles in order to show them with OpenGL. I have also uploaded my project here, if you want to give it a try and see ...
0
votes
0answers
108 views

How to access vertices in a polygon layer using ogr library with c++

up to now I have tried these classes in order to extract the vertices of polygons: OGRPolygon : It doesn't have any method to get number of vertices, start point and end point. OGRLineString : ...
0
votes
0answers
144 views

How to read vector datasets using GDAL library

Up to now, I have used GDAL in order to read raster information and geotiffs and show them with the help of OpenGL. Now I have a vector dataset, and by that, I mean I have the files with types: DBF ...
0
votes
0answers
52 views

OGR: How to control the spatial reference of a layer?

I want to use a subset of a shape for a spatial filter. The filter returns 0 features which is unexpected. So I was checking the spatial references of the layers and one of them seems to have none. ...
0
votes
0answers
217 views

GDAL/OGR to extract pixel values

I want to use GDAL/OGR to extract pixel values from a raster file. The extraction should be based on polygons, stored in a shapefile. My thought was to iterate over the features in the shapefile, ...
0
votes
0answers
202 views

What does OGR “driver not loaded” mean when connecting to SQL Server through QGIS?

All, Using QGIS 1.8, SQL Server 2012, and OGR 1.9.2 (also fails on our SQL Server 2008 sandbox machine) When creating a connection in QGIS I'm getting the following errors: Ubuntu 12.04 Driver ...
0
votes
0answers
50 views

batch clipping code produces some shapefiles containing no features

#MASS CLIPPING (ogr2ogr) #Stefan Safranek #Shape Files by US-States import os, glob import subprocess from osgeo import ogr # Input folders saveFolder = "C:\\Users\\Stefan\\Desktop\\experiment ...
0
votes
0answers
71 views

Confusing offsets in shapefile written by QGIS/OGR

I think I'm stuck here. A shapefile has been updated in QGIS. Records have been deleted and those records have been marked with an asterix in the first byte of the record in the dbf file. I open the ...
0
votes
0answers
113 views

How to check are there any OGRGeometry (polygons) within an OGRGeometry (polygon) ?

Please see my image: I used the below statements to get Geometry: OGRGeometry *poGeometry; poGeometry = poFeature->GetGeometryRef(); Do you know how to check whether the Polygon 1 ...