Adding Custom Tile Server (mbtiles Server) as Overlay? {x}/{y}/{z} => {0}/{1}/{2}

369 views
Skip to first unread message

Derek Hildreth

unread,
Feb 14, 2020, 4:09:42 PM2/14/20
to OsmAnd
All,

I have a custom tile server (using mbtiles-server) I'd like to use as an overlay and I'm struggling to get the format correct.  It appears that OsmAnd expects {0}/{1}/{2}.  I'm not sure how 0, 1, and 2 equate to x (col), y (row), and z (zoom).  I feel like I'm close because I do see the tiles appearing, but they are large tiles missing in between other tiles (whitespace/margins around a tile).

Then, I read on the wiki page here that:

OsmAnd does not use the OpenStreetMap standard tile layer (also known as openstreetmap-carto) to generate its maps, so bugs related to maps rendered for OsmAnd do not belong there. OsmAnd uses its own tile render generation routines, generally defined in the OsmAnd-resources GitHub project.

 Does that mean my attempts were doomed from the start? :-)

Any help would be greatly appreciated!  Thank you.


API Info:
{
"api": "MBTiles Server 3.3.4",
"http": {
"GET": [
"/<mbtiles>",
"/<mbtiles>/{zoom}/{x}/{y}",
"/<mbtiles>/WMTS",
"/<mbtiles>/WMTS/1.0.0/WMTSCapabilities.xml"
]
},
"mbtiles": [
"mt"
],
"ok": true,
"protocol": "http",
"cache": "/home/user/mbtiles",
"port": 5000,
"status": 200
}


MBTile Info:
{
"version": "1.1.0",
"type": "overlay",
"minzoom": 6,
"maxzoom": 15,
"description": "Montana Private Parcels and Public Land",
"name": "Montana Private Parcels and Public Land",
"bounds": [
-116.04914578697117,
44.357921825347965,
-104.0396585815126,
49.001105491109875
],
"center": [
-110.044402,
46.679514
],
"format": "png"
}

 Screenshot:

Screenshot_20200214-140359.png


Andy Townsend

unread,
Feb 14, 2020, 4:35:50 PM2/14/20
to osm...@googlegroups.com
On 14/02/2020 21:09, Derek Hildreth wrote:
 Does that mean my attempts were doomed from the start? :-)


I don't think so!  If you're serving tiles in a format like:

https://servername/directory/0/1/2.png

then you should be able to set it up.

I have a server https://map.atownsend.org.uk/ that serves tiles in the usual OSM format, so https://map.atownsend.org.uk/hot/9/253/166.png is a valid tile.  I've defined that in Osmand via "Map Source / Define/Edit" as:

  • Name    AJT
  • URL    https://map.atownsend.org.uk/hot/{0}/{1}/{2}.png
  • Min zoom    0
  • Max zoom    24
  • Expire    (left blank)
  • Elliptic Mercator    (unticked)

Best Regards,

Andy


Derek Hildreth

unread,
Feb 14, 2020, 5:49:49 PM2/14/20
to osm...@googlegroups.com
Thanks for the help!  I must've had a strange caching issue because I was able to re-add it with a new map name and everything works now!

I used your url to verify things were working okay, which gave me a great testing baseline. Thanks again for your help!

--
You received this message because you are subscribed to a topic in the Google Groups "OsmAnd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/osmand/dHSzsWrEDZs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to osmand+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osmand/b3df9a51-8c0d-a4cf-8aa2-cbfcaf85c6af%40gmail.com.
Reply all
Reply to author
Forward
0 new messages