Skip to content

Commit

Permalink
Add icons for menu. Art work from openclipart.org
Browse files Browse the repository at this point in the history
On the fly switching of pak file when bbox test fails. 
All ports now use the same options.
Translations once again functional..
WinCE port is once again operational.
Display routing decisions to user with icons.


git-svn-id: http://svn.openstreetmap.org/applications/rendering/gosmore@18429 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
  • Loading branch information
nic committed Nov 2, 2009
1 parent 00aa95e commit 2fea3c1
Show file tree
Hide file tree
Showing 25 changed files with 8,355 additions and 2,946 deletions.
10 changes: 8 additions & 2 deletions Makefile
Expand Up @@ -48,7 +48,7 @@ all: gosmore$(EXE)
# task then chooses the most
# appropriate process and forwards the expose, search or routing request to
# it. THE CODE IS NOT FINISHED. Linux version looks promising.
gosmore: gosmore.cpp libgosm.cpp libgosm.h
gosmore: gosmore.cpp libgosm.cpp libgosm.h bboxes.c
g++ -DCHILDREN=16 ${CFLAGS} ${WARNFLAGS} ${XMLFLAGS} \
gosmore.cpp libgosm.cpp -o gosmore ${EXTRA}

Expand All @@ -57,7 +57,7 @@ gosmore16: gosmore.cpp libgosm.cpp libgosm.h
gosmore.cpp libgosm.cpp -o gosmore16 ${EXTRA}

$(ARCH)gosmore.exe: gosmore.cpp libgosm.cpp gosmore.rsc resource.h \
libgosm.h ceglue.h ceglue.c
libgosm.h ceglue.h ceglue.c bboxes.c
${ARCH}g++ ${CFLAGS} ${EXTRAC} -c gosmore.cpp
${ARCH}g++ ${CFLAGS} ${EXTRAC} -c libgosm.cpp
${ARCH}gcc ${CFLAGS} ${EXTRAC} -c ConvertUTF.c
Expand All @@ -75,6 +75,12 @@ translations.c: extract
extract: extract.c
${CC} ${CFLAGS} ${XMLFLAGS} extract.c -o extract

bboxes.c: density.c density.txt
gcc -lm density.c -o density
./density <density.txt >density.sh
# wget http://www.openstreetmap.org/api/0.6/changeset/1707270/download -O \
# countries.osm

osmunda: osmunda.cpp libgosm.cpp libgosm.h
g++ ${CFLAGS} ${WARNFLAGS} ${XMLFLAGS} \
osmunda.cpp libgosm.cpp -o osmunda
Expand Down
Binary file added compass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,513 changes: 4,513 additions & 0 deletions countries.osm

Large diffs are not rendered by default.

302 changes: 302 additions & 0 deletions elemstyles.xml
Expand Up @@ -25,6 +25,308 @@ BEWARE: If a key/value pair matches more than one rule, the "rule that wins" is
-->

<rules>
<!-- The following rules must be at the beginning of this file and must be
in the same order as the OPTIONS COMMANDS enum in gosmore.cpp -->
<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="FollowGPSr" />
<icon annotate="true" src="satellite.png" />
<area colour="#000000"/> <!-- Overloaded as Background=0 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="AddWayOrNode" />
<icon annotate="true" src="pencil.png" />
<area colour="#e0ffff"/> <!-- Overloaded as Background=1 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="StartRoute" />
<icon annotate="true" src="waypoint/pin/green.png" />
<line width="6" realwidth="6" colour="#00ff00"/>
<!-- These line attributes are used for drawing the route -->
<area colour="#d3d3d3"/> <!-- Overloaded as Background=2 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="EndRoute" />
<icon annotate="true" src="waypoint/pin/red.png" />
<area colour="#e6e6fa"/> <!-- Overloaded as Background=3 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>


