-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GeoJSON renders incorrectly with default Rhumb arc type #8042
Comments
This may due to the same issue as #7864. Try this Sandcastle which sets the arc type back to what it used to be. Let me know if this looks correct. |
@OmarShehata, thanks for your reply. Here is my updated Sandcastle example like you propose: var viewer = new Cesium.Viewer('cesiumContainer');
var dataSource = Cesium.GeoJsonDataSource.load('https://gist.githubusercontent.com/ezze/98a77f60cab8d24613f440599bece3a5/raw/9ac4498a1f0d3f3c80792a73a52672f1c847f43d/russia.json');
dataSource.then(function(data) {
// Change the arcType to GEODESIC, which is what it was in CesiumJS 1.53.
for (var i = 0; i < data.entities.values.length; i++) {
var entity = data.entities.values[i];
if (Cesium.defined(entity.polygon)) {
entity.polygon.arcType = Cesium.ArcType.GEODESIC;
}
}
viewer.dataSources.add(dataSource);
}); Everything works fine now. Your workaround is fine for me at the moment. But will it be fixed? |
Glad to hear the work-around solves your issue. The reason this originally changed in #7492 (comment) was to be compliant with the GeoJSON spec:
So I'm surprised that this actually produces the wrong result compared to all the other visualizers you cited. @shehzan10 do you know why this might be? |
Same issue came up again on the forum here: https://groups.google.com/d/msg/cesium-dev/MwWRudF0axw/S6hSHn-rBwAJ |
Just a reminder here that the use of rhumblines in GeoJSON is not spec compliant. We use rhumblines to emulate the behavior seen at geojson.io, which goes with the interpretation that GeoJSON lines are shortest-paths in the CRS |
For anyone who wants to do some close reading, here's the relevant section of the spec linked at the PR referenced above: https://tools.ietf.org/html/rfc7946#section-3.1.1
|
Congratulations on closing the issue! I found these Cesium forum links in the comments above: https://groups.google.com/d/msg/cesium-dev/MwWRudF0axw/S6hSHn-rBwAJ If this issue affects any of these threads, please post a comment like the following:
|
This GeoJSOn still has some issues |
Work started in https://github.com/AnalyticalGraphicsInc/cesium/tree/fix-rhumb-triangulation but needs an approach that will work at the north and south poles. |
Came up again here: #8812 (comment). In this case, the polygon fill seems to get stuck trying to be computed (you can tell the viewer thinks the data source is still being loaded because the timeline is stuck, unless you set GeoJSON: countries.geo.txt |
Also reported in #8789. See that issue for another example file |
I have run into a similar issue rendering a geojson containing large multipolygons. Here is a sandcastle example. For the sake of completeness here is a sandcastle example with the workaround. I have verified the geometry is valid, and have tried the arc type workaround described above to no avail. Any insight the Cesium team could provide would be very much appreciated. Update: I was able to get my data set rendering correctly. It turns out the issue was the southern most polygon wrapped from bounding box border to bounding box border. Splitting the offending polygon and converting all multipolygons to polygons in the geojson data set fixed the rendering issues. |
I'm using Cesium 1.60.0 and trying to load GeoJSON describing borders of Russia. I extracted this GeoJSON from shape files found on NaturalEarth (1:50m resolution, cultural). Unfortunately, Cesium does something wrong while rendering the GeoJSON. Seems like it draws polygon lines between points that should not be connected with each other.
I report this issue because this GeoJSON is displayed as expected with another software such as QGIS.
Sandcastle example
Cesium doesn't display GeoJSON properly
QGIS displays GeoJSON as expected
geojson.io displays GeoJSON as expected
mapshaper.org displays GeoJSON as expected
Browser: Chromium Version 75.0.3770.142 (Official Build) Built on Ubuntu , running on Ubuntu 18.04 (64-bit)
Operating System: Kubuntu 18.04
The text was updated successfully, but these errors were encountered: