Select to view content in your preferred language

convert WGS84 to 27700 using geometry service - what datum transformation?

4358
11
04-08-2014 07:28 AM
MikeSteven
Regular Contributor
Hi,

I'm trying to convert coordinates from WGS84 to British National Grid using the geometry service but when I do this, the points all seem to be a bit out (maybe 100m or so). From reading up on this it seems that the reason is probably I'm not doing a datum transformation to the coordinates. However, I can't find out what value to put in for the datum transformation.

The starting coordinates come from the geolocation API so are in WKID 4326, so the starting datum should be WGS1984 I think. The output spatial reference is British National Grid (WKID 27700) so it's datum is OSGB_1936. I've been searching to find out what the value for the datum transformation should be and the closest I've come is EPSG::1314 which is for WGS1984_To_OSGB_1936. I've tried specifying this as the datum transformation value but the output point is in the same location as if I leave this datum transformation parameter blank.

Has anyone else come across this?

   function zoomToLocation(location) {
    var pt = new Point(location.coords.longitude, location.coords.latitude, new SpatialReference({
     wkid : 4236
    }));
    var outSR = new SpatialReference({
     wkid : 27700
    });

    var PrjParams = new ProjectParameters();
    PrjParams.geometries = [pt];
    PrjParams.outSR = outSR;
    var datumtrans = 1314;
    PrjParams.transformation = datumtrans;

    geometryService.project(PrjParams, function(projectedPoints) {
     console.log('Conversion completed. Datum Transformation: ' + datumtrans + '.');
     pt = projectedPoints[0];
     map.centerAndZoom(pt, 8);
    });
   }
0 Kudos
11 Replies
JohnGravois
Deactivated User
my pleasure Mike.  please consider marking this thread as 'answered'.
0 Kudos
derekswingley1
Deactivated User
Unfortunately, this is a bug in the docs. It should be transformForward, not transformationForward. See http://jsfiddle.net/9WXDx/2/.

We'll get this updated next time we update the docs.
0 Kudos