bagpipemike

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

Discussion created by bagpipemike on Apr 8, 2014
Latest reply on Nov 14, 2014 by amarsden
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);
    });
   }

Outcomes