Using QGIS/proj4 to map WGS84 LL to OSGB36 (UK) grid

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using QGIS/proj4 to map WGS84 LL to OSGB36 (UK) grid

Hugo Tyson

Change Request/FAQ candidate: Using OSGB36 UK grid

Apologies if this is posted in the wrong place -
the audience is intended to be users and developers
of both PROJ and QGIS.

Versions in use: proj-4.4.9; qgis-0.7.0

Using QGIS and cs2cs (proj4), we were unable to convert
from WGS84 Lat/Long to OSGB36 grid references matching
the Ordnance Survey's own website:
http://www.gps.gov.uk/convert.asp
(You have to register/log-in to use the converter)

Best we got was results roughly matching web OSGB tools
that don't do datum conversion, just projection (meaning
from OSGB36 datum Lat/Long to UK grid).

So we worked out that to get cs2cs to do the conversion
completely correctly, we had to tell it about the Airy
or OSGB 1936 *datum* as well as the Airy ellipse that
it already knows about.  To do this you need to add a line
to the datums data (sic) definition table in pj_datums.c
and re-build/re-install. The table starts:
C_NAMESPACE struct PJ_DATUMS pj_datums[] = {
/* id       definition                               ellipse  comments */
/* --       ----------                               -------  -------- */
"WGS84",    "towgs84=0,0,0",                         "WGS84", "",

and the extra line (anywhere in that table) needs to be:

"airy", "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "airy", "Airy 1830",

The numbers for the 7-value Helmert transformation came from the
OS web document http://www.gps.gov.uk/guidecontents.asp
which gives the values for converting *to* OSGB36 - proj requires
the inverse of that: "towgs84=...".  This definition isn't exactly
the inverse, it just has the signs flipped.  Given the nature of
the transformation that's good enough.

To use this datum in cs2cs, the runes to cast are these:
  cs2cs +proj=latlong +to +proj=tmerc +lat_0=49 +lon_0=-2
        +k=0.999601 +x_0=400000 +y_0=-100000 +ellps=airy
        +datum=airy +units=m +no_defs
which gives results within a couple of metres of the Ordnance
Survey's converter.  "+datum=airy" is the new bit.

PROJ-REQUEST: proj people, please include this datum in future
proj releases.

[QGIS-specifics snipped - this msg also in QGIS forum]

Thanks are due to proj and qgis authors et al for providing these
excellent tools in the first place.  We are using them just for
demo purposes, we're not in the GIS business at all, so they've
provided a very easy and useful way to start working in the
GIS world.

Thanks again and best regards,

        - Hugo

--
Hugo Tyson
Cambridge Positioning Systems Ltd
62-64 Hills Road
Cambridge
CB2 1LA

http://www.cpslocates.com/

=************************************************************
This email and any attachments are confidential. They have been checked for viruses but it is your
responsibility to conduct your own virus checks.

Cambridge Positioning Systems Limited, 62-64 Hills Road, Cambridge, CB2 1LA, is registered in England
under company number 2808344.
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj

proj-patch.txt (474 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using QGIS/proj4 to map WGS84 LL to OSGB36 (UK) grid

Frank Warmerdam
On 11/8/05, Hugo Tyson <[hidden email]> wrote:
> and the extra line (anywhere in that table) needs to be:
>
> "airy", "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "airy", "Airy 1830",

Hugo,

I think it would be more appropriate to name this datum OSGB36
instead of Airy.  I will incorporate an adjusted definition in the code.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

RE: Using QGIS/proj4 to map WGS84 LL to OSGB36 (UK) grid

Hugo Tyson
In reply to this post by Hugo Tyson
 <> wrote:

> On 11/8/05, Hugo Tyson <[hidden email]> wrote:
>> and the extra line (anywhere in that table) needs to be:
>>
>> "airy",
>> "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
>> "airy", "Airy 1830",  
>
> Hugo,
>
> I think it would be more appropriate to name this datum OSGB36
> instead of Airy.  I will incorporate an adjusted definition in the
> code.

Hi Frank, firstly thanks for your timely response.

Yeah, I was unsure which would be best -
often "+datum=fred +ellps=fred" seem to go
comfortably together but OSGB36 is
technically the better name.  I'll alter our
patches accordingly to match what'll be there
in forthcoming proj releases.  Thanks!

Thanks again and Best Regards,

        - Huge

--
Hugo Tyson, Cambridge Positioning Systems Ltd
=************************************************************
This email and any attachments are confidential. They have been checked for viruses but it is your
responsibility to conduct your own virus checks.

Cambridge Positioning Systems Limited, 62-64 Hills Road, Cambridge, CB2 1LA, is registered in England
under company number 2808344.


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj