Tag Info

New answers tagged

2

In windows command line you could: FOR /D /R %g IN (*.gdb) DO ogr2ogr -update -append -f FileGBD D:\output.gdb x:\incoming\%g input_layername Just place the input_layername after the input dataset. /D tells FOR to search for directories and /R asks it to do it recursively. In a .bat file, replace the '%' with '%%', so %g > %%g Extended batch file ...


1

I discovered my error. I was expecting to see lat/lng pairs from EPSG:3857, but it's actually EPSG:4326 I should have been converting to.


1

No workaround should be needed. What you did in the first place is the right way. Take this GML as input: <?xml version="1.0" encoding="utf-8" ?> <ogr:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ogr.maptools.org/ mixed_points.xsd" xmlns:ogr="http://ogr.maptools.org/" ...


1

If you have MySQL 5.7.5 or later, you can use MySQL's ST_Union function from ogr2ogr: ogr2ogr -sql "SELECT ST_Union(geo) FROM counties" -f KML counties.kml MySQL:"..." If you have GDAL/OGR built with SpatiaLite support, then you can let GDAL/OGR do the unions with the SQLite dialect. As a special case, "Union" is called GUnion: ogr2ogr -dialect SQLITE ...


0

It works quite fast for me. I used http://download.geofabrik.de/europe-latest.osm.pbf as sample data and converted the points layer into Spatialite database as ogr2ogr -f sqlite -dsco spatialite=yes europe_points.sqlite europe-latest.osm.pbf points -progress -lco spatial_index=no Then I created CSV file as ogr2ogr -f "CSV" commandtmp.csv ...


3

For doing that is required a script; not a command. As I don't know which operative system you have, I am going to use a bash script in my Linux system (in Windows the equivalent is a bat file) and by using only shapefiles. #!/bin/bash for i in *.shp do ogr2ogr -t_srs EPSG:4326 out_data/$i $i done The above script (named as convert and running with ...


0

Read the ogr2ogr documentation http://www.gdal.org/ogr2ogr.html, especially section about -addfields -addfields: (starting with GDAL 1.11) This is a specialized version of -append. Contrary to -append, -addfields has the effect of adding, to existing target layers, the new fields found in source layers. This option is useful when merging files ...


0

Ogr2ogr easily handle your data but shapefile format does not. Ogrinfo reveals that your data contains one geometry which is of type Geometrycollection. Collection is made by combining one linestring and one point. GEOMETRYCOLLECTION ( LINESTRING ( 120.9954464 6.040449 0, 120.9953874 6.0402356 0, 120.9957951 6.0401396 0, ...


2

The part that is going wrong is where you assumed that the coordinates in 3857 are degrees (like -5.8, 41). The units of 3857 are metres. So you're asking for something tiny, off the map (near the origin). Lets look at a conversion, using pyproj: from pyproj import Proj, transform inProj = Proj(init='epsg:4326') outProj = Proj(init='epsg:3857') x1,y1 = ...



Top 50 recent answers are included