GeoJson
GeoJSON (RFC 7946), the format most map data is published in, read into and written from the library's shapes.
Reading (decode) takes a FeatureCollection, a single Feature or a bare geometry. A Point becomes a marker, a LineString a polyline, a Polygon a polygon whose rings are the outline and its holes. A MultiPolygon becomes ONE polygon of all its rings (the model keeps parts and holes together under the even-odd rule, see DrawnPolygon), and a MultiPoint, MultiLineString or GeometryCollection becomes one shape per member. A feature's id is the shape's id (made unique when it isn't), its description or else name property the shape's description, and the simplestyle properties give the colours: fill, fill-opacity, stroke, stroke-width, stroke-opacity and marker-color, marker-size, each with the spec's own default when missing. Every other property is kept as text in the shape's properties (a number as its text, an object or array as its JSON text, null skipped), name among them, which also stands in for a missing description. Vertex ids are made up (<shape>-<ring>-<index>), since GeoJSON has none, and the closing point of a ring is dropped (the model closes a ring itself).
Real data is untidy, so reading is forgiving: a feature that cannot be used (no geometry, a point outside the globe, a ring of two points) is left out and says so in ImportResult.warnings, and is counted by kind in ImportResult.leftOut, rather than failing the whole file. Only a text that is not GeoJSON at all throws.
Writing (encode) is lossy by nature: GeoJSON has no pictures, no hatching, no labels and no vertex ids, so a shape filled with an image has no fill, and the id, description, colours (alpha as -opacity), zIndex and properties (as text properties of the same names, except the keys the library writes itself) are what is kept. A polygon of several parts becomes a MultiPolygon, its outer rings counter-clockwise and its holes clockwise as the RFC asks. For a lossless file use DrawJson.
Coordinates are [longitude, latitude], with the altitude as a third number only when it isn't 0. Nothing is reprojected: GeoJSON is WGS 84 degrees, like the model.