Questions tagged [ogr]

The OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats. OGR is a part of the GDAL library

The OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats.

OGR is a part of the GDAL library

212 questions
0
votes
0 answers

GDALException: OGR failure. when trying to serialize GeoDjango geometry field into GeoJSON

The data was imported into Django (or rather PostGIS) from a shapefile using LayerMapping. It seems well-formed since it is viewable using the admin interface. There were issues with installing the right version of GDAL because OSGeo4W installs a…
Lupilum
  • 363
  • 2
  • 11
0
votes
2 answers

Python crashes when trying to perform buffer using OSGEO OGR

I'm trying to run a simple script to manually create some geometry and then perform a buffer on said geometry. However, python will completely crash whenever I try to perform a Buffer operation. >>> from osgeo import ogr >>> point =…
Evan Siroky
  • 9,040
  • 6
  • 54
  • 73
0
votes
1 answer

OGR Intersection method between polygons returning None

I'm trying to get the intersection geometry result of two polygons using the python OGR library. I have verified that each polygon is a geometry and that they intersect. However, intersects returns true while Intersection returns None. Any ideas? #…
todoroki
  • 11
  • 5
0
votes
1 answer

How to create a polygon ESRI shapefile in c++?

I am using opencv in c++ to extract a set of 2D points from an geospatial image. Using those points as vertex i want to create a polygon ESRI shapefile. Gdal api tutorials (https://gdal.org/1.11/ogr/ogr_apitut.html) only have examples of how to…
underfloor
  • 301
  • 3
  • 12
0
votes
2 answers

Rasterize WKT polygon (from geopandas) with Python and OGR/GDAL

As a coding enthusiast I am currently creating my own "geospatial" tool as how I would like it to work. However right on the start I am already facing a problem. My tool should work using GeoPandas to extract information and then OGR/GDAL for the…
Mr unkown
  • 1
  • 1
0
votes
1 answer

Merge OGR layers with attribute tables in Python

This is the example of merging OGR layers in Python from Python GDAL/OGR cookbook. https://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#merge-ogr-layers import os, ogr, osr outputMergefn = 'merge.shp' directory =…
Piotr Koller
  • 599
  • 3
  • 8
  • 17
0
votes
1 answer

readOGR not recognizing the projection

OS: Windows R: 3.5.1 rgdal: 1.3-4 I am having difficulty plotting the Maryland shoreline. I think this is because it is not detecting the projection. The Maryland shoreline data can be downloaded from…
BillZ
  • 127
  • 2
  • 7
0
votes
1 answer

Python OGR: Finding bad spot in source code for code displacement

I've tried to adapt a python ogr script which displaces points too near to each other (originally from http://wiki.gis-lab.info/w/Displacement_of_points_with_same_coordinates,_ShiftPoints/OGR for python2) to Python3. I've also changed the GDAL…
Gloster
  • 28
  • 4
0
votes
1 answer

Missing plugin library OSGEO ogr_OCI.dll

I am working on a project that uses OSGEO. I am trying to make shapefiles using OSGeo.Ogr. The first step involves registering all drivers. I am doing that (as shown in the image below). However, I get the exception as shown in the diagram, even…
Umar Dastgir
  • 688
  • 9
  • 25
0
votes
0 answers

Why is "...like '%Wert'" not working with ogr.ExecuteSQL and dialect = SQLITE?

I am trying to count features that have the text "Fehler" in a certain field. This only works, when using the OGRSQL-dialect, but returns None when using SQLITE. I want to use the SQLITE-dialect, because I am looping over several SQL-Strings, and…
0
votes
1 answer

python OGR Shapefile export features

I've downloaded an openstreetmap shapefile and want to extract certain features (to make the file less heavy and have only the ones I'm interested in, for example bicycle paths from the roads). How would I do this, I can currently open the file and…
Yorian
  • 2,002
  • 5
  • 34
  • 60
0
votes
1 answer

How do you write vector files with the GDAL Java bindings?

I have no trouble reading files of different types using GDAL's Java bindings (version 2.2.1) via the org.gdal.ogr.ogr.OpenShared(filePath) method to create a DataSource. If I want to create a SQLite file from a DataSource, however, how would I do…
Brideau
  • 4,564
  • 4
  • 24
  • 33
0
votes
2 answers

Using GDAL.OpenEx() in C# with CSV file

I'm trying to read all fields in a CSV file using GDAL v2.1.3 Using this command it is working: ogrinfo -ro -al -so test.csv -oo X_POSSIBLE_NAMES=Lon* -oo Y_POSSIBLE_NAMES=Lat* -oo KEEP_GEOM_COLUMNS=NO Now I need to do this in my C#…
Paul Meems
  • 3,002
  • 4
  • 35
  • 66
0
votes
1 answer

Error dissolving shapefile with ogr and SQLite

I'm trying to dissolve a shapefile based on this question and that instruction. However, when I run my line of code: ogr2ogr "c:/working/testing/dissolve.shp" "c:/working/testing/test.shp" -f"ESRI Shapefile" -dialect sqlite -sql "SELECT…
s6hebern
  • 725
  • 9
  • 18
0
votes
0 answers

gdal can't import ogr

I've written a python script that runs fine on one computer. but can't import ogr from osgeo on another. Both machines running linux, and have gdal compiled from source and both include with-python=yes in the config. I have tried both: import…
Steven Lutz
  • 467
  • 1
  • 6
  • 16