New answers tagged

1

I struggled with this too! I managed to solve the problem ogr2ogr -f MSSQLSpatial "MSSQL:server=Servername\SQL2012;database=DatabaseName;UID= username;PWD=password" C:\Pathto\shape.shp All you need to do is get rid of the [] and it should work...Hope this is still applicable to you.Just to show you I had the same issue here is a screensht of multiple ...


1

If you have National Grid coordinates with trailing letters, you can not use these in ogr2ogr. The ngconverter linked in the other answer will be the best solution. It will output coordinates in EPSG:27700. If you have numerical coordinates, EPSG:27700 will work in ogr2ogr, as pointed out by @iant.


2

Something like: ogr2ogr -f XXX -s_srs epsg:27700 -t_srs epsg:4326 out.xxx in.shp The ogr2ogr manual page explains all the options.


1

I figured this out. It seems like there were some artifact functions with the name addGeometryColumn (overloading in postgres is possible). This error in the logfile made me suspect there is something very wrong with the addGeometryColumn function: ERROR: function addgeometrycolumn(unknown, unknown, unknown, integer, unknown, integer) is not unique at ...


0

I'd just like to add that checking for Spatialite support via ogrinfo --formats sqlite | grep 'spatialite' -i and an output of SQLite -vector- (rw+v): SQLite / Spatialite does not guarantee support. Mine outputs this but then ogr2ogr still fails claiming it does not support Spatialite. Instead, use ogrinfo --format sqlite | grep 'spatialite' -i (note the ...


1

The solution for this problem was to create a table in oracle with the NULL value and 'No_elements' for tax_type field. I then add an extra ogr2ogr line in my batch file that appends the NULL observation into the existing file geodatabase that is exported in the previous line.


0

You must convert the "description" field of your csv file into label annotation following the DGAL OGR Feature Style specification http://www.gdal.org/ogr_feature_style.html. See a text label example from the section 2.1 A text label, taking the text string from the "text_string" attribute field: "LABEL(f:"Times New Roman",s:12pt,t:{text_string})...


1

I've had some success with -append (to avoid recreating the table) and --config OGR_TRUNCATE YES (to truncate/empty the table before uploading new data) ogr2ogr -append -f PostgreSQL PG:"dbname=regional host=localhost user=*** password=***" Hsp_09_13.MIF -t_srs EPSG:3857 -nlt MULTIPOLYGON -nln postcode_sector_boundaries --config OGR_TRUNCATE YES (not ...


2

Use GDAL with SQLite SQL dialect http://www.gdal.org/ogr_sql_sqlite.html and utilize LIMIT and OFFSET ogr2ogr -f "ESRI Shapefile" -dialect sqlite -sql "select * from my_shape limit 10000 offset 0" batch_1.shp my_shape.shp ogr2ogr -f "ESRI Shapefile" -dialect sqlite -sql "select * from my_shape limit 10000 offset 10000" batch_2.shp my_shape.shp ogr2ogr -f "...


1

According to the OGR Driver Info for Microstation DGN, you cannot create DGN file consisting of more than one layer: DGN files can only have one layer. Attempts to create more than one layer in a DGN file will fail. So I don't think this is possible through ogr2ogr or QGIS. You may need to look for another application.


4

As you discovered by trial and error, there were few nagging issues you needed to fix, the last of which was resolved using ogr2ogr's -nlt GEOMETRY* argument. * Note the recommendation in @LeeHachadoorian's comment that -nlt PROMOTE_TO_MULTI be used as a default solution, rather than nlt GEOMETRY, as the former promotes best practice in addition to ...


1

This is quite a nasty problem and hard to resolve without experience on different ways to store geodata into SQLite database. The problem is not in the output format but in the input format. The natural_earth_vector.sqlite database is written as FDO. Read more info from the "Regular" SQLite databases" section in the GDAL SQLite driver manual page http://www....


1

So the answer seems to be; it's not possible. ogr2ogr does not pick up on xlinks in GML files. My solution was to use Safe FME to load the data instead.



Top 50 recent answers are included