<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="OrientNorthwards" />
<icon annotate="true" src="compass.png" />
<area colour="#ffffe0"/> <!-- Overloaded as Background=4 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="LoadGPX" />
<icon annotate="true" src="compass.png" />
<area colour="#f5deb3"/> <!-- Overloaded as Background=5 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="FastestRoute" />
<icon annotate="true" src="road.png" />
<area colour="#7b68ee"/> <!-- Overloaded as Background=6 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="Vehicle" />
<icon annotate="true" src="transport/car.png" />
<area colour="#6b8e23"/> <!-- Overloaded as Background=7 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="English" />
<icon annotate="true" src="flags.png" />
<area colour="#ffffff"/> <!-- Overloaded as Background=8 -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ButtonSize" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="IconSet" />
<icon annotate="true" src="iconset.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="DetailLevel" />
<icon annotate="true" src="magnify.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ValidateMode" />
<icon annotate="true" src="valid.png" />
<line width="10" realwidth="10" colour="#ff9999"/>
<!-- These line attributes are used for marking invalid objects -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="Exit" />
<icon annotate="true" src="exit.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="DisplayOff" />
<icon annotate="true" src="sleep.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="FullScreen" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ShowCompass" />
<icon annotate="true" src="compass.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="Background" />
<icon annotate="true" src="palette.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ShowCoordinates" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ShowTrace" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="CommPort" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="BaudRate" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ZoomInKey" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ZoomOutKey" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="MenuKey" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="ShowActiveRouteNodes" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="SearchSpacing" />
<icon annotate="true" src="misc/deprecated.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdturnleft" />
<icon annotate="true" src="waypoint/route/left.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdkeepleft" />
<icon annotate="true" src="waypoint/route/left/fork.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdturnright" />
<icon annotate="true" src="waypoint/route/right.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdkeepright" />
<icon annotate="true" src="waypoint/route/right/fork.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdstop" />
<icon annotate="true" src="waypoint/route/destination.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmduturn" />
<icon annotate="true" src="waypoint/route/right/uturn.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround1" />
<icon annotate="true" src="waypoint/wpt1.png" /> <!-- Bad choice -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround2" />
<icon annotate="true" src="waypoint/wpt2.png" /> <!-- Bad choice -->
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround3" />
<icon annotate="true" src="waypoint/wpt3.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround4" />
<icon annotate="true" src="waypoint/wpt4.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround5" />
<icon annotate="true" src="waypoint/wpt5.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround6" />
<icon annotate="true" src="waypoint/wpt6.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround7" />
<icon annotate="true" src="waypoint/wpt7.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<rule> <!-- Not valid OSM-XML, but used inside gosmore -->
<condition k="gosmore" v="cmdround8" />
<icon annotate="true" src="waypoint/wpt8.png" />
<scale_min>1</scale_min> <!-- N/A -->
<scale_max>4</scale_max> <!-- N/A -->
</rule>

<!-- mark some specials that should be fixed - they are already the default and therefore shouldn't be tagged -->
<rule>
Expand Down
Binary file added exit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions geonames2osm.c
@@ -0,0 +1,38 @@
// To run this program :
// wget http://download.geonames.org/export/dump/cities1000.zip
// unzip cities1000.zip
// gcc geonames2osm.c && sort -nr -t$'\t' -k 15 cities1000.txt |
// ./a.out >lowres.osm

#include <stdio.h>
#include <strings.h>

char list[180000][80], line[5000]; // Space for Jerusalem and its translations

int main (void)
{
int cnt = 0, i, j, idx[30], ppl; // Do we need to set idx[0] = 0 ?
while (fgets (line, sizeof (line), stdin)) {
for (i = 0, j = 1; line[i] != '\0' && j < 30; i++) {
if (line[i] == '\t') idx[j++] = i + 1;
}
if (j < 14) continue; // Bad line
// For each geonames entry we generate 2 names and convert the ones that
// are unique into OSM-XML.
for (i = 1; i >= 0; i--) {
sprintf (list[cnt], i ? "%.2s %.*s" : "%.0s%.*s", line +
idx[line[idx[8]] == 'U' && line[idx[8]+1] == 'S' ? 10 : 8],
idx[2] - idx[1] - 1, line + idx[1]);
for (j = 0; j < cnt && strcasecmp (list[j], list[cnt]) != 0; j++) {}
if (j < cnt) break; // If seen before
ppl = atoi (line + idx[14]);
if (i == 1) printf ("<node id='%d' lat='%.*s' lon='%.*s'>\n"
" <tag k='place' v='%s' />\n", 0x7fffffff - cnt,
idx[5] - idx[4] - 1, line + idx[4],
idx[6] - idx[5] - 1, line + idx[5], ppl > 456789 ? "city" :
ppl > 23456 ? "town" : ppl > 789 ? "village" : "hamlet");
printf (" <tag k='%s' v=\"%s\" />\n", i ? "ref" : "name", list[cnt++]);
}
if (i < 1) printf ("</node>\n");
}
}

0 comments on commit 2fea3c1

Please sign in to comment.