Am I thinking about geolocation/DB storage correctly?

This page summarizes the projects mentioned and recommended in the original post on /r/reactnative

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • geolib

    Zero dependency library to provide some basic geo functions

  • Hey all, I'm currently using Expo's location plugin. This gives the user's latitude and longitude, which I'm storing in a Firebase Firestore document. I want to have a functionality where a user can select a distance radius (say, nearest kilometer, nearest 10 KM, and a global option which shows all) compared to the user's current location and show all available data within it. There's a library called geolib which can calculate the metered distance between two points. This is great, however I'm having trouble trying to think about how to query for these objects. I don't want to query ALL the documents and then filter down the documents based on their location on the FE, which means I'd probably need to query the backend for this specific data. This is where I'm running into some trouble. I'd basically have to have a firebase compound filter where I'm calculating the distance between the user's current location and +10 miles on the FE. Can somebody shed some light on this approach? I'm thinking: 1. Get users point 2. Calculate an arbitrary point that is essentially 10km away from users point (mathmatically?) 3. Query Firebase Firestore backend for results within that latitude/longitude. It just seems really complicated, and I'm wondering if I'm doing something wrong.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts