bruvellu / cifonauta

Marine biology image database by CEBIMar/USP
http://cifonauta.cebimar.usp.br
GNU General Public License v3.0
21 stars 5 forks source link

Add geolocation information by clicking on a map #264

Open bruvellu opened 10 months ago

bruvellu commented 10 months ago

Geolocation is an informative metadata, but it's not always embedded in the image. Users can input the latitude and longitude in the form, but it's time-consuming to switch to another page with a map, find out the coordinates, and then copy and paste the values.

To make it easier to input and edit geolocation data, the user could directly click on a map to extract the coordinates.

GeoDjango is a full app for dealing with geolocation data in Django. It might be an overkill for what we need, but it does seem to have a built-in functionality for extracting coordinates from a map by clicking (PointField). See this article for an example approach.

This functionality was included in the desktop editor Véliger. See the DockGeo class and the functions therein. How to convert between sexagesimal and decimal is here.

Currently, the fields storing latitude and longitude are regular a CharField. But perhaps more appropriate would be a DecimalField. The FloatField apparently is not ideal for that. How many digits should we include in these decimal values? According to this table, four digits give us an 11-meter accuracy, which should be good enough for the type of data we have. Or perhaps five digits (1m)? (also see the responses here)

Some map frameworks and APIs:

bruvellu commented 8 months ago

Initial implementation using Google Maps working since 0528ee037198215e5136a743aa27206b9d64969d

bruvellu commented 5 months ago

Google Maps requires a billing account to continue using. This may not be possible for us.

We should probably pivot to Leaflet which is active and has all the features we need.