[Proj] Proj4 transform from WGS84 to UK Northings and Eastings help needed ...
Hugo Tyson
Hugo.Tyson at cpslocates.com
Tue May 23 07:43:21 PDT 2006
Hi Penny,
proj-bounces at lists.maptools.org <> wrote:
> I have some Navteq data, which I believe is in WGS84 decimal degrees.
> I am using an ESRI product (which uses proj4) to project the data
> into british national grid northings and eastings. However, when I
> project the data, the coordinates appear to be between 100 to 200m
> out from where I would expect. <SNIP>
I was doing the same in November 2005, and I ended up writing what
follows to the proj and qgis mailing lists. Frank suggested using
OSGB36 as the name of the datum, which is fine, so please read the
below with that change in mind, "osgb36" not "airy". Hope it helps,
- Hugo
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
http://www.cpslocates.com/
=************************************************************
Matrix Everywhere
CPS To Strengthen Presence In Japan As Demand For Its Location Solutions Grows
More information: http://www.cpslocates.com/cps/news_detail.asp?ID=169
********************************************************************************
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.
********************************************************************************
More information about the Proj
mailing list