About Carte_zone_monde_rdf
:
“An authoring interface to produce location information”
By Cédric Kiss, Florent Mailland, supported
by Charles McCathieNevile.
Project SWAD-Europe at W3C, $Id: readme_carte_zones_monde_rdf.html,v 1.17 2004/09/22 14:12:34 charles Exp $.
Below is a
static screenshot taken from the script. You can see IATA and ICAO airports
(red and yellow dots, resp.) and some low-resulotion zones (orange
polygons).
See more screenshots, taken along the
development process.
Introduction
Carte_zone_monde_rdf is an SVG client-side
script intended to help working with geographic information. It
can
- reveal if a particular world zone contains a certain
sort of actors (SWAD-E people, for instance).
- provide an RDF description of a point selected, including its
latitude/longitude, which region(s) it falls in, and where the nearest
airport is and how far away it is.
The zone can be drawn by a geometric polygon on a map, using
latitude/longitude co-ordinates.
The uses RDF for the description of these zones, airports, and actors. Some
functionalities were added now, you can also get RDF
information about the geographic zone you selected as the location
latitude/longitude co-ordinates, nearest airport and distance between the
selected point and the airport.
Feedback is always welcome and appreciated, and should be sent to either
the RDF Interest Group or the Geowanking list
(more specifically dedicated to geospatial information).
How to use it?
- You can consult the "Aide sur le fonctionnement de l'application" for
information about how to use the application.
- When all the files are loaded, click on a position (an
airport, a person's location, or any point on the world map);
- Then click on [Display Results] or so, and you get the
names and zones of people, along with an RDF output of the
results.
- If you want, you can just click on the map to get RDF information about
the selected point, if the airports information files are loaded, the
result will contain information about the nearest airport and its
distance from the selected point.
This RDF output can look like that:
0100 <rdf:RDF>
0101 <!-- Situation des personnes par rapport a ta position actuelle -->
0102 <Person>
0103 <name>Alice Walter</name>
0104 <sameZoneType xml:lang="fr">pays</sameZoneType>
0105 <sameZoneName xml:lang="fr">France</sameZoneName>
0106 </Person>
0107 <Person>
0108 <name>Bob Smith</name>
0109 <sameZoneType xml:lang="fr">continent</sameZoneType>
0110 <sameZoneName xml:lang="fr">Europe</sameZoneName>
0111 </Person>
0112 </rdf:RDF>
Files used
- carte_zones_monde_rdf.svg,
the script to run (work at least with ASV3/Win);
- proxy.php, a very simple PHP
proxy, used to circumvent the security violation error when
attempting to getURL() a file outside your web server;
- Many other important files are used (like airports data, zones
information, images, JS sha1 encrypter...). Visit the directory listing to see or download them.
- vocab/, all the RDF vocabulary used to
describe the regions.
The files containing the zone information contain a URL, a title, along
with the co-ordinates of the outlines. They can look like that:
1100 <?xml version="1.0" encoding="UTF-8"?>
1101 <rdf:RDF
1102 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
1103 xmlns:area="http://ckiss.net/machin/area-ns#">
1104
1105 <area:Area>
1106 <area:name>Arizona</area:name>
1107 <area:polygons>
1108 <area:Polygon>
1109 <area:center>
1110 -112.353981 33.391022
1111 </area:center>
1112 <area:points>
[..] -109.046196 31.331800
-109.300354 31.334017
-109.789291 31.332031
<!-- (I stripped the co-ordinates enumeration) -->
-109.048943 31.806059
-109.045547 31.508570
-109.046196 31.331800
1200 </area:points>
1201 </area:Polygon>
1202 </area:polygons>
1203 </area:Area>
1204 </rdf:RDF>
The files containing the RDF vocabulary contain a Description of the resource look like:
<rdf:RDF
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:NS0='http://www.w3.org/2001/sw/Europe/200306/geo/vocab/termes#'
xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#'
>
<rdf:Description rdf:about='#pays'>
<rdfs:label>La France</rdfs:label>
<rdf:type rdf:resource='http://www.aktors.org/ontology/portal#Geographical-Region'/>
<rdfs:comment>Le pays lui-même - La France, y compris les DOM-TOM</rdfs:comment>
</rdf:Description>
<rdf:Description rdf:about='#PACA'>
<!-- PACA est en france -->
<NS0:zone rdf:resource='#pays'/>
<rdfs:comment>Provence Alpes Cote d'Az...</rdfs:comment>
<rdfs:label>PACA</rdfs:label>
<!-- c'est un region, donc du type Geographic-region (parce que tout de type region l'est) mais ca ne fait pas mal de le dire aussi -->
<rdf:type rdf:resource='#region'/>
<rdf:type rdf:resource='http://www.aktors.org/ontology/portal#Geographical-Region'/>
</rdf:Description>
<!-- on defini une classe pour les regions de France -->
<rdf:Description rdf:about='#region'>
<!-- c'est un type de region geographique -->
<rdfs:subClassOf rdf:resource='http://www.aktors.org/ontology/portal#Geographical-Region'/>
<rdfs:comment>Region</rdfs:comment>
<rdfs:comment>Une region administrative de la France, genre PACA</rdfs:comment>
</rdf:Description>
</rdf:RDF>
Implemented Functions
Looking for particular people:
- If needed, you can edit the source code to meet your requirement (e.g.
if you need to work only with people who master french, search for
"fr" within "lang:masters"...). There is a function
that applies conditions for filtering search results.
There is a complete list of the 70-odd functions
defined (not all of them are used). Here are some of the functions
explained a bit:
- initPays()
- Load every regions files containing countries outlines
- initFoaf()
- Load some foaf informations files. These are loaded in real time,
from the files referred to in scutterTrim.rdf - there is a larger list of
files at scutter_20030806.xml but it
takes days to load and most of the information you get wouldn't be
relevant. If you edit this function you can change where it loads FOAF
files from.
- initAirport()
- Load from the file airports.rdf all the
co-ordinates and information about airports
- formateGeoResultsEnRdf(regions, selected_co-ordinates,
nearestAirport_info)
- Generate an RDF output about the regions the selected point belong
and about the nearest airport found
- formateDataResultsEnRdf(arrayResult)
- do the same but with foaf actors found near the geographic zone
selected
- getNearestAirport(latitud, longitud)
- calculate the nearest airport from the lat/long co-ordinates given in
parameter --note this is being changed in the
testVersion
- convertCoordToDec(latitud, longitud)
- convert co-ordinates in degrees-minutes[-seconds] to degrees in
decimal
- calcDistance(latitud_a, longitud_a, latitud_b, longitud_b)
- calculate the distance in kilometer between the points a and b
- getFoafActorInfo(foaf_file)
- get the information about actors contained in foaf_file
- locateMousePoint(evt)
- Find the point where the click happened, taking into account zoom and
pan
- Make loadable sub-areas of any zone (hard to do because of Javascript's
strange file-loading functions).
- Get the airport data live from MortenF's
nearest airport instead of loading it all up previously (quicker).
CMN 20040921 I started to do this - the functions are at the end of the
code in the testVersion.
- See where the FOAF people
map gets its data and copy...
- I got the country outlines from the Digital Chart of the World's
website as plain text, and converted them manually to RDF. It would be
cool to make a script to automate that, or to find better sources.
- Explain what a new region file should look like (see above), and how to
get it added to the list of regions loaded - factor out
- Convert onClicks to work onActivate, and sort out keyboard navigation
by region (continent, country, region? Phone code? ...)
- Clean up the onZoomResize to catch display areas in general
- Allow a choice of different region lists rather than loading everything
at once.
- (ideally, explain how to add a functionailty in general)
- describe the functionality in RDF - where is the javascript, what
is it called. Load the list of functions, turn them on and off
javascript (is it feasible to load the javascript in real time?)
- Use a database to increase performance when loading information - at
the moment it uses a small proxy but the page itself seperately loads
each file requested. This is not scalable - the program hangs for days
(literally several days or even weeks) while loading data
- Make the getURL calls so that they can fetch RDF by preference (for
example from Morten's thing. Maybe look at Gerald Oskoboiny's DTRT
for parsing a request and assume they all pass through the proxy?)
--CMN040922 I got around this with Morten's service because it
accepts a parameter in the URI itself
- Determine the geographic's regions type (administrative regions,
countries, or what ever ...).
- Provide an XForms interface based on the same data. (Then work out how
to use the SVG interface as one presentation, and have a more textual
interface option).
Known problems
- Javascript's file-loading functions don't seem robust enough to load
every asked file...
- Multi-encoding is not handled (I use ISO-Latin encoding, so if you use
UTF-8 special characters, the output can also be... special ;-))
- Ontologies are not handled.
- The handling offoaf:interests is ugly (searches for the
string in the whole printNode()), but at least, can find data
into the object and/or therdf:aboutfields.
- Nearest airport calcul seems return error following the point selected
(maybe caused by wrong airports co-ordinates).
Translation
Some SVG commands are displayed in French. So maybe you could want a
translation of these:
- Afficher les acteurs = Display the actors
- Afficher les résultats = Display the results
- Bilan des fichiers chargés = File loading stats
- Aide sur le fonctionnement de l'application = Help about how to use the
application
- Travail en cours = Current work
- Chargement des fichiers = Loading files
- Veuillez séléctionner une action à effectuer = Please select an action
to execute
Last update: $Date: 2004/09/22 14:12:34 $ by $Author:
charles $