ogr2ogr reprojection
Zhonghai Wang
zhonghaiw at GMAIL.COM
Thu May 18 03:29:05 PDT 2006
Hi Jukka,
I've tried what you said, but it doen't work.
the command "dir /b *.shp>call_convert.bat" just simply writes the file path
into the call_convert.bat file, and the convert.bat command is never be
called.
after performing "dir /b *.shp>call_convert.bat" I get the file path in the
call_convert.bat instead of call convert.bat destination_1 source_1
and call convert.bat destination_2 source_2.
something is wrong?
thanks
zhonghai
On 5/18/06, Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi> wrote:
>
> Hi,
>
> Another alternative is to make one batch file (.bat) for the actual
> conversion and call it with parameters from another. Like this
>
> convert.bat
> ========
>
> ogr2ogr [-all fixed parameters like -s_srs and -t_srs here] %1 %2
>
>
> call_convert.bat
> ===========
> call convert.bat destination_1 source_1
> call convert.bat destination_2 source_2
> call convert.bat destination_3 source_3
> etc.
>
> Conversion is started by running "call_convert.bat", and "destination_1"
> and "source_1" will be treated as %1 and %2 by the "convert.bat",
> respectively.
>
> To start with call_conver.bat you can first insert all your shapefiles
> there by command
> dir /b *.shp >call_convert.bat
>
> dir /b /s puts there all shapefiles from subdirectories as well.
>
> This may be a brutal way but it has some advantages. For example you can
> add some extra commands to "convert.bat" to be executed after each
> conversion. This way I use to make log files with time stamps about raster
> file batch conversions.
>
> Regards,
>
> -Jukka Rahkonen-
>
>
>
> ________________________________
>
> Lähettäjä: UMN MapServer Users List puolesta: Jelmer Baas
> Lähetetty: to 18.5.2006 8:17
> Vastaanottaja: MAPSERVER-USERS at LISTS.UMN.EDU
> Aihe: Re: [UMN_MAPSERVER-USERS] ogr2ogr reprojection
>
>
>
> Zhonghai Wang wrote:
> > Hi,
> >
> > I've tried with this batch command, but I failed, because I don't know
> > how to specify the -s_srs and -t_srs parameters, should it be something
> > like this?
> >
> >> for %a in (*.shp) do ogr2ogr.exe %a -init=epsg:4326 -init=world:CH1903
> >
> > **init=world:CH1903 is for switzerland, and I am sure that this
> > projection code is right.
>
> yeah, this should do it. Sorry for my short last response though.
>
> This should execute
> ogr2ogr.exe <filename> -init=epsg:4326 -init=world:CH1903
>
> For each .shp file you have. What is the error you receive? Perhaps the
> ogr2ogr.exe isn't in the same folder?
>
> --
> Jelmer Baas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060518/6f2691a6/attachment.htm>
More information about the MapServer-users
mailing list