You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Danny B. <dan...@us...> - 2010-12-04 09:43:53
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27411 Modified Files: buildmap_osm_text.c Log Message: Oops, too much debug output Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** buildmap_osm_text.c 4 Dec 2010 09:34:33 -0000 1.25 --- buildmap_osm_text.c 4 Dec 2010 09:43:45 -0000 1.26 *************** *** 905,909 **** int line; ! buildmap_info ("Way %d is an area, %d polygon lines", in_way, nWayNodes); /* * Detect an AREA -> create a polygon --- 905,909 ---- int line; ! // buildmap_info ("Way %d is an area, %d polygon lines", in_way, nWayNodes); /* * Detect an AREA -> create a polygon |
From: Danny B. <dan...@us...> - 2010-12-04 09:34:41
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv23950 Modified Files: buildmap_osm_text.c Log Message: Comment out a check for way consistency (are all its nodes present) because splitter output triggers it, see the comments introduced by this patch. Also add a bit of counting that I hope will help in automating the splitter process more. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** buildmap_osm_text.c 13 Nov 2010 15:02:13 -0000 1.24 --- buildmap_osm_text.c 4 Dec 2010 09:34:33 -0000 1.25 *************** *** 496,499 **** --- 496,509 ---- } + /**< @brief count polygon lines early */ + static int EarlyPolygonCount = 0; + static int EarlyPolygonNodeCounter = 0; + + static void + buildmap_osm_nd_counter(void) + { + EarlyPolygonNodeCounter++; + } + /** * @brief to figure out early (in pass 1) whether this is an interesting way *************** *** 505,508 **** --- 515,527 ---- { WayIsInteresting(in_way, WayNotInteresting); + + /* To count polygon lines early ?? */ + if (WayFlags & AREA) { + // buildmap_info ("Early - Way %d is an area", in_way); + EarlyPolygonCount += EarlyPolygonNodeCounter; + } + EarlyPolygonNodeCounter = 0; + /* End count polygon lines */ + buildmap_osm_text_reset_way(); return 0; *************** *** 631,634 **** --- 650,669 ---- ix = buildmap_osm_text_point_get(node); if (ix < 0) { + #if 0 + /* + * This started out as a consistency check, but output of + * splitter has a massive amount of these : + * a way (an area like a lake) that is cut in two because of + * the boundaries splitter introduces will turn up in several + * maps. The strangeness from splitter is that the ways are + * all fully defined, but the nodes aren't all present. + * + * So here we take care not to discard those ways (areas). + * + * It might be a good idea to enable this just when the output + * is created by splitter, e.g. by putting an if statement + * around the lines of code #if-fed out below. + */ + /* Inconsistent OSM file, this node is not defined */ /* Only count if we didn't already know this */ *************** *** 637,640 **** --- 672,676 ---- WayInvalid = 1; buildmap_verbose("Invalid way %d due to missing node %d", in_way, node); + #endif return 0; } *************** *** 869,872 **** --- 905,909 ---- int line; + buildmap_info ("Way %d is an area, %d polygon lines", in_way, nWayNodes); /* * Detect an AREA -> create a polygon *************** *** 1304,1307 **** --- 1341,1349 ---- NumWays++; continue; + #if 1 + } else if (strncasecmp(p, "nd", 2) == 0) { + buildmap_osm_nd_counter(); + continue; + #endif } else if (strncasecmp(p, "/way", 4) == 0) { ret += buildmap_osm_text_way_end_pass1(p); *************** *** 1322,1325 **** --- 1364,1368 ---- buildmap_info("Pass %d : %d lines read (%d seconds)", passid, LineNo, t[passid] - t[passid - 1]); + buildmap_info("Early polygon count %d", EarlyPolygonCount); passid++; *************** *** 1517,1523 **** buildmap_info("Pass %d : %d lines read (%d seconds)", passid, LineNo, t[passid] - t[passid - 1]); - buildmap_info("Ways %d, interesting %d, discarded (missing node) %d", - NumWays, interestingWays, WaysMissingNode); - buildmap_info("Number of nodes : %d, interesting %d", NumNodes, nNodeTable); passid++; --- 1560,1563 ---- *************** *** 1529,1532 **** --- 1569,1575 ---- (void) time(&t[passid]); + buildmap_info("Ways %d, interesting %d, discarded (missing node) %d", + NumWays, interestingWays, WaysMissingNode); + buildmap_info("Number of nodes : %d, interesting %d", NumNodes, nNodeTable); buildmap_info("Pass %d : %d lines read (%d seconds)", passid, LineNo, t[passid] - t[passid - 1]); |
From: Danny B. <dan...@us...> - 2010-12-01 19:56:30
|
Update of /cvsroot/roadmap/roadmap/doc In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv22171/doc Modified Files: Map-Building Map-Format Navigation OpenStreetMap Added Files: Maps Log Message: Perform the documentation change about building OSM based maps for larger countries (using splitter) as recently announced. Index: OpenStreetMap =================================================================== RCS file: /cvsroot/roadmap/roadmap/doc/OpenStreetMap,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OpenStreetMap 27 Jan 2009 01:42:13 -0000 1.2 --- OpenStreetMap 1 Dec 2010 19:56:21 -0000 1.3 *************** *** 1,8 **** RoadMap and OpenStreetMap map data ! January 2009 ! ! = Using OpenStreetMap Maps = This information is preliminary, since OSM support is --- 1,7 ---- RoadMap and OpenStreetMap map data ! November 2010 ! == Using OpenStreetMap Maps == This information is preliminary, since OSM support is *************** *** 16,20 **** to be with several ways to interpret the same data. Second, there's not always a direct mapping between the coordinates on the screen where ! RoadMap is trying to displaya map, and the name of the map file(s) that contain(s) information for that region. --- 15,19 ---- to be with several ways to interpret the same data. Second, there's not always a direct mapping between the coordinates on the screen where ! RoadMap is trying to display a map, and the name of the map file(s) that contain(s) information for that region. --- NEW FILE: Maps --- RoadMap and OpenStreetMap map data November 2010 = Maps = RoadMap is program that displays maps. Depending on how you got RoadMap, it may come prepackaged with a set of demo maps that may or may not be useful to you. This chapter describes the kinds of map data RoadMap can deal with, how to recognize and treat them, and how to obtain and/or preprocess them. == About RoadMap Maps == This information is preliminary, since OSM support is work-in-progress. It does work, but may change in detail. === Locating Map Files === - Indexed maps The maps that RoadMap renders come from several sources (TIGER, various shapefile formats, OpenStreetMap). They all need to be indexed for use by RoadMap for several reasons. First, we don't want to overload RoadMap to be with several ways to interpret the same data. Second, there's not always a direct mapping between the coordinates on the screen where RoadMap is trying to display a map, and the name of the map file(s) that contain(s) information for that region. - Maps without indexing : QuadTiles Explanation of the nature of QuadTile maps is in a subsequent chapter. For now, note that QuadTile based maps have directory and file naming such that a separate indexing mechanism is not required. A map file for QuadTile based maps is named similar to : /usr/local/share/roadmap/maps/qt18/01/a0/qt01a08006.rdm /usr/local/share/roadmap/maps/qt25/65/97/qt659709cd.rdm === Map File Names === - File name formats The map files are named in a way that depends on how the data was obtained and therefore, how the data is organized. A map file called "usc25027.rdm" contains contains data from county 27 in state 25). A map file called iso-be.rdm contains the whole country "be". A third map file format is based on QuadTiles. The files contain some information that RoadMap can use to figure out where it is -- an index is made using this information so that RoadMap doesn't need to continually look in all the files. That index is currently called "usdir.rdm". - QuadTiles, RoadMap tileid values, and filenames If the name of the file holding the map data encoded its position and size somehow, then an index wouldn't be needed (at least for positioning -- there are other reasons an index is useful, but none are as critical to rendering). For maps whose data source is organized by geography (i.e., latitude/longitude) rather than politics (i.e. country name), it's possible to do such an encoding. The encoding used by RoadMap for OpenStreetMap (OSM) maps is known as "quadtile" encoding. There's a good description of quadtiles as they relate to OSM on the OSM wiki, here: http://wiki.openstreetmap.org/index.php/QuadTiles (There's also a more general article on Wikipedia.) The OSM quadtile scheme uses a full 32 bits worth of addressing in a "tileid", and can reference tiles as small as 600 meters on a side (at the equator -- they're narrower further north and south). RoadMap doesn't need such fine-grained resolution, and uses fewer bits for RoadMap tileids. This frees those bits to be used for other purposes, and RoadMap uses only 27 bits to address quadtiles (the smallest addressable tile is about 2.4km on a side). Of the 5 bits remaining in a 32 bit word, RoadMap uses one bit internally to distinguish a tileid from one of the "FIPS" county identifiers that represent RoadMaps other maps, and the other 4 are used to encode how many bits of the 27 address bits are currently in use -- the 4 bits are used to represent "bit count" values of 12 through 27, maximum and a minimum tile sizes that RoadMap can handle of from 2.4km up to 320km on a side. The encoded RoadMap tileid is used directly to form the filename representing the data for that OSM quadtile. The tileid is represented in hexadecimal. The lowest 4 bits (the least-significant hex digit) is 12 less than the bit level -- so a 19 bit tile would have a '7' in that digit. The OSM quadtile value appears in the other 7 hex digits. Its value is "left-justified" -- i.e., as more bits are added to the quadtile address, the address grows to the right. As an example, to RoadMap encoding of the 19 bit OSM quadtile id of 251833, would be 0x3d7b9007. (251833 is 0x3d7b9 in hex). == Obtaining Map Files == - Fetching OpenStreetMap data by QuadTile OSM map data is available from servers on the web, using a simple API. As simple as it is, though, it can produce a lot of data in XML format, very quickly. While it might not be a problem for desktop systems with high-speed connections, if RoadMap is to be able to do on-demand loading of OSM data, an alternative protocol is preferable. Conveniently, work has already been done to specify just such a compact profile. Known as the "OSM Mobile Binary Protocol", it is documented here: http://wiki.openstreetmap.org/index.php/OSM_Mobile_Binary_Protocol Roadmap comes with code which can provide data in this format, which can be run in two different ways: either as a a command-line program, or as a proxy server implemented as a CGI script. The two programs share most of their code, and are written in PHP. Converting the "Mobile Binary" data to a format useable directly by RoadMap is handled by the command "buildmap_osm". Given some information about position and area, the size of the quadtiles desired, and the source of the data, buildmap_osm will produce the RoadMap .rdm files necessary for displaying that region. buildmap_osm can be given two lat/lon pairs, to specify a bounding box, or a single lat/lon pair plus a radius in miles or km (it's not really a radius -- the distance again actually describes a square bounding box). The size of the quadtile to fetch is specified in "bits" (see the previous section), and the source of the data is specified either as the PHP "osmgetbmap" command, or as a URL referring to an installed version of the PHP cgi script. A sample command looks like: ``` buildmap_osm -m /tmp/maps -s osmgetbmap 48.135,17.125:20km ``` which will fetch 40 km square worth of maps centered on Bratislava. Using the web proxy, the same request might look like: ``` buildmap_osm -m /tmp/maps -s http://localhost:801/cgi-bin/bmap.php \ 48.135,17.125:20km ``` - Fetching OpenStreetMap data in large chunks The OpenStreetMap servers only allow obtaining a limited amount of map info per query. Access via the OSM Mobile Binary Protocol is subject to such limitations. Other services (e.g. http://download.geofabrik.de/osm/europe/) provide access to large chunks of OSM data in a single file, e.g. a file per country, like the maps used in many commercial GPS devices. The buildmap_osm command was extended to be able to process those files. A sample command looks like ``` buildmap_osm -i iso-be.osm -o iso-be.rdm ``` which will convert one file into the other. The file name format is twofold : iso-xx.rdm or iso-xx-yyy.rdm . The former is a file per country (xx is the ISO two-character code for the country). The latter format allows for country subdivisions (yyy is a subdivision of country xx). The codes xx and yyy are defined in the ISO-3166-1 (country) and ISO-3166-2 (country subdivision). Note that the latter is incomplete. - Limitations - Because the OSM maps are loaded based on geographic location, they currently have no notion of political locality. This means that searching by address or intersection can't currently work. - There's no way currently to do on-demand loading of OSM maps. Work needs to be done to integrate a buildmap_osm "method" into RoadMap's map download scheme. - When a tile is fetched, it will include all roads (and other lines -- "ways" in OSM parlance) which start or end in that tile. This leads to two interesting issues: + The true bounding box of the data in a fetched tile is probably not going to line up with the presumed dimensions of that tile. The bounding box may be smaller (if there is very little data, all within the bounds of the tile), or larger (as a result of roads and other features extending past the tile "boundaries"). + When a neighboring tile is fetched, it may include the same line, if the other end of the line is in that tile. In order to reduce the amount of duplicated data, when tiles are fetched via the "mobile binary" protocol, we tell the server that we already have tiles to the south and east, but not to the north and west. This way, if you load a full set of tiles, you should get just one copy of any line. The osmgetbmap code, however, doesn't do a perfect job of figuring out what not to give you based on what you say you already have, so you may get duplicated data, particularly around the edges of the area requested. The order in which RoadMap fetches tiles might need to be changed to help with this problem, as well. - Because tiles can provide overlapping data, map rendering near the edges of tiles can be somewhat messy -- the lines on one tile may be rendered before the polygons of the next, for instance, and labels placed when rendering one may collide with labels placed when rendering the next. For this reason, tiles should be kept fairly large -- RoadMap already has the means to make rendering relatively large areas efficiently. The only reason to choose small tiles is to reduce "latency" when requesting data on-demand. Index: Map-Format =================================================================== RCS file: /cvsroot/roadmap/roadmap/doc/Map-Format,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Map-Format 27 Jan 2009 01:42:13 -0000 1.2 --- Map-Format 1 Dec 2010 19:56:21 -0000 1.3 *************** *** 1,5 **** RoadMap Quickstart ! January 2009 --- 1,5 ---- RoadMap Quickstart ! November 2010 *************** *** 69,74 **** ! (See the file README.osm included with thre RoadMap source for ! information about file naming for OpenStreetMap files.) As indicated in several other places, the RoadMap map files (extension --- 69,74 ---- ! (See the section on OpenStreetMap in this documentation to find out ! about RoadMap support for OpenStreetMap data.) As indicated in several other places, the RoadMap map files (extension *************** *** 89,92 **** --- 89,99 ---- three digits identify the county within the state. + Maps derived from OpenStreetMap have this file name convention : + ``` + iso-<country>-<section>.rdm + ``` + in which "country" is the two-character ISO country code, and "section" + is a three-digit sequence number for the maps. + As for now, there is a single index file, named usdir.rdm. This file must be in the same directory as the map files. *************** *** 97,108 **** order and C structure layout. - [ //Future//: In order to make it possible to share map files between - different systems, an ASCII format is also defined, with the suffix - .rdx; the rdmxchange program translates from one format to the other. - Note that the data stored in the rdx files is strictly equivalent to the - one stored in the rdm files, and the organization of this data is very - specific to the RoadMap application. The rdx format was not designed to - exchange data with other applications. ] - These two types of files, the map and index files, contain very different data but share the same general organization: these files contain --- 104,107 ---- Index: Navigation =================================================================== RCS file: /cvsroot/roadmap/roadmap/doc/Navigation,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Navigation 9 Apr 2009 06:12:54 -0000 1.2 --- Navigation 1 Dec 2010 19:56:21 -0000 1.3 *************** *** 47,51 **** ! = Maps for Navigation = In order to support navigation, several extensions were made to the --- 47,51 ---- ! == Maps for Navigation == In order to support navigation, several extensions were made to the Index: Map-Building =================================================================== RCS file: /cvsroot/roadmap/roadmap/doc/Map-Building,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Map-Building 8 Apr 2009 12:43:29 -0000 1.3 --- Map-Building 1 Dec 2010 19:56:21 -0000 1.4 *************** *** 4,8 **** ! = Building Maps = To build the TIGER map files from scratch: --- 4,10 ---- ! == Building Maps == ! ! === Building TIGER Maps === To build the TIGER map files from scratch: *************** *** 66,70 **** ! = Map Utilities = RoadMap comes with a small set of utility programs and scripts which --- 68,286 ---- ! === Building OpenStreetMap Based Maps === ! ! *** Note : you need to work with unreleased sources (CVS snapshot 2010-11-25 ! *** or more later) in order for some features to work. ! ! No matter how you build the map, it needs to end up in a directory that RoadMap ! searches. You can configure this to be any directory you like, but know ! that one of the defaults - on a Linux or Unix based system - is ! ``` ! /usr/local/share/roadmap/maps ! ``` ! or actually, because of the /usr/local/share/roadmap/... default, ! any directory under ! ``` ! /usr/local/share/roadmap ! ``` ! so if the directions below mention a directory maps.nl then you're free ! to actually create this as ! ``` ! /usr/local/share/roadmap/maps.nl ! ``` ! and it should just work. ! ! ==== Smaller regions : without splitter ==== ! ! After downloading the map XML file, there are two basic steps in creating ! an OSM based map file : converting it into (one or more) rdm files, and ! creating an index file for every map directory. ! ! We'll assume you run these commands from the RoadMap source directory, ! in which you've performed the steps for compiling RoadMap and its tools. ! ! To convert a smallish map into a format suitable for RoadMap, use this : ! ``` ! buildmap_osm -m /usr/local/share/roadmap/maps.nl -i iso-nl-001.osm -o iso-nl-001.rdm ! ``` ! ! Note that buildmap_osm is rather strict about the file names allowed. ! ! The second step - creating the index file - consists of a single "buildus" command, ! which you need to run with the same -m <directory-name> parameter as buildmap_osm. ! ! Here's a full example : ! ``` ! pavilion: {1} wget -c -q http://download.geofabrik.de/osm/europe/luxembourg.osm.bz2 ! pavilion: {2} bunzip2 <luxembourg.osm.bz2 >iso-lu-000.osm ! pavilion: {3} buildmap_osm -m /usr/local/share/roadmap/maps.lu -i iso-lu-000.osm -o iso-lu-000.rdm ! -- Pass 1 : 1101143 lines read (3 seconds) ! -- Pass 2 : 1101143 lines read (36 seconds) ! -- Pass 3 : 1101143 lines read (8 seconds) ! -- loading shape info (from 260935 ways) ... ! -- generating squares... ! -- sorting squares... ! -- sorting points... ! -- counting crossings... ! -- sorting lines... ! -- Pass 4 : 1101143 lines read (0 seconds) ! -- Splits 233959, ways split 21339, not split 7320 ! -- sorting streets... ! -- retrieving lines and squares... ! -- sorting polygons' squares... ! -- sorting polygons... ! -- sorting polygon lines... ! -- writing results to iso-lu-000.rdm ! -- saving dictionary... ! -- saving 5 attributes... ! -- saving 416988 points... ! -- saving 279279 lines... ! -- Line By Point : 416721 points, 558497 lines ! -- saving 3687 streets... ! -- building the street search accelerator... ! -- saving 0 ranges... ! -- saving 18340 polygons... ! -- saving 376 squares... ! pavilion: {4} buildus -m /usr/local/share/roadmap/maps.lu ! -- app_a02.txt, line 3274: Processing maps from /usr/local/share/roadmap/maps.lu ! -- iso-lu-000.rdm: Country lu division 000 fips 1442000 ! -- iso-lu-000.rdm: scanning the county file... ! -- iso-lu-000.rdm: County 1442000 geometry n 50180434 s 49447603 w 5739644 e 6529990 ! -- sorting counties... ! -- usdir.rdm: Writing index file to directory '/usr/local/share/roadmap/maps.lu' ! -- usdir.rdm: saving dictionary... ! -- usdir.rdm: saving counties... ! pavilion: {5} ls -l /usr/local/share/roadmap/maps.lu luxembourg.osm.bz2 iso-lu-000.osm ! -rw-rw-r-- 1 danny danny 7733578 2010-11-24 09:09 luxembourg.osm.bz2 ! -rw-rw-r-- 1 danny danny 82908838 2010-11-24 21:10 iso-lu-000.osm ! ! /usr/local/share/roadmap/maps.lu: ! total 4100 ! -rw-rw-r-- 1 danny danny 10768052 2010-11-24 21:11 iso-lu-000.rdm ! -rw-rw-r-- 1 danny danny 181492 2010-11-24 21:12 usdir.rdm ! ``` ! ! There's a limitation when you have more than one map directory, e.g. a maps.be and ! a maps.lu directory. The limitation is that only one index file (usdir.rdm) is used. ! ! So if you have multiple map directories, you will need to create one index file : ! ``` ! buildus -m /usr/local/share/roadmap/maps.be,/usr/local/share/roadmap/maps.lu ! ``` ! ! ==== Using splitter ==== ! ! Splitter is a Java based utility described at http://www.mkgmap.org.uk/page/tile-splitter . ! ! You can download it at http://www.mkgmap.org.uk/splitter/ , please download the link ! indicated with [.tar.gz] . It downloads as a file called splitter-r123.tar.gz (version ! number subject to change, this is the value in November 2010). ! ! The only file used from the download is the splitter.jar. Please download this in ! your roadmap-directory/src/splitter so it becomes ! roadmap-dir/src/splitter/splitter-r123/splitter.jar ! ! If the version number is different, then this is one of the things to tweak in the ! "doit" script that I'll talk about in a second. ! ! ==== Big countries : use splitter more than once ==== ! ! There are a few things to keep in mind when doing that. ! ! The scripts used shouldn't clean up maps just generated for another part of the ! country (e.g. the script for Wales shouldn't delete the maps of England just ! created). Also you need to divide the range of 1000 possible divisions into the ! groups required for each region. ! ! I'll explain this with the UK as example. ! ! The UK can be downloaded from GeoFabrik in several chunks : England, Scotland, Wales. ! Without digressing about the political correctness, these are the files available at ! http://download.geofabrik.de/osm/europe/great_britain/ . ! ! At the time of this writing, this combination gives ! ``` ! input file max-nodes map-id ! initial last ! ! england 50000 001 423 ! scotland 10000 501 790 ! wales 10000 801 931 ! ``` ! ! You'll need to divide the range of 1000 into the chunks required for England, Scotland ! and Wales. Actually the example in the table above almost shows how not to do it : ! Wales is taking up much more of the range than actually required. By increasing ! max-nodes for Wales, it requires only 39 maps. ! ! ``` ! netherlands 10000 329 ! netherlands 8000 357 ! wales 10000 131 ! wales 50000 39 ! ``` ! ! The other thing that limits us here is density of the maps. This is not well spread. ! Things would be simpler if the density of towns, streets, etc. was the same everywhere. ! Unfortunately that is not so. Consequently, a couple of the maps generated by splitter ! may have too many elements on it, which is known to cause a ! ## too many polygon lines - 134145, max 65535 ! error condition in buildmap_osm. ! ! This is known to happen if you choose max-nodes=10000 for the Netherlands. One such map ! contains 149970 polygons. With max-nodes=8000, this situation keeps occurring. ! ! If you encounter a country that has trouble with all this, then it would still be ! possible to separate it over more than one map directory. In the UK example : we could ! use a maps.eng directory containg all of England, and a maps.ws directory containing ! Wales and Scotland. ! ! ==== Countries with variable density : use splitter more than once ==== ! ! The map of the Netherlands is an example where some areas are more dense than others. ! This causes most of the chunks of the map to convert well, but a small fraction is ! too big, e.g. with the ! ## too many polygon lines - 134145, max 65535 ! error - obviously the number before the comma is often different. ! ! To handle this, a second script is created to take just the maps that splitter ! has not made small enough, and force splitter to make them more fine grained. ! ! Such a sample script is src/splitter/nl.more/deeper.nl . ! ! To get an idea, splitting the Netherlands map with ! ``` ! resolution buildmap ! errors ! 13 9 ! 12 28 ! ``` ! ! What I did for this ? ! 1. Find the offending files ! make -n -f Makefile.nl ! 2. Link the OSM files to the subdirectory ! ln iso-nl-{001,004,008,013, ..}.osm nl.more ! 3. Initialize the START variable in the deeper.nl script ! set START=120 ! 4. Run the deeper.nl script ! 5. Move working maps to the right place ! mv maps.nl/iso*rdm ../maps.nl ! 6. Move areas.list files up ! mv areas.list.nl.* .. ! ! and then, basically restart for those chunks that are still too big : ! 7. Find the offending files ! make -n -f Makefile.nl ! 8. Link them into nl.more ! 9. Increase the value of START in deeper.nl so you don't overwrite ! files from the previous pass. ! set START=240 ! 10. Rerun the deeper.nl script ! ! 99. Rebuild the index of the map directory ! buildus -d .. -m maps.nl ! ! == Overview of Map Utilities == RoadMap comes with a small set of utility programs and scripts which |
From: Danny B. <dan...@us...> - 2010-12-01 19:56:29
|
Update of /cvsroot/roadmap/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv22171 Modified Files: README Log Message: Perform the documentation change about building OSM based maps for larger countries (using splitter) as recently announced. Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.167 retrieving revision 1.168 diff -C2 -d -r1.167 -r1.168 *** README 8 Apr 2009 10:13:50 -0000 1.167 --- README 1 Dec 2010 19:56:21 -0000 1.168 *************** *** 1,6 **** RoadMap User Manual and README ! February 2009 = Introduction = --- 1,7 ---- RoadMap User Manual and README ! November 2010 + [icons/roadmap.png] = Introduction = *************** *** 112,115 **** --- 113,118 ---- @@ runtime-help-link Configuration %!include: Configuration + @@ runtime-help-link Maps + %!include: Maps @@ runtime-help-link OpenStreetMap %!include: OpenStreetMap |
From: Danny B. <dan...@us...> - 2010-11-25 16:53:56
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11247 Modified Files: buildus_main.c Log Message: Deal with comma separated path. Index: buildus_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildus_main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** buildus_main.c 5 Apr 2009 10:56:37 -0000 1.16 --- buildus_main.c 25 Nov 2010 16:53:48 -0000 1.17 *************** *** 3,7 **** * * Copyright 2002 Pascal F. Martin ! * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. --- 3,7 ---- * * Copyright 2002 Pascal F. Martin ! * Copyright (c) 2008, 2009, 2010, Danny Backx. * * This file is part of RoadMap. *************** *** 80,83 **** --- 80,86 ---- /** * @brief + * + * We can get away with overwriting BuildMapResult (removal of the comma) because + * this always happens after scanning all the map directories. */ static void buildus_save (void) { *************** *** 86,90 **** if (buildmap_db_open (BuildMapResult, "usdir.rdm") < 0) { ! buildmap_fatal (0, "cannot create database '%s'", BuildMapResult); } --- 89,101 ---- if (buildmap_db_open (BuildMapResult, "usdir.rdm") < 0) { ! char *comma = strchr(BuildMapResult, ','); ! if (comma) { ! *comma = '\0'; ! if (buildmap_db_open (BuildMapResult, "usdir.rdm") < 0) { ! buildmap_fatal (0, "cannot create database '%s'", BuildMapResult); ! } ! /* *comma = ','; Don't restore, see comment above */ ! } else ! buildmap_fatal (0, "cannot create database '%s'", BuildMapResult); } *************** *** 113,117 **** cities = roadmap_dictionary_open ("city"); ! if (! cities) return; /* May not exist is all map files. */ us_cities = buildmap_dictionary_open ("city"); --- 124,128 ---- cities = roadmap_dictionary_open ("city"); ! if (! cities) return; /* May not exist in all map files. */ us_cities = buildmap_dictionary_open ("city"); |
From: Danny B. <dan...@us...> - 2010-11-24 20:43:59
|
Update of /cvsroot/roadmap/roadmap/src/splitter/nl.more In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1589/splitter/nl.more Added Files: deeper.nl Log Message: Add sample files --- NEW FILE: deeper.nl --- #!/bin/csh set COUNTRY="nl" set P=.. set MAPS="maps".$COUNTRY set MAKEFILE=Makefile.$COUNTRY set SPLITTER=../splitter-r161/splitter.jar set MAXNODES=10000 # set START=280 set DIVIDE=2 # if (! -d $MAPS) then mkdir $MAPS endif # set LIST=`ls iso-$COUNTRY-*.osm` set INDEX=$START # foreach osm ($LIST) set num=`echo $osm | awk -F- '{print $3;}' | awk -F. '{print $1;}'` set AREA=areas.list.$COUNTRY.$num set LINE=`cat ../areas.list.$COUNTRY* | grep 0000$num":"` echo "num {" $num "} LINE {" $LINE "}" set c1=`echo $LINE | awk '{print $2;}'` set c2=`echo $LINE | awk '{print $4;}'` set x1=`echo $c1 | awk -F, '{print $1;}'` set y1=`echo $c1 | awk -F, '{print $2;}'` set x2=`echo $c2 | awk -F, '{print $1;}'` set y2=`echo $c2 | awk -F, '{print $2;}'` # # Simplified, assume DIVIDE=2 # set xm = `expr \( $x1 + $x2 \) / 2` set ym = `expr \( $y1 + $y2 \) / 2` echo 00000$INDEX":" $x1,$y1 to $xm,$ym >>$AREA echo " " >>$AREA set INDEX=`expr $INDEX + 1` echo 00000$INDEX":" $x1,$ym to $xm,$y2 >>$AREA echo " " >>$AREA set INDEX=`expr $INDEX + 1` echo 00000$INDEX":" $xm,$y1 to $x2,$ym >>$AREA echo " " >>$AREA set INDEX=`expr $INDEX + 1` echo 00000$INDEX":" $xm,$ym to $x2,$y2 >>$AREA echo " " >>$AREA set INDEX=`expr $INDEX + 1` java -Xmx2048M -jar $SPLITTER --split-file=$AREA $osm end # rm template.args # echo ".SUFFIXES= .osm .rdm .gz" >$MAKEFILE echo "" >>$MAKEFILE echo "SHELL=/bin/sh" >>$MAKEFILE echo "P="$P >>$MAKEFILE echo "" >>$MAKEFILE echo "all::" >>$MAKEFILE echo "" >>$MAKEFILE # set ALL="" foreach i (`seq -w 0 999`) if (-r 00000$i.osm.gz) then mv 00000$i.osm.gz iso-$COUNTRY-$i.osm.gz echo "" >>$MAKEFILE echo "$MAPS/iso-$COUNTRY-$i.rdm: iso-$COUNTRY-$i.osm" >>$MAKEFILE echo " $P/buildmap_osm -c ../../default/All -m $MAPS -i iso-$COUNTRY-$i.osm -o iso-$COUNTRY-$i.rdm 2>&1 >bm-$COUNTRY-$i.out" >>$MAKEFILE echo "" >>$MAKEFILE echo "iso-$COUNTRY-$i.osm: iso-$COUNTRY-$i.osm.gz" >>$MAKEFILE echo " gunzip <iso-$COUNTRY-$i.osm.gz >iso-$COUNTRY-$i.osm" >>$MAKEFILE set ALL="$ALL $MAPS/iso-$COUNTRY-$i.rdm" endif end echo "" >>$MAKEFILE echo "all:: $ALL" >>$MAKEFILE # make -j10 -k -f $MAKEFILE # exit 0 |
From: Danny B. <dan...@us...> - 2010-11-24 20:43:59
|
Update of /cvsroot/roadmap/roadmap/src/splitter In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1589/splitter Added Files: doit.england doit.nl doit.scotland doit.wales Log Message: Add sample files --- NEW FILE: doit.wales --- #!/bin/csh set COUNTRY="gb" set OSMFILE="wales-2010.10.20.osm" set P=.. set MAPS="maps".$COUNTRY set MAKEFILE=Makefile.$COUNTRY set SPLITTER=splitter-r123/splitter.jar # rm -f iso-$COUNTRY*.osm iso-$COUNTRY*.osm.gz $MAKEFILE bm-$COUNTRY-*.out areas.list.$COUNTRY # if (! -r $OSMFILE) then if (-r $OSMFILE.bz2) then bunzip2 <$OSMFILE.bz2 >$OSMFILE else echo "$OSMFILE doesn't exist" exit 1 endif endif # if (! -d $MAPS) then mkdir $MAPS endif # java -jar $SPLITTER --mapid=801 --max-nodes=10000 $OSMFILE mv areas.list areas.list.$COUNTRY rm template.args # echo ".SUFFIXES= .osm .rdm .gz" >$MAKEFILE echo "" >>$MAKEFILE echo "SHELL=/bin/sh" >>$MAKEFILE echo "P="$P >>$MAKEFILE echo "" >>$MAKEFILE echo "all::" >>$MAKEFILE echo "" >>$MAKEFILE # set ALL="" foreach i (`seq -w 0 999`) if (-r 00000$i.osm.gz) then mv 00000$i.osm.gz iso-$COUNTRY-$i.osm.gz echo "" >>$MAKEFILE echo "$MAPS/iso-$COUNTRY-$i.rdm: iso-$COUNTRY-$i.osm" >>$MAKEFILE echo " $P/buildmap_osm -c ../default/All -m $MAPS -i iso-$COUNTRY-$i.osm -o iso-$COUNTRY-$i.rdm 2>&1 >bm-$COUNTRY-$i.out" >>$MAKEFILE echo "" >>$MAKEFILE echo "iso-$COUNTRY-$i.osm: iso-$COUNTRY-$i.osm.gz" >>$MAKEFILE echo " gunzip <iso-$COUNTRY-$i.osm.gz >iso-$COUNTRY-$i.osm" >>$MAKEFILE set ALL="$ALL $MAPS/iso-$COUNTRY-$i.rdm" endif end echo "" >>$MAKEFILE echo "all:: $ALL" >>$MAKEFILE # make -j10 -k -f $MAKEFILE # $P/buildus -d .. -m $MAPS # exit 0 --- NEW FILE: doit.nl --- #!/bin/csh set COUNTRY="nl" set OSMFILE="netherlands-2010.11.13.osm" set P=.. set MAPS="maps".$COUNTRY set MAKEFILE=Makefile.$COUNTRY set SPLITTER=splitter-r123/splitter.jar set SPLITTER=splitter-r161/splitter.jar set MAXNODES=10000 # # rm -f iso-$COUNTRY*.osm iso-$COUNTRY*.osm.gz $MAPS/iso-$COUNTRY-*.rdm $MAKEFILE bm-$COUNTRY-*.out areas.list.$COUNTRY # if (! -r $OSMFILE) then if (-r $OSMFILE.bz2) then bunzip2 <$OSMFILE.bz2 >$OSMFILE else echo "$OSMFILE doesn't exist" exit 1 endif endif # if (! -d $MAPS) then mkdir $MAPS endif # java -Xmx2048M -jar $SPLITTER --mapid=001 --max-nodes=30000 --resolution=12 $OSMFILE # mv areas.list areas.list.$COUNTRY mv template.args template.args.$COUNTRY # echo ".SUFFIXES= .osm .rdm .gz" >$MAKEFILE echo "" >>$MAKEFILE echo "SHELL=/bin/sh" >>$MAKEFILE echo "P="$P >>$MAKEFILE echo "" >>$MAKEFILE echo "all::" >>$MAKEFILE echo "" >>$MAKEFILE # set ALL="" foreach i (`seq -w 0 999`) if (-r 00000$i.osm.gz) then mv 00000$i.osm.gz iso-$COUNTRY-$i.osm.gz echo "" >>$MAKEFILE echo "$MAPS/iso-$COUNTRY-$i.rdm: iso-$COUNTRY-$i.osm" >>$MAKEFILE echo " $P/buildmap_osm -c ../default/All -m $MAPS -i iso-$COUNTRY-$i.osm -o iso-$COUNTRY-$i.rdm 2>&1 >bm-$COUNTRY-$i.out" >>$MAKEFILE echo "" >>$MAKEFILE echo "iso-$COUNTRY-$i.osm: iso-$COUNTRY-$i.osm.gz" >>$MAKEFILE echo " gunzip <iso-$COUNTRY-$i.osm.gz >iso-$COUNTRY-$i.osm" >>$MAKEFILE set ALL="$ALL $MAPS/iso-$COUNTRY-$i.rdm" endif end echo "" >>$MAKEFILE echo "all:: $ALL" >>$MAKEFILE # make -j10 -k -f $MAKEFILE # $P/buildus -d .. -m $MAPS # exit 0 --- NEW FILE: doit.scotland --- #!/bin/csh set COUNTRY="gb" set OSMFILE="scotland-2010.10.20.osm" set P=.. set MAPS="maps".$COUNTRY set MAKEFILE=Makefile.$COUNTRY set SPLITTER=splitter-r123/splitter.jar # rm -f iso-$COUNTRY*.osm iso-$COUNTRY*.osm.gz $MAKEFILE bm-$COUNTRY-*.out areas.list.$COUNTRY # if (! -r $OSMFILE) then if (-r $OSMFILE.bz2) then bunzip2 <$OSMFILE.bz2 >$OSMFILE else echo "$OSMFILE doesn't exist" exit 1 endif endif # if (! -d $MAPS) then mkdir $MAPS endif # java -jar $SPLITTER --mapid=501 --max-nodes=10000 $OSMFILE mv areas.list areas.list.$COUNTRY rm template.args # echo ".SUFFIXES= .osm .rdm .gz" >$MAKEFILE echo "" >>$MAKEFILE echo "SHELL=/bin/sh" >>$MAKEFILE echo "P="$P >>$MAKEFILE echo "" >>$MAKEFILE echo "all::" >>$MAKEFILE echo "" >>$MAKEFILE # set ALL="" foreach i (`seq -w 0 999`) if (-r 00000$i.osm.gz) then mv 00000$i.osm.gz iso-$COUNTRY-$i.osm.gz echo "" >>$MAKEFILE echo "$MAPS/iso-$COUNTRY-$i.rdm: iso-$COUNTRY-$i.osm" >>$MAKEFILE echo " $P/buildmap_osm -c ../default/All -m $MAPS -i iso-$COUNTRY-$i.osm -o iso-$COUNTRY-$i.rdm 2>&1 >bm-$COUNTRY-$i.out" >>$MAKEFILE echo "" >>$MAKEFILE echo "iso-$COUNTRY-$i.osm: iso-$COUNTRY-$i.osm.gz" >>$MAKEFILE echo " gunzip <iso-$COUNTRY-$i.osm.gz >iso-$COUNTRY-$i.osm" >>$MAKEFILE set ALL="$ALL $MAPS/iso-$COUNTRY-$i.rdm" endif end echo "" >>$MAKEFILE echo "all:: $ALL" >>$MAKEFILE # make -j10 -k -f $MAKEFILE # $P/buildus -d .. -m $MAPS # exit 0 --- NEW FILE: doit.england --- #!/bin/csh set COUNTRY="gb" set OSMFILE="england-2010.10.20.osm" set P=.. set MAPS="maps".$COUNTRY set MAKEFILE=Makefile.$COUNTRY set SPLITTER=splitter-r123/splitter.jar # rm -f iso-$COUNTRY*.osm iso-$COUNTRY*.osm.gz $MAKEFILE bm-$COUNTRY-*.out areas.list.$COUNTRY # if (! -r $OSMFILE) then if (-r $OSMFILE.bz2) then bunzip2 <$OSMFILE.bz2 >$OSMFILE else echo "$OSMFILE doesn't exist" exit 1 endif endif # if (! -d $MAPS) then mkdir $MAPS endif # java -jar $SPLITTER --mapid=001 --max-nodes=50000 $OSMFILE mv areas.list areas.list.$COUNTRY rm template.args # echo ".SUFFIXES= .osm .rdm .gz" >$MAKEFILE echo "" >>$MAKEFILE echo "SHELL=/bin/sh" >>$MAKEFILE echo "P="$P >>$MAKEFILE echo "" >>$MAKEFILE echo "all::" >>$MAKEFILE echo "" >>$MAKEFILE # set ALL="" foreach i (`seq -w 0 999`) if (-r 00000$i.osm.gz) then mv 00000$i.osm.gz iso-$COUNTRY-$i.osm.gz echo "" >>$MAKEFILE echo "$MAPS/iso-$COUNTRY-$i.rdm: iso-$COUNTRY-$i.osm" >>$MAKEFILE echo " $P/buildmap_osm -c ../default/All -m $MAPS -i iso-$COUNTRY-$i.osm -o iso-$COUNTRY-$i.rdm 2>&1 >bm-$COUNTRY-$i.out" >>$MAKEFILE echo "" >>$MAKEFILE echo "iso-$COUNTRY-$i.osm: iso-$COUNTRY-$i.osm.gz" >>$MAKEFILE echo " gunzip <iso-$COUNTRY-$i.osm.gz >iso-$COUNTRY-$i.osm" >>$MAKEFILE set ALL="$ALL $MAPS/iso-$COUNTRY-$i.rdm" endif end echo "" >>$MAKEFILE echo "all:: $ALL" >>$MAKEFILE # make -j10 -k -f $MAKEFILE # $P/buildus -d .. -m $MAPS # exit 0 |
From: Danny B. <dan...@us...> - 2010-11-24 20:43:20
|
Update of /cvsroot/roadmap/roadmap/src/splitter/nl.more In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1369/nl.more Log Message: Directory /cvsroot/roadmap/roadmap/src/splitter/nl.more added to the repository |
From: Danny B. <dan...@us...> - 2010-11-24 20:42:59
|
Update of /cvsroot/roadmap/roadmap/src/splitter In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1181/splitter Log Message: Directory /cvsroot/roadmap/roadmap/src/splitter added to the repository |
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv29535 Modified Files: buildmap_index.c buildmap_main.c buildmap_metadata.c buildmap_place.c buildmap_point.c buildmap_range.c buildmap_shape.c buildmap_square.c buildmap_street.c buildmap_zip.c buildmap_line.c buildmap_messages.c buildmap_dictionary.c buildmap_polygon.c buildmap_osm_main.c buildmap_dbwrite.c buildmap.h Log Message: Implement better error handling, remove the file being written into if an error occurred. Index: buildmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_main.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** buildmap_main.c 29 Mar 2009 11:53:19 -0000 1.20 --- buildmap_main.c 17 Nov 2010 00:05:28 -0000 1.21 *************** *** 167,173 **** ! static void buildmap_county_save (const char *name) { char db_name[128]; snprintf (db_name, 127, "usc%s.rdm", name); --- 167,174 ---- ! static int buildmap_county_save (const char *name) { char db_name[128]; + int r; snprintf (db_name, 127, "usc%s.rdm", name); *************** *** 178,184 **** } ! buildmap_db_save (); ! buildmap_db_close (); } --- 179,186 ---- } ! r = buildmap_db_save (); buildmap_db_close (); + + return r; } *************** *** 232,236 **** } ! buildmap_county_save (county); buildmap_db_reset (); roadmap_hash_reset (); --- 234,240 ---- } ! if (buildmap_county_save (county) != 0) { ! buildmap_fatal (0, "Map generation failed"); ! } buildmap_db_reset (); roadmap_hash_reset (); Index: buildmap_dictionary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_dictionary.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_dictionary.c 2 Dec 2007 00:29:17 -0000 1.7 --- buildmap_dictionary.c 17 Nov 2010 00:05:28 -0000 1.8 *************** *** 443,447 **** ! static void buildmap_dictionary_save_one (struct dictionary_volume *dictionary, buildmap_db *parent) { --- 443,447 ---- ! static int buildmap_dictionary_save_one (struct dictionary_volume *dictionary, buildmap_db *parent) { *************** *** 472,476 **** child = buildmap_db_add_section (parent, dictionary->name); if (child == NULL) { ! buildmap_fatal (0, "Cannot add new section %s", dictionary->name); } --- 472,477 ---- child = buildmap_db_add_section (parent, dictionary->name); if (child == NULL) { ! buildmap_error (0, "Cannot add new section %s", dictionary->name); ! return 1; } *************** *** 508,511 **** --- 509,514 ---- dictionary->string_count * sizeof(unsigned int)); memcpy (db_data, dictionary->data, dictionary->cursor); + + return 0; } *************** *** 810,814 **** ! static void buildmap_dictionary_save (void) { int i; --- 813,817 ---- ! static int buildmap_dictionary_save (void) { int i; *************** *** 816,820 **** buildmap_db *names = buildmap_db_add_section (NULL, "string"); ! if (names == NULL) buildmap_fatal (0, "Cannot add new section 'string'"); buildmap_info ("saving dictionary..."); --- 819,826 ---- buildmap_db *names = buildmap_db_add_section (NULL, "string"); ! if (names == NULL) { ! buildmap_error (0, "Cannot add new section 'string'"); ! return 1; ! } buildmap_info ("saving dictionary..."); *************** *** 823,829 **** if (DictionaryVolume[i]->name[0] != '.') { ! buildmap_dictionary_save_one (DictionaryVolume[i], names); } } } --- 829,837 ---- if (DictionaryVolume[i]->name[0] != '.') { ! if (buildmap_dictionary_save_one (DictionaryVolume[i], names) != 0) ! return 1; } } + return 0; } Index: buildmap_zip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_zip.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** buildmap_zip.c 17 Jan 2006 06:41:15 -0000 1.6 --- buildmap_zip.c 17 Nov 2010 00:05:28 -0000 1.7 *************** *** 175,179 **** ! static void buildmap_zip_save (void) { int i; --- 175,179 ---- ! static int buildmap_zip_save (void) { int i; *************** *** 181,185 **** buildmap_db *root = buildmap_db_add_section (NULL, "zip"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (root, ZipCodeCount, sizeof(int)); --- 181,188 ---- buildmap_db *root = buildmap_db_add_section (NULL, "zip"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (root, ZipCodeCount, sizeof(int)); *************** *** 189,192 **** --- 192,197 ---- db_zip[i] = ZipCode[i].zip_code; } + + return 0; } Index: buildmap_metadata.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_metadata.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** buildmap_metadata.c 3 Dec 2007 18:33:28 -0000 1.5 --- buildmap_metadata.c 17 Nov 2010 00:05:28 -0000 1.6 *************** *** 205,209 **** ! static void buildmap_metadata_save (void) { int i; --- 205,209 ---- ! static int buildmap_metadata_save (void) { int i; *************** *** 260,263 **** --- 260,265 ---- } } + + return 0; } Index: buildmap_range.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_range.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** buildmap_range.c 28 Dec 2008 18:27:13 -0000 1.17 --- buildmap_range.c 17 Nov 2010 00:05:28 -0000 1.18 *************** *** 547,551 **** * @brief */ ! static void buildmap_range_save (void) { int i; --- 547,551 ---- * @brief */ ! static int buildmap_range_save (void) { int i; *************** *** 615,619 **** square_info = calloc (square_count, sizeof(*square_info)); if (square_info == NULL) { ! buildmap_fatal (0, "no more memory"); } --- 615,620 ---- square_info = calloc (square_count, sizeof(*square_info)); if (square_info == NULL) { ! buildmap_error (0, "no more memory"); ! return 1; } *************** *** 739,774 **** root = buildmap_db_add_section (NULL, "range"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); table_street = buildmap_db_add_section (root, "bystreet"); ! if (table_street == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_street, buildmap_street_count(), sizeof(RoadMapRangeByStreet)); table_city = buildmap_db_add_section (root, "bycity"); ! if (table_city == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_city, city_count, sizeof(RoadMapRangeByCity)); table_place = buildmap_db_add_section (root, "place"); ! if (table_place == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_place, RangePlaceCount, sizeof(RoadMapRangePlace)); table_zip = buildmap_db_add_section (root, "byzip"); ! if (table_zip == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_zip, zip_count, sizeof(RoadMapRangeByZip)); table_addr = buildmap_db_add_section (root, "addr"); ! if (table_addr == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_addr, RangeCount, sizeof(RoadMapRange)); table_noaddr = buildmap_db_add_section (root, "noaddr"); ! if (table_noaddr == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_noaddr, RangeNoAddressCount, sizeof(RoadMapRangeNoAddress)); table_square = buildmap_db_add_section (root, "bysquare"); ! if (table_square == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_square, square_count, sizeof(RoadMapRangeBySquare)); --- 740,799 ---- root = buildmap_db_add_section (NULL, "range"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } table_street = buildmap_db_add_section (root, "bystreet"); ! if (table_street == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_street, buildmap_street_count(), sizeof(RoadMapRangeByStreet)); table_city = buildmap_db_add_section (root, "bycity"); ! if (table_city == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_city, city_count, sizeof(RoadMapRangeByCity)); table_place = buildmap_db_add_section (root, "place"); ! if (table_place == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_place, RangePlaceCount, sizeof(RoadMapRangePlace)); table_zip = buildmap_db_add_section (root, "byzip"); ! if (table_zip == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_zip, zip_count, sizeof(RoadMapRangeByZip)); table_addr = buildmap_db_add_section (root, "addr"); ! if (table_addr == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_addr, RangeCount, sizeof(RoadMapRange)); table_noaddr = buildmap_db_add_section (root, "noaddr"); ! if (table_noaddr == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_noaddr, RangeNoAddressCount, sizeof(RoadMapRangeNoAddress)); table_square = buildmap_db_add_section (root, "bysquare"); ! if (table_square == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_square, square_count, sizeof(RoadMapRangeBySquare)); *************** *** 807,811 **** if (street_index > this_range->street) { ! buildmap_fatal (0, "inconsistent range order"); } --- 832,837 ---- if (street_index > this_range->street) { ! buildmap_error (0, "inconsistent range order"); ! return 1; } *************** *** 838,845 **** if (i - first_range_in_city < 0) { ! buildmap_fatal (0, "negative count"); } if (i - first_range_in_city >= 0x10000) { ! buildmap_fatal (0, "too many street in a single city"); } } --- 864,873 ---- if (i - first_range_in_city < 0) { ! buildmap_error (0, "negative count"); ! return 1; } if (i - first_range_in_city >= 0x10000) { ! buildmap_error (0, "too many street in a single city"); ! return 1; } } *************** *** 882,893 **** if (i - first_range_in_city < 0) { ! buildmap_fatal (0, "negative count"); } if (i - first_range_in_city >= 0x10000) { ! buildmap_fatal (0, "too many street in a single city"); } if (street_index >= buildmap_street_count()) { ! buildmap_fatal (0, "out of bound street"); } --- 910,924 ---- if (i - first_range_in_city < 0) { ! buildmap_error (0, "negative count"); ! return 1; } if (i - first_range_in_city >= 0x10000) { ! buildmap_error (0, "too many street in a single city"); ! return 1; } if (street_index >= buildmap_street_count()) { ! buildmap_error (0, "out of bound street"); ! return 1; } *************** *** 963,967 **** if (k >= square_count) { ! buildmap_fatal (0, "invalid square index %d", k); } --- 994,999 ---- if (k >= square_count) { ! buildmap_error (0, "invalid square index %d", k); ! return 1; } *************** *** 969,973 **** if (k < square_current) { ! buildmap_fatal (0, "no-address line out of order (square)"); } db_square[k].noaddr_start = i; --- 1001,1006 ---- if (k < square_current) { ! buildmap_error (0, "no-address line out of order (square)"); ! return 1; } db_square[k].noaddr_start = i; *************** *** 981,984 **** --- 1014,1018 ---- free(square_info); + return 0; } Index: buildmap.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** buildmap.h 12 May 2009 13:53:32 -0000 1.8 --- buildmap.h 17 Nov 2010 00:05:28 -0000 1.9 *************** *** 83,86 **** --- 83,87 ---- typedef void (*buildmap_db_action) (void); + typedef int (*buildmap_db_return_action) (void); typedef struct { *************** *** 88,92 **** const char *name; buildmap_db_action sort; ! buildmap_db_action save; buildmap_db_action summary; buildmap_db_action reset; --- 89,93 ---- const char *name; buildmap_db_action sort; ! buildmap_db_return_action save; buildmap_db_action summary; buildmap_db_action reset; *************** *** 96,99 **** --- 97,101 ---- int buildmap_db_open (const char *path, const char *name); + int buildmap_db_remove (const char *path, const char *name); void buildmap_db_register (const buildmap_db_module *module); *************** *** 110,114 **** /* The functions that call the registered actions: */ void buildmap_db_sort (void); ! void buildmap_db_save (void); void buildmap_db_summary (void); void buildmap_db_reset (void); --- 112,116 ---- /* The functions that call the registered actions: */ void buildmap_db_sort (void); ! int buildmap_db_save (void); void buildmap_db_summary (void); void buildmap_db_reset (void); Index: buildmap_place.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_place.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_place.c 12 May 2009 13:53:32 -0000 1.7 --- buildmap_place.c 17 Nov 2010 00:05:28 -0000 1.8 *************** *** 104,108 **** buildmap_fatal (0, "Underdimensioned place table (block %d, BUILDMAP_BLOCK %d)", ! block, BUILDMAP_BLOCK); } --- 104,108 ---- buildmap_fatal (0, "Underdimensioned place table (block %d, BUILDMAP_BLOCK %d)", ! block, BUILDMAP_BLOCK); } *************** *** 369,373 **** * @brief */ ! static void buildmap_place_save (void) { int i; --- 369,373 ---- * @brief */ ! static int buildmap_place_save (void) { int i; *************** *** 414,419 **** if (square < square_current) { ! buildmap_fatal (0, "abnormal square order: %d following %d", square, square_current); } if (square_current >= 0) { --- 414,420 ---- if (square < square_current) { ! buildmap_error (0, "abnormal square order: %d following %d", square, square_current); + return 1; } if (square_current >= 0) { *************** *** 426,431 **** if (one_place->layer < layer_current) { ! buildmap_fatal (0, "abnormal layer order: %d following %d", one_place->layer, layer_current); } layer_current = one_place->layer; --- 427,433 ---- if (one_place->layer < layer_current) { ! buildmap_error (0, "abnormal layer order: %d following %d", one_place->layer, layer_current); + return 1; } layer_current = one_place->layer; *************** *** 441,457 **** root = buildmap_db_add_section (NULL, "place"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); data_table = buildmap_db_add_section (root, "data"); ! if (data_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (data_table, PlaceCount, sizeof(int)); square_table = buildmap_db_add_section (root, "bysquare"); ! if (square_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (square_table, square_count, sizeof(RoadMapPlaceBySquare)); layer_table = buildmap_db_add_section (root, "bylayer"); ! if (layer_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (layer_table, layer_count, sizeof(int)); --- 443,471 ---- root = buildmap_db_add_section (NULL, "place"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } data_table = buildmap_db_add_section (root, "data"); ! if (data_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (data_table, PlaceCount, sizeof(int)); square_table = buildmap_db_add_section (root, "bysquare"); ! if (square_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (square_table, square_count, sizeof(RoadMapPlaceBySquare)); layer_table = buildmap_db_add_section (root, "bylayer"); ! if (layer_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (layer_table, layer_count, sizeof(int)); *************** *** 488,492 **** layer_sublist += layer_current; if (layer_sublist >= layer_count) { ! buildmap_fatal (0, "invalid place/bylayer count"); } } --- 502,507 ---- layer_sublist += layer_current; if (layer_sublist >= layer_count) { ! buildmap_error (0, "invalid place/bylayer count"); ! return 1; } } *************** *** 512,518 **** if (layer_sublist+square_current+1 != layer_count) { ! buildmap_fatal (0, "invalid place/bylayer count"); } } } --- 527,536 ---- if (layer_sublist+square_current+1 != layer_count) { ! buildmap_error (0, "invalid place/bylayer count"); ! return 1; } } + + return 0; } Index: buildmap_shape.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_shape.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** buildmap_shape.c 12 May 2009 13:53:32 -0000 1.14 --- buildmap_shape.c 17 Nov 2010 00:05:28 -0000 1.15 *************** *** 256,260 **** * @brief */ ! static void buildmap_shape_save (void) { int i; --- 256,260 ---- * @brief */ ! static int buildmap_shape_save (void) { int i; *************** *** 366,383 **** root = buildmap_db_add_section (NULL, "shape"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); table_square = buildmap_db_add_section (root, "bysquare"); ! if (table_square == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_square, square_count, sizeof(RoadMapShapeBySquare)); table_line = buildmap_db_add_section (root, "byline"); ! if (table_line == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_line, ShapeLineCount, sizeof(RoadMapShapeByLine)); table_data = buildmap_db_add_section (root, "data"); ! if (table_data == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_data, shape_count, sizeof(RoadMapShape)); --- 366,395 ---- root = buildmap_db_add_section (NULL, "shape"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } table_square = buildmap_db_add_section (root, "bysquare"); ! if (table_square == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_square, square_count, sizeof(RoadMapShapeBySquare)); table_line = buildmap_db_add_section (root, "byline"); ! if (table_line == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_line, ShapeLineCount, sizeof(RoadMapShapeByLine)); table_data = buildmap_db_add_section (root, "data"); ! if (table_data == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_data, shape_count, sizeof(RoadMapShape)); *************** *** 398,402 **** if (last_line > one_shape->line) { ! buildmap_fatal (0, "decreasing line order in shape table"); } --- 410,415 ---- if (last_line > one_shape->line) { ! buildmap_error (0, "decreasing line order in shape table"); ! return 1; } *************** *** 417,421 **** if (square < last_square) { ! buildmap_fatal (0, "decreasing square order in shape table"); } while (last_square < square) { --- 430,435 ---- if (square < last_square) { ! buildmap_error (0, "decreasing square order in shape table"); ! return 1; } while (last_square < square) { *************** *** 495,507 **** if (shape_index != shape_count) { ! buildmap_fatal (0, "inconsistent count of shapes: " "total = %d, saved = %d", shape_count, shape_index+1); } if (last_square >= square_count) { ! buildmap_fatal (0, "inconsistent count of squares: " "total = %d, saved = %d", square_count, last_square+1); } --- 509,523 ---- if (shape_index != shape_count) { ! buildmap_error (0, "inconsistent count of shapes: " "total = %d, saved = %d", shape_count, shape_index+1); + return 1; } if (last_square >= square_count) { ! buildmap_error (0, "inconsistent count of squares: " "total = %d, saved = %d", square_count, last_square+1); + return 1; } *************** *** 512,519 **** if (line_index+1 != ShapeLineCount) { ! buildmap_fatal (0, "inconsistent count of lines: " "total = %d, saved = %d", ShapeLineCount, line_index+1); } } --- 528,538 ---- if (line_index+1 != ShapeLineCount) { ! buildmap_error (0, "inconsistent count of lines: " "total = %d, saved = %d", ShapeLineCount, line_index+1); + return 1; } + + return 0; } Index: buildmap_index.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_index.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** buildmap_index.c 27 Nov 2007 13:44:06 -0000 1.5 --- buildmap_index.c 17 Nov 2010 00:05:28 -0000 1.6 *************** *** 670,674 **** ! static void buildmap_index_save (void) { int i; --- 670,674 ---- ! static int buildmap_index_save (void) { int i; *************** *** 749,753 **** for (i = 0; i < this_authority->name_count; ++i) { if (name_cursor >= NameCount) { ! buildmap_fatal (0, "invalid map count"); } db_name[name_cursor++] = this_authority->names[i]; --- 749,754 ---- for (i = 0; i < this_authority->name_count; ++i) { if (name_cursor >= NameCount) { ! buildmap_error (0, "invalid map count"); ! return 1; } db_name[name_cursor++] = this_authority->names[i]; *************** *** 763,767 **** if (territory_cursor >= TerritoryCount) { ! buildmap_fatal (0, "invalid territory count"); } one_territory = db_territory + territory_cursor; --- 764,769 ---- if (territory_cursor >= TerritoryCount) { ! buildmap_error (0, "invalid territory count"); ! return 1; } one_territory = db_territory + territory_cursor; *************** *** 780,784 **** if (map_cursor >= MapCount) { ! buildmap_fatal (0, "invalid map count"); } db_map[map_cursor].class = this_map->class; --- 782,787 ---- if (map_cursor >= MapCount) { ! buildmap_error (0, "invalid map count"); ! return 1; } db_map[map_cursor].class = this_map->class; *************** *** 794,798 **** if (city_cursor >= CityCount) { ! buildmap_fatal (0, "invalid city count"); } db_city[city_cursor++] = this_city->name; --- 797,802 ---- if (city_cursor >= CityCount) { ! buildmap_error (0, "invalid city count"); ! return 1; } db_city[city_cursor++] = this_city->name; *************** *** 808,811 **** --- 812,817 ---- territory_cursor - one_authority->territory_first; } + + return 0; } Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** buildmap_line.c 7 Jul 2009 01:52:31 -0000 1.27 --- buildmap_line.c 17 Nov 2010 00:05:28 -0000 1.28 *************** *** 630,635 **** /** * @brief a collection of actions for everything all tables in the "line" database */ ! static void buildmap_line_save (void) { int i; --- 630,636 ---- /** * @brief a collection of actions for everything all tables in the "line" database + * @return 0 if success, other values for failure */ ! static int buildmap_line_save (void) { int i; *************** *** 670,675 **** buildmap_db *line_bypoint1_table, *line_bypoint2_table; ! if (!LineCount) ! return; buildmap_info ("saving %d lines...", LineCount); --- 671,678 ---- buildmap_db *line_bypoint1_table, *line_bypoint2_table; ! if (!LineCount) { ! buildmap_error (0, "LineCount is 0"); ! return 1; ! } buildmap_info ("saving %d lines...", LineCount); *************** *** 697,702 **** if (square < square_current) { ! buildmap_fatal (0, "abnormal square order: %d following %d", square, square_current); } if (square_current >= 0) { --- 700,706 ---- if (square < square_current) { ! buildmap_error (0, "abnormal square order: %d following %d", square, square_current); + return 1; } if (square_current >= 0) { *************** *** 705,709 **** */ if (layer_current <= 0) { ! buildmap_fatal (0, "empty square %d has lines?", square); } layer1_count += (layer_current + 1); /* 1 slot for the end line. */ --- 709,714 ---- */ if (layer_current <= 0) { ! buildmap_error (0, "empty square %d has lines?", square); ! return 1; } layer1_count += (layer_current + 1); /* 1 slot for the end line. */ *************** *** 715,720 **** if (one_line->layer < layer_current) { ! buildmap_fatal (0, "abnormal layer order: %d following %d", one_line->layer, layer_current); } --- 720,726 ---- if (one_line->layer < layer_current) { ! buildmap_error (0, "abnormal layer order: %d following %d", one_line->layer, layer_current); + return 1; } *************** *** 743,747 **** if (square == one_line->square_from) { ! buildmap_fatal (0, "non crossing line in the crossing line table"); } --- 749,754 ---- if (square == one_line->square_from) { ! buildmap_error (0, "non crossing line in the crossing line table"); ! return 1; } *************** *** 749,754 **** if (square < square_current) { ! buildmap_fatal (0, "abnormal square order: d following %d", square, square_current); } if (square_current >= 0) { --- 756,762 ---- if (square < square_current) { ! buildmap_error (0, "abnormal square order: d following %d", square, square_current); + return 1; } if (square_current >= 0) { *************** *** 767,772 **** if (one_line->layer < layer_current) { ! buildmap_fatal (0, "abnormal layer order: %d following %d", one_line->layer, layer_current); } layer_current = one_line->layer; --- 775,781 ---- if (one_line->layer < layer_current) { ! buildmap_error (0, "abnormal layer order: %d following %d", one_line->layer, layer_current); + return 1; } layer_current = one_line->layer; *************** *** 777,781 **** /* Lets compute how much space is needed for the last square. */ if (layer_current < 0) { ! buildmap_fatal (0, "empty square %d has lines?", square); } layer2_count += (layer_current + 1); /* 1 slot for the end line. */ --- 786,791 ---- /* Lets compute how much space is needed for the last square. */ if (layer_current < 0) { ! buildmap_error (0, "empty square %d has lines?", square); ! return 1; } layer2_count += (layer_current + 1); /* 1 slot for the end line. */ *************** *** 786,815 **** root = buildmap_db_add_section (NULL, "line"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); data_table = buildmap_db_add_section (root, "data"); ! if (data_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (data_table, LineCount, sizeof(RoadMapLine)); data2_table = buildmap_db_add_section (root, "data2"); ! if (data2_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (data2_table, LineCount, sizeof(RoadMapLine2)); square1_table = buildmap_db_add_section (root, "bysquare1"); ! if (square1_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (square1_table, square_count, sizeof(RoadMapLineBySquare)); layer1_table = buildmap_db_add_section (root, "bylayer1"); ! if (layer1_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (layer1_table, layer1_count, sizeof(int)); square2_table = buildmap_db_add_section (root, "bysquare2"); ! if (square2_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (square2_table, square_count, sizeof(RoadMapLineBySquare)); long_lines_table = buildmap_db_add_section (root, "longlines"); ! if (long_lines_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (long_lines_table, LongLinesCount, sizeof(RoadMapLongLine)); --- 796,846 ---- root = buildmap_db_add_section (NULL, "line"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } data_table = buildmap_db_add_section (root, "data"); ! if (data_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (data_table, LineCount, sizeof(RoadMapLine)); data2_table = buildmap_db_add_section (root, "data2"); ! if (data2_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (data2_table, LineCount, sizeof(RoadMapLine2)); square1_table = buildmap_db_add_section (root, "bysquare1"); ! if (square1_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (square1_table, square_count, sizeof(RoadMapLineBySquare)); layer1_table = buildmap_db_add_section (root, "bylayer1"); ! if (layer1_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (layer1_table, layer1_count, sizeof(int)); square2_table = buildmap_db_add_section (root, "bysquare2"); ! if (square2_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (square2_table, square_count, sizeof(RoadMapLineBySquare)); long_lines_table = buildmap_db_add_section (root, "longlines"); ! if (long_lines_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (long_lines_table, LongLinesCount, sizeof(RoadMapLongLine)); *************** *** 817,834 **** layer2_table = buildmap_db_add_section (root, "bylayer2"); ! if (layer2_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (layer2_table, layer2_count, sizeof(int)); index2_table = buildmap_db_add_section (root, "index2"); ! if (index2_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (index2_table, LineCrossingCount, sizeof(int)); buildmap_line_count_linebypoint(&LineByPoint1Count, &LineByPoint2Count); line_bypoint1_table = buildmap_db_add_section (root, "bypoint1"); ! if (line_bypoint1_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (line_bypoint1_table, LineByPoint1Count, sizeof(int)); line_bypoint2_table = buildmap_db_add_section (root, "bypoint2"); ! if (line_bypoint2_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (line_bypoint2_table, LineByPoint2Count, sizeof(int)); --- 848,877 ---- layer2_table = buildmap_db_add_section (root, "bylayer2"); ! if (layer2_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (layer2_table, layer2_count, sizeof(int)); index2_table = buildmap_db_add_section (root, "index2"); ! if (index2_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (index2_table, LineCrossingCount, sizeof(int)); buildmap_line_count_linebypoint(&LineByPoint1Count, &LineByPoint2Count); line_bypoint1_table = buildmap_db_add_section (root, "bypoint1"); ! if (line_bypoint1_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (line_bypoint1_table, LineByPoint1Count, sizeof(int)); line_bypoint2_table = buildmap_db_add_section (root, "bypoint2"); ! if (line_bypoint2_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (line_bypoint2_table, LineByPoint2Count, sizeof(int)); *************** *** 874,878 **** layer_sublist += (layer_current + 1); if (layer_sublist >= layer1_count) { ! buildmap_fatal (0, "invalid line/bylayer1 count"); } } --- 917,922 ---- layer_sublist += (layer_current + 1); if (layer_sublist >= layer1_count) { ! buildmap_error (0, "invalid line/bylayer1 count"); ! return 1; } } *************** *** 900,904 **** if (layer_sublist+layer_current+1 != layer1_count) { ! buildmap_fatal (0, "invalid line/bylayer1 count"); } } --- 944,949 ---- if (layer_sublist+layer_current+1 != layer1_count) { ! buildmap_error (0, "invalid line/bylayer1 count"); ! return 1; } } *************** *** 935,939 **** layer_sublist += (layer_current + 1); if (layer_sublist >= layer2_count) { ! buildmap_fatal (0, "invalid line/bylayer2 count"); } } --- 980,985 ---- layer_sublist += (layer_current + 1); if (layer_sublist >= layer2_count) { ! buildmap_error (0, "invalid line/bylayer2 count"); ! return 1; } } *************** *** 954,958 **** if (layer_sublist+layer_current+1 != layer2_count) { ! buildmap_fatal (0, "invalid line/bylayer2 count"); } } --- 1000,1005 ---- if (layer_sublist+layer_current+1 != layer2_count) { ! buildmap_error (0, "invalid line/bylayer2 count"); ! return 1; } } *************** *** 961,964 **** --- 1008,1013 ---- buildmap_line_transform_linebypoint(db_line_bypoint1, db_line_bypoint2); + + return 0; } Index: buildmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_street.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buildmap_street.c 12 May 2009 13:53:32 -0000 1.10 --- buildmap_street.c 17 Nov 2010 00:05:28 -0000 1.11 *************** *** 320,324 **** * @brief */ ! static void buildmap_street_save (void) { int i; --- 320,324 ---- * @brief */ ! static int buildmap_street_save (void) { int i; *************** *** 338,349 **** root = buildmap_db_add_section (NULL, "street"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); table_name = buildmap_db_add_section (root, "name"); ! if (table_name == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_name, StreetCount, sizeof(RoadMapStreet)); table_cfcc = buildmap_db_add_section (root, "type"); ! if (table_cfcc == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_cfcc, StreetCount, sizeof(char)); --- 338,358 ---- root = buildmap_db_add_section (NULL, "street"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } table_name = buildmap_db_add_section (root, "name"); ! if (table_name == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_name, StreetCount, sizeof(RoadMapStreet)); table_cfcc = buildmap_db_add_section (root, "type"); ! if (table_cfcc == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_cfcc, StreetCount, sizeof(char)); *************** *** 360,363 **** --- 369,374 ---- db_cfcc[i] = one_street->cfcc; } + + return 0; } Index: buildmap_messages.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_messages.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_messages.c 8 Oct 2008 18:23:57 -0000 1.7 --- buildmap_messages.c 17 Nov 2010 00:05:28 -0000 1.8 *************** *** 56,60 **** BuildMapMessageLevel += level; ! #ifndef _WIN32 if (BuildMapMessageLevel >= BUILDMAP_MESSAGE_VERBOSE) setbuf(stdout, NULL); --- 56,60 ---- BuildMapMessageLevel += level; ! #ifndef _WIN32 if (BuildMapMessageLevel >= BUILDMAP_MESSAGE_VERBOSE) setbuf(stdout, NULL); *************** *** 71,79 **** if (name == NULL) { ! if (SourceFile) ! free(SourceFile); ! SourceFile = NULL; ! return; } /* Get the file's base name (for error display purpose). */ p = strrchr (name, '/'); --- 71,80 ---- if (name == NULL) { ! if (SourceFile) ! free(SourceFile); ! SourceFile = NULL; ! return; } + /* Get the file's base name (for error display purpose). */ p = strrchr (name, '/'); Index: buildmap_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_point.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** buildmap_point.c 12 May 2009 13:53:32 -0000 1.11 --- buildmap_point.c 17 Nov 2010 00:05:28 -0000 1.12 *************** *** 356,360 **** * @brief save points into the database file */ ! static void buildmap_point_save (void) { int i; --- 356,360 ---- * @brief save points into the database file */ ! static int buildmap_point_save (void) { int i; *************** *** 382,393 **** root = buildmap_db_add_section (NULL, "point"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); table_data = buildmap_db_add_section (root, "data"); ! if (table_data == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_data, PointCount, sizeof(RoadMapPoint)); table_bysquare = buildmap_db_add_section (root, "bysquare"); ! if (table_bysquare == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_bysquare, square_count, sizeof(RoadMapPointBySquare)); --- 382,402 ---- root = buildmap_db_add_section (NULL, "point"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } table_data = buildmap_db_add_section (root, "data"); ! if (table_data == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_data, PointCount, sizeof(RoadMapPoint)); table_bysquare = buildmap_db_add_section (root, "bysquare"); ! if (table_bysquare == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_bysquare, square_count, sizeof(RoadMapPointBySquare)); *************** *** 405,409 **** if (one_point->square != last_square) { if (one_point->square != last_square + 1) { ! buildmap_fatal (0, "decreasing square order in point table"); } last_square = one_point->square; --- 414,419 ---- if (one_point->square != last_square) { if (one_point->square != last_square + 1) { ! buildmap_error (0, "decreasing square order in point table"); ! return 1; } last_square = one_point->square; *************** *** 421,424 **** --- 431,436 ---- (unsigned short) (one_point->latitude - reference_latitude); } + + return 0; } Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** buildmap_osm_main.c 23 Oct 2010 08:18:35 -0000 1.21 --- buildmap_osm_main.c 17 Nov 2010 00:05:28 -0000 1.22 *************** *** 99,105 **** * @param writeit */ ! static void buildmap_osm_save_custom (const char *filename, int writeit) { char *parent; parent = roadmap_path_parent(BuildMapResult, filename); --- 99,106 ---- * @param writeit */ ! static int buildmap_osm_save_custom (const char *filename, int writeit) { char *parent; + int ret = 0; parent = roadmap_path_parent(BuildMapResult, filename); *************** *** 108,117 **** if (buildmap_db_open (BuildMapResult, filename) < 0) { ! buildmap_fatal (0, "cannot create database %s", filename); } if (writeit) { buildmap_info("writing results to %s", filename); ! buildmap_db_save (); } else { buildmap_info("no results to write to %s", filename); --- 109,119 ---- if (buildmap_db_open (BuildMapResult, filename) < 0) { ! buildmap_error (0, "cannot create database %s", filename); ! return 1; } if (writeit) { buildmap_info("writing results to %s", filename); ! ret = buildmap_db_save (); } else { buildmap_info("no results to write to %s", filename); *************** *** 119,122 **** --- 121,128 ---- buildmap_db_close (); + if (ret != 0) { + ret = buildmap_db_remove (BuildMapResult, filename); + } + return 0; } *************** *** 259,263 **** int buildmap_osm_text_process_file(char *fn) { ! int n, ret = 0; FILE *f; char country[6], division[6]; --- 265,269 ---- int buildmap_osm_text_process_file(char *fn) { ! int n, ret = 0, ret2; FILE *f; char country[6], division[6]; *************** *** 303,307 **** buildmap_db_sort(); ! buildmap_osm_save_custom(BuildMapFileName, (ret == 0) ? 1 : 0); return ret; --- 309,315 ---- buildmap_db_sort(); ! ret2 = buildmap_osm_save_custom(BuildMapFileName, (ret == 0) ? 1 : 0); ! if (ret2 != 0) ! return ret2; return ret; Index: buildmap_square.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_square.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** buildmap_square.c 29 Mar 2009 11:54:26 -0000 1.14 --- buildmap_square.c 17 Nov 2010 00:05:28 -0000 1.15 *************** *** 415,419 **** ! static void buildmap_square_save (void) { int i; --- 415,419 ---- ! static int buildmap_square_save (void) { int i; *************** *** 431,442 **** root = buildmap_db_add_section (NULL, "square"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); table_global = buildmap_db_add_section (root, "global"); ! if (table_global == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_global, 1, sizeof(RoadMapGlobal)); table_data = buildmap_db_add_section (root, "data"); ! if (table_data == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (table_data, SquareCount, sizeof(RoadMapSquare)); --- 431,451 ---- root = buildmap_db_add_section (NULL, "square"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } table_global = buildmap_db_add_section (root, "global"); ! if (table_global == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_global, 1, sizeof(RoadMapGlobal)); table_data = buildmap_db_add_section (root, "data"); ! if (table_data == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (table_data, SquareCount, sizeof(RoadMapSquare)); *************** *** 472,475 **** --- 481,486 ---- db_square[i].count_points = one_square->count; } + + return 0; } Index: buildmap_polygon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_polygon.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** buildmap_polygon.c 11 Oct 2010 19:38:06 -0000 1.16 --- buildmap_polygon.c 17 Nov 2010 00:05:28 -0000 1.17 *************** *** 881,885 **** ! static void buildmap_polygon_save (void) { int i; --- 881,885 ---- ! static int buildmap_polygon_save (void) { int i; *************** *** 905,920 **** */ if (PolygonLineCount > 0xffff) { ! buildmap_fatal (0, "too many polygon lines - %d, max %d", PolygonLineCount, 0xffff); } root = buildmap_db_add_section (NULL, "polygons"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); head_table = buildmap_db_add_section (root, "head"); ! if (head_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (head_table, PolygonCount, sizeof(RoadMapPolygon)); line_table = buildmap_db_add_section (root, "line"); ! if (line_table == NULL) buildmap_fatal (0, "Can't add a new section"); buildmap_db_add_data (line_table, PolygonLineCount, sizeof(RoadMapPolygonLine)); --- 905,930 ---- */ if (PolygonLineCount > 0xffff) { ! buildmap_error (0, "too many polygon lines - %d, max %d", PolygonLineCount, 0xffff); ! return 1; } root = buildmap_db_add_section (NULL, "polygons"); ! if (root == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } head_table = buildmap_db_add_section (root, "head"); ! if (head_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (head_table, PolygonCount, sizeof(RoadMapPolygon)); line_table = buildmap_db_add_section (root, "line"); ! if (line_table == NULL) { ! buildmap_error (0, "Can't add a new section"); ! return 1; ! } buildmap_db_add_data (line_table, PolygonLineCount, sizeof(RoadMapPolygonLine)); *************** *** 935,939 **** if (one_polygon == NULL) { ! buildmap_fatal (0, "invalid line was not removed"); } --- 945,950 ---- if (one_polygon == NULL) { ! buildmap_error (0, "invalid line was not removed"); ! return 1; } *************** *** 941,946 **** if (one_polygon->sorted < polygon_current) { ! buildmap_fatal (0, "abnormal polygon order: %d following %d", one_polygon->sorted, polygon_current); } --- 952,958 ---- if (one_polygon->sorted < polygon_current) { ! buildmap_error (0, "abnormal polygon order: %d following %d", one_polygon->sorted, polygon_current); + return 1; } *************** *** 948,952 **** if (roadmap_polygon_get_count(db_poly) <= 1) { ! buildmap_fatal (0, "empty polygon"); } --- 960,965 ---- if (roadmap_polygon_get_count(db_poly) <= 1) { ! buildmap_error (0, "empty polygon"); ! return 1; } *************** *** 963,967 **** if (one_polygon->count > 0xfffff) { ! buildmap_fatal (0, "too many polygon lines (%d, max %d)", one_polygon->count, 0xfffff); } buildmap_polygon_set_count(db_poly, one_polygon->count); --- 976,981 ---- if (one_polygon->count > 0xfffff) { ! buildmap_error (0, "too many polygon lines (%d, max %d)", one_polygon->count, 0xfffff); ! return 1; } buildmap_polygon_set_count(db_poly, one_polygon->count); *************** *** 972,977 **** if (square < square_current) { ! buildmap_fatal (0, "abnormal square order: %d following %d", square, square_current); } square_current = square; --- 986,992 ---- if (square < square_current) { ! buildmap_error (0, "abnormal square order: %d following %d", square, square_current); + return 1; } square_current = square; *************** *** 983,988 **** buildmap_polygon_fill_in_drawing_order (db_poly, db_line); - } } --- 998,1004 ---- buildmap_polygon_fill_in_drawing_order (db_poly, db_line); } + + return 0; } Index: buildmap_dbwrite.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_dbwrite.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** buildmap_dbwrite.c 12 May 2009 13:53:32 -0000 1.8 --- buildmap_dbwrite.c 17 Nov 2010 00:05:28 -0000 1.9 *************** *** 201,204 **** --- 201,227 ---- /** + * @bref remove the output file, it is bad + * @param path + * @param name + */ + int buildmap_db_remove (const char *path, const char *name) { + struct roadmap_db_section *root; + + if (path == NULL) { + path = "."; + } + + BuildmapCurrentDbName = roadmap_path_join (path, name); + + if (BuildmapCurrentDbName == NULL) { + buildmap_error (0, "no more memory"); + return -1; + } + + unlink(BuildmapCurrentDbName); + return 0; + } + + /** * @brief * @param parent *************** *** 225,228 **** --- 248,252 ---- aligned = (offset + 7) & (~7); + // fprintf(stderr, "buildmap_db_add_section(%s) extend (aligned %d, sz %d)\n", name, aligned, sizeof(struct roadmap_db_section)); if (buildmap_db_extend (aligned + sizeof(struct roadmap_db_section)) < 0) { return NULL; *************** *** 289,292 **** --- 313,317 ---- section->head->size += total_size; + // fprintf(stderr, "buildmap_db_add_data(%d,%d) : extend(offset %d, aligned_size %d)\n", count, size, offset, aligned_size); if (buildmap_db_extend (offset + aligned_size) < 0) { return -1; *************** *** 439,452 **** /** * @brief save the map */ ! void buildmap_db_save (void) { ! int i; for (i = 0; i < BuildmapModuleCount; ++i) { if (BuildmapModuleRegistration[i]->save != NULL) { ! BuildmapModuleRegistration[i]->save (); } } } --- 464,481 ---- /** * @brief save the map + * @return 0 on success, failure if other values. */ ! int buildmap_db_save (void) { ! int i, r; for (i = 0; i < BuildmapModuleCount; ++i) { if (BuildmapModuleRegistration[i]->save != NULL) { ! r = BuildmapModuleRegistration[i]->save (); ! if (r != 0) ! return r; } } + return 0; } |
From: Danny B. <dan...@us...> - 2010-11-13 15:02:21
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv10266 Modified Files: buildmap_osm_text.c Log Message: This works around a problem with continuation lines in the XML (see the comment in the changed code). This caused 7 of the chunks of England to fail, until now. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** buildmap_osm_text.c 1 Nov 2010 09:24:30 -0000 1.23 --- buildmap_osm_text.c 13 Nov 2010 15:02:13 -0000 1.24 *************** *** 1279,1284 **** if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') ! buildmap_fatal(0, "invalid XML (line %d, %s)", LineNo, buf); p++; /* point to character after '<' now */ --- 1279,1299 ---- if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') { ! /* ! * Assume we're in a continuation line such as ! * ! * <tag k='opening_hours' v='Mo 09:30-19:00; ! * Tu 09:30-17:00; ! * We 09:30-17:00; ! * Th 09:30-19:00; ! * Fr 09:30-17:00; ! * Sa 09:30-16:00; ! * Su 10:00-14:00'/> ! * ! * and just continue with the next line and hope we'll pick up ! * a new tag soon. ! */ ! continue; ! } p++; /* point to character after '<' now */ *************** *** 1331,1336 **** if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') ! buildmap_fatal(0, "invalid XML (line %d, %s)", LineNo, buf); p++; /* point to character after '<' now */ --- 1346,1366 ---- if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') { ! /* ! * Assume we're in a continuation line such as ! * ! * <tag k='opening_hours' v='Mo 09:30-19:00; ! * Tu 09:30-17:00; ! * We 09:30-17:00; ! * Th 09:30-19:00; ! * Fr 09:30-17:00; ! * Sa 09:30-16:00; ! * Su 10:00-14:00'/> ! * ! * and just continue with the next line and hope we'll pick up ! * a new tag soon. ! */ ! continue; ! } p++; /* point to character after '<' now */ *************** *** 1378,1383 **** if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') ! buildmap_fatal(0, "invalid XML (line %d, %s)", LineNo, buf); p++; /* point to character after '<' now */ --- 1408,1428 ---- if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') { ! /* ! * Assume we're in a continuation line such as ! * ! * <tag k='opening_hours' v='Mo 09:30-19:00; ! * Tu 09:30-17:00; ! * We 09:30-17:00; ! * Th 09:30-19:00; ! * Fr 09:30-17:00; ! * Sa 09:30-16:00; ! * Su 10:00-14:00'/> ! * ! * and just continue with the next line and hope we'll pick up ! * a new tag soon. ! */ ! continue; ! } p++; /* point to character after '<' now */ *************** *** 1433,1438 **** if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') ! buildmap_fatal(0, "invalid XML"); p++; /* point to character after '<' now */ --- 1478,1498 ---- if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') { ! /* ! * Assume we're in a continuation line such as ! * ! * <tag k='opening_hours' v='Mo 09:30-19:00; ! * Tu 09:30-17:00; ! * We 09:30-17:00; ! * Th 09:30-19:00; ! * Fr 09:30-17:00; ! * Sa 09:30-16:00; ! * Su 10:00-14:00'/> ! * ! * and just continue with the next line and hope we'll pick up ! * a new tag soon. ! */ ! continue; ! } p++; /* point to character after '<' now */ |
From: Danny B. <dan...@us...> - 2010-11-13 08:58:01
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27202/d/gpx Modified Files: Makefile Log Message: Add a couple of dependencies to make the build more reliable : - for documentation - for sources depending on expat Add a note about address lookup support in OSM working in recent versions. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 28 Jun 2008 16:49:28 -0000 1.6 --- Makefile 13 Nov 2010 08:57:48 -0000 1.7 *************** *** 50,51 **** --- 50,53 ---- -include .depends.mk + + gpx.o: ../config.mk |
From: Danny B. <dan...@us...> - 2010-11-13 08:58:01
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27202/d Modified Files: Makefile Log Message: Add a couple of dependencies to make the build more reliable : - for documentation - for sources depending on expat Add a note about address lookup support in OSM working in recent versions. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** Makefile 11 Oct 2010 19:38:06 -0000 1.145 --- Makefile 13 Nov 2010 08:57:48 -0000 1.146 *************** *** 613,617 **** -cp $(MANUAL) $(pkgdatadir) ! $(MANUAL): ../README expand $< | \ (cd ../doc; txt2tags --target html \ --- 613,617 ---- -cp $(MANUAL) $(pkgdatadir) ! $(MANUAL): ../README $(addprefix ../doc/, $(DOC_SRC)) expand $< | \ (cd ../doc; txt2tags --target html \ *************** *** 773,774 **** --- 773,777 ---- roadmap_plugin.o: Makefile config.mk roadmap_trip.o: Makefile config.mk + + roadmap_gpx.o: Makefile config.mk + roadmap_landmark.o: Makefile config.mk |
From: Danny B. <dan...@us...> - 2010-11-13 08:57:56
|
Update of /cvsroot/roadmap/roadmap/doc In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27202/doc Modified Files: Usage Log Message: Add a couple of dependencies to make the build more reliable : - for documentation - for sources depending on expat Add a note about address lookup support in OSM working in recent versions. Index: Usage =================================================================== RCS file: /cvsroot/roadmap/roadmap/doc/Usage,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Usage 8 Feb 2009 21:14:31 -0000 1.4 --- Usage 13 Nov 2010 08:57:48 -0000 1.5 *************** *** 403,406 **** --- 403,409 ---- OPTIONS ARE ONLY CURRENTLY AVAILABLE WHEN USING THE US TIGER MAPS. ** + ** NEW : OSM based maps based on XML map data, built with buildmap_osm + from sources November 2010 and newer, do support address lookup. ** + RoadMap manages several types of points: a location point (selected using a street address or the mouse), the GPS position (updated automatically |
From: Danny B. <dan...@us...> - 2010-11-01 09:24:38
|
Update of /cvsroot/roadmap/roadmap/src/default In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv29450/default Modified Files: All Log Message: Upload the code I've been working on for a while into CVS. There are almost certainly things in there that are worth your input... Index: All =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/default/All,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** All 12 Feb 2009 16:35:08 -0000 1.6 --- All 1 Nov 2010 09:24:30 -0000 1.7 *************** *** 1,5 **** Class.Name: All Class.Lines: Freeways Ramps Highways Streets Trails Rivers Shore Railroads Boundaries ! Class.Polygons: Lakes Sea Parks Hospitals Airports Stations Malls Class.NavigationModes: Car Bike Foot Boat Navigation.Car: Freeways Ramps Highways Streets --- 1,5 ---- Class.Name: All Class.Lines: Freeways Ramps Highways Streets Trails Rivers Shore Railroads Boundaries ! Class.Polygons: Lakes Sea Parks Hospitals Airports Stations Malls Nature Amenity Class.NavigationModes: Car Bike Foot Boat Navigation.Car: Freeways Ramps Highways Streets *************** *** 82,83 **** --- 82,91 ---- Boundaries.Declutter: 2147483647 Boundaries.Speed: 1 + Nature.Color: green + Nature.Declutter: 1300 + Nature.Thickness: 1 + Nature.Speed: 1 + Amenity.Color: orange + Amenity.Declutter: 1300 + Amenity.Thickness: 1 + Amenity.Speed: 1 |
From: Danny B. <dan...@us...> - 2010-11-01 09:24:38
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv29450 Modified Files: buildmap_osm_text.c buildmap_osm_common.c Log Message: Upload the code I've been working on for a while into CVS. There are almost certainly things in there that are worth your input... Index: buildmap_osm_common.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_common.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_osm_common.c 27 Feb 2009 14:50:42 -0000 1.2 --- buildmap_osm_common.c 1 Nov 2010 09:24:30 -0000 1.3 *************** *** 3,7 **** * * Copyright (c) 2007 Paul Fox ! * Copyright (c) 2008, Danny Backx * * This file is part of RoadMap. --- 3,7 ---- * * Copyright (c) 2007 Paul Fox ! * Copyright (c) 2008, 2010, Danny Backx * * This file is part of RoadMap. *************** *** 27,30 **** --- 27,32 ---- * * This file contains the static data. + * + * See http://wiki.openstreetmap.org/wiki/Map_Features */ *************** *** 81,84 **** --- 83,88 ---- int BuildMapLayerStation = 0; int BuildMapLayerMall = 0; + int BuildMapLayerNature = 0; + int BuildMapLayerAmenity = 0; /* Water layers. */ *************** *** 111,114 **** --- 115,120 ---- #define SEA &BuildMapLayerSea #define BOUNDARY &BuildMapLayerBoundary + #define NATURE &BuildMapLayerNature + #define AMENITY &BuildMapLayerAmenity BuildMapDictionary DictionaryPrefix; *************** *** 142,145 **** --- 148,154 ---- BuildMapLayerSea = buildmap_layer_get ("sea"); + BuildMapLayerNature = buildmap_layer_get ("nature"); + BuildMapLayerAmenity = buildmap_layer_get ("amenity"); + BuildMapLayerBoundary = buildmap_layer_get ("boundaries"); } *************** *** 224,228 **** { "footway", TRAIL, 0 }, /* 16 */ { "steps", TRAIL, 0 }, /* 17 */ ! { "pedestrian", TRAIL, 0 }, /* =>17 */ { 0, NULL, 0 }, }; --- 233,241 ---- { "footway", TRAIL, 0 }, /* 16 */ { "steps", TRAIL, 0 }, /* 17 */ ! { "pedestrian", TRAIL, 0 }, /* 18 */ ! { "pathway", TRAIL, 0 }, /* 19 */ ! { "road", STREET, 0 }, /* 20 */ /* New - ok ? */ ! { "secondary_link", STREET, 0 }, /* 21 */ /* New - ok ? */ ! { "path", TRAIL, 0 }, /* 22 */ /* New - ok ? */ { 0, NULL, 0 }, }; *************** *** 252,255 **** --- 265,270 ---- { "weir", RIVER, 0 }, /* 11 */ { "dam", RIVER, 0 }, /* 12 */ + { "riverbank", RIVER, 0 }, /* 13 */ /* New - ok ? */ + { "ditch", RIVER, 0 }, /* 14 */ /* New - ok ? */ { 0, NULL, 0 }, }; *************** *** 291,296 **** { "coastline", SHORELINE, 0 }, /* 1 */ { "water", LAKE, AREA }, /* 2 */ ! { "wood", NULL, AREA }, /* 3 */ { "peak", NULL, 0 }, /* 4 */ { 0, NULL, 0 }, }; --- 306,329 ---- { "coastline", SHORELINE, 0 }, /* 1 */ { "water", LAKE, AREA }, /* 2 */ ! { "wood", NATURE, AREA }, /* 3 */ { "peak", NULL, 0 }, /* 4 */ + { "land", NULL, AREA }, /* 5 */ /* New - ok ? */ + { "bay", NULL, AREA }, /* 6 */ /* New - ok ? */ + { "beach", NULL, AREA }, /* 7 */ /* New - ok ? */ + { "cave_entrance", NULL, AREA }, /* 8 */ /* New - ok ? */ + { "cliff", NULL, AREA }, /* 9 */ /* New - ok ? */ + { "fell", NULL, AREA }, /* 10 */ /* New - ok ? */ + { "glacier", NULL, AREA }, /* 11 */ /* New - ok ? */ + { "heath", NULL, AREA }, /* 12 */ /* New - ok ? */ + { "marsh", NULL, AREA }, /* 13 */ /* New - ok ? */ + { "mud", NULL, AREA }, /* 14 */ /* New - ok ? */ + { "sand", NULL, AREA }, /* 15 */ /* New - ok ? */ + { "scree", NULL, AREA }, /* 16 */ /* New - ok ? */ + { "scrub", NULL, AREA }, /* 17 */ /* New - ok ? */ + { "sprint", NULL, AREA }, /* 18 */ /* New - ok ? */ + { "stone", NULL, AREA }, /* 19 */ /* New - ok ? */ + { "tree", NULL, AREA }, /* 20 */ /* New - ok ? */ + { "volcano", NULL, AREA }, /* 21 */ /* New - ok ? */ + { "wetland", NULL, AREA }, /* 22 */ /* New - ok ? */ { 0, NULL, 0 }, }; *************** *** 310,330 **** { "hospital", HOSPITAL, 0 }, /* 1 */ { "pub", NULL, 0 }, /* 2 */ ! { "parking", NULL, AREA }, /* 3 */ ! { "post_office", NULL, 0 }, /* 4 */ { "fuel", NULL, 0 }, /* 5 */ { "telephone", NULL, 0 }, /* 6 */ { "toilets", NULL, 0 }, /* 7 */ { "post_box", NULL, 0 }, /* 8 */ ! { "school", NULL, AREA }, /* 9 */ ! { "supermarket", NULL, 0 }, /* 10 */ ! { "library", NULL, 0 }, /* 11 */ { "theatre", NULL, 0 }, /* 12 */ { "cinema", NULL, 0 }, /* 13 */ ! { "police", NULL, 0 }, /* 14 */ ! { "fire_station", NULL, 0 }, /* 15 */ { "restaurant", NULL, 0 }, /* 16 */ ! { "fastfood", NULL, 0 }, /* 17 */ { "bus_station", NULL, 0 }, /* 18 */ ! { "place_of_worship", NULL, 0 }, /* 19 */ { "cafe", NULL, 0 }, /* 20 */ { "bicycle_parking", NULL, AREA }, /* 21 */ --- 343,363 ---- { "hospital", HOSPITAL, 0 }, /* 1 */ { "pub", NULL, 0 }, /* 2 */ ! { "parking", AMENITY, AREA }, /* 3 */ ! { "post_office", AMENITY, 0 }, /* 4 */ { "fuel", NULL, 0 }, /* 5 */ { "telephone", NULL, 0 }, /* 6 */ { "toilets", NULL, 0 }, /* 7 */ { "post_box", NULL, 0 }, /* 8 */ ! { "school", AMENITY, AREA }, /* 9 */ ! { "supermarket", AMENITY, 0 }, /* 10 */ ! { "library", AMENITY, 0 }, /* 11 */ { "theatre", NULL, 0 }, /* 12 */ { "cinema", NULL, 0 }, /* 13 */ ! { "police", AMENITY, 0 }, /* 14 */ ! { "fire_station", AMENITY, 0 }, /* 15 */ { "restaurant", NULL, 0 }, /* 16 */ ! { "fast_food", NULL, 0 }, /* 17 */ /* Changed */ { "bus_station", NULL, 0 }, /* 18 */ ! { "place_of_worship", AMENITY, 0 }, /* 19 */ { "cafe", NULL, 0 }, /* 20 */ { "bicycle_parking", NULL, AREA }, /* 21 */ *************** *** 332,337 **** { "grave_yard", NULL, AREA }, /* 23 */ { "university", NULL, AREA }, /* 24 */ ! { "college", NULL, AREA }, /* 25 */ { "townhall", NULL, AREA }, /* 26 */ { 0, NULL, 0 }, }; --- 365,418 ---- { "grave_yard", NULL, AREA }, /* 23 */ { "university", NULL, AREA }, /* 24 */ ! { "college", AMENITY, AREA }, /* 25 */ { "townhall", NULL, AREA }, /* 26 */ + { "food_court", NULL, 0 }, /* 27 */ /* New - ok ? */ + { "drinking_water", NULL, 0 }, /* 28 */ /* New - ok ? */ + { "bbq", NULL, 0 }, /* 28 */ /* New - ok ? */ + { "bar", NULL, 0 }, /* 29 */ /* New - ok ? */ + { "biergarten", NULL, 0 }, /* 30 */ /* New - ok ? */ + { "ice_cream", NULL, 0 }, /* 31 */ /* New - ok ? */ + { "kindergarten", NULL, 0 }, /* 32 */ /* New - ok ? */ + { "ice_cream", NULL, 0 }, /* 33 */ /* New - ok ? */ + { "ferry_terminal", AMENITY, AREA }, /* 34 */ /* New - ok ? */ + { "bicycle_rental", NULL, 0 }, /* 35 */ /* New - ok ? */ + { "car_rental", NULL, 0 }, /* 36 */ /* New - ok ? */ + { "car_sharing", NULL, AREA }, /* 37 */ /* New - ok ? */ + { "car_wash", NULL, 0 }, /* 38 */ /* New - ok ? */ + { "grit_bin", NULL, 0 }, /* 39 */ /* New - ok ? */ + { "taxi", NULL, AREA }, /* 40 */ /* New - ok ? */ + { "atm", NULL, 0 }, /* 41 */ /* New - ok ? */ + { "bank", NULL, 0 }, /* 42 */ /* New - ok ? */ + { "bureau_de_change", NULL, 0 }, /* 43 */ /* New - ok ? */ + { "pharmacy", NULL, 0 }, /* 44 */ /* New - ok ? */ + { "baby_hatch", NULL, 0 }, /* 45 */ /* New - ok ? */ + { "dentist", NULL, 0 }, /* 46 */ /* New - ok ? */ + { "doctor", NULL, 0 }, /* 47 */ /* New - ok ? */ + { "social_facility", NULL, 0 }, /* 48 */ /* New - ok ? */ + { "veterinary", NULL, 0 }, /* 49 */ /* New - ok ? */ + { "architect_office", NULL, 0 }, /* 50 */ /* New - ok ? */ + { "arts_centre", AMENITY, AREA }, /* 51 */ /* New - ok ? */ + { "community_centre", AMENITY, AREA }, /* 52 */ /* New - ok ? */ + { "social_centre", AMENITY, AREA }, /* 53 */ /* New - ok ? */ + { "fountain", NULL, 0 }, /* 51 */ /* New - ok ? */ + { "nightclub", NULL, 0 }, /* 51 */ /* New - ok ? */ + { "stripclub", NULL, 0 }, /* 51 */ /* New - ok ? */ + { "studio", NULL, 0 }, /* 54 */ /* New - ok ? */ + { "bench", NULL, 0 }, /* 55 */ /* New - ok ? */ + { "brothel", NULL, 0 }, /* 56 */ /* New - ok ? */ + { "clock", NULL, 0 }, /* 57 */ /* New - ok ? */ + { "courthouse", AMENITY, 0 }, /* 58 */ /* New - ok ? */ + { "crematorium", AMENITY, 0 }, /* 59 */ /* New - ok ? */ + { "embassy", AMENITY, 0 }, /* 60 */ /* New - ok ? */ + { "hunting_stand", NULL, 0 }, /* 61 */ /* New - ok ? */ + { "marketplace", AMENITY, AREA }, /* 62 */ /* New - ok ? */ + { "prison", AMENITY, AREA }, /* 63 */ /* New - ok ? */ + { "recycling", NULL, 0 }, /* 64 */ /* New - ok ? */ + { "sauna", NULL, 0 }, /* 65 */ /* New - ok ? */ + { "shelter", NULL, AREA }, /* 66 */ /* New - ok ? */ + { "vending_machine", NULL, 0 }, /* 67 */ /* New - ok ? */ + { "waste_basket", NULL, 0 }, /* 68 */ /* New - ok ? */ + { "waste_disposal", NULL, 0 }, /* 69 */ /* New - ok ? */ + { "watering_place", NULL, 0 }, /* 70 */ /* New - ok ? */ { 0, NULL, 0 }, }; *************** *** 363,368 **** { "pitch", NULL, AREA }, /* 8 */ { "track", NULL, AREA }, /* 9 */ ! { "marina", NULL, AREA }, /* 10 */ ! { "stadium", NULL, AREA }, /* 11 */ { "golf_course", PARK, AREA }, /* 12 */ { "sports_centre", NULL, AREA }, /* 13 */ --- 444,449 ---- { "pitch", NULL, AREA }, /* 8 */ { "track", NULL, AREA }, /* 9 */ ! { "marina", AMENITY, AREA }, /* 10 */ ! { "stadium", AMENITY, AREA }, /* 11 */ { "golf_course", PARK, AREA }, /* 12 */ { "sports_centre", NULL, AREA }, /* 13 */ *************** *** 390,393 **** --- 471,578 ---- #endif + layer_info_t office_to_layer[] = { + { 0, NULL, 0 }, + { "accountant", NULL, 0 }, + { "architect", NULL, 0 }, + { "company", NULL, 0 }, + { "employment_agency", NULL, 0 }, + { "estate_agent", NULL, 0 }, + { "government", NULL, 0 }, + { "insurance", NULL, 0 }, + { "it", NULL, 0 }, + { "lawyer", NULL, 0 }, + { "newspaper", NULL, 0 }, + { "ngo", NULL, 0 }, + { "quango", NULL, 0 }, + { "research", NULL, 0 }, + { "telecommunication", NULL, 0 }, + { "travel_agent", NULL, 0 }, + { 0, NULL, 0 }, + }; + + layer_info_t barrier_to_layer[] = { + { 0, NULL, 0 }, + { "hedge", NULL, 0 }, + { "fence", NULL, 0 }, + { "wall", NULL, 0 }, + { "ditch", NULL, 0 }, + { "retaining_wall", NULL, 0 }, + { "city_wall", NULL, 0 }, + { "bollard", NULL, 0 }, + { "cycle_barrier", NULL, 0 }, + { "block", NULL, 0 }, + { "cattle_grid", NULL, 0 }, + { "toll_booth", NULL, 0 }, + { "entrance", NULL, 0 }, + { "gate", NULL, 0 }, + { "lift_gate", NULL, 0 }, + { "stile", NULL, 0 }, + { "horse_stile", NULL, 0 }, + { "kissing_gate", NULL, 0 }, + { "sally_port", NULL, 0 }, + { "turnstile", NULL, 0 }, + { "kent_carriage_gap", NULL, 0 }, + { 0, NULL, 0 }, + }; + + layer_info_t craft_to_layer[] = { + { 0, NULL, 0 }, + { "agricultural_engines", NULL, 0 }, + { "basket_maker", NULL, 0 }, + { "beekeeper", NULL, 0 }, + { "blacksmith", NULL, 0 }, + { "boatbuilder", NULL, 0 }, + { "carpenter", NULL, 0 }, + { "carpet_layer", NULL, 0 }, + { "caterer", NULL, 0 }, + { "clockmaker", NULL, 0 }, + { "confectionery", NULL, 0 }, + { "electrician", NULL, 0 }, + { "gardener", NULL, 0 }, + { "handicraft", NULL, 0 }, + { "hvac", NULL, 0 }, + { "jeweller", NULL, 0 }, + { "locksmith", NULL, 0 }, + { "metal_construction", NULL, 0 }, + { "optician", NULL, 0 }, + { "painter", NULL, 0 }, + { "photographer", NULL, 0 }, + { "photographic_laboratory", NULL, 0 }, + { "plasterer", NULL, 0 }, + { "plumber", NULL, 0 }, + { "pottery", NULL, 0 }, + { "roofer", NULL, 0 }, + { "shoemaker", NULL, 0 }, + { "scaffolder", NULL, 0 }, + { "stonemason", NULL, 0 }, + { "sweep", NULL, 0 }, + { "tailor", NULL, 0 }, + { "tiler", NULL, 0 }, + { "sailmaker", NULL, 0 }, + { "rigger", NULL, 0 }, + { "saddler", NULL, 0 }, + { "sculptor", NULL, 0 }, + { "upholsterer", NULL, 0 }, + { 0, NULL, 0 }, + }; + + layer_info_t emergency_to_layer[] = { + { 0, NULL, 0 }, + { "ambulance_station", NULL, AREA }, + { "fire_extinguisher", NULL, 0 }, + { "fire_flapper", NULL, 0 }, + { "fire_hose", NULL, 0 }, + { "fire_hydrant", NULL, 0 }, + { "phone", NULL, 0 }, + { "ses_station", NULL, 0 }, + { "siren", NULL, 0 }, + { 0, NULL, 0 }, + }; + + layer_info_t geological_to_layer[] = { + { 0, NULL, 0 }, + { "palaeontological_site", NULL, 0 }, + { 0, NULL, 0 }, + }; layer_info_sublist_t list_info[] = { *************** *** 440,443 **** --- 625,633 ---- {"wheelchair", NULL, NULL }, {"junction", NULL, NULL }, + {"office", office_to_layer, NULL }, + {"barrier", barrier_to_layer, NULL }, + {"craft", craft_to_layer, NULL }, + {"emergency", emergency_to_layer, NULL }, + {"geological", geological_to_layer, NULL }, { 0, NULL, 0 }, }; Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** buildmap_osm_text.c 23 Oct 2010 08:18:34 -0000 1.22 --- buildmap_osm_text.c 1 Nov 2010 09:24:30 -0000 1.23 *************** *** 87,90 **** --- 87,92 ---- static int WayIsOneWay = ROADMAP_LINE_DIRECTION_BOTH; /**< is this way one direction only */ + static int WayAdminLevel = 0; /**< boundaries */ + static int WayCoast = 0; /**< coastline */ /** *************** *** 178,181 **** --- 180,185 ---- WayInvalid = 0; WayIsOneWay = ROADMAP_LINE_DIRECTION_BOTH; + WayAdminLevel = 0; + WayCoast = 0; } *************** *** 744,747 **** --- 748,755 ---- WayStreetRef = FromXmlAndDup(value); return 0; /* FIX ME ?? */ + } else if (strcasecmp(tag, "admin_level") == 0) { + WayAdminLevel = atoi(value); + } else if (strcasecmp(tag, "natural") == 0 && strcasecmp(value, "coastline") == 0) { + WayCoast = 1; } *************** *** 793,796 **** --- 801,811 ---- int j; int was_split = 0; + static int l_shoreline = 0, + l_boundary = 0; + + if (l_shoreline == 0) + l_shoreline = buildmap_layer_get("shore");; + if (l_boundary == 0) + l_boundary = buildmap_layer_get("boundaries");; if (WayInvalid) { *************** *** 802,805 **** --- 817,846 ---- buildmap_fatal(0, "Wasn't in a way (%s)", data); + if (WayCoast) { + WayNotInteresting = 0; + #if 0 + buildmap_info("Way %d (%s) admin level %d", + in_way, WayStreetName ? WayStreetName : "", WayAdminLevel); + #endif + WayLayer = l_shoreline; + } + + if (WayAdminLevel) { + #if 0 + if (WayStreetName) { + buildmap_info("Way %s admin level %d", WayStreetName, WayAdminLevel); + } else { + buildmap_info("Way %d <unnamed> admin level %d", in_way, WayAdminLevel); + } + #endif + + if (WayAdminLevel == 2) { + /* National border, always considered interesting */ + WayNotInteresting = 0; + } + + WayLayer = l_boundary; + } + if (WayNotInteresting || WayLayer == 0) { buildmap_verbose("discarding way %d, not interesting (%s)", in_way, data); *************** *** 878,881 **** --- 919,927 ---- #if 0 else { + /* + * debugging purpose : flag unnamed ways, whatever they + * are, with the OSM way id. + * You can use this to look them up in the OSM XML file. + */ char s[64]; sprintf(s, "OSM unnamed way %d", in_way); |
From: Danny B. <dan...@us...> - 2010-10-30 18:18:16
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv18858 Modified Files: roadmap_path.c Log Message: Update this so it has the Android changes. Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_path.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** roadmap_path.c 15 Feb 2009 16:47:49 -0000 1.14 --- roadmap_path.c 30 Oct 2010 18:18:09 -0000 1.15 *************** *** 75,78 **** --- 75,80 ---- static const char *RoadMapPathConfigSuffix = "roadmap"; + static char *RoadMapUser = NULL; + static char *RoadMapTrips = NULL; static const char *RoadMapPathConfigPreferred = "/Storage Card/roadmap"; *************** *** 355,360 **** const char *roadmap_path_user (void) { - static char *RoadMapUser = NULL; - if (RoadMapUser == NULL) { WCHAR path_unicode[MAX_PATH]; --- 357,360 ---- *************** *** 380,384 **** { static char RoadMapDefaultTrips[] = "trips"; - static char *RoadMapTrips = NULL; if (RoadMapTrips == NULL) { --- 380,383 ---- *************** *** 668,669 **** --- 667,690 ---- } + /** + * @brief recursively clean up a linked list + */ + static void roadmap_path_cleanup_recursive (RoadMapPathList p) + { + if (p == NULL) + return; + roadmap_path_cleanup_recursive (p->next); + free(p); + } + + /** + * @brief cleanup + */ + void roadmap_path_shutdown (void) + { + roadmap_path_cleanup_recursive (RoadMapPaths); + RoadMapPaths = NULL; + + RoadMapUser = NULL; // this only points into a structure, free() happens elsewhere + RoadMapTrips = NULL; // this only points into a structure, free() happens elsewhere + } |
From: Danny B. <dan...@us...> - 2010-10-30 17:51:39
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv13635 Modified Files: roadmap_gpsd3.c Log Message: Only do #include <errno.h> when you need it. Index: roadmap_gpsd3.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gpsd3.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_gpsd3.c 17 Aug 2010 18:57:10 -0000 1.1 --- roadmap_gpsd3.c 30 Oct 2010 17:51:32 -0000 1.2 *************** *** 36,40 **** --- 36,43 ---- #include "roadmap_gpsd3.h" + #if defined(ROADMAP_USES_LIBGPS) + /* This include won't work on WinCE but libgps won't run on WinCE either. */ #include "errno.h" + #endif #ifdef ROADMAP_USES_LIBGPS |
From: Danny B. <dan...@us...> - 2010-10-23 08:18:43
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31178 Modified Files: buildmap_osm_text.c buildmap_osm_main.c Log Message: Handle return values decently. This removes the need for the -k argument to make in my recent scripts. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** buildmap_osm_text.c 20 Oct 2010 07:40:33 -0000 1.21 --- buildmap_osm_text.c 23 Oct 2010 08:18:34 -0000 1.22 *************** *** 554,559 **** int node; ! if (sscanf(data, "nd ref=%*[\"']%d%*[\"']", &node) != 1) return -1; NodeIsInteresting(node); --- 554,560 ---- int node; ! if (sscanf(data, "nd ref=%*[\"']%d%*[\"']", &node) != 1) { return -1; + } NodeIsInteresting(node); *************** *** 776,780 **** WayLayer = ret; ! return ret; } --- 777,781 ---- WayLayer = ret; ! return 0; } Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** buildmap_osm_main.c 22 Sep 2010 15:32:33 -0000 1.20 --- buildmap_osm_main.c 23 Oct 2010 08:18:35 -0000 1.21 *************** *** 303,307 **** buildmap_db_sort(); ! buildmap_osm_save_custom(BuildMapFileName, ret); return ret; --- 303,307 ---- buildmap_db_sort(); ! buildmap_osm_save_custom(BuildMapFileName, (ret == 0) ? 1 : 0); return ret; |
From: Danny B. <dan...@us...> - 2010-10-20 07:40:41
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv10949 Modified Files: buildmap_osm_text.c Log Message: Clean up some stuff, move between passes. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** buildmap_osm_text.c 17 Oct 2010 12:48:03 -0000 1.20 --- buildmap_osm_text.c 20 Oct 2010 07:40:33 -0000 1.21 *************** *** 115,132 **** WaysMissingNode = 0; /**< Number of ways discarded due to missing nodes */ - #if 0 - /** - * @brief allow the user to specify a bounding box - */ - int HaveLonMin = 0, - HaveLonMax = 0, - HaveLatMin = 0, - HaveLatMax = 0, - LonMin = 0, - LonMax = 0, - LatMin = 0, - LatMax = 0; - #endif - /** * @brief table for translating the names in XML strings into readable format --- 115,118 ---- *************** *** 292,296 **** buildmap_osm_text_node(char *data) { ! int npoints, nchars, r; double flat, flon; char *p; --- 278,282 ---- buildmap_osm_text_node(char *data) { ! int nchars, r; double flat, flon; char *p; *************** *** 328,348 **** } - #if 0 - if ((HaveLonMin && (NodeLon < LonMin)) - || (HaveLonMax && (NodeLon > LonMax)) - || (HaveLatMin && (NodeLat < LatMin)) - || (HaveLatMax && (NodeLat > LatMax))) { - - /* Outside the specified bounding box, ignore this node */ - NodeLat = NodeLon = 0; - NodeLatRead = NodeLonRead = 0; - - return 1; - } - #endif - - npoints = buildmap_point_add(NodeLon, NodeLat); - buildmap_osm_text_point_add(NodeId, npoints); /* hack */ - return 0; } --- 314,317 ---- *************** *** 368,372 **** buildmap_osm_text_node_end_and_process(char *data) { ! // buildmap_info("buildmap_osm_text_node_end_and_process node id %d, place %s, Name %s, Postal %s\n", NodeId, NodePlace, NodeTownName, NodePostalCode); if (NodePlace && (strcmp(NodePlace, "town") == 0 || strcmp(NodePlace, "village") == 0 --- 337,342 ---- buildmap_osm_text_node_end_and_process(char *data) { ! int npoints; ! if (NodePlace && (strcmp(NodePlace, "town") == 0 || strcmp(NodePlace, "village") == 0 *************** *** 392,395 **** --- 362,369 ---- } + /* Add the node */ + npoints = buildmap_point_add(NodeLon, NodeLat); + buildmap_osm_text_point_add(NodeId, npoints); + buildmap_osm_text_reset_node(); return 0; *************** *** 605,609 **** */ if (NodeId) ! r += buildmap_osm_text_node_end(""); if (sscanf(data, "node id=%*[\"']%d%*[\"']", &NodeId) != 1) { --- 579,583 ---- */ if (NodeId) ! r += buildmap_osm_text_node_end_and_process(""); if (sscanf(data, "node id=%*[\"']%d%*[\"']", &NodeId) != 1) { *************** *** 749,767 **** /* street names */ ! if (strcmp(tag, "name") == 0) { if (WayStreetName) free(WayStreetName); WayStreetName = FromXmlAndDup(value); return 0; /* FIX ME ?? */ ! } else if (strcmp(tag, "landuse") == 0) { WayNotInteresting = 1; // buildmap_info("discarding way %d, landuse %s", in_way, data); ! } else if (strcmp(tag, "oneway") == 0 && strcmp(value, "yes") == 0) { WayIsOneWay = ROADMAP_LINE_DIRECTION_ONEWAY; ! } else if (strcmp(tag, "building") == 0) { if (strcasecmp(value, "yes") == 0) { WayNotInteresting = 1; } ! } else if (strcmp(tag, "ref") == 0) { if (WayStreetRef) free(WayStreetRef); --- 723,742 ---- /* street names */ ! if (strcasecmp(tag, "name") == 0) { if (WayStreetName) free(WayStreetName); WayStreetName = FromXmlAndDup(value); return 0; /* FIX ME ?? */ ! } else if (strcasecmp(tag, "landuse") == 0) { WayNotInteresting = 1; // buildmap_info("discarding way %d, landuse %s", in_way, data); ! } else if (strcasecmp(tag, "oneway") == 0 && strcasecmp(value, "yes") == 0) { WayIsOneWay = ROADMAP_LINE_DIRECTION_ONEWAY; ! } else if (strcasecmp(tag, "building") == 0) { if (strcasecmp(value, "yes") == 0) { WayNotInteresting = 1; + buildmap_verbose("buildmap_osm_text_tag(%d) building, not interesting", in_way); } ! } else if (strcasecmp(tag, "ref") == 0) { if (WayStreetRef) free(WayStreetRef); *************** *** 1239,1242 **** --- 1214,1218 ---- /* * Pass 1 - just figure out which ways are interesting + * Currently this is *all ways* but this may change. */ LineNo = 0; *************** *** 1287,1291 **** /* ! * Pass 2 - flag interesting nodes */ LineNo = 0; --- 1263,1268 ---- /* ! * Pass 2 - flag interesting nodes : any node (a <nd>) in a way, ! * but e.g. nodes that represent town definitions as well. */ LineNo = 0; *************** *** 1332,1336 **** /* ! * Pass 3 */ LineNo = 0; --- 1309,1314 ---- /* ! * Pass 3 - look for all <node>s, define the interesting ones. ! * Pass 3 - define ways flagged as interesting */ LineNo = 0; *************** *** 1366,1377 **** ret += buildmap_osm_text_node_interesting_end(p); continue; - #if 0 - } else if (strncasecmp(p, "nd", 2) == 0) { - ret += buildmap_osm_text_nd_pass1(p); - continue; - #endif } else if (strncasecmp(p, "tag", 3) == 0) { ret += buildmap_osm_text_tag(p); continue; } } --- 1344,1359 ---- ret += buildmap_osm_text_node_interesting_end(p); continue; } else if (strncasecmp(p, "tag", 3) == 0) { ret += buildmap_osm_text_tag(p); continue; + } else if (strncasecmp(p, "way", 3) == 0) { + ret += buildmap_osm_text_way(p); + continue; + } else if (strncasecmp(p, "/way", 4) == 0) { + ret += buildmap_osm_text_way_end(p); + continue; + } else if (strncasecmp(p, "nd", 2) == 0) { + ret += buildmap_osm_text_nd(p); + continue; } } *************** *** 1382,1387 **** passid++; /* ! * Pass 4 */ LineNo = 0; --- 1364,1370 ---- passid++; + #if 0 /* ! * Pass 4 - define ways flagged as interesting */ LineNo = 0; *************** *** 1409,1417 **** for (; *p && isspace(*p); p++) ; ! if (strncasecmp(p, "osm", 3) == 0) { ! continue; ! } else if (strncasecmp(p, "?xml", 4) == 0) { ! continue; ! } else if (strncasecmp(p, "way", 3) == 0) { ret += buildmap_osm_text_way(p); continue; --- 1392,1396 ---- for (; *p && isspace(*p); p++) ; ! if (strncasecmp(p, "way", 3) == 0) { ret += buildmap_osm_text_way(p); continue; *************** *** 1419,1426 **** ret += buildmap_osm_text_way_end(p); continue; - } else if (strncasecmp(p, "node", 4) == 0) { - continue; - } else if (strncasecmp(p, "/node", 5) == 0) { - continue; } else if (strncasecmp(p, "nd", 2) == 0) { ret += buildmap_osm_text_nd(p); --- 1398,1401 ---- *************** *** 1429,1450 **** ret += buildmap_osm_text_tag(p); continue; - } else if (strncasecmp(p, "relation", 8) == 0) { - continue; - } else if (strncasecmp(p, "/relation", 9) == 0) { - continue; - } else if (strncasecmp(p, "member", 6) == 0) { - continue; - } else if (strncasecmp(p, "/member", 7) == 0) { - continue; - } else if (strncasecmp(p, "bound", 5) == 0) { - continue; - } else if (strncasecmp(p, "bounds", 6) == 0) { - continue; - } else if (strncasecmp(p, "/bounds", 7) == 0) { - continue; - } else if (strncasecmp(p, "/osm", 4) == 0) { - continue; - } else { - buildmap_fatal(0, "invalid XML token (%s)", p); } } --- 1404,1407 ---- *************** *** 1458,1462 **** passid++; ! /* * End pass 4 --- 1415,1419 ---- passid++; ! #endif /* * End pass 4 |
From: Danny B. <dan...@us...> - 2010-10-17 12:48:11
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv8799 Modified Files: buildmap_osm_text.c Log Message: Work in progress, trying to get address info interpreted. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** buildmap_osm_text.c 2 Oct 2010 14:11:50 -0000 1.19 --- buildmap_osm_text.c 17 Oct 2010 12:48:03 -0000 1.20 *************** *** 115,132 **** WaysMissingNode = 0; /**< Number of ways discarded due to missing nodes */ /** * @brief allow the user to specify a bounding box */ - #if 0 - /* Mallorca ? */ - int HaveLonMin = 1, - HaveLonMax = 1, - HaveLatMin = 1, - HaveLatMax = 1, - LonMin = 2200000, - LonMax = 3150000, - LatMin = 39100000, - LatMax = 39950000; - #else int HaveLonMin = 0, HaveLonMax = 0, --- 115,122 ---- WaysMissingNode = 0; /**< Number of ways discarded due to missing nodes */ + #if 0 /** * @brief allow the user to specify a bounding box */ int HaveLonMin = 0, HaveLonMax = 0, *************** *** 210,213 **** --- 200,205 ---- buildmap_osm_text_reset_node(void) { + // buildmap_info("reset node %d", NodeId); + NodeId = 0; free(NodePlace); NodePlace = 0; *************** *** 336,339 **** --- 328,332 ---- } + #if 0 if ((HaveLonMin && (NodeLon < LonMin)) || (HaveLonMax && (NodeLon > LonMax)) *************** *** 347,350 **** --- 340,344 ---- return 1; } + #endif npoints = buildmap_point_add(NodeLon, NodeLat); *************** *** 362,382 **** buildmap_osm_text_node_end(char *data) { ! if (NodePlace && strcmp(NodePlace, "town") == 0) { /* We have a town, process it */ - if (NodeTownName && NodePostalCode) { - buildmap_verbose("Node %d town %s postal %s", - NodeId, NodeTownName, NodePostalCode); - } if (NodeTownName) { NodeFakeFips++; - // buildmap_verbose ("buildmap_osm_text_node_end: " - // "fake fips %d\n", NodeFakeFips); int year = 2008; - #if 0 - buildmap_verbose("Node %d town %s, no postal code", - NodeId, NodeTownName); - #endif RoadMapString s; s = buildmap_dictionary_add (DictionaryCity, (char *) NodeTownName, strlen(NodeTownName)); --- 356,383 ---- buildmap_osm_text_node_end(char *data) { ! buildmap_osm_text_reset_node(); ! return 0; ! } ! ! /** ! * @brief At the end of a node, process its data ! * @param data point to the line buffer ! * @return error indication ! */ ! int ! buildmap_osm_text_node_end_and_process(char *data) ! { ! // buildmap_info("buildmap_osm_text_node_end_and_process node id %d, place %s, Name %s, Postal %s\n", NodeId, NodePlace, NodeTownName, NodePostalCode); ! if (NodePlace && (strcmp(NodePlace, "town") == 0 ! || strcmp(NodePlace, "village") == 0 ! || strcmp(NodePlace, "city") == 0)) { /* We have a town, process it */ if (NodeTownName) { NodeFakeFips++; int year = 2008; RoadMapString s; + + // buildmap_info("buildmap_dictionary_add(%s)", NodeTownName); s = buildmap_dictionary_add (DictionaryCity, (char *) NodeTownName, strlen(NodeTownName)); *************** *** 413,487 **** static struct shapeinfo *shapes; - #if 0 - /* - * Count nodes - * Watch out : should be called in Pass 1. - */ - struct node_counter { - int count; - int node; - }; - struct node_counter_row { - int max, alloc; - struct node_counter *row; - }; - - static struct node_counter_row nc[256]; - static int node_counter_init = 0; - - /** - * @brief add one to the use counter of this node - * @param node a node id - */ - static void CountNode(int node) - { - int i, row; - - if (! node_counter_init) { - node_counter_init++; - for (i=0; i<256; i++) { - nc[i].max = nc[i].alloc = 0; - nc[i].row = NULL; - } - } - - row = node % 256; - for (i=0; i<nc[row].max; i++) - if (node == nc[row].row[i].node) { - nc[row].row[i].count++; - return; - } - - if (nc[row].alloc == nc[row].max) { - nc[row].alloc += 256; - nc[row].row = realloc(nc[row].row, - sizeof(struct node_counter) * nc[row].alloc); - } - - i = nc[row].max; - nc[row].row[i].node = node; - nc[row].row[i].count = 1; - nc[row].max++; - } - - /** - * @brief report the number of uses of this node - * @param node the node id - * @return the number of uses - */ - static int NodeReportUse(int node) - { - int row = node % 256; - int i; - - for (i=0; i<nc[row].max; i++) - if (node == nc[row].row[i].node) { - return nc[row].row[i].count; - } - buildmap_fatal(0, "NodeReportUse %d", node); - return -1; - } - #endif - /** * @brief --- 414,417 ---- *************** *** 530,535 **** int i; - // buildmap_info("WayIsInteresting(%d,%d)", wayid, ni); - if (nWayTable == maxWayTable) { maxWayTable += 1000; --- 460,463 ---- *************** *** 568,572 **** } - buildmap_info("IsWayInteresting(%d) : reposition", wayid); for (ptr=0; ptr<nWayTable; ptr++) if (wayid == WayTable[ptr].wayid) --- 496,499 ---- *************** *** 604,629 **** } - #if 0 - /** - * @brief - * @param data points into the line of text being processed - * @return error indication - * - * Example line : - * <nd ref="997470"/> - */ - static int - buildmap_osm_text_nd_pass1(char *data) - { - int node; - - if (sscanf(data, "nd ref=%*[\"']%d%*[\"']", &node) != 1) - return -1; - - // CountNode(node); - return 0; - } - #endif - static int maxNodeTable = 0; static int nNodeTable = 0; --- 531,534 ---- *************** *** 645,658 **** for (i=0; i<nNodeTable; i++) { if (NodeTable[i].nodeid == node) { - // buildmap_info("Duplicate interesting node %d", node); return; } } - // buildmap_info("NodeIsInteresting(%d)", node); NodeTable[nNodeTable].nodeid = node; nNodeTable++; } /** * @brief this <nd> is interesting, register it so we can later treat its <node> --- 550,573 ---- for (i=0; i<nNodeTable; i++) { if (NodeTable[i].nodeid == node) { return; } } NodeTable[nNodeTable].nodeid = node; nNodeTable++; } + /* FIX ME */ + static int + IsNodeInteresting(int node) + { + int i; + for (i=0; i<nNodeTable; i++) { + if (NodeTable[i].nodeid == node) + return 1; + } + return 0; + } + /** * @brief this <nd> is interesting, register it so we can later treat its <node> *************** *** 677,689 **** buildmap_osm_text_node_interesting(char *data) { ! int node, r; ! if (sscanf(data, "node id=%*[\"']%d%*[\"']", &node) != 1) return -1; ! // buildmap_verbose("buildmap_osm_text_node_interesting(%d)", node); ! r = buildmap_osm_text_node(data); ! r += buildmap_osm_text_node_end(data); - // buildmap_info("NodeInteresting(%d)", node); return r; } --- 592,616 ---- buildmap_osm_text_node_interesting(char *data) { ! int r = 0; ! // buildmap_verbose("buildmap_osm_text_node_interesting(%d)", NodeId); ! /* ! * Avoid figuring out whether we're in a ! * <node ... /> ! * or ! * <node ... > ! * .. ! * </node> ! * case, by resetting first if needed. ! */ ! if (NodeId) ! r += buildmap_osm_text_node_end(""); ! ! if (sscanf(data, "node id=%*[\"']%d%*[\"']", &NodeId) != 1) { return -1; ! } ! ! r += buildmap_osm_text_node(data); return r; } *************** *** 695,704 **** buildmap_osm_text_node_interesting_end(char *data) { ! int node; ! if (sscanf(data, "node id=%*[\"']%d%*[\"']", &node) != 1) ! return -1; ! buildmap_verbose("buildmap_osm_text_node_interesting_end(%d)", node); ! return buildmap_osm_text_node_end(data); ! // return 0; } --- 622,630 ---- buildmap_osm_text_node_interesting_end(char *data) { ! // buildmap_verbose("buildmap_osm_text_node_interesting_end(%d)", NodeId); ! if (IsNodeInteresting(NodeId)) ! return buildmap_osm_text_node_end_and_process(data); ! else ! return 0; } *************** *** 774,777 **** --- 700,704 ---- free(NodePostalCode); NodePostalCode = strdup(tagv); + NodeIsInteresting(NodeId); } else if (strcmp(tagk, "place") == 0) { /* <tag k="place" v="town"/> */ *************** *** 779,782 **** --- 706,710 ---- free(NodePlace); NodePlace = strdup(tagv); + NodeIsInteresting(NodeId); } else if (strcmp(tagk, "name") == 0) { /* <tag k="name" v="Herent"/> */ *************** *** 784,788 **** --- 712,718 ---- free(NodeTownName); NodeTownName = FromXmlAndDup(tagv); + NodeIsInteresting(NodeId); } + return 0; } *************** *** 1342,1346 **** ret += buildmap_osm_text_tag(p); continue; ! } } --- 1272,1282 ---- ret += buildmap_osm_text_tag(p); continue; ! } else if (strncasecmp(p, "node", 4) == 0) { ! ret += buildmap_osm_text_node(p); ! continue; ! } else if (strncasecmp(p, "/node", 5) == 0) { ! ret += buildmap_osm_text_node_end(p); ! continue; ! } } *************** *** 1355,1358 **** --- 1291,1296 ---- LineNo = 0; fseek(fdata, 0L, SEEK_SET); + buildmap_osm_text_reset_way(); + buildmap_osm_text_reset_node(); while (! feof(fdata)) { *************** *** 1399,1402 **** --- 1337,1342 ---- NumNodes = 0; fseek(fdata, 0L, SEEK_SET); + buildmap_osm_text_reset_way(); + buildmap_osm_text_reset_node(); while (! feof(fdata)) { *************** *** 1430,1437 **** ret += buildmap_osm_text_nd_pass1(p); continue; } else if (strncasecmp(p, "tag", 3) == 0) { ret += buildmap_osm_text_tag(p); continue; - #endif } } --- 1370,1377 ---- ret += buildmap_osm_text_nd_pass1(p); continue; + #endif } else if (strncasecmp(p, "tag", 3) == 0) { ret += buildmap_osm_text_tag(p); continue; } } *************** *** 1447,1450 **** --- 1387,1392 ---- LineNo = 0; fseek(fdata, 0L, SEEK_SET); + buildmap_osm_text_reset_way(); + buildmap_osm_text_reset_node(); while (! feof(fdata)) { |
From: Danny B. <dan...@us...> - 2010-10-11 19:38:14
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27517 Modified Files: roadmap_db_polygon.h buildmap_polygon.c rdmxchange_main.c Makefile Log Message: This is the change just approved, but with the #if 0 deleted instead of conditionally compiled. This removes a bit of old code in buildmap. Index: roadmap_db_polygon.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_polygon.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_db_polygon.h 18 Dec 2007 21:22:13 -0000 1.7 --- roadmap_db_polygon.h 11 Oct 2010 19:38:06 -0000 1.8 *************** *** 1,8 **** ! /* roadmap_polygon.h - the format of the polygon table used by RoadMap. ! * ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright 2010 Danny Backx * * This file is part of RoadMap. *************** *** 21,26 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: * * The RoadMap polygons are described by the following tables: --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief roadmap_polygon.h - the format of the polygon table used by RoadMap. * * The RoadMap polygons are described by the following tables: *************** *** 52,58 **** } RoadMapPolygon; - /* Table polygons/points (old code only) is an array of int. */ - typedef int RoadMapPolygonPoint; - /* Table polygons/lines is an array of int. */ typedef int RoadMapPolygonLine; --- 54,57 ---- Index: rdmxchange_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rdmxchange_main.c 6 Feb 2006 01:46:15 -0000 1.5 --- rdmxchange_main.c 11 Oct 2010 19:38:06 -0000 1.6 *************** *** 266,270 **** rdmxchange_main_declare (&RoadMapStreetExport, &RdmXchangeStreetImport); rdmxchange_main_declare (&RoadMapRangeExport, &RdmXchangeRangeImport); ! rdmxchange_main_declare (&RoadMapPolygonExport, &RdmXchangePolygonImport); rdmxchange_main_declare (&RoadMapShapeExport, &RdmXchangeShapeImport); rdmxchange_main_declare (&RoadMapLineExport, &RdmXchangeLineImport); --- 266,270 ---- rdmxchange_main_declare (&RoadMapStreetExport, &RdmXchangeStreetImport); rdmxchange_main_declare (&RoadMapRangeExport, &RdmXchangeRangeImport); ! // rdmxchange_main_declare (&RoadMapPolygonExport, &RdmXchangePolygonImport); rdmxchange_main_declare (&RoadMapShapeExport, &RdmXchangeShapeImport); rdmxchange_main_declare (&RoadMapLineExport, &RdmXchangeLineImport); *************** *** 276,279 **** --- 276,281 ---- &RdmXchangeDictionaryImport); + fprintf(stderr, "\nNOTE : this program is not up to date, " + "e.g. the 'polygon' tables are not converted\n"); for (i = 1; i < argc; ++i) { Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** Makefile 17 Aug 2010 18:57:10 -0000 1.144 --- Makefile 11 Oct 2010 19:38:06 -0000 1.145 *************** *** 170,174 **** rdmxchange_line.c \ rdmxchange_shape.c \ - rdmxchange_polygon.c \ rdmxchange_square.c \ rdmxchange_street.c \ --- 170,173 ---- Index: buildmap_polygon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_polygon.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** buildmap_polygon.c 12 May 2009 13:53:32 -0000 1.15 --- buildmap_polygon.c 11 Oct 2010 19:38:06 -0000 1.16 *************** *** 3,7 **** * * Copyright 2002 Pascal F. Martin ! * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. --- 3,7 ---- * * Copyright 2002 Pascal F. Martin ! * Copyright (c) 2009, 2010 Danny Backx. * * This file is part of RoadMap. *************** *** 897,921 **** buildmap_db *root; buildmap_db *head_table; - buildmap_db *point_table; buildmap_db *line_table; ! ! buildmap_info ("saving polygons..."); ! ! /* Create empty old-style "polygon" tables, to satisfy old ! * RoadMap code that might be asked to use this db. (without this, ! * old code will segv.) ! */ ! root = buildmap_db_add_section (NULL, "polygon"); ! if (root == NULL) buildmap_fatal (0, "Can't add a new section"); ! ! head_table = buildmap_db_add_section (root, "head"); ! if (head_table == NULL) buildmap_fatal (0, "Can't add a new section"); ! buildmap_db_add_data (head_table, 0, sizeof(RoadMapPolygon)); ! ! point_table = buildmap_db_add_section (root, "point"); ! if (point_table == NULL) buildmap_fatal (0, "Can't add a new section"); ! buildmap_db_add_data (point_table, 0, sizeof(RoadMapPolygonPoint)); ! /* Create the new-style "polygons" (note new name) tables, --- 897,903 ---- buildmap_db *root; buildmap_db *head_table; buildmap_db *line_table; ! buildmap_info ("saving %d polygons...", PolygonLineCount); /* Create the new-style "polygons" (note new name) tables, *************** *** 923,927 **** */ if (PolygonLineCount > 0xffff) { ! buildmap_fatal (0, "too many polygon lines"); } --- 905,909 ---- */ if (PolygonLineCount > 0xffff) { ! buildmap_fatal (0, "too many polygon lines - %d, max %d", PolygonLineCount, 0xffff); } *************** *** 981,985 **** if (one_polygon->count > 0xfffff) { ! buildmap_fatal (0, "too many polygon lines"); } buildmap_polygon_set_count(db_poly, one_polygon->count); --- 963,967 ---- if (one_polygon->count > 0xfffff) { ! buildmap_fatal (0, "too many polygon lines (%d, max %d)", one_polygon->count, 0xfffff); } buildmap_polygon_set_count(db_poly, one_polygon->count); |
From: Danny B. <dan...@us...> - 2010-10-02 14:11:59
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv17799 Modified Files: buildmap_osm_text.c Log Message: Dramatic speedup by using (blush) a hash instead of a simplistic search. Split up the logic to allow more structured buildup of knowledge, preparing for work as suggested on the list recently. As trial, hardcode to ignore <tag k='building' v='yes'/> for now, and don't include the nodes associated with such a way in the map. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** buildmap_osm_text.c 19 Sep 2010 07:55:27 -0000 1.18 --- buildmap_osm_text.c 2 Oct 2010 14:11:50 -0000 1.19 *************** *** 2,6 **** * LICENSE: * ! * Copyright (c) 2008, 2009, Danny Backx. * * Based on code Copyright 2007 Paul Fox that interprets the OSM --- 2,6 ---- * LICENSE: * ! * Copyright (c) 2008, 2009, 2010, Danny Backx. * * Based on code Copyright 2007 Paul Fox that interprets the OSM *************** *** 49,52 **** --- 49,53 ---- #include "roadmap_osm.h" #include "roadmap_line.h" + #include "roadmap_hash.h" #include "buildmap.h" *************** *** 98,103 **** static int NodeFakeFips; /**< fake postal code */ ! static int WayLandUseNotInteresting = 0; /**< land use not interesting ! for RoadMap */ /** --- 99,103 ---- static int NodeFakeFips; /**< fake postal code */ ! static int WayNotInteresting = 0; /**< this way is not interesting for RoadMap */ /** *************** *** 111,116 **** static int nsplits = 0; /**< number of times we've split a way */ ! static int WaysSplit = 0, /**< Number of ways that were split */ ! WaysNotSplit = 0; /**< Number of ways not split */ /** --- 111,117 ---- static int nsplits = 0; /**< number of times we've split a way */ ! static int WaysSplit = 0, /**< Number of ways that were split */ ! WaysNotSplit = 0, /**< Number of ways not split */ ! WaysMissingNode = 0; /**< Number of ways discarded due to missing nodes */ /** *************** *** 240,248 **** } *points = 0; static void buildmap_osm_text_point_add(int id, int npoint) { if (nPoints == nPointsAlloc) { ! nPointsAlloc += 10000; points = realloc(points, sizeof(struct points) * nPointsAlloc); if (!points) --- 241,259 ---- } *points = 0; + #define NPOINTSINC 10000 + + RoadMapHash *PointsHash = NULL; + static void buildmap_osm_text_point_add(int id, int npoint) { if (nPoints == nPointsAlloc) { ! nPointsAlloc += NPOINTSINC; ! ! if (PointsHash == NULL) ! PointsHash = roadmap_hash_new("PointsHash", nPointsAlloc); ! else ! roadmap_hash_resize(PointsHash, nPointsAlloc); ! points = realloc(points, sizeof(struct points) * nPointsAlloc); if (!points) *************** *** 250,253 **** --- 261,266 ---- } + roadmap_hash_add(PointsHash, id, nPoints); + points[nPoints].id = id; points[nPoints++].npoint = npoint; *************** *** 264,269 **** int i; ! /* fix me, this needs to be speed up */ ! for (i=0; i<nPoints; i++) if (points[i].id == id) return points[i].npoint; --- 277,283 ---- int i; ! for (i = roadmap_hash_get_first(PointsHash, id); ! i >= 0; ! i = roadmap_hash_get_next(PointsHash, i)) if (points[i].id == id) return points[i].npoint; *************** *** 399,402 **** --- 413,417 ---- static struct shapeinfo *shapes; + #if 0 /* * Count nodes *************** *** 467,470 **** --- 482,486 ---- return -1; } + #endif /** *************** *** 493,497 **** */ sscanf(data, "way id=%*[\"']%d%*[\"']", &in_way); ! WayLandUseNotInteresting = 0; if (in_way == 0) --- 509,513 ---- */ sscanf(data, "way id=%*[\"']%d%*[\"']", &in_way); ! WayNotInteresting = 0; if (in_way == 0) *************** *** 500,503 **** --- 516,608 ---- } + static int maxWayTable = 0; + static int nWayTable = 0; + static int interestingWays = 0; + typedef struct WayTableStruct { + int wayid; + int notinteresting; + } WayTableStruct; + static WayTableStruct *WayTable = NULL; + + static void + WayIsInteresting(int wayid, int ni) + { + int i; + + // buildmap_info("WayIsInteresting(%d,%d)", wayid, ni); + + if (nWayTable == maxWayTable) { + maxWayTable += 1000; + WayTable = (struct WayTableStruct *) realloc(WayTable, + sizeof(struct WayTableStruct) * maxWayTable); + } + + for (i=0; i<nWayTable; i++) + if (WayTable[i].wayid == wayid) + return; + + WayTable[nWayTable].wayid = wayid; + WayTable[nWayTable].notinteresting = ni; + nWayTable++; + if (ni == 0) + interestingWays++; + } + + /** + * @brief find out if this way is interesting + * @param wayid + * @return inverted !! + * + * Note : relies on the order of ways encountered in the file, for performance + */ + static int + IsWayInteresting(int wayid) + { + static int ptr = 0; + + if (wayid == WayTable[ptr].wayid) + return WayTable[ptr].notinteresting; + if (wayid == WayTable[ptr+1].wayid) { + ptr++; + return WayTable[ptr].notinteresting; + } + + buildmap_info("IsWayInteresting(%d) : reposition", wayid); + for (ptr=0; ptr<nWayTable; ptr++) + if (wayid == WayTable[ptr].wayid) + return WayTable[ptr].notinteresting; + + /* Should not happen */ + buildmap_fatal(0, "IsWayInteresting(%d): unknown way", wayid); + return 0; /* to avoid compiler warning */ + } + + /** + * @brief to figure out early (in pass 1) whether this is an interesting way + * @param data + * @return + */ + static int + buildmap_osm_text_way_pass1(char *data) + { + sscanf(data, "way id=%*[\"']%d%*[\"']", &in_way); + WayNotInteresting = 0; + return 0; + } + + /** + * @brief to figure out early (in pass 1) whether this is an interesting way + * @param data + * @return + */ + static int + buildmap_osm_text_way_end_pass1(char *data) + { + WayIsInteresting(in_way, WayNotInteresting); + buildmap_osm_text_reset_way(); + return 0; + } + + #if 0 /** * @brief *************** *** 516,523 **** return -1; ! CountNode(node); return 0; } /** * @brief --- 621,707 ---- return -1; ! // CountNode(node); ! return 0; ! } ! #endif ! ! static int maxNodeTable = 0; ! static int nNodeTable = 0; ! typedef struct NodeTableStruct { ! int nodeid; ! } NodeTableStruct; ! static NodeTableStruct *NodeTable = NULL; ! ! static void ! NodeIsInteresting(int node) ! { ! int i; ! ! if (nNodeTable == maxNodeTable) { ! maxNodeTable += 1000; ! NodeTable = (struct NodeTableStruct *) realloc(NodeTable, ! sizeof(struct NodeTableStruct) * maxNodeTable); ! } ! for (i=0; i<nNodeTable; i++) { ! if (NodeTable[i].nodeid == node) { ! // buildmap_info("Duplicate interesting node %d", node); ! return; ! } ! } ! ! // buildmap_info("NodeIsInteresting(%d)", node); ! NodeTable[nNodeTable].nodeid = node; ! nNodeTable++; ! } ! ! /** ! * @brief this <nd> is interesting, register it so we can later treat its <node> ! * @param data ! * @return ! */ ! static int ! buildmap_osm_text_nd_interesting(char *data) ! { ! int node; ! ! if (sscanf(data, "nd ref=%*[\"']%d%*[\"']", &node) != 1) ! return -1; ! ! NodeIsInteresting(node); ! ! // CountNode(node); return 0; } + static int + buildmap_osm_text_node_interesting(char *data) + { + int node, r; + + if (sscanf(data, "node id=%*[\"']%d%*[\"']", &node) != 1) + return -1; + // buildmap_verbose("buildmap_osm_text_node_interesting(%d)", node); + r = buildmap_osm_text_node(data); + r += buildmap_osm_text_node_end(data); + + // buildmap_info("NodeInteresting(%d)", node); + return r; + } + + /** + * @build this is called on every node, but should figure out whether it is interesting + */ + static int + buildmap_osm_text_node_interesting_end(char *data) + { + int node; + if (sscanf(data, "node id=%*[\"']%d%*[\"']", &node) != 1) + return -1; + buildmap_verbose("buildmap_osm_text_node_interesting_end(%d)", node); + return buildmap_osm_text_node_end(data); + // return 0; + } + + /** * @brief *************** *** 543,547 **** --- 727,735 ---- if (ix < 0) { /* Inconsistent OSM file, this node is not defined */ + /* Only count if we didn't already know this */ + if (WayInvalid == 0) + WaysMissingNode++; WayInvalid = 1; + buildmap_verbose("Invalid way %d due to missing node %d", in_way, node); return 0; } *************** *** 637,644 **** return 0; /* FIX ME ?? */ } else if (strcmp(tag, "landuse") == 0) { ! WayLandUseNotInteresting = 1; // buildmap_info("discarding way %d, landuse %s", in_way, data); } else if (strcmp(tag, "oneway") == 0 && strcmp(value, "yes") == 0) { WayIsOneWay = ROADMAP_LINE_DIRECTION_ONEWAY; } else if (strcmp(tag, "ref") == 0) { if (WayStreetRef) --- 825,836 ---- return 0; /* FIX ME ?? */ } else if (strcmp(tag, "landuse") == 0) { ! WayNotInteresting = 1; // buildmap_info("discarding way %d, landuse %s", in_way, data); } else if (strcmp(tag, "oneway") == 0 && strcmp(value, "yes") == 0) { WayIsOneWay = ROADMAP_LINE_DIRECTION_ONEWAY; + } else if (strcmp(tag, "building") == 0) { + if (strcasecmp(value, "yes") == 0) { + WayNotInteresting = 1; + } } else if (strcmp(tag, "ref") == 0) { if (WayStreetRef) *************** *** 704,712 **** buildmap_fatal(0, "Wasn't in a way (%s)", data); ! if (WayLandUseNotInteresting || WayLayer == 0) { ! #if 0 ! buildmap_info("discarding way %d, landuse %s", in_way, data); ! #endif ! WayLandUseNotInteresting = 0; buildmap_osm_text_reset_way(); return 0; --- 896,903 ---- buildmap_fatal(0, "Wasn't in a way (%s)", data); ! if (WayNotInteresting || WayLayer == 0) { ! buildmap_verbose("discarding way %d, not interesting (%s)", in_way, data); ! ! WayNotInteresting = 0; buildmap_osm_text_reset_way(); return 0; *************** *** 799,806 **** from_ix = 0; for (j=1; j<nWayNodes-1; j++) { int point = WayNodes[j]; if (NodeReportUse(point) <= 1) continue; ! int k, num; --- 990,999 ---- from_ix = 0; for (j=1; j<nWayNodes-1; j++) { + #if 0 int point = WayNodes[j]; + if (NodeReportUse(point) <= 1) continue; ! #endif int k, num; *************** *** 1085,1090 **** * not a big time consumer !) * ! * Pass 1 deals with node definitions only. ! * Pass 2 interprets ways and a few tags. * All underlying processing is passed to other functions. */ --- 1278,1285 ---- * not a big time consumer !) * ! * Pass 1 deals with way definitions. ! * Pass 2 deals with node definitions only. ! * Pass 3 interprets ways and a few tags. ! * * All underlying processing is passed to other functions. */ *************** *** 1092,1104 **** buildmap_osm_text_read(FILE * fdata, int country_num, int division_num) { ! char *got; ! static char buf[LINELEN]; ! int ret = 0; ! char *p; ! time_t t0, t1, t2, t3; NodeFakeFips = 1000000 + country_num * 1000 + division_num; ! (void) time(&t0); DictionaryPrefix = buildmap_dictionary_open("prefix"); --- 1287,1301 ---- buildmap_osm_text_read(FILE * fdata, int country_num, int division_num) { ! char *got; ! static char buf[LINELEN]; ! int ret = 0; ! char *p; ! time_t t[10]; ! int passid, NumNodes, NumWays; NodeFakeFips = 1000000 + country_num * 1000 + division_num; ! passid = 1; ! (void) time(&t[passid - 1]); DictionaryPrefix = buildmap_dictionary_open("prefix"); *************** *** 1111,1117 **** /* ! * Pass 1 */ LineNo = 0; while (! feof(fdata)) { --- 1308,1315 ---- /* ! * Pass 1 - just figure out which ways are interesting */ LineNo = 0; + NumWays = 0; while (! feof(fdata)) { *************** *** 1134,1185 **** for (; *p && isspace(*p); p++) ; ! if (strncasecmp(p, "osm", 3) == 0) { ! continue; ! } else if (strncasecmp(p, "?xml", 4) == 0) { ! continue; ! } else if (strncasecmp(p, "way", 3) == 0) { ! // ret += buildmap_osm_text_way(p); continue; } else if (strncasecmp(p, "/way", 4) == 0) { ! // ret += buildmap_osm_text_way_end(p); ! continue; ! } else if (strncasecmp(p, "node", 4) == 0) { ! ret += buildmap_osm_text_node(p); ! continue; ! } else if (strncasecmp(p, "/node", 5) == 0) { ! ret += buildmap_osm_text_node_end(p); ! continue; ! } else if (strncasecmp(p, "nd", 2) == 0) { ! ret += buildmap_osm_text_nd_pass1(p); continue; } else if (strncasecmp(p, "tag", 3) == 0) { ret += buildmap_osm_text_tag(p); continue; ! } else if (strncasecmp(p, "relation", 8) == 0) { continue; ! } else if (strncasecmp(p, "/relation", 9) == 0) { continue; ! } else if (strncasecmp(p, "member", 6) == 0) { continue; ! } else if (strncasecmp(p, "/member", 7) == 0) { continue; ! } else if (strncasecmp(p, "bound", 5) == 0) { continue; ! } else if (strncasecmp(p, "bounds", 6) == 0) { continue; ! } else if (strncasecmp(p, "/bounds", 7) == 0) { continue; ! } else if (strncasecmp(p, "/osm", 4) == 0) { continue; ! } else { ! buildmap_fatal(0, "invalid XML token (%s)", p); } } ! (void) time(&t1); ! buildmap_info("Pass 1 : %d lines read (%d seconds)", LineNo, t1 - t0); /* ! * Pass 2 */ LineNo = 0; --- 1332,1447 ---- for (; *p && isspace(*p); p++) ; ! if (strncasecmp(p, "way", 3) == 0) { ! ret += buildmap_osm_text_way_pass1(p); ! NumWays++; continue; } else if (strncasecmp(p, "/way", 4) == 0) { ! ret += buildmap_osm_text_way_end_pass1(p); continue; } else if (strncasecmp(p, "tag", 3) == 0) { ret += buildmap_osm_text_tag(p); continue; ! } ! } ! ! (void) time(&t[passid]); ! buildmap_info("Pass %d : %d lines read (%d seconds)", ! passid, LineNo, t[passid] - t[passid - 1]); ! passid++; ! ! /* ! * Pass 2 - flag interesting nodes ! */ ! LineNo = 0; ! fseek(fdata, 0L, SEEK_SET); ! ! while (! feof(fdata)) { ! buildmap_set_line(++LineNo); ! got = fgets(buf, LINELEN, fdata); ! if (got == NULL) { ! if (feof(fdata)) ! break; ! buildmap_fatal(0, "short read (length)"); ! } ! ! /* Figure out the XML */ ! for (p=buf; *p && isspace(*p); p++) ; ! if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') ! buildmap_fatal(0, "invalid XML (line %d, %s)", LineNo, buf); ! ! p++; /* point to character after '<' now */ ! for (; *p && isspace(*p); p++) ; ! ! if (strncasecmp(p, "way", 3) == 0) { ! ret += buildmap_osm_text_way_pass1(p); continue; ! } else if (strncasecmp(p, "/way", 4) == 0) { ! ret += buildmap_osm_text_way_end_pass1(p); continue; ! } else if (strncasecmp(p, "nd", 2) == 0) { ! if (in_way && ! IsWayInteresting(in_way)) ! ret += buildmap_osm_text_nd_interesting(p); continue; ! } ! } ! ! (void) time(&t[passid]); ! buildmap_info("Pass %d : %d lines read (%d seconds)", ! passid, LineNo, t[passid] - t[passid - 1]); ! passid++; ! ! /* ! * Pass 3 ! */ ! LineNo = 0; ! NumNodes = 0; ! fseek(fdata, 0L, SEEK_SET); ! ! while (! feof(fdata)) { ! buildmap_set_line(++LineNo); ! got = fgets(buf, LINELEN, fdata); ! if (got == NULL) { ! if (feof(fdata)) ! break; ! buildmap_fatal(0, "short read (length)"); ! } ! ! /* Figure out the XML */ ! for (p=buf; *p && isspace(*p); p++) ; ! if (*p == '\n' || *p == '\r') continue; ! if (*p != '<') ! buildmap_fatal(0, "invalid XML (line %d, %s)", LineNo, buf); ! ! p++; /* point to character after '<' now */ ! for (; *p && isspace(*p); p++) ; ! ! if (strncasecmp(p, "node", 4) == 0) { ! ret += buildmap_osm_text_node_interesting(p); ! NumNodes++; continue; ! } else if (strncasecmp(p, "/node", 5) == 0) { ! ret += buildmap_osm_text_node_interesting_end(p); continue; ! #if 0 ! } else if (strncasecmp(p, "nd", 2) == 0) { ! ret += buildmap_osm_text_nd_pass1(p); continue; ! } else if (strncasecmp(p, "tag", 3) == 0) { ! ret += buildmap_osm_text_tag(p); ! continue; ! #endif } } ! (void) time(&t[passid]); ! buildmap_info("Pass %d : %d lines read (%d seconds)", ! passid, LineNo, t[passid] - t[passid - 1]); ! passid++; /* ! * Pass 4 */ LineNo = 0; *************** *** 1216,1223 **** continue; } else if (strncasecmp(p, "node", 4) == 0) { - // ret += buildmap_osm_text_node(p); continue; } else if (strncasecmp(p, "/node", 5) == 0) { - // ret += buildmap_osm_text_node_end(p); continue; } else if (strncasecmp(p, "nd", 2) == 0) { --- 1478,1483 ---- *************** *** 1248,1261 **** } ! (void) time(&t2); ! buildmap_info("Pass 2 : %d lines read (%d seconds)", LineNo, t2 - t1); /* ! * End pass 2 */ buildmap_osm_text_ways_shapeinfo(); - (void) time(&t3); - buildmap_info("Shape info processed (%d seconds)", t3 - t2); buildmap_info("Splits %d, ways split %d, not split %d", --- 1508,1529 ---- } ! (void) time(&t[passid]); ! buildmap_info("Pass %d : %d lines read (%d seconds)", ! passid, LineNo, t[passid] - t[passid - 1]); ! buildmap_info("Ways %d, interesting %d, discarded (missing node) %d", ! NumWays, interestingWays, WaysMissingNode); ! buildmap_info("Number of nodes : %d, interesting %d", NumNodes, nNodeTable); ! ! passid++; /* ! * End pass 4 */ buildmap_osm_text_ways_shapeinfo(); + (void) time(&t[passid]); + buildmap_info("Pass %d : %d lines read (%d seconds)", + passid, LineNo, t[passid] - t[passid - 1]); + passid++; buildmap_info("Splits %d, ways split %d, not split %d", |
From: Danny B. <dan...@us...> - 2010-09-22 15:32:41
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv26617 Modified Files: roadmap_iso.c buildmap_osm_main.c Log Message: This fixes the two buildmap issues reported recently : - report an error to the user if using -i with -o and the other way around - be able to cope with path elements preceding file names in some format (strip the directory before analysing the file name) Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** buildmap_osm_main.c 5 Sep 2010 20:53:56 -0000 1.19 --- buildmap_osm_main.c 22 Sep 2010 15:32:33 -0000 1.20 *************** *** 818,823 **** count = 1; ! } else if (*inputfile) { exit(buildmap_osm_text_process_file(inputfile)); } else { --- 818,827 ---- count = 1; ! } else if (*inputfile && *BuildMapFileName) { exit(buildmap_osm_text_process_file(inputfile)); + } else if (*inputfile) { + usage(argv[0], "cannot specify -i without -o"); + } else if (*BuildMapFileName) { + usage(argv[0], "cannot specify -o without -i"); } else { Index: roadmap_iso.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_iso.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_iso.c 21 Sep 2010 16:48:17 -0000 1.2 --- roadmap_iso.c 22 Sep 2010 15:32:33 -0000 1.3 *************** *** 336,343 **** { int n; ! char pattern[32]; sprintf(pattern, "iso-%%[a-zA-Z]-%%[a-zA-Z0-9]%s", suffix); ! n = sscanf(fn, pattern, country, division); if (strlen(country) != 2) return 0; --- 336,346 ---- { int n; ! char pattern[32], *p; ! ! /* Find last path separator, if any */ ! p = strrchr(fn, '/'); sprintf(pattern, "iso-%%[a-zA-Z]-%%[a-zA-Z0-9]%s", suffix); ! n = sscanf(p ? p+1 : fn, pattern, country, division); if (strlen(country) != 2) return 0; *************** *** 421,426 **** { int n, f; ! n = sscanf(fn, "usc%d.rdm", &f); if (n != 1) return 0; --- 424,433 ---- { int n, f; + char *p; ! /* find last path separator, if any */ ! p = strrchr(fn, '/'); ! ! n = sscanf(p ? p+1 : fn, "usc%d.rdm", &f); if (n != 1) return 0; |
From: Danny B. <dan...@us...> - 2010-09-21 16:48:25
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv2535 Modified Files: roadmap_iso.c Log Message: Commit a patch I sent to the list a couple of days ago. - Don't use a iso-division-COUNTRY file if the division is already numeric. - Hardcode the path name for a map file based on that same assumption. Index: roadmap_iso.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_iso.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_iso.c 16 Oct 2008 19:38:45 -0000 1.1 --- roadmap_iso.c 21 Sep 2010 16:48:17 -0000 1.2 *************** *** 300,304 **** * @param fips the input parameter * - * FIX ME maybe this function should build a list of possible file names instead of just one */ void roadmap_iso_mapfile_from_fips(char *buf, int fips) --- 300,303 ---- *************** *** 306,317 **** int i, j; int country = (fips / 1000) % 1000; for (i=0; IsoCountryCodeTable[i].name; i++) if (IsoCountryCodeTable[i].numeric == country) { ! sprintf(buf, "iso-%s.rdm", IsoCountryCodeTable[i].alpha2); for (j=0; buf[j]; j++) buf[j] = tolower(buf[j]); return; } } --- 305,318 ---- int i, j; int country = (fips / 1000) % 1000; + int division = fips % 1000; for (i=0; IsoCountryCodeTable[i].name; i++) if (IsoCountryCodeTable[i].numeric == country) { ! sprintf(buf, "iso-%s-%03d.rdm", IsoCountryCodeTable[i].alpha2, division); for (j=0; buf[j]; j++) buf[j] = tolower(buf[j]); return; } + /* wtf ? */ } *************** *** 363,366 **** --- 364,371 ---- * This function looks up the "division" in a file that is supposed to * contain stuff about the "country". + * + * Except if the division we have is numeric, then no file is involved, + * and the string is converted into a number. + * * The file is named "iso-division-%s [.txt]", and contains one line * per entry, each line has a number (this is what we look for), *************** *** 381,384 **** --- 386,395 ---- int num; + if ((strlen(division) == 3 && isdigit(division[0]) && isdigit(division[1]) + && isdigit(division[2])) + || (strlen(division) == 2 && isdigit(division[0]) && isdigit(division[1]))) { + return atoi(division); + } + sprintf(mfn, "iso-division-%s" _TXT, country); f = fopen(mfn, "r"); |