Why does this Mapserver layer not overlay correctly onto Google Maps?

المشرف العام

Administrator
طاقم الإدارة
I'm using mapserver to serve an overlay of weather data onto a google map (V2) and the weather data is not displaying where it should.

The image below shows the problem i am having. The black lines are the land border of Alaska, as you can see, they do not line up. The brown lines represent lat long lines.

As you can see the relationship between the lat lon lines and the borders of Alaska align correctly, however they don't match up with google.



The WMS request i am using looks like the following:

http://mysite.com/cgi-bin/mapserv?m...3464081945&WIDTH=256&HEIGHT=256&reaspect=true

The bounding box is built using the following javascript:

var lULP = new GPoint(a.x * 256, (a.y + 1) * 256);var lLRP = new GPoint((a.x + 1) * 256, a.y * 256);var lUL = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lULP, b, false);var lLR = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lLRP, b, false);var lBbox = lUL.x + "," + lUL.y + "," + lLR.x + "," + lLR.y;and this is my mapfile

MAP#CONFIG "PROJ_DEBUG" "ON"#CONFIG "CPL_DEBUG" "ON"#CONFIG "MS_ERRORFILE" "/opt/fgs/www/htdocs/airlog/logs/ms_error.txt"#DEBUG 5IMAGETYPE PNGSIZE 400 300SHAPEPATH "/opt/fgs/www/htdocs/data"#FONTSET "/opt/fgs/www/htdocs//data/fonts.txt"IMAGECOLOR 255 255 255 TRANSPARENT OFFWEBMETADATA"wms_title" "WMS Demo Server""wms_onlineresource" "http://10.142.62.153/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/mymap.map&""wms_srs" "epsg:4326 epsg:900913"ENDENDPROJECTION"proj=merc""a=6378137""b=6378137""lat_ts=0.0""lon_0=0.0""x_0=0.0""y_0=0""k=1.0""units=m""nadgrids=@null""wktext""no_defs"ENDEXTENT -20037508.34 -20037508.34 20037508.34 20037508.34UNITS metersLAYERTYPE RASTERSTATUS ON#NAME GISIMAGE_RADAR_CUR_ALASKA_TESTGROUP radarALASKA_TESTDATA "/opt/fgs/www/htdocs/Bristow/GISIMAGE_RADAR_CUR_ALASK.png"PROJECTION"proj=latlong""a=6367451.5""b=6367451.5"END UNITS DDPROCESSING "DITHER=YES"# For Mapserver 3.x, we would use# OFFSITE 0OFFSITE 0 0 0ENDSYMBOLNAME "circle"TYPE ellipseFILLED truePOINTS1 1ENDEND# Graticule (lines of constant lat-lon)LAYERNAME "Graticule"PROJECTION"proj=latlong""a=6378137""b=6378137"#"ellps=WGS84"#"datum=WGS84"ENDTYPE LINESTATUS ONCLASSCOLOR 180 180 180LABELTYPE BITMAPSIZE SMALLCOLOR 90 90 90POSITION AUTOOUTLINECOLOR 255 255 255ENDENDGRID# In lat-lon coordinate system, lines will always be straight (need 2 pts)MINSUBDIVIDE 2MAXSUBDIVIDE 180 # MAXINTERVAL must be < MININTERVAL or mapserver will hang.# MININTERVAL 15# MAXINTERVAL 10# MINARCS 18# MAXARCS 10LABELFORMAT '%.f'ENDENDENDI think the issue is related to the output WKT in the map file but i'm not really sure and i would certainly appreciate help from those far more experienced than me at this stuff!

Thanks everyone in advance, and if i have neglected to include some critical information, please let me know :)



أكثر...
 
أعلى