Professional Documents
Culture Documents
HENRIK SANDSTRÖM
and JOHANNES SVENSSON
HENRIK SANDSTRÖM
and JOHANNES SVENSSON
TRITA-CSC-E 2010:119
ISRN-KTH/CSC/E--10/119--SE
ISSN-1653-5715
KTH CSC
SE-100 44 Stockholm, Sweden
URL: www.kth.se/csc
Abstract
This Master Thesis investigates how a solution for indoor
maps can be implemented. It proposes an XML-based for-
mat for storing the internal information of buildings. This
thesis shows how a format was created by first researching
present outdoor map formats, then combining the best con-
cepts from these formats with required indoor information.
The proposed format is focused on being easy to use and to
work with. The format takes advantage of important con-
cepts like layers, inheritance, and references, which makes
it flexible and to prevent redundancy.
This thesis also shows how the created format works in
different implementations. The main implementations are
an editor, which can quickly and easily create maps, and
a mobile viewer, which makes it possible to interact with
the maps from a cell phone. During the implementation
the format was improved to make it more understandable
as well as easier to work with. The problem with the lack
of an indoor positioning system is discussed. This problem
was solved in the viewer by using extensive search functions
and the possibility to scan available barcodes throughout
the building.
Sammanfattning
Inomhuskartor
Detta examensarbete undersöker hur en lösning för inom-
huskartor kan utformas. Arbetet föreslår ett XML-baserat
format för lagring av information om byggnaders struktur.
I rapporten visas hur ett format skapas genom att först
undersöka existerande kartformat, för att sedan använda de
bästa idéerna från dessa format kombinerat med nödvändig
information om inomhusmiljöer. Det föreslagna formatet är
fokuserat på att vara både enkelt att använda och arbeta
med. Det använder sig av viktiga koncept som lager, arv
och referenser för att göra formatet flexibelt samt för att
undvika redundans.
Denna rapport visar också hur det skapade formatet
fungerar i olika implementationer. De viktigaste implemen-
tationerna som gjorts är en editor som snabbt och enkelt
kan skapa kartor samt en mobil applikation som gör det
möjligt att interagera med kartor med hjälp av en mobil-
telefon. Formatet förbättrades kontinuerligt under imple-
mentationen för att göra det lättare att både förstå och
jobba med. Problemet med avsaknaden av ett inomhus-
positioneringssystem diskuteras. Detta problem löstes på
den mobila applikationen med hjälp av omfattande sök-
funktioner samt möjligheten att skanna streckkoder som
finns i byggnaden.
Contents
Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Preface
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Division of Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Background 5
2.1 XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.1 Adoption/Existing Implementations . . . . . . . . . . . . . . 5
2.1.2 Text-based Properties . . . . . . . . . . . . . . . . . . . . . . 6
2.1.3 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.4 XML Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.5 XSLT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.6 XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.7 XLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.8 XPointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 The IFC Building Model . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.2 Important Ideas and Concepts . . . . . . . . . . . . . . . . . 7
2.2.3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 GML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.1 Important Ideas and Concepts . . . . . . . . . . . . . . . . . 11
2.4 CityGML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4.2 Important Ideas and Concepts . . . . . . . . . . . . . . . . . 13
2.5 KML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.5.2 Important Ideas and Concepts . . . . . . . . . . . . . . . . . 14
2.6 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6.1 Global Positioning System . . . . . . . . . . . . . . . . . . . . 18
2.6.2 Mobile Network Localization . . . . . . . . . . . . . . . . . . 19
2.6.3 Wireless Network Positioning . . . . . . . . . . . . . . . . . . 19
2.6.4 Hybrid Positioning . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.5 Indoor Positioning . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.6 Positioning With Only a Map . . . . . . . . . . . . . . . . . . 20
2.6.7 Positioning Conclusion . . . . . . . . . . . . . . . . . . . . . . 20
3 Method 21
3.1 Structure of the Work . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Choice of Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 The Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.1 Format Description . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.2 First Draft Results . . . . . . . . . . . . . . . . . . . . . . . . 27
3.3.3 Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.3.4 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3.5 Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.6 Writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.7 Graphical Representation . . . . . . . . . . . . . . . . . . . . 31
3.3.8 Licensing Fees . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.4 Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.4.1 Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.4.2 Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.4.3 Fast Floor Switching . . . . . . . . . . . . . . . . . . . . . . . 36
3.4.4 Snap to point/axis . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4.5 Underlay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4.6 Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4.7 Zoom and Pan . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4.8 Import and Export of EIML . . . . . . . . . . . . . . . . . . 37
3.4.9 Marking Origo . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.4.10 Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.4.11 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.4.12 Target Platform . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.5 Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.5.1 Target Platform and Hardware . . . . . . . . . . . . . . . . . 39
3.5.2 Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.5.3 Displaying and Navigation . . . . . . . . . . . . . . . . . . . . 41
3.5.4 Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5.5 Area Interaction . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6 Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6.1 Implementation Results . . . . . . . . . . . . . . . . . . . . . 44
4 Results 47
4.1 Use of other formats . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.1.1 Format Structure . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.1.2 Object Orientation and Inheritance . . . . . . . . . . . . . . . 48
4.1.3 Object References . . . . . . . . . . . . . . . . . . . . . . . . 48
4.1.4 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2 Open Vs. Closed data . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2.2 Effects of an Open Format . . . . . . . . . . . . . . . . . . . 49
4.3 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.4 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.4.1 Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.4.2 Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.4.3 Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.4.4 Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.5 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.5.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.6 Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.7 Implementation results . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.7.1 Usage of SVG . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5 Conclusion 55
6 Future Work 57
6.1 Tag List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.2 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.3 Customizable Container . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.4 Time Dependent Objects . . . . . . . . . . . . . . . . . . . . . . . . 58
Bibliography 59
Abbreviations
CityGML (City Geography Markup Language)
CityGML is an information model used to define a set of 3D urban objects. It is
also able to define relationships between these objects. CityGML is based on GML
and is a standard of the Open Geospatial Consortium.
EIML
EIML is the name given, by us, to our newly constructed format for storing indoor
maps.
XML Schema
XML Schema (with capital s) is a type of XML schema which defines a set of rules
which an XML file must follow to be regarded as valid. Is itself an XML document
which can be validated with a DTD file. It is an open standard developed by the
W3C.
Acknowledgements
We want to thank our supervisors at Ericsson for the opportunity to investigate this
thesis and also for the help and guidance throughout the project. We also want to
thank Stefan Arnborg for the insight and help with our project.
A special thanks goes to Alessandro Pieropan at CVAP for taking his time to
review our work with us.
Division of Work
The most important part of this Master thesis, which also required the most ex-
pertise, was the format for storing indoor maps. Therefore, we decided to do the
background study together so that we would be able to discuss the format with each
other.
For the implementation part we decided to divide the work as much as possible.
The class structure was shared by all implementations, and was therefore a combined
effort. However, the work of parsing (described in Section 3.3.5) and writing (Section
3.3.6) the format was done individually; Henrik did the parsing and Johannes the
writing.
In the early stages we also did some work on small, but important, aspects of the
format’s use. Most of this work is mentioned shortly in the report and was divided as
follows: Henrik worked with SVG conversion with Java (described in Section 3.3.7),
validation with XML Schema and Java (Section 3.3.4). Johannes worked with SVG
conversion with XSLT (Section 3.3.7), initial work on map drawing algorithm which
was later used in the viewer and the editor (Section 3.3.7).
The two biggest implementations of the format were the editor and the mo-
bile viewer. These were worked on separately with Johannes creating the editor
(described in Section 3.4) and Henrik creating the viewer (Section 3.5).
Structure of the Report
The first part of this report contains the background study. In this section we have
summarized the, for us, most important parts of the literature study.
After the background study is the Problem and Purpose section where we explain
how our work can be used and also what our goals were. The Method section of
the report contains our practical work. It explains the different parts of the format
and the implementations of the format. Each section contains a description of what
we did, how we did it, and the direct result. In the Result section are the results of
our work. This includes for example how the different components performed and
what we learned from creating and using them.
The last section after the Conclusion is the Future Work section. In this section
we highlight what we felt should be added to the format in the future.
When the term the format is used in the report it refers to the format that we
created during the project.
Chapter 1
The initial problem formulation of this Master Thesis was described as follows:
Indoor location based services can be considered the next step within
location-based services. Although it seems to have much in common with
the currently existing outdoor solutions it differs quite much when you
compare the map data, positioning technologies, and user interaction.
This Master thesis will investigate how a solution for indoor maps can
be implemented.[11]
The main goal of this Master Thesis is to create a useful format for storing
indoor maps and to make implementations that show how the format, which was
named EIML, is used effectively. The format must first and foremost be easy to
use. This means that it must be easy for a user to both understand and use it in an
implementation. To accomplish this it was decided that different use cases would
be created to show the possibilities of the format. Before the use cases could be
created, possible areas of usage were discussed. The implementation part focused
on creating software as a proof of concept. However, we made our best to ensure
that it would be possible for others to continue work on the software in order to
make it widely usable.
1.1.1 Conferences
At conferences it can be useful to have an indoor map of the building or buildings
that are relevant for the conference so that visitors can find their way around the
1
CHAPTER 1. PROBLEM AND PURPOSE
conference. Such an indoor map could also change with time to always show the
current speaker in the right section of the conference.
1.1.2 Exhibitions
At an exhibition an indoor map could be of great importance. Such a map would
allow the visitor not only to get an overview of the complete exhibition, but also
search for and highlight the parts of the exhibition that are the most interesting for
the visitor. The map can also guide the visitor to these points of interest (POI).
2
1.2. USE CASES
Bob wants to visit a specific conference room. The core of the indoor
map application is already on his phone, however, he does not have a
map of the building he is in. He scans a barcode in the reception that
tells the indoor map viewer application to download the latest version of
this building’s indoor map. When the map is downloaded the barcode
information is still available and tells the application where Bob is in
the building and shows the correct position on the map. He now has the
map on his phone and knows where on that map he is located so that
he can start navigating.
Bob does a search for the conference room in the viewer and it tells
him that he only has to take the elevator to the next floor and then take
the first left in the first corridor on the right. Furthermore the viewer
shows the location of the final destination on the map on the screen.
Ben has an image of the floor plan that he wants to use for guidance
when drawing the new indoor map. Ben starts the indoor map editor
and is presented with a single clean floor of a new building. He then
adds the floor plan image as an underlay in the editor. He controls the
scale of the image and the opacity of the underlay so that he can draw
effectively on top of it.
Ben wants the map to be in the right scale. To achieve this he draws
a wall that he knows the length of. He then selects the option to set
the scale for the wall to the real world length of that wall. The editor
now knows the wall’s exact length and it will draw all other objects in
3
CHAPTER 1. PROBLEM AND PURPOSE
the correct scale. Ben now draws wall lines where the underlay image
indicates that walls are located. He then switches draw tool to draw
windows instead and creates a few of those. After that Ben switches to
the tool for drawing doors and adds doors to the rooms. He is now done
with the drawing of the basic structures on that floor.
Ben now wants to define the conference rooms on the map as well as
add additional information about these rooms. He switches to the area
select mode. In this mode Ben can easily select the lines that will act
as the barrier for the conference rooms. When the selected lines make a
complete polygon, that is accepted by the format, the editor will create
the area and clear the selection. Ben stays in this mode to create a few
more areas. After this, Ben wants to change the name and description
of one of the newly created areas. He then goes back in to the edit mode
to right click on one of the lines of the area. Ben is then presented with
a drop down menu with options relevant to that line. He selects the
option to set the name of the area and is presented with an input box
where the current name of the area is already filled in. Ben selects a
name for the conference room and confirms the change. He then right
clicks again on a line on the edge of the area and selects the option to
set the description of the area. After setting a description for the area
Ben feels as if he is done with the map and chooses to save the file.
Corp Inc. wants their own viewer with company specific graphics
and information to perfectly fit their target audience. To accomplish
this task, Brian first wants to parse a given format file to his own class
hierarchy to then be able to paint and perhaps also modify the data.
Since the format is based on an open format for storing information in
files, it is very easy for Brian to use a readily available parser to parse
the format file. He can then create the wanted class hierarchy while
parsing the file. When Brian wants to export the indoor map data to
file he can easily use a readily available serializer for the open format,
for storing information in files, to create a file.
4
Chapter 2
Background
There is no standardized method for storing information about and drawing simple
maps of an indoor environment. However, there exist formats for modeling outdoor
environments and formats that model buildings from an architectural point of view.
We have studied these other formats and summarized the most important key con-
cepts and ideas. We have also studied other areas that are relevant to our format.
The key ideas that we feel are the most important and relevant for the creation of
our maps are presented in this section.
2.1 XML
XML (Extensible Markup Language) is a widely used and accepted open standard
for storing information in files[8]. It is a text-based file format where the information
is structured with tags. This makes the XML files relatively easy for a human to
understand and edit directly with just a text editor. XML is extremely strict, it
has a rule that if a document is found to have any error, missing tag or other,
the parser must exit directly. Since the XML format was introduced more than
ten years ago it has implementations and tools for almost every single platform.
This makes it a good candidate for our format. Several of the latest and most used
outdoor map formats like GML (Geography Markup Language) and KML (Keyhole
Markup Language) are based on XML.
5
CHAPTER 2. BACKGROUND
2.1.3 Validation
A big advantage with using XML is that the XML files can be validated using an
XML schema. An XML schema contains a set of rules that can validate XML files.
2.1.5 XSLT
XSLT (Extensible Stylesheet Language Transformations) is an XML-based language
with the purpose of describing how an XML format is translated into another XML
format. XSLT is also an open standard, and just as XML, developed by the W3C.
This format can, for example, transform the XML-based KML format for outdoor
maps into the XML-based SVG (Scalable Vector Graphics) image format[9].
2.1.6 XPath
XPath is a query language for selecting nodes from any XML document. While
doing this selection, XPath is also capable of computing values. It is possible to
change the navigation and selection depending on these calculated values and also
according to other local criteria. XPath is also an important part of XSLT.
2.1.7 XLink
XLink is a specification that provides methods for creating internal and external
links within XML documents. It is also possible to associate meta-data with the
links that are created. With XLink it is only possible to link to a complete document.
An XLink is almost as an XHTML (Extensible Hyper-Text Markup Language) link
6
2.2. THE IFC BUILDING MODEL
2.1.8 XPointer
XPointer is a standardized way to create hyperlinks in to specific parts of an XML
document. An example of how XPointer can be used:
href=http://www.zoo.com/zoolist.xml#id(’animal’).child(5,item)
This creates a link to zoolist.xml and finds the tag labeled animal and retrieves the
fifth item under that tag.
7
CHAPTER 2. BACKGROUND
• Core Layer – This layer defines core concepts such as actor, group, product,
and relationships which are all used in the higher layers.
• Interoperability Layer – This layer contains the most common building com-
ponents such as walls, beams, columns, doors, etc. It also contains services
such as fluid flow and sound properties.
• Domain Layer – The highest level which contains concepts for architecture,
structural engineering, facilities management, etc.
Construction Facilities
HVAC Electrical Architecture
Management Mgmt
Domain Domain Domain
Domain Domain
Repres-
Profile Property Quantity Topology Utility
entation
Resource Resource Resource Resource Resource
Resource
Figure 2.1. A visual overview of the layers and what they contain[4].
8
2.2. THE IFC BUILDING MODEL
Representation of Space
Many formats do not have a definition of space because it does not exist as a physical
object. However, in the IFC model, space is included and can be defined and used in
relations. The reason for this is that space can play an important role when talking
about, for example, heating placement and cost. In this case there is a relationship
between how much space we need to heat and what kind of surfaces that are related
to that space.
Relationships
Relationships are an important part of the IFC model. As mentioned earlier, there
are relationships between, for example, walls and spaces. The relationships which
are defined in the model are very flexible. It is not necessary to relate a wall to
the space that it encloses, instead it can be related to the floor. Relationships are
defined as classes in the IFC model and there are five different kinds of relations.
Custom Entities
When working with the IFC model it is possible to define new entities. These
entities are called products or proxies and can be defined in the same way as all
other predefined entities are defined.
External References
External references are often accessed through a HTTP access protocol. There are
three different types of external references in the IFC model. These are document
reference, classification reference, and library reference.
9
CHAPTER 2. BACKGROUND
example of this usage is the possibility to define an actor, see figure 2.2. This actor
has nothing to do with the materials that the building should consist of, but he plays
an important role in the construction. An IfcActor can then even be related to an
organization and be assigned a profile containing name and other information[5].
Concept of a Library
It is possible to reference objects and concepts that are in an external library.
Product information might be stored in the supplier’s database and updated by the
supplier. The possibility to reference this information makes it possible to always
have the latest values. Another benefit is that a library reference places a significant
amount of data outside of the IFC model which keeps down the size and complexity
of the file.
Measurements
The measurements in the IFC model need to have some kind of unit. In this aspect
the model displays great flexibility, offering both imperial and metric units and even
the ability to convert between them.
2.2.3 Conclusion
The IFC building model does not only define how a building looks, it defines ev-
erything that is needed to construct that building. Everything from material and
10
2.3. GML
their cost to the human resources and organizations that need to be involved can
be modeled with IFC. This makes the format very useful for architectural projects.
2.3 GML
GML (Geographic Markup Language) is an XML-based standard for expressing
geographical features. The grammar is defined by the Open Geospatial Consortium
(OGC)[22]. GML is only used for expressing features and does not say anything
about how these could be represented graphically.
Main Ideas
These are the main ideas of the GML standard[22]:
• provide an open, vendor-neutral framework for the description of geospatial
application schemas for the transport and storage of geographical information
in XML
• allow profiles that support proper subsets of GML framework descriptive ca-
pabilities
• support the description of geospatial application schemas for specialized do-
mains and information communities
• enable the creation and maintenance of linked geographic application schemas
and datasets
• support the storage and transport of application schemas and datasets
• increase the ability of organizations to share geographic application schemas
and the information they describe
11
CHAPTER 2. BACKGROUND
Feature
A feature is defined as an abstraction of a real world phenomena and it is associated
with a location relative to the Earth. This means that a digital representation of the
real world may be thought of as a set of features. The state of a feature is defined
by a set of properties, where each property may be thought of as a combination of
a name, a type, and a value.
Root Element
GML has a root XML type from which XML types for all GML objects must be
derived.
Referencing
In the GML format it is possible to reference not only other parts of the same
document, but also any site or location on the Internet. This is done with XPointers.
Users
GML is emerging as the international standard for outdoor geographical data. To-
day, over 250 companies and agencies around the world use GML.
12
2.4. CITYGML
2.4 CityGML
2.4.1 Overview
CityGML (City Geography Markup Language) is a concept for modeling and ex-
changing of 3D city and landscape models. It is implemented as an XML application
schema and a subset of GML and is an official OGC Standard that can be used free
of charge. CityGML does not only have support for the visual objects in a city but
can also be used to model traffic and other abstract dynamic objects.[21]
These levels can be processed and viewed independently depending on the needs
of the user. Objects may also be modeled in different LOD simultaneously which
enables the analysis and visualization of the same object with regard to different
degrees of resolution. See figure 2.3 for a visual example of LOD.
Grouping
In CityGML it is possible for the user to define groups. These group aggregates
arbitrary city objects according to user-defined criteria. These groups can also be
assigned different attributes. It is, for example, possible to define a fire escape
plan and have multiple houses with the same meet-up place. These houses can be
grouped in a grouped and assigned properties that they all share.
Prototypic objects
CityGML allows the definition of prototypic objects. These objects can be trees,
traffic lights, cars, people etc. These objects can then be referenced into a point
according to a world coordinate reference system and a transformation matrix that
facilitates scaling, rotation, and transformation of the prototype. It is also possible
to make external references to objects.
13
CHAPTER 2. BACKGROUND
2.5 KML
2.5.1 Overview
KML was originally developed by Keyhole, Inc, which was acquired by Google Inc.
in 2004. This format is a simplification of the GML format with several additions
for storing geographical annotation and visualization. KML is based on the XML
format with tags and nested elements and attributes.
14
2.5. KML
Standard
The KML format is an open standard developed by the OGC. The KML format is
based on the GML format, but has only kept a small portion of it since the KML
format is supposed to be easier to use and grasp. KML is only about one tenth of
the size of GML[23].
Profiles
The KML specification defines a set of profiles that defines which elements and fea-
tures of the KML format that need to be supported for each profile. Developers can
then choose to target one or several of these profiles to ensure that their application
has the level of functionality the user expects.
The profiles specified in the OGC KML Engineering Report are; mobile devices
(mobile); Web browsers (browser); 3D spinning globes (3D); and GIS desktop ap-
plications (GIS)[24], see figure 2.4. Mobile devices are not expected to support the
same level of detail as 3D geobrowsers that run on desktop computers.
The profiles are built by combining smaller modules describing different areas
of functionality, see figure 2.5. These modules are:
• Mobile: the elements that must be supported on a mobile device (cell phone,
PDA, etc.).
• Styling: elements describing how placemarks and similar items must look.
• Extended data: specify untyped and typed data (with its defining schema).
• 3D: the elements used to specify 3D information, such as 3D models and the
placement of those.
Extended
Mobile Styling 3D
Data
Core
There are XML schema files for validating the separate profiles and modules
available[26][25].
15
CHAPTER 2. BACKGROUND
Extended
Weblog/CMS Core Mobile
Data
Extended
Web Map Core Mobile Styling
Data
Extended
3D Geo-browser Core Mobile Styling 3D
Data
Viewers
There are several applications available that can read the KML format since this
format has been widely accepted by the public and industry. There are viewers
available for most platforms, both as web-based and native clients. Since KML is
based on the XML format it is easily parsed with any XML parser available.
Compression
The KML files and the eventual related images can be compressed with the ZIP
format to form a KMZ file. This can provide up to 90% compression to minimize
the amount of data that needs to be transferred[17]. This KMZ file must contain
one main KML file and other possible files in subdirectories. The general suggestion
is to create a KMZ archive when either the size of the main KML file exceeds 10
KiB or if additional files, such as images, sound files, or 3D models, are referenced.
File references
From time to time the user might want to reference to other KML or KMZ files.
This can be done in KML by using the Link and NetworkLink tags specify where
the referenced file is to be fetched from. The NetworkLink tag contains a Link
tag which can refer to a file on a network, in a KMZ file, or the file directly. The
referenced files can be raster images, 3D COLLADA models, other KML files, etc.
16
2.5. KML
Overlays
KML supports defining overlays, such as a compass or other information, directly
in the format. This is done by using the ScreenOverlay tag which references an
image file which is to be used as an overlay.
Custom data
KML supports, so called, vendor tags which means that custom tags can be added
to KML files. There are three ways of adding custom data to KML[16]:
• Data element - allows you to add untyped name/value pairs to the user data
associated with a given Feature (NetworkLink, Placemark, GroundOverlay,
PhotoOverlay, ScreenOverlay, Document, or Folder). These name/value pairs
are displayed in the balloon by default. This information can also be used for
entity replacement in the text element of BalloonStyle. (See the section on
Using the BalloonStyle Element as a Template.)
• Schema and SchemaData elements - allow you to add typed data to the user
data associated with a given Feature.
• Arbitrary XML data - allows you to preserve user data within a KML file.
Google Earth passes this data along with the file and saves it, but does not
use it.
LookAt
Since KML is meant to visualize geographical data, one of its primary elements
is the LookAt element. With this element KML can help the client application
position the map view for the user. This is to help the user to quickly view an area
of interest on the map, related to the information in the KML file.
Regions
This KML feature enables the user to add very large datasets without risking de-
creased performance. Data in regions are only loaded when the objects are large
enough to be visible in the viewer. The second most important aspect of regions are
LOD (Level of Detail). You can specify how many pixels that are needed for objects
to be shown. Regions can also be nested to provide, for example, increasingly higher
resolution images the more you zoom. If you have a big image, you can split it into
several smaller images, this enables the viewer to only show the nearest parts with
higher resolution[15], see figure 2.6.
Expiration
Data that is loaded into the Google Earth viewer can be refreshed if the user adds
the refreshMode element, with the data onExpire in it, to a Link element. This
17
CHAPTER 2. BACKGROUND
Figure 2.6. This is a large image split into a set of smaller images which can be
rendered with different resolutions based on how far away they are.[15]
enables the content to be refreshed, either based on the HTTP server expiration
time or the time specified by the expire tag in the, by the href tag, referenced
Python script.
2.6 Positioning
Positioning is an important part in navigation and there are many different posi-
tioning systems today that can accurately determine your position depending on
your environment. This section summarizes how these systems work and when they
work.
18
2.6. POSITIONING
The GPS satellites that orbit the earth transmit one way signals that gives
the current location of the satellite and the current time. The monitoring stations
on earth control the satellites’ orbits and adjusts the satellites’ clocks. The GPS
receiver picks up the signals from the satellites and with the information in those
signals the device can locate itself with a longitude, latitude, and altitude[10].
To be able to make this positioning the GPS receiver needs to intercept the
signal of at least 4 satellites. With one satellite it is possible to determine how far
from that satellite you are. This means that you are somewhere on the sphere that
can be drawn around the satellite. With two satellites your position is somewhere on
the intersection of the spheres that two satellites produce. With three satellites the
intersection of the three spheres becomes two possible points. If a fourth satellite
is added, there is only one possible point in 3D-space.
Usually it is not a problem to intercept these signals when the receiver is posi-
tioned outdoors. However, indoors the signal is blocked by roofs and walls and does
not reach the receiver. Therefore it is not possible, or at least extremely hard, to
position a GPS receiver indoors[29].
19
CHAPTER 2. BACKGROUND
20
Chapter 3
Method
This chapter discusses the methods used throughout the project and how the work
was carried out. It covers the languages used in this project, the format itself, the
editor and lastly the viewer with an additional section on routing.
21
CHAPTER 3. METHOD
All implementations are in Java. Some of the main reasons for this choice are
that Java has a wide range of open libraries to use with XML, which allows us to
easily parse and write data. Java is also used on many mobile platforms which
means that the same code can be used on both stationary and mobile devices. Java
is platform independent which means that it is possible to use the same program
on Windows, Linux, UNIX, or any other operating system with support for a Java
virtual machine. For an example of how our format could be used, see figure 3.1.
Figure 3.1. An overview of how the different parts of the project could interact.
<eiml>
<Building id="B1">
...
22
3.3. THE FORMAT
</Building>
<Building id="B2">
...
</Building>
</eiml>
The Building element contains all the information about a specific building. All
buildings are required to have a unique ID so that it is possible to refer to them.
Under the building tag, EIML divides the building into floors. By doing this,
the user does not need to define the specific height of different objects and features.
Every Floor element has to have an ID just like the Building element. A Floor
element also needs to have a number assigned to it which refers to the order of the
floors (e.g., floor number 1 is below floor number 2). The Floor tag also supports
information about the altitude of a certain floor relative to the ground.
With this new information added to the previous example it can look like this:
<eiml>
<Building id="B1">
<Floor id="F1" number="1">
...
</Floor>
<Floor id="F2" number="2">
...
</Floor>
<Floor id="F3" number="3">
...
</Floor>
</Building>
<Building id="B2">
...
</Building>
</eiml>
Under the Floor element the format starts to get really interesting and at the
same time more complex. At the floor level of a building, everything that can be
on that floor is defined. This includes both structural features like walls, doors,
and windows as well as abstract features like rooms and areas. These features are
grouped in different containers. The most important container is the Structure con-
tainer. This container holds the definition of all walls, doors, and windows. These
features are separated from other features since they are present in all buildings and
cannot be moved.
Example of the Structure element:
<Structure id="S1">
23
CHAPTER 3. METHOD
EIML also has support for the defining of rooms. This container is called Area,
since a room is basically an area. A key aspect for the ability to define areas
is exhibition halls where several exhibitors share a large area, which is often not
divided by walls. An area can have a name, description, and a defined area size.
The shape of an area is defined in the container Enclosure. The reason for using
an enclosure is that it is possible to restrict an area within a set of walls. To refer
to a wall the tag WallRef is used. WallRef uses the attribute called ref to refer
to other, already defined, walls. However, it is not enough to only define a room
as being contained by walls since two rooms might not be separated by a wall but
by an open space. Therefore, it is possible to define lines inside an enclosure. The
last container inside an Area is the ObjectList. With the ObjectList it is possible to
place objects in the area with coordinates relative to that area.
This is an example of how an AreaList element can be structured:
<AreaList id="AL1">
<Area id="A1">
<name>My room</name>
<description>This is where I keep all stuff!</description>
<Enclosure id="E1">
<line>9.0,0.0 9.0,15.0</line>
<line>9.0,15.0 20.0,15.0</line>
<WallRef ref="W8" />
<line>20.0,0.0 9.0,0.0</line>
</Enclosure>
<ObjectList>
<ObjectRef ref="O1" id="DISK4" translate="1.0,1.0"
rotate="2.0" scale="0.01,0.01" />
</ObjectList>
</Area>
</AreaList>
If the Structure and AreaList elements were added to the Floor element it might
look like this:
24
3.3. THE FORMAT
<Floor id="F2"
<Structure id="S2">
<Wall id="W8">20.0,15.0 20.0,0.0</Wall>
<Wall id="W6">20.0,0.0 0.0,0.0</Wall>
<Wall id="W11">9.0,10.0 9.0,15.0</Wall>
<Door id="D2">9.0,8.5 9.0,10.0</Door>
</Structure>
<AreaList id="AL1">
<Area id="A1">
<name>My room</name>
<description>This is mine!description>
<Enclosure id="E1">
<line>9.0,0.0 9.0,15.0</line>
<line>9.0,15.0 20.0,15.0</line>
<WallRef ref="W8" />
<line>20.0,0.0 9.0,0.0</line>
</Enclosure>
<ObjectList>
<ObjectRef ref="O1" id="DISK4" translate="1.0,1.0"
rotate="2.0" scale="0.01,0.01" />
</ObjectList>
</Area>
</AreaList>
</Floor>
The last element in EIML is the ObjectLibrary. The ObjectLibrary is placed right
under the eiml tag. The concept of an ObjectLibrary is to hold all the information of
all the objects that can be placed inside a building. An object that is created in the
ObjectLibrary describes all the properties of that object. This makes it possible to
refer to that object with a simple reference from the basic structure of the building.
The advantage of referencing objects, instead of duplicating the information, is that
it puts a significant amount of information outside the basic building and makes
the format easier to grasp.
Coordinate System
EIML has a coordinate system with origo in one predefined point of the building.
All structural objects are defined in the same global coordinate system. The only
place were objects can be placed in a local coordinate system is when objects are
placed in an Area.
25
CHAPTER 3. METHOD
Units
For ease of use the format keeps all measurements in meters. However, it is possible
to use other measurements for objects in the ObjectLibrary and then scale them
when they are placed in the building. The global use of meters also opens for the
possibility to translate a feature’s location into a location based on longitude and
latitude.
Building Location
The position of a building is defined with the GPSData element. This element
specifies the location of the building’s origo using longitude and latitude. To get
the rotation and height information there are also the attributes angle and height.
This element is located directly under the Building tag.
<Building id="B1">
<GPSData longitude="59.403175" latitude="17.948484"
rotation="30.0" height="BoundGround"/>
...
</Building>
3D Model of Building
A user has the possibility to define a 3D model of the building that can be used
to, for example, display the house in a 3D geobrowser. This model has to be a
COLLADA file and it can be loaded from any URI. The Model element is defined
under the building element.
<Building id="B1">
...
<Model ref="http://www.myhouse.com/gremlings/model.dae"/>
...
</Building>
Raster Image
The Raster element is used to either complement the floor data or to be used in
case of missing floor data. If the user scans a blueprint of a very complicated floor
plan, this could be used instead of the user having to place all the walls, doors,
windows, etc. This element is optional and can be placed inside the Floor element.
26
3.3. THE FORMAT
Order
The order of the definition of the elements are important since the default for XML
Schema validated documents is used, in which the elements must be in a certain
order. This can both be helpful to the user, because of the consistency, but it can
also hamper the user since they are not allowed to place a Building element after
the ObjectLibrary element.
Drawable
EIML contains a specified drawable interface. All objects that can be drawn inherit
from this interface in some way. The first layer, under the drawable interface,
contains the basic draw elements like line, point, curve and polygon. Below these
there are more concrete features like, for example, a wall inherits from a curve.
3.3.3 Improvements
During the implementation of the first draft of EIML it was continuously improved.
There was never any need for a complete change of the design of the format. How-
ever, there were improvements made that were necessary to make EIML fully usable
for our use cases.
To get some input on our format we contacted Alessandro Pieropan who has
experience working with maps. In one of his projects, he created an XML-based
map format for virtual pedestrians. This format is called EDML, Environment
Distrimobs Markup Language, which is used to create city plan and architectural
representation for simulations.
Alessandro Pieropan gave some valuable input on our format, both to improve
the structure of it and to make implementation easier. He thought that we had
a good ground structure and that we should be able to use the structure for our
intended use. The most valuable input was his thoughts on the 2D structure of
our format. He meant that it would be very hard, if not impossible, to completely
convert the format to 3D. However, he also thought that our solution with holding
3D models on top of the map, might work out.
We also discussed the implementation part with Pieropan and he warned us
about the size of the format, that it might become too much data for a computer
or cell phone to hold the information.
27
CHAPTER 3. METHOD
Outlining a Floor
It is possible to define a BoundingBox to each floor. This element specifies what
part of a map actually contains building information and what part is outside the
28
3.3. THE FORMAT
building.
Improvements of Enclosures
The definition of enclosures was made more strict. The reason for this is to know
exactly how a user wants an area to look. The first version of EIML had very
loose definitions of areas and if a mistake was made in the Enclosure element it
was difficult to find the error. By making the enclosure definition more strict it
is harder to make mistakes because the user gets immediate feedback if an area is
questionable. In the final version of the format an enclosure has to consist of a set
of connected lines and the first point for the first line has to be in the same place
as the last point of the last line.
3.3.4 Validation
Implementation
Validation is an important part of the XML environment. Validation can be used
both to tell the user if he has created a valid document and it can guarantee pro-
grams that the input file is a correctly structured document. In our format there are
several different parts that have to be validated and the validation process might
not be trivial.
An XML Schema has been created that validates the structure of EIML. It checks
that all start tags have end tags and that it is a well-formed XML document[30].
The XML Schema is not only used for validating but it can also give the user a
good overview over the structure of the format.
During the implementation of EIML it was realized that the XML Schema would
not be enough to validate the format. For example, when creating an area in our
format there are a set of restrictions on that area. The area defined must be a valid
polygon, which means that it must be closed and not contain any trailing points.
This is not possible to do in XML Schema so it was critical to extend the validation
with a Java component. This Java component validates all of the information that
the XML Schema validated and also makes sure that the polygons are correct.
Result
The validation was very useful while developing the editor. It provides a fast way to
validate that the created files were structured correctly. The XML Schema is very
29
CHAPTER 3. METHOD
useful to find errors in created files. It finds most of the errors and in most cases the
Java validator is not needed. In the small number of cases where the Java validator
proved to be useful, it found small but significant errors that passed through the
XML Schema.
3.3.5 Parsing
Implementation
The conversion from an EIML file to a class structure was an important part of
the implementation. The goal was to create a flexible solution that allows us to
alter the structure of the format and still be able to correctly parse it after minimal
code changes. To achieve this a SAX-parser is used. The SAX-parser simplifies the
parsing by handling the processing of the file. A SAX-parser is event-driven, which
means that for every reached tag the parser extracts the information from that tag
and asks what to do with it. With the help of an interface called ParsableWritable,
which holds information about how classes can be parsed and written, this infor-
mation can then be sent to the class that represents that specific tag.
Result
The goal of keeping the parser flexible was definitively achieved. Making structural
changes to the format can be easily done and in very little time. The SAX-parser
worked perfectly with our data and allowed us to effectively parse data.
3.3.6 Writing
Implementation
An XML serializer is needed to write EIML data to file. The XML serializer in
Android was tested and the conclusion was that it was perfect for our purposes.
However, it could not be used in our implementation since it is not present in the
Java standard library. Since we needed a way to write XML data to file both on
the Android platform as well as on a standard computer running the indoor map
editor, we chose to implement it ourselves.
The XML serializer that we implemented is very similar to the one found in
Android. We added some improved functionality, simplified the API, and made the
tag formatting a little bit smarter compared to the XML serializer in Android.
Result
The result is an easy to use XML serializer that can generate XML files. It is used
in the editor for the exporting of indoor maps to file.
30
3.3. THE FORMAT
Figure 3.3. The editor showing some of the graphical structures. Yellow dots are
the guiding points for the Bézier lines. Green dots are the end points of the lines.
The editor shows walls as black lines, doors as red lines, and windows as blue lines.
SVG
The first graphical representation, that was created from EIML, was an SVG image
that was created from the information stored in the format. The SVG file was first
created by using XSLT and the final version uses Java.
31
CHAPTER 3. METHOD
XSLT
XSLT is an XML-based format with which you can describe how to transform one
XML format to another XML format. Since both the EIML format and the SVG
image format are XML-based, XSLT was used to transform the EIML format into
an SVG file. This worked very well until more complex information such as the
object library and draw references were introduced to the format. This made it
very hard to use XSLT to generate the SVG files.
Java
The Java class structure has a method for writing an SVG file. This feature was
added because of the problems with XSLT. This method is implemented in the same
way as the method that writes the XML data. The SVG writer is defined for each
element with a method that writes the corresponding SVG tag and then calls this
method in any existing elements lower in the class hierarchy.
Result
The SVG writer provides a good overview of what a map looks like. In the early
stages of the project this was the only implementation showing a finished map. The
SVG writer makes it possible to create simple sample maps that can be used for
debugging.
Because of the problems with XSLT combined with the fine integration of the
SVG generating Java code in the class structure, we decided that the Java was the
best to use.
3.4 Editor
The editor was an important part of the project because it makes it possible to
quickly create maps with the help of a graphical user interface. Before the editor
the only way to create a map was by editing the XML file with a text editor. The
editor has been created with the use case of the user creating the maps in mind.
See figure 3.4 for a view of the editor with a clean slate.
3.4.1 Usability
The editor is simple to use and first and foremost it allows the user to quickly create
maps so that the user can concentrate on creating accurate maps instead of rushing
it because of a bad workflow. To enable fast creation of indoor maps, keyboard
32
3.4. EDITOR
shortcuts are a key aspect of the editor. These shortcuts make it possible to change
tools instantly instead of having to move the mouse to a toolbar to select a tool
there. Keyboard shortcuts can enable instant switching of tools with some training,
while moving the mouse around to switch tools is never instantaneous. This is due
to the required mouse movement between the drawing panel and the toolbar.
3.4.2 Modes
The editor is designed with three different modes representing the key aspects of the
editor. The first mode is used to preview how the map looks in the mobile viewer,
the second mode is for editing the map, and the third mode is to create new areas
within the map. These modes are constructed so that they respond differently on
the user input. The user interface is also different for the separate modes.
View mode
The view mode gives the user a preview of what the map looks like in the mobile
viewer, see figure 3.5 for an example. This mode does not react to any user input
other than that of the user requesting to change mode as well as panning or zooming
of the map.
Edit mode
The key aspect of the editor is to draw new, modify, or delete lines to define the
structures of a building, see figure 3.6. Since this is the mode that is used most of
33
CHAPTER 3. METHOD
Figure 3.5. The editor in the view mode with an image underlay to guide the
drawing.
• Right-click on Line
If the line is part of an Area, it is possible for the user to view and change the
ID, name, and description of the Area. It is also possible to delete that area.
The user is able to set the scale of the line, i.e., how long the line is in meters
in the real world. This enables the user to make sure that the coordinates
throughout the map correspond to the real world coordinates.
The user is able to delete the Line.
• Right-click on Point
The user is able to delete the Point.
34
3.4. EDITOR
Figure 3.6. The editor in the edit mode with an image underlay to guide the
drawing. Showing the popup menu for one of the walls surrounding an area.
35
CHAPTER 3. METHOD
is made so that the user easily can see that the lines have been selected and then
get a visual confirmation that the area is successfully created.
When an area has been created the user has the choice to either select lines to
create a new area or to go back to the edit mode.
3.4.5 Underlay
The editor has the possibility to show a partially transparent image under the
drawing panel, see figure 3.7. This enables the user to import an image of a floor
plan and draw the walls and other structures with the guidance of that image. The
image can be scaled so that it has the same scale as the drawn lines.
The user might want to be able to change the opacity of the underlying image.
This is possible to do with fast keyboard shortcuts as well as through the menu.
3.4.6 Scale
Since the coordinate format of EIML is in meters, it is important that the user can
make sure that the length of lines in the editor corresponds to the lines (e.g., walls)
in reality. The user is able, in the editor, to set the real world length of a line. This
scales the rest of the information in the EIML file accordingly.
36
3.4. EDITOR
Figure 3.7. The editor in the edit mode with an image underlay to guide the
drawing.
To enable fine tuning of lines and drawing of small or very large structures it is
important for the user to be able to both zoom and pan the map. By scrolling the
mouse wheel, the editor zooms in or out at the location of the mouse pointer. By
clicking the middle mouse button and dragging the map, the user can pan the map.
The existing Java classes are used to parse and import EIML files into the editor. By
using the Java classes it is possible to change the data directly by holding references
to the parsed data. It is then possible to easily export the modified map to an EIML
file by calling the method on the root object of the class hierarchy that exports the
XML information.
37
CHAPTER 3. METHOD
3.4.10 Menu
The menu bar is generated with all the buildings from the parsed file and under
each building menu are the selectable floors. Almost all of the actions described
in this section are also available in the menu. See figure 3.8 for an example of the
available options.
Figure 3.8. The editor in the edit mode showing some menu options.
3.4.11 Validation
Since the editor uses the Java class structure for the parsing of the EIML file that
the user would like to import, the parsing makes sure that the imported file is
validated and well-formed. The user does not need to worry about the correctness
of the edited or exported file.
38
3.5. VIEWER
3.5 Viewer
To view the maps a map viewer application for a mobile device was created. The
goal of the viewer is to give the user the ability to navigate in a building using a
mobile device. The following list describes the features of the viewer. This list is
inspired by the predefined use cases.
Besides these points the viewer supports outdoor maps and makes it possible to
select a building on an outdoor map. When a building is selected on the outdoor
map the user receives information about the building and is also presented with the
choice to enter that building and see the indoor map.
39
CHAPTER 3. METHOD
The Android system allows users to follow certain guidelines to create applications
that are compatible with all phones which was helpful for the implementation.
The implementation and testing was done in an emulator, on the HTC Magic[12],
and on the Google Nexus One[18]. The emulator made it possible to test the
implementation with different resolutions. The HTC Magic and the Google Nexus
One also have different hardware which made them good candidates for our testing.
The main differences between the two phones are different screen size and resolution,
processor speed, and camera image quality.
Besides the difference in hardware between the phones there are a few co-existing
versions of the Android operating system deployed currently. Our implementation
is targeted at version 1.6. This was influenced by the Xperia™ X10 since it runs
Android 1.6. However, we also decided to test it on all the major versions of Android,
which are 1.5 through 2.2. See figure 3.9 for an example of the Android versions
and resolutions that were tested.
Figure 3.9. Four different instances of the emulator running different Android
versions with different screen sizes. From left to right: 1.5 with 320x480, 1.5 with
320x240, 2.1 with 400x800, 1.6 with 320x480.
3.5.2 Parsing
Because the reading and parsing are implemented in Java they were easily converted
and used in the viewer. The only problem was that the SAX parser, which is used
in the parsing algorithm on the server side, is not supported in the Android Java
Library. However, there is an almost identical parser available which is used and
allows the use of the same general parsing code by only making minor changes to
the structure of the parser.
40
3.5. VIEWER
It is possible to view the maps in the editor as they would look on the mobile
device. Therefore, the editor code has to be flexible so that it can be used for
drawing the maps both in the editor and the viewer. To make this possible the
viewer implements parts of the editor.
To make the application easier to use for the user, it is possible to view the
map in both landscape and portrait mode, see figure 3.10. Android phones have a
rotation sensor that indicates how it is rotated. This sensor is used to automatically
change the view of the map to help the users as much as possible.
Figure 3.10. Viewer shown in landscape and portrait mode under Android 1.5 with
resolution 480x320 and 320x480 respectively.
To navigate the map the user can simply hold and drag it. All Android phones
come with touch screens which makes this the easiest way to navigate. The user
can also zoom in and out with help of two buttons in the top corners of the screen.
Another important aspect of the navigation is the presentation of different op-
tions. The only visual elements that the user can see when the viewer has started
is the map itself and the zoom buttons. The reason for this was to give the map
as much space as possible on a small mobile screen. All other options are hidden
until the menu button is pressed. All Android devices have a menu button which is
always accessible in some way. When the menu button is pressed different options
are presented to the user.
41
CHAPTER 3. METHOD
3.5.4 Searching
To make it easier for the users to find conference rooms, people etc., there are
multiple search functionalities included in the viewer. The most common way is
to use a text search to search for someone’s name, room number, or conference
room name. Another way to search is by scanning barcodes which provides location
information.
Text Search
The viewer contains a plain text search option. This option is selectable from the
menu and gives a single text field for the user to type the search query. To make
the searching easier for the user the text field is equipped with an auto complete
function. While a user types in the search field different possible results, containing
the typed text, appears. These results are selectable and can be accessed as soon
as they appear. When a result is selected the map puts an arrow on the result’s
target and moves the map so that the arrow becomes visible. If the result is on a
different floor, the floor is changed.
Barcode Scanning
The barcode scanner is implemented in the viewer to help the user retrieve the
correct maps as well as for positioning purposes. The barcode scanning functionality
comes from an external library, from the ZXing Team[6]. This scanner can read
a variety of barcodes and return the information from those codes to the viewer.
To use the barcode scanner the user selects the Scan option from the main menu.
When the Scan option is selected the mobile phone’s camera is activated and the
scanning interface combined with the input from the camera are displayed on the
screen. The user scans a barcode by holding the camera in front of it. When a
barcode is scanned the result is parsed by the viewer and the appropriate action is
taken.
One major advantage of the barcodes is that they are already in use today. The
uses today are not only on grocery store products but also to identify electrical
cabinets or rooms. In the Ericsson building, where this project was done, every
room had a barcode by the door outside the room. With the barcode scanner in
the viewer it was possible to read these codes and then use them to help a user
position himself in the building. See figure 3.11 for two examples of barcodes that
the viewer can read.
Manual Searching
It is possible for a user to search for a conference room or similar by navigating
the map. The user can press the menu button to select what floor he wants to see.
When a certain floor is selected it is easily navigated and the user can press on
different areas to get more information about them.
42
3.6. ROUTING
Figure 3.11. Two different barcodes that the viewer can read.
It was possible to interact with areas that were defined in the map structure. These
areas were marked with a light green color just like in the editor. In the viewer,
every area is clickable. When a user presses down on an area, the information for
that area is displayed. The information is taken from the EIML file.
3.6 Routing
The routing ability is one of the most utilized features in the mobile Android version
of Google Maps. Android users have navigated more than 1 billion miles during the
last 6 month with this feature[19]. The routing feature can also be useful indoors
since one of the most common uses for a map is to find your way to a destination.
There are a few different possible implementation solutions to enable routing in
our format. One possible solution is to let the creator of a map place waypoints
in the map and then connect these waypoints. This makes it easy for the software
developer to create the routes at the same time as it would take longer time for the
creator of the map to actually create the map. Another way is to let an algorithm
scan the map and automatically determine what possible routes there are. This
solution means more job for the software developer at the same time as it takes less
time to create the map.
Our goal was to make it easy to create maps, therefore we implemented an
algorithm that automatically creates the possible routes.
43
CHAPTER 3. METHOD
The algorithm used to find which doors are connected is a Depth First Search
(DFS). The reason for this choice is that an exhaustive search of the whole area
is needed to identify which doors were connected to it. A Breadth First Search
could have been used to get the same result, however, the DFS algorithm provides
a better memory efficiency.
First the structure of the building is drawn to an image to set up the boundaries
44
3.6. ROUTING
for the search. Then a search is performed from every door and area to see which
other doors and areas can be encountered. The search starts at one door and
continues until a black wall, green area, blue window, or a red door is encountered.
If the search encountered a wall or a window it is terminated. If the encountered
object is an area or door it is connected to the original door or area. All the
connections are saved in a graph representing the connected areas. This graph can
then be traversed to calculate routing options.
45
Chapter 4
Results
This chapter presents, in detail, the results we achieved in the different parts of the
project. The main outcomes of this work are:
• EIML format
An XML-based format for storing indoor map information. EIML is object
oriented and focused on ease of use.
• Editor
An application for graphical creation and modification of EIML files. The
editor supports all aspects of the EIML format and provides a visual assistance
while working with maps.
• Viewer
A mobile based application for viewing an indoor map. The viewer supports
interaction with the maps as well as navigation and positioning systems.
47
CHAPTER 4. RESULTS
4.1.4 Layers
A vital part of GML and the key aspect of KML is that information is structured
in layers. KML offers a wide variety of possibilities to define overlays to already
existing maps. EIML took advantage of this concept by separating the structural
information from the general information and interior design of a building. The
basic building blocks of a building (i.e., walls, doors, and windows) are defined in
a separate container. However, the information from this container could still be
used for various tasks like restricting areas.
48
4.3. TESTING
Maps[14] uses, is to render images from the data and only send these images to
the user. It is also possible to keep the data open like, for example, Open Street
Map[27]. The advantage of this is that anyone can contribute and improve the data.
In our implementation we decided to keep the data open. This would allow more
freedom to the user and it would make it possible to an independent user to publish
his own map. It would also be possible to create a community, like Open Street
Map, where the users could create and update maps. The more products that have
integrated our maps the more likely it is to get more users and developers.
4.3 Testing
Testing was carried out continuously during the implementation. To simulate a case
as close to our use cases as possible it was decided to map the floor of the building
that we were working in. The building is an Ericsson owned building and is located
on Färögatan 6, Kista, Sweden. The building has 8 floors and about 200 rooms per
floor.
The main goal of the testing was to ensure the usability of EIML and to find
possible ways to improve on the format. At the same time the testing also helped
with improving the implementations.
4.4 Performance
4.4.1 Viewer
The viewer performed well on the 528 MHz processor of the HTC Magic as well as
the 1 GHz Snapdragon processor of the Nexus One and Xperia™ X10. The only
part that slowed down the user experience was the loading of the map which has to
be done when the program starts. This was mainly because of the large input file
that had to be parsed. The barcode scanning in the viewer worked well and was
able to correctly scan all of the barcodes that we tested.
49
CHAPTER 4. RESULTS
4.4.2 Editor
The mapping of one floor in the Ericsson building, including all windows, doors, and
walls, took around 3 hours which is fast considering that the floor had over 1800
structural items. There were no computational performance issues with running
the editor on a modern computer.
4.4.3 Format
The only performance issue with EIML is that a large building can take some time
for a standard computer as well as a mobile device to process all the information.
This is an issue with all XML-based formats that contain much data but has not
been an issue during this project. To prevent this from being a problem in the
future it is possible to prioritize important data during the parsing.
Transferring a large EIML file is not an issue since it is possible to compress it
to about 10% of the original size with a common compression algorithm.
4.4.4 Usability
The goal of EIML and the implementations was not to create software for an end user
but to create a proof of concept to be able to show the use that indoor maps might
have. Therefore, no usability testing was performed besides our own evaluations.
Viewer
The viewer was easy to use and its interface was easily understood. By hiding all
buttons except those for zooming, the exploration of the map was simplified.
Editor
The editor has, like all software, a small learning curve that a user has to get over
before he can use the editor effectively. An important part of the editor is the
keyboard shortcuts that allows the user to quickly change between different modes,
tools, buildings, and floors. When a user has learned these shortcuts he can quickly
create large maps.
Format
We believe that we were able to create a format for storing indoor maps that is
easy to both read and use. Even with a large building like the Ericsson building, it
was possible to open the file with a text editor and both find and edit information
about rooms and similar items.
50
4.5. POSITIONING
4.5 Positioning
Indoor positioning is an area of research that has been getting more and more
attention during the last years. We believe that an indoor positioning system will
eventually be something that anyone uses and that with such a system in place,
indoor maps will become an even more important part of our lives. However, even
without such a system, good indoor maps can play a crucial role in navigating inside
buildings. Indoor positioning still has a long way to go before it can be used along
with indoor maps.
4.5.1 Conclusion
The mobile network, GPS, and wireless network positioning were the three types
of positioning systems that can be used in modern cell phones. Currently these
systems were not nearly accurate enough for use with indoor maps.
Some testing was performed with two modern cell phones (HTC Magic and the
Nexus One) with GPS, mobile network, and wireless network positioning activated.
The results were that the cell phone was able to locate us within a circular area
with a radius of about 50 meters. From this data it might be possible to locate the
building that a cell phone is in, but not much more. For effective positioning indoor
the radius should not be more than a couple of meters.
Another big problem is the altitude. The mobile network and wireless network
localization are not able to determine the altitude of a cell phone. Altitude is an
important part of localization indoors because it can be very hard for the user to
determine what floor he is on[28].
We believe that in the future this problem will be solved with either a new
positioning technique or with external tools to improve the accuracy of current
technologies. An example of this would be if it was simple enough to install GPS
repeaters in a building[20].
A GPS system cannot be used indoor because the signal does not penetrate solid
objects like roofs and other objects in the way.
4.6 Routing
The initial idea was to perform the routing on the mobile device. Because of this
the routing algorithms were from the beginning heavily optimized with the help of
profilers. In the case of a small indoor map with around 50 doors it took less than
one second to calculate all of the routing possibilities. However, for larger maps like
the Ericsson building on Färögatan 6, Kista, Sweden, the routing took too much
time to be performed on a mobile device. The routing code is written in Java and
could easily be moved to a server so that the calculations could be done there.
51
CHAPTER 4. RESULTS
Figure 4.1. An example of how the Java class structure is similar to the XML file.
This structure allowed us to treat every tag independently and we could write
and execute tag specific code. This makes EIML very flexible. We could easily
change or extend the format with new tags by only changing the affected places.
To further utilize this structure we said that every class, which represented a
tag, must extend an interface. This interface requires that the class has methods
which handles both parsing and writing. This interface is called ParsableWritable.
Later on, ParsableWritable was extended to contain methods that can validate a
tag as well as methods that can write the appropriate SVG code for that tag.
52
4.7. IMPLEMENTATION RESULTS
it is possible to only draw the vital parts. The drawing algorithm also allowed us
to easily add specific features and alter the map to our liking.
53
Chapter 5
Conclusion
In this report we have described a possible solution for an indoor maps implemen-
tation. We have created EIML, an XML-based format, which can store indoor map
information. Then we have built software that creates, modifies, and navigates
indoor maps in this format.
The format that was created and improved throughout this report meets the
goals of being flexible and easy to use. Because the format is XML-based, it is easy
to understand and to get an overview of the file. For someone who has experience
with XML it is also possible to get a good grasp of how EIML works by looking at
the XML Schema.
The final version of EIML stores all the information that is needed to create
an indoor map which can model a general office building. It has also enough infor-
mation to store information about conference rooms and such as well as perform
routing.
The implementation part was very helpful for improving the format and it is
also a good way to show that it is possible to work with EIML. Working with the
format gave good insight to which problems EIML had and made it possible to
adjust the flaws we found in the process of implementing.
The editor is very easy to work with and it proved to be a valuable tool for
creating the indoor maps. It is very resource efficient and provides a streamlined
workflow enabling the user to quickly create accurate maps.
The viewer is a good way to show how the maps can be used. It provides us with
a real life example of how indoor maps can be used in a useful way. The viewer also
proposes an interesting solution to the lack of a positioning system. With the help
of barcodes it is both possible to identify the current building and also identify the
location of the barcode. The barcode scanner works better than we initially could
have expected and we were able to successfully scan the barcodes already present
in the building we worked in.
Many different graphical representation possibilities were explored throughout
the project. Early on, the focus was at creating scalable images in the SVG format.
These images were useful to get a view of what a map might look like, but it was
55
CHAPTER 5. CONCLUSION
hard to use these images in the viewer or the editor. The solution to this was to
create a drawing function in the editor to show what the map looks like and then
use the same drawing code in the viewer. This makes it easier to display and modify
the map in both the editor and the viewer.
56
Chapter 6
Future Work
During the creation of EIML we always strived towards creating a flexible format. It
was our goal to have a format that could easily be expanded with new features. This
means that many of the features in this section are not problematic to implement
but were excluded due to lack of time.
6.2 Positioning
We believe that an indoor positioning system solution will be available in the near
future. If such a system would become popular and widely adopted it would be
easily implemented in our format. EIML can store information about where the
building is located in the terms of longitude, latitude and altitude. Even though
only one such point is defined, the longitude, latitude, and altitude can be calculated
for any other point in the building because all other measurements are defined.
57
CHAPTER 6. FUTURE WORK
this level. It would be good to have a general container that could be customized for
specific uses without having to change the code or definition of the format. Example
of such a container would be a fire route. It would be possible to let this container
contain drawables and information about these drawables in a flexible way so that
a viewer could show them, with or without modifications to the viewer.
58
Bibliography
[1] AECBytes. The IFC Building Model: A Look Under the Hood, 2004. http://
www.aecbytes.com/feature/2004/IFCmodel.html Accessed on 2010-03-08.
[8] Bill Evjen, Kent Sharkey, Thiru Thangarathinam, Michael Kay, Alessandro
Vernet, and Sam Ferguson. Professional XML. Wrox Press Ltd., Birmingham,
UK, UK, 2007.
[9] Michael Fitzgerald. Learning XSLT. O’Reilly & Associates, Inc., Sebastopol,
CA, USA, 2003.
59
BIBLIOGRAPHY
[19] Tom Krazit. Google I/O keynote day 2: Android day (live blog), 2010. http:
//news.cnet.com/8301-30684_3-20005447-265.html Accessed on 2010-07-
14.
[24] Open Geospatial Consortium, Inc. KML Engineering Report, 2010. http:
//www.opengeospatial.org/standards/kml Accessed on 2010-02-17.
[25] Open Geospatial Consortium, Inc. KML Module Schemas, 2010. http://www.
ogcnetwork.net/schemas/kml/ows5/xsl/ Accessed on 2010-03-15.
[26] Open Geospatial Consortium, Inc. KML Profile Schemas, 2010. http://www.
ogcnetwork.net/schemas/kml/ows5/profile/ Accessed on 2010-03-15.
60
BIBLIOGRAPHY
[28] Arto Puikkonen, Ari-Heikki Sarjanoja, Merja Haveri, Jussi Huhtala, and Jonna
Häkkilä. Towards designing better maps for indoor navigation: experiences
from a case study. In MUM ’09: Proceedings of the 8th International Conference
on Mobile and Ubiquitous Multimedia, New York, NY, USA, 2009. ACM.
61
TRITA-CSC-E 2010:119
ISRN-KTH/CSC/E--10/119--SE
ISSN-1653-5715
www.kth.se