FRAMES | NO FRAMES
Geodata Transformations

Overview

This is supported from 10.1 onwards.

The image service's Add operation and Update operation support a geodataTransforms parameter. This parameter is an array of geodataTransform objects. A geodataTransform object has the following JSON syntax:

{
  "geodataTransform" : "<geodataTransformName>",
  "geodataTransformArguments" : {<geodataTransformArguments>}  
}

There are three types of geodataTransform objects. The structure of the geodataTransformArguments object varies based on the geodataTransform name.

Polynomial Transformation

The arguments for the Polynomial transformation are as shown below:

{
  "geodataTransform" : "Polynomial",
  "geodataTransformArguments" : {  
  "sourcePoints" : [<sourcePoint1>, <sourcePoint2>, <sourcePoint3> ...], //array of points
  "targetPoints" : [<targetPoint1>, <targetPoint2>, <targetPoint3> ...], //array of points
  "coeffx" : [<coeffx11>, <coeffx12>], //array of doubles
  "coeffy" : [<coeffy11>, <coeffy12>], //array of doubles
  "inverseCoeffx" : [<inverseCoeffx11>, <inverseCoeffx12>], //array of doubles
  "inverseCoeffy" : [<inverseCoeffy11>, <inverseCoeffy12>], //array of doubles
  "spatialReference": {<spatialReference1>},
  "polynomialOrder": <polynomialOrder1> //integer: 1, 2, or 3. Frist order requires at least 3 pairs of control points; second order requires at least 6 pairs of control points; third order requires at least 10 pairs of control points; use more control points to get better fit (smaller RMS)
  }
}

Example:

{
  "geodataTransform" : "Polynomial",
  "geodataTransformArguments" : {
  "sourcePoints" : [ {"x":0.0, "y":0.0}, {"x":0.0, "y":200.0}, {"x":200.0, "y":0} ],
  "targetPoints" : [ {"x":100.0, "y":100.0}, {"x":100.0, "y":300.0}, {"x":300.0, "y":100.0} ],
  "polynomialOrder" : 1,
  "spatialReference": {"wkid" : 54004}
  }
}

Projective Transformation

The arguments for the Projective transformation are as shown below:

{
  "geodataTransform" : "Projective",
  "geodataTransformArguments" : {
    "sourcePoints" : [<sourcePoint1>, <sourcePoint2>, <sourcePoint3> ...], //array of points
    "targetPoints" : [<targetPoint1>, <targetPoint2>, <targetPoint3> ...], //array of points
    "coeffx" : [<coeffx11>, <coeffx12>...], //array of doubles
    "coeffy" : [<coeffy11>, <coeffy12>...], //array of doubles
    "inverseCoeffx" : [<inverseCoeffx11>, <inverseCoeffx12>], //array of doubles
    "inverseCoeffy" : [<inverseCoeffy11>, <inverseCoeffy12>], //array of doubles
    "spatialReference": {<spatialReference1>}
  }
}

Example:

{
  "geodataTransform" : "Projective",
  "geodataTransformArguments" : {
  "sourcePoints" : [ {"x":551.18, "y":817.09}, {"x":653.84, "y":714.43}, {"x":819.49, "y":712.10}, {"x":895.71, "y":789.87} ],
  "targetPoints" : [ {"x":596.29, "y":878.53}, {"x":655.39, "y":815.54}, {"x":733.94, "y":806.21}, {"x":765.05, "y":850.54} ],
  "spatialReference": {"wkid" : 54004}
  }
}

Identity Transformation

The arguments for the Identity transformation are as shown below:

{
  "geodataTransform" : "Identity",
  "geodataTransformArguments" : {
    "spatialReference": {<spatialReference1>}
  }
}

Example:

{
  "geodataTransform" : "Identity",
  "geodataTransformArguments" : {
  "spatialReference": {"wkid" : 54004}
  }
}