OpenBazaar / openbazaar-go

OpenBazaar 2.0 Server Daemon in Go
MIT License
993 stars 283 forks source link

Feature request: Location based search #1467

Open fire-pig opened 5 years ago

fire-pig commented 5 years ago

For service based listings (and many product based listings), location is an important factor in determining whether a listing is relevant or not. Someone who lives in Panama, for example, probably doesn't care to see listings for plumbers in Alabama. Likewise, someone searching for a car/boat/house, probably only wants to see listings within a fairly short distance.

Tags can be kludged to provide crude location search, but it would be handy if OB provided better location search / visualization.

One concern that has been brought up is that using an API (such as the Google Maps api) would potentially deanonymize OpenBazaar users to the map api provider.

However, I think there are sufficient tools to build location based search entirely self-hosted without any calls to outside services (albeit at the cost of disk space, code complexity), using the tools below:

  1. Google Plus Codes - a system to assign an address to every location on earth down to a 3 x 3 meter level of granularity. Open source.

  2. OpenAddresses.io - Global library of addresses. Open Source. Global address db is about 12 GB, but you can download smaller regions if you only need local data.

  3. Mapkeep - Self-hostable mapping app which uses OpenStreetMap data, OpenMapTiles, Mapbox GL JS, and Nominatum (Open Street Map server) to display addresses.

fire-pig commented 5 years ago

Some more libraries that might be helpful for this project.

osm - a general purpose library for reading, writing and working with OpenStreetMap data in Go (golang). It has the ability to read OSM XML and PBF data formats available at planet.osm.org or via the v0.6 API.

go-staticmaps is a golang library that allows you to create nice static map images from OpenStreetMap tiles, along with markers of different size and color, as well as paths and colored areas.

Pelias - A modular, open-source geocoder built on top of Elasticsearch for fast and accurate global search.