Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Tesla Autopilot maps

This site may earn commission on affiliate links.

verygreen

Curious member
Jan 16, 2017
3,048
11,762
TN
So while we are waiting for HW2+ maps to actually materialize, here's something to ponder.

Many of you have noticed already that the car seems to slow down in TACC and autosteer mode before curves. So I was researching how is speed limit determined (some people I asked were sure it was from Navigon maps, but I think evidence does not support it).

Anyway lo and behold I found that there are "adas map tiles" thing the car pulls calculated on current coordinates. I am not really sure what is the format, but it at the very least contains various curvatures of the roads (used to calculate safe speeds for curves), but also is consisting of "branches". Branches have various properties like what road class is it, whenever the next branch exit is an offramp (to the left and right too), if the branch is itself a ramp, should autosteer be enabled, should autopark be restricted, is it a two way traffic branch, should "pedal misapplication mitigation" (?) be enabled, should radar braking be enabled, side collision assist enabled, length of this branch in meters, speed limit, speed limit units and some more cryptic stuff.

It looks like there's also some code to feed some curve and other data back to mothership, but it's not clear if it needs to be separately enabled. Additionally there are multiple levels of this tile data - development, live, staging and staging2, Korea gets its own tiles for some reason.

Anyway, if you want to experiment with format, grab your copy fast before Tesla closed this down (some random tile from around here): https://daws.tesla.services/iiNG2d6xFR1USl/dev/dnkk9.tile
 
This very likely explains the behavior change that people says they experience with AS not taking highway exits and so on when it previously would. Also likely explains how Tesla has been addressing the phantom breaking issue...

So the maps stuff you're seeing on the HW2+ APE is unrelated to this file format? Its something totally new?

Interesting.
 
How do you view the tile?

Also, Tesla implemented the tiles way back with AP1.0 on v7.1

Firmware 7.1

So while we are waiting for HW2+ maps to actually materialize, here's something to ponder.

Many of you have noticed already that the car seems to slow down in TACC and autosteer mode before curves. So I was researching how is speed limit determined (some people I asked were sure it was from Navigon maps, but I think evidence does not support it).

Anyway lo and behold I found that there are "adas map tiles" thing the car pulls calculated on current coordinates. I am not really sure what is the format, but it at the very least contains various curvatures of the roads (used to calculate safe speeds for curves), but also is consisting of "branches". Branches have various properties like what road class is it, whenever the next branch exit is an offramp (to the left and right too), if the branch is itself a ramp, should autosteer be enabled, should autopark be restricted, is it a two way traffic branch, should "pedal misapplication mitigation" (?) be enabled, should radar braking be enabled, side collision assist enabled, length of this branch in meters, speed limit, speed limit units and some more cryptic stuff.

It looks like there's also some code to feed some curve and other data back to mothership, but it's not clear if it needs to be separately enabled. Additionally there are multiple levels of this tile data - development, live, staging and staging2, Korea gets its own tiles for some reason.

Anyway, if you want to experiment with format, grab your copy fast before Tesla closed this down (some random tile from around here): https://daws.tesla.services/iiNG2d6xFR1USl/dev/dnkk9.tile
 
Are these the same Tiles shown in the Autopilot Database tab (in debug)? Linking to your post from May with screenshots.
yes, same tiles. But now I actually know what's in there ;)

How do you view the tile?

Also, Tesla implemented the tiles way back with AP1.0 on v7.1

Firmware 7.1
Yes, adas tiles are by no means new. I know of no way of viewing the tile easily, I guess format is somewhat proprietary too, still with more people looking at them somebody might have some smart ideas.
 
Okay. I thought you just found it. How tough would it be to view it? Are my tiles downloaded to the car?


yes, same tiles. But now I actually know what's in there ;)


Yes, adas tiles are by no means new. I know of no way of viewing the tile easily, I guess format is somewhat proprietary too, still with more people looking at them somebody might have some smart ideas.
 
Last edited:
There are just too many things called tiles ;) The google maps tiles, openstreetmap tiles, ....

I have no idea what the adas tiles are based on, but it's not a tmx text format for sure. It looks like it could also list "features" called "furniture".

The code that loads this whole thing is kind of twisted OOP stuff where it's not super easy to trace everything. The verification part has some text output so it's possible to get some rough high level idea about general data in the tile like how many branches and such there are
 
So how does this tiles-thing work, are they downloaded to your car based on which country/city you're in? How often do they refresh? Are our cars uploading tiles? What's crackalackin?
the tiles are downloaded based on your location and also surroundign tiles too so you don't end up outside of the covered area accidentally.
It hashes gps coordinates to arrive at the tile url.

I don't think the car uploads tiles, but there's a curves log and upload that could be activated, I guess that's how they make new tiles then (or at least one of the ways)
 
