Why the transformation of the z-coordinate of the AGSPoint from one Spatial reference to another does not work

1227
4
04-09-2022 03:27 PM
fedotevseev
New Contributor

Hello everyone, please tell me why the transformation of z coordinates does not work x and y values changes, but z coordinate not change, I need the z coordinate to change according to the specified height of the vertical spatial reference, maybe I'm using the wrong tool for this?

an example of the code that I use:

let point1 = AGSPointMake3D(48.8589505, 2.2768487, 698.458, 0, .wgs84()

let transform1 = AGSGeometryEngine.projectGeometry(point1 as AGSGeometry, to: translate.inputSpatialReference)
let transform2 = AGSGeometryEngine.projectGeometry(point1 as AGSGeometry, to: translate.outputSpatialReference)
let transform3 = AGSGeometryEngine.projectGeometry(point1 as AGSGeometry, to: dhhn)
let transform4 = AGSGeometryEngine.projectGeometry(point1 as AGSGeometry, to: .webMercator())

 

print in concole: 

Optional(AGSPoint: (48.858930, 2.276841, 698.458000, 0.000000), sr: 4269)
Optional(AGSPoint: (48.858951, 2.276849, 698.458000, 0.000000), sr: 4152)
Optional(AGSPoint: (48.858951, 2.276849, 698.458000, 0.000000), sr: 4258)

Optional(AGSPoint: (5438953.490354, 253524.372136, 698.458000, 0.000000), sr: 3857)

 

0 Kudos
4 Replies
DiveshGoyal
Esri Regular Contributor

Make sure the spatial references you are using are created with a vertical WKID that specifies the vertical coord system. https://developers.arcgis.com/ios/api-reference/interface_a_g_s_spatial_reference.html#ae1b20d3100e7...

You can check if your spatial references have a vertical component using the hasVertical property
https://developers.arcgis.com/ios/api-reference/interface_a_g_s_spatial_reference.html#a0e0bd2138b15...

0 Kudos
fedotevseev
New Contributor

Yes spatial references have a vertical wkid, I'm testing to two spatial references

first: wkid 4326
verticalWKID 7837
results z-coordinate 562.5691528320312
second: wkid 4326
verticalWKID 0
results z-coordinate 562.5691528320312

but result z coordinate for different spatial references is the same

0 Kudos
DiveshGoyal
Esri Regular Contributor

Are these the input spatial reference? Or the target?

can you provide WKID and verticalWKID of both input and target spatial references, along with the coordinates you are projecting, and the results you are getting. We can try to repro on our end

It is very hard to piece together this information from your messages above

0 Kudos
fedotevseev
New Contributor

My goal is to get the transformed height in DHHN2016 (verticalWkid 7837), from WGS 84 (verticalWKID 115700).
To do this, I created:

Снимок экрана 2022-04-16 в 18.46.11.png

Снимок экрана 2022-04-16 в 18.47.41.png

The result I am trying to get from converting the height of wgs 84 to the height of dhhn2016:

I probably don't use some additional transformation to achieve the desired result

Снимок экрана 2022-04-16 в 18.37.42.png

0 Kudos