Syntax trouble extracting elevation from Geojson

Hi all,
I am working with a geojson file, and trying to extract a nested object to include as a displayed output of a command syntax. This object is a more uncommon, optional 3rd parameter (point type geometries usually only specify two values for coordinates). This third value is for elevation. I am having trouble forming a command syntax that will extract that particular object- perhaps because “coordinates” is a subset of the “geometry” property? I dunno, and sorry, pretty new at this.

In short, and if it’s possible, I need the last part of the syntax command that will extract that object and display it as part of an embedded url fetch and listing command in Nightbot. I just don’t know how to format the proper command for it to see that nested property under “coordinates”, which is nested under, and as a subtree of “geometry”. Do I put .geometry.coordinates, or .geometry/coordinates- or in short, how do you get the command to go past the “geometry” field and into its subset of “coordinates”??

The answer might be simple, and sorry for the newbie question.
Thanks for any help.

Hey @seeker77!

Yes, you use . (dots) to access JSON keys’ content, unless they’re anything else than a string, then you use ['key']. See the MDN documentation.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.