The OGR Simple Features Library is a C++ open source library (and command line tools) providing access to vector file formats.
3
votes
2answers
61 views
How to computational efficiently check if there are any overlapping polygons in a group of polygons?
I need to do some processing with groups of polygons. If any of the polygons in the group overlaps other polygon the result is unpredictable and don't throw any error. So, I need to detect if there is ...
2
votes
2answers
160 views
OSR Python testSR.ImportFromEPSG(4326) returns empty spatial reference
This is empty using Python .ImportFromEPSG(4326):
import osr
#this fails:
testSR = osr.SpatialReference()
testSR.ImportFromEPSG(4326)
print testSR.ExportToPrettyWkt()
#why did the import from EPSG ...
5
votes
1answer
155 views
Geometry errors when importing data from ESRI file geodatabase to PostGIS
When I run the following command to import by data from an ESRI fgdb to postgis...
ogr2ogr -f "PostgreSQL" -a_srs "EPSG:28355" -t_srs "EPSG:3857" PG:"dbname=tp_test user=postgres port=54321 ...
5
votes
1answer
209 views
GDAL.RasterizeLayer not ported to the C# bindings?
I am trying to use the OSGeo.GDAL.Gdal.RasterizeLayer(…) from GDAL 1.9.2 and it requires some SWIGTYPE parameters:
OSGeo.GDAL.Gdal.RasterizeLayer(
OSGeo.GDAL.Dataset dataset,
int bands,
...
3
votes
1answer
73 views
OGR Info - Check for spatial index?
If we want to get information about a vector layer (shapefile for example) we could use ogrinfo:
ogrinfo -so myshapefile.shp mylayer
This returns a lot of pertinent information about the shapefile. ...
3
votes
1answer
459 views
How do you open shapefiles with ogr2ogr
I'm following along the D3 tutorial, and on this line:
ogr2ogr \
-f GeoJSON \
-where "adm0_a3 IN ('GBR', 'IRL')" \
subunits.json \
ne_10m_admin_0_map_subunits.shp
run into the following ...
2
votes
1answer
87 views
Need help assigning values to field using OGR in python
I've got a similar question to this one How to programatically populate a shapefile field with polygon areas in OGR?, but the solution doesn't seem to be working for me. I am trying to import a ...
1
vote
1answer
17 views
OGR UnionCascaded gives strange lines (flat polygons)
I'm using OGR to perform a union using UnionCascaded. All my polygons have been created by GDAL polygonize which ensures that all polygons follow pixel edges and should therefore align nicely. But I ...
1
vote
1answer
39 views
GDAL SQL syntax to add field an put values
I try to make a new field in my attribute table and put in values from another field after converting from character to integer but can't get the right syntax. I run this as shell-script in MSYS.
cd ...
0
votes
1answer
173 views
Installing GDAL with Java Bindings (gdal.jar) on Ubuntu 12.10
I am trying to build a postgis importer for mutliple shapefiles. After geotools took orders of magnitude longer than shp2pgsql to import my data, I decided to attempt to use the java bindings to GDAL ...
5
votes
0answers
92 views
How to detect a GDAL/OGR 'Warning'?
When I run a batch script using a GDAL/OGR program, I can detect if an error occured by checking ERRORLEVEL for the value 1.
When using GDAL/OGR in python or .NET, I get an exception when an error ...
2
votes
0answers
42 views
traversing KML files with ogr python
i'm new to OGR processing and KML format so be gentle:
i've got a series of KML files all containing multiple regions partitioning a larger area in each. i also have a series of geocoded points for ...
2
votes
0answers
60 views
Custom python datasource to QGIS
I'm working on a homebrew spatial feature data format, and using Python to write it's API.
It occoured to me that use some tool like QGIS to display my data would be very nice to have, for debug/test ...
2
votes
0answers
79 views
Ogr: How to add layer description to dgn?
I have created a dgn-file using Ogr, but can't find a way to fill out the description for this layer programatically. (something like _dgnLayer.Description = "Highways")
opts.Add("SEED=" + ...
2
votes
0answers
360 views
OGR VRT MSSQL example
I'm trying to import vector data into SAGA GIS from a SQLExpress 2008 server.
Firstly is this possible?
I would have thought using an OGR VRT layer would have been the way to do it, I've attached a ...
1
vote
0answers
27 views
how to get correct geo reference system for a VMap
I am new to GIS, trying to read the GeoRef System for VMap by using the following code:
OGRSpatialReference *ref = layer->GetSpatialRef();
if( ref )
{
QString georefSystem = ...
1
vote
0answers
80 views
Ogr2Ogr: Failed to create GPX file output.gpx
When i try to export an shapefile to gpx using ogr2ogr.
ogr2ogr -f GPX output.gpx D:\mypaste\input.shp -sql "SELECT Id AS name FROM layername"
It gives me the following error "Failed to create GPX ...
1
vote
0answers
123 views
How to use the OGR/GDAL configure options in QGIS python environment
I’m looking for a solution how to use the OGR/GDAL configure options (--config) in the qgis python environment. http://trac.osgeo.org/gdal/wiki/ConfigOptions
Setting special configure options is ...
1
vote
0answers
111 views
Naming layers in DXF using OGR2OGR
We have been using ogr2ogr to export data from PostGIS into DXF. Using the default behaviour of the export, all data are put into layer '0'. We would put data into a layer name from the PG table name. ...
1
vote
0answers
189 views
ogr2ogr failed to reproject shapefile error exceeds limits
I cannot get correct transformation from WGS84 to the Hungarian EOV EPSG:23700 (Hungarian Datum 72) using ogr2ogr.
I am using ogr2ogr from the fwtools shell. I have a shapefile in GCS WGS84 (epsg ...
1
vote
0answers
93 views
Is Django's LayerMapping capable of putting a static value into all features?
I'm using GeoDjango's LayerMapping utility to try and import a set of features. The catch is that aside from the attributes in the source layer, I want all the destination features to have the same ...
0
votes
0answers
25 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 ...
0
votes
0answers
19 views
NYC Building Perimeter Shapefile after 2011
I've been using the following NYC building perimeter shapefile from the DOTT for some work. This file however dates back to 2010. Is there a newer one available, and if so where?
I have found this ...
0
votes
0answers
30 views
Is QGIS OGR plug-in data provider (based on Postgres) limited to 500 features in layer?
I developed a plug-in based on OGR. It works fine but when I want to add a vector data (using my plug-in) I get 1449 features (with 76 columns) in my layer. Then I select this layer and load it.
...
0
votes
0answers
31 views
OGR shows no layers
I have an ESRI File Geodatabase (FileGDB) (size is 15+GB), which has over 10 layers, when I open it up in ArcGIS, everything seems to be working.
I want to move this database to postgreSQL with OGR ...
0
votes
0answers
34 views
QgsVectorLayer: How to load files containing multiple layers
I’m trying to load all layers from a ZIP-file using the OGR-Dataprovider.
vlayer = QgsVectorLayer("/path/file.zip", "ZIP-Layer", "ogr")
will load only the first layer.
Any idea how to load all ...
0
votes
0answers
41 views
How to expand Ogr Sql Functionality
I'm using Ogr2Ogr for some geometric & querying operations by storing the results in SQLite files.In SQLite there are some functions I use.For that,I need to extent sql functionality.For that I'm ...
0
votes
0answers
37 views
Using GDAL/OGR exes in php
could you point me in the next logical direction? I wanted to use the gdal and run the exe commands through my web application, but have no clue what the next step should be after running the ...
0
votes
0answers
122 views
OGR-Driver GML axis order handling (GDAL, QGIS)
By default the OGR-Driver will swap the axis order to longitude, latitude for geographic coordinate systems.
"Since OGR 1.8.0, the GML driver has coordinate system support. This is only reported ...
0
votes
0answers
321 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 ...
0
votes
0answers
147 views
Errors with ogr2ogr and DXF files (ASCII and BIN)
Using OGR, I'm trying to reproject a DXF file. I'm using ogr2ogr, but I get two type of errors depending if I start with a BIN DXF or an ASCII DXF file.
With BIN DXF:
ogr2ogr -s_srs 27492.prj -t_srs ...