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

readOGR cannot read a GML file

I want to use a function mapunit_geom_by_ll_bbox from soilDB package in R which is supposed to download a GML file containing from the web, and read the GML using readOGR to return me an SpatialPolygonsDataFrame (i think) object. Although the…
0
votes
0 answers

Python3 gdal/ogr open OpenStreetMap data file always returns None

I'm using Python 3 and gdal/ogr module to open/read .osm.pbf data files downloaded from OpenStreetMap. With the method presented in this thread, I could successfully parse open the file a week ago through the following code: import gdal,…
mikeqfu
  • 329
  • 2
  • 10
0
votes
1 answer

GeoTools Query with SortBy: Wrong syntax of generated SQL

I’m trying to read a MapInfo MAP file in Java using GeoTools and its OGR Plugin. I want to iterate over the features in a certain sort order. I’m trying to use GeoTool’s Query and SortBy for this purpose, but the SQL query that gets generated has a…
hfs
  • 2,433
  • 24
  • 37
0
votes
1 answer

Querying polygons that contain 4 points

I have 4 points that I always get, I would like to query if the polygon defined by a multipoint contains those 4 points. I’m using PostGIS and Postgres. I'm also using OGR/GDAL for that purpose. Would someone provide me with the Query using SQL for…
andre
  • 731
  • 2
  • 13
  • 27
0
votes
0 answers

Add field to a geojson and populate it - python

Took from Python GDAL/OGR Cookbook 1.0 documentation, I insert a "in memory" geojson in string format and a gdal "in memory" raster as input_zone_polygon in loop_zonal_stats, then I receive a int value from zonal_stats() for each feature. This value…
Alex C.
  • 87
  • 10
0
votes
1 answer

Converting blocking synchronous code to async

that is the blocking code, how would I convert it to non blocking async ? I'm trying to do async communication between a client and a server. here is my blocking sync code, how would I do it async ? bool…
andre
  • 731
  • 2
  • 13
  • 27
0
votes
0 answers

How can I read byte() geometry into array of points using VBScript?

I have a binary file "geo.bin" that represents some geometry (OGR WKB I think). The binary file has a list of points that make up a polygon. I'd like to read the binary data and create an array of points in my VBScript script. Are there solutions…
carlr
  • 21
  • 5
0
votes
1 answer

Osgeo.ogr not getting csv field name correctly

Osgeo.ogr seems not able to correctly get the field name of a csv file. Take this example: Identifian,C,254;CodeVoieRi,C,254;CodeInseeI,N,10,0 1;;13021 2;;13021 3;;13021 The problem is that ogr take the "," and the ";" as delimiters while the ","…
Jbertrand
  • 419
  • 1
  • 4
  • 14
0
votes
2 answers

Import multiple shapefiles with different sets of attributes in R and combine them

I have a folder containing many shapefiles that are somehow related but contain different numbers of attributes in the corresponding database (dbf-File). I managed to load them all into R…
user2386786
  • 725
  • 9
  • 25
0
votes
2 answers

Python subprocess formulation

I have been experimenting with Python's subprocess module. I wish to emulate the following, successful command: Command line: ogr2ogr -f GeoJSON -clipsrc cutting.json output.json input.json Python implementation: import…
LearningSlowly
  • 8,641
  • 19
  • 55
  • 78
0
votes
1 answer

GDAL/OGR now built with geos?

Back in 2014 Enthought's build of GDAL/OGR was missing important functionality. In October of that year John from Enthought wrote: "Correct, there are many possible build configurations of GDAL/OGR, and geos is not currently supported by…
Jim B
  • 1
0
votes
0 answers

Python Multiprocessing - Library import failed when calling a function in Windows OS

I use the Python multiprocessing module to speed up a geoprocessing function in my script. To this end, I use OGR, OSR and GDAL libraries. Multiprocessing works fine in Linux OS. However, when I execute the script in Windows OS, the…
C.Riedel
  • 3
  • 4
0
votes
1 answer

Plotting a polygon in R from shapefile data retrived from MYSQL

I am attempting to plot a polygon in R using MySQL as a db source. These data are polygon points that were originally generated from loading ESRI shapefile data into MySQL using ogr2ogr. (QGIS > OGR > MySQL > R) The connection to the MySQL server…
Praxis
  • 934
  • 2
  • 17
  • 31
0
votes
2 answers

Increase extent of vector layer with OGR or GDAL?

When using the OGR library or GDAL library with Python script, is it possible to increase the extent of a vector layer without actually adding new data points? In my specific case, I would like to increase the extent of vector layers associated…
Philip Whitten
  • 293
  • 2
  • 16
0
votes
1 answer

The type initializer for 'OSGeo.OSR.OsrPINVOKE' threw an exception

I'm trying to create a CoordinateTransformation to transform the SRS of a shapefile. However, on attempting to create one with the following method call: var sourceSrs = new SpatialReference(Osr.SRS_WKT_WGS84); I get the exception: The type…
displayName
  • 13,888
  • 8
  • 60
  • 75