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

0
votes
2answers
76 views

Will .sbn and .sbx files (spatial index) speed up operations in GDAL/OGR?

I'm trying to intersect large datasets in OGR and python using SQL queries like ST_Intersects and ST_Contains. These operations run very fast in ArcMap but I'm designing a system to automate them, ...
0
votes
0answers
24 views

OGRGeometry::exportToWkb return buffer empty

I would like to export OGR Geometry in WKB format. I used the function OGRGeometry::exportToWkb from OGR. The problem is that the buffer returned by the function is empty and OGRERR_NONE is always ...
8
votes
3answers
1k views

How to stop writeOGR from abbreviating Field Names when using “ESRI Shapefile” driver

I'm currently using the following script to add some attribute data from a table to lots of individual shapefiles: library(rgdal) specieslist <- read.csv("SpeciesList1.txt", header=F) attdata ...
2
votes
1answer
80 views

How to Automate Symmetric Difference using OGR in Python

I need to try and automate the process of creating mask layers by using the symmetric difference of two different polygon layer files (they are currently in .TAB format, however these can be converted ...
0
votes
0answers
47 views

Converting DXF to GeoJSON with ogr2ogr

I'm trying to convert my DXF to GeoJSON with ogr2ogr, but I can't get it to include blocks. ogr2ogr -f "GeoJSON" "/Desktop/test2.geojson" "/Desktop\drawing.dxf" -sql "SELECT * FROM entities" ...
1
vote
1answer
59 views

Dissolve in ogr / python

I have a set of ~100,000 polygons (.shp format). Using python and ogr I would like to dissolve them to one feature class to speed up other downstream operations. The command I am using is: ogr2ogr -f ...
2
votes
1answer
69 views

Create new shapefile based on values ranges in existing shapefile using gdal/ogr/python

I have a shapefile containing many thousands of polygons with values stored in an attribute field and ranging 0-105. I would like to create a much simplified file that contains classes for value ...
0
votes
1answer
78 views

Improving performance of Clip using OGR?

I have a set of points which I am trying to clip to a set of polygons. The files have many features (150,000 polys, 8,000 points). I'd like to automate this process carry it out once a day, hence I am ...
0
votes
0answers
19 views

OGR_LINK_FIELD to filename in a Geospatial PDF

Im using gdal_translate to create a Geospatial PDF. im trying to add file path to my feature when clicking on them by using: -co OGR_LINK_FIELD=<column whit path> i creating my pdf in the ...
0
votes
0answers
17 views

using import ogr in Arcgis python [duplicate]

I need to use import ogr in my python window provided by ArcGIS 10.2, but i can't configure ogr and gdal on my system. Please tell me how i can fix this issue and import ogr in my python window ...
1
vote
0answers
140 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
34 views

Extract raster values to multipoint shapefile and write to new field using gdal/python [duplicate]

I have a raster with one band and I would like to query a set of overlying points (.shp) to determine how many points as well as which points points fall under a range of certain pixel values ...
1
vote
1answer
173 views

Count number of points within multipolygon shapefile using OGR

I have two shapefiles: 1) consists of points (hundreds of entries) and 2) multi polygons (tens of thousands of entries). I simply need to count the total number of points contained within the ...
2
votes
1answer
420 views

Calculate area of polygons using OGR in python script

I have a shapefile of many thousands of polygons. I'm trying to append an area field to the attribute table and calculate the area of each polygon (in sq. meters) driver = ogr.GetDriverByName("ESRI ...
2
votes
3answers
98 views

ogr: what is the advantage of using `geom.Clone()` over `geom`?

What is the advantage of using geom.Clone() over geom? Simple example: geom = link_feat.GetGeometryRef() newfeature.SetGeometry(geom.Clone()) # or newfeature.SetGeometry(geom) ...
1
vote
0answers
41 views

problem with saving/processing layers in QGIS

I recently encountered the following problems with a shapefile in QGIS 2.10.1: when I simply tried to save the layer as a new layer, there is error message: "Feature geometry not imported (OGR ...
-3
votes
3answers
121 views

How can I use ogrinfo to reach information about a .shp?

How can I use ogrinfo? where should I write it? In the visual studio's command prompt or somewhere else? Can you make some examples? when I use ogrinfo in the windows or visual studio's command ...
2
votes
1answer
63 views

