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

Always raise error "1:1 error Parse error on line 1: " t y p e "" when analysing result with geojsonhint #110

Open
clemosm opened this issue May 23, 2019 · 2 comments
Labels

Comments

@clemosm
Copy link

clemosm commented May 23, 2019

I wanted to use osmtogeojson in order to upload osm data to mapbox. So I used osmtogeojson, but Mapbox says "Unknown filetype" and when I analyse any result from osmtogeojson with geojsonhint, I always get :

1:1 error Parse error on line 1:
" t y p e "
^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'INVALID'

And the data I obtained is :
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "id": "node/1853272897", "properties": { "timestamp": "2017-03-11T12:50:59Z", "version": "4", "changeset": "46761722", "user": "sbiribizio", "uid": "354284", "name": "Capo Linaro", "natural": "cape", "wikidata": "Q3657144", "wikipedia": "it:Capo Linaro", "id": "node/1853272897" }, "geometry": { "type": "Point", "coordinates": [ 11.8357546, 42.028944 ] } } ] }
So I don't know where the problem comes from (I thought of different encodings maybe).

@clemosm clemosm changed the title Always catch error "1:1 error Parse error on line 1: " t y p e "" when analysing result with geojsonhint Always raise error "1:1 error Parse error on line 1: " t y p e "" when analysing result with geojsonhint May 23, 2019
@tyrasd
Copy link
Owner

tyrasd commented Nov 27, 2019

Hmm, that's odd. The result looks correct as posted above.

Mapbox says "Unknown filetype"

did you try renaming the file to have .geojson file ending?

different encodings maybe

Maybe. Normally, the result should be in utf-8. can you check if this is actually the case on your end? also: what system do you run?

@clemosm
Copy link
Author

clemosm commented Nov 27, 2019

I run Windows 10. I guess it's in utf-8 already because Sublime Text correctly display it when I ask "open with encoding.." (I don't know how to check otherwise; and I don't have the files at the moment). I didn't rename anything... I thought of a encoding error within osmtogeojson (like reading and writing with different encodings or a missing character Idk).
Hopefully I could finally download my dataset in smaller pieces from overpass-turbo (which also uses osmtogeojson...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants