Closed LeviRemi closed 2 years ago
@LeviRemi - I track this down. It's deep down in the dependency chain; when you get down to it, this repo is use to convert geojson geometry to Esri geometry. See this code specifically:
case 'Point':
result.x = geojson.coordinates[0];
result.y = geojson.coordinates[1];
if (geojson.coordinates[2]) {
result.z = geojson.coordinates[2];
}
result.spatialReference = spatialReference;
break;
Note that m
is not handled at all. z
should get set, but their check, if (geojson.coordinates[2])
, fails to work as needed when the value of the third coordinate is 0
, as it is in your example. Really, the best thing to do would be get a PR fix in on that repo - to properly handle z coordinates, and to handle m
coordinates as well
@LeviRemi - note that the GeoJSON spec doesn't say anything about m-values; just x, y, z.
Bug logged at https://github.com/terraformer-js/terraformer/issues/78.
@rgwozdz Nice catch! I will take a look at the terraformer code today and see about submitting a PR.
As for M Values, that's a good point. Probably best to abandon expectation of built-in M support when the GeoJSON spec itself omits it. I have other ways of tracking the M value, so no worries there.
PR open at terraformer-js/terraformer/pull/79
I'll pull the updated dep into winnow, and note here when published.
Released FeatureServer 3.5.1, which contains winnow 2.51, which contains terraformer 2.1.1, which has the fix.
Excellent! Thank you for the quick update, @rgwozdz. I will close this for now since this update takes care of the Z-value issue and the missing m-value was determined to be a non-issue.
I am sending 4-dimensional coordinates to Koop as an esriGeometryPoint, but only the x and y coordinates are returning from a feature layer query. I suspect this is due to the hasZ and hasM properties being false, but I cannot find a way to manually set them true.
I tried passing hasZ: true and hasM: true in the geojson's metadata for koop's
getData()
callback function, but have had no success. Could anyone tell me how this is done, or if this is even possible? Thanks in advanced!GeoJSON plugged into getData callback:
GeoJSON response from Koop on FeatureLayer query: