I am testing Field Maps to collect points and I want to store the GPS Elevation value in a field.
My feature class has the Z enabled.
I tried
var sGeo = Centroid($feature)
return sGeo.z
But it does not return anything on Android or IOS. I am using the latest version of Field Maps on both.
I have also found that
var sGeo = Centroid($feature)
return sGeo.x
or
return sGeo.y
work on Android but not IOS.
Are there other functions I should be using?
Thanks
Solved! Go to Solution.
"Execution Error:Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference."
This was a bug in Field Maps web, we've already fixed it internally and it should be addressed in our June release. Arcade requires the feature and map to have the same spatial reference since it doesn't have a built in projection engine. The features we queried and used as samples in the Arcade Editor were not being projected to the basemap/map spatial reference so you would see this error. By switching the basemap, the feature and map now have the same spatial reference (Web Mercator presumably) so it works
@Larry This should work.
var geom = Geometry($feature)
if (!IsEmpty(geom)) {
return geom.z
} else {
return null
}
Thanks Aaron, we are close,
I am using a NAD83 UTM zone 22 base map and I get the error:
"Execution Error:Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference."
If I switch the base map to the ESRI World Imagery it works fine.
"Execution Error:Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference."
This was a bug in Field Maps web, we've already fixed it internally and it should be addressed in our June release. Arcade requires the feature and map to have the same spatial reference since it doesn't have a built in projection engine. The features we queried and used as samples in the Arcade Editor were not being projected to the basemap/map spatial reference so you would see this error. By switching the basemap, the feature and map now have the same spatial reference (Web Mercator presumably) so it works