GeoLocation storage in DB User table - lan-solo-capstone/freeshare GitHub Wiki

User table will have 2 fields:

latitude: { type: Sequelize.DECIMAL(8, 6), }, longitude: { type: Sequelize.DECIMAL(9, 6), },

We tried using GEOMETRY data type - but it ends up requiring PostGIS DB extension, etc. and it was hard to make it work. Since we are only interested in longitude and latitude static data to drop pins on the map, we believe this is a sensible approach. Mapbox is expecting the geolocation data to be number, so we are simply passing it as Decimal format.

Reference: https://stackoverflow.com/questions/1196415/what-datatype-to-use-when-storing-latitude-and-longitude-data-in-sql-databases