PointFieldMetadata altitude

Afternoon LEAF,

How do I populate the altitude (z dimension) of a 3D PointFieldMedata object? I found that I could set the dimensionality to 3D but couldn’t find anything that told me where to put the Z field.

So how do I go from this:

“{"type": "Point", "coordinates": [-79.9559, 39.6295]}”

To this:

“{"type": "Point", "coordinates": [-79.9559, 39.6295,ALTITUDE]}”

Thank you!

LEAF’s Geospatial values are represented as GeoJSON, and the GeoJSON representation of positions is an X,Y array for 2D, or X,Y,Z array for 3D.

A position is an array of numbers. There MUST be two or more
elements. The first two elements are longitude and latitude, or
easting and northing, precisely in that order and using decimal
numbers. Altitude or elevation MAY be included as an optional third
element.

Your “to this” example is exactly what you need.

1 Like

To create a 3D Point in Java, use the overloaded of() method:

Point p = Point.of(longitude, latitude, altitude);
2 Likes