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...> - 2008-08-05 05:42:49
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19822/unix Added Files: .cvsignore Log Message: Tell CVS not to talk about files in here. --- NEW FILE: .cvsignore --- .depends.mk |
|
From: Danny B. <dan...@us...> - 2008-08-05 05:42:49
|
Update of /cvsroot/roadmap/roadmap/src/qt4 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19822/qt4 Added Files: .cvsignore Log Message: Tell CVS not to talk about files in here. --- NEW FILE: .cvsignore --- .depends.mk |
|
From: Danny B. <dan...@us...> - 2008-08-05 05:42:49
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19822/gpx Added Files: .cvsignore Log Message: Tell CVS not to talk about files in here. --- NEW FILE: .cvsignore --- .depends.mk |
|
From: Danny B. <dan...@us...> - 2008-08-05 05:42:49
|
Update of /cvsroot/roadmap/roadmap/src/gtk In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19822/gtk Added Files: .cvsignore Log Message: Tell CVS not to talk about files in here. --- NEW FILE: .cvsignore --- .depends.mk |
|
From: Danny B. <dan...@us...> - 2008-08-05 05:42:49
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19822/qt Added Files: .cvsignore Log Message: Tell CVS not to talk about files in here. --- NEW FILE: .cvsignore --- .depends.mk |
|
From: Danny B. <dan...@us...> - 2008-08-05 05:42:49
|
Update of /cvsroot/roadmap/roadmap/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19822/gtk2 Added Files: .cvsignore Log Message: Tell CVS not to talk about files in here. --- NEW FILE: .cvsignore --- .depends.mk gtkroadgps gtkroadmap |
|
From: Danny B. <dan...@us...> - 2008-08-05 05:42:49
|
Update of /cvsroot/roadmap/roadmap/src/agg_support In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19822/agg_support Added Files: .cvsignore Log Message: Tell CVS not to talk about files in here. --- NEW FILE: .cvsignore --- .depends.mk |
|
From: Paul F. <pg...@us...> - 2008-08-04 23:25:56
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv528 Modified Files: buildmap_osm_binary.c buildmap_osm_main.c Log Message: fix typo errors in recent buildmap_osm changes. Index: buildmap_osm_binary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_binary.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** buildmap_osm_binary.c 4 Aug 2008 17:44:07 -0000 1.8 --- buildmap_osm_binary.c 4 Aug 2008 23:25:51 -0000 1.9 *************** *** 66,70 **** #include "buildmap_layer.h" ! #include "buildmap_osm_static.h" #include "buildmap_osm_binary.h" --- 66,70 ---- #include "buildmap_layer.h" ! #include "buildmap_osm_common.h" #include "buildmap_osm_binary.h" Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_osm_main.c 4 Aug 2008 17:44:07 -0000 1.7 --- buildmap_osm_main.c 4 Aug 2008 23:25:51 -0000 1.8 *************** *** 45,48 **** --- 45,49 ---- #include "buildmap_metadata.h" #include "buildmap_layer.h" + #include "buildmap_osm_common.h" #include "buildmap_osm_binary.h" #include "buildmap_osm_text.h" *************** *** 236,240 **** int ret = 0; FILE *f; - int tileid = 32; f = fopen(fn, "r"); --- 237,240 ---- |
|
From: Danny B. <dan...@us...> - 2008-08-04 17:46:28
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27243 Added Files: buildmap_osm_common.c buildmap_osm_common.h Log Message: You'll need these too. --- NEW FILE: buildmap_osm_common.c --- /* * LICENSE: * * Copyright 2007 Stephen Woodbridge * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief a module to convert OSM (OpenStreetMap) data into RoadMap maps. * * This file contains the static data. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mman.h> #include <time.h> #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_math.h" #include "roadmap_path.h" #include "roadmap_file.h" #include "roadmap_osm.h" #include "buildmap.h" #include "buildmap_zip.h" #include "buildmap_city.h" #include "buildmap_square.h" #include "buildmap_point.h" #include "buildmap_line.h" #include "buildmap_street.h" #include "buildmap_range.h" #include "buildmap_area.h" #include "buildmap_shape.h" #include "buildmap_polygon.h" #include "buildmap_layer.h" #include "buildmap_osm_common.h" #include "buildmap_osm_binary.h" /* Road layers. */ int BuildMapLayerFreeway = 0; int BuildMapLayerRamp = 0; int BuildMapLayerMain = 0; int BuildMapLayerStreet = 0; int BuildMapLayerTrail = 0; int BuildMapLayerRail = 0; /* Area layers. */ int BuildMapLayerPark = 0; int BuildMapLayerHospital = 0; int BuildMapLayerAirport = 0; int BuildMapLayerStation = 0; int BuildMapLayerMall = 0; /* Water layers. */ int BuildMapLayerShoreline = 0; int BuildMapLayerRiver = 0; int BuildMapLayerCanal = 0; int BuildMapLayerLake = 0; int BuildMapLayerSea = 0; int BuildMapLayerBoundary = 0; #define FREEWAY &BuildMapLayerFreeway #define RAMP &BuildMapLayerRamp #define MAIN &BuildMapLayerMain #define STREET &BuildMapLayerStreet #define TRAIL &BuildMapLayerTrail #define RAIL &BuildMapLayerRail #define PARK &BuildMapLayerPark #define HOSPITAL &BuildMapLayerHospital #define AIRPORT &BuildMapLayerAirport #define STATION &BuildMapLayerStation #define MALL &BuildMapLayerMall #define SHORELINE &BuildMapLayerShoreline #define RIVER &BuildMapLayerRiver #define CANAL &BuildMapLayerCanal #define LAKE &BuildMapLayerLake #define SEA &BuildMapLayerSea #define BOUNDARY &BuildMapLayerBoundary BuildMapDictionary DictionaryPrefix; BuildMapDictionary DictionaryStreet; BuildMapDictionary DictionaryType; BuildMapDictionary DictionarySuffix; BuildMapDictionary DictionaryCity; /** * @brief initialize layers */ void buildmap_osm_common_find_layers (void) { BuildMapLayerFreeway = buildmap_layer_get ("freeways"); BuildMapLayerRamp = buildmap_layer_get ("ramps"); BuildMapLayerMain = buildmap_layer_get ("highways"); BuildMapLayerStreet = buildmap_layer_get ("streets"); BuildMapLayerTrail = buildmap_layer_get ("trails"); BuildMapLayerRail = buildmap_layer_get ("railroads"); BuildMapLayerPark = buildmap_layer_get ("parks"); BuildMapLayerHospital = buildmap_layer_get ("hospitals"); BuildMapLayerAirport = buildmap_layer_get ("airports"); BuildMapLayerStation = buildmap_layer_get ("stations"); BuildMapLayerMall = buildmap_layer_get ("malls"); BuildMapLayerShoreline = buildmap_layer_get ("shore"); BuildMapLayerRiver = buildmap_layer_get ("rivers"); BuildMapLayerCanal = buildmap_layer_get ("canals"); BuildMapLayerLake = buildmap_layer_get ("lakes"); BuildMapLayerSea = buildmap_layer_get ("sea"); BuildMapLayerBoundary = buildmap_layer_get ("boundaries"); } char *stringtype[] = { "name", "name_left", "name_right", "name_other", "int_name", "nat_name", "reg_name", "loc_name", "old_name", "ref", "int_ref", "nat_ref", "reg_ref", "loc_ref", "old_ref", "ncn_ref", "rcn_ref", "lcn_ref", "icao", "iata", "place_name", "place_numbers", "postal_code", "is_in", "note", "description", "image", "source", "source_ref", "created_by", }; char *datetype[] = { "date_on", "date_off", "start_date", "end_date", }; #if NEEDED char *numeric_type[] = { "lanes", "layer", "ele", "width", "est_width", "maxwidth", "maxlength", "maxspeed", "minspeed", "day_on", "day_off", "hour_on", "hour_off", "maxweight", "maxheight", }; #endif layer_info_t highway_to_layer[] = { { 0, NULL, 0 }, { "motorway", FREEWAY, 0 }, /* 1 */ { "motorway_link", FREEWAY, 0 }, /* 2 */ { "trunk", FREEWAY, 0 }, /* 3 */ { "trunk_link", FREEWAY, 0 }, /* 4 */ { "primary", MAIN, 0 }, /* 5 */ { "primary_link", MAIN, 0 }, /* 6 */ { "secondary", STREET, 0 }, /* 7 */ { "tertiary", STREET, 0 }, /* 8 */ { "unclassified", STREET, 0 }, /* 9 */ { "minor", STREET, 0 }, /* 10 */ { "residential", STREET, 0 }, /* 11 */ { "service", STREET, 0 }, /* 12 */ { "track", TRAIL, 0 }, /* 13 */ { "cycleway", TRAIL, 0 }, /* 14 */ { "bridleway", TRAIL, 0 }, /* 15 */ { "footway", TRAIL, 0 }, /* 16 */ { "steps", TRAIL, 0 }, /* 17 */ { "pedestrian", TRAIL, 0 }, /* =>17 */ { 0, NULL, 0 }, }; layer_info_t cycleway_to_layer[] = { { 0, NULL, 0 }, { "lane", TRAIL, 0 }, /* 1 */ { "track", TRAIL, 0 }, /* 2 */ { "opposite_lane", TRAIL, 0 }, /* 3 */ { "opposite_track", TRAIL, 0 }, /* 4 */ { "opposite", NULL, 0 }, /* 5 */ { 0, NULL, 0 }, }; layer_info_t waterway_to_layer[] = { { 0, NULL, 0 }, { "river", RIVER, 0 }, /* 1 */ { "canal", RIVER, 0 }, /* 2 */ { "stream", RIVER, 0 }, /* 3 */ { "drain", RIVER, 0 }, /* 4 */ { "dock", RIVER, 0 }, /* 5 */ { "lock_gate", RIVER, 0 }, /* 6 */ { "turning_point", RIVER, 0 }, /* 7 */ { "aquaduct", RIVER, 0 }, /* 8 */ { "boatyard", RIVER, 0 }, /* 9 */ { "water_point", RIVER, 0 }, /* 10 */ { "weir", RIVER, 0 }, /* 11 */ { "dam", RIVER, 0 }, /* 12 */ { 0, NULL, 0 }, }; layer_info_t abutters_to_layer[] = { { 0, NULL, 0 }, { "residential", NULL, 0 }, /* 1 */ { "retail", NULL, 0 }, /* 2 */ { "industrial", NULL, 0 }, /* 3 */ { "commercial", NULL, 0 }, /* 4 */ { "mixed", NULL, 0 }, /* 5 */ { 0, NULL, 0 }, }; layer_info_t railway_to_layer[] = { { 0, NULL, 0 }, { "rail", RAIL, 0 }, /* 1 */ { "tram", RAIL, 0 }, /* 2 */ { "light_rail", RAIL, 0 }, /* 3 */ { "subway", RAIL, 0 }, /* 4 */ { "station", NULL, 0 }, /* 5 */ { "preserved", RAIL, 0 }, /* 6 */ { "disused", RAIL, 0 }, /* 7 */ { "abandoned", RAIL, 0 }, /* 8 */ { "narrow_gauge", RAIL, 0 }, /* 9 */ { "monorail", RAIL, 0 }, /* 10 */ { "halt", RAIL, 0 }, /* 11 */ { "tram_stop", RAIL, 0 }, /* 12 */ { "viaduct", RAIL, 0 }, /* 13 */ { "crossing", RAIL, 0 }, /* 14 */ { "level_crossing", RAIL, 0 }, /* 15 */ { "subway_entrance", RAIL, 0 }, /* 16 */ { "turntable", RAIL, 0 }, /* 17 */ { 0, NULL, 0 }, }; layer_info_t natural_to_layer[] = { { 0, NULL, 0 }, { "coastline", SHORELINE, 0 }, /* 1 */ { "water", LAKE, AREA }, /* 2 */ { "wood", NULL, AREA }, /* 3 */ { "peak", NULL, 0 }, /* 4 */ { 0, NULL, 0 }, }; layer_info_t boundary_to_layer[] = { { 0, NULL, 0 }, { "administrative", NULL, AREA }, /* 1 */ { "civil", NULL, AREA }, /* 2 */ { "political", NULL, AREA }, /* 3 */ { "national_park", NULL, AREA }, /* 4 */ { "world_country", NULL, AREA }, /* 5 */ { 0, NULL, 0 }, }; layer_info_t amenity_to_layer[] = { { 0, NULL, 0 }, { "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 */ { "public_building", NULL, AREA }, /* 22 */ { "grave_yard", NULL, AREA }, /* 23 */ { "university", NULL, AREA }, /* 24 */ { "college", NULL, AREA }, /* 25 */ { "townhall", NULL, AREA }, /* 26 */ { 0, NULL, 0 }, }; layer_info_t place_to_layer[] = { { 0, NULL, 0 }, { "continent", NULL, AREA }, /* 1 */ { "country", NULL, AREA }, /* 2 */ { "state", NULL, AREA }, /* 3 */ { "region", NULL, AREA }, /* 4 */ { "county", NULL, AREA }, /* 5 */ { "city", NULL, AREA }, /* 6 */ { "town", NULL, AREA }, /* 7 */ { "village", NULL, AREA }, /* 8 */ { "hamlet", NULL, AREA }, /* 9 */ { "suburb", NULL, AREA }, /* 10 */ { 0, NULL, 0 }, }; layer_info_t leisure_to_layer[] = { { 0, NULL, 0 }, { "park", PARK, AREA }, /* 1 */ { "common", PARK, AREA }, /* 2 */ { "garden", PARK, AREA }, /* 3 */ { "nature_reserve", PARK, AREA }, /* 4 */ { "fishing", NULL, AREA }, /* 5 */ { "slipway", NULL, 0 }, /* 6 */ { "water_park", NULL, AREA }, /* 7 */ { "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 */ { 0, NULL, 0 }, }; layer_info_t historic_to_layer[] = { { 0, NULL, 0 }, { "castle", NULL, 0 }, /* 1 */ { "monument", NULL, 0 }, /* 2 */ { "museum", NULL, 0 }, /* 3 */ { "archaeological_site",NULL, AREA }, /* 4 */ { "icon", NULL, 0 }, /* 5 */ { "ruins", NULL, AREA }, /* 6 */ { 0, NULL, 0 }, }; #if NEEDED char *oneway_type[] = { 0, "no", /* 0 */ "yes", /* 1 */ "-1" /* 2 */ }; #endif layer_info_sublist_t list_info[] = { {0, NULL, NULL }, {"highway", highway_to_layer, NULL }, {"cycleway", cycleway_to_layer, NULL }, {"tracktype", NULL, TRAIL }, {"waterway", waterway_to_layer, RIVER }, {"railway", railway_to_layer, NULL }, {"aeroway", NULL, NULL }, {"aerialway", NULL, NULL }, {"power", NULL, NULL }, {"man_made", NULL, NULL }, {"leisure", leisure_to_layer, NULL }, {"amenity", amenity_to_layer, NULL }, {"shop", NULL, NULL }, {"tourism", NULL, NULL }, {"historic", historic_to_layer, NULL }, {"landuse", NULL, NULL }, {"military", NULL, NULL }, {"natural", natural_to_layer, NULL }, {"route", NULL, NULL }, {"boundary", boundary_to_layer, NULL }, {"sport", NULL, NULL }, {"abutters", abutters_to_layer, NULL }, {"fenced", NULL, NULL }, {"lit", NULL, NULL }, {"area", NULL, NULL }, {"bridge", NULL, MAIN }, {"cutting", NULL, NULL }, {"embankment", NULL, NULL }, {"surface", NULL, NULL }, {"access", NULL, NULL }, {"bicycle", NULL, NULL }, {"foot", NULL, NULL }, {"goods", NULL, NULL }, {"hgv", NULL, NULL }, {"horse", NULL, NULL }, {"motorcycle", NULL, NULL }, {"motorcar", NULL, NULL }, {"psv", NULL, NULL }, {"motorboat", NULL, NULL }, {"boat", NULL, NULL }, {"oneway", NULL, NULL }, {"noexit", NULL, NULL }, {"toll", NULL, NULL }, {"place", place_to_layer, NULL }, {"lock", NULL, NULL }, {"attraction", NULL, NULL }, {"wheelchair", NULL, NULL }, {"junction", NULL, NULL }, { 0, NULL, 0 }, }; --- NEW FILE: buildmap_osm_common.h --- /* * LICENSE: * * Copyright 2007 Stephen Woodbridge * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief include file for the static data of buildmap_osm */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mman.h> #include <time.h> #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_math.h" #include "roadmap_path.h" #include "roadmap_file.h" #include "roadmap_osm.h" #include "buildmap.h" #include "buildmap_zip.h" #include "buildmap_city.h" #include "buildmap_square.h" #include "buildmap_point.h" #include "buildmap_line.h" #include "buildmap_street.h" #include "buildmap_range.h" #include "buildmap_area.h" #include "buildmap_shape.h" #include "buildmap_polygon.h" #include "buildmap_layer.h" #include "buildmap_osm_binary.h" #define AREA 1 typedef struct layer_info { char *name; int *layerp; int flags; } layer_info_t; typedef struct layer_info_sublist { char *name; layer_info_t *list; int *layerp; } layer_info_sublist_t; /* Road layers. */ extern int BuildMapLayerFreeway; extern int BuildMapLayerRamp; extern int BuildMapLayerMain; extern int BuildMapLayerStreet; extern int BuildMapLayerTrail; extern int BuildMapLayerRail; /* Area layers. */ extern int BuildMapLayerPark; extern int BuildMapLayerHospital; extern int BuildMapLayerAirport; extern int BuildMapLayerStation; extern int BuildMapLayerMall; /* Water layers. */ extern int BuildMapLayerShoreline; extern int BuildMapLayerRiver; extern int BuildMapLayerCanal; extern int BuildMapLayerLake; extern int BuildMapLayerSea; extern int BuildMapLayerBoundary; #define FREEWAY &BuildMapLayerFreeway #define RAMP &BuildMapLayerRamp #define MAIN &BuildMapLayerMain #define STREET &BuildMapLayerStreet #define TRAIL &BuildMapLayerTrail #define RAIL &BuildMapLayerRail #define PARK &BuildMapLayerPark #define HOSPITAL &BuildMapLayerHospital #define AIRPORT &BuildMapLayerAirport #define STATION &BuildMapLayerStation #define MALL &BuildMapLayerMall #define SHORELINE &BuildMapLayerShoreline #define RIVER &BuildMapLayerRiver #define CANAL &BuildMapLayerCanal #define LAKE &BuildMapLayerLake #define SEA &BuildMapLayerSea #define BOUNDARY &BuildMapLayerBoundary extern BuildMapDictionary DictionaryPrefix; extern BuildMapDictionary DictionaryStreet; extern BuildMapDictionary DictionaryType; extern BuildMapDictionary DictionarySuffix; extern BuildMapDictionary DictionaryCity; /** * @brief initialize layers */ extern void buildmap_osm_common_find_layers (void); extern char *stringtype[]; extern char *datetype[]; extern layer_info_t highway_to_layer[]; extern layer_info_t cycleway_to_layer[]; extern layer_info_t waterway_to_layer[]; extern layer_info_t abutters_to_layer[]; extern layer_info_t railway_to_layer[]; extern layer_info_t natural_to_layer[]; extern layer_info_t boundary_to_layer[]; extern layer_info_t amenity_to_layer[]; extern layer_info_t place_to_layer[]; extern layer_info_t leisure_to_layer[]; extern layer_info_t historic_to_layer[]; extern layer_info_sublist_t list_info[]; |
|
From: Danny B. <dan...@us...> - 2008-08-04 17:44:12
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26028 Modified Files: Makefile buildmap_line.c buildmap_osm_binary.c buildmap_osm_main.c buildmap_point.c buildmap_range.c buildmap_shape.c buildmap_square.c buildmap_street.c Added Files: buildmap_osm_text.c buildmap_osm_text.h Log Message: This adds the source for a new option in buildmap_osm, the ability to process the native XML from OpenStreetMap. Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** buildmap_line.c 18 Dec 2007 21:22:13 -0000 1.14 --- buildmap_line.c 4 Aug 2008 17:44:07 -0000 1.15 *************** *** 1,4 **** ! /* buildmap_line.c - Build a line table & index for RoadMap. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,25 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ! * SYNOPSYS: * * int buildmap_line_add (int tlid, int layer, int from, int to); --- 19,33 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Build a line table & index for RoadMap. * ! * These functions are used to build a table of lines from ! * the Tiger maps. The objective is double: (1) reduce the size of ! * the Tiger data by sharing all duplicated information and ! * (2) produce the index data to serve as the basis for a fast ! * search mechanism for streets in roadmap. * * int buildmap_line_add (int tlid, int layer, int from, int to); *************** *** 34,42 **** * void buildmap_line_get_square_sorted (int line); * - * These functions are used to build a table of lines from - * the Tiger maps. The objective is double: (1) reduce the size of - * the Tiger data by sharing all duplicated information and - * (2) produce the index data to serve as the basis for a fast - * search mechanism for streets in roadmap. */ --- 42,45 ---- *************** *** 161,171 **** ! int buildmap_line_add (int tlid, int layer, int from, int to) { ! int block; int offset; BuildMapLine *this_line; - if (LineById == NULL) buildmap_line_initialize(); --- 164,181 ---- ! /** ! * @brief add a line to buildmap's list ! * @param tlid the line id ! * @param layer the layer of this line ! * @param from point 1 ! * @param to point 2 ! * @return the number of lines we know ! */ ! int buildmap_line_add (int tlid, int layer, int from, int to) ! { int block; int offset; BuildMapLine *this_line; if (LineById == NULL) buildmap_line_initialize(); *************** *** 192,196 **** } if (layer <= 0) { ! buildmap_fatal (0, "invalid layer"); } this_line->tlid = tlid; --- 202,206 ---- } if (layer <= 0) { ! buildmap_fatal (0, "invalid layer %d in line #%d", layer, tlid); } this_line->tlid = tlid; *************** *** 300,303 **** --- 310,319 ---- + /** + * @brief get point ids for a line, from the sorted list + * @param line index from the SortedLine array + * @param from return the from point + * @param to return the to point + */ void buildmap_line_get_points_sorted (int line, int *from, int *to) { *************** *** 483,487 **** } - SortedLine2 = malloc (LineCrossingCount * sizeof(int)); if (SortedLine2 == NULL) { --- 499,502 ---- *************** *** 543,550 **** - buildmap_info ("saving lines..."); - if (!LineCount) return; square_count = buildmap_square_get_count(); --- 558,565 ---- if (!LineCount) return; + buildmap_info ("saving %d lines...", LineCount); + square_count = buildmap_square_get_count(); Index: buildmap_range.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_range.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** buildmap_range.c 2 Dec 2007 00:32:35 -0000 1.15 --- buildmap_range.c 4 Aug 2008 17:44:07 -0000 1.16 *************** *** 1,4 **** ! /* buildmap_range.c - Build a street address range table & index for RoadMap. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,23 **** --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Build a street address range table & index for RoadMap. * * SYNOPSYS: *************** *** 88,92 **** static void buildmap_range_register (void); ! static void buildmap_range_initialize (void) { --- 92,98 ---- static void buildmap_range_register (void); ! /** ! * @brief ! */ static void buildmap_range_initialize (void) { *************** *** 103,107 **** } ! static BuildMapRange *buildmap_range_new (void) { --- 109,115 ---- } ! /** ! * @brief ! */ static BuildMapRange *buildmap_range_new (void) { *************** *** 129,133 **** } ! void buildmap_range_merge (unsigned int frleft, unsigned int toleft, unsigned int frright, unsigned int toright, --- 137,149 ---- } ! /** ! * @brief ! * @param frleft ! * @param toleft ! * @param frright ! * @param toright ! * @param from ! * @param to ! */ void buildmap_range_merge (unsigned int frleft, unsigned int toleft, unsigned int frright, unsigned int toright, *************** *** 171,175 **** } ! int buildmap_range_add (int line, int street, --- 187,200 ---- } ! /** ! * @brief ! * @param line ! * @param street ! * @param fradd ! * @param toadd ! * @param zip ! * @param city ! * @return ! */ int buildmap_range_add (int line, int street, *************** *** 261,265 **** } ! void buildmap_range_add_no_address (int line, int street) { --- 286,294 ---- } ! /** ! * @brief ! * @param line ! * @param street ! */ void buildmap_range_add_no_address (int line, int street) { *************** *** 327,331 **** } ! void buildmap_range_add_place (RoadMapString place, RoadMapString city) { --- 356,364 ---- } ! /** ! * @brief ! * @param place ! * @param city ! */ void buildmap_range_add_place (RoadMapString place, RoadMapString city) { *************** *** 391,395 **** } ! static int buildmap_range_compare (const void *r1, const void *r2) { --- 424,433 ---- } ! /** ! * @brief ! * @param r1 ! * @param r2 ! * @return ! */ static int buildmap_range_compare (const void *r1, const void *r2) { *************** *** 429,433 **** return i1 - i2; } ! static int buildmap_range_compare_no_addr (const void *r1, const void *r2) { --- 467,476 ---- return i1 - i2; } ! /** ! * @brief ! * @param r1 ! * @param r2 ! * @return ! */ static int buildmap_range_compare_no_addr (const void *r1, const void *r2) { *************** *** 445,448 **** --- 488,494 ---- } + /** + * @brief + */ static void buildmap_range_sort (void) { *************** *** 499,503 **** } ! static void buildmap_range_save (void) { --- 545,551 ---- } ! /** ! * @brief ! */ static void buildmap_range_save (void) { *************** *** 650,654 **** ! buildmap_info ("saving ranges..."); /* Compute the space required for the "byCity" & "byzip" indexes. */ --- 698,702 ---- ! buildmap_info ("saving %d ranges...", RangeCount); /* Compute the space required for the "byCity" & "byzip" indexes. */ *************** *** 936,940 **** } ! static void buildmap_range_summary (void) { --- 984,990 ---- } ! /** ! * @brief ! */ static void buildmap_range_summary (void) { *************** *** 947,951 **** } ! static void buildmap_range_reset (void) { --- 997,1003 ---- } ! /** ! * @brief ! */ static void buildmap_range_reset (void) { *************** *** 996,1000 **** } ! static buildmap_db_module BuildMapRangeModule = { "range", --- 1048,1054 ---- } ! /** ! * @brief ! */ static buildmap_db_module BuildMapRangeModule = { "range", *************** *** 1005,1009 **** }; ! static void buildmap_range_register (void) { buildmap_db_register (&BuildMapRangeModule); --- 1059,1065 ---- }; ! /** ! * @brief ! */ static void buildmap_range_register (void) { buildmap_db_register (&BuildMapRangeModule); Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** Makefile 31 Jul 2008 20:56:30 -0000 1.127 --- Makefile 4 Aug 2008 17:44:07 -0000 1.128 *************** *** 118,121 **** --- 118,123 ---- buildmap_shapefile.c \ buildmap_osm_binary.c \ + buildmap_osm_common.c \ + buildmap_osm_text.c \ buildmap_empty.c \ buildmap_place.c \ *************** *** 192,195 **** --- 194,199 ---- buildmap_opt.h \ buildmap_osm_binary.h \ + buildmap_osm_common.h \ + buildmap_osm_text.h \ buildmap_place.h \ buildmap_point.h \ Index: buildmap_shape.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_shape.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** buildmap_shape.c 27 Nov 2007 14:41:13 -0000 1.11 --- buildmap_shape.c 4 Aug 2008 17:44:07 -0000 1.12 *************** *** 1,4 **** ! /* buildmap_shape.c - Build a shape table & index for RoadMap. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,23 **** --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Build a shape table & index for RoadMap. * * SYNOPSYS: *************** *** 47,51 **** #include "buildmap_square.h" ! typedef struct { --- 51,57 ---- #include "buildmap_square.h" ! /** ! * @brief ! */ typedef struct { *************** *** 75,79 **** static void buildmap_shape_register (void); ! static void buildmap_shape_initialize (void) { --- 81,87 ---- static void buildmap_shape_register (void); ! /** ! * @brief ! */ static void buildmap_shape_initialize (void) { *************** *** 90,94 **** } ! int buildmap_shape_add (int line, int irec, int uid, int sequence, int longitude, int latitude) { --- 98,111 ---- } ! /** ! * @brief ! * @param line ! * @param irec ! * @param uid ! * @param sequence ! * @param longitude ! * @param latitude ! * @return ! */ int buildmap_shape_add (int line, int irec, int uid, int sequence, int longitude, int latitude) { *************** *** 189,193 **** } ! static int buildmap_shape_compare (const void *r1, const void *r2) { --- 206,215 ---- } ! /** ! * @brief ! * @param r1 ! * @param r2 ! * @return ! */ static int buildmap_shape_compare (const void *r1, const void *r2) { *************** *** 208,212 **** } ! static void buildmap_shape_sort (void) { --- 230,236 ---- } ! /** ! * @brief ! */ static void buildmap_shape_sort (void) { *************** *** 231,235 **** } ! static void buildmap_shape_save (void) { --- 255,261 ---- } ! /** ! * @brief ! */ static void buildmap_shape_save (void) { *************** *** 258,265 **** - buildmap_info ("saving shapes..."); - if (!ShapeCount) return; square_count = buildmap_square_get_count(); --- 284,291 ---- if (!ShapeCount) return; + buildmap_info ("saving %d shapes...", ShapeCount); + square_count = buildmap_square_get_count(); *************** *** 494,498 **** } ! static void buildmap_shape_summary (void) { --- 520,526 ---- } ! /** ! * @brief ! */ static void buildmap_shape_summary (void) { *************** *** 506,510 **** } ! static void buildmap_shape_reset (void) { --- 534,540 ---- } ! /** ! * @brief ! */ static void buildmap_shape_reset (void) { *************** *** 533,537 **** } ! static buildmap_db_module BuildMapShapeModule = { "shape", --- 563,569 ---- } ! /** ! * @brief ! */ static buildmap_db_module BuildMapShapeModule = { "shape", *************** *** 542,546 **** }; ! static void buildmap_shape_register (void) { buildmap_db_register (&BuildMapShapeModule); --- 574,580 ---- }; ! /** ! * @brief ! */ static void buildmap_shape_register (void) { buildmap_db_register (&BuildMapShapeModule); Index: buildmap_osm_binary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_binary.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_osm_binary.c 21 Jul 2008 18:33:42 -0000 1.7 --- buildmap_osm_binary.c 4 Aug 2008 17:44:07 -0000 1.8 *************** *** 66,173 **** #include "buildmap_layer.h" #include "buildmap_osm_binary.h" extern char *BuildMapResult; - #if 0 - static int KMaxLon = 180000000; - static int KMaxLat = 90000000; - #endif - - typedef struct layer_info { - char *name; - int *layerp; - int flags; - } layer_info_t; - - #define AREA 1 - - typedef struct layer_info_sublist { - char *name; - layer_info_t *list; - int *layerp; - } layer_info_sublist_t; - - /* Road layers. */ - - static int BuildMapLayerFreeway = 0; - static int BuildMapLayerRamp = 0; - static int BuildMapLayerMain = 0; - static int BuildMapLayerStreet = 0; - static int BuildMapLayerTrail = 0; - static int BuildMapLayerRail = 0; - - /* Area layers. */ - - static int BuildMapLayerPark = 0; - static int BuildMapLayerHospital = 0; - static int BuildMapLayerAirport = 0; - static int BuildMapLayerStation = 0; - static int BuildMapLayerMall = 0; - - /* Water layers. */ - - static int BuildMapLayerShoreline = 0; - static int BuildMapLayerRiver = 0; - static int BuildMapLayerCanal = 0; - static int BuildMapLayerLake = 0; - static int BuildMapLayerSea = 0; - - static int BuildMapLayerBoundary = 0; - - #define FREEWAY &BuildMapLayerFreeway - #define RAMP &BuildMapLayerRamp - #define MAIN &BuildMapLayerMain - #define STREET &BuildMapLayerStreet - #define TRAIL &BuildMapLayerTrail - #define RAIL &BuildMapLayerRail - - #define PARK &BuildMapLayerPark - #define HOSPITAL &BuildMapLayerHospital - #define AIRPORT &BuildMapLayerAirport - #define STATION &BuildMapLayerStation - #define MALL &BuildMapLayerMall - - #define SHORELINE &BuildMapLayerShoreline - #define RIVER &BuildMapLayerRiver - #define CANAL &BuildMapLayerCanal - #define LAKE &BuildMapLayerLake - #define SEA &BuildMapLayerSea - #define BOUNDARY &BuildMapLayerBoundary - - static BuildMapDictionary DictionaryPrefix; - static BuildMapDictionary DictionaryStreet; - static BuildMapDictionary DictionaryType; - static BuildMapDictionary DictionarySuffix; - static BuildMapDictionary DictionaryCity; - // static BuildMapDictionary DictionaryFSA; - - /** - * @brief initialize layers - */ - void buildmap_osm_binary_find_layers (void) { - - BuildMapLayerFreeway = buildmap_layer_get ("freeways"); - BuildMapLayerRamp = buildmap_layer_get ("ramps"); - BuildMapLayerMain = buildmap_layer_get ("highways"); - BuildMapLayerStreet = buildmap_layer_get ("streets"); - BuildMapLayerTrail = buildmap_layer_get ("trails"); - BuildMapLayerRail = buildmap_layer_get ("railroads"); - - BuildMapLayerPark = buildmap_layer_get ("parks"); - BuildMapLayerHospital = buildmap_layer_get ("hospitals"); - BuildMapLayerAirport = buildmap_layer_get ("airports"); - BuildMapLayerStation = buildmap_layer_get ("stations"); - BuildMapLayerMall = buildmap_layer_get ("malls"); - - BuildMapLayerShoreline = buildmap_layer_get ("shore"); - BuildMapLayerRiver = buildmap_layer_get ("rivers"); - BuildMapLayerCanal = buildmap_layer_get ("canals"); - BuildMapLayerLake = buildmap_layer_get ("lakes"); - BuildMapLayerSea = buildmap_layer_get ("sea"); - - BuildMapLayerBoundary = buildmap_layer_get ("boundaries"); - } - /** * @brief --- 66,74 ---- #include "buildmap_layer.h" + #include "buildmap_osm_static.h" #include "buildmap_osm_binary.h" extern char *BuildMapResult; /** * @brief *************** *** 198,499 **** #define STRING_REF 9 - static char *stringtype[] = { - "name", - "name_left", - "name_right", - "name_other", - "int_name", - "nat_name", - "reg_name", - "loc_name", - "old_name", - "ref", - "int_ref", - "nat_ref", - "reg_ref", - "loc_ref", - "old_ref", - "ncn_ref", - "rcn_ref", - "lcn_ref", - "icao", - "iata", - "place_name", - "place_numbers", - "postal_code", - "is_in", - "note", - "description", - "image", - "source", - "source_ref", - "created_by", - }; - - static char *datetype[] = { - "date_on", - "date_off", - "start_date", - "end_date", - }; - - #if NEEDED - static char *numeric_type[] = { - "lanes", - "layer", - "ele", - "width", - "est_width", - "maxwidth", - "maxlength", - "maxspeed", - "minspeed", - "day_on", - "day_off", - "hour_on", - "hour_off", - "maxweight", - "maxheight", - }; - #endif - - static layer_info_t highway_to_layer[] = { - { 0, NULL, 0 }, - { "motorway", FREEWAY, 0 }, /* 1 */ - { "motorway_link", FREEWAY, 0 }, /* 2 */ - { "trunk", FREEWAY, 0 }, /* 3 */ - { "trunk_link", FREEWAY, 0 }, /* 4 */ - { "primary", MAIN, 0 }, /* 5 */ - { "primary_link", MAIN, 0 }, /* 6 */ - { "secondary", STREET, 0 }, /* 7 */ - { "tertiary", STREET, 0 }, /* 8 */ - { "unclassified", STREET, 0 }, /* 9 */ - { "minor", STREET, 0 }, /* 10 */ - { "residential", STREET, 0 }, /* 11 */ - { "service", STREET, 0 }, /* 12 */ - { "track", TRAIL, 0 }, /* 13 */ - { "cycleway", TRAIL, 0 }, /* 14 */ - { "bridleway", TRAIL, 0 }, /* 15 */ - { "footway", TRAIL, 0 }, /* 16 */ - { "steps", TRAIL, 0 }, /* 17 */ - { "pedestrian", TRAIL, 0 }, /* =>17 */ - { 0, NULL, 0 }, - }; - - static layer_info_t cycleway_to_layer[] = { - { 0, NULL, 0 }, - { "lane", TRAIL, 0 }, /* 1 */ - { "track", TRAIL, 0 }, /* 2 */ - { "opposite_lane", TRAIL, 0 }, /* 3 */ - { "opposite_track", TRAIL, 0 }, /* 4 */ - { "opposite", NULL, 0 }, /* 5 */ - { 0, NULL, 0 }, - }; - - static layer_info_t waterway_to_layer[] = { - { 0, NULL, 0 }, - { "river", RIVER, 0 }, /* 1 */ - { "canal", RIVER, 0 }, /* 2 */ - { "stream", RIVER, 0 }, /* 3 */ - { "drain", RIVER, 0 }, /* 4 */ - { "dock", RIVER, 0 }, /* 5 */ - { "lock_gate", RIVER, 0 }, /* 6 */ - { "turning_point", RIVER, 0 }, /* 7 */ - { "aquaduct", RIVER, 0 }, /* 8 */ - { "boatyard", RIVER, 0 }, /* 9 */ - { "water_point", RIVER, 0 }, /* 10 */ - { "weir", RIVER, 0 }, /* 11 */ - { "dam", RIVER, 0 }, /* 12 */ - { 0, NULL, 0 }, - }; - - static layer_info_t abutters_to_layer[] = { - { 0, NULL, 0 }, - { "residential", NULL, 0 }, /* 1 */ - { "retail", NULL, 0 }, /* 2 */ - { "industrial", NULL, 0 }, /* 3 */ - { "commercial", NULL, 0 }, /* 4 */ - { "mixed", NULL, 0 }, /* 5 */ - { 0, NULL, 0 }, - }; - - static layer_info_t railway_to_layer[] = { - { 0, NULL, 0 }, - { "rail", RAIL, 0 }, /* 1 */ - { "tram", RAIL, 0 }, /* 2 */ - { "light_rail", RAIL, 0 }, /* 3 */ - { "subway", RAIL, 0 }, /* 4 */ - { "station", NULL, 0 }, /* 5 */ - { "preserved", RAIL, 0 }, /* 6 */ - { "disused", RAIL, 0 }, /* 7 */ - { "abandoned", RAIL, 0 }, /* 8 */ - { "narrow_gauge", RAIL, 0 }, /* 9 */ - { "monorail", RAIL, 0 }, /* 10 */ - { "halt", RAIL, 0 }, /* 11 */ - { "tram_stop", RAIL, 0 }, /* 12 */ - { "viaduct", RAIL, 0 }, /* 13 */ - { "crossing", RAIL, 0 }, /* 14 */ - { "level_crossing", RAIL, 0 }, /* 15 */ - { "subway_entrance", RAIL, 0 }, /* 16 */ - { "turntable", RAIL, 0 }, /* 17 */ - { 0, NULL, 0 }, - }; - - static layer_info_t natural_to_layer[] = { - { 0, NULL, 0 }, - { "coastline", SHORELINE, 0 }, /* 1 */ - { "water", LAKE, AREA }, /* 2 */ - { "wood", NULL, AREA }, /* 3 */ - { "peak", NULL, 0 }, /* 4 */ - { 0, NULL, 0 }, - }; - - static layer_info_t boundary_to_layer[] = { - { 0, NULL, 0 }, - { "administrative", NULL, AREA }, /* 1 */ - { "civil", NULL, AREA }, /* 2 */ - { "political", NULL, AREA }, /* 3 */ - { "national_park", NULL, AREA }, /* 4 */ - { "world_country", NULL, AREA }, /* 5 */ - { 0, NULL, 0 }, - }; - - static layer_info_t amenity_to_layer[] = { - { 0, NULL, 0 }, - { "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 */ - { "public_building", NULL, AREA }, /* 22 */ - { "grave_yard", NULL, AREA }, /* 23 */ - { "university", NULL, AREA }, /* 24 */ - { "college", NULL, AREA }, /* 25 */ - { "townhall", NULL, AREA }, /* 26 */ - { 0, NULL, 0 }, - }; - - static layer_info_t place_to_layer[] = { - { 0, NULL, 0 }, - { "continent", NULL, AREA }, /* 1 */ - { "country", NULL, AREA }, /* 2 */ - { "state", NULL, AREA }, /* 3 */ - { "region", NULL, AREA }, /* 4 */ - { "county", NULL, AREA }, /* 5 */ - { "city", NULL, AREA }, /* 6 */ - { "town", NULL, AREA }, /* 7 */ - { "village", NULL, AREA }, /* 8 */ - { "hamlet", NULL, AREA }, /* 9 */ - { "suburb", NULL, AREA }, /* 10 */ - { 0, NULL, 0 }, - }; - - static layer_info_t leisure_to_layer[] = { - { 0, NULL, 0 }, - { "park", PARK, AREA }, /* 1 */ - { "common", PARK, AREA }, /* 2 */ - { "garden", PARK, AREA }, /* 3 */ - { "nature_reserve", PARK, AREA }, /* 4 */ - { "fishing", NULL, AREA }, /* 5 */ - { "slipway", NULL, 0 }, /* 6 */ - { "water_park", NULL, AREA }, /* 7 */ - { "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 */ - { 0, NULL, 0 }, - }; - - static layer_info_t historic_to_layer[] = { - { 0, NULL, 0 }, - { "castle", NULL, 0 }, /* 1 */ - { "monument", NULL, 0 }, /* 2 */ - { "museum", NULL, 0 }, /* 3 */ - { "archaeological_site",NULL, AREA }, /* 4 */ - { "icon", NULL, 0 }, /* 5 */ - { "ruins", NULL, AREA }, /* 6 */ - { 0, NULL, 0 }, - }; - - #if NEEDED - static char *oneway_type[] = { - 0, - "no", /* 0 */ - "yes", /* 1 */ - "-1" /* 2 */ - }; - #endif - - - static layer_info_sublist_t list_info[] = { - {0, NULL, NULL }, - {"highway", highway_to_layer, NULL }, - {"cycleway", cycleway_to_layer, NULL }, - {"tracktype", NULL, TRAIL }, - {"waterway", waterway_to_layer, RIVER }, - {"railway", railway_to_layer, NULL }, - {"aeroway", NULL, NULL }, - {"aerialway", NULL, NULL }, - {"power", NULL, NULL }, - {"man_made", NULL, NULL }, - {"leisure", leisure_to_layer, NULL }, - {"amenity", amenity_to_layer, NULL }, - {"shop", NULL, NULL }, - {"tourism", NULL, NULL }, - {"historic", historic_to_layer, NULL }, - {"landuse", NULL, NULL }, - {"military", NULL, NULL }, - {"natural", natural_to_layer, NULL }, - {"route", NULL, NULL }, - {"boundary", boundary_to_layer, NULL }, - {"sport", NULL, NULL }, - {"abutters", abutters_to_layer, NULL }, - {"fenced", NULL, NULL }, - {"lit", NULL, NULL }, - {"area", NULL, NULL }, - {"bridge", NULL, MAIN }, - {"cutting", NULL, NULL }, - {"embankment", NULL, NULL }, - {"surface", NULL, NULL }, - {"access", NULL, NULL }, - {"bicycle", NULL, NULL }, - {"foot", NULL, NULL }, - {"goods", NULL, NULL }, - {"hgv", NULL, NULL }, - {"horse", NULL, NULL }, - {"motorcycle", NULL, NULL }, - {"motorcar", NULL, NULL }, - {"psv", NULL, NULL }, - {"motorboat", NULL, NULL }, - {"boat", NULL, NULL }, - {"oneway", NULL, NULL }, - {"noexit", NULL, NULL }, - {"toll", NULL, NULL }, - {"place", place_to_layer, NULL }, - {"lock", NULL, NULL }, - {"attraction", NULL, NULL }, - {"wheelchair", NULL, NULL }, - {"junction", NULL, NULL }, - { 0, NULL, 0 }, - }; - static unsigned char * read_4_byte_int(unsigned char *p, int *r) --- 99,102 ---- --- NEW FILE: buildmap_osm_text.h --- /* * LICENSE: * * Copyright 2007 Paul Fox * Copyright (c) 2008, Danny Backx * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief a module to read OSM text format */ #define LINELEN 512 void buildmap_osm_text_find_layers (void); int buildmap_osm_text_read(FILE * fdata); Index: buildmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_street.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_street.c 27 Nov 2007 14:41:13 -0000 1.7 --- buildmap_street.c 4 Aug 2008 17:44:07 -0000 1.8 *************** *** 1,4 **** ! /* buildmap_street.c - Build a street table & index for RoadMap. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,23 **** --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Build a street table & index for RoadMap. * * SYNOPSYS: *************** *** 56,60 **** #include "buildmap_line.h" ! struct buildmap_street_struct { --- 60,66 ---- #include "buildmap_line.h" ! /** ! * @brief ! */ struct buildmap_street_struct { *************** *** 66,69 **** --- 72,78 ---- }; + /** + * @brief + */ typedef struct buildmap_street_struct BuildMapStreet; *************** *** 80,84 **** static void buildmap_street_register (void); ! static void buildmap_street_initialize (void) { --- 89,95 ---- static void buildmap_street_register (void); ! /** ! * @brief ! */ static void buildmap_street_initialize (void) { *************** *** 92,95 **** --- 103,116 ---- + /** + * @brief + * @param cfcc + * @param fedirp + * @param fename + * @param fetype + * @param fedirs + * @param line + * @return + */ int buildmap_street_add (char cfcc, *************** *** 181,185 **** } ! static int buildmap_street_compare (const void *r1, const void *r2) { --- 202,211 ---- } ! /** ! * @brief ! * @param r1 ! * @param r2 ! * @return ! */ static int buildmap_street_compare (const void *r1, const void *r2) { *************** *** 198,201 **** --- 224,230 ---- } + /** + * @brief + */ void buildmap_street_sort (void) { *************** *** 231,235 **** } ! void buildmap_street_print_sorted (FILE *file, int street) { --- 260,268 ---- } ! /** ! * @brief ! * @param file ! * @param street ! */ void buildmap_street_print_sorted (FILE *file, int street) { *************** *** 256,259 **** --- 289,297 ---- + /** + * @brief + * @param street + * @return + */ int buildmap_street_get_sorted (int street) { *************** *** 265,274 **** } ! int buildmap_street_count (void) { return StreetCount; } ! static void buildmap_street_save (void) { --- 303,317 ---- } ! /** ! * @brief ! * @return ! */ int buildmap_street_count (void) { return StreetCount; } ! /** ! * @brief ! */ static void buildmap_street_save (void) { *************** *** 284,291 **** - buildmap_info ("saving street..."); - if (!StreetCount) return; root = buildmap_db_add_section (NULL, "street"); if (root == NULL) buildmap_fatal (0, "Can't add a new section"); --- 327,334 ---- if (!StreetCount) return; + buildmap_info ("saving %d streets...", StreetCount); + root = buildmap_db_add_section (NULL, "street"); if (root == NULL) buildmap_fatal (0, "Can't add a new section"); *************** *** 313,317 **** } ! static void buildmap_street_summary (void) { --- 356,362 ---- } ! /** ! * @brief ! */ static void buildmap_street_summary (void) { *************** *** 322,326 **** } ! static void buildmap_street_reset (void) { --- 367,373 ---- } ! /** ! * @brief ! */ static void buildmap_street_reset (void) { *************** *** 345,349 **** } ! static buildmap_db_module BuildMapStreetModule = { "street", --- 392,398 ---- } ! /** ! * @brief ! */ static buildmap_db_module BuildMapStreetModule = { "street", *************** *** 354,358 **** }; ! static void buildmap_street_register (void) { buildmap_db_register (&BuildMapStreetModule); --- 403,409 ---- }; ! /** ! * @brief ! */ static void buildmap_street_register (void) { buildmap_db_register (&BuildMapStreetModule); --- NEW FILE: buildmap_osm_text.c --- /* * LICENSE: * * Copyright (c) 2008, Danny Backx * Based on code Copyright 2007 Stephen Woodbridge that interprets the OSM binary stream. * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief a module to read OSM text format */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <ctype.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mman.h> #include <time.h> #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_math.h" #include "roadmap_path.h" #include "roadmap_file.h" #include "roadmap_osm.h" #include "buildmap.h" #include "buildmap_zip.h" #include "buildmap_city.h" #include "buildmap_square.h" #include "buildmap_point.h" #include "buildmap_line.h" #include "buildmap_street.h" #include "buildmap_range.h" #include "buildmap_area.h" #include "buildmap_shape.h" #include "buildmap_polygon.h" #include "buildmap_layer.h" #include "buildmap_osm_common.h" #include "buildmap_osm_text.h" /** * @brief a couple of variables to keep track of the way we're dealing with */ static int in_way = 0; /**< are we in a way (its id) */ static int nWayNodes = 0; /**< number of nodes known for this way */ static int nWayNodeAlloc = 0; /**< size of the allocation of the array */ static int *WayNodes = 0; /**< the array to keep track of this way's nodes */ static int WayLayer = 0; /**< the layer for this way */ static char *WayStreetName = 0; /**< the street name */ static int WayFlags = 0; /**< properties of this way, from the table flags */ static int WayInvalid = 0; /**< this way contains invalid nodes */ /** * @brief variables referring to the current node */ static int NodeId = 0; /**< which node */ static char *NodePlace = 0; /**< what kind of place is this */ static char *NodeTownName = 0; /**< which town */ static char *NodePostalCode = 0; /**< postal code */ static int NodeLon, /**< coordinates */ NodeLat; /**< coordinates */ /** * @brief some global variables */ static int LineNo; /**< line number in the input file */ static int nPolygons = 0; /**< current polygon id (number of polygons until now) */ /** * @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, HaveLatMin = 0, HaveLatMax = 0, LonMin = 0, LonMax = 0, LatMin = 0, LatMax = 0; #endif /** * @brief reset all the info about this way */ static void buildmap_osm_text_reset_way(void) { in_way = 0; nWayNodes = 0; free(WayStreetName); WayStreetName = 0; WayFlags = 0; WayInvalid = 0; } /** * @brief reset all the info about this node */ static void buildmap_osm_text_reset_node(void) { NodeId = 0; free(NodePlace); NodePlace = 0; free(NodeTownName); NodeTownName = 0; free(NodePostalCode); NodePostalCode = 0; } /** * @brief * @param d * @param string * @return */ static RoadMapString str2dict (BuildMapDictionary d, const char *string) { if (string == 0 || !strlen(string)) { return buildmap_dictionary_add (d, "", 0); } return buildmap_dictionary_add (d, (char *) string, strlen(string)); } /** * @brief simplistic way to gather point data */ static int nPointsAlloc = 0; static int nPoints = 0; static struct points { int id; int npoint; } *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) buildmap_fatal(0, "allocate %d points", nPointsAlloc); } points[nPoints].id = id; points[nPoints++].npoint = npoint; } /** * @brief look up a point by id * @param id the external representation * @return the internal index */ static int buildmap_osm_text_point_get(int id) { 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; return -1; } /** * @brief collect node data in pass 1 * @param data * @return an error indicator * * The input line is discarded if a bounding box is specified and the node is outside. * * Example input line : * <node id="123295" timestamp="2005-07-05T03:26:11Z" user="LA2" * lat="50.4443626" lon="3.6855288"/> */ int buildmap_osm_text_node(char *data) { int npoints, nchars, r; double flat, flon; char *p; static char *tag = 0, *value = 0; int NodeLatRead, NodeLonRead; sscanf(data, "node id=%*[\"']%d%*[\"']%n", &NodeId, &nchars); p = data + nchars; /* Initialize/allocate these only once, never free them. */ if (! tag) tag = malloc(512); if (! value) value = malloc(512); NodeLat = NodeLon = 0; NodeLatRead = NodeLonRead = 0; while (NodeLatRead == 0 || NodeLonRead == 0) { for (; *p && isspace(*p); p++) ; r = sscanf(p, "%[a-zA-Z0-9_]=%*[\"']%[^\"']%*[\"']%n", tag, value, &nchars); if (strcmp(tag, "lat") == 0) { sscanf(value, "%lf", &flat); NodeLat = flat * 1000000; NodeLatRead++; } else if (strcmp(tag, "lon") == 0) { sscanf(value, "%lf", &flon); NodeLon = flon * 1000000; NodeLonRead++; } p += nchars; } 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; } npoints = buildmap_point_add(NodeLon, NodeLat); buildmap_osm_text_point_add(NodeId, npoints); /* hack */ 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(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) { #if 0 int fips = 32999 * 10000 + NodePostalCode; #else static int fips = 32999 * 10000; fips++; #endif int year = 2008; RoadMapString s = buildmap_dictionary_add (DictionaryCity, (char *) NodeTownName, strlen(NodeTownName)); buildmap_city_add(fips, year, s); } if (NodePostalCode) { int zip = 0; sscanf(NodePostalCode, "%d", &zip); if (zip) buildmap_zip_add(zip, NodeLon, NodeLat); } } buildmap_osm_text_reset_node(); return 0; } /** * @brief this structure keeps shape data for a postprocessing step */ struct shapeinfo { int lineid; int count; int *lons; int *lats; }; static int numshapes = 0; static int nallocshapes = 0; /** * @brief ? */ static struct shapeinfo *shapes; /** * @brief * @param data * @return * * Sample XML : * <way id="75146" timestamp="2006-04-28T15:24:05Z" user="Mercator"> * <nd ref="997466"/> * <nd ref="997470"/> * <nd ref="1536769"/> * <nd ref="997472"/> * <nd ref="1536770"/> * <nd ref="997469"/> * <tag k="highway" v="residential"/> * <tag k="name" v="Rue de Thiribut"/> * <tag k="created_by" v="JOSM"/> * </way> */ static int buildmap_osm_text_way(char *data) { /* Severely cut in pieces. * This only remembers which way we're in... */ sscanf(data, "way id=%*[\"']%d%*[\"']", &in_way); if (in_way == 0) buildmap_fatal(0, "buildmap_osm_text_way(%s) error", data); return 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(char *data) { int node, ix; float lon, lat; if (! in_way) buildmap_fatal(0, "Wasn't in a way (%s)", data); if (sscanf(data, "nd ref=%*[\"']%d%*[\"']", &node) != 1) return -1; ix = buildmap_osm_text_point_get(node); if (ix < 0) { /* Inconsistent OSM file, this node is not defined */ WayInvalid = 1; return 0; } lon = buildmap_point_get_longitude(ix); lat = buildmap_point_get_latitude(ix); if (nWayNodes == nWayNodeAlloc) { nWayNodeAlloc += 100; WayNodes = (int *)realloc(WayNodes, sizeof(int) * nWayNodeAlloc); if (WayNodes == 0) buildmap_fatal(0, "allocation failed for %d ints", nWayNodeAlloc); } WayNodes[nWayNodes++] = node; return 0; } /** * @brief deal with tag lines outside of ways * @param data points into the line of text being processed * @return error indication */ static int buildmap_osm_text_node_tag(char *data) { static char *tagk = 0; static char *tagv = 0; if (! tagk) tagk = malloc(512); if (! tagv) tagv = malloc(512); sscanf(data, "tag k=%*['\"]%[^\"']%*['\"] v=%*['\"]%[^\"']%*['\"]", tagk, tagv); if (strcmp(tagk, "postal_code") == 0) { /* <tag k="postal_code" v="3020"/> */ if (NodePostalCode) free(NodePostalCode); NodePostalCode = strdup(tagv); } else if (strcmp(tagk, "place") == 0) { /* <tag k="place" v="town"/> */ if (NodePlace) free(NodePlace); NodePlace = strdup(tagv); } else if (strcmp(tagk, "name") == 0) { /* <tag k="name" v="Herent"/> */ if (NodeTownName) free(NodeTownName); NodeTownName = strdup(tagv); } return 0; } /** * @brief deal with tag lines inside a <way> </way> pair * @param data points into the line of text being processed * @return error indication * * Example line : * <tag k="highway" v="residential"/> * <tag k="name" v="Rue de Thiribut"/> * <tag k="created_by" v="JOSM"/> */ static int buildmap_osm_text_tag(char *data) { static char *tag = 0, *value = 0; int i, found; layer_info_t *list; int ret = 0; if (! in_way) { /* Deal with tags outside ways */ return buildmap_osm_text_node_tag(data); } if (! tag) tag = malloc(512); if (! value) value = malloc(512); sscanf(data, "tag k=%*[\"']%[^\"']%*[\"'] v=%*[\"']%[^\"']%*[\"']", tag, value); /* street names */ if (strcmp(tag, "name") == 0) { if (WayStreetName) free(WayStreetName); WayStreetName = strdup(value); return 0; /* FIX ME ?? */ } /* Scan list_info */ found = 0; for (i=1; found == 0 && list_info[i].name != 0; i++) { if (strcmp(tag, list_info[i].name) == 0) { list = list_info[i].list; found = 1; break; } } if (found) { if (list) { for (i=1; list[i].name; i++) { if (strcmp(value, list[i].name) == 0) { WayFlags = list[i].flags; if (list[i].layerp) ret = *(list[i].layerp); } } } else { /* */ } } /* FIX ME When are we supposed to do this */ if (ret) WayLayer = ret; return ret; } /** * @brief We found an end tag for a way, so we must have read all the required data. Process it. * @param data points to the line of text being processed * @return error indication */ static int buildmap_osm_text_way_end(char *data) { int from_point, to_point, line, street; int fromlon, tolon, fromlat, tolat; int j; static int lineid = 1; if (WayInvalid) return 0; if (in_way == 0) buildmap_fatal(0, "Wasn't in a way (%s)", data); RoadMapString rms_dirp = str2dict(DictionaryPrefix, ""); RoadMapString rms_dirs = str2dict(DictionarySuffix, ""); RoadMapString rms_type = str2dict(DictionaryType, ""); RoadMapString rms_name = 0; from_point = buildmap_osm_text_point_get(WayNodes[0]); to_point = buildmap_osm_text_point_get(WayNodes[nWayNodes-1]); fromlon = buildmap_point_get_longitude(from_point); fromlat = buildmap_point_get_latitude(from_point); tolon = buildmap_point_get_longitude(to_point); tolat = buildmap_point_get_latitude(to_point); if ((WayFlags & AREA) && (fromlon == tolon) && (fromlat == tolat)) { static int polyid = 0; static int cenid = 0; int line; static int lineid = 0; /* * Detect an AREA -> create a polygon */ nPolygons++; cenid++; polyid++; rms_name = str2dict(DictionaryStreet, WayStreetName); buildmap_polygon_add_landmark (nPolygons, WayLayer, rms_name); buildmap_polygon_add(nPolygons, cenid, polyid); for (j=1; j<nWayNodes; j++) { int prevpoint = buildmap_osm_text_point_get(WayNodes[j-1]); int point = buildmap_osm_text_point_get(WayNodes[j]); lineid++; line = buildmap_line_add(lineid, WayLayer, prevpoint, point); #if 0 buildmap_verbose("%d <- buildmap_line_add(%d,%d,%d,%d) - nodes %d %d", line, lineid, WayLayer, prevpoint, point, WayNodes[j-1], WayNodes[j]); #endif #if 0 /* This will break on some polygons */ buildmap_polygon_add_line(cenid, polyid, lineid, POLYGON_SIDE_RIGHT); #endif #if 0 int lon1 = buildmap_point_get_longitude(prevpoint); int lat1 = buildmap_point_get_latitude(prevpoint); int lon2 = buildmap_point_get_longitude(point); int lat2 = buildmap_point_get_latitude(point); buildmap_verbose("Poly %d add line %d %d %d" " points prev %d (%d,%d) cur %d (%d,%d)", nPolygons, cenid, polyid, lineid, WayNodes[j-1], lon1, lat1, WayNodes[j], lon2, lat2); #endif } } else { /* * Register the way * * Need to do this several different ways : * - begin and end points form a "line" * - register street name * - adjust the square * - keep memory of the point coordinates so we can postprocess the * so called shapes (otherwise we only have straight lines) */ int *lonsbuf, *latsbuf; /* Map begin and end points to internal point id */ from_point = buildmap_osm_text_point_get(WayNodes[0]); to_point = buildmap_osm_text_point_get(WayNodes[nWayNodes-1]); line = buildmap_line_add(++lineid, WayLayer, from_point, to_point); /* Street name */ if (WayStreetName) rms_name = str2dict(DictionaryStreet, WayStreetName); street = buildmap_street_add(WayLayer, rms_dirp, rms_name, rms_type, rms_dirs, line); buildmap_range_add_no_address(line, street); /* These are never freed, need to be preserved for shape registration. */ lonsbuf = calloc(nWayNodes, sizeof(int)); latsbuf = calloc(nWayNodes, sizeof(int)); for (j=0; j<nWayNodes; j++) { int point = buildmap_osm_text_point_get(WayNodes[j]); int lon = buildmap_point_get_longitude(point); int lat = buildmap_point_get_latitude(point); /* Keep info for the shapes */ lonsbuf[j] = lon; latsbuf[j] = lat; buildmap_square_adjust_limits(lon, lat); } if (numshapes == nallocshapes) { /* Allocate additional space (in big chunks) when needed */ nallocshapes += 1000; shapes = realloc(shapes, nallocshapes * sizeof(struct shapeinfo)); buildmap_check_allocated(shapes); } /* Keep info for the shapes */ shapes[numshapes].lons = lonsbuf; shapes[numshapes].lats = latsbuf; shapes[numshapes].count = nWayNodes; shapes[numshapes].lineid = lineid; numshapes++; } buildmap_osm_text_reset_way(); return 0; } /** * @brief a postprocessing step to load shape info * * this needs to be a separate step because lines need to be sorted */ static int buildmap_osm_text_ways_shapeinfo(void) { int i, j, count, lineid; int *lons, *lats; int line_index; buildmap_info("loading shape info (from %d ways) ...", numshapes); buildmap_line_sort(); for (i = 0; i < numshapes; i++) { count = shapes[i].count; if (count <= 2) continue; lineid = shapes[i].lineid; line_index = buildmap_line_find_sorted(lineid); #if 0 if (line_index != 25) { buildmap_info("Shapes skipped for line %d", line_index); continue; } else { buildmap_info("Shapes generated for line %d", line_index); } #endif if (line_index >= 0) { lons = shapes[i].lons; lats = shapes[i].lats; /* Add the shape points here */ for (j = 1; j < count - 1; j++) { buildmap_shape_add (line_index, i, lineid, j - 1, lons[j], lats[j]); #if 0 if (line_index == 25) buildmap_info("buildmap_shape_add(%d,%d,%d,%d,%d,%d)", line_index, i, lineid, j - 1, lons[j], lats[j]); #endif } } } return 1; } /** * @brief This is the gut of buildmap_osm_text : parse an OSM XML file * @param fdata an open file pointer, this will get read twice * @return error indication * * This is a simplistic approach to parsing the OSM text (XML) files. * It scans the XML twice, to cope with out of order information. * (Note that this simplistic approach may raise eyebrows, but this is * 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. */ int buildmap_osm_text_read(FILE * fdata) { int got; static char buf[LINELEN]; int ret = 0; char *p; time_t t0, t1, t2, t3; (void) time(&t0); DictionaryPrefix = buildmap_dictionary_open("prefix"); DictionaryStreet = buildmap_dictionary_open("street"); DictionaryType = buildmap_dictionary_open("type"); DictionarySuffix = buildmap_dictionary_open("suffix"); DictionaryCity = buildmap_dictionary_open("city"); buildmap_osm_common_find_layers (); /* * Pass 1 */ LineNo = 0; while (! feof(fdata)) { buildmap_set_line(++LineNo); got = (int)fgets(buf, LINELEN, fdata); if (got <= 0) { 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"); p++; /* point to character after '<' now */ 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(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; fseek(fdata, 0L, SEEK_SET); while (! feof(fdata)) { buildmap_set_line(++LineNo); got = (int)fgets(buf, LINELEN, fdata); if (got <= 0) { 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"); p++; /* point to character after '<' now */ 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(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(&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); return ret; } Index: buildmap_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_point.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** buildmap_point.c 27 Nov 2007 14:41:13 -0000 1.9 --- buildmap_point.c 4 Aug 2008 17:44:07 -0000 1.10 *************** *** 1,4 **** ! /* buildmap_point.c - Build a table of all points referenced in lines. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,23 **** --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Build a table of all points referenced in lines. * * SYNOPSYS: *************** *** 86,90 **** } ! int buildmap_point_add (int longitude, int latitude) { --- 90,99 ---- } ! /** ! * @brief add a point to buildmap's tables ! * @param longitude the longitude of this point ! * @param latitude the latitude of this point ! * @return the point count ! */ int buildmap_point_add (int longitude, int latitude) { *************** *** 330,338 **** buildmap_db *table_bysquare; - - buildmap_info ("saving points..."); - if (!PointCount) return; square_count = buildmap_square_get_count(); --- 339,346 ---- buildmap_db *table_bysquare; if (!PointCount) return; + buildmap_info ("saving %d points...", PointCount); + square_count = buildmap_square_get_count(); Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retri... [truncated message content] |
|
From: Danny B. <dan...@us...> - 2008-08-03 06:35:22
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5154 Modified Files: buildmap_square.c Log Message: Oops Index: buildmap_square.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_square.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** buildmap_square.c 3 Aug 2008 06:31:12 -0000 1.11 --- buildmap_square.c 3 Aug 2008 06:35:19 -0000 1.12 *************** *** 206,210 **** } ! if (count_longitude == 0 || count_latitude) buildmap_fatal (0, "buildmap_square: not enough data"); --- 206,210 ---- } ! if (count_longitude == 0 || count_latitude == 0) buildmap_fatal (0, "buildmap_square: not enough data"); |
|
From: Danny B. <dan...@us...> - 2008-08-03 06:31:16
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3236 Modified Files: buildmap_square.c Log Message: Add a test to avoid core dump with small files, call buildmap_fatal instead. Index: buildmap_square.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_square.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buildmap_square.c 27 Nov 2007 13:44:06 -0000 1.10 --- buildmap_square.c 3 Aug 2008 06:31:12 -0000 1.11 *************** *** 1,4 **** ! /* buildmap_square.c - Divide the area in more manageable squares. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,23 **** --- 19,33 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Divide the area in more manageable squares. + * + * These functions are used to build a table of lines from + * the Tiger maps. The objective is double: (1) reduce the size of + * the Tiger data by sharing all duplicated information and + * (2) produce the index data to serve as the basis for a fast + * search mechanism for streets in roadmap. * * SYNOPSYS: *************** *** 34,42 **** * (int square, int *longitude, int *latitude); * - * These functions are used to build a table of lines from - * the Tiger maps. The objective is double: (1) reduce the size of - * the Tiger data by sharing all duplicated information and - * (2) produce the index data to serve as the basis for a fast - * search mechanism for streets in roadmap. */ --- 44,47 ---- *************** *** 165,169 **** } ! void buildmap_square_initialize(void) { --- 170,176 ---- } ! /** ! * @brief ! */ void buildmap_square_initialize(void) { *************** *** 199,202 **** --- 206,212 ---- } + if (count_longitude == 0 || count_latitude) + buildmap_fatal (0, "buildmap_square: not enough data"); + size_longitude = (maxlongitude - minlongitude) / count_longitude; size_latitude = (maxlatitude - minlatitude) / count_latitude; |
|
From: Paul F. <pg...@us...> - 2008-07-31 20:56:33
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4328 Modified Files: Makefile Log Message: fixups for "make tarball" Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** Makefile 31 Jul 2008 20:46:56 -0000 1.126 --- Makefile 31 Jul 2008 20:56:30 -0000 1.127 *************** *** 247,250 **** --- 247,251 ---- roadmap_label.h \ roadmap_landmark.h \ + roadmap_lang.h \ roadmap_layer.h \ roadmap_library.h \ *************** *** 348,351 **** --- 349,353 ---- C_SRC = $(RMLIBSRC) $(RMGUISRC) $(RGGUISRC) \ $(RMPLUGINSRC) $(DMSRC) $(BMLIBSRC) $(BMSRC) \ + $(BMOSMSRC) \ $(BPSRC) $(BUSRC) $(XCHGSRC) $(MISCSRC) *************** *** 561,565 **** # source files from "..", i.e. the real top-level. these go into tarball. ! UPPER_SRC = README \ STATUS AUTHORS BUGS TODO CHANGES COPYING INSTALL howtos/makemaps.txt --- 563,567 ---- # source files from "..", i.e. the real top-level. these go into tarball. ! UPPER_SRC = README README.osm README.iphone \ STATUS AUTHORS BUGS TODO CHANGES COPYING INSTALL howtos/makemaps.txt |
|
From: Paul F. <pg...@us...> - 2008-07-31 20:56:20
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4311 Modified Files: roadmap_locator.c Log Message: eliminate unused var Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_locator.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** roadmap_locator.c 20 Jul 2008 12:43:46 -0000 1.26 --- roadmap_locator.c 31 Jul 2008 20:56:18 -0000 1.27 *************** *** 82,87 **** static RoadMapInstaller RoadMapDownload = roadmap_locator_no_download; - static RoadMapConfigDescriptor RoadMapConfigStaticCounty = - ROADMAP_CONFIG_ITEM("Map", "Static County"); --- 82,85 ---- |
|
From: Paul F. <pg...@us...> - 2008-07-31 20:46:59
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv32678 Modified Files: Makefile Log Message: send the dependency warning to stderr (so it doesn't corrupt "make sourcelist") Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** Makefile 28 Jun 2008 16:49:27 -0000 1.125 --- Makefile 31 Jul 2008 20:46:56 -0000 1.126 *************** *** 605,609 **** .depends.mk: ! @echo "Note: run 'make depends' to create dependency files" -include .depends.mk --- 605,609 ---- .depends.mk: ! @echo "Note: run 'make depends' to create dependency files" >&2 -include .depends.mk |
|
From: Paul F. <pg...@us...> - 2008-07-31 20:45:23
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv32228/gpx Modified Files: mkshort.c Log Message: suppress constant string compare warning Index: mkshort.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/mkshort.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mkshort.c 2 Oct 2006 14:20:20 -0000 1.3 --- mkshort.c 31 Jul 2008 20:45:19 -0000 1.4 *************** *** 31,35 **** #define DEFAULT_TARGET_LEN 8 ! #define DEFAULT_BADCHARS "\"$.,'!-" /* --- 31,35 ---- #define DEFAULT_TARGET_LEN 8 ! static char default_badchars[] = "\"$.,'!-"; /* *************** *** 88,92 **** h->whitespaceok = 1; ! h->badchars = DEFAULT_BADCHARS; h->target_len = DEFAULT_TARGET_LEN; h->must_uniq = 1; --- 88,92 ---- h->whitespaceok = 1; ! h->badchars = default_badchars; h->target_len = DEFAULT_TARGET_LEN; h->must_uniq = 1; *************** *** 277,284 **** mkshort_handle *hdl = (mkshort_handle *) h; ! if ((hdl->badchars != NULL) && (hdl->badchars != DEFAULT_BADCHARS)) xfree(hdl->badchars); if (s == NULL) { ! hdl->badchars = DEFAULT_BADCHARS; } else { hdl->badchars = xstrdup(s); --- 277,284 ---- mkshort_handle *hdl = (mkshort_handle *) h; ! if ((hdl->badchars != NULL) && (hdl->badchars != default_badchars)) xfree(hdl->badchars); if (s == NULL) { ! hdl->badchars = default_badchars; } else { hdl->badchars = xstrdup(s); |
|
From: Danny B. <dan...@us...> - 2008-07-21 18:33:49
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20549 Modified Files: buildmap_osm_binary.c Log Message: Add pointers to the protocol documentation. Index: buildmap_osm_binary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_binary.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** buildmap_osm_binary.c 19 Jul 2008 12:12:05 -0000 1.6 --- buildmap_osm_binary.c 21 Jul 2008 18:33:42 -0000 1.7 *************** *** 24,27 **** --- 24,34 ---- * @file * @brief a module to read OSM Mobile Binary format + * + * The protocol is documented in + * http://wiki.openstreetmap.org/index.php/OSM_Mobile_Binary_Protocol , + * and http://wiki.openstreetmap.org/index.php/OSM_Binary_Format , + * the current OSM protocol is in + * http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.5 . + * More generic protocol documentation : http://wiki.openstreetmap.org/index.php/Protocol . */ |
|
From: Danny B. <dan...@us...> - 2008-07-21 11:46:52
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4060 Modified Files: rdmindex_main.c Log Message: Add docs stubs, and indicate (as Oleg said) that this is unfinished software. Index: rdmindex_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmindex_main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rdmindex_main.c 21 Dec 2007 22:51:53 -0000 1.6 --- rdmindex_main.c 21 Jul 2008 11:46:47 -0000 1.7 *************** *** 1,4 **** ! /* rdmindex_main.c - The main function of the map index builder tool. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 22,25 **** --- 21,31 ---- */ + /** + * @file + * @brief UNFINISHED SOFTWARE, use buildus instead. + * + * The main function of the map index builder tool. + */ + #include <string.h> #include <stdlib.h> *************** *** 67,72 **** --- 73,83 ---- }; + /** + * @brief Save all data + */ static void rdmindex_save (void) { + if (RdmIndexVerbose) buildmap_info("rdmindex_save"); + buildmap_set_source (RdmIndexName); buildmap_db_open (RdmIndexPath, RdmIndexName); *************** *** 77,81 **** } ! static void rdmindex_scan_cities (void) { --- 88,94 ---- } ! /** ! * @brief ! */ static void rdmindex_scan_cities (void) { *************** *** 84,87 **** --- 97,101 ---- RoadMapDictionary cities; + if (RdmIndexVerbose) buildmap_info("rdmindex_scan_cities"); cities = roadmap_dictionary_open ("city"); *************** *** 97,106 **** } ! static void rdmindex_scan_indexes (const char *path) { } ! static void rdmindex_scan_maps (const char *path) { --- 111,127 ---- } ! /** ! * @brief ! * @param path ! */ static void rdmindex_scan_indexes (const char *path) { + if (RdmIndexVerbose) buildmap_info("rdmindex_scan_indexes(%s)", path); } ! /** ! * @brief ! * @param path ! */ static void rdmindex_scan_maps (const char *path) { *************** *** 119,122 **** --- 140,144 ---- RoadMapArea edges; + if (RdmIndexVerbose) buildmap_info("rdmindex_scan_maps(%s)", path); roadmap_path_set ("maps", path); *************** *** 189,193 **** } ! static const char **rdmindex_subdirectories (const char *path) { --- 211,218 ---- } ! /** ! * @brief ! * @param path ! */ static const char **rdmindex_subdirectories (const char *path) { *************** *** 196,199 **** --- 221,225 ---- char **cursor2; + if (RdmIndexVerbose) buildmap_info("rdmindex_subdirectories(%s)", path); for (cursor1 = cursor2 = files; *cursor1 != NULL; ++cursor1) { *************** *** 214,218 **** } ! static void rdmindex_recurse (const char *path) { --- 240,247 ---- } ! /** ! * @brief ! * @param path ! */ static void rdmindex_recurse (const char *path) { *************** *** 220,223 **** --- 249,254 ---- const char **cursor; + if (RdmIndexVerbose) buildmap_info("rdmindex_recurse(%s)", path); + if (RdmIndexGrand) { rdmindex_scan_indexes (path); *************** *** 239,243 **** } ! void usage(char *progpath, const char *msg) { --- 270,278 ---- } ! /** ! * @brief ! * @param progpath ! * @param msg ! */ void usage(char *progpath, const char *msg) { *************** *** 257,260 **** --- 292,301 ---- } + /** + * @brief + * @param argc + * @param argv + * @return + */ int main (int argc, char **argv) { *************** *** 274,277 **** --- 315,319 ---- usage(argv[0], opt_strerror(error)); + if (RdmIndexVerbose) buildmap_info("starting"); /* Make sure we have a directory there. */ |
|
From: Danny B. <dan...@us...> - 2008-07-20 12:43:49
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11095 Modified Files: dumpmap_main.c roadmap_dbread.c roadmap_locator.c Log Message: Auch, fix stuff that slipped through when I did my last commits. I apparently let "a change or two" from roadmap_editor slip in with the documentation updates, sorry about that. Index: roadmap_dbread.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_dbread.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** roadmap_dbread.c 12 Jul 2008 13:36:02 -0000 1.17 --- roadmap_dbread.c 20 Jul 2008 12:43:46 -0000 1.18 *************** *** 425,430 **** int roadmap_db_open (const char *path, const char *name, ! roadmap_db_model *model, ! const char *mode) { RoadMapFileContext file; --- 425,429 ---- int roadmap_db_open (const char *path, const char *name, ! roadmap_db_model *model) { RoadMapFileContext file; *************** *** 438,442 **** } ! if (roadmap_file_map (path, name, mode, &file) == NULL) { roadmap_log (ROADMAP_INFO, --- 437,441 ---- } ! if (roadmap_file_map (path, name, "r", &file) == NULL) { roadmap_log (ROADMAP_INFO, Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_locator.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** roadmap_locator.c 12 Jul 2008 14:08:38 -0000 1.25 --- roadmap_locator.c 20 Jul 2008 12:43:46 -0000 1.26 *************** *** 142,146 **** path = roadmap_scan_next ("maps", "usdir.rdm", path)) { ! if (roadmap_db_open (path, "usdir.rdm", RoadMapUsModel, "r")) { break; } --- 142,146 ---- path = roadmap_scan_next ("maps", "usdir.rdm", path)) { ! if (roadmap_db_open (path, "usdir.rdm", RoadMapUsModel)) { break; } *************** *** 282,286 **** path = roadmap_scan_next ("maps", map_name, path)) { ! if (roadmap_db_open (path, map_name, RoadMapCountyModel, "r")) { RoadMapCountyCache[oldest].fips = fips; --- 282,286 ---- path = roadmap_scan_next ("maps", map_name, path)) { ! if (roadmap_db_open (path, map_name, RoadMapCountyModel)) { RoadMapCountyCache[oldest].fips = fips; Index: dumpmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/dumpmap_main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dumpmap_main.c 12 Jul 2008 13:36:02 -0000 1.9 --- dumpmap_main.c 20 Jul 2008 12:43:46 -0000 1.10 *************** *** 218,222 **** } while (strchr (choices, input) == NULL); ! roadmap_dictionary_move_cursor (cursor, input, NULL); roadmap_dictionary_get_next (cursor, choices); } --- 218,222 ---- } while (strchr (choices, input) == NULL); ! roadmap_dictionary_move_cursor (cursor, input); roadmap_dictionary_get_next (cursor, choices); } *************** *** 541,545 **** if (argc >= 3) fprintf(out, "%s\n", argv[i]); ! if (! roadmap_db_open ("", argv[i], RoadMapModel, "r")) { roadmap_log (ROADMAP_FATAL, "cannot open map database %s", argv[i]); } --- 541,545 ---- if (argc >= 3) fprintf(out, "%s\n", argv[i]); ! if (! roadmap_db_open ("", argv[i], RoadMapModel)) { roadmap_log (ROADMAP_FATAL, "cannot open map database %s", argv[i]); } |
|
From: Danny B. <dan...@us...> - 2008-07-19 12:12:10
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6600 Modified Files: buildmap_osm_binary.c Log Message: Add some of the feature tags found on http://wiki.openstreetmap.org/index.php/OSM_Mobile_Binary_Protocol/Feature_Tags looks like our list was old. Also null-terminate the lists, and add some documentation stubs. Index: buildmap_osm_binary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_binary.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** buildmap_osm_binary.c 2 Jan 2008 16:42:49 -0000 1.5 --- buildmap_osm_binary.c 19 Jul 2008 12:12:05 -0000 1.6 *************** *** 1,4 **** ! /* buildmap_osm_binary.c - a module to read OSM Mobile Binary format ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,24 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * */ --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief a module to read OSM Mobile Binary format */ *************** *** 60,67 **** extern char *BuildMapResult; ! ! int KMaxLon = 180000000; ! int KMaxLat = 90000000; ! typedef struct layer_info { --- 63,70 ---- extern char *BuildMapResult; ! #if 0 ! static int KMaxLon = 180000000; ! static int KMaxLat = 90000000; ! #endif typedef struct layer_info { *************** *** 133,136 **** --- 136,142 ---- // static BuildMapDictionary DictionaryFSA; + /** + * @brief initialize layers + */ void buildmap_osm_binary_find_layers (void) { *************** *** 157,160 **** --- 163,172 ---- } + /** + * @brief + * @param d + * @param string + * @return + */ static RoadMapString str2dict (BuildMapDictionary d, const char *string) { *************** *** 259,262 **** --- 271,275 ---- { "steps", TRAIL, 0 }, /* 17 */ { "pedestrian", TRAIL, 0 }, /* =>17 */ + { 0, NULL, 0 }, }; *************** *** 268,271 **** --- 281,285 ---- { "opposite_track", TRAIL, 0 }, /* 4 */ { "opposite", NULL, 0 }, /* 5 */ + { 0, NULL, 0 }, }; *************** *** 274,277 **** --- 288,302 ---- { "river", RIVER, 0 }, /* 1 */ { "canal", RIVER, 0 }, /* 2 */ + { "stream", RIVER, 0 }, /* 3 */ + { "drain", RIVER, 0 }, /* 4 */ + { "dock", RIVER, 0 }, /* 5 */ + { "lock_gate", RIVER, 0 }, /* 6 */ + { "turning_point", RIVER, 0 }, /* 7 */ + { "aquaduct", RIVER, 0 }, /* 8 */ + { "boatyard", RIVER, 0 }, /* 9 */ + { "water_point", RIVER, 0 }, /* 10 */ + { "weir", RIVER, 0 }, /* 11 */ + { "dam", RIVER, 0 }, /* 12 */ + { 0, NULL, 0 }, }; *************** *** 283,295 **** { "commercial", NULL, 0 }, /* 4 */ { "mixed", NULL, 0 }, /* 5 */ }; static layer_info_t railway_to_layer[] = { ! { 0, NULL, 0 }, ! { "rail", RAIL, 0 }, /* 1 */ ! { "tram", RAIL, 0 }, /* 2 */ ! { "light_rail", RAIL, 0 }, /* 3 */ ! { "subway", RAIL, 0 }, /* 4 */ ! { "station", NULL, 0 }, /* 5 */ }; --- 308,334 ---- { "commercial", NULL, 0 }, /* 4 */ { "mixed", NULL, 0 }, /* 5 */ + { 0, NULL, 0 }, }; static layer_info_t railway_to_layer[] = { ! { 0, NULL, 0 }, ! { "rail", RAIL, 0 }, /* 1 */ ! { "tram", RAIL, 0 }, /* 2 */ ! { "light_rail", RAIL, 0 }, /* 3 */ ! { "subway", RAIL, 0 }, /* 4 */ ! { "station", NULL, 0 }, /* 5 */ ! { "preserved", RAIL, 0 }, /* 6 */ ! { "disused", RAIL, 0 }, /* 7 */ ! { "abandoned", RAIL, 0 }, /* 8 */ ! { "narrow_gauge", RAIL, 0 }, /* 9 */ ! { "monorail", RAIL, 0 }, /* 10 */ ! { "halt", RAIL, 0 }, /* 11 */ ! { "tram_stop", RAIL, 0 }, /* 12 */ ! { "viaduct", RAIL, 0 }, /* 13 */ ! { "crossing", RAIL, 0 }, /* 14 */ ! { "level_crossing", RAIL, 0 }, /* 15 */ ! { "subway_entrance", RAIL, 0 }, /* 16 */ ! { "turntable", RAIL, 0 }, /* 17 */ ! { 0, NULL, 0 }, }; *************** *** 300,303 **** --- 339,343 ---- { "wood", NULL, AREA }, /* 3 */ { "peak", NULL, 0 }, /* 4 */ + { 0, NULL, 0 }, }; *************** *** 308,311 **** --- 348,353 ---- { "political", NULL, AREA }, /* 3 */ { "national_park", NULL, AREA }, /* 4 */ + { "world_country", NULL, AREA }, /* 5 */ + { 0, NULL, 0 }, }; *************** *** 338,341 **** --- 380,384 ---- { "college", NULL, AREA }, /* 25 */ { "townhall", NULL, AREA }, /* 26 */ + { 0, NULL, 0 }, }; *************** *** 352,355 **** --- 395,399 ---- { "hamlet", NULL, AREA }, /* 9 */ { "suburb", NULL, AREA }, /* 10 */ + { 0, NULL, 0 }, }; *************** *** 369,372 **** --- 413,417 ---- { "golf_course", PARK, AREA }, /* 12 */ { "sports_centre", NULL, AREA }, /* 13 */ + { 0, NULL, 0 }, }; *************** *** 379,382 **** --- 424,428 ---- { "icon", NULL, 0 }, /* 5 */ { "ruins", NULL, AREA }, /* 6 */ + { 0, NULL, 0 }, }; *************** *** 440,443 **** --- 486,490 ---- {"wheelchair", NULL, NULL }, {"junction", NULL, NULL }, + { 0, NULL, 0 }, }; *************** *** 458,461 **** --- 505,517 ---- } + /** + * @brief look ahead and figure out the additional info (options) like the road type + * @param cur + * @param end + * @param name + * @param ref + * @param flagp + * @return the layer that this way is in + */ static int buildmap_osm_binary_parse_options *************** *** 557,560 **** --- 613,622 ---- } + /** + * @brief + * @param data + * @param len + * @return + */ static int buildmap_osm_binary_node(unsigned char *data, int len) *************** *** 595,599 **** static struct shapeinfo *shapes; ! static int buildmap_osm_binary_way(unsigned char *data, int len) --- 657,666 ---- static struct shapeinfo *shapes; ! /** ! * @brief ! * @param data ! * @param len ! * @return ! */ static int buildmap_osm_binary_way(unsigned char *data, int len) *************** *** 749,752 **** --- 816,822 ---- } + /** + * @brief + */ static int buildmap_osm_binary_ways_pass2(void) *************** *** 782,785 **** --- 852,860 ---- } + /** + * @brief + * @param data + * @return + */ static int buildmap_osm_binary_time(unsigned char *data) *************** *** 798,801 **** --- 873,881 ---- } + /** + * @brief + * @param data + * @return + */ static int buildmap_osm_binary_error(unsigned char *data) *************** *** 809,812 **** --- 889,897 ---- } + /** + * @brief + * @param fdata + * @return + */ int buildmap_osm_binary_read(FILE * fdata) *************** *** 899,902 **** return ret; } - - --- 984,985 ---- |
|
From: Danny B. <dan...@us...> - 2008-07-13 06:24:07
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1276 Modified Files: roadmap_db_line.h Log Message: Add docs stubs Index: roadmap_db_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_line.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_db_line.h 7 Jun 2007 16:03:54 -0000 1.5 --- roadmap_db_line.h 13 Jul 2008 06:24:03 -0000 1.6 *************** *** 1,4 **** ! /* roadmap_db_line.h - the format of the address line table used by RoadMap. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,25 **** * 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 lines are described by the following table: --- 19,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 the format of the address line table used by RoadMap. * * * The RoadMap lines are described by the following table: *************** *** 50,62 **** #include "roadmap_types.h" ! typedef struct { /* table line/data */ ! int from; int to; - } RoadMapLine; ! typedef struct { /* tables line/bysquare1 and line/bysquare2 */ ! int first; /* First layer item in line/layer. */ int count; /* Number of layers + 1, the additional layer defines the end. */ --- 53,68 ---- #include "roadmap_types.h" ! /** ! * @brief table line/data ! */ ! typedef struct { int from; int to; } RoadMapLine; ! /** ! * @brief tables line/bysquare1 and line/bysquare2 ! */ ! typedef struct { int first; /* First layer item in line/layer. */ int count; /* Number of layers + 1, the additional layer defines the end. */ *************** *** 65,72 **** typedef struct { - int line; unsigned char layer; - RoadMapArea area; } RoadMapLongLine; --- 71,76 ---- *************** *** 79,81 **** #endif // INCLUDED__ROADMAP_DB_LINE__H - --- 83,84 ---- |
|
From: Danny B. <dan...@us...> - 2008-07-12 14:10:20
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4850 Modified Files: roadmap_county.c Log Message: Forgot one Index: roadmap_county.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_county.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** roadmap_county.c 12 Jul 2008 13:51:18 -0000 1.18 --- roadmap_county.c 12 Jul 2008 14:10:14 -0000 1.19 *************** *** 317,320 **** --- 317,321 ---- * @param city * @param state + * @param fips * @param count * @return |
|
From: Danny B. <dan...@us...> - 2008-07-12 14:08:41
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4240 Modified Files: roadmap_locator.c Log Message: Add docs stubs Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_locator.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** roadmap_locator.c 15 Jun 2008 17:36:14 -0000 1.24 --- roadmap_locator.c 12 Jul 2008 14:08:38 -0000 1.25 *************** *** 1,7 **** ! /* roadmap_locator.c - Locate the map to which a specific place belongs. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,25 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: * * int roadmap_locator_by_position --- 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 Locate the map to which a specific place belongs. * * int roadmap_locator_by_position *************** *** 48,51 **** --- 51,55 ---- #include "roadmap_math.h" #include "roadmap_county.h" + #include "roadmap_config.h" #include "roadmap_locator.h" *************** *** 71,75 **** static roadmap_db_model *RoadMapCountyModel; ! static RoadMapDictionary RoadMapUsCityDictionary = NULL; static RoadMapDictionary RoadMapUsStateDictionary = NULL; --- 75,79 ---- static roadmap_db_model *RoadMapCountyModel; ! RoadMapDictionary RoadMapUsCityDictionary = NULL; static RoadMapDictionary RoadMapUsStateDictionary = NULL; *************** *** 78,83 **** --- 82,92 ---- static RoadMapInstaller RoadMapDownload = roadmap_locator_no_download; + static RoadMapConfigDescriptor RoadMapConfigStaticCounty = + ROADMAP_CONFIG_ITEM("Map", "Static County"); + /* + * @brief + */ static void roadmap_locator_configure (void) { *************** *** 133,137 **** path = roadmap_scan_next ("maps", "usdir.rdm", path)) { ! if (roadmap_db_open (path, "usdir.rdm", RoadMapUsModel)) { break; } --- 142,146 ---- path = roadmap_scan_next ("maps", "usdir.rdm", path)) { ! if (roadmap_db_open (path, "usdir.rdm", RoadMapUsModel, "r")) { break; } *************** *** 152,159 **** RoadMapUsStateDictionary = roadmap_dictionary_open ("state"); - } } char *roadmap_locator_filename(char *buf, int fips) { --- 161,173 ---- RoadMapUsStateDictionary = roadmap_dictionary_open ("state"); } } + /** + * @brief + * @param buf + * @param fips + * @return + */ char *roadmap_locator_filename(char *buf, int fips) { *************** *** 170,173 **** --- 184,191 ---- } + /** + * @brief + * @param index + */ static void roadmap_locator_remove (int index) { *************** *** 180,184 **** } ! static unsigned int roadmap_locator_new_access (void) { --- 198,205 ---- } ! /** ! * @brief ! * @return ! */ static unsigned int roadmap_locator_new_access (void) { *************** *** 206,210 **** } ! static int roadmap_locator_open (int fips) { --- 227,235 ---- } ! /** ! * @brief ! * @param fips ! * @return ! */ static int roadmap_locator_open (int fips) { *************** *** 257,261 **** path = roadmap_scan_next ("maps", map_name, path)) { ! if (roadmap_db_open (path, map_name, RoadMapCountyModel)) { RoadMapCountyCache[oldest].fips = fips; --- 282,286 ---- path = roadmap_scan_next ("maps", map_name, path)) { ! if (roadmap_db_open (path, map_name, RoadMapCountyModel, "r")) { RoadMapCountyCache[oldest].fips = fips; *************** *** 274,278 **** } ! void roadmap_locator_close (int fips) { --- 299,306 ---- } ! /** ! * @brief ! * @param fips ! */ void roadmap_locator_close (int fips) { *************** *** 290,294 **** } ! static int roadmap_locator_allocate (int **fipslistp) { --- 318,326 ---- } ! /** ! * @brief ! * @param fipslistp ! * @return ! */ static int roadmap_locator_allocate (int **fipslistp) { *************** *** 309,313 **** } ! void roadmap_locator_declare_downloader (RoadMapInstaller download) { --- 341,348 ---- } ! /** ! * @brief ! * @param download ! */ void roadmap_locator_declare_downloader (RoadMapInstaller download) { *************** *** 319,323 **** } ! int roadmap_locator_by_position (const RoadMapPosition *position, int **fipslistp) { --- 354,363 ---- } ! /** ! * @brief ! * @param position ! * @param fipslistp ! * @return ! */ int roadmap_locator_by_position (const RoadMapPosition *position, int **fipslistp) { *************** *** 336,340 **** } ! int roadmap_locator_by_state (const char *state_symbol, int **fipslistp) { --- 376,385 ---- } ! /** ! * @brief ! * @param state_symbol ! * @param fipslistp ! * @return ! */ int roadmap_locator_by_state (const char *state_symbol, int **fipslistp) { *************** *** 352,356 **** } ! int roadmap_locator_by_city (const char *city_name, const char *state_symbol, int **fipslistp) { --- 397,407 ---- } ! /** ! * @brief ! * @param city_name ! * @param state_symbol ! * @param fipslistp ! * @return ! */ int roadmap_locator_by_city (const char *city_name, const char *state_symbol, int **fipslistp) { *************** *** 381,385 **** } ! int roadmap_locator_activate (int fips) { --- 432,440 ---- } ! /** ! * @brief ! * @param fips ! * @return ! */ int roadmap_locator_activate (int fips) { *************** *** 394,403 **** } ! int roadmap_locator_active (void) { return RoadMapActiveCounty; } ! RoadMapString roadmap_locator_get_state (const char *state) { --- 449,465 ---- } ! /** ! * @brief ! * @return ! */ int roadmap_locator_active (void) { return RoadMapActiveCounty; } ! /** ! * @brief ! * @param state ! * @return ! */ RoadMapString roadmap_locator_get_state (const char *state) { *************** *** 406,409 **** --- 468,476 ---- } + /** + * @brief + * @param fips + * @return + */ int roadmap_locator_get_decluttered(int fips) { *************** *** 414,417 **** --- 481,489 ---- } + /** + * @brief + * @param fips + * @return + */ void roadmap_locator_set_decluttered(int fips) { |
|
From: Danny B. <dan...@us...> - 2008-07-12 13:58:34
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv32291 Modified Files: roadmap_place.c Log Message: Add docs stubs Index: roadmap_place.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_place.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_place.c 18 Mar 2008 02:23:30 -0000 1.4 --- roadmap_place.c 12 Jul 2008 13:58:31 -0000 1.5 *************** *** 1,4 **** ! /* roadmap_place.c - Manage placename points. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,23 **** --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Manage placename points. * * SYNOPSYS: *************** *** 47,50 **** --- 51,57 ---- static char *RoadMapPlaceType = "RoadMapPlaceContext"; + /** + * @brief + */ typedef struct { *************** *** 64,68 **** static RoadMapPlaceContext *RoadMapPlaceActive = NULL; ! static void *roadmap_place_map (roadmap_db *root) { --- 71,79 ---- static RoadMapPlaceContext *RoadMapPlaceActive = NULL; ! /** ! * @brief ! * @param root ! * @return ! */ static void *roadmap_place_map (roadmap_db *root) { *************** *** 119,122 **** --- 130,137 ---- } + /** + * @brief + * @param context + */ static void roadmap_place_activate (void *context) { *************** *** 129,132 **** --- 144,151 ---- } + /** + * @brief + * @param context + */ static void roadmap_place_unmap (void *context) { *************** *** 139,142 **** --- 158,164 ---- } + /** + * @brief + */ roadmap_db_handler RoadMapPlaceHandler = { "place", *************** *** 146,150 **** }; ! int roadmap_place_in_square (int square, int layer, int *first, int *last) { --- 168,179 ---- }; ! /** ! * @brief ! * @param square ! * @param layer ! * @param first ! * @param last ! * @return ! */ int roadmap_place_in_square (int square, int layer, int *first, int *last) { *************** *** 168,172 **** } ! void roadmap_place_point (int place, RoadMapPosition *position) { --- 197,205 ---- } ! /** ! * @brief ! * @param place ! * @param position ! */ void roadmap_place_point (int place, RoadMapPosition *position) { *************** *** 179,183 **** } ! int roadmap_place_count (void) { --- 212,219 ---- } ! /** ! * @brief ! * @return ! */ int roadmap_place_count (void) { |
|
From: Danny B. <dan...@us...> - 2008-07-12 13:55:00
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30605/unix Modified Files: roadmap_file.c Log Message: Add doc stubs Index: roadmap_file.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_file.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** roadmap_file.c 7 Nov 2006 03:16:45 -0000 1.20 --- roadmap_file.c 12 Jul 2008 13:54:56 -0000 1.21 *************** *** 1,7 **** ! /* roadmap_file.c - a module to open/read/close a roadmap database file. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx * * This file is part of RoadMap. *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_file.h. */ --- 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 a module to open/read/close a roadmap database file. */ *************** *** 42,45 **** --- 43,49 ---- + /** + * @brief + */ struct RoadMapFileContextStructure { *************** *** 51,54 **** --- 55,65 ---- + /** + * @brief + * @param path + * @param name + * @param mode + * @return + */ FILE *roadmap_file_fopen (const char *path, const char *name, *************** *** 87,91 **** } ! void roadmap_file_remove (const char *path, const char *name) { --- 98,106 ---- } ! /** ! * @brief ! * @param path ! * @param name ! */ void roadmap_file_remove (const char *path, const char *name) { *************** *** 96,100 **** } ! int roadmap_file_exists (const char *path, const char *name) { --- 111,119 ---- } ! /** ! * @brief ! * @param path ! * @param name ! */ int roadmap_file_exists (const char *path, const char *name) { *************** *** 110,114 **** } ! int roadmap_file_length (const char *path, const char *name) { --- 129,137 ---- } ! /** ! * @brief ! * @param path ! * @param name ! */ int roadmap_file_length (const char *path, const char *name) { *************** *** 126,130 **** } ! void roadmap_file_save (const char *path, const char *name, void *data, int length) { --- 149,159 ---- } ! /** ! * @brief ! * @param path ! * @param name ! * @param data ! * @param length ! */ void roadmap_file_save (const char *path, const char *name, void *data, int length) { *************** *** 143,147 **** } ! int roadmap_file_truncate (const char *path, const char *name, int length) { --- 172,182 ---- } ! /** ! * @brief ! * @param path ! * @param name ! * @param length ! * @return ! */ int roadmap_file_truncate (const char *path, const char *name, int length) { *************** *** 155,159 **** } ! void roadmap_file_append (const char *path, const char *name, void *data, int length) { --- 190,200 ---- } ! /** ! * @brief ! * @param path ! * @param name ! * @param data ! * @param length ! */ void roadmap_file_append (const char *path, const char *name, void *data, int length) { *************** *** 172,175 **** --- 213,222 ---- } + /** + * @brief + * @param path + * @param name + * @param new + */ int roadmap_file_rename (const char *path, const char *name, const char *new) { *************** *** 188,193 **** } ! /* ! * Make backup file: append "~" */ void roadmap_file_backup(const char *path, const char *name) { --- 235,242 ---- } ! /** ! * @brief Make backup file: append "~" ! * @param path ! * @param name */ void roadmap_file_backup(const char *path, const char *name) { *************** *** 209,212 **** --- 258,266 ---- } + /** + * @brief + * @param base + * @return + */ const char *roadmap_file_unique (const char *base) { *************** *** 239,243 **** } ! const char *roadmap_file_map (const char *path, const char *name, --- 293,304 ---- } ! /** ! * @brief ! * @param path ! * @param name ! * @param mode ! * @param file ! * @return ! */ const char *roadmap_file_map (const char *path, const char *name, *************** *** 313,319 **** } ! ! void *roadmap_file_base (RoadMapFileContext file){ ! if (file == NULL) { return NULL; --- 374,384 ---- } ! /** ! * @brief ! * @param file ! * @return ! */ ! void *roadmap_file_base (RoadMapFileContext file) ! { if (file == NULL) { return NULL; *************** *** 322,328 **** } ! ! int roadmap_file_size (RoadMapFileContext file){ ! if (file == NULL) { return 0; --- 387,397 ---- } ! /** ! * @brief ! * @param file ! * @return ! */ ! int roadmap_file_size (RoadMapFileContext file) ! { if (file == NULL) { return 0; *************** *** 331,335 **** } ! void roadmap_file_unmap (RoadMapFileContext *file) { --- 400,407 ---- } ! /** ! * @brief ! * @param file ! */ void roadmap_file_unmap (RoadMapFileContext *file) { *************** *** 348,352 **** } ! RoadMapFile roadmap_file_open (const char *name, const char *mode) { --- 420,429 ---- } ! /** ! * @brief ! * @param name ! * @param mode ! * @return ! */ RoadMapFile roadmap_file_open (const char *name, const char *mode) { *************** *** 366,370 **** } ! int roadmap_file_read (RoadMapFile file, void *data, int size) { int count = read ((int)file, data, (size_t)size); --- 443,453 ---- } ! /** ! * @brief ! * @param file ! * @param data ! * @param size ! * @return ! */ int roadmap_file_read (RoadMapFile file, void *data, int size) { int count = read ((int)file, data, (size_t)size); *************** *** 373,382 **** } int roadmap_file_write (RoadMapFile file, const void *data, int length) { return write ((int)file, data, (size_t)length); } void roadmap_file_close (RoadMapFile file) { close ((int)file); } - --- 456,475 ---- } + /** + * @brief + * @param file + * @param data + * @param length + * @return + */ int roadmap_file_write (RoadMapFile file, const void *data, int length) { return write ((int)file, data, (size_t)length); } + /** + * @brief + * @param file + */ void roadmap_file_close (RoadMapFile file) { close ((int)file); } |