Are You suprised ? - EC GI & GIS Portal

mexicanmorningData Management

Dec 16, 2012 (4 years and 10 months ago)

182 views

SVG Format Usage For GIS WWW Interface


Lucie FRIEDMANNOVÁ, Karel STANĚK

Masaryk University Brno, Faculty of Science, Department of Geography,

Laboratory on Geoinformatics and Cartography

lucie@porthos.geogr
.muni.cz
,
karst@porthos.geogr.muni.cz

http://www.geogr.muni.cz


Browsing GIS data over WWW clients is, despite offers of free GIS viewers such as
Arcexplorer, still
one of perspective ways to build up distributed GIS with “unlimited”
number of users. In this presentation we would like to show some relatively new possibilities
how to make a WWW GIS viewer. This approach is based on two key technologies


PHP
and SVG. O
n beginning several words about these technologies.


PHP is an open
-
source scripting language, with the interpreting engine on the server side.
Similar to Microsoft’s ASP it is continuing CGI technology with better integration to the web
server. The main a
dvantage of these solutions is the rich possibility to communicate with
database servers (PHP can directly communicate with many RDBMS, for example MySQL,
ORACLE, PostgreSQL. It can also communicate with any RDBMS through the ODBC
protocol). Also is possib
le to divide application code between the client (Java or JavaScript
usage) and the server (PHP code). It is possible to fully integrate PHP code with HTML and
XHTML code. Unlike ASP, PHP is a free solution. Maximum performance of PHP is
achieved with the
web server Apache, but there exists the possibility to include a PHP
interpreter in any web server). In our solution we use a combination of Apache + MySQL in
the Linux operating system environment, due performance and, of course, due zero license
fees. PH
P works like HTML (or XHTML) pre
-
processor, this mean that it is possible to
include PHP code inside HTML code. The WWW server on accessing such a page interprets
the PHP code first and a modified HTML page with interpretation results is served to the user
.
PHP is also capable of managing security affairs, i.e. script could be owned and its
interpretation could be limited in special cases. One advantage of PHP is the wide community
of non
-
profit developers, which implies the possibility to download a lot of

scripts from the
WWW.


SVG is a language describing two
-
dimensional interactive graphics for WWW usage.
Specification of this language is made by W3 consortium and under this specification are
subscribed the main computer graphic vendors. The ancest
or of this language was PGML,
which was created mainly by Adobe, based on Postscript. This origin is also somewhat visible
in SVG, but it is a completely new language, which reflecs all contemporary needs for web
graphics. In comparison with WebCGM, second

W3C standard for vector web graphic, it is
completely written under XML and implements other contemporary W3C standards such as
DOM, CSS2, XSLT and XHTML. SVG elements are vector graphics (basic shapes, paths
consist of bezier curves and polylines), raste
r images and text. SVG offers the possibility to
include event driven scripts, to extend the data model under XML convention, to support
animation, to support metadata etc. Of course, hyperlinking is supported by each graphic
element within SVG. It must be

noted that SVG is a document language similar to PDF or
Postscript; this means that coordinates are stored in page units and in the case of cartographic
coordinates a conversion is needed. The first draft of the SVG specification was published in
1998 and

a final version still does not exist. Despite this situation, there is increased support
for the SVG format. Adobe published plug
-
ins for Netscape and MS Explorer in April,
Mozilla starts to support SVG, Java solutions exist from CSIRO and IBM.


Our proje
ct is partially connected to activities INCO
-
COPPERNICUS ABDS for CEEC, for
example, as a possible cartographic part of ABDS clearinghouse web interface, but we plan to
extend the general GIS viewer. This project follows up the older pilot project that we
realized
for Breclav county government four years ago. In this older solution we use only HTML and
EMATEK CGM with hyperlinks (nowadays EMATEK uses WebCGM, but at the time of the
project, we had a proprietary extension of CGM). At the beginning of the new
project we
chose as a repository of geodata RDBMS MySQL; all such tools in the project (except source
GIS software) are open
-
source software. We keep the feature table definition as proposed in
the OpenGIS simple features for SQL recommendations


i.e. ide
ntifier column, four columns
of MBR coordinates, column with feature geometry (in our case it is a variable text list of
vertex coordinates delimited by commas), followed by attribute columns. For database filling
we use an Avenue script, which converts da
ta stored in shapefiles into MySQL table.



Figure 1:

System scheme


We then create an AVENUE script to convert an ArcView view window to the SVG format.
In the older project we use static visualization i.e. we compile a complete map and the user
can choo
se a map feature and display it in a WWW browser. Now we offer to the user the
possibility to create a limited number of cartograms from geodata stored in the database. At
this time we store in the database 18 mono
-

and polychromatic scales for 4,8 and 12
classes.
These classes are the result of classification of quantitative attributes of the features. Hitherto
we implement into PHP the following methods


natural breaks, quartiles, equal interval and
equal area. The PHP application then generates simple m
ap layouts that consist of map field,
title, legend and scale (the scale of initial visualisation without zooming, with of this
visualisation is 150 mm, height is proportional to MBR of features). Each feature (according
to ABDS project we now manage only
polygons) is hyperlinked to a database query, which
produces a list of element attributes. Legend features are hyperlinked with a script, which
highlights class members in SVG and also shows class statistics in a separate window.



Figure 2:

Initial For
m for map making


Figure 3:
Legend script function


Ongoing activities are focused on JavaScript usage within generated SVG, which could offer
more dynamic maps and also move part of the work to the client, but we are still limited by
plug
-
in possibiliti
es (at the start of project we tried to avoid Java usage, due to instabilities on
the client side). The end of the first stage of project is planned for the end of August
according to the ABDS schedule, after this date we will open our system to public usa
ge at
address www.geogr.muni.cz/phpmap/


In our presentation we would like to call attention to the relatively inexpensive way (not only
in money, but also in computation power of the client station), of building a GIS interface
over WWW. The following l
inks are useful for the above
-
mentioned technology usage.


www.zend.org

and
www.php.net

are PHP homepages

www.w3c.org/Graphics/SVG

is homepa
ge of SVG

www.mysql.org

is homepage of the RDBMS MySQL

www.adobe.com/svg/main.html

is homepage of the Adobe SVG software

sis.cmis.csiro.au/svg/ is homepage of SVG viewer

of CSIRO

www.mozilla.org

is homepage of the Mozilla project

www.apache.org

is homepage of the Apache web server