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...> - 2009-03-29 11:47:30
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9188 Modified Files: roadmap_db_metadata.h roadmap_db_turns.h roadmap_line.h roadmap_math.h roadmap_screen.h roadmap_screen_obj.h Log Message: Some of this commit is miscellaneous cleanup of differences between my disc and the CVS. Importantly though : add a parameter to buildmap_line_add. Index: roadmap_db_metadata.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_metadata.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_db_metadata.h 2 Jan 2006 09:02:16 -0000 1.2 --- roadmap_db_metadata.h 29 Mar 2009 11:47:21 -0000 1.3 *************** *** 1,4 **** ! /* roadmap_db_attributes.h - the format of the attributes table used by 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 roadmap_db_attributes.h - the format of the attributes table used by RoadMap. * * SYNOPSYS: Index: roadmap_math.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.h,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** roadmap_math.h 6 Nov 2008 20:31:02 -0000 1.43 --- roadmap_math.h 29 Mar 2009 11:47:21 -0000 1.44 *************** *** 176,179 **** #define MILLIONTHS 6 ! #endif // INCLUDED__ROADMAP_MATH__H --- 176,191 ---- #define MILLIONTHS 6 ! #if defined(HAVE_TRIP_PLUGIN) ! void roadmap_math_set_scale (int scale, int use_map_units); ! #endif ! #if defined(HAVE_TRIP_PLUGIN) || defined(HAVE_NAVIGATE_PLUGIN) ! int roadmap_math_calc_line_length (const RoadMapPosition *position, ! const RoadMapPosition *from_pos, ! const RoadMapPosition *to_pos, ! int first_shape, ! int last_shape, ! RoadMapShapeItr shape_itr, ! int *total_length); ! #endif + #endif // INCLUDED__ROADMAP_MATH__H Index: roadmap_db_turns.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_turns.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_db_turns.h 15 Mar 2009 08:11:47 -0000 1.1 --- roadmap_db_turns.h 29 Mar 2009 11:47:21 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2006 Ehud Shabtai + * Copyright (c) 2009, Danny Backx. * * This file is part of RoadMap. *************** *** 47,50 **** } RoadMapTurnsBySquare; #endif // _ROADMAP_DB_TURNS_H_ - --- 48,54 ---- } RoadMapTurnsBySquare; + /** + * Modelling one way streets in this database would be very expensive. + * Instead, this is in the line/data2 table, together with layer info. + */ #endif // _ROADMAP_DB_TURNS_H_ Index: roadmap_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_line.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_line.h 18 Mar 2009 18:18:24 -0000 1.7 --- roadmap_line.h 29 Mar 2009 11:47:21 -0000 1.8 *************** *** 73,76 **** --- 73,83 ---- int roadmap_line_get_layer (int line_id); + int roadmap_line_get_oneway (int line_id); int roadmap_line_get_fips(int line); + + #define ROADMAP_LINE_DIRECTION_BOTH 0 + #define ROADMAP_LINE_DIRECTION_ONEWAY 1 + #define ROADMAP_LINE_DIRECTION_REVERSE 2 + #define ROADMAP_LINE_DIRECTION_RESERVED 3 + #endif // INCLUDED__ROADMAP_LINE__H Index: roadmap_screen.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** roadmap_screen.h 7 Jun 2008 01:27:26 -0000 1.23 --- roadmap_screen.h 29 Mar 2009 11:47:21 -0000 1.24 *************** *** 117,119 **** --- 117,124 ---- #endif // ROADMAP_DBG_TIME + #ifdef HAVE_TRIP_PLUGIN + int roadmap_screen_height(void); + void roadmap_screen_move_center (int dy); + #endif + #endif // INCLUDE__ROADMAP_SCREEN__H Index: roadmap_screen_obj.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen_obj.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_screen_obj.h 21 Sep 2007 16:09:32 -0000 1.2 --- roadmap_screen_obj.h 29 Mar 2009 11:47:21 -0000 1.3 *************** *** 34,37 **** void roadmap_screen_obj_draw (void); ! #endif // INCLUDE__ROADMAP_SCREEN_OBJECT__H --- 34,38 ---- void roadmap_screen_obj_draw (void); ! void roadmap_screen_obj_offset (int x, int y); + #endif // INCLUDE__ROADMAP_SCREEN_OBJECT__H |
|
From: Danny B. <dan...@us...> - 2009-03-29 11:33:56
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5952 Modified Files: Makefile Log Message: Some of these sources are no longer needed, remove them. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** Makefile 15 Mar 2009 08:11:47 -0000 1.138 --- Makefile 29 Mar 2009 11:33:48 -0000 1.139 *************** *** 387,395 **** CFLAGS += -DHAVE_TRIP_PLUGIN ! RMLIBSRC += roadmap_skin.c roadmap_line_speed.c roadmap_res.c ! # roadmap_line_route.c roadmap_turns.c ! RMHEADERS += roadmap_skin.h roadmap_line_speed.h roadmap_db_line_speed.h roadmap_res.h ! # roadmap_line_route.h roadmap_db_line_route.h roadmap_db_turns.h roadmap_turns.h PLUGIN_CLEAN += ${TRIP_PLUGINSRC:.c=.o} ${RMLIBSRC:.c=.o} --- 387,395 ---- CFLAGS += -DHAVE_TRIP_PLUGIN ! RMLIBSRC += roadmap_skin.c roadmap_res.c ! # RMLIBSRC += roadmap_turns.c ! RMHEADERS += roadmap_skin.h roadmap_res.h ! # roadmap_db_turns.h roadmap_turns.h PLUGIN_CLEAN += ${TRIP_PLUGINSRC:.c=.o} ${RMLIBSRC:.c=.o} *************** *** 427,436 **** PLUGIN_CLEAN += ${NAVIGATE_PLUGINSRC:.c=.o} ! RMLIBSRC += roadmap_skin.c roadmap_line_speed.c roadmap_res.c roadmap_line_route.c # roadmap_turns.c RMHEADERS += ${NAVIGATE_PLUGIN_HDR} \ ! roadmap_skin.h roadmap_line_speed.h roadmap_db_line_speed.h roadmap_res.h ! # roadmap_line_route.h roadmap_db_line_route.h roadmap_db_turns.h roadmap_turns.h RMGUISRC += --- 427,436 ---- PLUGIN_CLEAN += ${NAVIGATE_PLUGINSRC:.c=.o} ! RMLIBSRC += roadmap_skin.c roadmap_res.c # roadmap_turns.c RMHEADERS += ${NAVIGATE_PLUGIN_HDR} \ ! roadmap_skin.h roadmap_res.h ! # roadmap_db_turns.h roadmap_turns.h RMGUISRC += |
|
From: Danny B. <dan...@us...> - 2009-03-28 22:06:20
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13698 Modified Files: roadmap_db_line.h Log Message: Add structure just discussed on the mailing list. Index: roadmap_db_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_line.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_db_line.h 17 Mar 2009 18:10:51 -0000 1.8 --- roadmap_db_line.h 28 Mar 2009 22:06:13 -0000 1.9 *************** *** 35,38 **** --- 35,41 ---- * in such a way that the lines of a square have a range of * ids next to each other.) + * line/data2 is an extension of line/data (more fields). The table has + * identical structure and clustering. The tables are not merged + * for backwards compatibility. * line/bysquare1 An index of layers per square (points to line/bylayer1). * line/bylayer1 An indirect index, from layers to lines. *************** *** 70,73 **** --- 73,91 ---- /** + * @brief table line/data2 + * + * line/data2 is an extension of line/data (more fields). The table has + * identical structure and clustering. The tables are not merged + * for backwards compatibility. + */ + typedef struct { + unsigned short filler : 4; /**< reserved for future use */ + unsigned short oneway : 2; /**< is this a oneway street */ + unsigned short layer : 10; /**< the layer of this line + Note that the #bits here matches ROADMAP_MAX_LAYERS + defined in roadmap_layer.c */ + } RoadMapLine2; + + /** * @brief tables line/bysquare1 and line/bysquare2 * |
|
From: Danny B. <dan...@us...> - 2009-03-28 15:58:13
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10358 Modified Files: roadmap_dbread.c Log Message: Add a bit of documentation Index: roadmap_dbread.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_dbread.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** roadmap_dbread.c 20 Jul 2008 12:43:46 -0000 1.18 --- roadmap_dbread.c 28 Mar 2009 15:58:05 -0000 1.19 *************** *** 235,240 **** /** ! * @brief ! * @param database */ static void roadmap_db_call_activate (roadmap_db_database *database) { --- 235,240 ---- /** ! * @brief A map is being opened, call the functions to read the map tables ! * @param database points to the map database */ static void roadmap_db_call_activate (roadmap_db_database *database) { *************** *** 245,249 **** const roadmap_db_model *registered; - /* For each module declared in the model, search for the matching table * and activate it. If no table has been found, de-activate the currently --- 245,248 ---- *************** *** 420,424 **** * @param name * @param model - * @param mode * @return 1 if successful, 0 on failure */ --- 419,422 ---- *************** *** 430,436 **** roadmap_db_database *database = roadmap_db_find (path, name); - if (database != NULL) { - roadmap_db_call_activate (database); return 1; /* Already open. */ --- 428,432 ---- |
|
From: Danny B. <dan...@us...> - 2009-03-26 20:57:48
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16864 Modified Files: roadmap_start.c Log Message: Remove a warning. Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** roadmap_start.c 15 Feb 2009 16:47:49 -0000 1.156 --- roadmap_start.c 26 Mar 2009 20:57:37 -0000 1.157 *************** *** 61,64 **** --- 61,65 ---- #include "roadmap_gpx.h" #include "roadmap_trip.h" + #include "roadmap_tripdb.h" #include "roadmap_track.h" #include "roadmap_landmark.h" |
|
From: Danny B. <dan...@us...> - 2009-03-25 20:38:23
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19065 Modified Files: buildmap_line.c Log Message: Add comment about the test. Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** buildmap_line.c 25 Mar 2009 20:35:58 -0000 1.20 --- buildmap_line.c 25 Mar 2009 20:38:19 -0000 1.21 *************** *** 1058,1068 **** for (i=0; i<max_line_by_point; i++) { int ix = buildmap_point_get_sorted(i); if (ix > sz1) { ! sz1 = ix + 10; tmp = realloc((void *)tmp, sz1 * sizeof(int)); } ! p1[buildmap_point_get_sorted(i)] = (int)(p2 - b); for (j=0; j<lbp[i].num; j++) { --- 1058,1074 ---- for (i=0; i<max_line_by_point; i++) { + /* + * The index in p1[buildmap_point_get_sorted(i)] turned out + * to be larger than max_line_by_point. Because I'm not sure + * by how much it's larger, I'll just test it and realloc + * when needed. + */ int ix = buildmap_point_get_sorted(i); if (ix > sz1) { ! sz1 = ix + 10; /* Exaggerate a bit. */ tmp = realloc((void *)tmp, sz1 * sizeof(int)); } ! p1[ix] = (int)(p2 - b); for (j=0; j<lbp[i].num; j++) { |
|
From: Danny B. <dan...@us...> - 2009-03-25 20:36:10
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18813 Modified Files: buildmap_line.c Log Message: Don't initialize this variable, we're not using it. Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** buildmap_line.c 25 Mar 2009 19:09:19 -0000 1.19 --- buildmap_line.c 25 Mar 2009 20:35:58 -0000 1.20 *************** *** 1040,1044 **** sz1 = max_line_by_point; ! sz2 = sizeof(int) * (max_line_by_point + cnt); /* --- 1040,1044 ---- sz1 = max_line_by_point; ! /* sz2 = sizeof(int) * (max_line_by_point + cnt); */ /* |
|
From: Danny B. <dan...@us...> - 2009-03-25 19:09:39
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6983 Modified Files: buildmap_line.c Log Message: Fix the buildmap_osm bug that Pablo reported. Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** buildmap_line.c 15 Mar 2009 07:49:46 -0000 1.18 --- buildmap_line.c 25 Mar 2009 19:09:19 -0000 1.19 *************** *** 1039,1043 **** } ! sz1 = sizeof(int) * max_line_by_point; sz2 = sizeof(int) * (max_line_by_point + cnt); --- 1039,1043 ---- } ! sz1 = max_line_by_point; sz2 = sizeof(int) * (max_line_by_point + cnt); *************** *** 1058,1061 **** --- 1058,1067 ---- for (i=0; i<max_line_by_point; i++) { + int ix = buildmap_point_get_sorted(i); + + if (ix > sz1) { + sz1 = ix + 10; + tmp = realloc((void *)tmp, sz1 * sizeof(int)); + } p1[buildmap_point_get_sorted(i)] = (int)(p2 - b); |
|
From: Danny B. <dan...@us...> - 2009-03-23 20:41:53
|
Update of /cvsroot/roadmap/roadmap/src/navigate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9415/navigate Modified Files: navigate.c navigate_cost.c navigate_cost.h navigate.h navigate_plugin.c navigate_route.c navigate_route.h navigate_simple.c navigate_simple.h Log Message: Restructure the navigation code to try and separate routing algorithm specifics ("business logic") from the basic navigation engine. It may look like I'm adding a "plugin" interface in navigation too, that's not the main reason for all this. The main reason is to make things easier to understand. Index: navigate_cost.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_cost.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_cost.h 15 Feb 2009 16:47:49 -0000 1.1 --- navigate_cost.h 23 Mar 2009 20:41:28 -0000 1.2 *************** *** 1,5 **** ! /** ! * @file navigate_cost.h - generic navigate cost functions ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 21,25 **** * 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 navigate_cost.h - generic navigate cost functions */ Index: navigate.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate.h 15 Feb 2009 16:47:49 -0000 1.1 --- navigate.h 23 Mar 2009 20:41:28 -0000 1.2 *************** *** 49,53 **** * also serves to pass them between navigate plugin and others */ ! typedef struct { PluginLine line; int line_direction; /**< is the direction reversed ? */ --- 49,53 ---- * also serves to pass them between navigate plugin and others */ ! typedef struct NavigateSegment { PluginLine line; int line_direction; /**< is the direction reversed ? */ *************** *** 63,71 **** enum NavigateInstr instruction; int group_id; ! int distance; ! int cross_time; ! } NavigateSegment; int navigate_is_enabled (void); void navigate_shutdown (void); --- 63,129 ---- enum NavigateInstr instruction; int group_id; ! ! int dist_from_destination; /**< how far away are we */ ! int distance; /**< distance from start */ ! int time; /**< time to reach this point */ ! int heuristic; /**< algorithm dependent */ } NavigateSegment; + /* Forward declaration, required to define the list pointers */ + struct NavigateIteration; + + typedef struct NavigateCost { + int distance; /**< distance until this point */ + int time; /**< time to reach this point */ + // int heuristic; /**< algorithm dependent heuristic about cost to get here */ + } NavigateCost; + + /** + * @brief structure of one step in navigation + * The code should maintain a doubly linked list of these + */ + typedef struct NavigateIteration { + struct NavigateIteration *prev, *next; + struct NavigateSegment *segment; + struct NavigateCost cost; + } NavigateIteration; + + /** + * @brief structure to store navigation status + * to be used in the generic navigation loop + * to be shared between the different navigation sub-functions + * may be extended by a navigation algorithm + */ + typedef struct { + NavigateIteration *first, *last; + NavigateIteration *current; + int iteration; + int maxdist; + } NavigateStatus; + + /* + * Definitions for the algorithm fields + */ + struct NavigateAlgorithm; + typedef int (*navigate_cost_fn) (NavigateIteration *iter); + typedef int (*navigate_step_fn) (struct NavigateAlgorithm *algo, NavigateStatus *stp); + typedef int (*navigate_end_fn) (NavigateStatus *stp); + + /** + * @brief structure that defines a navigation algorithm + * (basically a set of functions to calculate cost, next step, .. + * that all use the same data structures) + */ + typedef struct NavigateAlgorithm { + const char *algorithm_name; + int both_ways; + int max_iterations; + navigate_cost_fn cost_fn; + navigate_step_fn step_fn; + navigate_end_fn end_fn; + } NavigateAlgorithm; + + void navigate_algorithm_register(NavigateAlgorithm *algo); + int navigate_is_enabled (void); void navigate_shutdown (void); *************** *** 86,88 **** void navigate_format_messages (void); #endif /* INCLUDE__NAVIGATE_H */ - --- 144,145 ---- Index: navigate_plugin.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_plugin.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navigate_plugin.c 16 Feb 2009 16:11:47 -0000 1.2 --- navigate_plugin.c 23 Mar 2009 20:41:28 -0000 1.3 *************** *** 48,54 **** static void navigate_debug_be_trip(void) { ! /* departure : 4683870,50898550 */ roadmap_trip_set_selection(4683870, 50898550); roadmap_trip_set_selection_as ("Departure"); #if 0 /* destination : 4700775, 50903168 */ --- 48,59 ---- static void navigate_debug_be_trip(void) { ! /* 11/3 - new departure : 50.8979914" lon="4.6839269 */ ! roadmap_trip_set_selection(4683927, 50897991); ! roadmap_trip_set_selection_as ("Departure"); ! #if 0 ! /* old departure : 4683870,50898550 */ roadmap_trip_set_selection(4683870, 50898550); roadmap_trip_set_selection_as ("Departure"); + #endif #if 0 /* destination : 4700775, 50903168 */ Index: navigate.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate.c 15 Feb 2009 16:47:49 -0000 1.1 --- navigate.c 23 Mar 2009 20:41:28 -0000 1.2 *************** *** 3,7 **** * * Copyright 2006 Ehud Shabtai ! * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. --- 3,7 ---- * * Copyright 2006 Ehud Shabtai ! * Copyright (c) 2008, 2009 by Danny Backx. * * This file is part of RoadMap. *************** *** 607,610 **** --- 607,611 ---- navigate_bar_initialize (); navigate_visual_initialize (); + navigate_simple_initialize (); navigate_set (1); *************** *** 644,651 **** int navigate_calc_route () { ! int track_time; ! PluginLine from_line; ! RoadMapPosition from_pos, *fp, *dp; ! int flags; const char *focus = roadmap_trip_get_focus_name (); --- 645,654 ---- int navigate_calc_route () { ! int track_time; ! PluginLine from_line; ! RoadMapPosition from_pos, *fp, *dp; ! int flags; ! NavigateStatus status; ! NavigateIteration *p; const char *focus = roadmap_trip_get_focus_name (); *************** *** 667,684 **** NavigateNumSegments = MAX_NAV_SEGMENTS; - flags = NEW_ROUTE; - show_progress_dialog (); navigate_cost_reset (); ! track_time = navigate_route_get_segments (&from_line, from_pos, ! &NavigateDestination, NavigateDestPos, ! NavigateSegments, &NavigateNumSegments, ! &flags); ! roadmap_log(ROADMAP_DEBUG, "navigate_calc_route: after navigate_route_get_segments()"); ! if (track_time <= 0) { roadmap_dialog_hide ("Route calc"); NavigateTrackEnabled = 0; --- 670,683 ---- NavigateNumSegments = MAX_NAV_SEGMENTS; show_progress_dialog (); navigate_cost_reset (); ! status = navigate_route_get_initial (&from_line, from_pos, ! &NavigateDestination, NavigateDestPos); ! roadmap_log(ROADMAP_DEBUG, "navigate_calc_route: time %d", track_time); ! if (status.current == 0 || status.current->cost.distance <= 0) { roadmap_dialog_hide ("Route calc"); NavigateTrackEnabled = 0; *************** *** 696,708 **** int length = 0; ! /* navigate_instr_prepare_segments (NavigateSegments, NavigateNumSegments, ! &NavigateSrcPos, &NavigateDestPos); ! */ ! ! track_time = 0; ! for (i=0; i<NavigateNumSegments; i++) { ! length += NavigateSegments[i].distance; ! track_time += NavigateSegments[i].cross_time; ! } roadmap_dialog_hide ("Route calc"); --- 695,700 ---- int length = 0; ! length = status.current->cost.distance; ! track_time = status.current->cost.time; roadmap_dialog_hide ("Route calc"); *************** *** 745,764 **** roadmap_tripdb_empty_list(); ! roadmap_trip_add_waypoint("", &NavigateSegments[0].from_pos, TRIP_PLACE_ROUTE_MARK_START); ! for (i=0; i<NavigateNumSegments; i++) { ! #if 0 ! roadmap_trip_add_way(NavigateSegments[i].from_pos, ! NavigateSegments[i].to_pos, ! (i == NavigateNumSegments-1) ! ? TRIP_APPROACHING_DESTINATION : TRIP_CONTINUE); ! #else ! roadmap_trip_add_point_way(NavigateSegments[i].from_point, ! NavigateSegments[i].to_point, ! NavigateSegments[i].line, ! (i == NavigateNumSegments - 1) ? TRIP_APPROACHING_DESTINATION : TRIP_CONTINUE); ! #endif ! roadmap_trip_add_waypoint("", &NavigateSegments[i].to_pos, ! TRIP_PLACE_ROUTE_MARK_INSERT); } roadmap_trip_complete(); --- 737,755 ---- roadmap_tripdb_empty_list(); ! roadmap_trip_add_waypoint("", ! &status.first->segment->from_pos, ! TRIP_PLACE_ROUTE_MARK_START); ! ! for (i=0, p=status.first; p; p = p->next, i++) { ! roadmap_trip_add_point_way( ! p->segment->from_point, ! p->segment->to_point, ! p->segment->line, ! (i == NavigateNumSegments - 1) ? TRIP_APPROACHING_DESTINATION : TRIP_CONTINUE); ! ! roadmap_trip_add_waypoint("", ! &p->segment->to_pos, ! TRIP_PLACE_ROUTE_MARK_INSERT); } roadmap_trip_complete(); Index: navigate_simple.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_simple.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_simple.h 15 Feb 2009 16:47:49 -0000 1.1 --- navigate_simple.h 23 Mar 2009 20:41:28 -0000 1.2 *************** *** 2,6 **** * LICENSE: * ! * Copyright 2008, Danny Backx * * This file is part of RoadMap. --- 2,6 ---- * LICENSE: * ! * Copyright (c) 2008, 2009, Danny Backx * * This file is part of RoadMap. Index: navigate_route.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_route.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_route.c 15 Feb 2009 16:47:49 -0000 1.1 --- navigate_route.c 23 Mar 2009 20:41:28 -0000 1.2 *************** *** 2,6 **** * LICENSE: * ! * Copyright 2008 by Danny Backx. * * This file is part of RoadMap. --- 2,6 ---- * LICENSE: * ! * Copyright (c) 2008, 2009 by Danny Backx. * * This file is part of RoadMap. *************** *** 34,41 **** --- 34,53 ---- #include "roadmap.h" #include "roadmap_point.h" + #include "roadmap_math.h" #include "navigate.h" #include "navigate/navigate_simple.h" #include "navigate_route.h" + static NavigateAlgorithm *Algo = NULL; + + /** + * @brief register an algorithm + * @param algo the structure representing it + */ + void navigate_algorithm_register(NavigateAlgorithm *algo) + { + Algo = algo; + } + /** * @brief calculate the basic route. *************** *** 53,56 **** --- 65,69 ---- * @return track time */ + #if 0 int navigate_route_get_segments (PluginLine *from_line, RoadMapPosition from_pos, *************** *** 60,66 **** int *size, int *flags) { ! return navigate_simple_get_segments(from_line, from_pos, to_line, to_pos, ! segments, size, flags); } --- 73,143 ---- int *size, int *flags) + #else + NavigateStatus navigate_route_get_initial (PluginLine *from_line, + RoadMapPosition from_pos, + PluginLine *to_line, + RoadMapPosition to_pos) + #endif { ! int i; ! NavigateIteration *p; ! NavigateStatus status, rev; ! ! if (! Algo) ! return (NavigateStatus) {NULL, NULL, NULL, 0, 0}; ! ! /* navigate_route_setup(); */ ! ! /* Set up the start info */ ! status.first = calloc(1, sizeof(struct NavigateIteration)); ! status.last = calloc(1, sizeof(struct NavigateIteration)); ! ! status.first->prev = status.first->next = NULL; ! status.last->prev = status.last->next = NULL; ! status.first->segment = calloc(1, sizeof(struct NavigateSegment)); ! status.last->segment = calloc(1, sizeof(struct NavigateSegment)); ! ! status.first->segment->line = *from_line; ! status.first->segment->from_pos = from_pos; ! status.first->segment->to_pos = from_pos; ! ! status.last->segment->line = *to_line; ! status.last->segment->from_pos = to_pos; ! status.last->segment->to_pos = to_pos; ! ! status.first->cost.distance = 0; ! status.last->cost.distance = 0; ! status.first->cost.time = 0; ! status.last->cost.time = 0; ! ! status.first->cost.distance = 0; ! status.first->cost.time = 0; ! ! status.maxdist = roadmap_math_distance(&from_pos, &to_pos); ! ! status.current = status.first; ! ! /* ! * Prepare for running the algorithm from both directions ! */ ! rev.first = status.last; ! rev.last = status.first; ! ! status.iteration = 1; ! while (status.iteration <= Algo->max_iterations) { ! Algo->step_fn(Algo, &status); ! if (Algo->end_fn(&status)) { ! break; ! } ! if (Algo->both_ways) { ! Algo->step_fn(Algo, &rev); ! if (Algo->end_fn(&status)) { ! break; ! } ! } ! status.iteration++; ! } ! ! return status; } Index: navigate_cost.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_cost.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_cost.c 15 Feb 2009 16:47:49 -0000 1.1 --- navigate_cost.c 23 Mar 2009 20:41:28 -0000 1.2 *************** *** 159,163 **** int penalty = 0; ! float m_s; if (node_id != -1) { --- 159,163 ---- int penalty = 0; ! float m_s; /**< speed in m/s */ if (node_id != -1) { *************** *** 179,197 **** length = penalty + roadmap_line_length (line_id); ! /* ! * if (roadmap_layer_is_primary(layer)) ! * m_s = (float)(75 / 3.6); ! * else if (roadmap_layer_is_freeway(layer)) ! * m_s = (float)(100 / 3.6); ! * else if (roadmap_layer_is_secondary(layer) || roadmap_layer_is_ramp(layer)) ! * m_s = (float)(65 / 3.6); ! * else if (roadmap_layer_is_main(layer)) ! * m_s = (float)(30 / 3.6); ! * else ! * m_s = (float)(20 / 3.6); ! */ ! m_s = roadmap_layer_speed(layer) / 3.6; ! res = (int) (length / m_s) + 1; roadmap_log (ROADMAP_DEBUG, "cost_fastest(%d,%d,%d) -> %d", line_id, is_reversed, cur_cost, res); --- 179,185 ---- length = penalty + roadmap_line_length (line_id); ! m_s = roadmap_layer_speed(layer) / 3.6; /* FIX ME needs to be configurable */ ! res = (int) (length / m_s) + 1 + cur_cost; roadmap_log (ROADMAP_DEBUG, "cost_fastest(%d,%d,%d) -> %d", line_id, is_reversed, cur_cost, res); *************** *** 278,283 **** --- 266,276 ---- int prev_line_id, int is_prev_reversed) { + #if 0 return cost_fastest_traffic (line_id, is_reversed, cur_cost, prev_line_id, is_prev_reversed, -1); + #else + return cost_fastest (line_id, is_reversed, cur_cost, + prev_line_id, is_prev_reversed, -1); + #endif } Index: navigate_simple.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_simple.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** navigate_simple.c 18 Mar 2009 18:22:05 -0000 1.5 --- navigate_simple.c 23 Mar 2009 20:41:28 -0000 1.6 *************** *** 47,50 **** --- 47,51 ---- #include "roadmap_navigate.h" + #include "roadmap_turns.h" #include "navigate.h" *************** *** 55,59 **** #include "navigate_route.h" ! #define maxblacklist 100 static int blacklist[maxblacklist]; int nblacklist = 0; --- 56,60 ---- #include "navigate_route.h" ! #define maxblacklist 30 static int blacklist[maxblacklist]; int nblacklist = 0; *************** *** 65,71 **** --- 66,78 ---- static void navigate_simple_blacklist_add(int line) { + int i; + if (nblacklist == maxblacklist) roadmap_log(ROADMAP_FATAL, "blacklist full"); + for (i=0; i<nblacklist; i++) + if (blacklist[i] == line) + return; blacklist[nblacklist++] = line; + roadmap_log (ROADMAP_DEBUG, "Blacklisting line %d", line); } *************** *** 87,111 **** /** ! * @brief ! * @param pos ! * @param point ! * @param line ! * @param lines ! * @param maxlines ! * @return */ ! int navigate_simple_lines_closeby(RoadMapPosition pos, int point, PluginLine *line, ! PluginLine *lines, const int maxlines) { /* Use the line/bypoint data in newer maps, or fail */ int i, line_id; - // RoadMapStreetProperties prop; for (i=0; (line_id = roadmap_line_point_adjacent(point, i)) && (i < maxlines); i++) { - // roadmap_street_get_properties(line_id, &prop); lines[i].line_id = line_id; lines[i].layer = roadmap_line_get_layer(line_id); lines[i].fips = roadmap_line_get_fips(line_id); - // lines[i].fips = prop.fips; } return i; --- 94,112 ---- /** ! * @brief return the lines adjacent to the given point ! * @param point input parameter ! * @param lines existing array that will be filled up ! * @param maxlines number of entries that we can write in ! * @return the number of lines found */ ! int navigate_simple_lines_closeby(int point, PluginLine *lines, const int maxlines) { /* Use the line/bypoint data in newer maps, or fail */ int i, line_id; for (i=0; (line_id = roadmap_line_point_adjacent(point, i)) && (i < maxlines); i++) { lines[i].line_id = line_id; lines[i].layer = roadmap_line_get_layer(line_id); lines[i].fips = roadmap_line_get_fips(line_id); } return i; *************** *** 113,415 **** /** ! * @brief calculate the basic route. ! * ! * Called from navigate_calc_route and navigate_recalc_route. ! * Result will be placed in the "segments" parameter, number of steps in "size". ! * ! * @param from_line ! * @param from_pos ! * @param to_line ! * @param to_pos ! * @param segments ! * @param size ! * @param flags either NEW_ROUTE or RECALC_ROUTE ! * @return track time */ ! int navigate_simple_get_segments (PluginLine *from_line, ! RoadMapPosition from_pos, ! PluginLine *to_line, ! RoadMapPosition to_pos, ! NavigateSegment *segments, ! int *size, ! int *flags) { ! static int do_this_once = 1; ! int stop; ! ! #define MAX_CAT 10 /* Not interesting */ ! #define MAX_ITER 500 /* Max #iterations */ ! ! int ncategories, i, j, found; ! int categories[MAX_CAT], dist, maxdist, bestdist, dist2, rev, oldrev; ! int iteration, max_iterations, loop; ! int best, t; ! int tracktime, cost, oldcost; ! RoadMapPosition CurrentPos, newpos, newpos2, bestnewpos; ! int navmode; ! int point, newpt, newpt2, bestnewpt; ! NavigateCostFn cost_get; ! cost_get = navigate_cost_get(); ! /* Query the categories we can navigate in */ ! navmode = roadmap_navigate_get_mode(); ! ncategories = roadmap_layer_navigable(navmode, categories, MAX_CAT); ! max_iterations = MAX_ITER; ! if (do_this_once) { ! do_this_once = 0; ! roadmap_log(ROADMAP_WARNING, "Use map extension"); } ! from_line->line_id = to_line->line_id = 0; ! ! /* Where are we ? */ ! PluginLine *l = roadmap_navigate_position2line(from_pos); ! if (l) ! roadmap_log (ROADMAP_WARNING, "from --> %s (%d)", ! roadmap_plugin_street_full_name(l), l->line_id); ! else ! roadmap_log (ROADMAP_WARNING, "from --> ??"); ! if (l) ! *from_line = *l; ! #if 0 ! else ! return -1; ! #endif ! l = roadmap_navigate_position2line(to_pos); ! roadmap_log (ROADMAP_WARNING, "to --> %s", ! l ? roadmap_plugin_street_full_name(l) : "??"); ! if (l) ! *to_line = *l; ! #if 0 ! else return -1; ! #endif ! ! /* ! * Get in shape to start looking for a route ! */ ! CurrentPos = from_pos; ! tracktime = 0; ! oldcost = 0; ! bestdist = maxdist = roadmap_math_distance(&CurrentPos, &to_pos); ! ! /* FIX ME which of the points ? Could use roadmap_line_to_point as well. */ ! point = roadmap_line_from_point(from_line->line_id); ! point = roadmap_line_to_point(from_line->line_id); ! /* ! * Next iteration ! */ ! for (loop=iteration=0; loop < max_iterations && iteration < max_iterations; loop++) { ! roadmap_log (ROADMAP_DEBUG, ! "RouteGetSegments iteration === %d === point %d, CurrentPos %d %d", ! iteration, point, ! CurrentPos.longitude, CurrentPos.latitude); ! #if 1 ! roadmap_point_position(point, &newpos); ! roadmap_log (ROADMAP_DEBUG, "Point %d is at %d %d", point, ! newpos.longitude, newpos.latitude); ! #endif ! int maxlines = 10, nlines; ! PluginLine lines[10]; ! l = roadmap_navigate_position2line(CurrentPos); ! nlines = navigate_simple_lines_closeby(CurrentPos, point, l, lines, maxlines); ! roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", nlines, bestdist); ! if (nlines == 0) { ! point = roadmap_line_from_point(from_line->line_id); ! roadmap_log(ROADMAP_WARNING, "try point #%d", point); ! nlines = navigate_simple_lines_closeby(CurrentPos, point, l, ! lines, maxlines); ! roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", ! nlines, bestdist); ! } ! if (nlines == 0) { ! point = roadmap_line_to_point(from_line->line_id); ! roadmap_log(ROADMAP_WARNING, "try point #%d", point); ! nlines = navigate_simple_lines_closeby(CurrentPos, point, l, ! lines, maxlines); ! roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", ! nlines, bestdist); } - if (nlines == 0) { - point = 198; - roadmap_log(ROADMAP_WARNING, "try point #%d", point); - nlines = navigate_simple_lines_closeby(CurrentPos, point, l, - lines, maxlines); ! roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", ! nlines, bestdist); } - #if 1 - int x; - fprintf(stderr, "Lines closeby (point %d) -> lines {", point); - for (x=0; x<nlines; x++) - fprintf(stderr, "%d ", lines[x].line_id); - fprintf(stderr, "}\n"); - #endif ! bestdist = maxdist * 2; ! best = -1; ! ! for (i=0; i<nlines; i++) { ! RoadMapStreetProperties prop; ! ! roadmap_street_get_properties(lines[i].line_id, &prop); ! ! /* Have we already been here ? */ ! for (j=0, found=0; j<iteration && found == 0; j++) ! if (lines[i].line_id == segments[j].line.line_id) ! found = 1; ! if (found) { ! roadmap_log (ROADMAP_DEBUG, " line %d already visited", ! lines[i].line_id); ! continue; ! } ! /* Is this line forbidden ? */ ! if (navigate_simple_on_blacklist(lines[i].line_id)) { ! roadmap_log (ROADMAP_DEBUG, " line %d [%d] {%s} blacklisted", ! i, lines[i].line_id, ! roadmap_street_get_full_name(&prop)); ! continue; ! } newpt = roadmap_line_to_point(lines[i].line_id); roadmap_point_position(newpt, &newpos); dist = roadmap_math_distance(&newpos, &to_pos); ! roadmap_log (ROADMAP_DEBUG, "Line %d point %d pos %d %d", ! lines[i].line_id, newpt, ! newpos.longitude, newpos.latitude); ! ! newpt2 = roadmap_line_from_point(lines[i].line_id); roadmap_point_position(newpt2, &newpos2); dist2 = roadmap_math_distance(&newpos2, &to_pos); ! roadmap_log (ROADMAP_DEBUG, "Line %d point %d pos %d %d", ! lines[i].line_id, newpt2, ! newpos2.longitude, newpos2.latitude); ! if (point == newpt2) { ! rev = 0; ! if (dist < bestdist) { ! best = i; ! bestdist = dist; ! bestnewpt = newpt; ! bestnewpos = newpos; ! } ! } else { ! rev = 1; ! if (dist2 < bestdist) { ! best = i; ! bestdist = dist2; ! bestnewpt = newpt2; ! bestnewpos = newpos2; ! } ! } ! roadmap_log (ROADMAP_DEBUG, " line %d [%d] {%s} %d", ! i, lines[i].line_id, roadmap_street_get_full_name(&prop), ! rev ? dist2 : dist); ! } ! roadmap_log (ROADMAP_DEBUG, "After inner loop : best %d bestdist %d", ! best, bestdist); ! stop = 0; ! if (!stop && to_line && to_line->line_id == lines[best].line_id) ! stop++; ! if (!stop && roadmap_line_from_point(to_line->line_id) == bestnewpt) ! stop++; ! if (!stop && roadmap_line_to_point(to_line->line_id) == bestnewpt) ! stop++; ! if (stop) ! { ! roadmap_log (ROADMAP_DEBUG, "Line match -> track time %d, dist %d", ! tracktime, bestdist); ! *size = iteration; ! return tracktime; ! } ! if (bestdist < 30) /* FIX ME */ { ! roadmap_log (ROADMAP_DEBUG, "< 30 -> tracktime %d, dist %d", ! tracktime, bestdist); ! *size = iteration; ! return tracktime; } ! if (bestdist == maxdist) { ! /* Not better than the previous step */ ! /* We might be "there" */ ! if (bestdist < 100 /* FIX ME */) { ! roadmap_log (ROADMAP_DEBUG, "Tracktime %d, dist %d", ! tracktime, bestdist); ! *size = iteration; ! return tracktime; ! } } - if (best < 0) { - if (iteration == 0) { - roadmap_log (ROADMAP_WARNING, "On an island ?"); - return -1; - } ! roadmap_log (ROADMAP_DEBUG, "Backtrack .."); ! iteration--; ! navigate_simple_blacklist_add(segments[iteration].line.line_id); ! point = segments[iteration].from_point; ! CurrentPos = segments[iteration].from_pos; ! tracktime -= segments[iteration].cross_time; ! oldrev = segments[iteration].line_direction; ! oldcost = segments[iteration].cross_time; ! continue; ! } ! t = /* FIX ME */ (maxdist - bestdist) / 10; ! cost = (*cost_get)(lines[best].line_id, rev, oldcost, ! (iteration > 1) ? segments[iteration-1].line.line_id : 0, ! (iteration > 1) ? oldrev : 0, 0); ! segments[iteration].from_pos = CurrentPos; ! segments[iteration].from_point = point; ! segments[iteration].distance = maxdist - bestdist; ! // segments[iteration].cross_time = t; ! segments[iteration].line = lines[best]; ! segments[iteration].line_direction = rev; ! segments[iteration].cross_time = cost; ! segments[iteration].to_pos = CurrentPos = bestnewpos; ! segments[iteration].to_point = bestnewpt; ! point = bestnewpt; ! tracktime += t; ! oldcost = cost; ! iteration++; ! roadmap_log (ROADMAP_DEBUG, "To point %d (%d,%d) via line %d (rev %d)", ! point, ! CurrentPos.longitude, CurrentPos.latitude, ! lines[best].line_id, ! rev); ! roadmap_log (ROADMAP_DEBUG, "Line selected : from %d to %d", ! newpt, newpt2); ! } ! /* ! * Clean up and return ! */ ! return -1; } --- 114,386 ---- /** ! * @brief not sure how to use this ! * @param iter ! * @return */ ! static int navigate_simple_algo_cost(NavigateIteration *iter) { ! int cost; ! if (iter == 0) ! return 0; ! if (iter->segment == 0) ! return 0; ! cost = navigate_cost_time(iter->next->segment->line.line_id, ! iter->next->segment->line_direction, ! iter->segment->time, ! iter->segment->line.line_id, ! iter->segment->line_direction); ! iter->next->segment->time = cost; ! return cost; ! } ! /** ! * @brief move one step forward from the current position ! * @param algo the algorithm pointer ! * @param stp pointer to the navigation status to work on ! * @return success (-1 is failure, 0 is backtrack, 1 is success) ! */ ! static int navigate_simple_algo_step(NavigateAlgorithm *algo, NavigateStatus *stp) ! { ! int maxlines = 10, nlines; ! PluginLine *l, lines[10]; ! int point, best, newpt, newpt2, bestnewpt; ! RoadMapStreetProperties prop; ! int bestdist, dist, dist2, rev, bestheuristic; ! int i, found; ! NavigateIteration *p; ! RoadMapPosition newpos, newpos2, bestnewpos; ! NavigateSegment *s = stp->current->segment; ! NavigateSegment bestseg; ! RoadMapPosition to_pos = stp->last->segment->to_pos; ! /* Figure out where to start */ ! nlines = 0; ! if (s->from_point) { ! point = s->from_point; ! nlines = navigate_simple_lines_closeby(s->from_point, lines, maxlines); } ! if (nlines == 0) { ! l = roadmap_navigate_position2line(s->from_pos); ! point = roadmap_line_from_point(l->line_id); ! nlines = navigate_simple_lines_closeby(point, lines, maxlines); ! if (nlines == 0) { ! point = roadmap_line_to_point(l->line_id); ! nlines = navigate_simple_lines_closeby(point, lines, maxlines); ! } ! } ! if (nlines == 0) { ! /* This is too simplistic, maybe backtrack from here too ? */ return -1; ! } ! /* Allocate the next entry */ ! stp->current->next = calloc(1, sizeof(struct NavigateIteration)); ! stp->current->next->prev = stp->current; ! stp->current->next->segment = calloc(1, sizeof(struct NavigateSegment)); ! roadmap_point_position(point, &newpos); ! roadmap_log(ROADMAP_DEBUG, "Looking from point %d (%d %d), %d lines", ! point, ! newpos.longitude, newpos.latitude, ! nlines); ! /* We have a set of lines. Select the best one. */ ! bestdist = stp->maxdist * 2; ! bestheuristic = -1; ! best = -1; ! for (i=0; i<nlines; i++) { ! roadmap_street_get_properties(lines[i].line_id, &prop); /* Only for debug */ ! /* Have we already been here ? */ ! for (p=stp->first, found=0; p && found == 0; p=p->next) ! if (lines[i].line_id == p->segment->line.line_id) ! found = 1; ! if (found) { ! roadmap_log (ROADMAP_DEBUG, " line %d already visited", ! lines[i].line_id); ! continue; } ! /* Is this line forbidden ? */ ! if (navigate_simple_on_blacklist(lines[i].line_id)) { ! roadmap_log (ROADMAP_DEBUG, " line %d [%d] {%s} blacklisted", ! i, lines[i].line_id, ! roadmap_street_get_full_name(&prop)); ! continue; } ! /* Use the turns DB : is this turn allowed ? */ ! if (roadmap_turns_find_restriction (s->from_point, ! stp->current->prev ? stp->current->prev->segment->line.line_id : 0, ! stp->current->segment->line.line_id)) { ! roadmap_log (ROADMAP_WARNING, "Turn forbidden at %d from %d to %d", ! s->from_point, ! stp->current->prev ? stp->current->prev->segment->line.line_id : 0, ! stp->current->segment->line.line_id); ! continue; ! } + stp->current->next->segment->line = lines[i]; + newpt2 = roadmap_line_from_point(lines[i].line_id); + if (point == newpt2) { newpt = roadmap_line_to_point(lines[i].line_id); roadmap_point_position(newpt, &newpos); dist = roadmap_math_distance(&newpos, &to_pos); ! stp->current->next->segment->line_direction = rev = 0; ! stp->current->next->segment->from_point = newpt; ! stp->current->next->segment->from_pos = newpos; ! stp->current->next->segment->dist_from_destination = dist; ! stp->current->segment->to_point = newpt; ! stp->current->segment->to_pos = newpos; ! } else { roadmap_point_position(newpt2, &newpos2); dist2 = roadmap_math_distance(&newpos2, &to_pos); ! stp->current->next->segment->line_direction = rev = 1; ! stp->current->next->segment->from_point = newpt2; ! stp->current->next->segment->from_pos = newpos2; ! stp->current->next->segment->dist_from_destination = dist2; ! stp->current->segment->to_point = newpt2; ! stp->current->segment->to_pos = newpos2; ! } ! roadmap_log (ROADMAP_DEBUG, "Line %d (%s) point %d pos %d %d", ! lines[i].line_id, roadmap_street_get_full_name(&prop), ! stp->current->next->segment->from_point, ! stp->current->next->segment->from_pos.longitude, ! stp->current->next->segment->from_pos.latitude); ! stp->current->next->segment->distance = stp->current->segment->distance + ! roadmap_math_distance(&stp->current->segment->from_pos, ! &stp->current->segment->to_pos); ! (void) algo->cost_fn(stp->current); ! ! stp->current->next->segment->heuristic = ! stp->current->next->segment->dist_from_destination; ! ! if (bestheuristic < 0 || stp->current->next->segment->heuristic < bestheuristic) { ! bestseg = *stp->current->next->segment; ! best = i; ! bestdist = stp->current->next->segment->distance; ! bestnewpt = stp->current->segment->to_point; ! bestnewpos = stp->current->segment->to_pos; ! bestheuristic = stp->current->next->segment->heuristic; ! roadmap_log (ROADMAP_DEBUG, ! "Better ix %d, dist %d, pt %d, pos %d %d, hr %d", ! best, bestdist, bestnewpt, ! bestnewpos.longitude, bestnewpos.latitude, ! bestheuristic); } ! ! } ! ! /* Is the result really bad ? */ ! if (best < 0) { ! if (stp->iteration < 2) { ! roadmap_log (ROADMAP_WARNING, "On an island ?"); ! return -1; } ! roadmap_log (ROADMAP_DEBUG, "Backtrack .."); ! navigate_simple_blacklist_add(stp->current->segment->line.line_id); ! stp->current = stp->current->prev; ! if (stp->current == 0) ! stp->current = stp->first; ! return 0; ! } + /* Put the data for the "best" selection back */ + stp->current->next->segment->distance = bestdist; + stp->current->next->segment->from_point = + stp->current->segment->to_point = bestnewpt; + stp->current->next->segment->from_pos = + stp->current->segment->to_pos = bestnewpos; + stp->current->next->segment->heuristic = bestheuristic; + *stp->current->next->segment = bestseg; ! /* Move along */ ! stp->current = stp->current->next; ! /* Store cost information */ ! stp->current->cost.distance = stp->current->segment->distance; ! stp->current->cost.time = stp->current->segment->time; ! roadmap_log (ROADMAP_DEBUG, "New point %d distance %d, time %d", ! bestnewpt, ! stp->current->segment->distance, ! stp->current->segment->time); ! /* return */ ! return 1; ! } ! /** ! * @brief Figure out whether the routing algorithm needs to do another iteration ! * @param stp pointer to all the navigation info ! * @return 0 to keep going, 1 to stop (reached the destination) ! */ ! static int navigate_simple_algo_end(NavigateStatus *stp) ! { ! RoadMapPosition p1, p2; ! int dist; ! if (stp->current->segment->from_point) ! roadmap_point_position(stp->current->segment->from_point, &p1); ! else ! p1 = stp->current->segment->from_pos; ! if (stp->last->segment->to_point) ! roadmap_point_position(stp->last->segment->to_point, &p2); ! else ! p2 = stp->last->segment->to_pos; ! dist = roadmap_math_distance(&p1, &p2); ! ! roadmap_log (ROADMAP_DEBUG, "Distance is now %d", dist); ! if (dist < 30) ! return 1; ! return 0; /* Keep going */ ! #if 0 ! if (!stop && to_line && to_line->line_id == lines[best].line_id) ! stop++; ! if (!stop && roadmap_line_from_point(to_line->line_id) == bestnewpt) ! stop++; ! if (!stop && roadmap_line_to_point(to_line->line_id) == bestnewpt) ! stop++; ! return 0; /* Nearly infinite loop */ ! return 1; /* Stop immediately */ ! #endif ! } ! ! /** ! * @brief structure to pass an "algorithm" to the navigation engine ! */ ! NavigateAlgorithm SimpleAlgo = { ! "Simple navigation", /**< name of this algorithm */ ! 0, /**< cannot go both ways */ ! 500, /**< max #iterations */ ! navigate_simple_algo_cost, /**< cost function */ ! navigate_simple_algo_step, /**< step function */ ! navigate_simple_algo_end /**< end function */ ! }; ! ! /** ! * @brief register the algorithm ! */ ! void navigate_simple_initialize(void) ! { ! navigate_algorithm_register(&SimpleAlgo); } Index: navigate_route.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_route.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_route.h 15 Feb 2009 16:47:49 -0000 1.1 --- navigate_route.h 23 Mar 2009 20:41:28 -0000 1.2 *************** *** 1,8 **** /** - * @file navigate_route.h - generic navigate functions * * LICENSE: * * Copyright 2006 Ehud Shabtai * * This file is part of RoadMap. --- 1,8 ---- /** * * LICENSE: * * Copyright 2006 Ehud Shabtai + * Copyright (c) 2009, Danny Backx. * * This file is part of RoadMap. *************** *** 21,25 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * */ --- 21,29 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief navigate_route.h - generic navigate functions */ *************** *** 45,48 **** --- 49,57 ---- int *result); + NavigateStatus navigate_route_get_initial (PluginLine *from_line, + RoadMapPosition from_pos, + PluginLine *to_line, + RoadMapPosition to_pos); + #endif /* _NAVIGATE_ROUTE_H_ */ |
|
From: Danny B. <dan...@us...> - 2009-03-23 20:41:44
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9415 Modified Files: roadmap_layer.c roadmap_turns.c Log Message: Restructure the navigation code to try and separate routing algorithm specifics ("business logic") from the basic navigation engine. It may look like I'm adding a "plugin" interface in navigation too, that's not the main reason for all this. The main reason is to make things easier to understand. Index: roadmap_turns.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_turns.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_turns.c 15 Mar 2009 08:11:47 -0000 1.2 --- roadmap_turns.c 23 Mar 2009 20:41:28 -0000 1.3 *************** *** 74,78 **** /** ! * @brief * @param root * @return --- 74,78 ---- /** ! * @brief called to load the turns map into memory at RoadMap startup * @param root * @return *************** *** 135,139 **** /** ! * @brief * @param context */ --- 135,139 ---- /** ! * @brief activate the turns DB at RoadMap startup * @param context */ *************** *** 162,166 **** /** ! * @brief * @param context */ --- 162,166 ---- /** ! * @brief unmap the turns DB from RoadMap's memory * @param context */ *************** *** 192,199 **** /** ! * @brief ! * @param square ! * @param first ! * @param last */ int roadmap_turns_in_square (int square, int *first, int *last) { --- 192,200 ---- /** ! * @brief find the first and last turns in a given square (they're sorted this way) ! * @param square input parameter : the square ! * @param first returns the index of the first turn in this square ! * @param last returns the index of the last turn in this square ! * @return the number of turns in this square */ int roadmap_turns_in_square (int square, int *first, int *last) { *************** *** 219,231 **** /** ! * @brief ! * @param node ! * @param begin ! * @param end ! * @param first ! * @param last ! * @return */ ! int roadmap_turns_of_node (int node, int begin, int end, int *first, int *last) { --- 220,232 ---- /** ! * @brief Look up the turns of a node ! * @param node the node id ! * @param begin ?? ! * @param end ?? ! * @param first return the index of the first turn ! * @param last return the index of the last turn ! * @return the number of turns */ ! int roadmap_turns_of_node (int node, int begin, int end, int *first, int *last) { *************** *** 285,289 **** /** ! * @brief * @param node * @param from_line --- 286,290 ---- /** ! * @brief Find the restrictions when passing a node from one to another line * @param node * @param from_line Index: roadmap_layer.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_layer.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** roadmap_layer.c 12 Feb 2009 16:12:39 -0000 1.21 --- roadmap_layer.c 23 Mar 2009 20:41:28 -0000 1.22 *************** *** 1109,1113 **** * @brief returns the value of the Speed parameter of this layer, from default/All. * @param layer ! * @return */ int roadmap_layer_speed(int layer) --- 1109,1113 ---- * @brief returns the value of the Speed parameter of this layer, from default/All. * @param layer ! * @return speed, assumed by calling code to be in km/h (FIX ME) */ int roadmap_layer_speed(int layer) |
|
From: Danny B. <dan...@us...> - 2009-03-18 18:22:17
|
Update of /cvsroot/roadmap/roadmap/src/navigate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21216/navigate Modified Files: navigate_simple.c Log Message: Remove the runtime cache code. Index: navigate_simple.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_simple.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** navigate_simple.c 18 Mar 2009 18:20:03 -0000 1.4 --- navigate_simple.c 18 Mar 2009 18:22:05 -0000 1.5 *************** *** 1,3 **** - #undef HAVE_RUNTIME_CACHE /* * LICENSE: --- 1,2 ---- *************** *** 87,249 **** } - #ifdef HAVE_RUNTIME_CACHE - /* - * Cache - */ - enum direction { - D_NORMAL, - D_REVERSE - }; - - static int cache_point_count = 0, - cache_line_count = 0; - - struct cache_line { - int line; - int layer; - int fips; - }; - - #define INIT_LINES_PER_POINT 5 - #define INIT_POINTS 80 - - struct cache_per_point { - int point; - int num_lines, max_lines; - struct cache_line *lines; - }; - - struct cache_per_point *cache = NULL; - int num_cache = 0, max_cache = 0; - int cache_square = 0; - - /** - * @brief build a cache of the line/point combinations in this square, organize per point - * @param line - * @param point - * @param reverse - */ - static void cache_point(int line, int layer, int fips, int point, enum direction reverse) - { - int i, j; - - for (i=0; i<num_cache; i++) { - if (cache[i].point == point) { - for (j=0; j<cache[i].num_lines; j++) { - if (cache[i].lines[j].line == line) - return; - } - /* Found the entry for this point, but not this line, so store the line */ - if (cache[i].num_lines == cache[i].max_lines) { - /* If necessary, expand the array first */ - cache[i].max_lines += INIT_LINES_PER_POINT; - cache[i].lines = (struct cache_line *)realloc((void *)cache[i].lines, - cache[i].max_lines * sizeof(struct cache_line)); - } - cache[i].lines[cache[i].num_lines].line = line; - cache[i].lines[cache[i].num_lines].fips = fips; - cache[i].lines[cache[i].num_lines].layer = layer; - cache[i].num_lines++; - cache_line_count++; - return; - } - } - - /* Haven't seen this point yet */ - if (num_cache == max_cache) { - /* Need more space */ - max_cache += INIT_POINTS; - cache = (struct cache_per_point *)realloc((void *)cache, - max_cache * sizeof(struct cache_per_point)); - } - - /* New point, allocate initial array */ - cache[num_cache].point = point; - cache[num_cache].num_lines = 0; - cache[num_cache].max_lines = INIT_LINES_PER_POINT; - cache[num_cache].lines = (struct cache_line *)calloc(cache[num_cache].max_lines, - sizeof(struct cache_line)); - cache[num_cache].lines[cache[num_cache].num_lines].line = line; - cache[num_cache].lines[cache[num_cache].num_lines].fips = fips; - cache[num_cache].lines[cache[num_cache].num_lines].layer = layer; - cache[num_cache].num_lines++; - num_cache++; - - cache_point_count++; - cache_line_count++; - } - - /** - * @brief free the cache - */ - static void free_cache(void) - { - int i; - - for (i=0; i<num_cache; i++) { - free((void *)cache[i].lines); - } - - free(cache); - num_cache = max_cache = 0; - cache = NULL; - cache_point_count = cache_line_count = 0; - } - - /** - * @brief look up points and lines in this square - * @param square - */ - static void navigate_simple_square_inventory(int square) - { - #define maxlayers 10 - int nlayer, layers[maxlayers], i, layer, fips, - nlines, first, last, line, from_point, to_point; - RoadMapPosition pos; - - if (square == cache_square) - return; - free_cache(); - cache_square = square; - - nlayer = roadmap_layer_navigable(roadmap_navigate_get_mode(), layers, maxlayers); - - nlines = 0; - for (i=0; i<nlayer; i++) { - layer = layers[i]; - - /* Query streets per layer, due to structure of RoadMap database */ - if (roadmap_line_in_square(square, layer, &first, &last)) { - nlines += last - first + 1; - - for (line = first; line <= last; line++) { - roadmap_line_points(line, &from_point, &to_point); - /* We know the from_point is in the square */ - cache_point(line, layer, fips, from_point, D_NORMAL); - /* Check whether the to-point is in the square */ - roadmap_point_position(to_point, &pos); - if (roadmap_county_by_position(&pos, &fips, 1) == 1 - && roadmap_square_search(&pos) == square) - cache_point(line, layer, fips, to_point, D_REVERSE); - } - - } - - if (roadmap_line_in_square2(square, layer, &first, &last)) { - nlines += last - first + 1; - - for (line = first; line <= last; line++) { - int l = roadmap_line_get_from_index2(line); - to_point = roadmap_line_to_point(l); - cache_point(l, layer, fips, to_point, D_NORMAL); - } - } - roadmap_log (ROADMAP_DEBUG, "closeby : %d lines %d points after layer %d", - cache_line_count, cache_point_count, layer); - } - - } - #endif /* HAVE_RUNTIME_CACHE */ - /** * @brief --- 86,89 ---- *************** *** 258,262 **** PluginLine *lines, const int maxlines) { - #ifndef HAVE_RUNTIME_CACHE /* Use the line/bypoint data in newer maps, or fail */ int i, line_id; --- 98,101 ---- *************** *** 271,316 **** } return i; - #else /* HAVE_RUNTIME_CACHE */ - #define maxlayers 10 - int square, i, j, - nlines, found, other, l; - - roadmap_log (ROADMAP_DEBUG, "navigate_simple_lines_closeby(%d,%d) point %d", - pos.longitude, pos.latitude, point); - - square = roadmap_square_search(&pos); - - /* Make a point/line inventory of the whole square */ - navigate_simple_square_inventory(square); - - /* Figure out where to go now */ - for (i=0,found=0; i<num_cache && !found; i++) { - if (cache[i].point == point) { - found = 1; - break; - } - } - if (! found) { - roadmap_log (ROADMAP_WARNING, "Yow : not found"); - return 0; - } - - for (nlines=j=0; j<cache[i].num_lines; j++) { - RoadMapStreetProperties prop; - l = cache[i].lines[j].line; - - roadmap_street_get_properties(cache[i].lines[j].line, &prop); - - other = roadmap_line_from_point(l); - if (other == point) - other = roadmap_line_to_point(l); - - lines[nlines].line_id = l; - lines[nlines].fips = cache[i].lines[j].fips; - lines[nlines].layer = cache[i].lines[j].layer; - nlines++; - } - return nlines; - #endif /* HAVE_RUNTIME_CACHE */ } --- 110,113 ---- *************** *** 365,373 **** if (do_this_once) { do_this_once = 0; - #ifdef HAVE_RUNTIME_CACHE - roadmap_log(ROADMAP_WARNING, "Use runtime cache"); - #else roadmap_log(ROADMAP_WARNING, "Use map extension"); - #endif } --- 162,166 ---- |
|
From: Danny B. <dan...@us...> - 2009-03-18 18:20:10
|
Update of /cvsroot/roadmap/roadmap/src/navigate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20315/navigate Modified Files: navigate_simple.c Log Message: Remove silly debug statements. Call the new function roadmap_line_get_fips, and roadmap_line_get_layer, to make the visual appearance of the route work again. Index: navigate_simple.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_simple.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** navigate_simple.c 15 Mar 2009 07:49:47 -0000 1.3 --- navigate_simple.c 18 Mar 2009 18:20:03 -0000 1.4 *************** *** 246,282 **** #endif /* HAVE_RUNTIME_CACHE */ - static void debug(int point, int maxlines) - { - int i, line_id; - fprintf(stderr, "CloseBy from map (%d) -> ", point); - for (i=0; (line_id = roadmap_line_point_adjacent(point, i)) && (i < maxlines); i++) { - fprintf(stderr, "%d ", line_id); - } - fprintf(stderr, "\n"); - - #if 0 - static int once = 1; - if (once) { - once = 0; - for (i=0; i<1708; i++) { - int j; - fprintf(stderr, "LBP[%d] -> ", i); - for (j=0; roadmap_line_point_adjacent(i, j); j++) - fprintf(stderr, " %d ", roadmap_line_point_adjacent(i, j)); - fprintf(stderr, "\n"); - } - } - #endif - #if 0 - for (i=0; i<1708; i++) { - if (roadmap_line_point_adjacent(i, 0) == 21 - && roadmap_line_point_adjacent(i, 1) == 22 - && roadmap_line_point_adjacent(i, 2) == 23) { - fprintf(stderr, "YOW YOW YOW %d -> %d (21 22 23)\n", point, i); - } - } - #endif - } - /** * @brief --- 246,249 ---- *************** *** 291,309 **** PluginLine *lines, const int maxlines) { - #if 1 - debug(point, maxlines); - // if (point == 455) debug(367, maxlines); - // if (point == 461) debug(382, maxlines); - #endif #ifndef HAVE_RUNTIME_CACHE /* Use the line/bypoint data in newer maps, or fail */ int i, line_id; ! RoadMapStreetProperties prop; for (i=0; (line_id = roadmap_line_point_adjacent(point, i)) && (i < maxlines); i++) { ! roadmap_street_get_properties(line_id, &prop); lines[i].line_id = line_id; // lines[i].fips = prop.fips; - // lines[i].layer = prop.layer; } return i; --- 258,272 ---- PluginLine *lines, const int maxlines) { #ifndef HAVE_RUNTIME_CACHE /* Use the line/bypoint data in newer maps, or fail */ int i, line_id; ! // RoadMapStreetProperties prop; for (i=0; (line_id = roadmap_line_point_adjacent(point, i)) && (i < maxlines); i++) { ! // roadmap_street_get_properties(line_id, &prop); lines[i].line_id = line_id; + lines[i].layer = roadmap_line_get_layer(line_id); + lines[i].fips = roadmap_line_get_fips(line_id); // lines[i].fips = prop.fips; } return i; *************** *** 379,383 **** #define MAX_CAT 10 /* Not interesting */ ! #define MAX_ITER 100 /* Max #iterations */ int ncategories, i, j, found; --- 342,346 ---- #define MAX_CAT 10 /* Not interesting */ ! #define MAX_ITER 500 /* Max #iterations */ int ncategories, i, j, found; |
|
From: Danny B. <dan...@us...> - 2009-03-18 18:18:36
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19950 Modified Files: roadmap_line.c roadmap_line.h Log Message: Add new function to look up the fips of a line. Index: roadmap_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_line.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_line.h 14 Mar 2009 16:10:21 -0000 1.6 --- roadmap_line.h 18 Mar 2009 18:18:24 -0000 1.7 *************** *** 72,74 **** --- 72,76 ---- int roadmap_line_to_point (int line); + int roadmap_line_get_layer (int line_id); + int roadmap_line_get_fips(int line); #endif // INCLUDED__ROADMAP_LINE__H Index: roadmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_line.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** roadmap_line.c 14 Mar 2009 16:10:21 -0000 1.15 --- roadmap_line.c 18 Mar 2009 18:18:24 -0000 1.16 *************** *** 414,417 **** --- 414,425 ---- } + /** + * @brief + * @param index + * @param line_id + * @param area + * @param cfcc + * @return + */ int roadmap_line_long (int index, int *line_id, RoadMapArea *area, int *cfcc) { *************** *** 544,545 **** --- 552,569 ---- return p[ix]; } + + /** + * @brief return the fips for this line, based on the from point's position + * @param line the line id + * @return the fips + */ + int roadmap_line_get_fips(int line) + { + static int *fl = NULL; + RoadMapPosition pos; + + roadmap_line_from(line, &pos); + if (roadmap_locator_by_position(&pos, &fl) <= 0) + return -1; + return fl[0]; + } |
|
From: Danny B. <dan...@us...> - 2009-03-17 18:11:17
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19487 Modified Files: roadmap_db_line.h Log Message: In my mind, this describes the contents of this table better. Comments welcome. Index: roadmap_db_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_line.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_db_line.h 14 Mar 2009 16:10:20 -0000 1.7 --- roadmap_db_line.h 17 Mar 2009 18:10:51 -0000 1.8 *************** *** 29,34 **** * The RoadMap lines are described by the following table: * ! * line/data The ID of the line and its from and to points. ! * The lines are sorted by square. * line/bysquare1 An index of layers per square (points to line/bylayer1). * line/bylayer1 An indirect index, from layers to lines. --- 29,38 ---- * The RoadMap lines are described by the following table: * ! * line/data The from and to points of a line. ! * The line id isn't stored. ! * The lines are sorted by square. (This is not a property ! * of this table, but of the line ids : these are clustered ! * in such a way that the lines of a square have a range of ! * ids next to each other.) * line/bysquare1 An index of layers per square (points to line/bylayer1). * line/bylayer1 An indirect index, from layers to lines. *************** *** 57,62 **** * @brief table line/data * ! * line/data The ID of the line and its from and to points. ! * The lines are sorted by square. */ typedef struct { --- 61,66 ---- * @brief table line/data * ! * line/data The from and to points of a line. Lookup is by line id. ! * Line ids are clustered per square. */ typedef struct { |
|
From: Danny B. <dan...@us...> - 2009-03-15 08:11:56
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15251 Modified Files: roadmap_turns.c Makefile Added Files: buildmap_turn_restrictions.c buildmap_turn_restrictions.h roadmap_db_turns.h Log Message: Import the rest of Ehud's "turn" code, with minimal edits for clean compile and documentation stubs. --- NEW FILE: roadmap_db_turns.h --- /* * LICENSE: * * Copyright 2006 Ehud Shabtai * * 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 the format of the turn restrictions table used by RoadMap. */ #ifndef _ROADMAP_DB_TURNS_H_ #define _ROADMAP_DB_TURNS_H_ #include "roadmap_types.h" typedef struct { int from_line; int to_line; } RoadMapTurns; typedef struct { int node; int first; int count; } RoadMapTurnsByNode; typedef struct { int first; int count; } RoadMapTurnsBySquare; #endif // _ROADMAP_DB_TURNS_H_ --- NEW FILE: buildmap_turn_restrictions.h --- /* buildmap_turn_restrictions.h - Build a turn restrictions table & index for RoadMap. * * LICENSE: * * Copyright 2006 Ehud Shabtai * * 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 */ #ifndef _BUILDMAP_TURN_REST_H_ #define _BUILDMAP_TURN_REST_H_ #include "roadmap_types.h" void buildmap_turn_restrictions_initialize (void); int buildmap_turn_restrictions_add (int node, int from_line, int to_line); int buildmap_turn_restrictions_exists (int node, int from_line, int to_line); void buildmap_turn_restrictions_sort (void); void buildmap_turn_restrictions_save (void); void buildmap_turn_restrictions_summary (void); void buildmap_turn_restrictions_reset (void); #endif // _BUILDMAP_TURN_REST_H_ Index: roadmap_turns.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_turns.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_turns.c 15 Feb 2009 16:47:49 -0000 1.1 --- roadmap_turns.c 15 Mar 2009 08:11:47 -0000 1.2 *************** *** 50,55 **** static char *RoadMapTurnsType = "RoadMapTurnsContext"; typedef struct { - char *type; --- 50,57 ---- static char *RoadMapTurnsType = "RoadMapTurnsContext"; + /** + * @brief + */ typedef struct { char *type; *************** *** 65,69 **** int *turns_cache; int turns_cache_size; /* This is the size in bits ! */ - } RoadMapTurnsContext; --- 67,70 ---- *************** *** 72,76 **** static int RoadMapTurns2Mask[8*sizeof(int)] = {0}; ! static void *roadmap_turns_map (roadmap_db *root) { --- 73,81 ---- static int RoadMapTurns2Mask[8*sizeof(int)] = {0}; ! /** ! * @brief ! * @param root ! * @return ! */ static void *roadmap_turns_map (roadmap_db *root) { *************** *** 129,132 **** --- 134,141 ---- } + /** + * @brief + * @param context + */ static void roadmap_turns_activate (void *context) { *************** *** 152,155 **** --- 161,168 ---- } + /** + * @brief + * @param context + */ static void roadmap_turns_unmap (void *context) { *************** *** 168,171 **** --- 181,187 ---- } + /** + * @brief + */ roadmap_db_handler RoadMapTurnsHandler = { "turns", *************** *** 175,179 **** }; ! int roadmap_turns_in_square (int square, int *first, int *last) { --- 191,200 ---- }; ! /** ! * @brief ! * @param square ! * @param first ! * @param last ! */ int roadmap_turns_in_square (int square, int *first, int *last) { *************** *** 197,201 **** } ! int roadmap_turns_of_node (int node, int begin, int end, int *first, int *last) { --- 218,230 ---- } ! /** ! * @brief ! * @param node ! * @param begin ! * @param end ! * @param first ! * @param last ! * @return ! */ int roadmap_turns_of_node (int node, int begin, int end, int *first, int *last) { *************** *** 255,259 **** } ! int roadmap_turns_find_restriction (int node, int from_line, int to_line) { --- 284,294 ---- } ! /** ! * @brief ! * @param node ! * @param from_line ! * @param to_line ! * @return ! */ int roadmap_turns_find_restriction (int node, int from_line, int to_line) { Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** Makefile 15 Feb 2009 16:31:54 -0000 1.137 --- Makefile 15 Mar 2009 08:11:47 -0000 1.138 *************** *** 49,53 **** roadmap_linefont.c \ roadmap_lang.c \ ! roadmap_iso.c RMLIBOBJS = $(RMLIBSRC:.c=.o) --- 49,54 ---- roadmap_linefont.c \ roadmap_lang.c \ ! roadmap_iso.c \ ! roadmap_turns.c RMLIBOBJS = $(RMLIBSRC:.c=.o) *************** *** 127,131 **** buildmap_place.c \ buildmap_index.c \ ! buildmap_opt.c BMLIBOBJS = $(BMLIBSRC:.c=.o) --- 128,133 ---- buildmap_place.c \ buildmap_index.c \ ! buildmap_opt.c \ ! buildmap_turn_restrictions.c BMLIBOBJS = $(BMLIBSRC:.c=.o) *************** *** 212,216 **** buildus_county.h \ roadmap_iso.h \ ! buildus_fips.h XCHGHEADERS = \ --- 214,219 ---- buildus_county.h \ roadmap_iso.h \ ! buildus_fips.h \ ! buildmap_turn_restrictions.h XCHGHEADERS = \ *************** *** 299,302 **** --- 302,306 ---- roadmap_trip.h \ roadmap_tripdb.h \ + roadmap_turns.h \ roadmap_types.h \ roadmap_vii.h \ *************** *** 318,322 **** roadmap_db_square.h \ roadmap_db_street.h \ ! roadmap_dbread.h HEADERS = $(BMHEADERS) $(XCHGHEADERS) $(RGHEADERS) $(RMHEADERS) $(RMDBHEADERS) --- 322,327 ---- roadmap_db_square.h \ roadmap_db_street.h \ ! roadmap_dbread.h \ ! roadmap_db_turns.h HEADERS = $(BMHEADERS) $(XCHGHEADERS) $(RGHEADERS) $(RMHEADERS) $(RMDBHEADERS) *************** *** 410,424 **** navigate/navigate_route.c CFLAGS += -DHAVE_NAVIGATE_PLUGIN PLUGIN_CLEAN += ${NAVIGATE_PLUGINSRC:.c=.o} - # - # support for navigate plugin without trip plugin - # RMLIBSRC += roadmap_skin.c roadmap_line_speed.c roadmap_res.c roadmap_line_route.c # roadmap_turns.c ! # ! # End of support for navigate plugin without trip plugin ! # RMGUISRC += --- 415,436 ---- navigate/navigate_route.c + NAVIGATE_PLUGIN_HDR = \ + navigate/navigate_bar.h \ + navigate/navigate_cost.h \ + navigate/navigate.h \ + navigate/navigate_plugin.h \ + navigate/navigate_route.h \ + navigate/navigate_simple.h \ + navigate/navigate_visual.h + CFLAGS += -DHAVE_NAVIGATE_PLUGIN PLUGIN_CLEAN += ${NAVIGATE_PLUGINSRC:.c=.o} RMLIBSRC += roadmap_skin.c roadmap_line_speed.c roadmap_res.c roadmap_line_route.c # roadmap_turns.c ! ! RMHEADERS += ${NAVIGATE_PLUGIN_HDR} \ ! roadmap_skin.h roadmap_line_speed.h roadmap_db_line_speed.h roadmap_res.h ! # roadmap_line_route.h roadmap_db_line_route.h roadmap_db_turns.h roadmap_turns.h RMGUISRC += --- NEW FILE: buildmap_turn_restrictions.c --- /* * LICENSE: * * Copyright 2006 Ehud Shabtai * Copyright (c) 2009, 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 buildmap_turn_restrictions.c - Build turn restrictions table & index for RoadMap. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap_db_turns.h" #include "roadmap_hash.h" #include "buildmap.h" #include "buildmap_turn_restrictions.h" #include "buildmap_square.h" #include "buildmap_point.h" /** * @brief */ typedef struct { int node; int from_line; int to_line; } BuildMapTurns; static int TurnsCount = 0; static int TurnsNodeCount = 0; static int TurnsMaxNode = 0; static BuildMapTurns *Turns[BUILDMAP_BLOCK] = {NULL}; static RoadMapHash *TurnsByNode = NULL; static int TurnsAddCount = 0; static int *SortedTurns = NULL; /** * @brief */ void buildmap_turn_restrictions_initialize (void) { TurnsByNode = roadmap_hash_new ("TurnsByNode", BUILDMAP_BLOCK); TurnsMaxNode = 0; TurnsAddCount = 0; TurnsCount = 0; } /** * @brief * @param node * @param from_line * @param to_line * @return */ int buildmap_turn_restrictions_add (int node, int from_line, int to_line) { int index; int node_exists; int block; int offset; BuildMapTurns *this_turn; TurnsAddCount += 1; /* First search if that shape is not known yet. */ node_exists = 0; for (index = roadmap_hash_get_first (TurnsByNode, node); index >= 0; index = roadmap_hash_get_next (TurnsByNode, index)) { this_turn = Turns[index / BUILDMAP_BLOCK] + (index % BUILDMAP_BLOCK); if (this_turn->node == node) { if ((this_turn->from_line == from_line) && (this_turn->to_line == to_line )) { buildmap_error (0, "duplicated turn_restriction: %d %d %d", node, from_line, to_line); } node_exists = 1; } } /* This shape was not known yet: create a new one. */ block = TurnsCount / BUILDMAP_BLOCK; offset = TurnsCount % BUILDMAP_BLOCK; if (block >= BUILDMAP_BLOCK) { buildmap_fatal (0, "too many shape records"); } if (Turns[block] == NULL) { /* We need to add a new block to the table. */ Turns[block] = calloc (BUILDMAP_BLOCK, sizeof(BuildMapTurns)); if (Turns[block] == NULL) { buildmap_fatal (0, "no more memory"); } roadmap_hash_resize (TurnsByNode, (block+1) * BUILDMAP_BLOCK); } this_turn = Turns[block] + offset; this_turn->node = node; this_turn->from_line = from_line; this_turn->to_line = to_line; if (! node_exists) { TurnsNodeCount += 1; if (node > TurnsMaxNode) { TurnsMaxNode = node; } if (node < 0) { buildmap_fatal (0, "negative node index: %d", node); } } roadmap_hash_add (TurnsByNode, node, TurnsCount); return TurnsCount++; } int buildmap_turn_restrictions_exists (int node, int from_line, int to_line) { int index; BuildMapTurns *this_turn; for (index = roadmap_hash_get_first (TurnsByNode, node); index >= 0; index = roadmap_hash_get_next (TurnsByNode, index)) { this_turn = Turns[index / BUILDMAP_BLOCK] + (index % BUILDMAP_BLOCK); if (this_turn->node == node) { if ((this_turn->from_line == from_line) && (this_turn->to_line == to_line )) { return 1; } } } return 0; } static int buildmap_turns_compare (const void *r1, const void *r2) { int index1 = *((int *)r1); int index2 = *((int *)r2); BuildMapTurns *record1; BuildMapTurns *record2; record1 = Turns[index1/BUILDMAP_BLOCK] + (index1 % BUILDMAP_BLOCK); record2 = Turns[index2/BUILDMAP_BLOCK] + (index2 % BUILDMAP_BLOCK); if (record1->node != record2->node) { return record1->node - record2->node; } if (record1->from_line != record2->from_line) { return record1->from_line - record2->from_line; } return record1->to_line - record2->to_line; } void buildmap_turn_restrictions_sort (void) { int i; if (SortedTurns != NULL) return; /* Sort was already performed. */ buildmap_info ("sorting turn restrictions..."); SortedTurns = malloc (TurnsCount * sizeof(int)); if (SortedTurns == NULL) { buildmap_fatal (0, "no more memory"); } for (i = 0; i < TurnsCount; i++) { SortedTurns[i] = i; } qsort (SortedTurns, TurnsCount, sizeof(int), buildmap_turns_compare); } void buildmap_turn_restrictions_save (void) { int i; int j; int square; int last_node = -1; int node_index = -1; int turn_index; int last_square = -1; int square_count; int longitude = 0; int latitude = 0; RoadMapTurns *db_turns; BuildMapTurns *one_turn; RoadMapTurnsByNode *db_by_node; RoadMapTurnsBySquare *db_bysquare; buildmap_db *root; buildmap_db *table_square; buildmap_db *table_node; buildmap_db *table_data; return; buildmap_info ("saving turn restrictions..."); root = buildmap_db_add_section (NULL, "turns"); if (root == NULL) buildmap_fatal (0, "Can't add a new section"); square_count = buildmap_square_get_count(); /* Create the database space. */ table_square = buildmap_db_add_child (root, "bysquare", square_count, sizeof(RoadMapTurnsBySquare)); table_node = buildmap_db_add_child (root, "bynode", TurnsNodeCount, sizeof(RoadMapTurnsByNode)); table_data = buildmap_db_add_child (root, "data", TurnsCount, sizeof(RoadMapTurns)); db_bysquare = (RoadMapTurnsBySquare *) buildmap_db_get_data (table_square); db_by_node = (RoadMapTurnsByNode *) buildmap_db_get_data (table_node); db_turns = (RoadMapTurns *) buildmap_db_get_data (table_data); last_node = -1; for (i = 0, turn_index = 0; i < TurnsCount; i++, turn_index++) { j = SortedTurns[i]; one_turn = Turns[j/BUILDMAP_BLOCK] + (j % BUILDMAP_BLOCK); if (one_turn->node != last_node) { if (last_node > one_turn->node) { buildmap_fatal (0, "decreasing node order in turn restrictions table"); } node_index += 1; db_by_node[node_index].node = one_turn->node; db_by_node[node_index].first = turn_index; db_by_node[node_index].count = 0; last_node = one_turn->node; longitude = buildmap_point_get_longitude_sorted (last_node); latitude = buildmap_point_get_latitude_sorted (last_node); square = buildmap_point_get_square_sorted (last_node); if (square != last_square) { if (square < last_square) { buildmap_fatal (0, "decreasing square order in turns table"); } while (last_square < square) { last_square += 1; db_bysquare[last_square].first = node_index; db_bysquare[last_square].count = 0; } } db_bysquare[last_square].count += 1; } db_by_node[node_index].count += 1; db_turns[turn_index].from_line = one_turn->from_line; db_turns[turn_index].to_line = one_turn->to_line; } if (turn_index != TurnsCount) { buildmap_fatal (0, "inconsistent count of turn restrictions: " "total = %d, saved = %d", TurnsCount, turn_index+1); } if (last_square >= square_count) { buildmap_fatal (0, "inconsistent count of squares: " "total = %d, saved = %d", square_count, last_square+1); } for (last_square += 1; last_square < square_count; last_square += 1) { db_bysquare[last_square].first = node_index; db_bysquare[last_square].count = 0; } if (node_index+1 != TurnsNodeCount) { buildmap_fatal (0, "inconsistent count of nodes: " "total = %d, saved = %d", TurnsNodeCount, node_index+1); } #if 0 if (switch_endian) { int i; for (i=0; i<square_count; i++) { switch_endian_int(&db_bysquare[i].first); switch_endian_int(&db_bysquare[i].count); } for (i=0; i<TurnsNodeCount; i++) { switch_endian_int(&db_by_node[i].node); switch_endian_int(&db_by_node[i].first); switch_endian_int(&db_by_node[i].count); } for (i=0; i<TurnsCount; i++) { switch_endian_int(&db_turns[i].from_line); switch_endian_int(&db_turns[i].to_line); } } #endif } /** * @brief */ void buildmap_turn_restrictions_summary (void) { fprintf (stderr, "-- turn restrictions table: %d items, %d add, %d bytes used\n" " %d lines (range %d), max %d points per line\n", TurnsCount, 0, TurnsCount * sizeof(RoadMapTurns) + (TurnsMaxNode + 1) * sizeof(RoadMapTurnsByNode), TurnsNodeCount, TurnsMaxNode, 0); } /** * @brief */ void buildmap_turn_restrictions_reset (void) { int i; for (i = 0; i < BUILDMAP_BLOCK; i++) { if (Turns[i] != NULL) { free(Turns[i]); Turns[i] = NULL; } } free (SortedTurns); SortedTurns = NULL; TurnsCount = 0; TurnsNodeCount = 0; TurnsMaxNode = 0; TurnsByNode = NULL; } |
|
From: Danny B. <dan...@us...> - 2009-03-15 07:49:55
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11853 Modified Files: buildmap_line.c buildmap_osm_main.c Log Message: Change a test slightly. Add 2009 copyright. Test for 0 pointer before using it. Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** buildmap_line.c 14 Mar 2009 16:10:22 -0000 1.17 --- buildmap_line.c 15 Mar 2009 07:49:46 -0000 1.18 *************** *** 1003,1007 **** old = nalloc_line_by_point; ! if (nalloc_line_by_point < point) { nalloc_line_by_point = point + ALLOC_POINTS; lbp = (struct lbp *) realloc((void *)lbp, --- 1003,1007 ---- old = nalloc_line_by_point; ! if (nalloc_line_by_point <= point) { nalloc_line_by_point = point + ALLOC_POINTS; lbp = (struct lbp *) realloc((void *)lbp, Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** buildmap_osm_main.c 14 Mar 2009 16:10:21 -0000 1.15 --- buildmap_osm_main.c 15 Mar 2009 07:49:46 -0000 1.16 *************** *** 3,7 **** * * Copyright 2007 Paul G. Fox ! * Copyright (c) 2008, Danny Backx * * This file is part of RoadMap. --- 3,7 ---- * * Copyright 2007 Paul G. Fox ! * Copyright (c) 2008, 2009, Danny Backx * * This file is part of RoadMap. |
|
From: Danny B. <dan...@us...> - 2009-03-15 07:49:55
|
Update of /cvsroot/roadmap/roadmap/src/navigate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11853/navigate Modified Files: navigate_simple.c Log Message: Change a test slightly. Add 2009 copyright. Test for 0 pointer before using it. Index: navigate_simple.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_simple.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navigate_simple.c 14 Mar 2009 16:10:23 -0000 1.2 --- navigate_simple.c 15 Mar 2009 07:49:47 -0000 1.3 *************** *** 413,419 **** /* Where are we ? */ PluginLine *l = roadmap_navigate_position2line(from_pos); ! roadmap_log (ROADMAP_WARNING, "from --> %s (%d)", ! l ? roadmap_plugin_street_full_name(l) : "??", ! l->line_id); if (l) *from_line = *l; --- 413,422 ---- /* Where are we ? */ PluginLine *l = roadmap_navigate_position2line(from_pos); ! if (l) ! roadmap_log (ROADMAP_WARNING, "from --> %s (%d)", ! roadmap_plugin_street_full_name(l), l->line_id); ! else ! roadmap_log (ROADMAP_WARNING, "from --> ??"); ! if (l) *from_line = *l; |
|
From: Danny B. <dan...@us...> - 2009-03-14 16:10:36
|
Update of /cvsroot/roadmap/roadmap/src/navigate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30632/navigate Modified Files: navigate_simple.c Log Message: First cut at a map extension: add line/bypoint1 and line/bypoint2 tables. Index: navigate_simple.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/navigate/navigate_simple.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_simple.c 15 Feb 2009 16:47:49 -0000 1.1 --- navigate_simple.c 14 Mar 2009 16:10:23 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + #undef HAVE_RUNTIME_CACHE /* * LICENSE: *************** *** 86,89 **** --- 87,91 ---- } + #ifdef HAVE_RUNTIME_CACHE /* * Cache *************** *** 242,245 **** --- 244,281 ---- } + #endif /* HAVE_RUNTIME_CACHE */ + + static void debug(int point, int maxlines) + { + int i, line_id; + fprintf(stderr, "CloseBy from map (%d) -> ", point); + for (i=0; (line_id = roadmap_line_point_adjacent(point, i)) && (i < maxlines); i++) { + fprintf(stderr, "%d ", line_id); + } + fprintf(stderr, "\n"); + + #if 0 + static int once = 1; + if (once) { + once = 0; + for (i=0; i<1708; i++) { + int j; + fprintf(stderr, "LBP[%d] -> ", i); + for (j=0; roadmap_line_point_adjacent(i, j); j++) + fprintf(stderr, " %d ", roadmap_line_point_adjacent(i, j)); + fprintf(stderr, "\n"); + } + } + #endif + #if 0 + for (i=0; i<1708; i++) { + if (roadmap_line_point_adjacent(i, 0) == 21 + && roadmap_line_point_adjacent(i, 1) == 22 + && roadmap_line_point_adjacent(i, 2) == 23) { + fprintf(stderr, "YOW YOW YOW %d -> %d (21 22 23)\n", point, i); + } + } + #endif + } /** *************** *** 255,258 **** --- 291,312 ---- PluginLine *lines, const int maxlines) { + #if 1 + debug(point, maxlines); + // if (point == 455) debug(367, maxlines); + // if (point == 461) debug(382, maxlines); + #endif + #ifndef HAVE_RUNTIME_CACHE + /* Use the line/bypoint data in newer maps, or fail */ + int i, line_id; + RoadMapStreetProperties prop; + + for (i=0; (line_id = roadmap_line_point_adjacent(point, i)) && (i < maxlines); i++) { + roadmap_street_get_properties(line_id, &prop); + lines[i].line_id = line_id; + // lines[i].fips = prop.fips; + // lines[i].layer = prop.layer; + } + return i; + #else /* HAVE_RUNTIME_CACHE */ #define maxlayers 10 int square, i, j, *************** *** 295,298 **** --- 349,353 ---- } return nlines; + #endif /* HAVE_RUNTIME_CACHE */ } *************** *** 320,323 **** --- 375,380 ---- int *flags) { + static int do_this_once = 1; + int stop; #define MAX_CAT 10 /* Not interesting */ *************** *** 343,354 **** max_iterations = MAX_ITER; /* Where are we ? */ PluginLine *l = roadmap_navigate_position2line(from_pos); ! roadmap_log (ROADMAP_WARNING, "from --> %s", ! l ? roadmap_plugin_street_full_name(l) : "??"); if (l) *from_line = *l; else return -1; l = roadmap_navigate_position2line(to_pos); --- 400,425 ---- max_iterations = MAX_ITER; + if (do_this_once) { + do_this_once = 0; + #ifdef HAVE_RUNTIME_CACHE + roadmap_log(ROADMAP_WARNING, "Use runtime cache"); + #else + roadmap_log(ROADMAP_WARNING, "Use map extension"); + #endif + } + + from_line->line_id = to_line->line_id = 0; + /* Where are we ? */ PluginLine *l = roadmap_navigate_position2line(from_pos); ! roadmap_log (ROADMAP_WARNING, "from --> %s (%d)", ! l ? roadmap_plugin_street_full_name(l) : "??", ! l->line_id); if (l) *from_line = *l; + #if 0 else return -1; + #endif l = roadmap_navigate_position2line(to_pos); *************** *** 357,362 **** --- 428,435 ---- if (l) *to_line = *l; + #if 0 else return -1; + #endif /* *************** *** 376,382 **** */ for (loop=iteration=0; loop < max_iterations && iteration < max_iterations; loop++) { ! roadmap_log (ROADMAP_DEBUG, "RouteGetSegments iteration === %d === point %d", ! iteration, point); int maxlines = 10, nlines; PluginLine lines[10]; --- 449,462 ---- */ for (loop=iteration=0; loop < max_iterations && iteration < max_iterations; loop++) { ! roadmap_log (ROADMAP_DEBUG, ! "RouteGetSegments iteration === %d === point %d, CurrentPos %d %d", ! iteration, point, ! CurrentPos.longitude, CurrentPos.latitude); + #if 1 + roadmap_point_position(point, &newpos); + roadmap_log (ROADMAP_DEBUG, "Point %d is at %d %d", point, + newpos.longitude, newpos.latitude); + #endif int maxlines = 10, nlines; PluginLine lines[10]; *************** *** 386,389 **** --- 466,503 ---- roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", nlines, bestdist); + if (nlines == 0) { + point = roadmap_line_from_point(from_line->line_id); + roadmap_log(ROADMAP_WARNING, "try point #%d", point); + nlines = navigate_simple_lines_closeby(CurrentPos, point, l, + lines, maxlines); + + roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", + nlines, bestdist); + } + if (nlines == 0) { + point = roadmap_line_to_point(from_line->line_id); + roadmap_log(ROADMAP_WARNING, "try point #%d", point); + nlines = navigate_simple_lines_closeby(CurrentPos, point, l, + lines, maxlines); + + roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", + nlines, bestdist); + } + if (nlines == 0) { + point = 198; + roadmap_log(ROADMAP_WARNING, "try point #%d", point); + nlines = navigate_simple_lines_closeby(CurrentPos, point, l, + lines, maxlines); + + roadmap_log(ROADMAP_WARNING, "lines_closeby -> %d, best dist %d", + nlines, bestdist); + } + #if 1 + int x; + fprintf(stderr, "Lines closeby (point %d) -> lines {", point); + for (x=0; x<nlines; x++) + fprintf(stderr, "%d ", lines[x].line_id); + fprintf(stderr, "}\n"); + #endif bestdist = maxdist * 2; *************** *** 417,424 **** --- 531,546 ---- dist = roadmap_math_distance(&newpos, &to_pos); + roadmap_log (ROADMAP_DEBUG, "Line %d point %d pos %d %d", + lines[i].line_id, newpt, + newpos.longitude, newpos.latitude); + newpt2 = roadmap_line_from_point(lines[i].line_id); roadmap_point_position(newpt2, &newpos2); dist2 = roadmap_math_distance(&newpos2, &to_pos); + roadmap_log (ROADMAP_DEBUG, "Line %d point %d pos %d %d", + lines[i].line_id, newpt2, + newpos2.longitude, newpos2.latitude); + if (point == newpt2) { rev = 0; *************** *** 447,453 **** best, bestdist); ! if (to_line->line_id == lines[best].line_id || ! roadmap_line_from_point(to_line->line_id) == bestnewpt || ! roadmap_line_to_point(to_line->line_id) == bestnewpt) { roadmap_log (ROADMAP_DEBUG, "Line match -> track time %d, dist %d", tracktime, bestdist); --- 569,581 ---- best, bestdist); ! stop = 0; ! if (!stop && to_line && to_line->line_id == lines[best].line_id) ! stop++; ! if (!stop && roadmap_line_from_point(to_line->line_id) == bestnewpt) ! stop++; ! if (!stop && roadmap_line_to_point(to_line->line_id) == bestnewpt) ! stop++; ! if (stop) ! { roadmap_log (ROADMAP_DEBUG, "Line match -> track time %d, dist %d", tracktime, bestdist); |
|
From: Danny B. <dan...@us...> - 2009-03-14 16:10:35
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30632 Modified Files: roadmap_db_line.h roadmap_line.h buildmap_osm_main.c roadmap_line.c buildmap_line.c Log Message: First cut at a map extension: add line/bypoint1 and line/bypoint2 tables. Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** buildmap_line.c 28 Dec 2008 18:28:27 -0000 1.16 --- buildmap_line.c 14 Mar 2009 16:10:22 -0000 1.17 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009, Danny Backx * * This file is part of RoadMap. *************** *** 68,73 **** static int *SortedLine2 = NULL; - static void buildmap_line_register (void); #define MAX_LONG_LINES 150000 --- 69,76 ---- static int *SortedLine2 = NULL; static void buildmap_line_register (void); + static void buildmap_line_add_bypoint(int, int); + static void buildmap_line_count_linebypoint(int *LineByPoint1Count, int *LineByPoint2Count); + static void buildmap_line_transform_linebypoint(RoadMapLineByPoint1 *, RoadMapLineByPoint2 *); #define MAX_LONG_LINES 150000 *************** *** 76,79 **** --- 79,102 ---- static RoadMapHash *LongLinesHash = NULL; + /* + * @brief Line By Point stuff + * This structure holds info about a point : it gathers the line ids of lines that + * start or end in a point. + * The point id is not stored, this structure's index in the array is the point id. + */ + struct lbp { + /* int point; */ + int max, /**< number of fields already allocated in ptr */ + num; /**< number of fields used in ptr */ + int *ptr; /**< array that holds line ids */ + }; + static struct lbp *lbp = NULL; /**< array of structures holding info + about a point */ + static int max_line_by_point = 0, /**< highest index in lbp */ + nalloc_line_by_point = 0; /**< allocation count of lbp */ + + #define ALLOC_LINES 5 /**< increment allocation of ptr by this amount */ + #define ALLOC_POINTS 100 /**< increment allocation of lbp by this amount */ + /* FIXME. this is called for every line, but it misses all of the *************** *** 133,137 **** } ! static int buildmap_line_get_layer_sorted (int line) { --- 156,164 ---- } ! /** ! * @brief ! * @param line ! * @return ! */ static int buildmap_line_get_layer_sorted (int line) { *************** *** 141,145 **** } ! static void buildmap_line_initialize (void) { --- 168,174 ---- } ! /** ! * @brief ! */ static void buildmap_line_initialize (void) { *************** *** 158,162 **** } - /** * @brief add a line to buildmap's list --- 187,190 ---- *************** *** 205,212 **** roadmap_hash_add (LineById, tlid, LineCount); return LineCount++; } ! static void buildmap_line_new_long (int sorted_line) --- 233,251 ---- roadmap_hash_add (LineById, tlid, LineCount); + /* + * This adds info, but they will look wrong if you compare them with the + * end result : transformation happens when "sorting". + */ + buildmap_line_add_bypoint(from, LineCount); + buildmap_line_add_bypoint(to, LineCount); + return LineCount++; } ! /** ! * @brief ! * @param sorted_line ! * @return ! */ static void buildmap_line_new_long (int sorted_line) *************** *** 246,249 **** --- 285,295 ---- } + /** + * @brief + * @param sorted_line + * @param longitude + * @param latitude + * @return + */ void buildmap_line_test_long (int sorted_line, int longitude, int latitude) { RoadMapLongLine *this_long_line; *************** *** 318,321 **** --- 364,374 ---- } + /** + * @brief + * @param line + * @param longitude + * @param latitude + * @return + */ void buildmap_line_get_position (int line, int *longitude, int *latitude) { *************** *** 326,330 **** } ! void buildmap_line_get_position_sorted (int line, int *longitude, int *latitude) { --- 379,389 ---- } ! /** ! * @brief ! * @param line ! * @param longitude ! * @param latitude ! * @return ! */ void buildmap_line_get_position_sorted (int line, int *longitude, int *latitude) { *************** *** 336,340 **** } ! int buildmap_line_get_sorted (int line) { --- 395,403 ---- } ! /** ! * @brief ! * @param line ! * @return ! */ int buildmap_line_get_sorted (int line) { *************** *** 348,352 **** } ! int buildmap_line_get_id_sorted (int line) { --- 411,419 ---- } ! /** ! * @brief ! * @param line ! * @return ! */ int buildmap_line_get_id_sorted (int line) { *************** *** 354,358 **** } ! int buildmap_line_get_square_sorted (int line) { --- 421,429 ---- } ! /** ! * @brief ! * @param line ! * @return ! */ int buildmap_line_get_square_sorted (int line) { *************** *** 361,365 **** } ! static int buildmap_line_compare (const void *r1, const void *r2) { --- 432,441 ---- } ! /** ! * @brief ! * @param r1 ! * @param r2 ! * @return ! */ static int buildmap_line_compare (const void *r1, const void *r2) { *************** *** 400,403 **** --- 476,485 ---- } + /** + * @brief + * @param r1 + * @param r2 + * @return + */ static int buildmap_line_compare2 (const void *r1, const void *r2) { *************** *** 445,448 **** --- 527,533 ---- } + /** + * @brief + */ void buildmap_line_sort (void) { *************** *** 517,523 **** qsort (SortedLine2, LineCrossingCount, sizeof(int), buildmap_line_compare2); } ! static void buildmap_line_save (void) { --- 602,613 ---- qsort (SortedLine2, LineCrossingCount, sizeof(int), buildmap_line_compare2); + + /* The LineByPoint stuff gets sorted in the buildmap_line_transform_linebypoint + * function, when we need to pass over the info for other purposes anyway. */ } ! /** ! * @brief ! */ static void buildmap_line_save (void) { *************** *** 551,556 **** buildmap_db *index2_table; ! if (!LineCount) return; buildmap_info ("saving %d lines...", LineCount); --- 641,652 ---- buildmap_db *index2_table; + /* Navigation support */ + int LineByPoint1Count = 0, LineByPoint2Count = 0; + RoadMapLineByPoint1 *db_line_bypoint1; + RoadMapLineByPoint2 *db_line_bypoint2; + buildmap_db *line_bypoint1_table, *line_bypoint2_table; ! if (!LineCount) ! return; buildmap_info ("saving %d lines...", LineCount); *************** *** 701,704 **** --- 797,809 ---- buildmap_db_add_data (index2_table, LineCrossingCount, sizeof(int)); + buildmap_line_count_linebypoint(&LineByPoint1Count, &LineByPoint2Count); + line_bypoint1_table = buildmap_db_add_section (root, "bypoint1"); + if (line_bypoint1_table == NULL) buildmap_fatal (0, "Can't add a new section"); + buildmap_db_add_data (line_bypoint1_table, LineByPoint1Count, sizeof(int)); + + line_bypoint2_table = buildmap_db_add_section (root, "bypoint2"); + if (line_bypoint2_table == NULL) buildmap_fatal (0, "Can't add a new section"); + buildmap_db_add_data (line_bypoint2_table, LineByPoint2Count, sizeof(int)); + db_lines = (RoadMapLine *) buildmap_db_get_data (data_table); db_square1 = (RoadMapLineBySquare *) buildmap_db_get_data (square1_table); *************** *** 708,711 **** --- 813,818 ---- db_layer2 = (int *) buildmap_db_get_data (layer2_table); db_index2 = (int *) buildmap_db_get_data (index2_table); + db_line_bypoint1 = (RoadMapLineByPoint1 *) buildmap_db_get_data (line_bypoint1_table); + db_line_bypoint2 = (RoadMapLineByPoint2 *) buildmap_db_get_data (line_bypoint2_table); *************** *** 824,830 **** memcpy (db_long_lines, LongLines, LongLinesCount * sizeof (RoadMapLongLine)); } ! static void buildmap_line_summary (void) { --- 931,940 ---- memcpy (db_long_lines, LongLines, LongLinesCount * sizeof (RoadMapLongLine)); + buildmap_line_transform_linebypoint(db_line_bypoint1, db_line_bypoint2); } ! /** ! * @brief ! */ static void buildmap_line_summary (void) { *************** *** 834,838 **** } ! static void buildmap_line_reset (void) { --- 944,950 ---- } ! /** ! * @brief ! */ static void buildmap_line_reset (void) { *************** *** 859,863 **** } ! static buildmap_db_module BuildMapLineModule = { "line", --- 971,977 ---- } ! /** ! * @brief ! */ static buildmap_db_module BuildMapLineModule = { "line", *************** *** 868,874 **** }; ! static void buildmap_line_register (void) { buildmap_db_register (&BuildMapLineModule); } --- 982,1086 ---- }; ! /** ! * @brief ! */ static void buildmap_line_register (void) { buildmap_db_register (&BuildMapLineModule); } + /** + * @brief Line By Point support : announce that this line starts or ends at this point + * @param point the point + * @param line the line + */ + static void buildmap_line_add_bypoint(int point, int line) + { + int i, old; + + if (max_line_by_point < point) + max_line_by_point = point; + + old = nalloc_line_by_point; + + if (nalloc_line_by_point < point) { + nalloc_line_by_point = point + ALLOC_POINTS; + lbp = (struct lbp *) realloc((void *)lbp, + nalloc_line_by_point * sizeof(struct lbp)); + for (i=old; i<nalloc_line_by_point; i++) { + lbp[i].max = 0; + lbp[i].num = 0; + lbp[i].ptr = 0; + } + } + /* lbp[point].point = point; */ + if (lbp[point].num == lbp[point].max) { + lbp[point].max += ALLOC_LINES; + lbp[point].ptr = (int *)realloc((void *)lbp[point].ptr, + lbp[point].max * sizeof(int)); + } + for (i=0; i<lbp[point].num; i++) + if (lbp[point].ptr[i] == line) + return; /* already there, no need to add again */ + lbp[point].ptr[lbp[point].num++] = line; + } + + /** + * @brief turn the data generated on the fly into the format fit for storage + */ + static void buildmap_line_transform_linebypoint(RoadMapLineByPoint1 *q1, RoadMapLineByPoint2 *q2) + { + int i, j, sz1, sz2; + int cnt = 0; + int *p1, *p2, *b; + int *tmp; + + for (i=0; i<max_line_by_point; i++) { + cnt += lbp[i].num; + } + + sz1 = sizeof(int) * max_line_by_point; + sz2 = sizeof(int) * (max_line_by_point + cnt); + + /* + * This can be done without a tmp array, but for reasons I don't grasp, + * the map only gets written right if the whole area pointed to by q1 + * is written. + */ + tmp = (int *)calloc(max_line_by_point, sizeof(int)); + + /* This is a sparse array, make it NULL first */ + p1 = tmp; + for (i=0; i<max_line_by_point; i++) + *(p1++) = 0; + + p1 = tmp; + b = p2 = (int *)q2; + + for (i=0; i<max_line_by_point; i++) { + p1[buildmap_point_get_sorted(i)] = (int)(p2 - b); + + for (j=0; j<lbp[i].num; j++) { + *(p2++) = buildmap_line_get_sorted(lbp[i].ptr[j]); + } + *(p2++) = 0; + } + + buildmap_info("Line By Point : %d points, %d lines", + max_line_by_point, cnt); + + memcpy(q1, tmp, max_line_by_point * sizeof (RoadMapLineByPoint1)); + free(tmp); + } + + static void buildmap_line_count_linebypoint(int *LineByPoint1Count, int *LineByPoint2Count) + { + int i; + int cnt = 0; + + for (i=0; i<max_line_by_point; i++) { + cnt += lbp[i].num; + } + + *LineByPoint1Count = max_line_by_point; + *LineByPoint2Count = max_line_by_point + cnt; + } Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** buildmap_osm_main.c 13 Mar 2009 17:00:29 -0000 1.14 --- buildmap_osm_main.c 14 Mar 2009 16:10:21 -0000 1.15 *************** *** 784,787 **** --- 784,789 ---- buildmap_layer_load(class); + buildmap_metadata_add_attribute ("MapFormat", "Version", "1.3 alpha"); + buildmap_verbose("processing with bits '%d'", osm_bits); Index: roadmap_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_line.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_line.h 24 Dec 2008 08:30:35 -0000 1.5 --- roadmap_line.h 14 Mar 2009 16:10:21 -0000 1.6 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009, Danny Backx. * * This file is part of RoadMap. *************** *** 66,68 **** --- 67,74 ---- extern roadmap_db_handler RoadMapLineHandler; + extern int roadmap_line_point_adjacent(int point, int ix); + + int roadmap_line_from_point (int line); + int roadmap_line_to_point (int line); + #endif // INCLUDED__ROADMAP_LINE__H Index: roadmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_line.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** roadmap_line.c 12 Feb 2009 18:21:23 -0000 1.14 --- roadmap_line.c 14 Mar 2009 16:10:21 -0000 1.15 *************** *** 73,76 **** --- 73,80 ---- int LineIndex2Count; + RoadMapLineByPoint1 *LineByPoint1; + int LineByPoint1Count; + RoadMapLineByPoint2 *LineByPoint2; + int LineByPoint2Count; } RoadMapLineContext; *************** *** 89,92 **** --- 93,98 ---- roadmap_db *layer2_table; roadmap_db *long_lines_table; + roadmap_db *by_point1_table; + roadmap_db *by_point2_table; *************** *** 105,108 **** --- 111,116 ---- index2_table = roadmap_db_get_subsection (root, "index2"); long_lines_table = roadmap_db_get_subsection (root, "longlines"); + by_point1_table = roadmap_db_get_subsection (root, "bypoint1"); + by_point2_table = roadmap_db_get_subsection (root, "bypoint2"); context->Line = (RoadMapLine *) roadmap_db_get_data (line_table); *************** *** 176,179 **** --- 184,217 ---- } + if (by_point1_table && by_point2_table) { + roadmap_log(ROADMAP_WARNING, "***** This map has line by point *****"); + context->LineByPoint1 = (RoadMapLineByPoint1 *) roadmap_db_get_data (by_point1_table); + context->LineByPoint1Count = roadmap_db_get_count (by_point1_table); + roadmap_log(ROADMAP_WARNING, "***** This map has line by point1 (%d) *****", + context->LineByPoint1Count); + + if (roadmap_db_get_size (by_point1_table) != + context->LineByPoint1Count * sizeof(int)) { + roadmap_log (ROADMAP_ERROR, "invalid line/bypoint1 structure"); + goto roadmap_line_map_abort; + } + + context->LineByPoint2 = (RoadMapLineByPoint2 *) roadmap_db_get_data (by_point2_table); + context->LineByPoint2Count = roadmap_db_get_count (by_point2_table); + roadmap_log(ROADMAP_WARNING, "***** This map has line by point2 (%d) *****", + context->LineByPoint2Count); + + if (roadmap_db_get_size (by_point2_table) != + context->LineByPoint2Count * sizeof(int)) { + roadmap_log (ROADMAP_ERROR, "invalid line/bypoint2 structure"); + goto roadmap_line_map_abort; + } + } else { + context->LineByPoint1 = 0; + context->LineByPoint1Count = 0; + context->LineByPoint2 = 0; + context->LineByPoint2Count = 0; + } + return context; *************** *** 468,469 **** --- 506,545 ---- } #endif + + /** + * @brief Get a line adjacent to a given point + * @param point this is the point referred to + * @param ix the index in the list of lines adjacent to this point + * @return a line id, or 0 if out of bounds + */ + int roadmap_line_point_adjacent(int point, int ix) + { + int i; + int *p, *q; + + if (RoadMapLineActive == NULL) + return 0; /* No line. */ + if (RoadMapLineActive->LineByPoint1 == 0) + return 0; /* No map data */ + if (RoadMapLineActive->LineByPoint2 == 0) + return 0; /* No map data */ + + if (ix < 0) + return 0; + if (point <= 0 || RoadMapLineActive->LineByPoint1Count < point) + return 0; + + q = (int *)RoadMapLineActive->LineByPoint1; + q += point; + + p = (int *)RoadMapLineActive->LineByPoint2; + p += *q; + + /* expensive check ? */ + for (i=0; i<ix; i++) + if (p[i] == 0) { + roadmap_log (ROADMAP_WARNING, "Didn't expect this !"); + return 0; + } + return p[ix]; + } Index: roadmap_db_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_line.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_db_line.h 13 Jul 2008 06:24:03 -0000 1.6 --- roadmap_db_line.h 14 Mar 2009 16:10:20 -0000 1.7 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009, Danny Backx * * This file is part of RoadMap. *************** *** 55,58 **** --- 56,62 ---- /** * @brief table line/data + * + * line/data The ID of the line and its from and to points. + * The lines are sorted by square. */ typedef struct { *************** *** 63,66 **** --- 67,74 ---- /** * @brief tables line/bysquare1 and line/bysquare2 + * + * line/bysquare1 An index of layers per square (points to line/bylayer1). + * line/bysquare2 A given line may have one end in a different square: + * this 2nd index covers this (points to line/bylayer2). */ typedef struct { *************** *** 82,84 **** --- 90,110 ---- /* Table line/index2 is an array of int. */ + /** + * @brief table line/bypoint1 + * + * Navigation support : provide a list of lines that begin or end at this point + */ + typedef struct { + int line; + } RoadMapLineByPoint1; + + /** + * @brief table line/bypoint2 + * + * Navigation support : index into line/bypoint1 + */ + typedef struct { + int nlines; + } RoadMapLineByPoint2; + #endif // INCLUDED__ROADMAP_DB_LINE__H |
|
From: Danny B. <dan...@us...> - 2009-03-13 18:24:05
|
Update of /cvsroot/roadmap/roadmap/web In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29696 Modified Files: navbar.html sitesponsor.html Log Message: Update our web site to meet SourceForge's request. Index: navbar.html =================================================================== RCS file: /cvsroot/roadmap/roadmap/web/navbar.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** navbar.html 27 Jan 2009 01:48:47 -0000 1.9 --- navbar.html 13 Mar 2009 18:23:49 -0000 1.10 *************** *** 19,23 **** <a class="navitem" href="list.html">Mailing lists</a> <a class="navitem2" href="http://sourceforge.net/mailarchive/forum.php?forum_name=roadmap-general">Archives</a> <span class="invisible">|</span> ! <a class="navitem" href="http://sourceforge.net/projects/roadmap">SourceForge</a> <span class="invisible">|</span> <a class="navitem2" href="http://roadmap.wiki.sourceforge.net">Wiki</a> <span class="invisible">|</span> </div> --- 19,28 ---- <a class="navitem" href="list.html">Mailing lists</a> <a class="navitem2" href="http://sourceforge.net/mailarchive/forum.php?forum_name=roadmap-general">Archives</a> <span class="invisible">|</span> ! <!-- <a class="navitem" href="http://sourceforge.net/projects/roadmap">SourceForge</a> <span class="invisible">|</span> ! --> ! <a href="http://sourceforge.net/projects/roadmap"> ! <img src="http://sflogo.sourceforge.net/sflogo.php?group_id=74158&type=13" ! width="120" height="30" border="0" ! alt="Get RoadMap at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <a class="navitem2" href="http://roadmap.wiki.sourceforge.net">Wiki</a> <span class="invisible">|</span> </div> Index: sitesponsor.html =================================================================== RCS file: /cvsroot/roadmap/roadmap/web/sitesponsor.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sitesponsor.html 10 Oct 2007 17:33:25 -0000 1.1 --- sitesponsor.html 13 Mar 2009 18:23:49 -0000 1.2 *************** *** 10,16 **** <hr> This project hosted by ! <a href="http://sourceforge.net"> ! <img src="http://sflogo.sourceforge.net/sflogo.php?group_id=74158&type=4" ! width="125" height="37" border="0" alt="SourceForge.net Logo" align="top"/></a> <p> <!-- end of site sponsor code --> --- 10,17 ---- <hr> This project hosted by ! <a href="http://sourceforge.net/projects/roadmap"> ! <img src="http://sflogo.sourceforge.net/sflogo.php?group_id=74158&type=13" ! width="120" height="30" border="0" ! alt="Get RoadMap at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <p> <!-- end of site sponsor code --> |
|
From: Paul F. <pg...@us...> - 2009-03-13 17:00:58
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7193 Modified Files: buildmap_opt.c buildmap_osm_main.c Log Message: make note that '--' can be used to terminate options, to disambiguate things like negative latitude values. Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** buildmap_osm_main.c 27 Feb 2009 14:50:42 -0000 1.13 --- buildmap_osm_main.c 13 Mar 2009 17:00:29 -0000 1.14 *************** *** 699,703 **** fprintf(stderr, "%s: %s\n", prog, msg); fprintf(stderr, ! "usage: %s [options] lat,lon[:lat,lon] -or- lat,lon:NN{mi|km}\n", prog); opt_desc(options, 1); exit(1); --- 699,705 ---- fprintf(stderr, "%s: %s\n", prog, msg); fprintf(stderr, ! "usage: %s [options] lat,lon[:lat,lon] -or- lat,lon:NN{mi|km}\n" ! " Use '--' after the options if the 'lat' value is negative.\n", ! prog); opt_desc(options, 1); exit(1); Index: buildmap_opt.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_opt.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_opt.c 8 Aug 2008 12:50:44 -0000 1.2 --- buildmap_opt.c 13 Mar 2009 17:00:29 -0000 1.3 *************** *** 340,343 **** --- 340,344 ---- } } else if (argv[i][1] == '-' && !argv[i][2]) { + /* let '--' by itself terminate option processing */ (void)opt_shift(argc, &argv[i]); return opt_ok; |
|
From: Danny B. <dan...@us...> - 2009-03-13 16:45:26
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4365 Modified Files: buildmap_osm_text.c Log Message: CVS is up again so here's the fix for the problem that got introduced with the recent cleanup. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** buildmap_osm_text.c 27 Feb 2009 14:50:42 -0000 1.11 --- buildmap_osm_text.c 13 Mar 2009 16:45:00 -0000 1.12 *************** *** 787,791 **** for (j=1; j<nWayNodes-1; j++) { int point = WayNodes[j]; ! if (NodeReportUse(point) >= 1) continue; --- 787,791 ---- for (j=1; j<nWayNodes-1; j++) { int point = WayNodes[j]; ! if (NodeReportUse(point) <= 1) continue; |
|
From: Paul F. <pg...@us...> - 2009-02-27 14:50:54
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8029 Modified Files: buildmap_osm_binary.c buildmap_osm_common.c buildmap_osm_main.c buildmap_osm_text.c buildmap_osm_text.h Log Message: fix a couple of copyright statements, make code fit 80 columns, remove tabs. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buildmap_osm_text.c 26 Jan 2009 19:42:45 -0000 1.10 --- buildmap_osm_text.c 27 Feb 2009 14:50:42 -0000 1.11 *************** *** 3,7 **** * * Copyright (c) 2008, Danny Backx ! * Based on code Copyright 2007 Stephen Woodbridge that interprets the OSM binary stream. * * This file is part of RoadMap. --- 3,8 ---- * * Copyright (c) 2008, Danny Backx ! * Based on code Copyright 2007 Paul Fox that interprets the OSM ! * binary stream. [...1892 lines suppressed...] ! continue; ! } else { ! buildmap_fatal(0, "invalid XML token (%s)", p); ! } } *************** *** 1190,1194 **** ! buildmap_info("Splits %d, ways split %d, not split %d", nsplits, WaysSplit, WaysNotSplit); return ret; --- 1245,1250 ---- ! buildmap_info("Splits %d, ways split %d, not split %d", ! nsplits, WaysSplit, WaysNotSplit); return ret; Index: buildmap_osm_common.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_common.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_osm_common.c 4 Aug 2008 17:46:24 -0000 1.1 --- buildmap_osm_common.c 27 Feb 2009 14:50:42 -0000 1.2 *************** *** 2,6 **** * LICENSE: * ! * Copyright 2007 Stephen Woodbridge * * This file is part of RoadMap. --- 2,7 ---- * LICENSE: * ! * Copyright (c) 2007 Paul Fox ! * Copyright (c) 2008, Danny Backx * * This file is part of RoadMap. Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** buildmap_osm_main.c 24 Oct 2008 15:26:45 -0000 1.12 --- buildmap_osm_main.c 27 Feb 2009 14:50:42 -0000 1.13 *************** *** 87,93 **** "Show more progress information"}, {"inputfile", "i", opt_string, "", ! "Convert this OSM file into a map"}, {"outputfile", "o", opt_string, "", ! "Write output in this file"}, OPT_DEFS_END }; --- 87,93 ---- "Show more progress information"}, {"inputfile", "i", opt_string, "", ! "Convert this OSM file into a map"}, {"outputfile", "o", opt_string, "", ! "Write output in this file"}, OPT_DEFS_END }; *************** *** 236,268 **** int buildmap_osm_text_process_file(char *fn) { ! int n, ret = 0; ! FILE *f; ! char country[6], division[6]; ! int fips, country_num = 0, division_num = 0; f = fopen(fn, "r"); if (f == NULL) { ! buildmap_fatal(0, "couldn't open \"%s\"", fn); ! return -1; } if ((n = buildmap_osm_filename_iso(fn, country, division, ".osm"))) { ! buildmap_metadata_add_attribute ("Territory", "Id", country); ! buildmap_metadata_add_attribute ("Territory", "Parent", country); ! buildmap_metadata_add_value ("Territory", "Parent", country); ! country_num = roadmap_iso_alpha_to_num(country); ! if (n == 2) ! division_num = roadmap_iso_division_to_num(country, division); } else if (buildmap_osm_filename_usc(fn, &fips)) { ! /* ?? */ ! buildmap_metadata_add_attribute ("Territory", "Id", fn); ! buildmap_metadata_add_attribute ("Territory", "Parent", fn); ! buildmap_metadata_add_value ("Territory", "Parent", fn); ! country_num = fips / 1000; ! division_num = fips % 1000; } else { ! buildmap_fatal(0, "Invalid file name \"%s\" should be ISO or USC shape", fn); } --- 236,270 ---- int buildmap_osm_text_process_file(char *fn) { ! int n, ret = 0; ! FILE *f; ! char country[6], division[6]; ! int fips, country_num = 0, division_num = 0; f = fopen(fn, "r"); if (f == NULL) { ! buildmap_fatal(0, "couldn't open \"%s\"", fn); ! return -1; } if ((n = buildmap_osm_filename_iso(fn, country, division, ".osm"))) { ! buildmap_metadata_add_attribute ("Territory", "Id", country); ! buildmap_metadata_add_attribute ("Territory", "Parent", country); ! buildmap_metadata_add_value ("Territory", "Parent", country); ! country_num = roadmap_iso_alpha_to_num(country); ! if (n == 2) ! division_num = ! roadmap_iso_division_to_num(country, division); } else if (buildmap_osm_filename_usc(fn, &fips)) { ! /* ?? */ ! buildmap_metadata_add_attribute ("Territory", "Id", fn); ! buildmap_metadata_add_attribute ("Territory", "Parent", fn); ! buildmap_metadata_add_value ("Territory", "Parent", fn); ! country_num = fips / 1000; ! division_num = fips % 1000; } else { ! buildmap_fatal(0, ! "Invalid file name \"%s\" should be ISO or USC shape", fn); } *************** *** 285,289 **** /** ! * @brief populates a list of tileids necessary to give coverage for the given position * @param position * @param focus --- 287,292 ---- /** ! * @brief populates a list of tileids necessary to give coverage ! * for the given position * @param position * @param focus *************** *** 588,592 **** printf("tileid:\t0x%08x\t%d\n", tileid, tileid); ! printf("true tileid:\t0x%08x\t%d\n", tileid2trutile(tileid), tileid2trutile(tileid)); printf("bits:\t%d\n", tileid2bits(tileid)); --- 591,596 ---- printf("tileid:\t0x%08x\t%d\n", tileid, tileid); ! printf("true tileid:\t0x%08x\t%d\n", ! tileid2trutile(tileid), tileid2trutile(tileid)); printf("bits:\t%d\n", tileid2bits(tileid)); *************** *** 672,677 **** printf("tileid:\t0x%08x\t%d\n", tileid, tileid); printf("true tileid:\t0x%08x\t%d\n", ! tileid2trutile(tileid), ! tileid2trutile(tileid)); printf("bits:\t%d\n", bits); return 0; --- 676,681 ---- printf("tileid:\t0x%08x\t%d\n", tileid, tileid); printf("true tileid:\t0x%08x\t%d\n", ! tileid2trutile(tileid), ! tileid2trutile(tileid)); printf("bits:\t%d\n", bits); return 0; *************** *** 738,742 **** opt_val("encode", &encode) || opt_val("outputfile", &BuildMapFileName) || ! opt_val("inputfile", &inputfile); if (error) usage(argv[0], opt_strerror(error)); --- 742,746 ---- opt_val("encode", &encode) || opt_val("outputfile", &BuildMapFileName) || ! opt_val("inputfile", &inputfile); if (error) usage(argv[0], opt_strerror(error)); *************** *** 768,774 **** if (strncmp(source, "http:", 5) == 0) { ! cmdfmt = "wget -q -O - '%s?tile=%d&ts=%d&have=%d'"; } else { ! cmdfmt = "%s -t %d -b %d -h %d"; } --- 772,778 ---- if (strncmp(source, "http:", 5) == 0) { ! cmdfmt = "wget -q -O - '%s?tile=%d&ts=%d&have=%d'"; } else { ! cmdfmt = "%s -t %d -b %d -h %d"; } *************** *** 788,792 **** } else if (*inputfile) { ! exit(buildmap_osm_text_process_file(inputfile)); } else { --- 792,796 ---- } else if (*inputfile) { ! exit(buildmap_osm_text_process_file(inputfile)); } else { Index: buildmap_osm_text.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_osm_text.h 16 Oct 2008 19:38:45 -0000 1.2 --- buildmap_osm_text.h 27 Feb 2009 14:50:42 -0000 1.3 *************** *** 27,31 **** */ ! #define LINELEN 2048 void buildmap_osm_text_find_layers (void); --- 27,31 ---- */ ! #define LINELEN 2048 void buildmap_osm_text_find_layers (void); Index: buildmap_osm_binary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_binary.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** buildmap_osm_binary.c 4 Aug 2008 23:25:51 -0000 1.9 --- buildmap_osm_binary.c 27 Feb 2009 14:50:42 -0000 1.10 *************** *** 2,6 **** * LICENSE: * ! * Copyright 2007 Stephen Woodbridge * * This file is part of RoadMap. --- 2,6 ---- * LICENSE: * ! * Copyright 2007 Paul Fox * * This file is part of RoadMap. *************** *** 26,34 **** * * 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 . */ --- 26,36 ---- * * 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 . */ *************** *** 116,120 **** /** ! * @brief look ahead and figure out the additional info (options) like the road type * @param cur * @param end --- 118,123 ---- /** ! * @brief look ahead and figure out the additional info (options) ! * like the road type * @param cur * @param end *************** *** 181,185 **** tim = (time_t)itime; ! buildmap_verbose("'%s' is %s", datetype[key], asctime(gmtime(&tim))); } else if (key >= key_numeric_start) { --- 184,189 ---- tim = (time_t)itime; ! buildmap_verbose ! ("'%s' is %s", datetype[key], asctime(gmtime(&tim))); } else if (key >= key_numeric_start) { *************** *** 199,203 **** val = *cur++; ! buildmap_verbose("list type is '%s', subtype ", list_info[key].name); if (list_info[key].list) { --- 203,208 ---- val = *cur++; ! buildmap_verbose ! ("list type is '%s', subtype ", list_info[key].name); if (list_info[key].list) { *************** *** 242,246 **** prop = *dp++; ! buildmap_verbose("node: id %ld, lon %ld, lat %ld, prop %d", id, lon, lat, prop); if (dp < data + len) --- 247,252 ---- prop = *dp++; ! buildmap_verbose("node: id %ld, lon %ld, lat %ld, prop %d", ! id, lon, lat, prop); if (dp < data + len) |
|
From: Paul F. <pg...@us...> - 2009-02-20 20:18:44
|
Update of /cvsroot/roadmap/roadmap/sugar In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1389 Modified Files: README.xo_laptop Log Message: icon credit Index: README.xo_laptop =================================================================== RCS file: /cvsroot/roadmap/roadmap/sugar/README.xo_laptop,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README.xo_laptop 14 Sep 2008 20:10:00 -0000 1.3 --- README.xo_laptop 20 Feb 2009 20:18:38 -0000 1.4 *************** *** 38,39 **** --- 38,45 ---- + Icon -- + + Credit for the svg icon goes to "fmiser" from the RoadMap mailing + list. However, since he only provided a PNG for the "standard" + icon, it was run through potrace to generate an SVG, and the + resulting shapes used verbatim for the XO. |
|
From: Paul F. <pg...@us...> - 2009-02-20 20:16:18
|
Update of /cvsroot/roadmap/roadmap/sugar/activity In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1217 Modified Files: RoadMap.svg Log Message: better XO icon Index: RoadMap.svg =================================================================== RCS file: /cvsroot/roadmap/roadmap/sugar/activity/RoadMap.svg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RoadMap.svg 18 Feb 2009 04:07:34 -0000 1.3 --- RoadMap.svg 20 Feb 2009 20:16:08 -0000 1.4 *************** *** 1,12 **** ! <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 20010904//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd' [ ! <!ENTITY stroke_color "#666666"> ! <!ENTITY fill_color "#000000"> ! <!ENTITY fill_opacity "1"> ! ]><svg height="468pt" preserveAspectRatio="xMidYMid meet" version="1.0" viewBox="0 0 468 468" width="468pt" xmlns="http://www.w3.org/2000/svg"> ! <metadata> Created by potrace 1.8, written by Peter Selinger 2001-2007 </metadata> ! <g fill="&fill_color;" stroke="&stroke_color;" style="fill-opacity:&fill_opacity;;" transform="translate(0,468) scale(0.731250,-0.731250)"> ! <path d="M0 320 l0 -320 58 0 c56 0 59 1 109 52 66 68 87 110 86 174 0 61 -22 109 -71 160 l-37 38 33 -23 c117 -81 126 -246 21 -366 l-31 -35 53 0 c46 0 57 4 86 32 37 36 53 32 27 -7 l-17 -26 54 3 c54 3 54 3 81 53 30 54 36 120 17 158 -7 12 -29 41 -50 64 -22 24 -39 47 -39 53 0 21 19 47 47 65 l28 18 -28 -30 c-15 -16 -27 -38 -27 -49 0 -11 20 -40 45 -64 56 -55 71 -101 55 -173 -6 -29 -17 -62 -26 -74 l-14 -23 90 0 90 0 0 320 0 320 -320 0 -320 0 0 -320z m630 271 c0 -36 -2 -39 -37 -44 -21 -4 -49 -19 -68 -37 l-31 -30 -90 31 c-54 18 -119 33 -166 36 -70 5 -82 3 -133 -22 -71 -34 -85 -26 -85 51 l0 54 305 0 305 0 0 -39z m-381 -166 l54 -26 44 21 c64 30 75 24 12 -8 l-54 -27 -55 26 c-30 15 -62 29 -70 32 -13 5 -13 5 0 6 8 0 39 -11 69 -24z m208 19 c-3 -3 -12 -4 -19 -1 -8 3 -5 6 6 6 11 1 17 -2 13 -5z m-129 -139 c-3 -3 -9 2 -12 12 -6 14 -5 15 5 6 7 -7 10 -15 7 -18z m27 -35 c3 -5 1 -10 -4 -10 -6 0 -11 5 -11 10 0 6 2 10 4 10 3 0 8 -4 11 -10z m35 -72 c0 -5 -4 -8 -10 -8 -5 0 -10 10 -10 23 0 18 2 19 10 7 5 -8 10 -18 10 -22z m-7 -68 c-3 -11 -9 -20 -14 -20 -10 0 -12 24 -2 33 13 13 21 7 16 -13z"/> ! </g> ! </svg> \ No newline at end of file --- 1,119 ---- ! <?xml version="1.0" encoding="UTF-8" standalone="no"?> ! <svg ! xmlns:dc="http://purl.org/dc/elements/1.1/" ! xmlns:cc="http://creativecommons.org/ns#" ! xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" ! xmlns:svg="http://www.w3.org/2000/svg" ! xmlns="http://www.w3.org/2000/svg" ! xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" ! xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" ! height="468pt" ! id="svg2" ! inkscape:output_extension="org.inkscape.output.svg.inkscape" ! inkscape:version="0.46" ! preserveAspectRatio="xMidYMid meet" ! sodipodi:docname="x.svg" ! sodipodi:version="0.32" ! version="1.0" ! viewBox="0 0 468 468" ! width="468pt"> ! <defs ! id="defs11"> ! <inkscape:perspective ! id="perspective13" ! inkscape:persp3d-origin="292.5 : 195 : 1" ! inkscape:vp_x="0 : 292.5 : 1" ! inkscape:vp_y="0 : 1000 : 0" ! inkscape:vp_z="585 : 292.5 : 1" ! sodipodi:type="inkscape:persp3d" /> ! </defs> ! <sodipodi:namedview ! bordercolor="#666666" ! borderopacity="1.0" ! gridtolerance="10.0" ! guidetolerance="10.0" ! id="base" ! inkscape:current-layer="svg2" ! inkscape:cx="267.31022" ! inkscape:cy="178.84605" ! inkscape:pageopacity="0.0" ! inkscape:pageshadow="2" ! inkscape:window-height="672" ! inkscape:window-width="737" ! inkscape:window-x="53" ! inkscape:window-y="9" ! inkscape:zoom="1" ! objecttolerance="10.0" ! pagecolor="#ffffff" ! showgrid="false" /> ! <metadata ! id="metadata4"> Created by potrace 1.8, written by Peter Selinger 2001-2007 + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> </metadata> ! <path ! style="fill:#00aa00;fill-opacity:1;stroke:none" ! id="path8" ! d="M 0,234 L 0,468 L 42.4125,468 C 83.3625,468 85.55625,467.26875 122.11875,429.975 C 170.38125,380.25 185.7375,349.5375 185.00625,302.7375 C 185.00625,258.13125 168.91875,223.03125 133.0875,185.7375 L 106.03125,157.95 L 130.1625,174.76875 C 215.71875,234 222.3,354.65625 145.51875,442.40625 L 122.85,468 L 161.60625,468 C 195.24375,468 203.2875,465.075 224.49375,444.6 C 251.55,418.275 263.25,421.2 244.2375,449.71875 L 231.80625,468.73125 L 271.29375,466.5375 C 310.78125,464.34375 310.78125,464.34375 330.525,427.78125 C 352.4625,388.29375 356.85,340.03125 342.95625,312.24375 C 337.8375,303.46875 321.75,282.2625 306.39375,265.44375 C 290.30625,247.89375 277.875,231.075 277.875,226.6875 C 277.875,211.33125 291.76875,192.31875 312.24375,179.15625 L 332.71875,165.99375 L 312.24375,187.93125 C 301.275,199.63125 292.5,215.71875 292.5,223.7625 C 292.5,231.80625 307.125,253.0125 325.40625,270.5625 C 366.35625,310.78125 377.325,344.41875 365.625,397.06875 C 361.2375,418.275 353.19375,442.40625 346.6125,451.18125 L 336.375,468 L 402.1875,468 L 468,468 L 468,234 L 468,2.8421709e-14 L 234,2.8421709e-14 L 0,2.8421709e-14 L 0,234 z M 460.6875,35.83125 C 460.6875,62.15625 459.225,64.35 433.63125,68.00625 C 418.275,70.93125 397.8,81.9 383.90625,95.0625 L 361.2375,117 L 295.425,94.33125 C 255.9375,81.16875 208.40625,70.2 174.0375,68.00625 C 122.85,64.35 114.075,65.8125 76.78125,84.09375 C 24.8625,108.95625 14.625,103.10625 14.625,46.8 L 14.625,7.3125 L 237.65625,7.3125 L 460.6875,7.3125 L 460.6875,35.83125 z M 182.08125,157.21875 L 221.56875,176.23125 L 253.74375,160.875 C 300.54375,138.9375 308.5875,143.325 262.51875,166.725 L 223.03125,186.46875 L 182.8125,167.45625 C 160.875,156.4875 137.475,146.25 131.625,144.05625 C 122.11875,140.4 122.11875,140.4 131.625,139.66875 C 137.475,139.66875 160.14375,147.7125 182.08125,157.21875 z M 334.18125,143.325 C 331.9875,145.51875 325.40625,146.25 320.2875,144.05625 C 314.4375,141.8625 316.63125,139.66875 324.675,139.66875 C 332.71875,138.9375 337.10625,141.13125 334.18125,143.325 z M 239.85,244.96875 C 237.65625,247.1625 233.26875,243.50625 231.075,236.19375 C 226.6875,225.95625 227.41875,225.225 234.73125,231.80625 C 239.85,236.925 242.04375,242.775 239.85,244.96875 z M 259.59375,270.5625 C 261.7875,274.21875 260.325,277.875 256.66875,277.875 C 252.28125,277.875 248.625,274.21875 248.625,270.5625 C 248.625,266.175 250.0875,263.25 251.55,263.25 C 253.74375,263.25 257.4,266.175 259.59375,270.5625 z M 285.1875,323.2125 C 285.1875,326.86875 282.2625,329.0625 277.875,329.0625 C 274.21875,329.0625 270.5625,321.75 270.5625,312.24375 C 270.5625,299.08125 272.025,298.35 277.875,307.125 C 281.53125,312.975 285.1875,320.2875 285.1875,323.2125 z M 280.06875,372.9375 C 277.875,380.98125 273.4875,387.5625 269.83125,387.5625 C 262.51875,387.5625 261.05625,370.0125 268.36875,363.43125 C 277.875,353.925 283.725,358.3125 280.06875,372.9375 z" /> ! <path ! d="M 0.5,467.4 L 467.6,467.6 L 467.6,0.39999926 L 0.4,0.39999926 L 0.5,467.4 z" ! id="path3239" ! style="fill:none;fill-rule:evenodd;stroke:#00aa00;stroke-width:0.36;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 359.46102,582.23365 C 379.35171,580.23388 387.13309,576.60947 395.29698,565.54198 C 406.36497,550.53753 422.06046,519.86568 428.35161,500.94724 C 441.1891,462.34308 442.32469,421.38022 431.28775,395.03774 C 426.86987,384.49333 408.71928,360.47994 382.38752,330.3423 C 366.38765,312.0299 359.82369,303.8864 353.61473,294.64581 C 347.5634,285.63976 347.2275,284.34594 348.88154,276.41315 C 352.75951,257.81423 368.25428,239.28358 394.41185,221.96207 C 401.64765,217.17054 408.33129,212.96563 409.26442,212.61784 C 410.19754,212.27004 406.23602,217.06417 400.46102,223.27147 C 381.76274,243.36944 372.29148,256.62723 367.80816,268.97862 C 363.71566,280.25326 364.88386,285.54937 374.81094,300.72704 C 382.94799,313.16792 390.8393,322.60247 407.63024,339.96455 C 429.76493,362.85217 439.62938,375.73086 448.36839,393.15105 C 457.78195,411.91586 461.62912,428.95278 461.62438,451.85395 C 461.62089,468.8523 460.0608,480.70787 454.88675,503.05599 C 448.04983,532.58663 441.22956,550.36619 429.29606,569.76776 L 420.96102,583.31892 L 385.96102,583.20356 C 360.04402,583.11813 353.16689,582.86642 359.46102,582.23363 L 359.46102,582.23365 z" ! id="path2397" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 243.46102,581.456 C 256.18063,577.31535 262.16356,573.2475 281.85146,555.35395 C 300.40949,538.4873 311.49347,531.47614 314.99972,534.38607 C 318.46063,537.25839 314.98427,545.87662 302.50813,565.35395 C 297.39976,573.32895 292.71614,580.64145 292.10006,581.60395 C 291.07799,583.20075 288.65916,583.34924 264.47047,583.30017 L 237.96102,583.24641 L 243.46102,581.456 z" ! id="path2399" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 333.73562,481.91373 C 331.24091,479.76787 330.9533,478.81644 330.64828,471.70069 C 330.35956,464.96524 330.64921,463.21664 332.69347,459.35395 C 334.99439,455.00637 343.04326,448.35395 346.00261,448.35395 C 352.96529,448.35395 351.50648,467.69605 343.70997,478.75221 C 339.95524,484.07675 337.24791,484.93487 333.73562,481.91373 z" ! id="path2401" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 344.15414,408.56736 C 340.55683,404.59236 339.13622,399.06173 339.04773,388.68736 C 339.00002,383.09575 339.34347,378.14574 339.81091,377.68736 C 342.0736,375.46854 355.50576,397.22262 355.68111,403.39002 C 355.72755,405.02349 354.95229,407.25861 353.9583,408.35696 C 351.67955,410.87496 346.34609,410.98943 344.15415,408.56735 L 344.15414,408.56736 z" ! id="path2403" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 313.99325,343.61347 C 311.58093,341.20113 311.30822,340.29602 311.71576,336.0546 C 312.2967,330.00845 313.32916,328.88112 316.8262,330.47448 C 319.71402,331.79024 325.46102,339.67777 325.46102,342.32539 C 325.46102,347.05049 318.24122,347.86142 313.99326,343.61346 L 313.99325,343.61347 z" ! id="path2405" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 294.08791,303.89634 C 291.53151,301.13796 286.06956,288.02834 286.69498,286.15208 C 287.40236,284.02996 297.23455,294.19407 299.03511,298.90878 C 301.7413,305.99485 298.79011,308.97012 294.08789,303.89634 L 294.08791,303.89634 z" ! id="path2407" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 400.46102,179.22442 C 396.52219,177.39891 396.21043,177.0363 397.96102,176.31667 C 400.31376,175.34952 414.5865,175.08114 416.87923,175.96094 C 419.40471,176.93005 418.7284,178.34428 414.99314,179.90498 C 410.22694,181.89643 405.7766,181.68802 400.46102,179.22442 z" ! id="path2409" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 231.96102,210.48429 C 206.66102,198.49877 179.56119,186.02877 171.73917,182.77319 C 163.91716,179.51761 157.50465,176.45727 157.48917,175.97244 C 157.4737,175.48762 160.72352,175.32582 164.71102,175.6129 C 178.12416,176.57856 212.17836,189.51499 251.94648,208.75167 C 265.13847,215.13293 276.43356,220.35395 277.04664,220.35395 C 277.65971,220.35395 286.66627,216.25316 297.06118,211.24108 C 329.90721,195.40382 351.11651,186.58455 362.71102,183.94249 C 369.403,182.41757 364.26318,187.28872 350.40581,195.60445 C 340.00252,201.84741 280.4427,232.38908 278.81588,232.31505 C 278.34571,232.29364 257.26102,222.46981 231.96102,210.48429 z" ! id="path2411" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 100.0378,580.99042 C 111.66096,576.66909 120.86859,569.62445 141.53484,549.24162 C 185.6822,505.69968 211.50415,470.78714 222.43992,439.85395 C 228.24316,423.4387 230.54025,410.00796 231.16251,388.85395 C 231.78029,367.85271 230.58354,351.50012 227.32973,336.48196 C 221.45493,309.36643 208.7934,283.36016 189.04856,257.85395 C 181.00404,247.46212 177.80685,243.88763 156.17754,221.10395 C 147.43181,211.89145 140.57661,204.35395 140.94376,204.35395 C 141.94889,204.35395 163.83459,219.73178 173.08872,226.94037 C 202.20635,249.62178 225.31246,282.32523 237.32234,317.85395 C 255.98719,373.07003 250.36135,435.41509 221.53435,492.81486 C 208.09508,519.57489 196.46997,535.93237 168.58502,567.31892 L 154.33892,583.35395 L 124.14998,583.30183 L 93.961019,583.24976 L 100.0378,580.99042 z" ! id="path2413" ! transform="scale(0.8,0.8)" /> ! <path ! style="opacity:1;fill:#ff0505;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.44999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" ! d="M 410.31022,131.65831 C 343.65359,108.38937 309.07236,98.63468 265.81022,90.89767 C 230.93887,84.66126 183.09317,81.16897 161.31022,83.27013 C 140.42269,85.28491 132.30393,87.91402 96.31022,104.31916 C 72.09195,115.35731 62.14176,119.15689 51.87155,121.28846 C 37.12203,124.34969 27.02257,118.28327 22.9004,103.88642 C 20.09465,94.0872 19.23612,82.50062 18.61495,46.05089 L 17.98866,9.3008902 L 296.73075,9.3008902 L 575.47288,9.3008902 L 575.05332,37.55089 C 574.78825,55.40196 574.19898,67.14462 573.45252,69.4513 C 570.89399,77.3576 564.53795,80.81832 547.0179,83.84442 C 535.2719,85.87321 525.65688,89.10454 514.0424,94.92652 C 499.20886,102.36209 488.18911,110.61566 469.54379,128.25503 C 459.92459,137.35526 451.32442,144.86777 450.43228,144.94952 C 449.54014,145.03128 431.48522,139.05023 410.31022,131.65832 L 410.31022,131.65831 z" ! id="path2391" ! transform="scale(0.8,0.8)" /> ! </svg> |