Mensaje

Un espacio abierto para compartir y debatir sobre el avance tecnológico y su relación con el mundo forestal. Software, drones, apps, satelites, etc.

martes, 14 de julio de 2015

Convert from decimal degrees to sexagesimal degrees (WGS84) or viceversa and generate a GeoJSON file (for any GIS soft) directly from a Spreadsheet

Hello everyone,


Sometimes we have to work with spatial data that is written in a paper, and most of the time it is in WGS84 (at least for me). It can be written in decimal degrees, like: lat 71,746284 W long 42,856483 N or in sexagesimal degrees, like lat 71° 23' 45,5" E long 42° 42' 34,78" S. We may have many coordinates and need to work with it in some appropriate software, like QGIS, gvSIG, arcMap, arcview, or any other. I use QGIS, but I hope this solution works for most of you (it won't for the old arcview users).


The most common solution is to write the data in a spreadsheet and save it as a CSV (comma separated value) file, and after that import it with your software. It is a good workaround, but I will give you an easier solution: a spreadsheet that converts the data for you and exports it to a GeoJSON file ready to open with your software (it has to read that extension thou).


Here it is:


Written coordinates to GeoJSON spreadsheet (adf.ly doesn't heart, if you are not interested in ads, just wait 5 sec and skip)


It is blocked to edit it, so you first need to save a copy to your drive (google drive). After that you are ready to use it. And I will tell you how:


The first thing you have to know is that, to export the data to a GeoJSON file the coordinates must be written in decimal degrees, but don't worry much about it...


"Sexagesimal to decimal" sheet:
Use this sheet if you have your data in sexagesimal degrees. Do not modify the column named "decimal" because it has the conversion formula. The data is copied automatically to "to export sexagesimal" sheet, where you have the button to export the data.

This is the sheet you have to complete with the data (the yellow fields are the one to fill in, the rest autocalculate):


"Decimal to sexagesimal" sheet:
Use this sheet if you have your data in decimal degrees.
It is basically the same that the previous one but it converts decimal degrees to sexagesimal degrees. Do not modify the columns named "grad" "min" and "sec". The data is copied automatically to "to export decimal" sheet, where you have the button to export the data.

This is the sheet:



And finally, this is the sheet where is the button to export the data:



Once you click "export" you have to choose the fields:



and when you hit "export"...


Then click in "download GeoJSON file"...


and finally click where the red arrow says.. and that is it!

EASY!


It works, but I am trying to improve it, so, check for updates.

It also has a "graphic" map, just to see if you are in the right hemisphere ;)


I hope it is handy to you!
If you like it please share the post (not the sheet)
Your comments are welcome.
SUBSCRIBE!