Lately I’ve been using http://geojsonlint.com a lot to visualize simple geojson output. I find it too strict, however, in its purpose and need a more versatile tool to “throw geojson on a map.” Taking inspiration from both that site and the former turfjs.party, I built this tool to help visualize and manipulate geojson data in the browser.
The page is built with react.js, and the code is all available here: github.com/jenningsanderson/geo
See the instructions below:
Loading and Rendering GeoJSON
There are three ways to load geojson data:
- Paste geojson directly into the geojson text box and click Render
- Use the src= URL variable to point to a valid geojson source file.
- Use the geojson= URL variable to pass geojson in directly.
If no sources are specified, the page will automatically generate two datasets: random points and random polygons. You can toggle between the two with Previous and Next
Render will attempt to parse the text in the input box and if it is valid geojson, it will render it on the map.
Fit Bounds will move the map to the bounds of the currently rendered objects.
Previous and Next will cycle through the history of successfully rendered geojson objects. Each time a new geojson object is created, the previous geojson is stored in history.
QuadkeyClicking Get Quadkey will populate the quadkey input box with the quadkey for the smallest tile that can fit the currenty rendered geojson (with max zoom 15). Render Quadkey renders a GeoJSON polygon representation of the quadkey value currently in the text box.
turf.js OperationsA few turf.js operations can be selected from the drop down menu. If applicable to the selected operation, the amount and units can be adjusted. Run then performs the selected operation on the currently rendered geojson, updating the map with the results. To undo the operation, click Previous.
Built with these frameworks and tools:
tilebelt: A small and very powerful set of helper functions for working with tiles, bounding boxes, and quadkeys.
assembly.css: This site uses the assembly css library for the icons and styles.