[FWTools] batch reproject shapefiles

pyroGIS pyrogis at gmail.com
Wed Oct 1 16:36:43 EDT 2008


Thank you Brian and Matt,

That was it..I feel a little silly for not being able to piece that apart
and deduce it for myself.

Lesson learned eh? I really appreciate the assistance from you both!

Cheers * joe

On Wed, Oct 1, 2008 at 12:57 PM, Bryan Keith <bryan at ideotrope.org> wrote:

> > as a complete n00b to batch variables, i'm having a little difficulty...
> >
> >
> > C:\user\shp\census>batchreproj.bat
> >
> > C:\user\shp\census>set prj_params=-s_srs epsg:4269 -t_srs epsg:2229
> >
> > C:\user\shp\census>for %g in (*.shp) do (ogr2ogr -f "esri shapefile"
> > -s_srs
> > ep
> > sg:4269 -t_srs epsg:2229 output\%g %g )
> >
> > C:\user\shp\census>(ogr2ogr -f "esri shapefile" -s_srs epsg:4269 -t_srs
> > epsg:2
> > 229 output\fe_2007_06083_taz00.shp fe_2007_06083_taz00.shp )
> > ERROR 1: Failed to create file .shp file.
> > ERROR 4: Failed to open Shapefile `output\fe_2007_06083_taz00.shp'.
>
> Larso,
>
> Does the "output" directory exist?
>
> Maybe try "mkdir output" before running the script?
>
> Bryan
>
> >
> > ERROR 1: Terminating translation prematurely after failed
> > translation of layer fe_2007_06083_taz00
> >
> >
> > On Wed, Oct 1, 2008 at 9:09 AM, Matt Wilkie <matt.wilkie at gov.yk.ca>
> wrote:
> >
> >> If you're on windows, try something like this:
> >>
> >>   set prj_params=-s_srs epsg:4617 -t_srs epsg:3578
> >>
> >>   for %%g in (*.shp) do (
> >>      ogr2ogr -f "esri shapefile" %prj_params% output\%%g %%g
> >>      )
> >>
> >>
> >> Change prj_params to suit your source and destination projections of
> >> course. There are some more involved examples at
> >> http://code.google.com/p/maphew/source/browse/#svn/trunk/gis/canvec
> >> and
> http://code.google.com/p/maphew/source/browse/#svn/trunk/gis/geobase
> >>
> >> cheers,
> >>
> >> matt wilkie
> >> --------------------------------------------
> >> Geographic Information,
> >> Information Management and Technology,
> >> Yukon Department of Environment
> >> 10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
> >> 867-667-8133 Tel * 867-393-7003 Fax
> >> http://environmentyukon.gov.yk.ca/geomatics/
> >> --------------------------------------------
> >>
> >>
> >> pyroGIS wrote:
> >>
> >>> hello members,
> >>>
> >>> i've recently seen the light and have begun a full embrace of FWTools,
> >>> gdal, ogr2ogr, etc. i imagine this is a basic question for some of you
> >>> out
> >>> there:
> >>>
> >>> what is the syntax for a batch reproject operation of a folder full of
> >>> shapefiles from one coord sys to another?
> >>>
> >>> i cannot find an example within the -help or through various google
> >>> queries...thank you_larso
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------
> >>>
> >>> _______________________________________________
> >>> FWTools mailing list
> >>> FWTools at lists.maptools.org
> >>> http://lists.maptools.org/mailman/listinfo/fwtools
> >>> http://fwtools.maptools.org/
> >>>
> >>
> >>
> > _______________________________________________
> > FWTools mailing list
> > FWTools at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/fwtools
> > http://fwtools.maptools.org/
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20081001/90d2c269/attachment.html


More information about the FWTools mailing list