Hello Steemians,
Creating a Web Map App with all Steemians locations might not seem like a super complex project, however, due to my lack of experience in Python and backend web design, I am forced to keep good track of my steps and take every single decision carefully.
The motivation behind is promoting meetups and user-to-user interaction . Hopefully, with this app users will easily find other Steemians in their neighborhood/area whether using a distance or province/country filtering.
With this roadmap I would like to describe the steps and challenges I have found so far in the current project that I am involved with.
Finding a map service
Retrieving locations from SteemData Server
Feeding Map with locations
Enabling Map filter feature
I was deciding between one of the following:
| pubnub | infosniper | batchgeo |
|---|---|---|
| yahoo |
Since most services are limited, I decided to going for google maps because of the extensive and good quality of its documentation.
The first step was finding a way to get all locations within the blockchain. My solution was using MongoDB and SteemData by Furion (https://steemit.com/steemdata/@furion/getting-started-with-steemdata).
This is the tricky part. Since I do not want to pay the subscription for unlimited geolocations calls, I have two possibilities:
Since I decided beforehand running the backend in Python, I chose the great tool "Geopy" as a remote geolocation service (running in Python). For the rest of the processes, I will be running Python3 and additionally the Pymongo module for the Database management.
Testing code so far:
from geopy.geocoders import Nominatim
import datetime
from steemdata import SteemData
geolocator = Nominatim()
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client.test_database
collection = db.test_collection
data2 = []
s = SteemData()
data = s.Accounts.aggregate(
[
{
"$match": {
"profile.location": { "$exists": "true", "$ne": "null" }
}
},
{
"$project":
{
"account":"$account",
"location":"$profile.location",
"_id":0
}},
{"$limit":5},
])
for element in data:
print(element["location"])
location = geolocator.geocode(element["location"])
data["location"] = location
print((location.latitude, location.longitude))
Please feel free to comment and suggest. I will post the final web url as soon as the app is ready. Thanks for reading.
-lightproject