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

Win7+Internet Explorer: GeoJSON example invalid object #358

Closed
markpet49 opened this issue Nov 17, 2017 · 11 comments
Closed

Win7+Internet Explorer: GeoJSON example invalid object #358

markpet49 opened this issue Nov 17, 2017 · 11 comments
Assignees
Milestone

Comments

@markpet49
Copy link
Member

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

@pdavidc pdavidc removed the bug label Nov 20, 2017
@pdavidc pdavidc changed the title GeoJSON example - invalid object Win7+Internet Explorer: GeoJSON example invalid object Nov 21, 2017
@pdavidc pdavidc added the bug label Nov 21, 2017
@pdavidc pdavidc added this to the WebWW v0.9.0 milestone Nov 21, 2017
@AkeluX
Copy link
Contributor

AkeluX commented Nov 22, 2017

The problem seems to be a character in the input file that the JSON parser in IE 11 doesn't understand:

SyntaxError: Invalid character\n at GeoJSONParser.prototype.parse (http://192.168.99.1:8080/build/dist/worldwind.js:50524:17)\n at Anonymous function (http://192.168.99.1:8080/build/dist/worldwind.js:50501:25)

@AkeluX
Copy link
Contributor

AkeluX commented Nov 22, 2017

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.

@markpet49
Copy link
Member Author

@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.

@pdavidc
Copy link
Contributor

pdavidc commented Nov 27, 2017

Here's a summary of what we've decided:
• Replace the file world_main_cities.geojson with one small enough to fit within the IE11 JSON size limitation.
• Document the IE11 JSON size limitation in the GeoJSON API docs.

@AkeluX
Copy link
Contributor

AkeluX commented Nov 30, 2017

@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?

@pdavidc
Copy link
Contributor

pdavidc commented Nov 30, 2017

@AkeluX This sounds good to me.

@AkeluX AkeluX added postpone and removed must have labels Nov 30, 2017
@AkeluX AkeluX removed this from the WebWW v0.9.0 milestone Nov 30, 2017
@markpet49
Copy link
Member Author

markpet49 commented Dec 10, 2017

@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):

cat -v wmc.geojson >wmc-cat.geojson
diff wmc.geojson wmc-cat.geojson

A quick fix is to clean the file with the following command:

tr -cd "\11\12\15\40-\176" <wmc.geojson >wmc-clean.geojson

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.

@AkeluX
Copy link
Contributor

AkeluX commented Dec 13, 2017

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?

@markpet49
Copy link
Member Author

markpet49 commented Dec 13, 2017

@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.

@pdavidc pdavidc removed the postpone label Feb 7, 2018
@AkeluX
Copy link
Contributor

AkeluX commented Feb 21, 2018

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.

screen shot 2018-02-21 at 14 46 34

@AkeluX
Copy link
Contributor

AkeluX commented Feb 23, 2018

Fixed via the action taken in #450.

@AkeluX AkeluX closed this as completed Feb 23, 2018
@ghost ghost removed the needs review label Feb 23, 2018
@pdavidc pdavidc added the nasa label May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants