# Matrix values

[[Category:Proposals with "Draft" status|]][[Category:Proposed features under way|]]

Despite One feature, one OSM element principle, tagging some complex concepts or objects still matter when it comes about stacked objects on a single node or alongside a way. It may be useful to consider options to describe how it goes when situations can't be addressed with simpler scalar values in keys.
Matrix values intend to define a 2 dimension table as a text string put in a key value. It's not encouraged nor designed to extend it to keys names which can get Namespaces.
Such table cells will contain values that refer to the key holding the matrix. Thus, different values in the table are still consistent as they should be all part of the same set of concepts a given key is intended for.

Work has been done to document highway lanes or complex arrangement of power lines on a single support. This page summarises and generalises conclusions and habits to help anyone that would use same tooling to solve another situation.

## Principles

### Restrictions

A matrix value is a really complex way of modelling information on objects that may be linked to external databases instead of populating OSM.
You should always wonder what is the exact need you satisfy when using them as to not clutter the database with non-geograĥical information and be sure this conforms to Good_practices.
Matrix values allow to document things that couldn't with simple scalar values. They're not designed to merge objects or make the mapping more concise. It's still recommended to use scalar values with as many OSM feature as needed to produce the simpler tagging as possible.

### Defining a table

Defined table always depends on context the matrix is used in.
It is relative to a physical feature seen on ground and the key documentation should explicitly define how matrix values are used and what they mean.

### Factorise rows

Sometimes, it may be possible to merge equivalent rows in a single set of values by adding a positive multiplicating factor representing the amount of time the pattern is repeated on ground.
For instance, line_attachment=2(suspension|pin|suspension)|(anchor) is a simplified version of line_attachment=(suspension|pin|suspension)|(suspension|pin|suspension)|(anchor). Both value could be used independently and will mean the same thing.