Why are my GeoJSON files being saved without line breaks? Why are they missing the proper formatting? All features in the file are being saved in the same line.
I'm using QGIS 3.6.3.
Here is what I believe is "proper formatting"
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
The JSON format does not strictly foresee line breaks: a valid
JSON files can be just a self-enclosed, single-line string.
It is to be noted however that (from the official ECMA-404 document)
Insignificant whitespace is allowed before or after any token. Whitespace is any sequence of one or more of the following code points: character tabulation (U+0009), line feed (U+000A), carriage return (U+000D), and space (U+0020). Whitespace is not allowed within any token, except that space is allowed in strings.
One can therefore add line breaks (before or after tokens) to improve readability, but they are completely optional, and that is one of the reasons why most programs do not add them to their outputs.
As for importing
GeoJSONs into MapBox, they suggest a number of tools:
There are several open source tools for converting other geospatial data formats to GeoJSON. A few favorites are: