description of layers to import and the symbology to
apply to them. This file is editable through a
symbology editor included with the library.
The cartographic data from OpenStreetMap are
stored in shapefiles, they each contain a data layer
(roads, natural features, places...) for a defined area.
Once the data from shapefiles were loaded, the
symbology defined in the dspx file is applied and the
basemap is displayed in the map control. Then,
business data like the Biotour network and the
customer location points are displayed on additional
data layers created from the data stored in the SQL
Server database.
5 MANAGEMENT OF DATA
LAYERS
DotSpatial allows, like any GIS solution, to manage
the data in a system of map layers. Among the layers
used in the map controls, some are part of the
basemap and are static layers. Other layers are
business layers on which the user will be able to act
(selection, drawing, additional data display, etc.).
The map data layers are loaded from shapefiles
while business data layers are loaded from the
existing SQL Server database of Biotour.
Businesslayers
SQLServer
Cartographiclayers
shapefiles
Figure 2: Layer types and their origin.
Next, when we look at the representation of data
on a map, the notion of map projection comes in. In
all online mapping services, such as Google Maps or
Bing Maps, the projection used is the Web Mercator
projection, this projection is also used by MapPoint.
Because of the constraint to remain as close as
possible of MapPoint rendering, this projection is
used in the new solution. However, coordinates of
basemap data are not projected in Web Mercator but
are in WGS84 format (a standard for use in
cartography, geodesy, and navigation including by
GPS), so a projection of this data is required. These
projections are made when the dspx file containing
the legend is loaded. About coordinates of business
data present in the database, they are also in WGS84
format. So, conversion functions for switching from
one projection to another have been implemented to
project coordinates from WGS84 to Web Mercator
and vice versa.
5.1 Cartographic Layers
Data of these layers are collected under the shapefile
format. In this format, each entity has metadata that
includes information on it. For example, for a
segment of roads data file, there is the type, the
direction of movement, etc. To display raw data in
an understandable representation, a symbology must
be applied to each data layer based on metadata.
Symbology operates on the association of a
representation and a filter expression. The filtering
works with simple logical expressions that are
applied to the metadata. When a symbology is
applied to a data layer, if the metadata associated
with an entity corresponds to the case of a filter
expression then the corresponding style will be
applied to that entity. Here are some examples of
filter expressions:
• [TYPE] <> 'primary' AND [TYPE] <>
'secondary'
• [NAME] = 'Rue Victor Hugo' AND
[ONEWAY] = '0'
Data displayed on the map depends on the zoom
level. However, in the DotSpatial library, the
function to manage the appearance of a data layer
depending on zoom level is implemented but does
not manage the appearance depending on metadata.
Thus, the appearance of data is set for the entire
layer and it is therefore not possible to display only a
part. So, this behavior had to be implemented by
modifying the symbology when the user changes the
zoom level.
A basemap which look likes all others basemap
provided by web map services has been
implemented. The symbology is applied both from
the .dspx configuration file for the majority of layers
and from the interface library which allows to
implement a symbology depending on zoom level.
5.2 Business Layers
Data of these layers are loaded from the existing
database of the application. No changes of the data
structure are required to build a map layer from an
existing table. A map object is built from a business
object by assigning his coordinates to the map object
and all others properties to the metadata of the map
object. Then all built map objects are assigned to a
layer that can be displayed with the appropriate
symbology. Inversely, to get a business object from
a selected map object, coordinates and all metadata
of the selected object are used to build a business
object that can be used in a business process.