Geometry Service - Project Transformations?

5456
7
01-07-2011 06:44 AM
RyanCoodey
Occasional Contributor III
Is there no way to set the transformations used with the Project operation in a Geometry service?  I have to project some things from NAD_27 to WGS_84 in our Silverlight application and the default transformation is not acceptable.

Thanks a lot!
0 Kudos
7 Replies
GaëtanLAVENU
Esri Contributor
I have the problem, I would like to be able to choose a datum transformation via Rest "Project" operation on geometry services.
0 Kudos
RaviNarayanan
Esri Contributor
Geometry service project operation via REST does not support explictly specifying a datum for transformation.  In the case when a transformation is not provided to the geometry service project method, one of the 3 default transformations will be used. Please see
http://help.arcgis.com/en/sdk/10.0/arcobjects_cpp/componenthelp/index.html#//000w00000205000000

For transformation between WGS1984 to NAD_1927, the default transformation used is:
esriSRGeoTransformation_NAD1927_To_WGS1984_4, forward and reverse, WKID = 1173
0 Kudos
RyanCoodey
Occasional Contributor III
Thanks a lot for the information ravi!  Maybe in the future we will be able to specify the transformation?

Thanks!
0 Kudos
nicogis
MVP Frequent Contributor
0 Kudos
SamLarsen
New Contributor III
Do you know when will this be added to the JavaScript API as an option in the Geometry Service Project method?
0 Kudos
nicogis
MVP Frequent Contributor
in 10.1 rest you can use datum transform:
http://servicesbeta2.esri.com/arcgis/sdk/rest/project.html
in js if it's not implemented you can use esri.request:


            var g = { geometryType:"esriGeometryPoint", geometries:[wgsPt.toJson()] };
            var params = { f:"json", geometries:dojo.toJson(g), inSR:4326,
                outSR:wkidMap, transformation:atransformation, transformForward:atransformForward
            };

            var requestHandle = esri.request({
                url:"http://servicesbeta4.esri.com/arcgis/rest/services/Geometry/GeometryServer/Project",
                content:params,
                callbackParamName:"callback",
                load:dojo.hitch(dojo.mixins(this, "OnSuccessProject"))
            }, {useProxy:false});

0 Kudos
SamLarsen
New Contributor III
I have also created an interim solution until the API catches up:

//  Use the hosted 10.1 Beta ArcGIS Server Geometry Service
gsvc = new esri.tasks.GeometryService("http://servicesbeta4.esri.com/arcgis/rest/services/Geometry/GeometryServer");
//  create a new point from the geolocation location
var point = new esri.geometry.Point(
 location.coords.longitude, location.coords.latitude, 
 new esri.SpatialReference({
  wkid: 4326
 })
);
//  set the output spatial reference for the project method
var outSR = new esri.SpatialReference({
 wkid: 27700
});
//  tack on two parameters in the query object - these will be added to the url and will give us a more accurate transformation
gsvc._url.query = dojo.mixin(gsvc._url.query, {
 //  set the datum transformation to OSGB_1936_To_WGS_1984_Petroleum (1314)
 //  the options are listed here: http://servicesbeta2.esri.com/arcgis/sdk/rest/dattrans.html
 transformation: 1314,
 //  we are transforming backwards in this case
 //  FROM WGS84 TO OSGB36
 transformForward: false
});
//  call the geometry service project method as you would normally
gsvc.project([point], outSR, function (projectedPoints) {
 //  get the projected point
 pt = projectedPoints[0];
 //  add it to the map
 addGraphic(pt);
 //  zoom the map to the added point
 map.centerAndZoom(pt, 17);
});
0 Kudos