Skip to content

Places: Improve details of the default world map #2998

Closed

Description

@lastzero

As a user of the free Community Edition, I would like to have more detail included in the basic world map so that I can better browse my pictures by location.

  • Since more than 95% of users opt for our completely free version without signing up as a sponsor, we unfortunately can no longer offer the high-quality commercial maps to everyone. Kindly note that they were also not listed as a free feature in our overview in the past, but were still available for evaluation purposes.
  • To improve the situation, it would be possible to add more details like cities and lakes to the basic maps. The only problem is that we don't have the resources to do that due to our large backlog of feature requests. So this would be a perfect task for contributors! ❤️
  • You can find the existing maps as JSON file in this directory: https://github.com/photoprism/photoprism/tree/develop/assets/static/geo

We are aware that advanced users could register "non-commercial test accounts" instead, but we think that would not be completely fair and MapTiler could then no longer offer them to those in need. Keep in mind that we have many more users than other open source projects that might encourage their users to do this. Likewise, using the OpenSteetMap development API is discouraged for consumer applications like ours, although some projects do it anyway. See our FAQ: https://docs.photoprism.app/getting-started/faq/#are-the-keys-for-using-interactive-world-maps-provided-free-of-charge

Activity

  1. filipnyquist commented on Dec 13, 2022

    @filipnyquist

    I know that Naturalearth provide some public domain maps , might be worth look into https://github.com/nvkelso/natural-earth-vector

  2. lastzero commented on Dec 13, 2022

    @lastzero
    MemberAuthor

    We also created the existing GeoJSON file from public data. I can't remember the exact steps, but maybe there are hints in the Git commit messages or old GitHub comments. Probably downloaded individual files specifying the land, borders, and sea, and then merged them using a command line tool.

    There are many websites and repos to choose from (but always check the license before downloading):

    👉 it might be worth automating this with a script so that it can be easily updated/improved later without having to start from scratch (again)

  3. lastzero commented on Dec 15, 2022

    @lastzero
    MemberAuthor

    For more clarity, we have renamed the included offline maps to "Low Resolution" in the "Settings" drop-down menu (previously "Basic").

  4. changed the title [-]Places: Improve the level of detail of the basic world map[/-] [+]Places: Improve the level of detail of the included offline world map[/+] on Dec 15, 2022
  5. maciejla commented on Dec 30, 2022

    @maciejla

    Hi, I think it would be nice to add a "Custom tileserver URL" option :) that way everyone can host their own tileserver e.g. only for their country
    Also, I have some experience with OpenStreetMap, I'll try to generate a geojson that's feasible for this kind of use, but it may be hard to fit a map of the whole world into a few MB :)

  6. lastzero commented on Dec 30, 2022

    @lastzero
    MemberAuthor

    Hi, I think it would be nice to add a "Custom tileserver URL" option :) that way everyone can host their own tileserver e.g. only for their country

    Generally yes, although hosting custom maps is a bit advanced. Considering all the other feature requests, we can't make this our highest priority. Feel free to remind us later next year! 😉

    Also, I have some experience with OpenStreetMap, I'll try to generate a geojson that's feasible for this kind of use, but it may be hard to fit a map of the whole world into a few MB :)

    Thanks, that's awesome! The JSON is not so big anymore when it is gzip compressed. Maybe there is also a way to use multiple files for lazy loading? This is the UI library we use: https://maplibre.org/

  7. maciejla commented on Dec 30, 2022

    @maciejla

    Good news 1 - I was able to add some city names (place=city in OSM) without drastically changing the file size (1.6MB, 380KB gzipped)

    Bad news 1 - I don't think it's possible to go much further with one single geojson file

    Bad news 2 - I don't know how to do it better

    Good news 2 - I'm willing to learn how to do it :)

    So, I'm publishing the resulting geojson here - feel free to use it if you want :)
    I'll try to figure out some kind of lazy loading now :)

    (sorry for sending it in a zip, github doesn't accept json in issues for some reason)
    world2.zip

  8. maciejla commented on Dec 30, 2022

    @maciejla

    My workflow in short:

    osmium tags-filter planet-latest.o5m  n/place=city -o test4.osm
    osmfilter test4.osm --keep-tags="all name=" --drop-version --drop-author -o=test5.osm
    osmtogeojson -m test5.osm > a.geojson
    

    then delete osm id's, as they aren't needed in this case:

    import json
    
    with open('a.geojson') as f:
        data = json.load(f)
    
    for feature in data['features']:
        del feature['id']
        del feature['properties']['id']
    
    with open('b.geojson', 'w') as f:
        json.dump(data, f)

    then merge with the existing file:

    import json
    
    with open('b.geojson') as f:
        data = json.load(f)
    
    with open('world.json') as f:
        data2 = json.load(f)
    
    data['features'].extend(data2['features'])
    
    with open('c.geojson', 'w') as f:
        json.dump(data, f)

    then minify:

    jq -c . < c.geojson > d.geojson
    
  9. lastzero commented on Dec 30, 2022

    @lastzero
    MemberAuthor

    Thanks! I'll replace the file and add a script with the commands when I have a bit of time 💐

  10. lastzero commented on Dec 31, 2022

    @lastzero
    MemberAuthor

    I replaced the file and tested it but could not see any cities. So I assume that either the code must be changed or the layer is not visible for some reason?

  11. maciejla commented on Dec 31, 2022

    @maciejla

    Whoops, my fault. I'll try to fix that now :)

  12. maciejla commented on Jan 9, 2023

    @maciejla

    Honestly, I don't know how to make the geojson working with photoprism :(
    However, I'm currently experimenting with vector tiles, and here's what I found out so far:

    • It's quite easy to generate a vector map based on OSM: https://openmaptiles.org/docs/generate/generate-openmaptiles/
    • It's quite easy to serve this map on demand: https://github.com/maptiler/tileserver-gl
    • mbtiles file for Poland with MAX_ZOOM=7 takes 13.8MB, can be overzoomed quite reasonably
    • If I'm estimating correctly, mbtiles file for the whole planet would take about 650MB. It seams reasonable to ship with photoprism / as a additional download
    • Unfortunately, in order to generate a mbtiles file it's required to import OSM files into a postgresql database
    • The import process takes quite some time (haven't measured it unfortunately)
    • After the import, tiles can be quickly regenerated (270s for Poland on i7-3770 w/ 16G of RAM)

    I'll try to create tiles for a bigger area (Europe probably), if that works out reasonably I'll try to create a whole planet :)

  13. 51 remaining items

  14. lastzero commented on Jun 6, 2023

    @lastzero
    MemberAuthor

    @lapo-luchini I can imagine that a locally hosted option might be preferable for a few users who have particularly high privacy requirements, don't need too much detail and frequent updates, have enough storage, don't use the maps from the public internet, or optionally have an internet connection with high-speed upload, their own CDN, or host their instance with a cloud provider (in which case the privacy advantage is somewhat mitigated). Note that we don't make money from advertising or selling data to advertisers, so we neither have a team to analyze your data nor customers to buy it. IMHO this should impact the choices and tradeoffs you want to make.

    Edit: That being said, you are of course welcome to fork and customize our software for your own needs, including to use other maps.

  15. lastzero commented on Jun 7, 2023

    @lastzero
    MemberAuthor

    Final testing for the upcoming release has started and the release notes have been updated to document all changes:

  16. Jeff254 commented on Jun 7, 2023

    @Jeff254
  17. added
    testedChanges have been tested successfully
    and removed
    please-testReady for manual testing & feedback
    on Jun 7, 2023
  18. added
    releasedAvailable in a stable release
    and removed
    testedChanges have been tested successfully
    on Jun 7, 2023
  19. loulou91 commented on Jun 8, 2023

    @loulou91

    Thanks you so much for this really great improvement of the CE edition!
    For me it's a welcome gift ;-)

  20. moved this to Released 🌈 in Roadmap 🚀✨on Jun 8, 2023
  21. gitinthebus commented on Sep 26, 2023

    @gitinthebus

    I'm so glad this was finally addressed in community edition. The map was the main feature I chose photoprism over alternatives and that bare map before, without any names or features, was completely useless.

  22. HeikoGr commented on Nov 9, 2023

    @HeikoGr

    I was curious if you have updated the maps recently and discovered that you now use api.maptiler.com instead of your own maps-server since #2106

    @lastzero
    to avoid an unnecesary invoice from maptiler:
    was this by accident or a planned change?

  23. lastzero commented on Nov 10, 2023

    @lastzero
    MemberAuthor

    @HeikoGr The map style selector we added in #2106 is only visible if your instance got a valid maps key from us, e.g. because you signed up as a member. The free default map (see screenshot below) is loaded from our CDN, so you don't need access to the MapTiler API.

    default-maps

  24. HeikoGr commented on Nov 10, 2023

    @HeikoGr

    I see. I thought the "default" in the selector was the old low res geo.json (because my browser wasn't fast enough with rendering).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

placesGeocoding & MapsprioritySupported by early sponsors or popular demandreleasedAvailable in a stable release

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions