Latlong in, tmerc OSGB36 out?

Dave Pearson pearsondave at HOTMAIL.COM
Wed Nov 15 13:31:30 PST 2006


Hello list,

I have a problem I just can't see the answer to, hope someone can help!
I have made a php mapscript service which accepts lat/long WGS84 GPS 
co-ordinates, but I wish to display the extents given in lat/long in the 
british ordnance survey transverse mercator projection, OSGB36. I have a 
mixture of shapefiles in both latlong (WGS84) and OSGB36.

I can get the service working accepting latlong and rendering latlong, but 
at the latitude of the UK everything looks really "squished" vertically.

How can I pursuade mapserver to project in OSGB36 yet still accept all input 
co-ords in latlong?  I think the clue may be in the "+to" of proj4 - or am I 
wrong in thinking mapserver can handle such a thing?

Here is my mapfile as it stands - unfortunately it's latlong, and doesnt 
honor the to - I think? Can anybody help please?

OUTPUTFORMAT
        NAME png
        DRIVER "GD/PNG"
        IMAGEMODE pc256
END

WEB
        IMAGEPATH "/var/gis/webgis/maps/"
        IMAGEURL "http://localdomain/webgis/maps/"
END
MAP
        STATUS ON
        SIZE 500 380
        EXTENT  -11.0 44.0 9.0 59.0
        UNITS dd
        SHAPEPATH "/var/gis/live"
        IMAGECOLOR 247 245 222
        FONTSET "/var/gis/live/fonts/fonts.txt"
        PROJECTION
                "proj=latlong"
                "ellps=WGS84"
                "datum=WGS84"
                "nodefs"
# this bit doesnt seem to get recognised
                "to"
                "proj=tmerc"
                "lat_0=49.000000000"
                "lon_0=-2.000000000"
                "k=0.9996012717"
                "x_0=400000.000"
                "y_0=-100000.000"
                "ellps=airy"
                "datum=OSGB36"
                "no_defs"
        END

LAYER
        CONNECTIONTYPE postgis
        NAME custpoi_pointl
        PROJECTION
                "proj=latlong"
                "ellps=WGS84"
                "datum=WGS84"
        END
        DATA "the_geom from custpoi_point"
        CONNECTION "user=postgres password=***** dbname=**** host=127.0.0.1"
        STATUS DEFAULT
        TYPE ANNOTATION
        CLASS
                TEXT " "
                STYLE
                        SYMBOL "poi1"
                        COLOR 238 0 0
                        SIZE 10
                        ANTIALIAS TRUE
                END
                LABEL
                        TYPE truetype
                        FONT arialb
                        SIZE 0
                        COLOR 238 0 0
                        FORCE FALSE
                        POSITION AUTO
                END

        END
END
LAYER
        NAME andesl7
        PROJECTION
                "proj=tmerc"
                "lat_0=49.000000000"
                "lon_0=-2.000000000"
                "k=0.9996012717"
                "x_0=400000.000"
                "y_0=-100000.000"
                "ellps=airy"
                "datum=OSGB36"
                "no_defs"
        END
        STATUS OFF
        MINSCALE 3000000
        TILEINDEX "al7.shp"
        TILEITEM "location"
        TYPE RASTER
END
END

Regards

Dave Pearson

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free! 
http://imagine-msn.com/messenger/launch80/?locale=en-gb



More information about the MapServer-users mailing list