Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to use rhumb lines for geometry #4000

Closed
mramato opened this issue Jun 3, 2016 · 11 comments
Closed

Add option to use rhumb lines for geometry #4000

mramato opened this issue Jun 3, 2016 · 11 comments

Comments

@mramato
Copy link
Contributor

mramato commented Jun 3, 2016

Once #3998 gets merged, example.geojson.txt loads nicely in Cesium but exposes an existing bug we never noticed. Check out these two screenshots, one from geojson.io and one from Cesium:

geojson.io

image

Cesium

image

As you can see, Polygons (and other surface geometry) are currently connected with geodesics. While GeoJSON doesn't specify what the correct behavior is, most users seem to expect rhumb. We should add an option to all surface geometry to allow for either behavior and then hook up GeoJsonDataSource to use it.

@mramato
Copy link
Contributor Author

mramato commented Jun 6, 2016

The next version of the GeoJSON spec is in its final draft stages (and actually has been approved already I believe). I haven't read the whole thing yet, but it now explicitly defines hows to connect points to form geometry (and as suspected, Cesium is currently doing the wrong thing).

@mramato
Copy link
Contributor Author

mramato commented Jul 14, 2016

Maybe I missed a conversation somewhere, but it would be nice if this happened long before the mythical 2.0 release we want to do. We need to make sure we conform to the latest GeoJSON spec.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 14, 2016

I expect it will happen sooner since we likely need it for 3D Tiles. Not sure why this is labeled 2.0.

@hpinkos
Copy link
Contributor

hpinkos commented Jul 14, 2016

Sorry, I just labeled it 2.0 because we have a bunch of other geometry issues labeled 2.0

@alberto-acevedo
Copy link

+1

@wallw-teal
Copy link
Contributor

While users may expect lat/lon boxes to be interpolated as rhumb lines, that is probably not true of other shapes. An option in the API would be nice, but the shortest distance between two points is always the geodesic. The 2D map library used by geojson.io is simply rendering a straight line in cartesian space between the 5 points in each box, which is taking advantage of the fact that a Mercator projection is being used (rhumb lines are straight lines in Mercator projections).

If an addition to the API is made, I would highly suggest taking a look at Karney's algorithms as implemented in GeographicLib. His algorithm for geodesics is faster than Vincenty's method and does not have the same issues with antipodal points. There is an ellipsoidal rhumb line algorithm as well.

Our application does its own GeoJSON parsing via another library and detects lat/lon rectangles. We then use Cesium.RectangleGeometry, which renders the rectangles as you expect.

@ggetz
Copy link
Contributor

ggetz commented Oct 26, 2017

Came up on the forum again: https://groups.google.com/forum/#!topic/cesium-dev/_T3vRx1D858

@mccoy1
Copy link

mccoy1 commented Feb 19, 2018

+1

1 similar comment
@zbennett10
Copy link

+1

@hpinkos
Copy link
Contributor

hpinkos commented Jan 24, 2019

Added in #7492

@hpinkos hpinkos closed this as completed Jan 24, 2019
@cesium-concierge
Copy link

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/forum/#!topic/cesium-dev/_T3vRx1D858

If this issue affects any of these threads, please post a comment like the following:

The issue at #4000 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants