<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Spatial Knowledge and Information Canada</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Symbology Encoding Using CartoCSS to Support Complex Symbols</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>SOROUSH OJAGH</string-name>
          <email>Soroush.ojagh@ucalgary.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>SARA SAEEDI</string-name>
          <email>ssaeedi@ucalgary.ca</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>JAMES BADGER</string-name>
          <email>jpbadger@ucalgary.ca</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>STEVE LIANG</string-name>
          <email>Steve.liang@ucalgary.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Geomatics Engineering, University of Calgary</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Geomatics, Engineering, University of Calgary</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <volume>7</volume>
      <issue>6</issue>
      <abstract>
        <p>Spatial analysts and decision makers are in growing need of interacting with maps as a visualization method of representing spatial information. CartoCSS is a style encoding which allows high-level of customization for cartographic aspects of a map. In this paper, we look at CartoCSS encoding as a styling option to render complex symbols. We also review its functionality in different environments including web, mobile, and desktop computers.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Geospatial data inherently contains
location-related digital information. Styling
geospatial data and using symbols can be
considered as the only way of portraying
geospatial data as a map (Guo, Long, &amp; Ji).
Various map makers are using different
symbols and terminologies for the same
feature. The Semantic Portrayal Ontology
has been developed to increase the
reusability of portrayal information between
different map makers
        <xref ref-type="bibr" rid="ref4">(Huang, Mansourian,
&amp; Harrie, 2017)</xref>
        .
      </p>
      <p>
        Customizing the cartographic aspects of a
map especially for composite symbols based
on Semantic Portrayal Ontology developed
by Open Geospatial Consortium (OGC)
Testbed 13
        <xref ref-type="bibr" rid="ref1">(Fellah, 2017)</xref>
        , is the primary
focus of this article. Styling geospatial data
is the only way to render data on a map.
Geoserver is one of the mostly common
used open source map server
        <xref ref-type="bibr" rid="ref6">(Mittlboeck &amp;
Belgiu, 2018)</xref>
        . It normally uses Styled Layer
Descriptor (SLD) as a XML-based markup
language to style geospatial data
        <xref ref-type="bibr" rid="ref5">(Landeta,
Vásquez, Rea, &amp; García-Santillán, 2018)</xref>
        .
However, it can use CSS-derived language
extension to style geospatial data instead of
SLD
        <xref ref-type="bibr" rid="ref2 ref3">(Geoserver, 2018a)</xref>
        . Styling composite
symbols using SLD and CSS can be done by
using defined geometry element of desired
feature
        <xref ref-type="bibr" rid="ref2 ref3">(Geoserver, 2018b)</xref>
        . Based on our
knowledge, styling composite symbols has
not been studied and applied by using
CartoCSS until now. In comparison to SLD,
CartoCSS is more compact and easier to
read and develop. So, we focused on using
Kosmtik as an external tool to render styles
developed by CartoCSS style encoding for
composite symbols in this study. Rendering
composite symbols such as bridges by using
CartoCSS styling language is the main
contribution of this study.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Methods and Data</title>
      <p>We styled a map using data in Shapefile
format that represents the Daara Refugee
Camp. We created a representation using
the result of applying CartoCSS encoding on
Kosmtik (Orgs, 2017). Styling bridges as
composite symbols with a different
appearance at different zoom levels is the
main outcome of this article. To achieve our
goal, we present bridges as double border
lines with angled lines at the start and end
points of each bridge’s borderline. Bridges
are defined by a single polyline in the
middle of the street or road. In figure 1-a,
the red dashed line is the bridge’s polyline in
the Shapefile, but we have to present the
bridge as the blue collection of lines (the
desired symbol). By using SLD or CSS
instead of CartoCSS, we can draw the angled
lines and control their geometry by the
predefined geometry element. However, in
CartoCSS it would be a challenge because
we cannot draw a new line and control its
geometry. So, to address this challenge, we
proposed an innovative method, and tried
styling the bridge’s composite symbols
through five steps illustrated in figure 1-b to
1-f. Actually, in the first step, two parallel
polylines are drawn along the central
polyline of bridge with an offset equal to the
half of road width. Then, we used two sets of
markers which are simple straight lines as
the angled lines of bridge’s symbol. In the
step 2, the first and last vertices of bridge’s
polyline will be extracted first. Then, we
placed created markers on the extracted
first and last vertices of bridge’s polyline. It
is worth mentioning that the central point of
markers will be attached to the extracted
vertices. In the third step, markers will be
rotated based on the required angle, which
is 45 degrees. Step four and five defined to
translate and offset rotated markers to be
placed on the first and last vertices of
parallel polylines. This process is defined by
showing the applied CartoCSS encodings in
Figure 1.</p>
      <p>Figure</p>
      <p>Description
a) Desired composite symbol
for bridges: double border
lines with angled lines at the
start and end points of each
bridge’s borderline
b) Step 1: Portray two parallel
lines showing bridge’s border
We used ::Background and
::Foreground ordering</p>
      <p>features
c) Step 2: Place two sets of
markers in the first and last
vertex of bridge’s polyline
marker- placement: vertex-first;
marker-placement:
vertex-last;
Marke
d) Step 3: Rotate markers
transform: rotate
(</p>
      <p>45,0,0);
marker-transform: rotate</p>
      <p>(45,0,0);
e) Step 4: Translate markers
marker-t transform: translate
(</p>
      <p>2.5,0);
f) Step 5: Offset markers
marker-offset: 8;</p>
    </sec>
    <sec id="sec-3">
      <title>3. Results</title>
      <p>We applied our methodology to style bridge
composite symbols at different zoom levels.
Figure 2-a and 2-b show the similar result of
applying CartoCSS styling language to style
bridges viewed by Kosmtik in Google
Chrome and Internet Explorer at zoom level
14. Styled bridges at zoom level 17 is shown
in Figure 2-c. Figure 2-d depicts the same
concept in Smartphone browser for zoom
levels 18 and 19.
a) Styled bridges in Google Chrome version: 70. 0.3538.77 zoom
level 14.
b) Styled bridges in Internet Explorer version:
11.0.9600.18697 zoom level 14.
c) Styled bridges in Internet Explorer version:
11.0.9600.18697 zoom level 17.
d) Styled bridges in Huawei Mate 10 zoom level 18 (left) and
zoom level 19 (right).</p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>Rendering composite symbols and using
customized cartographic styles is the goal of
the current study. We developed the desired
customized styles using CartoCSS styling
language and render the resulting map
using Kosmtik in different browsers and
devices. Controlling the order in which
features are being portrayed can be
considered as one of the fundamental needs
to portray spatial data. To the best of our
knowledge, it has not been addressed by
CartoCSS styling language until now. So, it
would be mentioned as the future direction
of the current study.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgements</title>
      <p>
        We want to acknowledge OGC Testbed 14
effort which this work is part of the OGC
Testbed 14 Por
        <xref ref-type="bibr" rid="ref7">trayal project (Saeedi, 2018</xref>
        ).
      </p>
    </sec>
    <sec id="sec-6">
      <title>Author contributions</title>
      <p>This paper is part of the OGC Testbed 14
portrayal project which is implemented at
the Geo-Web Sensor lab, University of
Calgary. Soroush Ojagh imported the
dataset and symbol set, preprocessed the
dataset, implemented the portrayal
methodology and wrote the paper. Dr. Sara
Saeedi who is the main editor of the OGC
Testbed 14 Symbology Engineering Report
contributed regarding the portrayal
methodology and the final paper structure.
James Badger developed the web
application and web map service and
participated in different steps of the
project/paper. Dr. Steve Liang supervised
the project and also contributed regarding
the final paper edits.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Fellah</surname>
            , S., Mitchell,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giannecchini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          (
          <year>2017</year>
          ).
          <source>OGC Testbed-13: Portrayal Engineering Report. OGC 17-045</source>
          . Retrieved from http://docs.opengeospatial.org/per/ 17-
          <fpage>045</fpage>
          .html
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Geoserver.</surname>
          </string-name>
          (
          <year>2018a</year>
          ).
          <source>CSS Styling</source>
          . Retrieved from https://docs.geoserver.org/latest/en /user/styling/css/index.html
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Geoserver.</surname>
          </string-name>
          (
          <year>2018b</year>
          ).
          <article-title>Geometry transformations in SLD</article-title>
          . Retrieved from https://docs.geoserver.org/stable/e n/user/styling/sld/extensions/geom etry-transformations.html
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Huang</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mansourian</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Harrie</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          (
          <year>2017</year>
          ).
          <article-title>Geospatial data integration and visualisation using Linked Data. Paper presented at the 4th Association of Geographic Information Laboratories for Europe PhD School</article-title>
          , AGILE
          <source>PhD School</source>
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Landeta</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vásquez</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rea</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>GarcíaSantillán</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          (
          <year>2018</year>
          ).
          <article-title>Edition, Publication and Visualization of Geoservices Using Open-Source Tools</article-title>
          .
          <source>Paper presented at the Conference on Information Technologies and Communication of Ecuador.</source>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Mittlboeck</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Belgiu</surname>
            ,
            <given-names>M. J. I. J. o. G.</given-names>
          </string-name>
          (
          <year>2018</year>
          ).
          <article-title>GeoS4S Module OpenGIS and Spatial Data Infrastructure</article-title>
          .
          <volume>14</volume>
          (
          <issue>3</issue>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Buehler</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          (
          <year>2018</year>
          ). OGC® Testbed-
          <volume>14</volume>
          :
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <source>Symbology Engineering Report. OGC 18-</source>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>029. Retrieved from</mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>http://www.opengis.net/doc/PER/t14-</mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>D029</mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>