Skip to content

Altitude/elevation support #117

Description

@Jellyfrog

Hi,

It would be nice if this supported Alitudes, if im reading the RFC right it's an optional feature of GeoJSON for example:
https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1

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.

Example usage:

use Location\Coordinate;
use Location\Polyline;
use Location\Formatter\Polyline\GeoJSON;

$polyline = new Polyline;
$polyline->addPoint(new Coordinate(52.5, 13.5, 1.0));
$polyline->addPoint(new Coordinate(62.5, 14.5, 2.0));

$formatter = new GeoJSON;

echo $formatter->format($polyline); // {"type":"LineString","coordinates":[[13.5,52.5,1.0],[14.5,62.5,2.0]]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions