[gdal-dev] GDAL 1.9.0 ogr2ogr. Organize results in destination folder.

Pedro Machado Monteiro pedromachadomonteiro at gmail.com
Thu Feb 12 07:40:06 PST 2015


Hello:



I´m trying to



1. transform coordinates with ogr2ogr, for every shape in folder “FONTE”
and its subfolders

2. put the results in a destination (sub)folder "Teste"

3. organize automatically the results, in the same manner as in source
“FONTE” (results organized in destination subfolders that have the same
names of the source subfolders)



I succeed in doing operations 1 and 2 with this string:



D:\Es\FONTE>*for /R %f in (*.shp) do* ogr2ogr -s_srs "+proj=tmerc
+lat_0=39.66666666666666 +lon_0

=1 +k=1 +x_0=200000 +y_0=300000 +ellps=intl +pm=lisbon +units=m +no_defs
+nadgrids=DLX_ETRS89_geo.gs

b +wktext" -t_srs "+proj=tmerc +lat_0=39.66825833333333
+lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0

 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" -f "ESRI Shapefile"
*Teste* "%f"



The results go to "Teste", but with no subfolders



How can I include operation 3 in that string?



Between *Teste* and "%f" I’ve tried to include "%~dpf", "%~dpnf" and
"%~dpnf.shp" but always got errors.



From:
http://gis.stackexchange.com/questions/25366/ogr2ogr-convert-all-shapefiles-in-a-directory




Thank you very much

Pedro Monteiro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150212/b5a3e868/attachment-0001.html>


More information about the gdal-dev mailing list