Skip to content

Latest commit

 

History

History
90 lines (73 loc) · 6.03 KB

README.md

File metadata and controls

90 lines (73 loc) · 6.03 KB

Map study

Understand how map is rendered

  • Use Open Street Map and use unity to render
  • Understand OSM map data structure
  • Understand Unity data structure
  • Code file reader/parser, and simple renderer for testing
  • Code converter for Unity, and demo app

Key words and Abgreviations

Words Description
OSM Open Street Map
MVT Mapbox Vector Tiles. spec
PBF Protocol Buffers. Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. spec

Blogs

Services

  • OSM Data Extracts | OSM data in regions via PBF
  • Mapzen Mapping platform to display, search, and navigate.
  • CARTO Platform for discovering and predicting the key insights underlying the location data.

Tools

  • osmosis Command line Java application for processing OSM data. github
  • TileMaker Command line tool to create vector tiles. github
  • iD In-browser OSM editor.
  • JOSM OSM editor for Java 8.
  • QGIS Geographic Information System.
  • OSM2World Converter that creates a 3D model of the world based on OSM. github.
  • ActionStreetMap Framework for building real city environment using Unity3d and OSM. github.

Routing

Wiki/Blogs

Tools

  • SimpleOsmRouter

Others

Notes

yeild in Unity C#

'yeild' is used in coRoutine. It stops operation and resumes in next frame. Qiita

yeild return null; // Stops for 1 frame and resume.

yeild return new WaitForSeconds( num ); // Stops for num seconds and resume.

OSM data structure

  • XML format (or PBF in hosts)
  • Many hosts offer compiled data. Assuming because the original data needs some processs like combining fragmented paths of an area, cascading attributes from different layers of data, and splitting data into smaller regions/area. The sample app directly uses the original data, but it should be pre-processed for performance.
  • Three type of elemnts, Node, Way and Relation. Node is a point, Way is a combination of Nodes creating line, or area if circled, and Relation is to combine elements to build complicated buildings, lines, area, etc.
  • An area can consists of multiple ways, thus need to combine them on drawing as OpenGL Polygon with filling color.
  • An area can be self-intersecting polygon and/or concave polygon. Such polygon needs to be tessellated.

OpenGL

  • Projection mode and ModelView mode
  • Projection is set in Projection mode, such as window size, perspective or ortho.
  • Modeling is set in ModelView mode, even camera rotation is done (same as whole world rotation).
  • LoadIdenty() is to reset and is done at first in every frame (possible to keep using but easier to reset).

So far

As of 28-Apr-2017, simple OSM file reader and renderer were made in Java with jogl on IntelliJ IDEA. Still a lot to do but here's the screen shot. First to fix some water area is not filled, and then support more tags, height. simple reader&renderer