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
90 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
102 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
134 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
69 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
81 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
25 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
1answer
102 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
673 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
111 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
42 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 error:...
1
vote
1answer
96 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
235 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
412 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
65 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
182 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
86 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
92 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
61 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
118 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 OGR?...
0
votes
0answers
46 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 os.chdir(r"...
7
votes
3answers
198 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
404 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
170 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
109 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
97 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
86 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
121 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
44 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
390 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
119 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
160 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
69 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
32 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# ...
2
votes
1answer
74 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 ...
0
votes
1answer
96 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?
0
votes
0answers
713 views

GeoPandas save to shapefile issue: Unable to open EPSG support file

When I try to use to_file() to write a GeoPandas GeoDataFrame to a shapefile I get the following error. df3.to_file('~/Desktop/testout.shp', driver = 'ESRI Shapefile'); ERROR:Fiona:OGR Error 4: ...
0
votes
1answer
45 views

How add a text field and then reproject all shapefiles which are in sub folders

I have a folder and inside of that folder, I have about 500 sub folders which contain on average about 5 shapefiles each. What I want to do is: to check if there is a field, lets say field_1, and ...
0
votes
0answers
61 views

Aggregate/merge data upon insert into PostGIS (via gdal)

I am working on a project where I take a large raster file (1.5GB+), put it through a number of image-processing operations, and finally convert it to vector data. Being that the raster is large, I am ...
3
votes
1answer
391 views

How to re-compile ogrinfo against gdal used by QGIS?

I just solved a problem with missing libraries blocking use of ogrinfo and ogr2ogr, only to find that these utilities are garbled in one more way: whenever I run any of these, I get following error (...
2
votes
2answers
82 views

Fusion table connexion issue

I'm trying to import some data from a SHP to GFT (Google Fusion Table). I get a 401 error. I'm using an Ubuntu 14.04 LTS Linux 64 bits with GDAL 1.11.0, released 2014/04/16. GFT is available (tested ...
3
votes
2answers
1k 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 ...
0
votes
2answers
104 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? ...
1
vote
1answer
170 views

Python ogr filter attribute SQL

I have a shapefile with 4 attribute fields (MC_ID, MC_info, C_ID, C_info). I want to change some MC_ID values selecting the features by C_info. For example: I want to set MC_ID = 2 for C_info = g19, ...
2
votes
0answers
63 views

Is GDAL/OGR (specifically CoordinateTransformation) thread-safe?

I'm using the Java bindings if it matters. I have a heavily multi-threaded program and this is one of the bottlenecks that I have in a synchronization block. If I could remove the synchronization, it ...
1
vote
0answers
68 views

how can I get the rest attributes like ATTV, ATTL etc. using S57 Reader?

I'm using GDAL to read S57 files to display them with S52 styles, but I was unable to get the attributions like "ATTV", "ATTL"? Do you know how to get it? I have put the two supporting files, ...
1
vote
1answer
271 views

How to read GeoCSV with OGR?

I have a GeoCSV file which stores the geometry in a WKT formatted cell following this recommendation: "identifier","date","geom","value" "Dgf01","15.04.2013","POINT (52.404869 13.147457)","285" "...
0
votes
0answers
163 views

How to build .vrt of shapefiles?

I've a huge number of shapefiles and I would like to create a VRT as I do with gdalbuilvrt for raster. I find here https://github.com/dwtkns/gdal-cheat-sheet that it should be possible and the format ...