CesiumGS / CesiumGS/cesium

KML and GeoJSON artifacts when translated from (0,0) with large geographic extents

Open
#12,915 2 comments 0 reactions 0 assignees View on GitHub
category - data sources category - kml category - polygons/geometry needs triage type - bug
Dominant language
JavaScript
Stars
15.8k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

### What happened?

When viewing the attached KML and GeoJSON files in Google Earth, all polygons appear as expected without artifacts. In Cesium, however, both formats only match in shape when plotted near (0,0). The farther they are translated from (0,0), the more noticeable the artifacts become. Additionally, the artifacts differ visually between the KML and GeoJSON formats.

### Expected rough overall shape:
Image

### Origin near (0,0) – (All render as expected)
Text file of the points used is attached as `2-ExamplePoints-Origin0.txt`.

* GeoJSON – Cesium Sandcastle (Using `2-ExamplePlot-Origin0.geojson`)

Image

* KML – Cesium Sandcastle (Using `2-ExamplePlot-Origin0.kml`)

Image

* KML – Google Earth (Using `2-ExamplePlot-Origin0.kml`)

Image

### Small translation from (0,0)
Text file of the points used is attached as `2-ExamplePoints-Translated.txt`.

* GeoJSON – Cesium Sandcastle (Using `2-ExamplePlot-Translated2.geojson`)

Image

* KML – Cesium Sandcastle (Using `2-ExamplePlot-Translated2.kml`)

Image

* KML – Google Earth (Using `2-ExamplePlot-Translated2.kml`)

Image

### Large translation from (0,0)
Text file of the points used is attached as `2-ExamplePoints-Translated2.txt`.

* GeoJSON – Cesium Sandcastle (Using `2-ExamplePlot-Translated.geojson`)

Image

* KML – Cesium Sandcastle (Using `2-ExamplePlot-Translated.kml`)

Image

* KML – Google Earth (Using `2-ExamplePlot-Translated.kml`)

Image

### Attachments
[ExamplePlotsAndPoints.zip](https://github.com/user-attachments/files/22514357/ExamplePlotsAndPoints.zip)

### Reproduction steps

1. Drag-and-drop the attached KML and GeoJSON files into Cesium Sandcastle. The polygons and lines used are triangulations of the attached `ExamplePoints*.txt`.
2. Compare the rendered shapes between plotting near (0,0), the small translation, and the translation near North America.

### Sandcastle example

https://sandcastle.cesium.com/#c=bY+xTsMwEEB/5ZQplSJbrDSNkFqJpVUHKqYsrnMpFhc7ss9pA+LfiRsQCOrtnt+zztrZwDAYPKOHFVg8wxqDiZ14vrK8zvR1XjvLylj0dbZY1ra2cyPwwmib/Cua4car08a7fmcuxhbwPumsCZXf24TvoVUUsEi4pfHgvjH7mChMR0rQpLr+4B69i7b5aT4Wy6zIysAjYTXLAA+m651niJ5yISRj15NiDPIY9Suy0CGkrZNayt9p2ZgBTLO68c20QAjTTRuJnswb1llVysn/l5JTjbGn/YCe1Ji0l7tqO0MhRCmn8XbJztFR+T8vfwI

### Environment

Browser: Edge
CesiumJS Version: 1.133
Operating System: Windows 11

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the linked Cesium Sandcastle example and the attached ExamplePlotsAndPoints.zip files, especially 2-ExamplePlot-Origin0.geojson, 2-ExamplePlot-Translated.geojson, and their KML counterparts. Compare rendering near (0,0) and near North America, then trace the KML and GeoJSON loading and polygon triangulation paths. Done means translated polygons and lines retain the expected shape without format-dependent artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.