Open erdmenchen opened 7 years ago
Selecting the location directly on a map would also be helpful for non-address locations so you don't have to go to Google Maps, search for the place, copy the coordinates and paste them to the field in Monica.
@djaiss has mentioned adding places to Activities under #2306 and I'd like to continue this discussion. I don't believe commercial services, like Google Maps or Yelp, should used for a number of reasons. I'd suppest OpenStreetMap EDIT: using the Nominatim search API (assuming usage is low enough?).
@djaiss how would you this to work?
@pqhf5kd of course I don't want to use commercial services. But let me explain my reasonings here. We have to distinguish between a Venue and a place for which you know the address.
When you do an activity, you are either at home, or somewhere else. If it's at home, you know your address and then we can simply use the regular Place object that we already have (which will fetch also the GPS coordinates).
However if you are outside, there is big chance that you are in a Venue, ie a commercial place, of which you don't know the address. In my opinion and while I want to avoid commercial services as much as possible, there is no open source services out there where you can type "Theater" and get the list of theaters around your town with their exact addresses as details.
In my mind I'd love to indicate that I went to a restaurant with a friend, type the first letters of this restaurant when I log this activity, it returns the name and the address automatically, I press Save and that's it. Since we do get the address automatically, we'd be able to fetch the weather for those GPS coordinates at the same time (which could be cool to know and record).
Using the free Yelp API (which wouldn't get any other information that the names we are looking for) would also give us ratings and photos, that'd be cool to have as well.
I don't think OpenStreetMap with the Nomimatim search API is precise enough to give us this kind of info.
So to answer your questions, we would be able to choose either a Venue or a type an address (with the exact same mechanism that we do have when users currently need to document an Address on the sidebar).
Thanks for the indepth reply @djaiss.
If we can discuss things a little further:
1) I've found searching '
2) Nominatim doesn't support eleastic searching, but Photon does. This appears to find the venue names very well (although, in contrast with Nominatim, it struggles with '
3) Do users want ratings and photos of venues they've already visited/experienced?
I don't have experience with Nominatim, so my comments are just based on quickly reading their websites and making a few queries to the services to check whether interesting data is returned.
Basically, what I need is to search a Venue in a city and have the results back. In real time.
If Nominatim can't do that, it'll be impossible to use this solution. I don't need ratings by the way, nor photos - it's just a nice to have if we want to show them in the search results to confirm that this was indeed the place used for the activity.
Photon looks interesting but there is a big red flag with it: it adds another dependency. Except if we use the version that Photon is hosting, but it seems pretty fragile. And installing Java and Elastic Search is currently not an option in the project (way too complex).
In my opinion, I don't think Nominatim is the right technical choice to look for venues. Remember that what I want to do is look for places, not displaying them on a map. Once we'll have to display those places on a map, we'll probably use OpenStreetMap.
So we could add a location to an Activity, and the way to do this or to display it to the user will depend on the service we will use. See #3209
How about using a generic construct of "Location", which consists of a user-defined name - eg, for an informal place "Home", "Daves House", "Jill's picnic spot" or for a formal name "Joe's Pizza", plus a geo-location identifier, which can be chosen from an extendable list of types
eg, "Address" - standard address text field(s) "Lat/Long" - lat field, long field "Plus code" - google maps compatible Plus Code "What3Words" - w3w compatible word list
Then a map frame could be shown that uses an appropriate mapping service API to render the geolocation.
This could extend (or be used by) the multiple addresses construct used for contacts. That is, when an address is added for a contact, it is added as a "Location". This would also assist in using the same address for multiple people that co-reside.
We should go with the simplest route here: lat/long, or an address, as we already support this kind of fields in the application.
Since all activity take place some where, there should be a form field to add a location to an activity.
That way the events could be displayed on a map later on.