Closed javagl closed 1 month ago
I believe this is a duplicate of https://github.com/CesiumGS/cesium/issues/4801.
As a workaround, you can set scene3DOnly
to true
when creating the viewer to avoid this error.
I'm going to close your issue to keep the discussion in one place. If you have any further input on this, please post it there instead.
I don't want to argue about what to close for which reason, but will mention a few points, at least for completeness:
the error here is "RangeError: Invalid array length" (and not "DeveloperError: normalized result is not a number" as in the other issue)
the stack traces do not seem to have anything in common
I just tried out the data from https://github.com/CesiumGS/cesium/issues/4801 , and this does not cause an error for me. I.e. even without scene3DOnly:true
, it does not cause a "normalized result is not a number" error. It just renders properly.
Edit:
What happened?
CesiumJS bails out with a
for certain GeoJSON data near the south pole.
Specifically, for a GeoJSON polygon with the coordinates
(inlined in the sandcastle below).
The problem is that here,
numVertices
will beNaN
, because therhumb.surfaceDistance
above isNaN
, because ... (several debugging steps deeper) ... thesigma1
andsigma2
here are both-Infinity
.(I think that whenever
Math.log
is called, one has to make very, very very sure that either the argument is not 0, or the downstream computation anticipates the possible-Infinity
. This did not happen here...)Reproduction steps
Open this sandcastle:
https://sandcastle.cesium.com/index.html#c=jVNdb5swFP0rFk9EoqbRqiojNKrE1ErTpk5LtZd5D665Sa0aX2SbVHTiv89AYJBm0nix7z0fvoaDQG0dOUh4BUNuiIZXkoGVVUF/dL2QBaKrM9SOSw2GBYs100yLTunAuk/cca/9zTQhLHB1CSxI/O4OuKsMZKgUCCdRsyDqOZoXR06rH9vC2LbbGc2tekE0AKXBEoyT0PNnjpXRCe5FksMu8YbJw32WLOmHJPu+XV2xgDStSXM8cdeP2Nn87N2Pp5+9yjhCi+4BC3Cmnox8KvtaKSe/oar34+UHkkA0udTczQ7vn1nxrvSNi+X1Jb2MyMVHv/yKzuCr/8NX/8KvJ/gcnpWTYtw2/aZbfLPp0nIM1T3gZ4u6TcwWKyOAKuR5OKRoQd0z6HBX6S4vJMxH4mJ4x31W6V/EUp7nU+Z6RnxDLB7xBG8W6yAKUutqBZth8FtZlGgcqYwKKY0dFKVqv0/8VIkXcFRYO3in8VSa5vJAZH5z5l8hQnFrPbKrlNrKNx+MTRp7/jtp+yKk3j8cwChet7Tn5eZL36SUprEvzysdonri5sT5Dw
Sandcastle example
(See above)
Environment
Browser: All CesiumJS Version: 1.122 Operating System: All
This was originally brought up, with real-world data (quite literally "real-world data"...), at https://community.cesium.com/t/25mb-geojson-file-related-rangeerror-invalid-array-length/35754