Organization of view of object's coordinates on the map |
DBMS have possibility of storage of the spatial data in accordance with standard of OGC (Open Geospatial Consortium) - OGC 06-103r4: «OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture». The storage of a spatial description of an object in database fields is not regulated in no way by the OGC standard, which only defines a list of types of spatial objects and a set of basic functions for working with them. The standard prescribes a generally required representation in a standardized form of the data stored in such fields, and defines two types of representations - WKB (Well-known Binary Representation for Geometry) and WKT (Well-known Text Representation for Geometry). This means that all DBMS developers who support this standard have the right to store geodata in their own format, but at the same time they must provide the ability to access this data in a standardized format (WKB or WKT). The physical arrangement of spatial information in a binary data block of its own format differs from WKB, differs from DBMS to DBMS, and often is not documented. In view of this, GIS Panorama uses a standardized access to spatial data in a database by means of WKB standard. Each record of the database table is represented by a set of fields. The following generalized fields types are distinguished: - Primary key - a field that uniquely identifies a record in a data set (table); - Geodata field; - Fields of attributive information about object; - Field defining the external view of object on a map; - Field containing the text of the signature for objects of the «title» type.
To reflect information from the database table with spatial data, the following correspondence is carried out: - Geodata field - Map object metric; - Attributive fields - Semantics of a map object.
The primary key is placed into service semantics 32798 («Object identifier»). External view of map objects can be assigned a single one for the entire table displayed on the map, or may be defined for each record personally using a special field containing the identifier of the conventional map symbol. As the identifier of the conventional symbol of the map, either the key (symbolic code) or the integer code of the conventional symbol in the digital classifier of the map is indicated. Thus, the required fields in the database table necessary for its displaying on the map are: - Primary key; - Geodata field.
To the map object the unique conformity of one concrete record in one concrete table of database is established. In this case, one record can sometimes be represented not by one, but by a whole set of objects on the map, which is due to the specifics of the standard for representing the metrics of objects in the database -OGC 06-103r4: «OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture». In this case, the correspondence «DB table record у Cartographic object» should be considered as «DB table record у A set of cartographic objects». The OpenGIS specification defines two standard ways of defining spatial objects: in the form of Well-Known Text (WKT) and in the form of Well-Known Binary (WKB). The WKT and WKB include information about the type of object and the coordinates that make up the object. In addition, the OpenGIS specification requires the internal storage format of spatial objects includes an identifier of coordinate system (spatial referencing system identifier - SRID). SRID is required for adding an object into the database. The fastest from the point of view of processing by software is the definition of spatial objects in WKB format. It is this format that is used to organize the mutual exchange of data between the database and the vector map.
Binary representation of geometrical object (WKB): Binary representation of geometrical object (WKB) in NDR format (B = 1) of type Polygon (T = 3) with 2 LinearRings (NR = 2) each LinearRings consists of 3 points (NP = 3)
WKB representation is a description of a geometric object as a set of bytes of a specific format. Such a set consists of a header part and byte arrays that determine the coordinates of the object's contours. A sequence of bytes can be represented using one of two standard binary encodings. The difference between the two geometry encoding is that the sequence of bytes is encoded in Big Endian in XDR and Little Endian in NDR. To reduce computational costs, the program uses the WKB with little endian byte order - NDR. There is supported a work with geometry of 2-x (2D), 3-x (Z and M) and 4-x (ZM) metrics for the following types of objects shown below.
Types of database geometry supported by the program:
Simple types of database geometry correlate with the objects types of vector maps of the GIS Panorama format as follows:
Correspondence between the type of the map's object and the types of database geometry:
Support for multi-geometry of the multipoint type has no direct analogue on the side of the vector map and is achieved through sets of objects. An object corresponding to the type (type) is created on the map for each simple type of geometry included in the multi-geometry. Thus, on a map not one, but several objects at once will correspond to a database object having type of multi-geometry. Such objects on the map are combined into sets, which allows you to subsequently select the entire set on the map, that is, all the components of multi-geometry, one at a time. Support for sets of objects is implemented at the level of the GIS core «Panorama». In view of the above, it is not recommended to use geometry of type the multipoint, since sets of point objects will be created to work with it, which reduces performance and violates the integrity of the «1 record in a DB = 1 object» correspondence.
Correspondence of the type of objects in sets and types of multi-geometry of the database:
|