-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Places: Improve details of the default world map #2998
Comments
I know that Naturalearth provide some public domain maps , might be worth look into https://github.com/nvkelso/natural-earth-vector |
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) |
For more clarity, we have renamed the included offline maps to "Low Resolution" in the "Settings" drop-down menu (previously "Basic"). |
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! 😉
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/ |
Good news 1 - I was able to add some city names ( 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 :) (sorry for sending it in a zip, github doesn't accept json in issues for some reason) |
My workflow in short:
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:
|
Thanks! I'll replace the file and add a script with the commands when I have a bit of time 💐 |
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? |
Whoops, my fault. I'll try to fix that now :) |
Honestly, I don't know how to make the geojson working with photoprism :(
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 :) |
I'm willing to generate and update these files as OSM data gets updated if the feature finally makes it into photoprism :) MapLibre seems to support vector tiles, so I'll try to display the map I'm currently serving with tileserver-gl in photoprism soon :) |
I know about OpenMapTiles, which are free maps provided by MapTiler. However, in the past there was a catch in the license so we could not use them. In the few minutes I just had, I can't find that anymore, but more research needs to be done to see if it's OK to use it in a production app (and bundle it), and how much storage that would require (so if our users would be OK with that too). Finally, it requires work on our end (or your contribution). |
Didn't knew about that, I'll check the license! Thank you for the warning :) |
We could also host these maps for our users (including CE), but that would not be offline like the current basic maps and also slower (not local, no CDN). |
I have read OpenMapTiles license, and it seems we can use it. However, it would be nice if someone with actual legal knowledge confirms that
The catch in the license you are talking about probably refers to ready-to-use tiles at https://data.maptiler.com/downloads/planet/ (it's required to select "non-commercial personal project" or "evaluation and education purpose" in order to download old tiles for free, otherwise it costs $4000) |
Yes, I think I got that far and then stopped because we didn't have the time or resources to render our own tiles. While the Community Edition could be considered non-commercial, German law might see it differently and it's not really personal anymore either. Do you have any idea what hardware is required to do this, how long it takes, and how much storage is needed (for generation and the final tiles that can be distributed)? |
For Poland, my PC (i7-3770, 16GB of RAM, SSD) can do it. For the whole planet, I don't have an idea, but that's what I'm trying out right now :)) |
@maciejla if it needs more RAM I have 32GB… unfortunately I have little free time to experiment myself, but if you have a workflow to execute, I can certainly help. |
I can offer 70+GB RAM with ~20x2GHz threads (E5-2620). If you set up a docker or VM or script (for Ubuntu any version), I can run it for you to do some experiments. |
Thank you for offering so much resources! I also have access to 24c 128GB RAM server at school, so if the admin agrees, that's something I can experiment on :) Here are my experiments so far (i7-3770, 16GB of RAM, 1TB Silicon Power SSD): Whole download + import + tile-generation process for Africa (5.6GB .osm.pbf file) took about 8h 30m
EDIT: Above (striked-out) calculations are wrong. See next comment Unfortunately, I think the biggest bottleneck I have in this whole process is the disk speed (often ~60% of CPU time is "wasted" in iowait state). I'm going to try enabling zstd compression in btrfs, as that may greatly reduce the amount of data that's needed to be read from disk (and of course, that means I don't have to move files out of that SSD 😅) I'll also run a public tileserver-gl instance serving vector tiles out of the mbtiles file that I have generated :) |
Whoops, it seems the postgresql database gets cleaned when executing However, I have successfully generated a mbtiles file for geofabrik extracts of Africa, Antarctica, Asia, Australia and Oceania. I have also successfully merged resulting mbtiles with Now I'm going to generate mbtiles for geofabrik extracts of Central America, Europe, North America and South America. Then I'll join them, and we'll have a full planet mbtiles file :) When I have the full planet file, I'll try to integrate it with PhotoPrism :) |
Confirmed, it is way faster with disk compression enabled ( |
Only geofabrik extract left is Europe :) and I need some help :) So, @lapo-luchini or @kovlo - I'll be grateful if you could execute following workflow:
That will automatically create docker container and volume with the database, download the europe.osm.pbf file (26.2GB) from Geofabrik, import it into postgresql database and generate tiles. Then, send me the resulting tiles.mbtiles file, I'll merge it with the rest of the files I have generated and we will have the whole planet done :)) I don't know exactly how much resources is required, but it should be between 250-500GB of disk space, the more RAM the better. It will probably take a few days Thank you very much! If you have any questions - feel free to ask :) |
@maciejla @HeikoGr @graciousgrey I feel like we can go with that, what do you think? Maybe the colors could use a little more love. Buildings and street names are also missing. However, a more detailed mbtiles file with zoom level 15 should be available for testing soon. Funnily enough, the "original" mbtiles file from OpenMapTiles did not render correctly, while all self-rendered files you provided worked perfectly. @HeikoGr Although I appreciate the idea behind pmtiles, using this format seems to cause a bit more overhead in terms of code size (additional deps required), development and testing effort. Detailed maps would be too big to host locally anyway and most users don't care where it's hosted, they just want it for free. So I think we'll serve the maps from our server, and additionally put a global CDN in front of it to get the best possible performance. This doesn't cost us anything (at least for now), because we have enough free credits from users who signed up through the "Bunny CDN" affiliate link in our docs, see https://docs.photoprism.app/getting-started/using-a-cdn/. |
Looks good to me! Any optimization should be made afterwards, as this is an important feature. pmtiles would also be hosted on a central server. But it is only one plain file without tile server. It's a very interesting approach, but you are right - you need another js library on the client side. |
Signed-off-by: Michael Mayer <michael@photoprism.app>
An updated development preview will be available for testing soon! Unfortunately I could not configure the CDN due to problems with the host headers (the JSON response contains absolute links including the domain name). |
I don't know if it is of any help, but someone regularly uploads updated mbtiles files here https://osm.dbtc.link/index.php?b=mbtiles&s=size&r=1 |
Thanks for letting us know! That might have been helpful, but we now have maps with very high details (~160 GB compressed) and also can adjust the colors if needed, so I think that's as good as it gets: |
see https://twitter.com/GlassedSilver/status/1665478317196169217 Signed-off-by: Michael Mayer <michael@photoprism.app>
Based on feedback we received yesterday, the "Low Resolution" option has been re-added to the settings menu: Kindly note that it will only be available if you have experimental features enabled under Settings > Advanced (reload the app for the settings to take effect). This is because we have received feedback/bug reports from users who felt that there is a problem with these simple offline maps as they do not contain any details other than land, water, countries and borders. On the other hand, it's worth having an option that works completely offline and improving it as time allows. |
Signed-off-by: Michael Mayer <michael@photoprism.app>
I'd love (and prefer) to use self-hosted "17GB z12" files up there if/when possible, but that works too, in the meantime. I'd also love to help code the feature, but unfortunately I have too little time for my current "opensource pet projects" already so I fear that won't happen soon. 🥲 |
@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. |
Final testing for the upcoming release has started and the release notes have been updated to document all changes: |
Am very excited about this release. It makes the Community Edition a very
usable..
…On Wed, Jun 7, 2023, 11:56 AM Michael Mayer ***@***.***> wrote:
Final testing for the upcoming release has started and the release notes
have been updated to document all changes:
- https://docs.photoprism.app/release-notes/#development-preview
—
Reply to this email directly, view it on GitHub
<#2998 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHNPNQW7EKVNXPDB23ABNRDXKA62BANCNFSM6AAAAAAS47KPTA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks you so much for this really great improvement of the CE edition! |
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. |
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). |
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.
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
The text was updated successfully, but these errors were encountered: