mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.24k stars 2.23k forks source link

GeoJson LineString coordinates should accept altitude/elevation/height #10174

Open zevero opened 3 years ago

zevero commented 3 years ago

Motivation

Mapbox v2.0.0 has such cool new 3d Terrain. I was all thrilled and tried it out on my paragliding page for displaying flights. Using a geoJson source, LineString coordinates (lat, lng) do not include altitude/elevation/height. So the result in my type: 'line' layer is quite unusable. image

Design Alternatives

  1. Include altitude as a third field in LineString coordinates
  2. Offer another possibility for showing 3d track information

Design

Design 1 should be quite easy to implement, if extending the standard is a possibility Design 2 would require more code changes, but would offer more functionality (individual color and individual width for each line segment, realtime updates, ...)

In both ways, there will be more fun with 3d with 3d lines in mapbpx gl js v2.0.0

EDIT: Related to https://github.com/mapbox/mapbox-gl-js/issues/3993

karimnaaji commented 3 years ago

Hi @zevero , thanks for the feedback. Elevated polylines is a feature we have on our roadmap. We would have to eventually allow polylines to be excluded from being draped (as this is currently the default behavior when used with terrain).

joedjc commented 3 years ago

Will it also be possible to encode altitude in a similar way in MVTs?

eidge commented 3 years ago

Just a plus one to the above. Similar use-case but for gliders, would love to replace the map in Glana with Mapbox and this would be the perfect excuse!

bentfc commented 3 years ago

Hi, that's a good news!! Do you have any idea of a release date for this feature? At least a delay?

zevero commented 3 years ago

Please - if this will get implemented - do not forget optional rgba color and thickness control for each segment (or between keyframes)

If this LineString could be animated in time (showing icon, title, progressing line. curtain to the ground, deleting/fading its tail) the better. Just wishing, but maybe all these things could be part of some LineTrack definition ... some day in the future...

arcsump commented 3 years ago

They had difficulty implementing 3D in points so I would not count on it.

Hundreds of issues prior, their answer is "it is difficult to implement"

maximilianchristl commented 3 years ago

Is there any news or timeframe for this feature? We are currently working on an aviation / paragliding / freeflight app and are comparing different map providers. Mapbox would be our favourite, but misses the 3d path and point functionality, which would be necessary to display flight data. So this is a showstopper for the moment :(

txaiwieser commented 3 years ago

Did anyone get an alternative to draw lines that differ from the terrain altitude?

Walkeezy commented 2 years ago

Any update on this? Would be a really cool feature!

dpman421 commented 2 years ago

We have a use case of adding elevation to transmission power lines based on voltage level, so this would be really nice to have. T

hughes commented 2 years ago

Is this still on the development roadmap?

joedjc commented 2 years ago

I hope it is still planned, and we can have Z values for every geometry type - similar to how features are draped on terrain except we can customise and specify how far off the surface features should be. I'm sure it would open a lot of possibilities.

eeegs commented 2 years ago

My plus one please. Good feature to just see the terrain a line passes through between two elevated points.

anders86755 commented 2 years ago

It will be a very cool feature. I've been waiting for this feature for a long time. Any update on this?

JonPichel commented 1 year ago

Any updates on this? I'm eager to switch to Mapbox from ArcGIS for a Drone GCS application but 3D is absolutely essential. If this gets done it would open so many possibilities for Mapbox.

PorridgeBear commented 1 year ago

+1

In KML this is done with a 3rd altitude value on the LineString array:

          <LineString id="2">
              <altitudeMode>relativeToGround</altitudeMode>
              <coordinates>
              -0.2536228067690857,51.433380901664165,2.41
              -0.25374175204266086,51.43333070652216,2.41
              </coordinates>
          </LineString>
flymypi commented 1 year ago

@karimnaaji Is this still planned?

andrew-hossack commented 7 months ago

Not planned, sad to see this feature being ignored.

PorridgeBear commented 7 months ago

I note some others' motivations for wanting this relate to drones as does mine - a new industry that is only 2nd to AI in growth projections - to be a 55 billion dollar industry by 2030.

I would suggest this thread represents today a small bleeding edge before more demand inline with the industry predictions.

Selfishly and pragmatically I'd get ahead of this 😜

john-work-ios commented 6 months ago

Up!

veech commented 3 months ago

We're using ArcGIS JS only because it supports this functionality. I am eager to swap over to Mapbox once this feature becomes available!

astojilj commented 3 months ago

Work's ongoing on enabling mean-sea-level elevation. At the moment, it is possible to specify the height (z offset from ground) of individual line vertices using the geojson array property and expression that allows lookup into the array based on line progress ("lineMetrics" for the source needs to be set). See the video and explanation at https://github.com/mapbox/mapbox-maps-ios/issues/360#issuecomment-2270606596

E.g. the linked example sets it as:

        "line-z-offset": [
          "at",
          ["floor", ["*", [ "line-progress" ], 6.9]],
          ["get", "elevation"]
        ]
hughes commented 2 months ago

I hope that mean-sea-level or ground-relative altitudes are not the only options. For large-scale lines (eg. orbital paths) or raw GPS data, ellipsoidal height is helpful.

bfercher commented 2 months ago

Thank you so much @astojilj for your work. looking forward to the release of this :-)