|
|
Subscribe / Log in / New account

Custom renderer?

Custom renderer?

Posted Jul 1, 2025 18:45 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)
Parent article: 15 Years of OsmAnd

Is it possible to use OsmAnd as a tile renderer? Perhaps even for vector tiles?

I'd love to self-host the entire globe, but the current solutions are painful. They require PostGIS and it's not the fastest tools for map rendering. Never mind that it takes about 2Tb to store the data.


to post comments

Custom renderer?

Posted Jul 1, 2025 20:20 UTC (Tue) by malmedal (subscriber, #56172) [Link] (12 responses)

Self-hosting is actually trivial, I have it on my phone.

Basically, either render your own vector tiles with tilemaker, https://github.com/systemed/tilemaker
or get them from: https://data.maptiler.com/downloads/tileset/osm/

The standard .mbtiles format is just sqlite3, easy to handle. pmtiles is not very much harder.

To display you need e.g.: https://github.com/maplibre/maplibre-gl-js

You'll need a style, for instance: https://github.com/maputnik/osm-liberty

Use maputnik, from the same people, if you want to change it.

Custom renderer?

Posted Jul 1, 2025 21:30 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (11 responses)

> The standard .mbtiles format is just sqlite3, easy to handle. pmtiles is not very much harder.

I tried `tilemaker`, but I can't get it to render the tiles on-demand. Which it should be able to do.

> You'll need a style, for instance: https://github.com/maputnik/osm-liberty

I found this one, but it depends on MapTiler which is commercial. It works great, but I'd love to do a fully OSS solution.

Custom renderer?

Posted Jul 1, 2025 23:40 UTC (Tue) by brunowolff (guest, #71160) [Link] (7 responses)

I'd appreciate additional suggestions here too. I bought a couple of inexpensive u-blox 8 USB GPS receivers a few years ago and wanted to try using them with OSM data on my laptop to use as a mapping tool on road trips. But so far the learning curve has seemed steep enough that I haven't worked on this much, as I have other projects I haven't done yet that I can work on. Currently I'm using paper maps which work OK. But when I screw up, it can sometimes be a pain to find a landmark to figure out where I am.

Custom renderer?

Posted Jul 2, 2025 10:53 UTC (Wed) by malmedal (subscriber, #56172) [Link] (6 responses)

In addition to what I explained to Cyberax, if you want
routing there's:

https://github.com/GIScience/openrouteservice

gives you walking and driving directions and various other nice things. GIScience also has a number of other nice projects for things like geocoding and reverse geocoding.

Sadly I don't have enough space on my phone to have this in addition to the maps, but if you're carrying a laptop you'll be fine.

Custom renderer?

Posted Jul 2, 2025 13:42 UTC (Wed) by Wol (subscriber, #4433) [Link] (5 responses)

> Sadly I don't have enough space on my phone to have this in addition to the maps, but if you're carrying a laptop you'll be fine.

Don't the latest phones have far more "memory" available than your typical laptop?

I might be out of date, but the recent laptops I looked at, many were 32/32 (32GB ram, 32GB SSD). Okay they were chromebooks, but the real laptops weren't much better.

Whereas your typical phone had no trouble whatsoever adding a 512GB microSD card ...

Cheers,
Wol

Custom renderer?

Posted Jul 2, 2025 14:13 UTC (Wed) by malmedal (subscriber, #56172) [Link] (4 responses)

As I understand it the cheap phones allow an SD card, while the expensive ones don't :) So I'm stuck with what the phone came with...

Custom renderer?

Posted Jul 2, 2025 14:30 UTC (Wed) by Wol (subscriber, #4433) [Link] (3 responses)

> while the expensive ones don't

?????

Ouch!

Given I tend to buy high-end budget phones, I didn't realise that ... seems daft I can have more storage than you! Although I was aware high end phones tended to come with "unlimited cloud storage" ... what happens when you change phone?

Cheers,
Wol

Custom renderer?

Posted Jul 2, 2025 17:08 UTC (Wed) by malmedal (subscriber, #56172) [Link] (2 responses)

I believe the reason is that the current best internal UFS chips are 10-15 times faster than even the best SD cards, so the manufacturers don't want to have deal with the complaints about how a phone suddenly went like molasses.

SD cards in phones

Posted Jul 3, 2025 10:10 UTC (Thu) by farnz (subscriber, #17727) [Link] (1 responses)

There's three reasons to not put an SD slot in a phone:
  1. Users will use low quality SD cards (either remarked as a fast card, and sold cheaper than most fast cards, or deliberately because they want high volume storage for small money), and then complain about the phone being slow. Fine for a budget phone, not so good for a premium phone.
  2. Users will change the SD card, and then complain that their phone has lost data, because things they used to have "on their phone" have gone missing. This will, again, be blamed on the phone, and the user is unlikely to come back and admit it was a result of changing SD card - which makes the phone look bad.
  3. If you're building to a price point, there's storage capacities that are unsaleable - if you're looking at phones under £200, you're unlikely to be willing to pay an extra £100 for a phone with 1 TiB of storage instead of 128 GiB. If you're looking at the base model costing £1,000 (or more) for 256 GiB, paying an extra £300 to have 1 TiB of fast storage feels more reasonable. As a consequence, low end phones aren't sold with big internal storage, whereas high end phones are.

And, of course, there's the thing where someone who's paid £150 for a phone is less likely to be willing to pay £50/month for unlimited data, whereas someone spending £1,000 on a phone might well pay for unlimited data, and thus be more willing to rely on cloud storage for bulk data like photos and videos.

SD cards in phones

Posted Jul 7, 2025 12:28 UTC (Mon) by DrMcCoy (subscriber, #86699) [Link]

Parallel to 1., there's also still a chance of getting a counterfit card, especially if you buy from some third-party seller on Amazon or somesuch. Such an SD card will look like a genuine x GB card, report itself as such, but in actually have only a few GB (or even just MB) of actual storage that loops. So you're soon overwriting your own data.

I actually put such a card into my previous, cheaper phone, when I got it, several years ago. You'll see all sorts of weird errors then.

Custom renderer?

Posted Jul 2, 2025 10:31 UTC (Wed) by malmedal (subscriber, #56172) [Link] (2 responses)

> I tried `tilemaker`, but I can't get it to render the tiles on-demand. Which it should be able to do.

I will be surprised if that can be made performant enough. I am using to render the entire world into a 70Gig or so file which fits on my phone.

> but it depends on MapTiler which is commercial.

You don't have to. This is what the tilemaker tiles replace.

To explain a bit more; what I do is use tilemaker to make vector tiles of the entire world, takes about a day, then copy it to my phone.

Instead of running tilemaker yourself you can download maptiler-osm-2025-06-30-v3.15-planet.mbtiles from MapTiler, not FOSS, but free for personal use,

The phone app consists of an Android WebView backed by an http-server which serves the tilemaker tiles and a javascript app, written with maplibre-gl and using osm-liberty as style.

This gives me a nice map of wherever I am in the world, which I can use without expensive roaming charges or messing with a local sim.

Custom renderer?

Posted Jul 2, 2025 17:52 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

> The phone app consists of an Android WebView backed by an http-server which serves the tilemaker tiles and a javascript app, written with maplibre-gl and using osm-liberty as style.

That's the part that doesn't work for me. I couldn't get tilemaker tiles from the converted mbtiles. My goal is to render them on the web (for things like the map for Immich).

Do you mind sharing the configuration for that tile server? I promise I'll share the resulting `docker-compose.yml` and write a blog post about it.

Custom renderer?

Posted Jul 2, 2025 19:03 UTC (Wed) by malmedal (subscriber, #56172) [Link]

Traveling right now, so don't have that accessible right now.

Are you sure you are talking about tilemaker and not one of the others like e.g. tippecanoe?

I prefer tilemaker because you just give it the planet-latest.osm.pbf and out comes either a .mbtiles or .pmtiles file. This is what you serve, for serving .mbtiles, you need to know it is just a sqlite3 file so I just coded up a simple endpoint in jetty(Java webserver) that did select tile where zoom = ? and row = ? and column = ?; and returned that.

For .pmtiles it is even easier, you just put the file in just about any webserver and point the client to that. The client will use byte-range http requests to get the metadata and the data it needs.(As long as you're not using a pre http/1.1 server :) )

Was that clear enough? Happy to answer more of needed.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds