Geojson from table data

Here is an easy way to convert a spreadsheet table to geojson. First you need a table containing the information you want to show in your map. If this table already has geopositions taht is great, but you have to make sure the columns of geocoordinates has the right variable names. The columns must be named lat and lon. Check out the following table:

https://docs.google.com/spreadsheets/d/1YGmpAlhoLHj9CYTM6mZcTKLRWxeE5WopcnjArC0v0rw/edit?usp=sharing

This table already has the lat and lon columns so it can be used in geojson.io, but first you have to download it as a .csv (comma separated values) file from google sheets. If you are using excel or some other spreadsheet software you can do the same thing and download it as a .csv file.

Once you have th .csv file go to:

http://geojson.io/#map=2/20.0/0.0

Now simply drag the .csv table from your file browser on to the white area to the right on geojson.io and KABOOM you have geojson!

Some more work is usually needed. You have to consider the variable names in relation to the excact Leaflet map you are using. In class we often use the newsmap with geojson. You can read about the properties in the geojson news map here:

In order for the news map to work well we should name our properties to match what is used in the news map. You can do this in you spreadsheet software or you can do it in the geojson.io tool and it is best done in the table tab in geojson.io view where you can rename the variable names on top of each column. This is easier than doing it JSON where you have to rename each instance of the variable name.

Here is the finished map with geojson from the table:

ANd here is the ifram used for the map above:

<iframe style="border: 0px;" src="https://gauteheggen.com/wp-content/uploads/2023/09/newsMap_franceTerror.html
" width="100%" height="420px" scrolling="no"><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>
</iframe>