[Gvsig_english] reproject swiss epsg 21781 to wgs84 with gvsig

Bernhard Draeyer draeyerb at hotmail.com
Wed Dec 16 11:24:16 CET 2009


hello

i try to reproject a shp-layer with the swiss epsg 21781 coordinate system to the epsg 4326 (wgs84) system. unfortunately the geometry is displayed some 200 m northeast from where it should be. i couldn't find out so far if the transformation doesn't work properly or if i do some wrong manipulation. this is how i proceeded so far:

1. create a user crs from a copy of the 21781 projected swiss grid. set azimuth from 90 to 89.9 and rectified height to 89.9 (since the original 21781 gives an error, when these params are set to 90).

2. open a view and apply the user crs to it.

3. add the shp-file to the layer. it displays with correct swiss coordinates.

4. open the geoprocess manager and select reproject. source prj is my user crs. target prj is epsg 4326 wgs84. there exists no epsg transformation in the table so the transformation was done by grids->chenxy06.gsb (which can be downloaded from the webpage of the swiss federal office of topography). a layer "..wgs84" is added to the view.

5. export the "..wgs84" layer as shp.

6. import the "..wgs84" shp in a new view with epsg4326 set as view crs. (could't figure out if i could do this step without exporting and importing the shp).

7. the new shp is displayed about 200 m to the northeast, where it should be. how do i know? because transformations with other tools give me correct results. for example the same shp transformed with arc map displays correct. also the transformation with ogr2ogr from fwtools works fine.

so where is the error?
A) i do not use correctly the geoprocess manager.
B) there is some transformation problem with the swiss coordinate system.

what looks strange to me:

fwtools uses the same gdal library as gvsig, right? so i compared some files. it seems, that the crs definitions are stored in the gcs.csv and pcs.csv files. these files in the gvsig folder are older, than the ones in the fwtools folder. in addition there exists a gcs.overrdide.csv in the fwtools with a replacement line for the 4149 CH1903 definition, which is referenced for the epsg 21781. it reads:

4149,CH1903,6149,CH1903,6149,9122,7004,8901,1,0,9603,674.374,15.056,405.346,,,,

compared to the line with gvsig:

4149,CH1903,6149,9122,7004,8901,1,0,,,,,,,,

so i replaced the epsg 4149 line in the gcs.csv from gvsig and also replaced the azimuth value from 90 to 89.9 in the epsg21781 line.
-> there is no difference when reprojecting

->>> this let me assume, that probably gvsig doesn't use the gcs.csv and pcs.csv files on startup but uses perhaps a seperate database.

in this case, is the database accessible for changing entries or can it be forced to (re-?) read the csv.

now i'm out of ideas ... somebody here to help cracking the mystery or who had similar problems?

many thanks

bernie

 		 	   		  
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009


More information about the Gvsig_internacional mailing list