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
0answers
66 views

How to access ArcSDE metadata using OGR?

I'm trying to get a list of all layers in an ArcSDE database hosted in oracle here is the command I'm using: ogrinfo -al SDE:localhost,5151,sde,sde,sde Note: I've replace the database, username ...
1
vote
2answers
70 views

How to access Shapefile metadata and metatypes information using OGR?

I'm trying to use ogrinfo to get some details on a shapefile. Now, the only way that I know is using orginfo: ogrinfo -ro -so -al BRA_001.shp But its display all information about the shape: ...
1
vote
1answer
77 views

Gdal ogrinfo CSV unable to open datasource

When I try to import a csv file into a PostgreSQL table with the Gdal ogr2ogr tool I get the "Unable to open datasource" Failure. So I tried to open it with the tool ogrinfo and I get the same ...
2
votes
2answers
106 views

How to add attribute table to new shapefile using OGR?

i have made a new shapefile from the original shapefile , and now i want to copy the attribute table from the original shapefile to the new select shapefile , but i don't know how to do that? import ...
2
votes
2answers
42 views

How to select form the attribute table in with ogr

i want to select the (Sumava) from the attribute table and then make a shape file, my problem is i don't know which function should i use to select this area.if any one can help me? import ogr import ...
1
vote
1answer
93 views

Batch convert dgn files to shp files using ogr2ogr

We have hundreds of dgn files which have to be converted to shapefiles. I am trying to use these commands to batch convert all the dgn files in a folder. for %%f in (*.dgn) do ogr2ogr -f "ESRI ...
0
votes
0answers
29 views

GDAL/OGR in C++: Opening a vector file

So I'm making a vector file this way: OGRSFDriverH hDriver=OGRGetDriverByName("KML"); OGRDataSourceH hDS=NULL; hDS = OGR_Dr_CreateDataSource (hDriver, fname_dst, NULL); //I add layers ...
1
vote
1answer
79 views

GDAL/OGR in C++: Merge multiple vector datasets to single [closed]

I need to merge multiple kml files into a single one. I found that I could use "ogr2ogr -append" but I have to do it through c++ and my Google-fu hasn't been successful so far. So, any ideas? Also, ...
1
vote
1answer
19 views

Is it possible to append shapefiles based on field values using ogr2ogr?

We have 5 "Master" shapefiles(A, B, C, D & E). Each will have different table structure. We have 100's of shapefiles which has features which has to go to A,B, C, D & E. We have a column in ...
0
votes
2answers
47 views

Skip a specified input layer in ogr2ogr

I am using ogr2ogr to load data from multiple GML files into PostGIS. As shown in the ogrinfo output below, each GML file has multiple layers. Had to open data source read-only. INFO: Open of ...
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
38 views

Strange behaviour / weird results using ogrinfo + WFS + spat

I want to use ogrinfo to get features from a WFS within a bounding box. I know I can use the "-spat minx miny maxx maxy" parameter for this, but it does not work. Here's what works, what not, and what ...
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 ...
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" ...
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
1answer
67 views

Creating point shapefile from GeoTIFF using GDAL/OGR?

I have a 0.05 deg global maps (~8000 files) in GeoTiff format. It's a kind of a mask containig "1" and "0". I need to create a point shapefile for each raster with points located over "1" values of ...
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
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 ...
0
votes
0answers
12 views

Scripting procedure to clip vector lat-long file to those that fall within a raster? [duplicate]

I am looking for something similar to this thread, but in a scripting procedure which can be run through a Bash shell. In essence, I have a vector of latitudes and longitudes that span most of ...
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 ...
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 ...
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
2answers
86 views

Count Distinct with Where clause in OGR

I am looking to run a query in OGR to write back all instances where there is only one record of an attribute. I was thinking that I would use the following: ogrinfo -dialect sqlite -sql "SELECT ...
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 ...
1
vote
1answer
79 views

No GDAL/OGR package for Ubuntu 15.04?

Using Ubuntu 15.04, I'm trying to install GDAL/OGR. I did: [] sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable [] sudo apt-get update However, I found this error message W: Failed to ...
1
vote
1answer
174 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 ...
0
votes
0answers
247 views

Dissolve using GDAL/OGR?

I'm trying to dissolve a shapefile according to a field using Python 2.7.10 and I don't want to use ArcPy. Is there any way to do this using GDAL/OGR?
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 ...
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
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 ...
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
69 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 ...
7
votes
3answers
186 views

Identify and delete overlaping or near lines with similar running

I have shapefiles with lines that shows surface water runoff. I need to clear and simplify these shapefiles by condition that if some lines are near by other and has similar running, this lines has to ...
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 ...
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
81 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 ...
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 ...
1
vote
1answer
62 views

Add Color To GTiff output raster band

I am using GDAL in Python to create a tiff raster of data that is originally from a shapefile. I have an auxillary data channel, which I would like to use to color the pixels of the tif. I have made ...
0
votes
1answer
85 views

In Python, How to Encode and Decode Complex Data for a OWSLib WPS call to PyWPS-4?

In Python, how can I encode "complex" (vector) data for a WPS call that just echos back the data, and decode the data from the result. I was planning on using OWSLib on the client side and PyWPS-4 on ...
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
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 ...
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 ...
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 ...
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
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 ...
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# ...