-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement OpenStreetMap data source #290
base: master
Are you sure you want to change the base?
Conversation
That might be something that I could contribute, I do quite a lot of network programming and this seems quite an isolated and easily testable thing.
I think initially a manual mechanism would be enough. Later, the Android JobScheduler API could be used for scheduling (e.g. once a week). Using .setRequiredNetworkType(int) we could even run the job only when an unmetered network (e.g. home WiFi) is used.
If
I've never seen this used for chargers, but why not 🙂
Yeah, that's a great idea, since it allows uniquely identifying the charger. |
cool! Currently quite a lot of the JSON parsing into an in-memory list of
Yep, makes sense. As it is set up now, it will already do the download on demand when the app is started and no chargers are stored in the DB (or too outdated, currently the hard limit is set to 300 days). So you could even already trigger a manual update by simply clearing the cache in the settings and then going back to the map. But intuitively an extra button to do it manually might still be useful. We already have a scheduled job to delete outdated entries from the DB, a very similar one with the extra network type constraint could be used to re-download the OSM chargers.
Yeah, let's check how many chargers have that field set to see whether it's worth implementing support for it (or, implement it anyway to encourage people to include it? 😅). We could also decide to e.g. show coordinates in the address field in case the address is not available - just so we have at least some kind of useful information in the UI at that position.
Yes - it's not a one-to-one mapping though, as one EVSEID doesn't correspond to a whole charging site, but either to a single plug, or sometimes a combination of plugs (e.g. when a charger has both Type 2 and a household plug, but only one of them can be used at a time). |
52f2e47
to
4b62781
Compare
There seems to be another way to get at least the country & city directly from the Overpass API, see the two examples here:
This would actually be pretty useful - e.g., we use the country to decide which of the real-time data sources should be queried for a charger. However, the wiki page mentions, at least for the second example:
I wonder why this is not mentioned for the first example, even though both examples do pretty similar things... Our query for all charging stations worldwide is very large, so not sure if this is feasible. |
@johan12345 Hmm, that's interesting! I assume this information is extracted by using the geographical relation (it's "inside" a certain administrative boundary). However, that does indeed sound expensive to calculate for a lot of points. And by looking at the syntax (without knowing in detail how Overpass works), I think Additionally, I wonder how much value there is in knowing the city in which a chargepoint is. I think if there is no address associated with a charger, then the distance (or the marker on a map) would be more useful from a user point of view. |
Regarding contributions: I did mean to take a look, but my calendar is totally stuffed until at least mid-October... So don't count on me, sorry. (I'm happy to test and give feedback though!) |
3a292f2
to
ea35455
Compare
ea35455
to
869de4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! Some initial feedback:
- Download started immediately after choosing OSM as provider. This should probably be done after confirmation (with a hint about the approximate size, for people withotu flatrate). Maybe initial download could be a wizard step?
- I have a 10Gbps internet uplink, so even though my phone is connected via WiFi, speed should be very fast. However, download took a few minutes. Is there some rate limit on the filehost? Or is there live processing of the downloaded data that slows things down a bit?
- When zooming/scrolling on the map while the download is in progress, the "Lade herunter..." text in the top bar flickers a bit. I think it briefly falls back to a default text. Nothing bad, but maybe it could be easily fixed?
- When viewing a large map area, loading chargers can be really slow! It took maybe 1-2 minutes on my Pixel 7a. Might be because I'm using the debug build, but I suspect some database index is missing? I also managed to trigger some ANRs when scrolling around on the map.
- I'm not sure how important automatic updates are, I think at least initially a manual update mechanism/activity (maybe with a "data is old, please update" hint) would be enough.
Gzipped the file is still around 5 MB, so not that large for today's standards... But yeah, due to the significant time it takes to import, it might still make sense to have a confirmation dialog.
Exactly, the data is being parsed (from JSON into
Yes, I'll look into that
There should at least be a spatial index, which is probably the most important when viewing a large area without many filters applied. I think (but haven't benchmarked yet) that the main problem here is that we first load all chargers in the visible map area into memory, and only then apply calculations for grouping them into clusters.
Manual updating, in principle, is already possible using the "clear cache" button in settings (just maybe not that obvious to the user). 😉 |
fc720bd
to
1a230ed
Compare
3ef5366
to
b85ce9a
Compare
The EVSE ID can be obtained thanks to this key in OSM: https://wiki.openstreetmap.org/wiki/Key:ref:EU:EVSE |
For notable brands/networks/operators OSM uses Name Suggestion Index (NSI). This data shows up in some of the editors contributors use to improve OSM. It is open to issues/PRs. |
Uhm, hows the status here? Would absolutely love to see this feature be released! |
Hi! Sorry, I have been very busy with other things lately and didn't have much time to work on EVMap except for necessary maintenance and minor improvements. Hopefully that will improve a bit later this summer. The main open points are still the ones in the TODO list above, but some (like parsing opening hours, Chargeprice support, and making use of EVSEIDs) can be tackled later in separate PRs. What I still would like to implement before merging this is moving the task of marker clustering into the DB query instead of doing it with in-memory I added a PoC SQL query for this in 107ec10, but it doesn't respect additional filters yet and is not yet used by the higher abstraction layers (ChargeLocationRepository). So that would be the next step. |
Is there documentation to build this? I would be absolutely happy if I could test it (even rn) |
sure, there is some documentation at https://github.com/ev-map/EVMap/?tab=readme-ov-file#development-setup |
Ooops, I just had to use a virt automotive, then it works. Right now, it looks really good, would absolutly love to see this merged! |
You just have to choose the correct build variant - for a phone the ...normal ones and for an automotive emulator the ...automotive ones :) |
Just tried out this build, a few things I noticed:
Otherwise it looks very promising, congrats :) |
Co-authored-by: Danilo Bargen <[email protected]>
* Update fragment_onboarding_data_source.xml Increase margin to data source text * Update fragment_onboarding_data_source.xml Increase margin to data source text * use margin instead of padding --------- Co-authored-by: johan12345 <[email protected]>
7ad78bb
to
a76987a
Compare
as discussed in #97, this adds support for OpenStreetMap as a data source for charging stations.
TODO:
ReferenceData
implementation which saves the list of possible choices)