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
Win7+Internet Explorer: GeoJSON example invalid object #358
Comments
The problem seems to be a character in the input file that the JSON parser in IE 11 doesn't understand:
|
The invalid character is in https://worldwind.arc.nasa.gov/web/examples/data/geojson-data/world_main_cities.geojson. I haven't identified which one. @pdavidc @markpet49, as this is not a bug in the GeoJSON parser itself, I propose to postpone this issue. |
@AkeluX FYI, I researched this a bit and it appears to be related to a size limitation for JSON strings in IE. If you shorten up world_main_cities.geojson, for instance, the problem goes away for that file. Initially, I thought it was related to unix style line endings, but that turned out not to be the case. The reported error message is misleading. |
Here's a summary of what we've decided: |
@markpet49 The current world_main_cities.geojson works on IE11 when I serve it from my local computer. I've also discovered that world_borders.geojson is actually 2MB larger than world_main_cities.geojson and works fine from worldwind.arc.nasa.gov. I guess the problem goes away when shortening the file because we remove the problem from the file, but it does not seem related to its size. @pdavidc I propose to go ahead with the release plan and continue investigating the cause for this issue independently. What do you think? |
@AkeluX This sounds good to me. |
@AkeluX Hi Yann. I dug in to this some more. You are correct that it is not size related. There are a number of non-printable (>0x7E) characters in the file. To see their location, I executed the following commands (on unix):
A quick fix is to clean the file with the following command:
After this, the file loaded fine, but some of the place names with non-printable (>0x7E) characters may have spelling issues. However, they are not likely to be spelled correctly with the current version. |
Thank you for looking deeper into this. Just as a thought, could it be that this file is encoded differently, e.g. UTF-8 vs UTF-16? |
@AkeluX Good thought, but many of the occurrences look suspiciously like garbage characters. Examples (with an exclamation point at the non-printable character position): "Amundsen!Scott South Pole Station" and "San Mart!n Station". I estimate about 100 lines out of 1200 have the issue. |
The new files proposed in #450, which are in UTF-8, also fix this issue! This screenshot was taken in Win7/IE11, see Lulea and Malmo. |
Fixed via the action taken in #450. |
Description
When running the GeoJSON example, the example stops loading with the following error:
GeoJSON.parse: invalidGeoJSONObject.
Operating System and Version
Windows 7/IE 11
The text was updated successfully, but these errors were encountered: