Home GPS Download Business Partners Contact Family AVL Links History AsOnTV

GPSS .GEO Files for "Map Matching"

Updated 0700 Thursday 30th August 2001 UK Time

Robin This GEOFILES page was set up to provide a simple explanation of GEO files, used within GPSS for "map matching". i.e. to recognise from the GPS-based position and direction of travel, what road you are on, or when you are passing particular places.

e.g. in the Sunninghill demonstration, GPSS will say, "we are on the B3020 Sunninghill High Street", and in other places, "we are near rail bridge and chemist, on our right". These facilities are supported by GEO files, which hold data, accurate to typically 5 metres or better.

You will find other GPSS mapping file details on the ADDMAPS Page, which you should read to understand some of the more basic principles adopted within GPSS, such as how locations are represented.

The material below was originally on the ADDMAPS Page.


GEO files support some of the more sophisticated facilities within GPSS - such as recognising that the car is on a particular street :
"we are on B3020 Sunninghill High Street"

- or near a particular landmark :
"we are near School, on our right"

This is achieved by the required data, such as the location and category of the place, being available for GPSS to check, second-by-second. The large quantity of such data, means that it must be placed somewhere where GPSS can find it quickly. This is done by putting the data into a file with a name based on its position. Within the UK this is simply a file based on the UK grid, and each file covers a 1 km square area.
e.g. SU 93320 67830 would match into SU9367.GEO

Outside the UK, the filename is based on lat/lon, and is a more complicated process. e.g. for a location such as 225682S0431524W in Brazil, the file name matching this location is 22S043WS.GE7

You will probably recognise the first 7 characters, 22S043W, as being the degrees of latitude and longitude. The 8th character S, and last character 7, provide a more accurate (or smaller cell) than 1 degree x 1 degree.

The precise algorithm used to relate lat/lon to GEO file name is given at the end of this section, under "LLTOGEO Algorithm", but you will be glad to know that you do not need to take up programming :-)

This logic, of relating location to GEO file name, is included within the GEOMAN facility of GPSS. You will see the form if you hit Control-C then hit the GEOMAN button. GEOMAN enables you to append data into GEO files, by clicking on the map, or using GPS. (GEO files would not normally be made using GEOMAN, which is intended simply as an experimental tool, permitting small samples of mapping to be created for test or demonstration)

Let's take a look at the data within a GEO file, starting with some of that appearing within the sample SU9367.GEO provided with all copies of GPSS :

ERC,SU 93625 67794,#Jade Fountain#$n$
RB,SU 93242 67070,#B3020 Bagshot Rd#$33$
JC,SU 93346 67200,#Berystede#
The data can be in any order, since GPSS will be checking all of it regularly.

The UK grid references (e.g. SU 93625 67794) could, of course, be a lat/lon reference (e.g. 225682S0431524W).

The first item is the category code. e.g. ERC = "Chinese Restaurant".
The text between # # is an optional name - if one is known. If not use ##.
The text between $ $ is an optional direction. For landmarks this is done in rough terms n,s,e,w for north, south, east or west - will be explained soon. For roads, this is more accurate, and in degrees clockwise from true north - this will also be explained in a moment.

Let us first consider approaches to a landmark : imagine the file did not include
ERC,SU 93625 67794,#Jade Fountain#$n$ - but instead, only included :
ERC,SU 93625 67794,## - GPSS would say :
"we are near Chinese Restaurant"
If we knew that the landmark was on the right when travelling roughly north, we could include $n$ and GPSS would say :
"we are near Chinese Restaurant, on our right" - but if travelling south would say
"we are near Chinese Restaurant, on our left".

This process of saying it is "on our left" or "on our right" is only practical when there is no doubt that the place can only be approached within about 100 metres (GPS accuracy) from two directions. If it is near a crossroads, then better not to include the $$ direction. It obviously does not apply to some landmarks, like bridges across the road.

So what is the text used for ? suppose we had :
ERC,SU 93625 67794,#Jade Fountain#$n$
- the text will be displayed, and if Text-To-Speech software was being used with GPSS, it would say :
"we are near chinese restaurant, called the Jade Fountain, on our right"

So what about that other example of a road - where the direction was more accurate ?
e.g. RB,SU 93242 67070,#B3020 Bagshot Rd#$33$

This is used for a very different purpose - that of map matching. It is used to announce, "we are on the B3020 Bagshot Rd", and perhaps a few minutes later, "we are moving north on B3020 Bagshot Rd". i.e. it is used to help GPSS know what road or steet the car is on. It remembers this for about 60 seconds - then deliberately forgets - since this type of data may not be available everywhere the car goes (and GPSS would still think it was on the last road for which it had data).

The GEOMAN facility was extended in v5.1 of GPSS, released in April 2001. One feature added was the ability to make GPSS announce that you were no longer on the "matched" road. To enable this feature, simply add a sound file with name WARNOFFR.WAV with a recording such as "Warning ! we are no longer on that road...". If available, GPSS will follow this sound by that of the relevant road being left.
e.g. "Warning ! we are no longer on that road... Armitage Court"

Another (related) feature added in v5.1 was the ability for GEOMAN to automatically record roads into the GEO files, by switching ON the new automatic facility in GEOMAN. A practical application of this might be to record a particular path on unmarked roads, then be able to retrace that path (in either direction) at a later time. The user might record a WAV file such as #FREDSRO.WAV ("Fred's Route"), and set up GEOMAN with the name "Freds Route" before switching ON the automatic process. This will create a new position and direction (of road) every 50 metres of travel (or whatever criterea has been set up on GEOMAN). When re-tracing the route, GPSS would be saying things like, "we are on Fred's route".

But let us return to the earlier example.....

The data is an accurate position, and the direction of the road at that position. Good places to use are perhaps 10 metres back from a road junction - for each road connected to the junction. Every junction should be included, and for long roads, it is reccomended that a point is taken every 200 metres - more if the data is intended to improve the accuracy of tracking.

For roads, it is possible to create a sound file based on the name, starting with #.
e.g. for #B3020 Bagshot Rd#$33$ use #B3020BA.WAV

The above examples are within the UK, using locations in UK Grid (e.g. SU 93242 67070) rather than lat/lon (e.g. 523075N0013075W). For those outside the UK, this extract from an e-mail to Roberto in Rome, Italy, in April 2001, may help in understanding GEO files:

GEOMAN and the GEO files are the most complicated thing in GPS. But I do not mind telling you about them, if you do not mind the hard work :-)

Best that you use the latest v5.1 Baseline of GPSS (or the v5.1 GPSS.EXE off oldnew.htm) because I made some improvements to GEOMAN, so that you could record roads into GEO files automatically. (category R such as "we are on B3020 Sunninghill High Street")

There is already some old information about GEO files in addmaps.htm But easiest for me to use my map of Roma to give you a practical example, to help answer your questions.

I selected the Roma map with GPSS and GEOMAN. I clicked on 4 points (2 on road Corso Vittorio, 1 on bridge over river Tiber, and 1 on road near Hospital) (more information in a moment)

The first click on the road was a position in the area covered by the GEO file 41N012Q.GEE
R,415393N0122820E,#Corso Vittorio#$322$

The next click on the road went into the next area in file 41N012R.GEE and that is where the other clicks went:
R,415400N0122812E,#Corso Vittorio#$327$

Now more detail on how I made this data.
I select category R (Road) on GEOMAN
I put name of road in GEOMAN = Corso Vittorio
clicked with left mouse button on road.
clicked with right mouse button further along road, to calculate direction of road
(322 then 327 degrees clockwise from north)
clicked on APPEND to write into file

This is how the data was made. If I wanted a sound for this road Corso Vittorio I would record a WAV file with the name #CORSOVI.WAV = "Corso Vittorio" Then, with these GEO files present, GPSS would say "we are on Corso Vittorio" if we drive in either direction on this bit of road (GPSS checks +180 degrees also)

For the bridge, I selected category LBRI,
put name of bridge as Tevera,
clicked on bridge with left mouse button,
made sure there was no direction (or GPSS would say "on our left"),
clicked on APPEND.
(result is "we are near bridge")
If I wanted to make a WAV file, I use name #TEVERA.WAV="River Tiber"
(result is "we are near River Tiber")

For the hospital, I selected LH for Hospital,
removed name Tevera,
(maybe I should change GPSS.EXE so this is automatic because easy to make mistake)
click on road near bridge and hospital with left mouse button,
clicked with mouse right button back on road south, in direction I would travel if the Hospital were on the RIGHT. This put direction S (South) into the entry

So when we go near this point, GPSS will look at direction, and if we are travelling South, South West, or South East, then it will say "we are near Hospital, on our right". If not going in this direction, it will say, "we are near Hosptal, on our left" If I wanted a special name and sound for hospital, we could do it, as for bridge. e.g. Tiber Hospital = #TIBERHO.WAV

Remember when using direction for landmarks ("on our left", or "on our right") GPSS can make mistakes if you can approach this position from many directions, so for the example above, it would be better to do the hospital as the bridge:
("we are near hospital" with no "on our left" or "on our right")

Now the answers to your questions:
Yes, when you change the category control to E, GEOMAN should look in GPSS.CAT and fill in Eating Place. You do not change this.
There should be an Italian WAV file $E.WAV = "Eating Place" (in Italian)
So GPSS can say in Italian, "we are near eating place".
You do not need to have a name for this, but if you wish to,
the name should go in the Name control lower on GEOMAN, above APPEND.
If you wish this name to be spoken, you can make a WAV file, starting #
e.g. "Freds Bar" = #FREDSBA.WAV

" (end of extract)

LLTOGEO Algorithm

The simplest way of expressing the relationship between lat/lon location and GPSS GEO file name, to computer programmers, is probably a few lines of BASIC code:
g$ is the string holding the location. e.g. "225682S0431524W" in Brazil
geo$ is the output filename of "22S043WS.GE7"

    geo$ = Mid$(g$, 1, 2) + Mid$(g$, 7, 1) + Mid$(g$, 8, 3) + Mid$(g$, 15, 1)
    i = Int(Val(Mid$(g$, 3, 2)) / 2)
    If i <= 9 Then
      i = i + 48
      i = i + 55
    End If
    geo$ = geo$ + Chr$(i)
    i = Int(Val(Mid$(g$, 11, 2)) / 2)
    If i <= 9 Then
      i = i + 48
      i = i + 55
    End If
    geo$ = geo$ + ".GE" + Chr$(i)