Professional Documents
Culture Documents
Spa Gobi and Gis
Spa Gobi and Gis
Community Edition
Stephen Ogutu
DEDICATION
Trademarks:
All other trademarks are the property of their respective owners. The
author is not associated with any product or vendor mentioned in this
book.
Limit of Liability/Disclaimer of Warranty:
While the publisher and author have used their best efforts in preparing
this book, they make no representations or warranties with respect to the
accuracy or completeness of the contents of this book and specifically
disclaim any implied warranties or merchantability or fitness for a
particular purpose. No warranty may be createdor extended by sales
representatives or written sales materials. The advice and strategies
contained herein may not be suitable for your situation. You should
consult with a professional where appropriate. Neither the publisher nor
author shall be liable for any loss of profit or any other commercial
damages, including but not limited to special, incidental, consequential,
or other damages.
CONTENTS
INTRODUCTION ............................................................................................1
QGIS ...............................................................................................................5
GEOSERVER ................................................................................................11
SPAGOBI ......................................................................................................18
THE ATTRIBUTE TABLE.............................................................................26
TEMPLATE .................................................................................................41
CROSS NAVIGATION...................................................................................47
The Author.
Stephen Ogutu is a technologist and educator
from Kenya. He has worked with various
companies including Essar Telecom, IST,
ICDC, Airtel then Zain , Neptune software
PLC and others in different capacities.He
currently lives in Nairobi Kenya and consults
on
Core
banking
systems,
Business
Introduction
Hundred Eyes
Scenario one
The SpagoBI training website www.learn-spabobi.com has
several students from different countries all over the world.
The owner wants to map the students in a map of the world so
that he can easily see which countries has the most users to his
website. This will allow him to customize the courses to better
suit his audience. How can we use SpagoBI to achieve this?
Solution
Diagram 1
QGIS
https://www.qgis.org/en/site/forusers/download.html
2. Install the QGIS software in your machine. It will
come with several other software that we will not be
using e.g GRASS GIS 6.4.3, MSYS and QGIS
Browser 2.8.2 and SAGA GIS (2.1.2). We are only
interested in QGIS Desktop 2.8.2.
3. From your desktop or start menu, click on QGIS
Desktop 2.8.2. icon. It has the icon similar to the one
below.
10
10.
GeoServer
11
12
13
14
15
16
If you have done all the steps correctly, you can see that the
map will be rendered. If you click on any area of the map, it
will show you details about it. If you check the image below,
you can see that we selected China. You can also zoom in and
out of the map. We will stop there for now, load some data
into SpagoBI and see how to analyze it.
17
18
SpagoBI
We have now learnt how to modify our map data using QGIS
and how to publish this map in the Geoserver ready for use by
any map consuming application like SpagoBI.
Like we had stated before, we will use the following scenario
to help us make a sample map.
The scenario:
The SpagoBI training website www.learn-spabobi.com has
several students from different countries all over the world.
The owner wants to map the students in a map of the world so
that he can easily see which countries has the most users to his
website. This will allow him to customize the courses to better
suit his audience. How can we use SpagoBI to achieve this?
From the scenario above, you can see that we need several
things.
1. We need a world map. We have already loaded one in
Geoserver and is ready to be used by SpagoBI.
2. We need the student data that contains which country
they come from so that we can link it to the map data.
To achive number two above, that is load the student data, we
will need to login to SpagoBI and create a dataset called
SpagoBI Students with the contents of the file Learnspagobi.com Users.csv which came with this book if you
purchased it.
Proceed as follows:
19
20
21
22
From the map above, you can see that the countries
23
24
This will make your map bigger. You can then click
and drag any area of your map. So let us see if we have
any students in South America.
25
26
5
4
You can see that the data is similar which means that both the
data in QGIS and the one in SpagoBI came from the attribute
27
28
29
30
31
32
6. Change it to POP2015.
33
34
8. Confirm deletion.
35
36
37
38
19. Save and execute the document. You will notice that
SUBREGION field have been deleted and POP2005 is
now changed to POP2015.
39
40
Template
The first line is just an opening bracket for the json file. The
second line mapName: "Students", is the name of the map
panel. You can give any string here. We have called ours
Students. Remember this is not a map that exists in SpagoBI,
it is just a name of a panel.
41
42
43
44
The next lines 8 and 9 shows how you link the data in your
dataset and the data in the attribute table. In your dataset, you
have a column called FIPS and this is what line 8 shows
under businessId. We need to link this to another column in
the attribute table called FIPS and this is what line 9 shows
under geoId. Remember the field names need not be the
same.
You can see below how we have linked the FIPS field in the
attribute table with the FIPS field in the dataset. You can see
that they have similar data that is 2 character country code.
45
46
Cross Navigation
A boat capsizes when it is just about to reach the shore. A Luo proverb.
47
48
The data we will use for the child report can be downloaded
from
http://data.okfn.org/data/core/countrycodes/r/country-codes.csv
Alternatively, you can use the CountryInfo.csv file under the
data folder in the CD that came with this book. Follow these
steps to create a child report.
1. Start the SpagoBI Studio and create a new project of
type SpagoBI.
49
50
51
52
10. Select flat file Data Source and for the Data Source
53
54
11. Navigate to the Data folder that came with this book.
15. Select all fields and move them to the right then click
on Finish.
55
56
57
58
OK.
Now edit your dataset and create a filter.
59
60
you desire.
24. After creating the formatting you need, save the file.
61
62
63
64
4. For the title, enter FIPS. The URL should have same
65
66
Resources
1. http://www.data.okfn.org/data/core/countrycodes/r/country-codes.csv
2. http://www.learn-spagobi.com
67
68
INDEX
LearnSpagobiNavigation_1.json, 69
Arcmap, 2
ArcServer, 2
Bing Maps, 1
LearnSpagobiNoNavigationWorld2.js
on, 38
CountryInfo.csv, 48
Plugins, 31
EPSG:4326, 15
QGIS, 2
Geoserver, 12
shapefiles, 14
GIS, 1
So what is QGIS?, 5
Google Earth, 2
SpagoBI, 17
http://localhost:8090/geoserver,
Spatial data, 2
29
store, 14
Kenya, 28
Table Manager, 32
Layer, 37
TM_WORLD_BORDERS0.3.shp, 26
Attribute data, 2
Learn-spagobi.com
Users.csv,
18
www.learn-spagobi.com
69