Write ogrinfo result to text file

I have obtained a desired value from a dataset using: ogrinfo input.shp -dialect SQLite -sql "SELECT SUM(field) from input The ogrinfo command prints the desired value via the command line when I ...
4
votes
1answer
634 views

Opening file geodatabases created with ogr2ogr in ArcGIS Desktop?

I've been using the new FileGDB support in gdal-1.9.0 to create file geodatabases that can be opened in ArcGIS. For example (I'm doing this all on one line, so I'm not certain this will run as ...
1
vote
1answer
65 views

How to rasterize a point layer with multiple features falling inside a raster cell?

How to make a raster with values that are the sum of all points inside each raster cell? The burn value is a specific attribute. Using gdal_rasterize or gdal.RasterizeLayer(), the resulting raster ...
3
votes
1answer
102 views

Calculate new field from existing fields using expression in gdal/ogr and append to shapefile

I'm trying to calculate a new field from existing fields based on a simple expression for a set of polygons in GDAL/OGR. The expression is basically: new field = (field 1 / field 2) * field 3 ...
1
vote
0answers
88 views

How to reach the geometry (polygon, polyline) of a dxf in python-ogr module

this might be a basic question, but I am rather new in ogr. I wish to collect all lines from the dxf file and create their boundary. I loaded the layers (ExecuteSQL( "SELECT DISTINCT Layer FROM ...
5
votes
1answer
1k 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 ...
2
votes
2answers
70 views

Using .DXF Arc or Circle accurately in ArcGIS for Desktop?

I need to use a .DXF in either QGIS or ArcGIS. However, if an Arc occurs in a .DXF drawing and if this file is opened in QGIS, I noticed that the geometry of the Arc is simplified. I did a test: ...
3
votes
1answer
49 views

OGR update using case statement

I am looking at updating a number of large shapefiles using ogrinfo and UPDATE. I would like to perform a CASE function to update specific fields with specific values. Is it possible to perform CASE ...
0
votes
1answer
68 views

Remove 3D geometry in shapefile using OGR

I have a series of shapefiles, that have 3D geometries (ie: points ZM). I would like to remove the 3D geometry so that the files are 2D. Is there a way to remove 3D geometry from a shapefile using ...
0
votes
0answers
45 views

OGR: How to save shapefile to HDD?

I'm new to OGR module and I can't figure out how to save new layer to my HDD. I allready have shapefile with lines and buffer and I want to clip lines with buffer. from osgeo import ogr ...
2
votes
2answers
578 views

Install GDAL 2.0 on a MacOSX

Does anybody know what's the easiest way to install GDAL 2.0 on a MacOSX? The usual suspects kingchaos binary distribution and homebrew seem to be stuck on GDAL 1.11 I need support for TopoJSON ...
2
votes
1answer
253 views

How to run GDAL vector (OGR) tools from inside QGIS?

I want fingertip access to the GDAL/OGR tools, particularly ogrinfo, from the main QGIS screen. I currently run ogrinfo.exe in a DOS shell but this seems clumsy. Installing the GDAL Tools plugin ...
2
votes
1answer
81 views

UnsatisfiedLinkError caused by org.gdal.ogr.ogrJNI.GetDriverCount()

I am developing in Java on Windows 7 with Eclipse (Luna). I am using gdal for some ogr processes and running the application from eclipse is fine, but running from command line on the same machine ...
1
vote
1answer
133 views

Read shapefile as a numpy array

Is it possible to read a shapefile with ogr as a numpy array, in order to use it as a mask to filter out a geotiff image? What I would like to obtain is a numpy array from the layer below: from ...
1
vote
0answers
80 views

how to reproject an image programatically in c# using gdal

I have to reproject an image programmatically in c# using gdal library. For the moment i'm a little bit lost in gdal and i don't really now which methods i have to use. I think i will have to ...
3
votes
4answers
741 views

Reading pre-10.0 File Geodatabase (GDB) using OGR?

I have been tasked with processing USGS's National Hydrography Dataset. However, it appears that the only available format is FileGDB (version 9.2-9.3.1). Looking at OGRs support for FileGDB, it looks ...
0
votes
1answer
80 views

how do i create OGRSpatialReference from raster file's georeference C++

I want to create .shp file using ogr with georeference based on my raster file, so i create an ogr layer using CreateLayer( "point_out", NULL, wkbPoint, NULL ); i want to set the OGRSpatialReference ...
4
votes
1answer
2k views

OGR and DXF files: Is it possible to handle layer names? (only “entities”)

I'm using Python and OGR to extract the layers of a DXF file and convert them into SHP. I began with: import ogr, os, sys driver = ogr.GetDriverByName('DXF') datasource = driver.Open('test1.dxf', 0) ...
2
votes
2answers
2k views

Opening .lyr file via rgdal/OGR

According to this answer I can read in a .lyr file via OGR as long as it was made with ArcGIS version 10. I have such a file (from the ArcGIS Maps & Data page) but I can't quite make R's readOGR ...
2
votes
3answers
155 views

Why is the city of San Francsico floating over Point Richmond?

I have a shapefile that is supposed to be the city of San Francisco. I got it from the good folks at Transbase. On their tiles, it seems to align with the city itself, but when I uploaded it to ...
0
votes
1answer
42 views

Batch reproject shapefiles in subdirectories

I have a catalog tree and in every folder I have a number of shapefiles, images and mxd files. The shapefiles are all in Greek Grid projection system (EPSG: 2100). What I want to do is to batch ...
4
votes
2answers
1k views

GEOS Python: Taking Union of several geometries

I am using the GEOS/OGR library in Python. I have files full of geometries that overlap, and I want to convert these to files of geometries that don't overlap. The way I have been approaching this ...
4
votes
3answers
305 views

Python GDAL/OGR: How to Erase features?

I have a big round polygon feature (5km diameter) and a small round polygon feature (3km diameter) that I would like to clip with Python GDAL/OGR to obtain the "donut". Once this is done, I will apply ...
0
votes
2answers
90 views

Using ST_LINE_INTERPOLATE_POINT in OGR and python

I'm interested in finding the midpoint on a linestring using OGR and python. This can be a line with more segments. Could I use the ST_LINE_INTERPOLATE_POINT in python using the ExecuteSQL() method? ...
2
votes
0answers
22 views

What is a MULTILINESTRING25D [duplicate]

I've never encountered the OGR geometry type MULTILINESTRING25D before (or any of the *25D types). What are these? How do they differ from other types? I couldn't find any useful documentation from ...
1
vote
1answer
1k views

Using OGR Intersection Method Python

I'm currently working to find the intersections between linears in a shapefile. I'm a newbie to the GDAL/OGR library. I've done some googling and came up with what seems to be a useful example(see ...
2
votes
1answer
66 views

Dissolving a TIN using python/ogr binding

I have a TIN model where I remove some of the triangles (see fig. 1). Most of the triangles touch on one edge, some on one vertice. I would now like to generate a polygon shapefile containing the ...
1
vote
2answers
148 views

Free 3rd party library for showing geospatial vector information

Up to now, I have used GDAL to extract raster data from geotiffs and then, OpenGL to show that raster data. But when it comes to extract vector data with the help of OGR, what library would you ...
0
votes
1answer
28 views

C# ogrinfo with virtual vector source doesn't work GDAL 1.10

I am trying to use GDAL 1.10 with a vector virtual source which is nothing more than the example union of two shapefile layers. from the commandline, ogrinfo works fine on the source. But the C# ...
8
votes
5answers
2k views

Are there GUI resources for gdal and ogr?

For those who are new to the programming side of GIS, I feel that a lot of great tools and resources are inacessible. I am interested in GUI based wizards for handling geoprocessing with libraries ...
1
vote
1answer
55 views

Why does Spatialite layer prompt for CRS if SRID was not explicitly defined in Layer Options?

In QGIS, if I Save As... a SpatiaLite file and don't enter an SRID in Layer Options, I will be prompted for a CRS upon opening the file. Yet GDAL documentation says that this option is only for ...
3
votes
1answer
703 views

Latest version of ogr2ogr fails with Layer Creation

I am able to successfully run ogr2ogr to add S57 data to PostgresDB. The version I use is GDAL 1.7.0b2, FWTools 2.4.7 and release date 2010/01/19 I upgraded my version to GDAL 1.9.1 and release date ...
0
votes
1answer
77 views

Where can I find ogr_FileGDB.dll v1.4 compilled for Windows?

Since v1.3 do not have custom CRS support, where can I find the ogr_FileGDB.dll v1.4 compiled for Windows?