Adding Geodesic Lines

46 views
Skip to first unread message

Michael Jurkoic

unread,
Nov 30, 2020, 1:40:15 PM11/30/20
to OpenLayers Dev

Hello,

I am interested in contributing code to OpenLayers that will allow users to draw geodesic (great circle) arcs between two points.  I've read the contributing guide, and I am starting to work on code for the feature.  This is my first time contributing to an open source project.  Is there anything I should know in general, or about adding this feature in particular?

Thanks,
Michael

Andreas Hocevar

unread,
Nov 30, 2020, 3:32:10 PM11/30/20
to OpenLayers Dev
Hey Michael,

thanks for your interest in OpenLayers, and for willing to improve the library. I'm not sure if it makes sense to add such a feature to OpenLayers, because there is a library (arc, https://www.npmjs.com/package/arc) already which provides that. You can see that it integrates well with OpenLayers in one of the official examples: https://openlayers.org/en/latest/examples/flight-animation.html.

That said, you might be able to save yourself some time using that library.

Andreas.

--
You received this message because you are subscribed to the Google Groups "OpenLayers Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlayers-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlayers-dev/52012b27-c1ad-4001-84f3-110c23b9cfecn%40googlegroups.com.

Michael Jurkoic

unread,
Nov 30, 2020, 5:01:26 PM11/30/20
to OpenLayers Dev
Andreas,

That was my thought: to use Arc to make this feature possible.  The best route seems to be to extend LineString or MultiLineString, and use Arc within that new class to build great circle arcs.  It would abstract the arc generation away from the user, but, since it would extend LineString, it would be easier to integrate that functionality with other parts of the library.

Would it make sense to add Arc as an OpenLayers dependency for that purpose?

Michael

You received this message because you are subscribed to a topic in the Google Groups "OpenLayers Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openlayers-dev/aiuh9nLPy28/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openlayers-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlayers-dev/CAOiJ94iteVgCH-NUo8ey4EW1_U7gcOwAW6VZXDe6F5HbqQ9Yeg%40mail.gmail.com.

Andreas Hocevar

unread,
Dec 1, 2020, 3:48:52 AM12/1/20
to OpenLayers Dev
Hey Michael,

I'd be hesitant to make Arc a dependency of OpenLayers. Like Turf and other tools that work with geometries, Arc works with GeoJSON, and so does OpenLayers. We are planning to remove the geometry classes from OpenLayers In the near future, and use GeoJSON directly as well.

Andreas.

Michael Jurkoic

unread,
Dec 1, 2020, 1:12:22 PM12/1/20
to OpenLayers Dev
Hi Andreas,

I wasn't aware of plans to remove the geometry classes, but it sounds exciting.

Will the drawing interactions that currently use geometries then be modified to work directly with GeoJSON?

Michael

Reply all
Reply to author
Forward
0 new messages