ogr2ogr with file list

Bart van den Eijnden bartvde at XS4ALL.NL
Tue Jul 26 13:44:47 EDT 2005


I would do it like this:

Start fwtools batch file.

Go to the directory which contains your input files (my directory is  
C:\temp\input).

Type:

C:\temp\input>for %f in (*.shp) do ogr2ogr "c:\temp\output\%f" %f -s_srs  
"+init=
epsg:42304" -t_srs WGS84

They will be created with the same name but in c:\temp\output.

Best regards,
Bart

On Tue, 26 Jul 2005 19:26:22 +0200, Tyler Mitchell <tylermitchell at SHAW.CA>  
wrote:

> Hi Yar,
> I'm pretty sure I've done this before, but not sure I've done it to  
> create a shapefile.
>
> Instead of specifying a single input shapefile as the dataset, specify a  
> folder containing several shapefiles.  Then also specify an alternate  
> output layer name.  Something like this might work...
>
> ogr2ogr -t_srs WGS84 /data/merged.shp /data/inputshp/ -nln merged
>
> I'm going to need to do the same thing shortly, so I will find out what  
> mistakes I made here.  Don't forget that it's:
>
> ogr2ogr <output dataset> <input dataset> [<input layer> optional]
>
> ----- Original Message -----
> From: Yar Doroshenko <numerous at GMAIL.COM>
> Date: Tuesday, July 26, 2005 10:08 am
> Subject: [UMN_MAPSERVER-USERS] ogr2ogr with file list
>
>> Hi Guys,
>>
>> I'm working on automating my shapefile coordinate conversions. I
>> know how
>> to do single file conversion:
>>
>> ogr2ogr input.shp output.shp -t_srs WGS84
>>
>> Now, can I automate the process? Let's say I have a list of
>> shapefiles that
>> I want to convert, would I do something like:
>>
>> for %f in (path_here\list.in) do ogr2ogr %f
>>
>> I tried this one in many different ways, but I do get errors.
>>
>> Would anyone have a correct syntax for multiple file conversions?
>>
>> Thank you
>>
>> Yar
>>
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the mapserver-users mailing list