Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 3.12 KB

data.md

File metadata and controls

55 lines (40 loc) · 3.12 KB

Understanding data model

Data model is important to understand how utymap renders scene from raw vector map data.

Table of content

Elements

Elements (Node, Way, Area, Relation) are basic components of UtyMap's conceptual data model which is inspired by OpenStreetMap (see osm docs) In general, data model consists of the following primitives:

  • Node - point specified by latitude and longitude. Used to define some POI (Place Of Interest) on map.
  • Way - open polyline specified by two or more points. Common usage is roads.
  • Area - closed polygon specified by three or more points. Widely used for simple buildings, terrain regions (green zones, water, etc.)
  • Relation - union of nodes, ways, areas or relations. Used for specifying complex shaped buildings, terrain regions, etc.

Each primitive has unique ID and set of tags. Tags define actual object represented by element data. Based on their location, all elements are grouped inside one or more quadkey. Each quadkey is defined by zoom (level of details), x, y (longitude and latitude). UtyMap uses Bing Maps quadkey schema.

Tags

Tag is just key-value pair, e.g. building=yes or kind=forest. Actual values depend on raw data schema used by specific data source meaning that active mapcss has to use this schema. For example, OpenStreetMap defines some park areas as leisure=park, but mapzen uses kind=park. Utymap does not perform any tag normalization in source code, instead, different mapcss styles has to be specified and used.

Data storage

Currently, utymap can import data from the following formats:

  • osm pbf
  • osm xml
  • geojson
  • shape

During import, data is converted into internal format which supports simple geo spatial requests. There are two types of data storage:

  • in-memory - stores all data in memory and all changes are discarded after application is unloaded. This type is useful for storing all changes applied to map data temporary (e.g. adding or removing new buildings).
  • persistent - stores data on disc in UtyMap's own format. This type is used for importing large regions once as import operation may take a lot of time and consumes RAM. Hint: you can import region on one device and copy to another.

You can use more than one data storage of given types (actually, there is no limit). It might be useful to implement custom save or role management systems.

Optimizations

Mesh cache

Version 2.1. adds mesh caching mechanism which stores generated terrain meshes on disk to avoid expensive calculations for unchanged data. It is enabled by default and can be disabled if needed.

Rendering less

Another optimization is reducing amount of data rendered by default. Can be easily done by revising mapcss rules.

Compression

This is in TODO list. General idea is to use compression for all persistent data.