Skip to content

Line by Line GeoJSON Format

Neil Rotstan edited this page Nov 1, 2018 · 7 revisions

The structure of traditional GeoJSON files isn't very conducive to streaming, resulting in files being pulled completely into memory during task creation. That naturally limits the size of files that can be processed.

For challenges containing a large number of tasks, we recommend an alternative line-by-line format instead. Each line in the file should represent a standalone FeatureCollection JSON object that encapsulates a single task. During processing, only one line of the file need be pulled into memory and parsed at a time, making it possible to support very large files.

As a simple example, a line-by-line GeoJSON file with three tasks might look like this:

{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-82.9908295,42.435009]},"properties":{"address":"13001 East Seven Mile","latitude":"42.435009","longitude":"-82.9908295","business_name":"Lions Auto Sales"}}]}
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-82.94074,42.42207]},"properties":{"address":"10709 Morang","latitude":"42.42207","longitude":"-82.94074","business_name":"Great Lakes Investment"}}]}
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-83.129097,42.3111]},"properties":{"address":"8118 West Vernor","latitude":"42.3111","longitude":"-83.129097","business_name":"St. Gabriel Church"}}]}

MapRoulette automatically detects the line-by-line format when processing GeoJSON files, so there is no need to use a different file extension or otherwise indicate that a file uses line-by-line formatting.

Clone this wiki locally