Git Product home page Git Product logo

flyover-reverse-engineering's Introduction

Santa Monica Pier

This is an attempt to reverse-engineer Flyover (= 3D satellite mode) from Apple Maps. Main goal is to document the results and to provide code that emerges.

Motivation

Noticed differences between Google Earth and Apple Flyover during previous project. Extreme example:

Google Earth Apple Flyover
Google Apple

General

Data is stored in map tiles. These five tile styles are used for Flyover:

Type Purpose URL structure
C3M Texture, Mesh, Transformation(, Animation) πŸ…(?|&)style=15&v=β“Ώ&region=❢&x=❷&y=❸&z=❹&h=❺
C3MM 1 Metadata πŸ…(?|&)style=14&v=β“Ώ&part=❻&region=❢
C3MM 2 Metadata πŸ…(?|&)style=52&v=β“Ώ&region=❢&x=❷&y=❸&z=❹&h=❺
DTM 1 Terrain/Surface/Elevation πŸ…(?|&)style=16&v=β“Ώ&region=❢&x=❷&y=❸&z=❹
DTM 2 Terrain/Surface/Elevation πŸ…(?|&)style=17&v=β“Ώ&size=❼&scale=❽&x=❷&y=❸&z=❹
  • πŸ…: URL prefix from resource manifest
  • β“Ώ: Version from resource manifest or altitude manifest using region
  • ❢: Region ID from altitude manifest
  • ❷❸❹: Map tile numbers (tiled web map scheme)
  • ❺: Height/altitude index. Probably from C3MM
  • ❻: Incremental part number
  • ❼❽: Size/scale. Not sure where its values come from

Resource hierarchy

ResourceManifest
└─ AltitudeManifest
   β”œβ”€ C3MM
   β”‚  └─ C3M
   └─ DTM?

Focusing on C3M(M) for now. DTMs are just images with a footer; they're probably used for the grid that is displayed when Maps is loading.

Status

Here

Code

This repository is structured as follows:

Directory Description
cmd command line programs
pkg most of the actual code
proto protobuf files
scripts additional scripts
vendor dependencies
Install

Install Go and run go get github.com/retroplasma/flyover-reverse-engineering. Then edit config.json in $GOPATH/src/github.com/retroplasma/flyover-reverse-engineering:

  • automatically on macOS:
    • ./scripts/get_config_macos.sh > config.json
  • or manually:
Command line programs

Here are some independent command line programs that use code from pkg:

Export OBJ (proof of concept, inefficient)

This exports Santa Monica Pier to ./export:

go run cmd/poc-export-obj/main.go
Authenticate URLs

This authenticates a URL using parameters from config.json:

go run cmd/auth/main.go [url]
Parse C3M file

This parses a C3M v3 file, decompresses meshes, reads JPEG textures and produces a struct that contains a textured 3d model:

go run cmd/parse-c3m/main.go [file]
Parse C3MM file (work in progress)
go run cmd/parse-c3mm/main.go [file]

Files on macOS

  • ~/Library/Preferences/com.apple.GEO.plist
    • last resource manifest url
  • ~/Library/Caches/GeoServices/Resources/altitude-*.xml
    • defines regions for c3m urls
    • altitude-*.xml url in resource manifest
  • ~/Library/Containers/com.apple.geod/Data/Library/Caches/com.apple.geod/MapTiles/MapTiles.sqlitedb
    • local map tile cache
  • /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
    • resource manifest base url, networking, caching, authentication
  • /System/Library/PrivateFrameworks/VectorKit.framework/VectorKit
    • parsers, decoders
  • /System/Library/PrivateFrameworks/GeoServices.framework/XPCServices/com.apple.geod.xpc
    • loads GeoServices
  • /Applications/Maps.app/Contents/MacOS/Maps
    • loads VectorKit

Important

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

flyover-reverse-engineering's People

Contributors

retroplasma avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.