Re-projection on the fly

Krung Saengpole saengpole at YAHOO.COM
Thu Aug 18 08:19:57 PDT 2005


Hi all,
I have one trouble about projection. My testing area is around UTM zone-47 and zone-48. The official road shapefile is translated both zones into zone-47 (Indian 1975). My road is in zone-48 (WGS84). So, I'd like to translate my utm-48 road data into zone-47. I used:
 
$proj48=ms_newProjectionObj("proj=utm,zone=48,ellps=WGS84,datum=WGS84,units=m,no_defs");
$proj47=ms_newProjectionObj("proj=utm,zone=47,a=6377276.345,b=6356075.413,towgs84=209,818,290,0,0,0,0,units=m,no_defs");
 
$line=ms_newLineObj();
$pt=ms_newPointObj();
$pt->setXY(195397,1604329);
$pt->project($proj48,$proj47);
$line->add($pt);
$pt->setXY(195385,1604354);
$pt->project($proj48,$proj47);
$line->add($pt);
.............
$shp->add($line);
 
My road should overlay onto official road. But it wasn't on the right place, it shifted to the left of official road about 350m. If I use data by not translating in map file as:
 
.............
# ------------- Official road ----------
LAYER
  NAME "road47"
  DATA "road/road47
  TYPE line
  PROJECTION
    "proj=utm"
    "zone=47"
    "a=6377276.345"
    "b=6356075.413"
    "towgs84=209,818,290,0,0,0,0"
    "units=m"
    "no_defs"
  END
  CLASS
    COLOR 0 200 0
  END
END
# ------------- my road ----------
LAYER
  NAME "road48"
  DATA "road/road48
  TYPE line
  PROJECTION
    "proj=utm"
    "zone=48"
    "ellps=WGS84"
    "datum=WGS84"
    "units=m"
    "no_defs"
  END
  CLASS
    COLOR 0 200 0
  END
END
.......
 
It works as it should be. What I've done wrong about the script above. Could I use this way to re-projection on the fly?
 
Thank you.
 
Krung
 



		
---------------------------------
 Start your day with Yahoo! - make it your home page 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050818/bd35d37b/attachment.htm>


More information about the MapServer-users mailing list