# Smart Environmental Data Infrastructures: Bridging the Gap between Earth Sciences and Citizens
## Data and Metadata Representation and Storage
### Geospatial and Environmental Data Modeling and Storage
Topological primitives represent nodes, arcs, and faces of geospatial networks. Besides the representation of spatial network topologies, they also enable the representation of the zones (faces) of discrete coverages. The OGC Geography Markup Language (GML) [25] (also ISO 19136) provides an XML encoding for collections of Features that implements the above data modeling framework. An important profile of the above standard due to its widespread use in different types of geospatial tools is the simple feature access (SFA) implementation specification [26]. As it is shown in Figure 4, this profile defines three types of geometric primitives, namely, Point, LineString, and Polygon. A Point is represented with a tuple of real coordinates. A LineString is an approximation of a curve represented with an ordered sequence of points, using linear interpolation between consecutive vertices. Polygons are represented with an exterior LinearRing (circular LineString whose start and end points are identical) and possibly with a collection of interior holes, represented also with LinearRings. In addition to the basic primitives, SFA supports also collections of geometries (GeometryCollection). Heterogeneous collections are direct instances of type GeometryCollection, whereas specific subtypes (MultiPoint, MultiLineString and MultiPolygon) are defined for homogeneous collections of either of the three basic types. Finally, an abstract type Geometry enables the representation of any of the above types in heterogeneous Feature collections like the one in Figure 2(a). The above standard defines two encodings for geometric objects, a text encoding called well-known text (WKT) encoding and a binary encoding called well-known binary (WKB) encoding. Besides, SFA is also the ground for the GeoJSON encoding [27] of geospatial features and for most of the current implementations of spatial DBMSs and toolkits. Figure 3: Illustration of geospatial features and coverages. Geographic Coverages may also be encoded in GML, but as it is also the case for Features, a simplification of the model that considers other encodings has also been defined in the context of OGC activities [28]. The most important data encodings are the GeoTIFF format, widely used in the geospatial domain and the NetCDF format, which is very well known among environmental experts. While GeoTIFF restricts to 2D spatial coverages, the data model supported by NetCDF goes much further. NetCDF and its data model, called common data model (CDM), have been proposed by UNIDATA ([[https://www.unidata.ucar.edu/](https://www.unidata.ucar.edu/)]([https://www.unidata.ucar.edu/](https://www.unidata.ucar.edu/))), a community of research and education entities whose objective is the sharing of geoscientific data and accessing and visualization tools. As it is shown in Figure 5, a dataset of the CDM has a tree of groups. Each group may have a collection of variables. Each Variable is a multidimensional geoscientific array of a specific data type. The dimensions of each variable are also defined in the same group and they may be shared by multiple variables. A group might also contain enumerations that may be used as data types of variables and attributes that are used to record metadata (pairs key-value) at the level of group or variable. One dimensional coordinate variables may be used to record the values of dimensions. It is noticed that the multidimensional CDM model of UNIDATA resembles the conventional multidimensional models used in data warehouses. A main difference is the specific support of CDM for sampling dimensions over space and time. Figure 4: Geometric types in Open Geospatial Consortium (OGC)-simple feature access (SFA) implementation specification. Figure 5: Main structures of the UNIDATA common data model (CDM).