-
Notifications
You must be signed in to change notification settings - Fork 884
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
Generate iD presets #4718
Comments
As presets from NSI have now been removed from |
When the new nsi-presets.json becomes available will it include the imageURL field? Currently I can't figure out where iD is pulling that information from.Do we have a timeline for this so we data consumers know whether to wait or roll our own solution? Not trying to pressure you, I'm just looking for clarity on the situation. |
Do you plan to package the brand images in GoMap!!, @bryceco ? I looked into that myself today, wrote a script that would download them all. It's about 8MB for all the images in a size of 50x50px. (Ergo it would be around 32MB for 100x100 and about 128MB for the size in which iD queries them on demand - 200x200px) |
My existing code downloads brand images on demand and caches them on disk, so I'd start with that. I hadn't considered packaging them with the app which is currently < 20MB, but that's a reasonable approach as well. |
I'm also considering cutting the files up into regions, so for example someone working in North America doesn't need to download the European presets, etc. I don't know how big the files will end up being, but NSI has grown a lot in the past year. |
For me the NSI will be packaged with the app, so regions isn't necessary. Maybe dynamic updating will be supported once the update mechanism is known to be stable. |
Loading all the presets + default translation(s) currently takes 4s in StreetComplete (done in a background thread of course), the biggest part of that of course are the brand names. With the upcoming version of So, this might be advisable. I'd even recommend splitting it up by country. However, this should be done later, because it will also increase complexity. For example brands that exist both in US and DE (but no other parts of the world) will then appear in two separate |
Thanks for the fast turnaround Bryan! |
What is the meaning of the trailing hex number?
|
Some entries have an odd location:
|
The schema is documented here: https://github.com/ideditor/schema-builder
The osmfeatures library and thus StreetComplete doesn't support any of this. |
@bhousel
What could be understood more easily if instead ISO 3166-2 codes were used, i.e. |
We support whatever country-coder supports, and people can supply their own geojson shape for anything beyond that. Check out location-conflation for more info, and this webpage where you can play around with them. I don't think country-coder will be tracking boundaries down to the state level anytime soon, though we did discuss it a bit here: rapideditor/country-coder#26 I also think it's totally ok to just drop presets that you can't support because they contain odd locations. The vast majority of stuff in NSI is just a normal country code include or world You'll miss out on stuff like Quebec KFC/PFK or Price Chopper Kansas City, but these are the edge cases that I built location-conflation for. |
The identifiers are supposed to be unique across a key/value/locationset and stable as long as those things don't change..
Or Tesco:
The identifiers also help us a lot because they are stable enough that we can push them to Wikidata, establishing the link from there back to our project. More on identifiers here: #3995 |
Okay everything makes sense and looks good.
Yeah, my initial approach will be to convert NSI locations back to the old "countryCodes" format:
|
Due to the fact that a large number of the images are now SVG, and iOS doesn't support SVG natively, I'm thinking I'm probably going to try packaging the images along with the presets. Can you point me to your download script? I wrote my own but it doesn't know how to properly set the correct file extension when it's ambiguous (bryceco@yahoo.com if you're prefer to communicate directly). |
I'm still unclear about where the imageURL originates. But I do notice that every URL with a width has width=150. Is this something we should consider a placeholder that we can change? |
@bryceco Think this may be what you're looking for name-suggestion-index/scripts/build_wikidata.js Lines 273 to 289 in 5958ae4
|
Note that the id-tagging-schema presets also use
This is the download script: https://github.com/westnordost/StreetComplete/blob/existance/buildSrc/src/main/java/DownloadBrandLogosTask.kt (replace The image URLs linked in the |
Thanks @kymckay for the code pointer! The wiki commons URLs use that Special:Redirect API to resize them to whatever size you want. You could run the SVG files through it too to have them rasterized (and that's actually what we were doing up until a few days ago when I added that SVG code in #4758) I'm just now realizing I could have used the Special:Redirect URL to avoid doing the md5sum stuff to get the svg file location. They are super handy but I can't find the documentation for them anywhere. @nyurik clued me into these, so maybe he knows where the docs are for them? |
My download script is here: https://github.com/bryceco/GoMap/blob/master/src/presets/getBrandIcons.py |
It doesn't seem it should take that long. My testing on various devices, loading, translating and building indices:
|
I noticed IO is slowed down quite a lot when the debugger is connected. Without the debugger, to load presets + default translation + NSI:
Still quite a bit slower though. Do you parse the json with a stream parser or a document parser? |
I’m using a document parser |
Followup from openstreetmap/iD#8175
iD has spun off their presets into some separate projects. From what I can tell:
This is great for the name-suggestion-index project because now we can depend on those other packages instead of iD. We can use those to build and distribute the NSI presets as a compatible addon to iD, and we doesn't have to be on iD's release schedule (iD can fetch the latest compatible NSI preset pack at runtime).
The text was updated successfully, but these errors were encountered: