ogr2ogr reprojection

Rahkonen Jukka Jukka.Rahkonen at MMMTIKE.FI
Thu May 18 06:48:39 EDT 2006


Hi,
 
I'm sorry about not being clear enough. You must manually edit the "call_convert.bat" by adding the missing parts, that is "call convert.bat " in the beginning of each row, and target name at the end of the row. Redirecting the file list to batch file prototype is only to help you in creating the working launching bat-file including all your shapefiles.
 
I suggest you to make first make manually a launch file with two or three rows only and test with that. When you see that it works you can put all your shapefiles on the list.
 
Regards,
 
-Jukka-

________________________________

Lähettäjä: UMN MapServer Users List puolesta: Zhonghai Wang
Lähetetty: to 18.5.2006 13:29
Vastaanottaja: MAPSERVER-USERS at LISTS.UMN.EDU
Aihe: Re: [UMN_MAPSERVER-USERS] ogr2ogr reprojection


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
	



More information about the mapserver-users mailing list