I suspect it's OpenStreetMap based as that's what Vahalla appears to be based on. But, it looks like you can run your own server, with your own DB etc. so will take some work to reverse it. I think it's a vector based image with the information embedded perhaps.
 
  • Informative
Reactions: NerdUno
the tiles are downloaded based on your location and also surroundign tiles too so you don't end up outside of the covered area accidentally.
It hashes gps coordinates to arrive at the tile url.
I don't think the car uploads tiles, but there's a curves log and upload that could be activated, I guess that's how they make new tiles then (or at least one of the ways)

I have modest skills but played a little. Never heard of geohash before. :) File name dnkk9 geohash mapped to an area at the bottom of my post.

Within the file there were 6 char geohashs. Used 'strings' util to pull 6 character stings from the 'tile' file. Found 56. Put a few of these in a geohash tool geohash.co (Geohash Converter) I found via a google search to get lat/long (col B in my sheet).

56 geohash may end up being 42.448 miles by 21.224 miles if I did the math right from the 6 char geohash coverage via www.movable-type.co.uk/scripts/geohash.html (show/mentioned below)
Also see GeoHash grid Aggregation | Elasticsearch Reference [5.6] | Elastic for coverage of a 6 char geohash.

PNxWY3b.jpg


Used this tool to get 3x3 grid with 'dnkkdp' in the middle (see col D,E,F in my sheet).
Color coded above to show some other surrounding ones that were in the output list from 'strings'.
www.movable-type.co.uk/scripts/geohash.html
(Geohash encoding/decoding)
CebSWdy.jpg

From site above: A geohash actually identifies a rectangular cell, each extra character identifies one of 32 sub-cells.

The cell sizes of geohashes of different lengths are as follows; note that the cell width reduces moving away from the equator (to 0 at the poles):

Length Cell width Cell height
1 ≤ 5,000km × 5,000km
2 ≤ 1,250km × 625km
3 ≤ 156km × 156km
4 ≤ 39.1km × 19.5km
5 ≤ 4.89km × 4.89km
6 ≤ 1.22km × 0.61km or 0.758 mi x 0.379 mi
7 ≤ 153m × 153m
8 ≤ 38.2m × 19.1m
9 ≤ 4.77m × 4.77m
10 ≤ 1.19m × 0.596m
11 ≤ 149mm × 149mm
12 ≤ 37.2mm × 18.6mm




Put the coordinates for the ones I converted in www.darrinward.com/lat-long (Map Tool: Map Latitude Longitude Coordinates/Points - Google Maps) and saw the same map (see (H)ospital/(H)ealth location) and 5 coordinates.

twpshSV.jpg


Other interesting site on tools/maps and geohash: Tips & Tricks - geohash.org


The whole file name was dnkk9 and that translated to this 5 character geohash area:

DMBlRUy.jpg
 
Last edited:
Anyway, if you want to experiment with format, grab your copy fast before Tesla closed this down (some random tile from around here): https://daws.tesla.services/iiNG2d6xFR1USl/dev/dnkk9.tile

This is what more-less the content of that tile file looks like (at least partially):

dnkk9.png


Please DO NOT take this visualization too seriously, as I pretty much don't know what I'm doing, things are figured out just by looking at it, visualization is not very precise, and the method of smoothing the curves that I used is most likely wrong.

Here is the same image as an overlay over the Google maps:

dnkk9_overlay.jpg


So, briefly about how the file looks like:

A single tile file contains two main parts: a list of smaller tiles, and a list of paths.

List of tiles contains a set of smaller tiles (one character more precise in geohash). Included are tiles from the inside of the main tile, as well as bordering tiles from outside, to cover the structures passing over the border of the main tile (this can be seen on the first image - blue box defines the main tile).

Each small tile contains only a list of IDs of paths, that are intersecting with it. This most likely is used as a sort of area indexing, to speed up the lookup of paths in the given area.


Each path is a separate structure, identified by a 32bit ID (which is probably global, not bound to the file). Single path contains some flags (that I don't know the meaning of), some parameters (e.g. length in meters, I think), and a bunch of lists.

First list is of course a list of points along the path. Each point have Latitude and Longitude (global, not relative to the tile), and a relative vector of spline smoothing.

Next are at least two lists of IDs referencing other paths, probably pointing to connecting paths, forming a big graph of routes.

Next are more lists (at least five) with some features, that I didn't figured out the meaning of, so there are more things in this map.

Latitude and Longitude are stored as 32bit unsigned integers, mapped to the whole range of a given value (fixed point notation).
 
Just want to say that I am in awe of how quickly @DamianXVI has unlocked the tile file format.

No doubt the Tesla parking lot was mapped to that extent for the FSD demo. Maybe they left some geotags in there (i.e. drop off point and the final parking space) if you look closer?

+1 go @DamianXVI go !! And not to mention verygreen for digging up all these lovely tidbits!!