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: Pascal F M. <pas...@us...> - 2005-12-13 09:31:05
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3073 Modified Files: mktarball Log Message: Forgot one more PocketPC file Index: mktarball =================================================================== RCS file: /cvsroot/roadmap/roadmap/mktarball,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** mktarball 8 Dec 2005 06:58:17 -0000 1.24 --- mktarball 13 Dec 2005 09:30:52 -0000 1.25 *************** *** 42,45 **** --- 42,46 ---- ${ROADMAP}/src/win32/*.[ch] ${ROADMAP}/src/win32/*.cpp + ${ROADMAP}/src/win32/*.ico ${ROADMAP}/src/win32/roadmap.rc ${ROADMAP}/src/ipkg/mkipkg |
From: Ehud S. <esh...@us...> - 2005-12-12 20:53:19
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23449 Modified Files: editor_track_main.c Log Message: Remove debug code. Index: editor_track_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** editor_track_main.c 12 Dec 2005 20:47:53 -0000 1.4 --- editor_track_main.c 12 Dec 2005 20:52:56 -0000 1.5 *************** *** 430,440 **** int point_id; int res; - static FILE *dbg_file; - - if (dbg_file == NULL) { - dbg_file = fopen("/tmp/rm.log", "w"); - } - - fflush (dbg_file); if (filter == NULL) { --- 430,433 ---- *************** *** 446,451 **** } - fprintf (dbg_file, "Recv gps point: %d, %d\n", gps_position->longitude, gps_position->latitude); - roadmap_math_get_context (&context_save_pos, &context_save_zoom); roadmap_math_set_context ((RoadMapPosition *)gps_position, 20); --- 439,442 ---- *************** *** 461,466 **** */ - fprintf (dbg_file, "Track end.\n"); - editor_track_end (); goto restore; --- 452,455 ---- *************** *** 471,477 **** TrackLastPosition = *filtered_gps_point; - fprintf (dbg_file, "Filter output point: %d, %d\n", - filtered_gps_point->longitude, filtered_gps_point->latitude); - point_id = editor_track_add_point(&TrackLastPosition, gps_time); --- 460,463 ---- |
From: Ehud S. <esh...@us...> - 2005-12-12 20:51:04
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22972 Modified Files: libroadmap.vcp Log Message: Added some files. Index: libroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap/libroadmap.vcp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libroadmap.vcp 1 Dec 2005 16:53:07 -0000 1.3 --- libroadmap.vcp 12 Dec 2005 20:50:39 -0000 1.4 *************** *** 454,473 **** DEP_CPP_EDITO=\ ! "..\..\..\..\..\roadmap_merged\src\buildmap.h"\ ! "..\..\..\..\..\roadmap_merged\src\roadmap.h"\ ! "..\..\..\..\..\roadmap_merged\src\roadmap_canvas.h"\ ! "..\..\..\..\..\roadmap_merged\src\roadmap_county.h"\ ! "..\..\..\..\..\roadmap_merged\src\roadmap_db.h"\ ! "..\..\..\..\..\roadmap_merged\src\roadmap_dbread.h"\ ! "..\..\..\..\..\roadmap_merged\src\roadmap_file.h"\ ! "..\..\..\..\..\roadmap_merged\src\roadmap_gui.h"\ [...1045 lines suppressed...] "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_db_line_route.h"\ "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_gui.h"\ "..\..\..\roadmap_line.h"\ + "..\..\..\roadmap_line_route.h"\ "..\..\..\roadmap_locator.h"\ "..\..\..\roadmap_plugin.h"\ *************** *** 5911,5917 **** --- 5965,5973 ---- "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_db_line_route.h"\ "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_gui.h"\ "..\..\..\roadmap_line.h"\ + "..\..\..\roadmap_line_route.h"\ "..\..\..\roadmap_locator.h"\ "..\..\..\roadmap_plugin.h"\ |
From: Ehud S. <esh...@us...> - 2005-12-12 20:48:38
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22423 Modified Files: roadmap_main.cpp roadmap_serial.c wince_input_mon.c wince_input_mon.h Log Message: Enforce GPS timeout (reconnect if a timeout occurs). Close GPS connection on shutdown. Index: wince_input_mon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_input_mon.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** wince_input_mon.c 15 Oct 2005 22:19:21 -0000 1.1.1.1 --- wince_input_mon.c 12 Dec 2005 20:48:29 -0000 1.2 *************** *** 40,46 **** --- 40,50 ---- while(io->subsystem != ROADMAP_IO_INVALID) { + int error = 0; + SetCommMask (hCommPort, EV_RXCHAR); if(!WaitCommEvent (hCommPort, &fdwCommMask, 0)) { + + error = 1; if(GetLastError() == ERROR_INVALID_HANDLE) { roadmap_log (ROADMAP_INFO, *************** *** 49,52 **** --- 53,57 ---- roadmap_log (ROADMAP_ERROR, "Error in WaitCommEvent."); + roadmap_serial_close (hCommPort); } *************** *** 55,58 **** --- 60,65 ---- * fail, and result in removing this input. */ + + error = 1; } *************** *** 65,69 **** /* Send a message to main window so it can read. */ ! SendMessage(RoadMapMainWindow, WM_USER_READ, (WPARAM)data, 0); } --- 72,78 ---- /* Send a message to main window so it can read. */ ! SendMessage(RoadMapMainWindow, WM_USER_READ, (WPARAM)data, (LPARAM)error); ! ! if (error) break; } Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_main.cpp 28 Nov 2005 19:36:35 -0000 1.2 --- roadmap_main.cpp 12 Dec 2005 20:48:29 -0000 1.3 *************** *** 393,396 **** --- 393,401 ---- { roadmap_main_io *context = (roadmap_main_io *) wParam; + + if (lParam) { + /* An error occured */ + context->io->subsystem = ROADMAP_IO_INVALID; + } (*context->callback) (context->io); break; Index: wince_input_mon.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_input_mon.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** wince_input_mon.h 15 Oct 2005 22:19:21 -0000 1.1.1.1 --- wince_input_mon.h 12 Dec 2005 20:48:29 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- #include <windows.h> #include "../roadmap_main.h" + #include "../roadmap_io.h" #define WM_USER_READ WM_USER+1 Index: roadmap_serial.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_serial.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_serial.c 15 Oct 2005 22:19:11 -0000 1.1.1.1 --- roadmap_serial.c 12 Dec 2005 20:48:29 -0000 1.2 *************** *** 40,44 **** NULL, OPEN_EXISTING, ! 0, NULL); --- 40,44 ---- NULL, OPEN_EXISTING, ! FILE_FLAG_WRITE_THROUGH, NULL); *************** *** 49,62 **** } - ct.ReadIntervalTimeout = MAXDWORD; - ct.ReadTotalTimeoutMultiplier = 0; - ct.ReadTotalTimeoutConstant = 0; - ct.WriteTotalTimeoutMultiplier = 10; - ct.WriteTotalTimeoutConstant = 1000; - if(!SetCommTimeouts(hCommPort, &ct)) { - roadmap_serial_close(hCommPort); - return (HANDLE)-1; - } - dcb.DCBlength = sizeof(DCB); if(!GetCommState(hCommPort, &dcb)) { --- 49,52 ---- *************** *** 65,78 **** } ! dcb.fBinary = TRUE; dcb.BaudRate = baud_rate; ! dcb.fOutxCtsFlow = TRUE; dcb.fRtsControl = RTS_CONTROL_DISABLE; dcb.fDtrControl = DTR_CONTROL_DISABLE; ! dcb.fOutxDsrFlow = FALSE; ! dcb.fOutX = FALSE; ! dcb.fInX = FALSE; dcb.ByteSize = 8; ! dcb.Parity = NOPARITY; dcb.StopBits = ONESTOPBIT; --- 55,68 ---- } ! // dcb.fBinary = TRUE; dcb.BaudRate = baud_rate; ! // dcb.fOutxCtsFlow = TRUE; dcb.fRtsControl = RTS_CONTROL_DISABLE; dcb.fDtrControl = DTR_CONTROL_DISABLE; ! // dcb.fOutxDsrFlow = FALSE; ! // dcb.fOutX = FALSE; ! // dcb.fInX = FALSE; dcb.ByteSize = 8; ! dcb.fParity = FALSE; dcb.StopBits = ONESTOPBIT; *************** *** 82,85 **** --- 72,85 ---- } + ct.ReadIntervalTimeout = MAXDWORD; + ct.ReadTotalTimeoutMultiplier = 0; + ct.ReadTotalTimeoutConstant = 0; + ct.WriteTotalTimeoutMultiplier = 10; + ct.WriteTotalTimeoutConstant = 1000; + if(!SetCommTimeouts(hCommPort, &ct)) { + roadmap_serial_close(hCommPort); + return (HANDLE)-1; + } + return hCommPort; } |
From: Ehud S. <esh...@us...> - 2005-12-12 20:48:01
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22300 Modified Files: editor_track_known.c editor_track_main.c editor_track_util.c Log Message: Expand RoadMap's internal database: - Line route data: direction, cross time, speed limit. - Text to speech field. - Support left/right separation of street numbers. Index: editor_track_util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editor_track_util.c 1 Dec 2005 12:19:00 -0000 1.3 --- editor_track_util.c 12 Dec 2005 20:47:53 -0000 1.4 *************** *** 42,45 **** --- 42,46 ---- #include "roadmap_locator.h" #include "roadmap_line.h" + #include "roadmap_line_route.h" #include "roadmap_point.h" #include "roadmap_navigate.h" *************** *** 746,755 **** if (direction != 0) { ! short from_flags; ! short to_flags; ! short speed_limit = 0; if (plugin_id == ROADMAP_PLUGIN_ID) { - //TODO get roadmap route data route = editor_override_line_get_route (roadmap_plugin_get_line_id (line)); } else { --- 747,755 ---- if (direction != 0) { ! LineRouteFlag from_flags = 0; ! LineRouteFlag to_flags = 0; ! LineRouteMax speed_limit = 0; if (plugin_id == ROADMAP_PLUGIN_ID) { route = editor_override_line_get_route (roadmap_plugin_get_line_id (line)); } else { *************** *** 758,770 **** if (route == -1) { ! route = editor_route_segment_add (0, 0, 0); ! from_flags = to_flags = 0; } else { ! editor_route_segment_get (route, &from_flags, &to_flags, &speed_limit); } ! if (direction == 1) { from_flags |= who; ! } else if (direction == 2) { to_flags |= who; } else { --- 758,782 ---- if (route == -1) { ! ! if (plugin_id == ROADMAP_PLUGIN_ID) { ! roadmap_line_route_get_flags ! (roadmap_plugin_get_line_id (line), ! &from_flags, &to_flags); ! ! roadmap_line_route_get_speed_limit ! (roadmap_plugin_get_line_id (line), ! &speed_limit, &speed_limit); ! } ! ! route = editor_route_segment_add ! (from_flags, to_flags, speed_limit, speed_limit); } else { ! editor_route_segment_get ! (route, &from_flags, &to_flags, &speed_limit, &speed_limit); } ! if (direction == ROUTE_DIRECTION_WITH_LINE) { from_flags |= who; ! } else if (direction == ROUTE_DIRECTION_AGAINST_LINE) { to_flags |= who; } else { *************** *** 773,777 **** if (route != -1) { ! editor_route_segment_set (route, from_flags, to_flags, speed_limit); } } --- 785,790 ---- if (route != -1) { ! editor_route_segment_set ! (route, from_flags, to_flags, speed_limit, speed_limit); } } *************** *** 779,783 **** if (plugin_id != EditorPluginID) { ! editor_override_line_get_trksegs (roadmap_plugin_get_line_id (line), &first, &last); if (first == -1) { --- 792,797 ---- if (plugin_id != EditorPluginID) { ! editor_override_line_get_trksegs ! (roadmap_plugin_get_line_id (line), &first, &last); if (first == -1) { *************** *** 787,795 **** last = trkseg; } ! editor_override_line_set_trksegs (roadmap_plugin_get_line_id (line), first, last); } else { ! editor_line_get_trksegs (roadmap_plugin_get_line_id (line), &first, &last); if (first == -1) { --- 801,811 ---- last = trkseg; } ! editor_override_line_set_trksegs ! (roadmap_plugin_get_line_id (line), first, last); } else { ! editor_line_get_trksegs ! (roadmap_plugin_get_line_id (line), &first, &last); if (first == -1) { *************** *** 800,804 **** } ! editor_line_set_trksegs (roadmap_plugin_get_line_id (line), first, last); } } --- 816,821 ---- } ! editor_line_set_trksegs ! (roadmap_plugin_get_line_id (line), first, last); } } *************** *** 878,882 **** editor_line_set_trksegs (line_id, trkseg, trkseg2); ! route = editor_route_segment_add (ED_ROUTE_CAR, 0, 0); editor_line_set_route (line_id, route); --- 895,899 ---- editor_line_set_trksegs (line_id, trkseg, trkseg2); ! route = editor_route_segment_add (ROUTE_CAR_ALLOWED, 0, 0, 0); editor_line_set_route (line_id, route); Index: editor_track_known.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_known.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_track_known.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_track_known.c 12 Dec 2005 20:47:53 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- #include "roadmap_gps.h" #include "roadmap_line.h" + #include "roadmap_line_route.h" #include "../db/editor_db.h" *************** *** 132,136 **** (trkseg_line_id, 0, last_point_id, flags|ED_TRKSEG_IGNORE|ED_TRKSEG_END_TRACK); ! editor_track_add_trkseg (line, trkseg, 0, ED_ROUTE_CAR); editor_log_pop (); return 1; --- 133,138 ---- (trkseg_line_id, 0, last_point_id, flags|ED_TRKSEG_IGNORE|ED_TRKSEG_END_TRACK); ! ! editor_track_add_trkseg (line, trkseg, 0, ROUTE_CAR_ALLOWED); editor_log_pop (); return 1; *************** *** 139,143 **** trkseg = editor_track_util_create_trkseg (trkseg_line_id, 0, last_point_id, flags|ED_TRKSEG_IGNORE); ! editor_track_add_trkseg (line, trkseg, 0, ED_ROUTE_CAR); editor_log_pop (); return 0; --- 141,145 ---- trkseg = editor_track_util_create_trkseg (trkseg_line_id, 0, last_point_id, flags|ED_TRKSEG_IGNORE); ! editor_track_add_trkseg (line, trkseg, 0, ROUTE_CAR_ALLOWED); editor_log_pop (); return 0; *************** *** 156,164 **** editor_log (ROADMAP_INFO, "Updating route direction: to -> from"); ! editor_track_add_trkseg (line, trkseg, 2, ED_ROUTE_CAR); } else { editor_log (ROADMAP_INFO, "Updating route direction: from -> to"); ! editor_track_add_trkseg (line, trkseg, 1, ED_ROUTE_CAR); } --- 158,166 ---- editor_log (ROADMAP_INFO, "Updating route direction: to -> from"); ! editor_track_add_trkseg (line, trkseg, 2, ROUTE_CAR_ALLOWED); } else { editor_log (ROADMAP_INFO, "Updating route direction: from -> to"); ! editor_track_add_trkseg (line, trkseg, 1, ROUTE_CAR_ALLOWED); } Index: editor_track_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editor_track_main.c 1 Dec 2005 12:19:00 -0000 1.3 --- editor_track_main.c 12 Dec 2005 20:47:53 -0000 1.4 *************** *** 426,431 **** --- 426,440 ---- static struct GPSFilter *filter; const RoadMapGpsPosition *filtered_gps_point; + RoadMapPosition context_save_pos; + int context_save_zoom; int point_id; int res; + static FILE *dbg_file; + + if (dbg_file == NULL) { + dbg_file = fopen("/tmp/rm.log", "w"); + } + + fflush (dbg_file); if (filter == NULL) { *************** *** 437,440 **** --- 446,455 ---- } + fprintf (dbg_file, "Recv gps point: %d, %d\n", gps_position->longitude, gps_position->latitude); + + roadmap_math_get_context (&context_save_pos, &context_save_zoom); + roadmap_math_set_context ((RoadMapPosition *)gps_position, 20); + editor_track_util_set_focus ((RoadMapPosition *)gps_position); + res = editor_track_filter_add (filter, gps_time, dilution, gps_position); *************** *** 446,451 **** */ editor_track_end (); ! return; } --- 461,468 ---- */ + fprintf (dbg_file, "Track end.\n"); + editor_track_end (); ! goto restore; } *************** *** 454,457 **** --- 471,477 ---- TrackLastPosition = *filtered_gps_point; + fprintf (dbg_file, "Filter output point: %d, %d\n", + filtered_gps_point->longitude, filtered_gps_point->latitude); + point_id = editor_track_add_point(&TrackLastPosition, gps_time); *************** *** 465,468 **** --- 485,492 ---- track_rec_locate_point (point_id); } + + restore: + editor_track_util_release_focus (); + roadmap_math_set_context (&context_save_pos, context_save_zoom); } *************** *** 475,481 **** if (editor_is_enabled()) { - editor_track_util_set_focus ((RoadMapPosition *)gps_position); track_rec_locate(gps_time, dilution, gps_position); - editor_track_util_release_focus (); } } --- 499,503 ---- |
From: Ehud S. <esh...@us...> - 2005-12-12 20:46:10
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/export In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21945 Modified Files: editor_export.c Log Message: Expand RoadMap's internal database: - Line route data: direction, cross time, speed limit. - Text to speech field. - Support left/right separation of street numbers. Index: editor_export.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_export.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editor_export.c 1 Dec 2005 12:18:15 -0000 1.3 --- editor_export.c 12 Dec 2005 20:46:01 -0000 1.4 *************** *** 36,39 **** --- 36,40 ---- #include "roadmap_layer.h" #include "roadmap_point.h" + #include "roadmap_line_route.h" #include "roadmap_fileselection.h" *************** *** 196,200 **** int roadmap_to_id; int route_id; ! short speed_limit; fprintf (file, "<extensions>\n"); --- 197,201 ---- int roadmap_to_id; int route_id; ! LineRouteMax speed_limit; fprintf (file, "<extensions>\n"); *************** *** 266,275 **** editor_route_segment_get ! (route_id, NULL, NULL, &speed_limit); if (speed_limit) { char str[100]; snprintf (str, sizeof(str), "%d", speed_limit); ! add_attribute (file, "city_name", str); } } --- 267,276 ---- editor_route_segment_get ! (route_id, NULL, NULL, &speed_limit, NULL); if (speed_limit) { char str[100]; snprintf (str, sizeof(str), "%d", speed_limit); ! add_attribute (file, "speed_limit", str); } } |
From: Ehud S. <esh...@us...> - 2005-12-12 20:45:40
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/static In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21839 Modified Files: editor_dialog.c Log Message: Expand RoadMap's internal database: - Line route data: direction, cross time, speed limit. - Text to speech field. - Support left/right separation of street numbers. Index: editor_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/static/editor_dialog.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_dialog.c 30 Nov 2005 08:13:57 -0000 1.2 --- editor_dialog.c 12 Dec 2005 20:45:28 -0000 1.3 *************** *** 36,39 **** --- 36,40 ---- #include "roadmap_layer.h" #include "roadmap_line.h" + #include "roadmap_line_route.h" #include "roadmap_shape.h" #include "roadmap_square.h" *************** *** 195,200 **** int i; int route_id; ! EditorRouteFlag route_from_flags; ! EditorRouteFlag route_to_flags; int type = (int) roadmap_dialog_get_data ("General", "Road type"); int cfcc = type + ROADMAP_ROAD_FIRST; --- 196,201 ---- int i; int route_id; ! LineRouteFlag route_from_flags; ! LineRouteFlag route_to_flags; int type = (int) roadmap_dialog_get_data ("General", "Road type"); int cfcc = type + ROADMAP_ROAD_FIRST; *************** *** 226,235 **** int l_from, l_to; int r_from, r_to; ! short speed_limit; l_from = l_to = r_from = r_to = -1; decode_range (street_range, &l_from, &l_to, &r_from, &r_to); ! speed_limit = (short) atoi (speed_limit_str); for (i=0; i<selected_lines->count; i++) { --- 227,236 ---- int l_from, l_to; int r_from, r_to; ! LineRouteMax speed_limit; l_from = l_to = r_from = r_to = -1; decode_range (street_range, &l_from, &l_to, &r_from, &r_to); ! speed_limit = (LineRouteMax) atoi (speed_limit_str); for (i=0; i<selected_lines->count; i++) { *************** *** 291,316 **** if (route_id == -1) { ! route_id = editor_route_segment_add (0, 0, 0); editor_line_set_route (line->line.line_id, route_id); } else { editor_route_segment_get ! (route_id, &route_from_flags, &route_to_flags, NULL); } if ((direction == 1) || (direction == 3)) { ! route_from_flags |= ED_ROUTE_CAR; } else { ! route_from_flags &= ~ED_ROUTE_CAR; } if ((direction == 2) || (direction == 3)) { ! route_to_flags |= ED_ROUTE_CAR; } else { ! route_to_flags &= ~ED_ROUTE_CAR; } if (route_id != -1) { editor_route_segment_set ! (route_id, route_from_flags, route_to_flags, speed_limit); } --- 292,319 ---- if (route_id == -1) { ! route_id = editor_route_segment_add (0, 0, 0, 0); editor_line_set_route (line->line.line_id, route_id); } else { editor_route_segment_get ! (route_id, &route_from_flags, &route_to_flags, NULL, NULL); } if ((direction == 1) || (direction == 3)) { ! route_from_flags |= ROUTE_CAR_ALLOWED; } else { ! route_from_flags &= ~ROUTE_CAR_ALLOWED; } if ((direction == 2) || (direction == 3)) { ! route_to_flags |= ROUTE_CAR_ALLOWED; } else { ! route_to_flags &= ~ROUTE_CAR_ALLOWED; } if (route_id != -1) { editor_route_segment_set ! (route_id, ! route_from_flags, route_to_flags, ! speed_limit, speed_limit); } *************** *** 357,365 **** int r_to = -1; int direction = 0; ! short speed_limit = 0; int cfcc = ROADMAP_ROAD_LAST; int same_street = 1; int same_direction = 1; ! short same_speed_limit = 1; int same_l_city = 1; int same_r_city = 1; --- 360,368 ---- int r_to = -1; int direction = 0; ! LineRouteMax speed_limit = 0; int cfcc = ROADMAP_ROAD_LAST; int same_street = 1; int same_direction = 1; ! int same_speed_limit = 1; int same_l_city = 1; int same_r_city = 1; *************** *** 384,388 **** int this_r_to = -1; int this_direction = 0; ! short this_speed_limit = 0; int route_id; --- 387,391 ---- int this_r_to = -1; int this_direction = 0; ! LineRouteMax this_speed_limit = 0; int route_id; *************** *** 417,422 **** if (route_id != -1) { this_direction = ! editor_route_get_direction (route_id, ED_ROUTE_CAR); ! editor_route_segment_get (route_id, NULL, NULL, &this_speed_limit); } } --- 420,427 ---- if (route_id != -1) { this_direction = ! editor_route_get_direction (route_id, ROUTE_CAR_ALLOWED); ! editor_route_segment_get ! (route_id, NULL, NULL, ! &this_speed_limit, NULL); } } *************** *** 425,429 **** RoadMapStreetProperties properties; ! roadmap_locator_activate (lines[i].line.fips); roadmap_street_get_properties (lines[i].line.line_id, &properties); --- 430,437 ---- RoadMapStreetProperties properties; ! if (roadmap_locator_activate (lines[i].line.fips) < 0) { ! continue; ! } ! roadmap_street_get_properties (lines[i].line.line_id, &properties); *************** *** 449,459 **** (&properties, ROADMAP_STREET_RIGHT_SIDE, &this_r_from, &this_r_to); - //TODO check roadmap route route_id = editor_override_line_get_route (lines[0].line.line_id); if (route_id != -1) { this_direction = ! editor_route_get_direction (route_id, ED_ROUTE_CAR); ! editor_route_segment_get (route_id, NULL, NULL, &this_speed_limit); } } --- 457,475 ---- (&properties, ROADMAP_STREET_RIGHT_SIDE, &this_r_from, &this_r_to); route_id = editor_override_line_get_route (lines[0].line.line_id); if (route_id != -1) { this_direction = ! editor_route_get_direction (route_id, ROUTE_CAR_ALLOWED); ! editor_route_segment_get ! (route_id, NULL, NULL, &this_speed_limit, NULL); ! } else { ! ! this_direction = ! roadmap_line_route_get_direction ! (lines[i].line.line_id, ROUTE_CAR_ALLOWED); ! roadmap_line_route_get_speed_limit ! (lines[i].line.line_id, ! &this_speed_limit, &this_speed_limit); } } *************** *** 692,696 **** for (i=0; i<selected_lines->count; i++) { int line_length; ! double speed; SelectedLine *line = &selected_lines->lines[i]; --- 708,712 ---- for (i=0; i<selected_lines->count; i++) { int line_length; ! int time; SelectedLine *line = &selected_lines->lines[i]; *************** *** 699,711 **** line_length = editor_line_length (line->line.line_id); ! speed = editor_line_get_avg_speed (line->line.line_id, 1); } else { line_length = roadmap_line_length (line->line.line_id); ! speed = -1; //TODO get real speed } ! if (speed > 0) { ! total_time += (int)(1.0 * line_length / speed) + 1; } else { --- 715,735 ---- line_length = editor_line_length (line->line.line_id); ! time = editor_line_get_cross_time (line->line.line_id, 1); } else { + LineRouteTime from_cross_time; + LineRouteTime to_cross_time; + line_length = roadmap_line_length (line->line.line_id); ! if (roadmap_line_route_get_cross_times ! (line->line.line_id, &from_cross_time, &to_cross_time) == -1) { ! time = -1; //TODO get real speed ! } else { ! time = from_cross_time; ! } } ! if (time > 0) { ! total_time += time; } else { |
From: Ehud S. <esh...@us...> - 2005-12-12 20:45:28
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21777 Modified Files: editor_line.c editor_line.h editor_route.c editor_route.h editor_street.c editor_street.h Log Message: Expand RoadMap's internal database: - Line route data: direction, cross time, speed limit. - Text to speech field. - Support left/right separation of street numbers. Index: editor_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_line.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_line.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_line.c 12 Dec 2005 20:45:10 -0000 1.2 *************** *** 674,681 **** ! double editor_line_get_avg_speed (int line, int direction) { editor_db_line *line_db; - int length; time_t start_time; time_t end_time; --- 674,680 ---- ! int editor_line_get_cross_time (int line, int direction) { editor_db_line *line_db; time_t start_time; time_t end_time; *************** *** 684,697 **** (ActiveLinesDB, line, 0, NULL); ! ! length = editor_line_length (line); ! ! if (!length) return -1; ! ! editor_trkseg_get_time (line_db->first_trkseg, &start_time, &end_time); if (start_time == end_time) return -1; ! return 1.0 * length / (end_time - start_time); } --- 683,692 ---- (ActiveLinesDB, line, 0, NULL); ! editor_trkseg_get_time ! (line_db->first_trkseg, &start_time, &end_time); if (start_time == end_time) return -1; ! return end_time - start_time; } Index: editor_route.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_route.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_route.h 30 Nov 2005 08:12:48 -0000 1.2 --- editor_route.h 12 Dec 2005 20:45:10 -0000 1.3 *************** *** 25,48 **** #define INCLUDE__EDITOR_ROUTE__H - #define ED_ROUTE_CAR 0x0001 - - #define ED_ROUTE_STOP_LIGHT 0x8000 - - typedef short EditorRouteFlag; - typedef struct editor_route_segment_s { ! EditorRouteFlag from_flags; ! EditorRouteFlag to_flags; ! short speed_limit; } editor_db_route_segment; int editor_route_segment_add ! (short from_flags, short to_flags, short speed_limit); void editor_route_segment_get ! (int route, short *from_flags, short *to_flags, short *speed_limit); void editor_route_segment_set ! (int route, short from_flags, short to_flags, short speed_limit); void editor_route_segment_copy (int source_line, int plugin_id, int dest_line); --- 25,55 ---- #define INCLUDE__EDITOR_ROUTE__H typedef struct editor_route_segment_s { ! LineRouteFlag from_flags; ! LineRouteFlag to_flags; ! LineRouteMax from_speed_limit; ! LineRouteMax to_speed_limit; } editor_db_route_segment; int editor_route_segment_add ! (LineRouteFlag from_flags, ! LineRouteFlag to_flags, ! LineRouteMax from_speed_limit, ! LineRouteMax to_speed_limit); void editor_route_segment_get ! (int route, ! LineRouteFlag *from_flags, ! LineRouteFlag *to_flags, ! LineRouteMax *from_speed_limit, ! LineRouteMax *to_speed_limit); ! void editor_route_segment_set ! (int route, ! LineRouteFlag from_flags, ! LineRouteFlag to_flags, ! LineRouteMax from_speed_limit, ! LineRouteMax to_speed_limit); void editor_route_segment_copy (int source_line, int plugin_id, int dest_line); Index: editor_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_line.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_line.h 28 Nov 2005 19:47:50 -0000 1.1 --- editor_line.h 12 Dec 2005 20:45:10 -0000 1.2 *************** *** 89,93 **** void editor_line_get_trksegs (int line, int *first, int *last); void editor_line_set_trksegs (int line, int first, int last); ! double editor_line_get_avg_speed (int line, int direction); int editor_line_mark_dirty (int line_id); --- 89,93 ---- void editor_line_get_trksegs (int line, int *first, int *last); void editor_line_set_trksegs (int line, int first, int last); ! int editor_line_get_cross_time (int line, int direction); int editor_line_mark_dirty (int line_id); Index: editor_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_street.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_street.c 1 Dec 2005 12:17:40 -0000 1.2 --- editor_street.c 12 Dec 2005 20:45:10 -0000 1.3 *************** *** 484,488 **** properties->city = -1; properties->range_id = -1; ! properties->range.min = properties->range.max = -1; if (editor_line_get_street --- 484,489 ---- properties->city = -1; properties->range_id = -1; ! properties->first_range.fradd = properties->first_range.toadd = -1; ! properties->second_range.fradd = properties->second_range.toadd = -1; if (editor_line_get_street *************** *** 496,518 **** &properties->city, NULL, ! &properties->range.min, ! &properties->range.max) != -1)) { properties->range_id = range; - - if (properties->range.min > properties->range.max) { - int tmp = properties->range.min; - properties->range.min = properties->range.max; - properties->range.max = tmp; - } } if (range != -1) { - int from; - int to; EditorString city; if (editor_street_get_range ! (range, ED_STREET_RIGHT_SIDE, &city, NULL, &from, &to) == -1) { return; } --- 497,516 ---- &properties->city, NULL, ! &properties->first_range.fradd, ! &properties->first_range.toadd) != -1)) { properties->range_id = range; } if (range != -1) { EditorString city; if (editor_street_get_range ! (range, ! ED_STREET_RIGHT_SIDE, ! &city, ! NULL, ! &properties->second_range.fradd, ! &properties->second_range.toadd) == -1) { return; } *************** *** 522,540 **** } - if (from > to) { - int tmp = from; - from = to; - to = tmp; - } - - if ((from != -1) && - ((properties->range.min == -1) || (from < properties->range.min))) { - properties->range.min = from; - } - - if ((to != -1) && - ((properties->range.max == -1) || (to > properties->range.max))) { - properties->range.max = to; - } } } --- 520,523 ---- *************** *** 574,584 **** static char RoadMapStreetAddress [32]; ! if (properties->range.min >= properties->range.max) { return ""; } ! sprintf (RoadMapStreetAddress, ! "%d - %d", properties->range.min, properties->range.max); return RoadMapStreetAddress; --- 557,592 ---- static char RoadMapStreetAddress [32]; + int min; + int max; ! if (properties->first_range.fradd == -1) { return ""; } ! if (properties->first_range.fradd > properties->first_range.toadd) { ! min = properties->first_range.toadd; ! max = properties->first_range.fradd; ! } else { ! min = properties->first_range.fradd; ! max = properties->first_range.toadd; ! } ! ! if (properties->second_range.fradd != -1) { ! ! if (properties->second_range.fradd < min) { ! min = properties->second_range.fradd; ! } ! if (properties->second_range.fradd > max) { ! max = properties->second_range.fradd; ! } ! if (properties->second_range.toadd < min) { ! min = properties->second_range.toadd; ! } ! if (properties->second_range.toadd > max) { ! max = properties->second_range.toadd; ! } ! } ! ! sprintf (RoadMapStreetAddress, "%d - %d", min, max); return RoadMapStreetAddress; Index: editor_street.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_street.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_street.h 28 Nov 2005 19:47:50 -0000 1.1 --- editor_street.h 12 Dec 2005 20:45:10 -0000 1.2 *************** *** 53,57 **** typedef struct { ! RoadMapStreetRange range; int street; int range_id; --- 53,58 ---- typedef struct { ! RoadMapStreetRange first_range; ! RoadMapStreetRange second_range; int street; int range_id; Index: editor_route.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_route.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_route.c 30 Nov 2005 08:12:48 -0000 1.2 --- editor_route.c 12 Dec 2005 20:45:10 -0000 1.3 *************** *** 31,34 **** --- 31,35 ---- #include "roadmap.h" + #include "roadmap_line_route.h" #include "../editor_log.h" *************** *** 56,60 **** ! void editor_route_segment_copy (int source_line, int plugin_id, int dest_line) { int route_id; --- 57,63 ---- ! void editor_route_segment_copy (int source_line, ! int plugin_id, ! int dest_line) { int route_id; *************** *** 63,67 **** if (!plugin_id) { - //TODO get roadmap's route information route_id = editor_override_line_get_route (source_line); } else { --- 66,69 ---- *************** *** 69,94 **** } ! if (route_id == -1) return; ! route = (editor_db_route_segment *) editor_db_get_item ( ! ActiveSegmentRouteDB, ! route_id, ! 0, ! NULL); ! assert (route != NULL); ! if (route == NULL) { ! editor_log ! (ROADMAP_ERROR, ! "Can't find route information for route_id:", route_id); ! return; ! } ! route_id = ! editor_route_segment_add ! (route->from_flags, ! route->to_flags, ! route->speed_limit); if (route_id < 0) { --- 71,121 ---- } ! if (route_id != -1) { ! route = (editor_db_route_segment *) editor_db_get_item ( ! ActiveSegmentRouteDB, ! route_id, ! 0, ! NULL); ! assert (route != NULL); ! if (route == NULL) { ! editor_log ! (ROADMAP_ERROR, ! "Can't find route information for route_id:", route_id); ! return; ! } ! route_id = ! editor_route_segment_add ! (route->from_flags, ! route->to_flags, ! route->from_speed_limit, ! route->to_speed_limit); ! } else { ! ! LineRouteFlag from_flags = 0; ! LineRouteFlag to_flags = 0; ! LineRouteMax from_speed_limit = 0; ! LineRouteMax to_speed_limit = 0; ! ! if (plugin_id != 0) return; /* No route info */ ! ! if (!roadmap_line_route_get_flags ! (source_line, &from_flags, &to_flags) && ! !roadmap_line_route_get_speed_limit ! (source_line, &from_speed_limit, &to_speed_limit)) { ! ! return; ! } ! ! route_id = ! editor_route_segment_add ! (from_flags, ! to_flags, ! from_speed_limit, ! to_speed_limit); ! } if (route_id < 0) { *************** *** 103,124 **** ! int editor_route_segment_add ! (EditorRouteFlag from_flags, EditorRouteFlag to_flags, short speed_limit) { ! editor_db_route_segment route; ! int id; ! route.from_flags = from_flags; ! route.to_flags = to_flags; ! route.speed_limit = speed_limit; ! id = editor_db_add_item (ActiveSegmentRouteDB, &route); ! if (id == -1) { ! editor_db_grow (); ! id = editor_db_add_item (ActiveSegmentRouteDB, &route); ! } ! return id; } --- 130,154 ---- ! int editor_route_segment_add (LineRouteFlag from_flags, ! LineRouteFlag to_flags, ! LineRouteMax from_speed_limit, ! LineRouteMax to_speed_limit) { ! editor_db_route_segment route; ! int id; ! route.from_flags = from_flags; ! route.to_flags = to_flags; ! route.from_speed_limit = from_speed_limit; ! route.to_speed_limit = to_speed_limit; ! id = editor_db_add_item (ActiveSegmentRouteDB, &route); ! if (id == -1) { ! editor_db_grow (); ! id = editor_db_add_item (ActiveSegmentRouteDB, &route); ! } ! return id; } *************** *** 160,166 **** void editor_route_segment_get (int route_id, ! EditorRouteFlag *from_flags, ! EditorRouteFlag *to_flags, ! short *speed_limit) { editor_db_route_segment *route; --- 190,197 ---- void editor_route_segment_get (int route_id, ! LineRouteFlag *from_flags, ! LineRouteFlag *to_flags, ! LineRouteMax *from_speed_limit, ! LineRouteMax *to_speed_limit) { editor_db_route_segment *route; *************** *** 189,193 **** if (from_flags != NULL) *from_flags = route->from_flags; if (to_flags != NULL) *to_flags = route->to_flags; ! if (speed_limit != NULL) *speed_limit = route->speed_limit; } --- 220,225 ---- if (from_flags != NULL) *from_flags = route->from_flags; if (to_flags != NULL) *to_flags = route->to_flags; ! if (from_speed_limit != NULL) *from_speed_limit = route->from_speed_limit; ! if (to_speed_limit != NULL) *to_speed_limit = route->to_speed_limit; } *************** *** 195,201 **** void editor_route_segment_set (int route_id, ! EditorRouteFlag from_flags, ! EditorRouteFlag to_flags, ! short speed_limit) { editor_db_route_segment *route; --- 227,234 ---- void editor_route_segment_set (int route_id, ! LineRouteFlag from_flags, ! LineRouteFlag to_flags, ! LineRouteMax from_speed_limit, ! LineRouteMax to_speed_limit) { editor_db_route_segment *route; *************** *** 224,228 **** route->from_flags = from_flags; route->to_flags = to_flags; ! route->speed_limit = speed_limit; } --- 257,262 ---- route->from_flags = from_flags; route->to_flags = to_flags; ! route->from_speed_limit = from_speed_limit; ! route->to_speed_limit = to_speed_limit; } |
From: Ehud S. <esh...@us...> - 2005-12-12 20:44:59
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21679 Modified Files: editor_plugin.c editor_screen.c Log Message: Expand RoadMap's internal database: - Line route data: direction, cross time, speed limit. - Text to speech field. - Support left/right separation of street numbers. Index: editor_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_screen.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor_screen.c 1 Dec 2005 12:13:33 -0000 1.5 --- editor_screen.c 12 Dec 2005 20:44:44 -0000 1.6 *************** *** 39,42 **** --- 39,43 ---- #include "roadmap_pointer.h" #include "roadmap_line.h" + #include "roadmap_line_route.h" #include "roadmap_shape.h" #include "roadmap_square.h" *************** *** 317,359 **** static int editor_screen_get_road_state (int line, int plugin_id, int fips) { - int route; int has_street = 0; int has_route = 0; ! //TODO get route from roadmap ! ! if (editor_db_activate (fips) != -1) { ! if (!plugin_id) { ! route = editor_override_line_get_route (line); ! } else { ! route = editor_line_get_route (line); ! } ! if (route != -1) { ! has_route = 1; ! } ! } ! if (plugin_id == 0) { ! ! RoadMapStreetProperties properties; ! roadmap_locator_activate (fips); ! roadmap_street_get_properties (line, &properties); ! if (properties.street != -1) { ! has_street = 1; } } else { ! EditorStreetProperties properties; ! editor_db_activate (fips); ! editor_street_get_properties (line, &properties); ! if (properties.street != -1) { ! has_street = 1; } } --- 318,369 ---- static int editor_screen_get_road_state (int line, int plugin_id, int fips) { int has_street = 0; int has_route = 0; ! if (plugin_id == ROADMAP_PLUGIN_ID) { ! if (roadmap_locator_activate (fips) >= 0) { ! ! RoadMapStreetProperties properties; ! roadmap_street_get_properties (line, &properties); ! if (properties.street != -1) { ! has_street = 1; ! } ! if (roadmap_line_route_get_direction ! (line, ROUTE_CAR_ALLOWED) != ROUTE_DIRECTION_NONE) { ! has_route = 1; ! ! } else if (editor_db_activate (fips) != -1) { ! ! int route; ! route = editor_override_line_get_route (line); ! ! if (route != -1) { ! has_route = 1; ! } ! } } } else { ! if (editor_db_activate (fips) != -1) { ! ! EditorStreetProperties properties; ! int route; ! editor_street_get_properties (line, &properties); ! if (properties.street != -1) { ! has_street = 1; ! } ! ! route = editor_line_get_route (line); ! if (route != -1) { ! has_route = 1; ! } } } *************** *** 412,415 **** --- 422,428 ---- } *override_pen = pen->pen; + } else { + + return 0; } *************** *** 429,433 **** RoadMapPosition to; ! direction = editor_route_get_direction (route, ED_ROUTE_CAR); if (direction <= 0) { --- 442,446 ---- RoadMapPosition to; ! direction = editor_route_get_direction (route, ROUTE_CAR_ALLOWED); if (direction <= 0) { *************** *** 614,618 **** if (route != -1) { ! direction = editor_route_get_direction (route, ED_ROUTE_CAR); if (direction > 0) { roadmap_screen_draw_line_direction --- 627,631 ---- if (route != -1) { ! direction = editor_route_get_direction (route, ROUTE_CAR_ALLOWED); if (direction > 0) { roadmap_screen_draw_line_direction Index: editor_plugin.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_plugin.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_plugin.c 30 Nov 2005 08:12:13 -0000 1.2 --- editor_plugin.c 12 Dec 2005 20:44:44 -0000 1.3 *************** *** 32,35 **** --- 32,36 ---- #include "db/editor_db.h" #include "db/editor_line.h" + #include "db/editor_route.h" #include "db/editor_override.h" #include "db/editor_street.h" *************** *** 120,123 **** --- 121,134 ---- + static int editor_plugin_get_direction (PluginLine *line, int who) { + + int route_id = editor_line_get_route (line->line_id); + + if (route_id == -1) return 0; + + return editor_route_get_direction (route_id, who); + } + + static RoadMapPluginHooks editor_plugin_hooks = { *************** *** 135,138 **** --- 146,150 ---- &editor_screen_adjust_layer, &editor_street_get_closest, + &editor_plugin_get_direction, &editor_track_end }; |
From: Ehud S. <esh...@us...> - 2005-12-12 20:43:35
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21384 Modified Files: usstates.txt Log Message: Israel is now officially a US state :-) Index: usstates.txt =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/usstates.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** usstates.txt 15 Oct 2005 22:19:03 -0000 1.1.1.1 --- usstates.txt 12 Dec 2005 20:43:26 -0000 1.2 *************** *** 12,16 **** HI,HAWAII ID,IDAHO ! IL,ILLINOIS IN,INDIANA IA,IOWA --- 12,16 ---- HI,HAWAII ID,IDAHO ! LL,ILLINOIS IN,INDIANA IA,IOWA *************** *** 74,75 **** --- 74,76 ---- DZ,DCW South America and Africa PN,Placenames + IL,Israel |
From: Ehud S. <esh...@us...> - 2005-12-12 20:43:18
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21325 Modified Files: app_a02.txt Log Message: Israel is now officially a US state :-) Index: app_a02.txt =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/app_a02.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** app_a02.txt 28 Nov 2005 19:36:34 -0000 1.2 --- app_a02.txt 12 Dec 2005 20:43:07 -0000 1.3 *************** *** 595,700 **** 16 085 Valley ID 16 087 Washington ID ! 17 001 Adams IL ! 17 003 Alexander IL ! 17 005 Bond IL ! 17 007 Boone IL ! 17 009 Brown IL ! 17 011 Bureau IL ! 17 013 Calhoun IL ! 17 015 Carroll IL ! 17 017 Cass IL ! 17 019 Champaign IL ! 17 021 Christian IL ! 17 023 Clark IL ! 17 025 Clay IL ! 17 027 Clinton IL ! 17 029 Coles IL ! 17 031 Cook IL ! 17 033 Crawford IL ! 17 035 Cumberland IL ! 17 037 DeKalb IL ! 17 039 De Witt IL ! 17 041 Douglas IL ! 17 043 DuPage IL ! 17 045 Edgar IL ! 17 047 Edwards IL ! 17 049 Effingham IL ! 17 051 Fayette IL ! 17 053 Ford IL ! 17 055 Franklin IL ! 17 057 Fulton IL ! 17 059 Gallatin IL ! 17 061 Greene IL ! 17 063 Grundy IL ! 17 065 Hamilton IL ! 17 067 Hancock IL ! 17 069 Hardin IL ! 17 071 Henderson IL ! 17 073 Henry IL ! 17 075 Iroquois IL ! 17 077 Jackson IL ! 17 079 Jasper IL ! 17 081 Jefferson IL ! 17 083 Jersey IL ! 17 085 Jo Daviess IL ! 17 087 Johnson IL ! 17 089 Kane IL ! 17 091 Kankakee IL ! 17 093 Kendall IL ! 17 095 Knox IL ! 17 097 Lake IL ! 17 099 La Salle IL ! 17 101 Lawrence IL ! 17 103 Lee IL ! 17 105 Livingston IL ! 17 107 Logan IL ! 17 109 McDonough IL ! 17 111 McHenry IL ! 17 113 McLean IL ! 17 115 Macon IL ! 17 117 Macoupin IL ! 17 119 Madison IL ! 17 121 Marion IL ! 17 123 Marshall IL ! 17 125 Mason IL ! 17 127 Massac IL ! 17 129 Menard IL ! 17 131 Mercer IL ! 17 133 Monroe IL ! 17 135 Montgomery IL ! 17 137 Morgan IL ! 17 139 Moultrie IL ! 17 141 Ogle IL ! 17 143 Peoria IL ! 17 145 Perry IL ! 17 147 Piatt IL ! 17 149 Pike IL ! 17 151 Pope IL ! 17 153 Pulaski IL ! 17 155 Putnam IL ! 17 157 Randolph IL ! 17 159 Richland IL ! 17 161 Rock Island IL ! 17 163 St. Clair IL ! 17 165 Saline IL ! 17 167 Sangamon IL ! 17 169 Schuyler IL ! 17 171 Scott IL ! 17 173 Shelby IL ! 17 175 Stark IL ! 17 177 Stephenson IL ! 17 179 Tazewell IL ! 17 181 Union IL ! 17 183 Vermilion IL ! 17 185 Wabash IL ! 17 187 Warren IL ! 17 189 Washington IL ! 17 191 Wayne IL ! 17 193 White IL ! 17 195 Whiteside IL ! 17 197 Will IL ! 17 199 Williamson IL ! 17 201 Winnebago IL ! 17 203 Woodford IL 18 001 Adams IN 18 003 Allen IN --- 595,700 ---- 16 085 Valley ID 16 087 Washington ID ! 17 001 Adams LL ! 17 003 Alexander LL ! 17 005 Bond LL ! 17 007 Boone LL ! 17 009 Brown LL ! 17 011 Bureau LL ! 17 013 Calhoun LL ! 17 015 Carroll LL ! 17 017 Cass LL ! 17 019 Champaign LL ! 17 021 Christian LL ! 17 023 Clark LL ! 17 025 Clay LL ! 17 027 Clinton LL ! 17 029 Coles LL ! 17 031 Cook LL ! 17 033 Crawford LL ! 17 035 Cumberland LL ! 17 037 DeKalb LL ! 17 039 De Witt LL ! 17 041 Douglas LL ! 17 043 DuPage LL ! 17 045 Edgar LL ! 17 047 Edwards LL ! 17 049 Effingham LL ! 17 051 Fayette LL ! 17 053 Ford LL ! 17 055 Franklin LL ! 17 057 Fulton LL ! 17 059 Gallatin LL ! 17 061 Greene LL ! 17 063 Grundy LL ! 17 065 Hamilton LL ! 17 067 Hancock LL ! 17 069 Hardin LL ! 17 071 Henderson LL ! 17 073 Henry LL ! 17 075 Iroquois LL ! 17 077 Jackson LL ! 17 079 Jasper LL ! 17 081 Jefferson LL ! 17 083 Jersey LL ! 17 085 Jo Daviess LL ! 17 087 Johnson LL ! 17 089 Kane LL ! 17 091 Kankakee LL ! 17 093 Kendall LL ! 17 095 Knox LL ! 17 097 Lake LL ! 17 099 La Salle LL ! 17 101 Lawrence LL ! 17 103 Lee LL ! 17 105 Livingston LL ! 17 107 Logan LL ! 17 109 McDonough LL ! 17 111 McHenry LL ! 17 113 McLean LL ! 17 115 Macon LL ! 17 117 Macoupin LL ! 17 119 Madison LL ! 17 121 Marion LL ! 17 123 Marshall LL ! 17 125 Mason LL ! 17 127 Massac LL ! 17 129 Menard LL ! 17 131 Mercer LL ! 17 133 Monroe LL ! 17 135 Montgomery LL ! 17 137 Morgan LL ! 17 139 Moultrie LL ! 17 141 Ogle LL ! 17 143 Peoria LL ! 17 145 Perry LL ! 17 147 Piatt LL ! 17 149 Pike LL ! 17 151 Pope LL ! 17 153 Pulaski LL ! 17 155 Putnam LL ! 17 157 Randolph LL ! 17 159 Richland LL ! 17 161 Rock Island LL ! 17 163 St. Clair LL ! 17 165 Saline LL ! 17 167 Sangamon LL ! 17 169 Schuyler LL ! 17 171 Scott LL ! 17 173 Shelby LL ! 17 175 Stark LL ! 17 177 Stephenson LL ! 17 179 Tazewell LL ! 17 181 Union LL ! 17 183 Vermilion LL ! 17 185 Wabash LL ! 17 187 Warren LL ! 17 189 Washington LL ! 17 191 Wayne LL ! 17 193 White LL ! 17 195 Whiteside LL ! 17 197 Will LL ! 17 199 Williamson LL ! 17 201 Winnebago LL ! 17 203 Woodford LL 18 001 Adams IN 18 003 Allen IN *************** *** 3232,3235 **** --- 3232,3236 ---- 72 153 Yauco PR 74 300 Midway Islands UM + 77 001 Israel IL 78 010 St. Croix VI 78 020 St. John VI |
From: Ehud S. <esh...@us...> - 2005-12-12 20:42:13
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21124 Modified Files: roadmap_math.c roadmap_math.h Log Message: Add context control interface. Index: roadmap_math.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_math.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_math.h 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_math.h 12 Dec 2005 20:42:02 -0000 1.3 *************** *** 114,116 **** --- 114,120 ---- int roadmap_math_distance_convert(const char *string, int *explicit); + void roadmap_math_set_context (RoadMapPosition *position, int zoom); + + void roadmap_math_get_context (RoadMapPosition *position, int *zoom); + #endif // _ROADMAP_MATH__H_ Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_math.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_math.c 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_math.c 12 Dec 2005 20:42:02 -0000 1.3 *************** *** 1301,1302 **** --- 1301,1325 ---- } + + void roadmap_math_set_context (RoadMapPosition *position, int zoom) { + + RoadMapContext.center = *position; + + if (zoom < 0x10000) { + RoadMapContext.zoom = (unsigned short) zoom; + } + + if (RoadMapContext.zoom <= 1) { + RoadMapContext.zoom = 2; + } + + roadmap_math_compute_scale (); + } + + + void roadmap_math_get_context (RoadMapPosition *position, int *zoom) { + + *position = RoadMapContext.center; + *zoom = RoadMapContext.zoom; + } + |
From: Ehud S. <esh...@us...> - 2005-12-12 20:41:11
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20967 Modified Files: roadmap_pointer.c Log Message: Decrease the long click delay. Index: roadmap_pointer.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_pointer.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_pointer.c 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_pointer.c 12 Dec 2005 20:41:03 -0000 1.3 *************** *** 35,39 **** #include "roadmap_main.h" ! #define LONG_CLICK_TIMEOUT 1000 #define DRAG_FLOW_CONTROL_TIMEOUT 30 --- 35,39 ---- #include "roadmap_main.h" ! #define LONG_CLICK_TIMEOUT 350 #define DRAG_FLOW_CONTROL_TIMEOUT 30 |
From: Ehud S. <esh...@us...> - 2005-12-12 20:40:45
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20873 Modified Files: roadmap_point.c Log Message: DB Points may now hold a real point ID (from map builder). Index: roadmap_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_point.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_point.c 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_point.c 12 Dec 2005 20:40:34 -0000 1.3 *************** *** 52,55 **** --- 52,58 ---- int BySquareCount; + int *PointID; + int PointIDCount; + unsigned short *PointToSquare2; int *PointToSquare4; *************** *** 64,67 **** --- 67,71 ---- roadmap_db *point_table; roadmap_db *bysquare_table; + roadmap_db *id_table; RoadMapPointContext *context; *************** *** 73,80 **** bysquare_table = roadmap_db_get_subsection (root, "bysquare"); point_table = roadmap_db_get_subsection (root, "data"); context->BySquare = (RoadMapPointBySquare *) roadmap_db_get_data (bysquare_table); ! context->Point = (RoadMapPoint *) roadmap_db_get_data (point_table); context->BySquareCount = roadmap_db_get_count (bysquare_table); --- 77,90 ---- bysquare_table = roadmap_db_get_subsection (root, "bysquare"); point_table = roadmap_db_get_subsection (root, "data"); + id_table = roadmap_db_get_subsection (root, "id"); context->BySquare = (RoadMapPointBySquare *) roadmap_db_get_data (bysquare_table); ! context->Point = (RoadMapPoint *) roadmap_db_get_data (point_table); ! ! if (id_table != NULL) { ! context->PointID = (int *) roadmap_db_get_data (id_table); ! context->PointIDCount = roadmap_db_get_count (id_table); ! } context->BySquareCount = roadmap_db_get_count (bysquare_table); *************** *** 257,261 **** int roadmap_point_db_id (int point) { ! return -1; } --- 267,277 ---- int roadmap_point_db_id (int point) { ! if ((RoadMapPointActive == NULL) || ! (RoadMapPointActive->PointID == NULL) || ! (RoadMapPointActive->PointIDCount <= point)) { ! return -1; ! } ! ! return RoadMapPointActive->PointID[point]; } |
From: Ehud S. <esh...@us...> - 2005-12-12 20:38:25
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20299 Modified Files: roadmap_gps.c roadmap_gps.h roadmap_start.c Log Message: Enforce GPS timeout (reconnect if a timeout occurs). Close GPS connection on shutdown. Index: roadmap_gps.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_gps.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_gps.c 15 Oct 2005 22:19:00 -0000 1.1.1.1 --- roadmap_gps.c 12 Dec 2005 20:38:11 -0000 1.2 *************** *** 178,181 **** --- 178,201 ---- + static void roadmap_gps_keep_alive (void) { + + if (RoadMapGpsLink.subsystem == ROADMAP_IO_INVALID) return; + + if (roadmap_gps_active ()) return; + + roadmap_log (ROADMAP_ERROR, "GPS timeout detected."); + + (*RoadMapGpsPeriodicRemove) (roadmap_gps_keep_alive); + + (*RoadMapGpsLinkRemove) (&RoadMapGpsLink); + + roadmap_io_close (&RoadMapGpsLink); + + /* Try to establish a new IO channel: */ + + roadmap_gps_open(); + } + + /* NMEA protocol support ----------------------------------------------- */ *************** *** 522,527 **** ! void roadmap_gps_register_listener (roadmap_gps_listener listener) { int i; --- 542,558 ---- + void roadmap_gps_shutdown (void) { ! if (RoadMapGpsLink.subsystem == ROADMAP_IO_INVALID) return; ! ! (*RoadMapGpsPeriodicRemove) (roadmap_gps_keep_alive); ! ! (*RoadMapGpsLinkRemove) (&RoadMapGpsLink); ! ! roadmap_io_close (&RoadMapGpsLink); ! } ! ! ! void roadmap_gps_register_listener (roadmap_gps_listener listener) { int i; *************** *** 691,694 **** --- 722,728 ---- RoadMapGpsConnectedSince = time(NULL); + RoadMapGpsLatestPositionData = time(NULL); + + (*RoadMapGpsPeriodicAdd) (roadmap_gps_keep_alive); /* Declare this IO to the GUI toolkit so that we wake up on GPS data. */ *************** *** 801,804 **** --- 835,839 ---- /* Try to establish a new IO channel: */ + (*RoadMapGpsPeriodicRemove) (roadmap_gps_keep_alive); roadmap_gps_open(); } Index: roadmap_gps.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_gps.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_gps.h 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_gps.h 12 Dec 2005 20:38:11 -0000 1.3 *************** *** 126,129 **** --- 126,131 ---- int roadmap_gps_is_nmea (void); + void roadmap_gps_shutdown (void); + #endif // INCLUDE__ROADMAP_GPS__H Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_start.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_start.c 1 Dec 2005 16:50:37 -0000 1.6 --- roadmap_start.c 12 Dec 2005 20:38:11 -0000 1.7 *************** *** 150,154 **** "A Street navigation system\n" "for Linux & UNIX" ! "\n\nEditor Plugin 0.2\n" "Ehud Shabtai\n" "esh...@gm..."); --- 150,154 ---- "A Street navigation system\n" "for Linux & UNIX" ! "\n\nEditor Plugin 0.3\n" "Ehud Shabtai\n" "esh...@gm..."); *************** *** 892,896 **** roadmap_plugin_shutdown (); roadmap_driver_shutdown (); ! roadmap_history_save(); roadmap_config_save (0); roadmap_start_save_trip (); --- 892,897 ---- roadmap_plugin_shutdown (); roadmap_driver_shutdown (); ! roadmap_gps_shutdown (); ! roadmap_history_save (); roadmap_config_save (0); roadmap_start_save_trip (); |
From: Ehud S. <esh...@us...> - 2005-12-12 20:36:52
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19827 Modified Files: roadmap_screen.c Log Message: Fix line shape check. Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_screen.c 28 Nov 2005 19:36:34 -0000 1.3 --- roadmap_screen.c 12 Dec 2005 20:36:32 -0000 1.4 *************** *** 577,580 **** --- 577,582 ---- if (first_shape_line >= 0) { + + first_shape = last_shape = -1; roadmap_shape_of_line (line, first_shape_line, last_shape_line, *************** *** 676,679 **** --- 678,683 ---- if (first_shape_line >= 0) { + + first_shape = last_shape = -1; roadmap_shape_of_line (real_line, first_shape_line, last_shape_line, |
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19429 Modified Files: buildmap_empty.c buildmap_main.c buildmap_point.c buildmap_point.h buildmap_postgres.c buildmap_range.c buildmap_street.c buildmap_street.h buildmap_tiger.c Makefile roadmap_db_street.h roadmap_geocode.c roadmap_locator.c roadmap_navigate.c roadmap_plugin.c roadmap_plugin.h roadmap_street.c roadmap_street.h roadmap_types.h Added Files: buildmap_line_route.c buildmap_line_route.h roadmap_db_line_route.h roadmap_line_route.c roadmap_line_route.h Log Message: Expand RoadMap's internal database: - Line route data: direction, cross time, speed limit. - Text to speech field. - Support left/right separation of street numbers. Index: buildmap_range.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_range.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_range.c 28 Nov 2005 19:36:34 -0000 1.2 --- buildmap_range.c 12 Dec 2005 20:35:41 -0000 1.3 *************** *** 415,424 **** BuildMapRange *record2; - int lowaddr1; - int lowaddr2; - int highaddr1; - int highaddr2; - - record1 = Range[i1/BUILDMAP_BLOCK] + (i1 % BUILDMAP_BLOCK); record2 = Range[i2/BUILDMAP_BLOCK] + (i2 % BUILDMAP_BLOCK); --- 415,418 ---- *************** *** 436,468 **** } ! if (record1->fradd < record1->toadd) { ! lowaddr1 = record1->fradd; ! highaddr1 = record1->toadd; ! } else { ! lowaddr1 = record1->toadd; ! highaddr1 = record1->fradd; ! } ! ! if (record2->fradd < record2->toadd) { ! lowaddr2 = record2->fradd; ! highaddr2 = record2->toadd; ! } else { ! lowaddr2 = record2->toadd; ! highaddr2 = record2->fradd; ! } ! ! result = lowaddr1 - lowaddr2; ! ! if (result != 0) { ! return result; ! } ! ! result = highaddr1 - highaddr2; ! ! if (result != 0) { ! return result; ! } ! ! result = record1->zip - record2->zip; if (result != 0) { --- 430,436 ---- } ! result = ! buildmap_line_get_sorted (record1->line & (~ CONTINUATION_FLAG)) - ! buildmap_line_get_sorted (record2->line & (~ CONTINUATION_FLAG)); if (result != 0) { *************** *** 470,486 **** } ! if ((record2->line & CONTINUATION_FLAG) == ! (record1->line & CONTINUATION_FLAG)) { ! ! fprintf (stderr, "range conflict:\n"); ! buildmap_range_print (stderr, i1); ! buildmap_range_print (stderr, i2); ! } ! ! if ((record2->line & CONTINUATION_FLAG) == 0) { ! return -1; /* High order 16 bits last. */ ! } ! return 1; /* Low order 16 bits first. */ } --- 438,444 ---- } ! /* Preserve the order of range insertion */ ! return i1 - i2; } Index: roadmap_types.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_types.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_types.h 15 Oct 2005 22:18:58 -0000 1.1.1.1 --- roadmap_types.h 12 Dec 2005 20:35:42 -0000 1.2 *************** *** 28,31 **** --- 28,35 ---- typedef unsigned short RoadMapString; + typedef unsigned char LineRouteFlag; + typedef unsigned char LineRouteMax; + typedef unsigned short LineRouteTime; + typedef struct { int longitude; Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 1 Dec 2005 12:26:09 -0000 1.7 --- Makefile 12 Dec 2005 20:35:41 -0000 1.8 *************** *** 114,117 **** --- 114,118 ---- roadmap_point.c \ roadmap_line.c \ + roadmap_line_route.c \ roadmap_shape.c \ roadmap_place.c \ *************** *** 208,211 **** --- 209,213 ---- buildmap_area.c \ buildmap_line.c \ + buildmap_line_route.c \ buildmap_shape.c \ buildmap_polygon.c \ Index: buildmap_tiger.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_tiger.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_tiger.c 15 Oct 2005 22:18:52 -0000 1.1.1.1 --- buildmap_tiger.c 12 Dec 2005 20:35:41 -0000 1.2 *************** *** 61,64 **** --- 61,65 ---- static BuildMapDictionary DictionaryPrefix; static BuildMapDictionary DictionaryStreet; + static BuildMapDictionary DictionaryText2Speech; static BuildMapDictionary DictionaryType; static BuildMapDictionary DictionarySuffix; *************** *** 309,312 **** --- 310,314 ---- RoadMapString fedirp; RoadMapString fename; + RoadMapString t2s; RoadMapString fetype; RoadMapString fedirs; *************** *** 329,335 **** --- 331,340 ---- DictionaryPrefix = buildmap_dictionary_open ("prefix"); DictionaryStreet = buildmap_dictionary_open ("street"); + DictionaryText2Speech = buildmap_dictionary_open ("text2speech"); DictionaryType = buildmap_dictionary_open ("type"); DictionarySuffix = buildmap_dictionary_open ("suffix"); + t2s = buildmap_dictionary_add (DictionaryText2Speech, "", 0); + data = buildmap_tiger_read (source, ".RT1", verbose, &size); if (data == NULL) return; *************** *** 384,389 **** ! from_point = buildmap_point_add (frlong, frlat); ! to_point = buildmap_point_add (tolong, tolat); line = buildmap_line_add (tlid, cfcc, from_point, to_point); --- 389,394 ---- ! from_point = buildmap_point_add (frlong, frlat, -1); ! to_point = buildmap_point_add (tolong, tolat, -1); line = buildmap_line_add (tlid, cfcc, from_point, to_point); *************** *** 393,397 **** street = buildmap_street_add ! (cfcc, fedirp, fename, fetype, fedirs, line); if ((zipl > 0) || (zipr > 0)) { --- 398,402 ---- street = buildmap_street_add ! (cfcc, fedirp, fename, fetype, fedirs, t2s, line); if ((zipl > 0) || (zipr > 0)) { Index: roadmap_geocode.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_geocode.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_geocode.c 15 Oct 2005 22:18:56 -0000 1.1.1.1 --- roadmap_geocode.c 12 Dec 2005 20:35:41 -0000 1.2 *************** *** 132,136 **** if (range_count > 0) { ! street_number[i] = ranges[0].min; for (k = 1; k < range_count; ++k) { --- 132,136 ---- if (range_count > 0) { ! street_number[i] = ranges[0].fradd; for (k = 1; k < range_count; ++k) { *************** *** 143,147 **** blocks[count] = blocks[i]; ranges[count] = ranges[k]; ! street_number[count] = ranges[count].min; count += 1; } --- 143,147 ---- blocks[count] = blocks[i]; ranges[count] = ranges[k]; ! street_number[count] = ranges[count].fradd; count += 1; } --- NEW FILE: buildmap_line_route.h --- /* buildmap_line_route.h - Build a line route table * * LICENSE: * * Copyright 2005 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_LINE_ROUTE__H_ #define _BUILDMAP_LINE_ROUTE__H_ #include "roadmap_db_line_route.h" void buildmap_line_route_initialize (void); int buildmap_line_route_add (unsigned char from_flags, unsigned char to_flags, unsigned char from_max_speed, unsigned char to_max_speed, unsigned short from_cross_time, unsigned short to_cross_time, int line); void buildmap_line_route_sort (void); int buildmap_line_route_count (void); void buildmap_line_route_save (void); void buildmap_line_route_summary (void); void buildmap_line_route_reset (void); #endif // _BUILDMAP_LINE_ROUTE__H_ Index: buildmap_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_point.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_point.c 28 Nov 2005 19:36:34 -0000 1.2 --- buildmap_point.c 12 Dec 2005 20:35:41 -0000 1.3 *************** *** 61,64 **** --- 61,65 ---- int longitude; int latitude; + int db_id; int sorted; int squareid; /* Before sorting. */ *************** *** 99,103 **** ! int buildmap_point_add (int longitude, int latitude) { int i; --- 100,104 ---- ! int buildmap_point_add (int longitude, int latitude, int db_id) { int i; *************** *** 145,151 **** this_point->longitude = longitude; ! this_point->latitude = latitude; ! this_point->sorted = -1; ! this_point->square = -1; --- 146,153 ---- this_point->longitude = longitude; ! this_point->latitude = latitude; ! this_point->db_id = db_id; ! this_point->sorted = -1; ! this_point->square = -1; *************** *** 342,345 **** --- 344,348 ---- BuildMapPoint *one_point; RoadMapPoint *db_points; + int *db_ids; RoadMapSortedList *db_bysquare; *************** *** 347,350 **** --- 350,354 ---- buildmap_db *root; buildmap_db *table_data; + buildmap_db *table_id; buildmap_db *table_bysquare; *************** *** 358,361 **** --- 362,368 ---- (root, "data", PointCount, sizeof(RoadMapPoint)); + table_id = buildmap_db_add_child + (root, "id", PointCount, sizeof(int)); + table_bysquare = buildmap_db_add_child (root, *************** *** 365,368 **** --- 372,376 ---- db_points = (RoadMapPoint *) buildmap_db_get_data (table_data); + db_ids = (int *) buildmap_db_get_data (table_id); db_bysquare = (RoadMapSortedList *) buildmap_db_get_data (table_bysquare); *************** *** 391,394 **** --- 399,404 ---- db_points[i].latitude = (unsigned short) (one_point->latitude - reference_latitude); + + db_ids[i] = one_point->db_id; } } --- NEW FILE: buildmap_line_route.c --- /* buildmap_line_route.c - Build a line route table * * LICENSE: * * Copyright 2005 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 * * SYNOPSYS: * * void buildmap_line_route_initialize (void); * int buildmap_line_route_add * (unsigned char from_flags, * unsigned char to_flags, * unsigned char from_max_speed, * unsigned char to_max_speed, * unsigned short from_cross_time, * unsigned short to_cross_time, * int line); * void buildmap_line_route_sort (void); * int buildmap_line_route_count (void); * void buildmap_line_route_save (void); * void buildmap_line_route_summary (void); * void buildmap_line_route_reset (void); * * This is a temporary scheme (no space optimizations) */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap_db_line_route.h" #include "roadmap_hash.h" #include "buildmap.h" #include "buildmap_line_route.h" struct buildmap_line_route_struct { RoadMapLineRoute record; int line; }; typedef struct buildmap_line_route_struct BuildMapRoute; static int RoutesCount = 0; static BuildMapRoute *Routes[BUILDMAP_BLOCK] = {NULL}; static int RouteAddCount = 0; void buildmap_line_route_initialize (void) { RouteAddCount = 0; RoutesCount = 0; } int buildmap_line_route_add (unsigned char from_flags, unsigned char to_flags, unsigned char from_max_speed, unsigned char to_max_speed, unsigned short from_cross_time, unsigned short to_cross_time, int line) { int block; int offset; BuildMapRoute *this_route; RouteAddCount += 1; block = line / BUILDMAP_BLOCK; offset = line % BUILDMAP_BLOCK; if (Routes[block] == NULL) { /* We need to add a new block to the table. */ Routes[block] = calloc (BUILDMAP_BLOCK, sizeof(BuildMapRoute)); if (Routes[block] == NULL) { buildmap_fatal (0, "no more memory"); } } this_route = Routes[block] + offset; this_route->record.from_flags = from_flags; this_route->record.to_flags = to_flags; this_route->record.from_max_speed = from_max_speed; this_route->record.to_max_speed = to_max_speed; this_route->record.to_cross_time = to_cross_time; this_route->record.from_cross_time = from_cross_time; this_route->line = line; if (line >= RoutesCount) RoutesCount = line + 1; return RoutesCount; } void buildmap_line_route_sort (void) {} void buildmap_line_route_save (void) { int i; BuildMapRoute *one_route; RoadMapLineRoute *db_route; buildmap_db *root; buildmap_db *table_data; buildmap_info ("saving line route..."); root = buildmap_db_add_section (NULL, "line_route"); if (root == NULL) buildmap_fatal (0, "Can't add a new section"); table_data = buildmap_db_add_child (root, "data", RoutesCount, sizeof(RoadMapLineRoute)); db_route = (RoadMapLineRoute *) buildmap_db_get_data (table_data); for (i = 0; i < RoutesCount; i++) { if (Routes[i/BUILDMAP_BLOCK] == NULL) { memset (&db_route[i], 0, sizeof (RoadMapLineRoute)); } else { one_route = Routes[i/BUILDMAP_BLOCK] + (i % BUILDMAP_BLOCK); db_route[i] = one_route->record; } } } void buildmap_line_route_summary (void) { fprintf (stderr, "-- line route table statistics: %d lines, %d bytes used\n", RoutesCount, RoutesCount * sizeof(RoadMapLineRoute)); } void buildmap_line_route_reset (void) { int i; for (i = 0; i < BUILDMAP_BLOCK; i++) { if (Routes[i] != NULL) { free (Routes[i]); Routes[i] = NULL; } } RoutesCount = 0; RouteAddCount = 0; } Index: roadmap_navigate.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_navigate.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_navigate.c 28 Nov 2005 19:36:34 -0000 1.3 --- roadmap_navigate.c 12 Dec 2005 20:35:42 -0000 1.4 *************** *** 34,37 **** --- 34,38 ---- #include "roadmap_message.h" #include "roadmap_line.h" + #include "roadmap_line_route.h" #include "roadmap_square.h" #include "roadmap_street.h" *************** *** 234,249 **** } ! //TODO define CAR const ! #ifndef _WIN32 ! #warning implement ! #endif ! //line_direction = roadmap_plugin_get_direction (line, 0x001); ! line_direction = 1; ! if ((line_direction == 0) || (line_direction == 3)) { symetric = 1; } ! if (line_direction <= 1) { tracked->direction = roadmap_math_azymuth (&line->from, &line->to); } else { --- 235,247 ---- } ! line_direction = ! roadmap_plugin_get_direction (&line->line, ROUTE_CAR_ALLOWED); ! if ((line_direction == ROUTE_DIRECTION_NONE) || ! (line_direction == ROUTE_DIRECTION_ANY)) { symetric = 1; } ! if (symetric || (line_direction == ROUTE_DIRECTION_WITH_LINE)) { tracked->direction = roadmap_math_azymuth (&line->from, &line->to); } else { --- NEW FILE: roadmap_db_line_route.h --- /* roadmap_db_line_route.h - the format of a line's route data * * LICENSE: * * Copyright 2005 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 * * SYNOPSYS: * * RoadMap's lines route data is described by the following table: * * line_route for each line its direction and cross time and allowed speed are specified */ #ifndef _ROADMAP_DB_LINE_ROUTE__H_ #define _ROADMAP_DB_LINE_ROUTE__H_ #include "roadmap_types.h" #define ROUTE_CAR_ALLOWED 0x1 typedef struct { /* table line_route */ unsigned char from_flags; unsigned char to_flags; unsigned char from_max_speed; unsigned char to_max_speed; unsigned short from_cross_time; unsigned short to_cross_time; } RoadMapLineRoute; #endif // _ROADMAP_DB_LINE_ROUTE__H_ Index: buildmap_point.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_point.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_point.h 15 Oct 2005 22:19:01 -0000 1.1.1.1 --- buildmap_point.h 12 Dec 2005 20:35:41 -0000 1.2 *************** *** 26,30 **** void buildmap_point_initialize (void); ! int buildmap_point_add (int longitude, int latitude); void buildmap_point_sort (void); --- 26,30 ---- void buildmap_point_initialize (void); ! int buildmap_point_add (int longitude, int latitude, int id); void buildmap_point_sort (void); Index: buildmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** buildmap_main.c 1 Dec 2005 12:23:16 -0000 1.4 --- buildmap_main.c 12 Dec 2005 20:35:41 -0000 1.5 *************** *** 43,46 **** --- 43,47 ---- #include "buildmap_range.h" #include "buildmap_line.h" + #include "buildmap_line_route.h" #include "buildmap_point.h" #include "buildmap_shape.h" *************** *** 160,163 **** --- 161,165 ---- buildmap_range_initialize(); buildmap_line_initialize(); + buildmap_line_route_initialize(); buildmap_polygon_initialize(); buildmap_shape_initialize(); *************** *** 171,174 **** --- 173,177 ---- buildmap_line_sort (); + buildmap_line_route_sort (); buildmap_street_sort (); buildmap_range_sort (); *************** *** 198,201 **** --- 201,205 ---- buildmap_square_save (); buildmap_line_save (); + buildmap_line_route_save (); buildmap_point_save (); buildmap_shape_save (); *************** *** 215,218 **** --- 219,223 ---- buildmap_square_reset (); buildmap_line_reset (); + buildmap_line_route_reset (); buildmap_point_reset (); buildmap_shape_reset (); *************** *** 273,276 **** --- 278,282 ---- buildmap_street_summary (); buildmap_line_summary (); + buildmap_line_route_summary (); buildmap_range_summary (); buildmap_shape_summary (); Index: roadmap_plugin.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_plugin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_plugin.h 30 Nov 2005 08:07:40 -0000 1.2 --- roadmap_plugin.h 12 Dec 2005 20:35:42 -0000 1.3 *************** *** 143,146 **** --- 143,148 ---- int max); + typedef int (*plugin_line_route_direction) (PluginLine *line, int who); + typedef void (*plugin_shutdown) (void); *************** *** 159,162 **** --- 161,165 ---- plugin_adjust_layer_hook adjust_layer; plugin_get_closest_func get_closest; + plugin_line_route_direction route_direction; plugin_shutdown shutdown; *************** *** 198,201 **** --- 201,206 ---- int max); + int roadmap_plugin_get_direction (PluginLine *line, int who); + void roadmap_plugin_shutdown (void); Index: roadmap_plugin.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_plugin.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_plugin.c 30 Nov 2005 08:07:40 -0000 1.2 --- roadmap_plugin.c 12 Dec 2005 20:35:42 -0000 1.3 *************** *** 30,33 **** --- 30,34 ---- #include "roadmap.h" #include "roadmap_line.h" + #include "roadmap_line_route.h" #include "roadmap_locator.h" #include "roadmap_street.h" *************** *** 367,371 **** } ! if (hooks->get_street != NULL) { return (*hooks->get_street_full_name) (line); } --- 368,372 ---- } ! if (hooks->get_street_full_name != NULL) { return (*hooks->get_street_full_name) (line); } *************** *** 386,390 **** props->address = roadmap_street_get_street_address (&rm_properties); props->street = roadmap_street_get_street_name (&rm_properties); ! props->street_t2s = ""; props->city = roadmap_street_get_city_name (&rm_properties); return; --- 387,391 ---- props->address = roadmap_street_get_street_address (&rm_properties); props->street = roadmap_street_get_street_name (&rm_properties); ! props->street_t2s = roadmap_street_get_street_t2s (&rm_properties); props->city = roadmap_street_get_city_name (&rm_properties); return; *************** *** 405,409 **** } ! if (hooks->get_street != NULL) { (*hooks->get_street_properties) (line, props); } --- 406,410 ---- } ! if (hooks->get_street_properties != NULL) { (*hooks->get_street_properties) (line, props); } *************** *** 474,477 **** --- 475,504 ---- + int roadmap_plugin_get_direction (PluginLine *line, int who) { + + if (line->plugin_id == ROADMAP_PLUGIN_ID) { + + return roadmap_line_route_get_direction (line->line_id, who); + + } else { + RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); + + if (hooks == NULL) { + roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", + line->plugin_id); + + return 0; + } + + if (hooks->route_direction != NULL) { + return (*hooks->route_direction) (line, who); + } + + return 0; + } + + } + + void roadmap_plugin_shutdown (void) { Index: buildmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_street.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_street.c 28 Nov 2005 19:36:34 -0000 1.2 --- buildmap_street.c 12 Dec 2005 20:35:41 -0000 1.3 *************** *** 96,99 **** --- 96,100 ---- RoadMapString fetype, RoadMapString fedirs, + RoadMapString t2s, int line) { *************** *** 166,169 **** --- 167,171 ---- this_street->record.fetype = fetype; this_street->record.fedirs = fedirs; + this_street->record.t2s = t2s; this_street->cfcc = cfcc; *************** *** 233,237 **** this_street = Street[street/BUILDMAP_BLOCK] + (street % BUILDMAP_BLOCK); ! fprintf (file, "%s %s %s (%s)", buildmap_dictionary_get (buildmap_dictionary_open("prefix"), --- 235,239 ---- this_street = Street[street/BUILDMAP_BLOCK] + (street % BUILDMAP_BLOCK); ! fprintf (file, "%s %s (%s) %s (%s)", buildmap_dictionary_get (buildmap_dictionary_open("prefix"), *************** *** 241,244 **** --- 243,249 ---- this_street->record.fename), buildmap_dictionary_get + (buildmap_dictionary_open("t2s"), + this_street->record.fename), + buildmap_dictionary_get (buildmap_dictionary_open("suffix"), this_street->record.fedirs), Index: buildmap_postgres.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_postgres.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_postgres.c 1 Dec 2005 12:23:16 -0000 1.1 --- buildmap_postgres.c 12 Dec 2005 20:35:41 -0000 1.2 *************** *** 53,56 **** --- 53,57 ---- #include "buildmap_point.h" #include "buildmap_line.h" + #include "buildmap_line_route.h" #include "buildmap_street.h" #include "buildmap_range.h" *************** *** 65,75 **** /* ROADS */ ! static const char *roads_sql = "SELECT segments.id AS id, AsText(segments.the_geom) AS the_geom, segments.type AS layer, streets.name FROM segments LEFT JOIN streets ON segments.street_id == streets.id;"; ! ! static const char *country_borders_sql = "SELECT ogc_fid AS id, AsText(wkb_geometry) AS the_geom FROM boundaries;"; ! static const char *water_sql = "SELECT ogc_fid AS id, AsText(wkb_geometry) AS the_geom FROM water;"; static BuildMapDictionary DictionaryPrefix; static BuildMapDictionary DictionaryStreet; static BuildMapDictionary DictionaryType; static BuildMapDictionary DictionarySuffix; --- 66,77 ---- /* ROADS */ ! static const char *roads_sql = "SELECT segments.id AS id, AsText(segments.the_geom) AS the_geom, segments.road_type AS layer, segments.from_node AS from_node_id, segments.to_node AS to_node_id, streets.name AS street_name, streets.text2speech as text2speech, cities.name as city_name FROM segments LEFT JOIN streets ON segments.street_id = streets.id LEFT JOIN cities ON streets.city_id = cities.id;"; ! static const char *roads_route_sql = "SELECT segments.id AS id, segments.from_car_allowed AS from_car_allowed, segments.to_car_allowed AS to_car_allowed, segments.from_max_speed AS from_max_speed, segments.to_max_speed AS to_max_speed, segments.from_cross_time AS from_cross_time, segments.to_cross_time AS to_cross_time FROM segments;"; ! static const char *country_borders_sql = "SELECT id AS id, AsText(the_geom) AS the_geom FROM boundaries;"; ! static const char *water_sql = "SELECT id AS id, AsText(the_geom) AS the_geom FROM water;"; static BuildMapDictionary DictionaryPrefix; static BuildMapDictionary DictionaryStreet; + static BuildMapDictionary DictionaryText2Speech; static BuildMapDictionary DictionaryType; static BuildMapDictionary DictionarySuffix; *************** *** 95,99 **** ! static int type2layer (const char *type) { return ROADMAP_ROAD_STREET; --- 97,101 ---- ! static int pg2layer (int layer) { return ROADMAP_ROAD_STREET; *************** *** 204,208 **** ! static void buildmap_postgres_read_borders_lines (int verbose) { int irec; --- 206,210 ---- ! static void buildmap_postgres_read_roads_lines (int verbose) { int irec; *************** *** 210,213 **** --- 212,217 ---- int line; + int street; + int zip; int tlid; int frlong; *************** *** 217,224 **** int from_point; int to_point; PGresult *db_result; ! db_result = PQexec(hPGConn, country_borders_sql); if (!db_result_ok (db_result)) { --- 221,243 ---- int from_point; int to_point; + int from_node_id; + int to_node_id; + RoadMapString fedirp; + RoadMapString fename; + RoadMapString t2s; + RoadMapString fetype; + RoadMapString fedirs; + RoadMapString city; + + DictionaryPrefix = buildmap_dictionary_open ("prefix"); + DictionaryStreet = buildmap_dictionary_open ("street"); + DictionaryText2Speech = buildmap_dictionary_open ("text2speech"); + DictionaryType = buildmap_dictionary_open ("type"); + DictionarySuffix = buildmap_dictionary_open ("suffix"); + DictionaryCity = buildmap_dictionary_open ("city"); PGresult *db_result; ! db_result = PQexec(hPGConn, roads_sql); if (!db_result_ok (db_result)) { *************** *** 237,248 **** float *lat_arr; int num_points; buildmap_set_line (irec); ! tlid = BordersTlidStart + atoi(PQgetvalue(db_result, irec, 0)); num_points = decode_line_string ! (PQgetvalue(db_result, irec, 1), &lon_arr, &lat_arr); frlong = lon_arr[0] * 1000000.0; --- 256,269 ---- float *lat_arr; int num_points; + int layer; + int column = 0; buildmap_set_line (irec); ! tlid = atoi(PQgetvalue(db_result, irec, column++)); num_points = decode_line_string ! (PQgetvalue(db_result, irec, column++), &lon_arr, &lat_arr); frlong = lon_arr[0] * 1000000.0; *************** *** 252,259 **** tolat = lat_arr[num_points-1] * 1000000.0; ! from_point = buildmap_point_add (frlong, frlat); ! to_point = buildmap_point_add (tolong, tolat); ! line = buildmap_line_add (tlid, BuildMapBorders, from_point, to_point); free (lon_arr); --- 273,313 ---- tolat = lat_arr[num_points-1] * 1000000.0; ! layer = pg2layer (atoi(PQgetvalue(db_result, irec, column++))); ! from_node_id = atoi(PQgetvalue(db_result, irec, column++)); ! to_node_id = atoi(PQgetvalue(db_result, irec, column++)); ! ! fedirp = str2dict (DictionaryPrefix, ""); ! ! fename = ! str2dict (DictionaryStreet, PQgetvalue(db_result, irec, column++)); ! t2s = ! str2dict (DictionaryText2Speech, PQgetvalue(db_result, irec, column++)); ! ! fetype = str2dict (DictionaryPrefix, ""); ! fedirs = str2dict (DictionaryPrefix, ""); ! ! from_point = buildmap_point_add (frlong, frlat, from_node_id); ! to_point = buildmap_point_add (tolong, tolat, to_node_id); ! ! line = buildmap_line_add (tlid, layer, from_point, to_point); ! ! street = buildmap_street_add ! (layer, fedirp, fename, fetype, fedirs, t2s, line); ! city = ! str2dict (DictionaryCity, PQgetvalue(db_result, irec, column++)); ! zip = buildmap_zip_add (0, 0, 0); ! ! if (!city) { ! ! buildmap_range_add_no_address (line, street); ! } else { ! ! buildmap_range_add ! (line, street, 1, 11, zip, city); ! ! buildmap_range_add ! (line, street, 2, 12, zip, city); ! } free (lon_arr); *************** *** 268,272 **** ! static void buildmap_postgres_read_borders_shape_points (int verbose) { int irec; --- 322,389 ---- ! static void buildmap_postgres_read_roads_route (int verbose) { ! ! int irec; ! int record_count; ! ! int line; ! int tlid; ! ! unsigned char from_car_allowed; ! unsigned char to_car_allowed; ! unsigned char from_max_speed; ! unsigned char to_max_speed; ! unsigned short from_cross_time; ! unsigned short to_cross_time; ! ! PGresult *db_result; ! ! db_result = PQexec(hPGConn, roads_route_sql); ! ! if (!db_result_ok (db_result)) { ! ! fprintf ! (stderr, "Can't query database: %s\n", PQerrorMessage(hPGConn)); ! PQfinish(hPGConn); ! exit(-1); ! } ! ! record_count = PQntuples(db_result); ! ! for (irec=0; irec<record_count; irec++) { ! ! int column = 0; ! ! buildmap_set_line (irec); ! ! tlid = atoi(PQgetvalue(db_result, irec, column++)); ! ! from_car_allowed = ! !strcmp("t", PQgetvalue(db_result, irec, column++)) ? ! ROUTE_CAR_ALLOWED: 0; ! to_car_allowed = ! !strcmp("t", PQgetvalue(db_result, irec, column++)) ? ! ROUTE_CAR_ALLOWED: 0; ! ! from_max_speed = atoi(PQgetvalue(db_result, irec, column++)); ! to_max_speed = atoi(PQgetvalue(db_result, irec, column++)); ! from_cross_time = atoi(PQgetvalue(db_result, irec, column++)); ! to_cross_time = atoi(PQgetvalue(db_result, irec, column++)); ! ! line = buildmap_line_find_sorted(tlid); ! ! buildmap_line_route_add ! (from_car_allowed, to_car_allowed, from_max_speed, to_max_speed, ! from_cross_time, to_cross_time, ! line); ! } ! ! PQclear(db_result); ! ! return; ! } ! ! ! static void buildmap_postgres_read_roads_shape_points (int verbose) { int irec; *************** *** 279,283 **** PGresult *db_result; ! db_result = PQexec(hPGConn, country_borders_sql); if (!db_result_ok (db_result)) { --- 396,400 ---- PGresult *db_result; ! db_result = PQexec(hPGConn, roads_sql); if (!db_result_ok (db_result)) { *************** *** 299,303 **** buildmap_set_line (irec); ! tlid = BordersTlidStart + atoi(PQgetvalue(db_result, irec, 0)); num_points = --- 416,420 ---- buildmap_set_line (irec); ! tlid = atoi(PQgetvalue(db_result, irec, 0)); num_points = *************** *** 334,342 **** ! static void buildmap_postgres_read_water_lines (int verbose) { int irec; int record_count; int tlid; int frlong; --- 451,460 ---- ! static void buildmap_postgres_read_borders_lines (int verbose) { int irec; int record_count; + int line; int tlid; int frlong; *************** *** 349,353 **** PGresult *db_result; ! db_result = PQexec(hPGConn, water_sql); if (!db_result_ok (db_result)) { --- 467,471 ---- PGresult *db_result; ! db_result = PQexec(hPGConn, country_borders_sql); if (!db_result_ok (db_result)) { *************** *** 361,365 **** record_count = PQntuples(db_result); - tlid = WaterTlidStart; for (irec=0; irec<record_count; irec++) { --- 479,482 ---- *************** *** 367,374 **** float *lat_arr; int num_points; - int j; buildmap_set_line (irec); num_points = decode_line_string --- 484,492 ---- float *lat_arr; int num_points; buildmap_set_line (irec); + tlid = BordersTlidStart + atoi(PQgetvalue(db_result, irec, 0)); + num_points = decode_line_string *************** *** 381,402 **** tolat = lat_arr[num_points-1] * 1000000.0; ! from_point = buildmap_point_add (frlong, frlat); ! ! for (j=1; j<num_points-1; j++) { ! ! int lon, lat; ! ! lon = lon_arr[j] * 1000000.0; ! lat = lat_arr[j] * 1000000.0; ! ! to_point = buildmap_point_add (lon, lat); ! ! buildmap_line_add (tlid++, BuildMapSea, from_point, to_point); ! from_point = to_point; ! } ! ! to_point = buildmap_point_add (tolong, tolat); ! buildmap_line_add (tlid++, BuildMapSea, from_point, to_point); free (lon_arr); --- 499,506 ---- tolat = lat_arr[num_points-1] * 1000000.0; ! from_point = buildmap_point_add (frlong, frlat, -1); ! to_point = buildmap_point_add (tolong, tolat, -1); ! line = buildmap_line_add (tlid, BuildMapBorders, from_point, to_point); free (lon_arr); *************** *** 411,415 **** ! static void buildmap_postgres_read_water_shape_points (int verbose) { int irec; --- 515,519 ---- ! static void buildmap_postgres_read_borders_shape_points (int verbose) { int irec; *************** *** 422,426 **** PGresult *db_result; ! db_result = PQexec(hPGConn, water_sql); if (!db_result_ok (db_result)) { --- 526,530 ---- PGresult *db_result; ! db_result = PQexec(hPGConn, country_borders_sql); if (!db_result_ok (db_result)) { *************** *** 442,446 **** buildmap_set_line (irec); ! tlid = WaterTlidStart + atoi(PQgetvalue(db_result, irec, 0)); num_points = --- 546,550 ---- buildmap_set_line (irec); ! tlid = BordersTlidStart + atoi(PQgetvalue(db_result, irec, 0)); num_points = *************** *** 477,480 **** --- 581,661 ---- + static void buildmap_postgres_read_water_lines (int verbose) { + + int irec; + int record_count; + + int tlid; + int frlong; + int frlat; + int tolong; + int tolat; + int from_point; + int to_point; + + PGresult *db_result; + + db_result = PQexec(hPGConn, water_sql); + + if (!db_result_ok (db_result)) { + + fprintf + (stderr, "Can't query database: %s\n", PQerrorMessage(hPGConn)); + PQfinish(hPGConn); + exit(-1); + } + + record_count = PQntuples(db_result); + + tlid = WaterTlidStart; + for (irec=0; irec<record_count; irec++) { + + float *lon_arr; + float *lat_arr; + int num_points; + int j; + + buildmap_set_line (irec); + + num_points = + decode_line_string + (PQgetvalue(db_result, irec, 1), &lon_arr, &lat_arr); + + frlong = lon_arr[0] * 1000000.0; + frlat = lat_arr[0] * 1000000.0; + + tolong = lon_arr[num_points-1] * 1000000.0; + tolat = lat_arr[num_points-1] * 1000000.0; + + from_point = buildmap_point_add (frlong, frlat, -1); + + for (j=1; j<num_points-1; j++) { + + int lon, lat; + + lon = lon_arr[j] * 1000000.0; + lat = lat_arr[j] * 1000000.0; + + to_point = buildmap_point_add (lon, lat, -1); + + buildmap_line_add (tlid++, BuildMapSea, from_point, to_point); + from_point = to_point; + } + + to_point = buildmap_point_add (tolong, tolat, -1); + + buildmap_line_add (tlid++, BuildMapSea, from_point, to_point); + + free (lon_arr); + free (lat_arr); + + } + + PQclear(db_result); + + return; + } + + static void buildmap_postgres_read_water_polygons (int verbose) { *************** *** 565,570 **** --- 746,754 ---- buildmap_postgres_read_borders_lines (verbose); buildmap_postgres_read_water_lines (verbose); + buildmap_postgres_read_roads_lines (verbose); buildmap_line_sort(); buildmap_postgres_read_borders_shape_points (verbose); + buildmap_postgres_read_roads_route (verbose); + buildmap_postgres_read_roads_shape_points (verbose); //buildmap_postgres_read_water_shape_points (verbose); buildmap_postgres_read_water_polygons (verbose); Index: buildmap_street.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_street.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_street.h 15 Oct 2005 22:18:48 -0000 1.1.1.1 --- buildmap_street.h 12 Dec 2005 20:35:41 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- RoadMapString fetype, RoadMapString fedirs, + RoadMapString t2s, int line); Index: buildmap_empty.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_empty.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_empty.c 18 Oct 2005 16:55:48 -0000 1.2 --- buildmap_empty.c 12 Dec 2005 20:35:41 -0000 1.3 *************** *** 82,89 **** points[0], points[1], points[2], points[3]); ! p1 = buildmap_point_add (points[0], points[1]); ! p2 = buildmap_point_add (points[2], points[1]); ! p3 = buildmap_point_add (points[2], points[3]); ! p4 = buildmap_point_add (points[0], points[3]); buildmap_line_add (1, cfcc, p1, p2); --- 82,89 ---- points[0], points[1], points[2], points[3]); ! p1 = buildmap_point_add (points[0], points[1], -1); ! p2 = buildmap_point_add (points[2], points[1], -1); ! p3 = buildmap_point_add (points[2], points[3], -1); ! p4 = buildmap_point_add (points[0], points[3], -1); buildmap_line_add (1, cfcc, p1, p2); Index: roadmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_street.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_street.c 28 Nov 2005 19:36:34 -0000 1.3 --- roadmap_street.c 12 Dec 2005 20:35:42 -0000 1.4 *************** *** 97,100 **** --- 97,101 ---- RoadMapDictionary RoadMapStreetPrefix; RoadMapDictionary RoadMapStreetNames; + RoadMapDictionary RoadMapText2Speech; RoadMapDictionary RoadMapStreetType; RoadMapDictionary RoadMapStreetSuffix; *************** *** 238,241 **** --- 239,243 ---- context->RoadMapStreetPrefix = NULL; context->RoadMapStreetNames = NULL; + context->RoadMapText2Speech = NULL; context->RoadMapStreetType = NULL; context->RoadMapStreetSuffix = NULL; *************** *** 325,328 **** --- 327,333 ---- this->RoadMapStreetNames = roadmap_dictionary_open ("street"); } + if (this->RoadMapText2Speech == NULL) { + this->RoadMapText2Speech = roadmap_dictionary_open ("text2speech"); + } if (this->RoadMapStreetType == NULL) { this->RoadMapStreetType = roadmap_dictionary_open ("type"); *************** *** 713,723 **** if (total >= count) return total; ! if (fradd > toadd) { ! ranges->min = toadd; ! ranges->max = fradd; ! } else { ! ranges->min = fradd; ! ranges->max = toadd; ! } ranges += 1; total += 1; --- 718,723 ---- if (total >= count) return total; ! ranges->fradd = fradd; ! ranges->toadd = toadd; ranges += 1; total += 1; *************** *** 786,790 **** position->longitude = (from.longitude + to.longitude) / 2; ! position->latitude = (from.latitude - to.latitude) / 2; } else { --- 786,790 ---- position->longitude = (from.longitude + to.longitude) / 2; ! position->latitude = (from.latitude + to.latitude) / 2; } else { *************** *** 1151,1154 **** --- 1151,1207 ---- + static int roadmap_street_check_other_side (int street, + int line, + int first_range) { + + int range_end; + RoadMapRange *range; + RoadMapRangeByStreet *by_street; + + + if (RoadMapRangeActive == NULL) return -1; + + range = RoadMapRangeActive->RoadMapAddr; + by_street = RoadMapRangeActive->RoadMapByStreet + street; + range_end = by_street->first_range + by_street->count_range; + + if (HAS_CONTINUATION ((range + first_range))) { + first_range++; + } + + first_range++; + + if (first_range >= range_end) return -1; + + if ((range[first_range].line & (~CONTINUATION_FLAG)) == (unsigned)line) { + return first_range; + } + + return -1; + } + + static void roadmap_street_extract_range (int range_index, + RoadMapStreetRange *range) { + + RoadMapRange *this_address = + &(RoadMapRangeActive->RoadMapAddr[range_index]); + + if (HAS_CONTINUATION(this_address)) { + + range->fradd = + ((int)(this_address->fradd) & 0xffff) + + (((int)(this_address[1].fradd) & 0xffff) << 16); + range->toadd = + ((int)(this_address->toadd) & 0xffff) + + (((int)(this_address[1].toadd) & 0xffff) << 16); + + } else { + + range->fradd = this_address->fradd; + range->toadd = this_address->toadd; + } + + } + static int roadmap_street_get_city (int street, int range) { *************** *** 1531,1558 **** { - RoadMapRange *this_address = - &(RoadMapRangeActive->RoadMapAddr[range_index]); ! if (HAS_CONTINUATION(this_address)) { ! ! properties->range.min = ! ((int)(this_address->fradd) & 0xffff) ! + (((int)(this_address[1].fradd) & 0xffff) << 16); ! properties->range.max = ! ((int)(this_address->toadd) & 0xffff) ! + (((int)(this_address[1].toadd) & 0xffff) << 16); } else { ! ! properties->range.min = this_address->fradd; ! properties->range.max = this_address->toadd; ! } ! ! if (properties->range.min > properties->range.max) { ! ! int tmp = properties->range.min; ! ! properties->range.min = properties->range.max; ! properties->range.max = tmp; } } --- 1584,1598 ---- { ! roadmap_street_extract_range (range_index, &properties->first_range); + range_index = + roadmap_street_check_other_side (street, line, range_index); + if (range_index != -1) { + roadmap_street_extract_range + (range_index, &properties->second_range); } else { ! properties->second_range.fradd = ! properties->second_range.toadd = -1; } } *************** *** 1578,1588 **** static char RoadMapStreetAddress [32]; ! if (properties->range.min >= properties->range.max) { return ""; } ! sprintf (RoadMapStreetAddress, ! "%d - %d", properties->range.min, properties->range.max); return RoadMapStreetAddress; --- 1618,1653 ---- static char RoadMapStreetAddress [32]; + int min; + int max; ! if (properties->first_range.fradd == -1) { return ""; } ! if (properties->first_range.fradd > properties->first_range.toadd) { ! min = properties->first_range.toadd; ! max = properties->first_range.fradd; ! } else { ! min = properties->first_range.fradd; ! max = properties->first_range.toadd; ! } ! ! if (properties->second_range.fradd != -1) { ! ! if (properties->second_range.fradd < min) { ! min = properties->second_range.fradd; ! } ! if (properties->second_range.fradd > max) { ! max = properties->second_range.fradd; ! } ! if (properties->second_range.toadd < min) { ! min = properties->second_range.toadd; ! } ! if (properties->second_range.toadd > max) { ! max = properties->second_range.toadd; ! } ! } ! ! sprintf (RoadMapStreetAddress, "%d - %d", min, max); return RoadMapStreetAddress; *************** *** 1757,1762 **** (const RoadMapStreetProperties *properties) { ! //TODO add t2s into roadmap DB ! return ""; } --- 1822,1839 ---- (const RoadMapStreetProperties *properties) { ! RoadMapStreet *this_street; ! ! if (RoadMapRangeActive->RoadMapText2Speech == NULL) return ""; ! ! if (properties->street < 0) { ! return ""; ! } ! ! this_street = ! RoadMapStreetActive->RoadMapStreets + properties->street; ! ! return ! roadmap_dictionary_get ! (RoadMapRangeActive->RoadMapText2Speech, this_street->t2s); } *************** *** 1779,1787 **** void roadmap_street_get_street_range ! (const RoadMapStreetProperties *properties, int side, int *from, int *to) { ! //FIXME find real street range numbers according to requested side ! *from = properties->range.min; ! *to = properties->range.max; } --- 1856,1872 ---- void roadmap_street_get_street_range ! (const RoadMapStreetProperties *properties, int range, int *from, int *to) { ! if (range == 1) { ! *from = properties->first_range.fradd; ! *to = properties->first_range.toadd; ! ! } else if (range == 2) { ! *from = properties->second_range.fradd; ! *to = properties->second_range.toadd; ! ! } else { ! roadmap_log (ROADMAP_ERROR, "Illegal range number: %d", range); ! } } Index: roadmap_street.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_street.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_street.h 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_street.h 12 Dec 2005 20:35:42 -0000 1.3 *************** *** 39,44 **** typedef struct { ! int min; ! int max; } RoadMapStreetRange; --- 39,44 ---- typedef struct { ! int fradd; ! int toadd; } RoadMapStreetRange; *************** *** 47,51 **** typedef struct { ! RoadMapStreetRange range; int street; --- 47,52 ---- typedef struct { ! RoadMapStreetRange first_range; ! RoadMapStreetRange second_range; int street; *************** *** 157,161 **** void roadmap_street_get_street_range ! (const RoadMapStreetProperties *properties, int side, int *from, int *to); int roadmap_street_replace --- 158,162 ---- void roadmap_street_get_street_range ! (const RoadMapStreetProperties *properties, int range, int *from, int *to); int roadmap_street_replace Index: roadmap_db_street.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_db_street.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_db_street.h 15 Oct 2005 22:18:53 -0000 1.1.1.1 --- roadmap_db_street.h 12 Dec 2005 20:35:41 -0000 1.2 *************** *** 39,42 **** --- 39,43 ---- RoadMapString fetype; RoadMapString fedirs; + RoadMapString t2s; } RoadMapStreet; --- NEW FILE: roadmap_line_route.c --- /* roadmap_line_route.c - Manage line route data * * LICENSE: * * Copyright 2005 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 * * SYNOPSYS: * * int roadmap_line_in_square (int square, int cfcc, int *first, int *last); * int roadmap_line_in_square2 (int square, int cfcc, int *first, int *last); * int roadmap_line_get_from_index2 (int index); * void roadmap_line_from (int line, RoadMapPosition *position); * void roadmap_line_to (int line, RoadMapPosition *position); * * int roadmap_line_count (void); * * These functions are used to retrieve the points that make the lines. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_dbread.h" #include "roadmap_line_route.h" static char *RoadMapLineRouteType = "RoadMapLineRouteContext"; typedef struct { char *type; RoadMapLineRoute *LineRoute; int LineRouteCount; } RoadMapLineRouteContext; static RoadMapLineRouteContext *RoadMapLineRouteActive = NULL; static void *roadmap_line_route_map (roadmap_db *root) { RoadMapLineRouteContext *context; roadmap_db *data_table; context = (RoadMapLineRouteContext *) malloc (sizeof(RoadMapLineRouteContext)); if (context == NULL) { roadmap_log (ROADMAP_ERROR, "no more memory"); return NULL; } context->type = RoadMapLineRouteType; data_table = roadmap_db_get_subsection (root, "data"); context->LineRoute = (RoadMapLineRoute *) roadmap_db_get_data (data_table); context->LineRouteCount = roadmap_db_get_count (data_table); if (roadmap_db_get_size (data_table) != context->LineRouteCount * sizeof(RoadMapLineRoute)) { roadmap_log (ROADMAP_ERROR, "invalid line route data structure"); free(context); return NULL; } return context; } static void roadmap_line_route_activate (void *context) { RoadMapLineRouteContext *line_route_context = (RoadMapLineRouteContext *) context; if ((line_route_context != NULL) && (line_route_context->type != RoadMapLineRouteType)) { roadmap_log (ROADMAP_FATAL, "invalid line route context activated"); } RoadMapLineRouteActive = line_route_context; } static void roadmap_line_route_unmap (void *context) { RoadMapLineRouteContext *line_route_context = (RoadMapLineRouteContext *) context; if (line_route_context->type != RoadMapLineRouteType) { roadmap_log (ROADMAP_FATAL, "unmapping invalid line context"); } free (line_route_context); } roadmap_db_handler RoadMapLineRouteHandler = { "line_route", roadmap_line_route_map, roadmap_line_route_activate, roadmap_line_route_unmap }; int roadmap_line_route_get_direction (int line, int who) { RoadMapLineRoute *route; if (RoadMapLineRouteActive == NULL) return 0; /* No data. */ if (RoadMapLineRouteActive->LineRouteCount <= line) return 0; route = &RoadMapLineRouteActive->LineRoute[line]; if ((route->from_flags & who) && (route->to_flags & who)) { return ROUTE_DIRECTION_ANY; } else if (!(route->from_flags & who) && !(route->to_flags & who)) { return ROUTE_DIRECTION_NONE; } else if (route->from_flags & who) { return ROUTE_DIRECTION_WITH_LINE; } else { return ROUTE_DIRECTION_AGAINST_LINE; } } int roadmap_line_route_get_flags (int line, LineRouteFlag *from, LineRouteFlag *to) { RoadMapLineRoute *route; if (RoadMapLineRouteActive == NULL) return -1; /* No data. */ if (RoadMapLineRouteActive->LineRouteCount <= line) return -1; route = &RoadMapLineRouteActive->LineRoute[line]; *from = route->from_flags; *to = route->to_flags; return 0; } int roadmap_line_route_get_speed_limit (int line, LineRouteMax *from, LineRouteMax *to) { RoadMapLineRoute *route; if (RoadMapLineRouteActive == NULL) return -1; /* No data. */ if (RoadMapLineRouteActive->LineRouteCount <= line) return -1; route = &RoadMapLineRouteActive->LineRoute[line]; *from = route->from_max_speed; *to = route->to_max_speed; return 0; } int roadmap_line_route_get_cross_times (int line, LineRouteTime *from, LineRouteTime *to) { RoadMapLineRoute *route; if (RoadMapLineRouteActive == NULL) return -1; /* No data. */ if (RoadMapLineRouteActive->LineRouteCount <= line) return -1; route = &RoadMapLineRouteActive->LineRoute[line]; *from = route->from_cross_time; *to = route->to_cross_time; return 0; } Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_locator.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_locator.c 1 Dec 2005 12:28:18 -0000 1.3 --- roadmap_locator.c 12 Dec 2005 20:35:42 -0000 1.4 *************** *** 42,45 **** --- 42,46 ---- #include "roadmap_shape.h" #include "roadmap_line.h" + #include "roadmap_line_route.h" #include "roadmap_street.h" #include "roadmap_polygon.h" *************** *** 104,107 **** --- 105,111 ---- RoadMapCountyModel = roadmap_db_register + (RoadMapCountyModel, "line_route", &RoadMapLineRouteHandler); + RoadMapCountyModel = + roadmap_db_register (RoadMapCountyModel, "point", &RoadMapPointHandler); RoadMapCountyModel = --- NEW FILE: roadmap_line_route.h --- /* roadmap_line_route.h - Manage the line route data. * * LICENSE: * * Copyright 2005 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 _ROADMAP_LINE_ROUTE__H_ #define _ROADMAP_LINE_ROUTE__H_ #include "roadmap_types.h" #include "roadmap_dbread.h" #include "roadmap_db_line_route.h" #define ROUTE_DIRECTION_NONE 0 #define ROUTE_DIRECTION_WITH_LINE 1 #define ROUTE_DIRECTION_AGAINST_LINE 2 #define ROUTE_DIRECTION_ANY 3 int roadmap_line_route_get_direction (int line, int who); int roadmap_line_route_get_flags (int line, LineRouteFlag *from, LineRouteFlag *to); int roadmap_line_route_get_speed_limit (int line, LineRouteMax *from, LineRouteMax *to); int roadmap_line_route_get_cross_times (int line, LineRouteTime *from, LineRouteTime *to); extern roadmap_db_handler RoadMapLineRouteHandler; #endif // _ROADMAP_LINE_ROUTE__H_ |
From: Pascal F M. <pas...@us...> - 2005-12-11 18:19:27
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12304 Modified Files: roadmap_layer.c Log Message: Avoid crashing if something is wrong Index: roadmap_layer.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_layer.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_layer.c 27 Nov 2005 05:58:30 -0000 1.9 --- roadmap_layer.c 11 Dec 2005 18:19:08 -0000 1.10 *************** *** 180,183 **** --- 180,185 ---- + if (RoadMapLayerCurrentClass == NULL) return 0; + --size; /* To match our boundary check. */ *************** *** 207,210 **** --- 209,214 ---- + if (RoadMapLayerCurrentClass == NULL) return 0; + --size; /* To match our boundary check. */ *************** *** 235,238 **** --- 239,245 ---- RoadMapLayer *layer; + + if (RoadMapLayerCurrentClass == NULL) return; + for (i = RoadMapLayerCurrentClass->lines_count - 1; i >= 0; --i) { *************** *** 314,318 **** RoadMapPen roadmap_layer_get_pen (int layer, unsigned int pen_index) { ! int total = RoadMapLayerCurrentClass->polygons_count + RoadMapLayerCurrentClass->lines_count; --- 321,329 ---- RoadMapPen roadmap_layer_get_pen (int layer, unsigned int pen_index) { ! int total; ! ! if (RoadMapLayerCurrentClass == NULL) return NULL; ! ! total = RoadMapLayerCurrentClass->polygons_count + RoadMapLayerCurrentClass->lines_count; |
From: Pascal F M. <pas...@us...> - 2005-12-11 18:04:54
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7928 Modified Files: buildmap_polygon.c Log Message: Better description of how this module works Index: buildmap_polygon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_polygon.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** buildmap_polygon.c 14 Nov 2005 07:01:38 -0000 1.3 --- buildmap_polygon.c 11 Dec 2005 18:04:46 -0000 1.4 *************** *** 24,30 **** * * void buildmap_polygon_initialize (void); - * int buildmap_polygon_add (int landid, RoadMapString cenid, int polyid); * int buildmap_polygon_add_landmark * (int landid, char cfcc, RoadMapString name); * int buildmap_polygon_add_line * (RoadMapString cenid, int polyid, int tlid, int side); --- 24,30 ---- * * void buildmap_polygon_initialize (void); * int buildmap_polygon_add_landmark * (int landid, char cfcc, RoadMapString name); + * int buildmap_polygon_add (int landid, RoadMapString cenid, int polyid); * int buildmap_polygon_add_line * (RoadMapString cenid, int polyid, int tlid, int side); *************** *** 40,43 **** --- 40,78 ---- * (2) produce the index data to serve as the basis for a fast * search mechanism for streets in roadmap. + * + * This module considers a single area to be described by a unique landmark + * ID. Each area can be made of multiple polygons, but the name of the area + * as well as the layer to be used is the same for all the polygons and + * is defined with the landmark. + * + * Thus buildmap_polygon_add_landmark() should be called before + * buildmap_polygon_add(), which should be called before + * buildmap_polygon_add_line(). + * + * The contour of each polygon is defined by a succession of lines. The + * map file will be filled with the lines in an order that is convenient + * for drawing. Imagine you would walk around the area following the + * polygon countour: you would then walk over all lines in a certain + * order: this is the sorting order there. + * + * Of course this order can lead to two solutions: either you walk clockwise + * or counter clockwise. The code here choose on way arbitrarily. However + * you can provide the lines in direction, but you must tell which one it is. + * The direction is defined by the order of the "from" and "to" points: if + * you were to walk from "from" to "to", would you have the area's polygon + * on you right or on your left? That information is the purpose of the "side" + * parameter. + * + * Note that polygons must be loaded before the lines. This is because a + * line must be loaded if it is part of a polygon, even if its layer is + * normally ignored (a line may not belong to the same layer as the polygon: + * think of a city park which half bounding lines are streets and the other + * half are property lines--RoadMap would normally not load property lines). + * + * The function buildmap_polygon_use_line() tells the line loading logic + * if it must load the line anyway. + * + * The other functions are generic functions, same as for the other table + * modules. */ |
From: Paul F. <pg...@us...> - 2005-12-08 21:14:04
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30069/src Modified Files: roadmap_landmark.c roadmap_landmark.h roadmap_start.c roadmap_track.c roadmap_trip.c Log Message: changes to improve the management of the landmark and current track files, especially their default values. Index: roadmap_landmark.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_landmark.c 8 Dec 2005 13:21:32 -0000 1.3 --- roadmap_landmark.c 8 Dec 2005 21:13:55 -0000 1.4 *************** *** 109,123 **** } void roadmap_landmark_save(void) { const char *name; if (!RoadMapLandmarkModified) return; ! name = roadmap_config_get (&RoadMapConfigLandmarkName); ! if (name && name[0]) { ! roadmap_gpx_write_waypoints(roadmap_path_trips(), name, ! &RoadMapLandmarkHead); } --- 109,141 ---- } + static const char *roadmap_landmark_filename(int *defaulted) { + const char *name; + name = roadmap_config_get (&RoadMapConfigLandmarkName); + if (!name[0]) { + name = "landmarks.gpx"; + *defaulted = 1; + } else { + *defaulted = 0; + } + return name; + } + + void roadmap_landmark_save(void) { const char *name; + int defaulted, ret; if (!RoadMapLandmarkModified) return; ! name = roadmap_landmark_filename (&defaulted); ! ret = roadmap_gpx_write_waypoints(roadmap_path_trips(), name, ! &RoadMapLandmarkHead); ! ! if (ret == 0) return; ! ! if (defaulted) { ! roadmap_config_set (&RoadMapConfigLandmarkName, name); } *************** *** 132,135 **** --- 150,155 ---- int ret; + if (!name || !name[0]) return; + if (! roadmap_path_is_full_path (name)) trip_path = roadmap_path_trips (); *************** *** 176,184 **** const char *path = roadmap_path_trips(); queue tmp_waypoint_list; ! int ret; ! name = roadmap_config_get (&RoadMapConfigLandmarkName); ! if ( ! roadmap_file_exists (path, name)) return; QUEUE_INIT(&tmp_waypoint_list); --- 196,204 ---- const char *path = roadmap_path_trips(); queue tmp_waypoint_list; ! int defaulted, ret; ! name = roadmap_landmark_filename (&defaulted); ! if ( ! roadmap_file_exists (path, name) && defaulted) return; QUEUE_INIT(&tmp_waypoint_list); *************** *** 191,194 **** --- 211,218 ---- } + if (defaulted) { + roadmap_config_set (&RoadMapConfigLandmarkName, name); + } + waypt_flush_queue (&RoadMapLandmarkHead); *************** *** 204,212 **** roadmap_config_declare ! ("preferences", &RoadMapConfigLandmarkName, "landmarks.gpx"); QUEUE_INIT(&RoadMapLandmarkHead); - roadmap_landmark_load(); - } --- 228,234 ---- roadmap_config_declare ! ("preferences", &RoadMapConfigLandmarkName, ""); QUEUE_INIT(&RoadMapLandmarkHead); } Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** roadmap_trip.c 7 Dec 2005 18:57:35 -0000 1.42 --- roadmap_trip.c 8 Dec 2005 21:13:55 -0000 1.43 *************** *** 979,982 **** --- 979,984 ---- // RoadMapTripModified should be checked, and the user // should confirm the action. + // ...or, we should do the write, particularly if we're changing + // trips. } *************** *** 1857,1863 **** QUEUE_INIT(&RoadMapTripQuickRoute.waypoint_list); - roadmap_track_initialize(); - roadmap_landmark_initialize(); - for (focal = RoadMapTripFocalPoints; focal->id != NULL; focal++) { --- 1859,1862 ---- *************** *** 1939,1943 **** trip_path = roadmap_path_trips (); ! roadmap_log (ROADMAP_WARNING, "roadmap_trip_load '%s'", name); QUEUE_INIT(&tmp_waypoint_list); --- 1938,1942 ---- trip_path = roadmap_path_trips (); ! roadmap_log (ROADMAP_DEBUG, "roadmap_trip_load '%s'", name); QUEUE_INIT(&tmp_waypoint_list); *************** *** 2027,2038 **** } ! if (! roadmap_path_is_full_path (name)) trip_path = roadmap_path_trips (); ! /* Always save if user-initiated. */ ! if (!force && !RoadMapTripModified) ! return; ! roadmap_log (ROADMAP_WARNING, "trip save_forced, or modified '%s'", name); roadmap_gpx_write_file (trip_path, name, &RoadMapTripWaypointHead, --- 2026,2037 ---- } ! if (! roadmap_path_is_full_path (name)) { trip_path = roadmap_path_trips (); + } ! if (!force && !RoadMapTripModified) return; ! /* Always save if user-initiated. */ ! roadmap_log (ROADMAP_DEBUG, "trip save_forced, or modified '%s'", name); roadmap_gpx_write_file (trip_path, name, &RoadMapTripWaypointHead, Index: roadmap_track.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_track.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_track.c 8 Dec 2005 07:18:44 -0000 1.3 --- roadmap_track.c 8 Dec 2005 21:13:55 -0000 1.4 *************** *** 268,280 **** } void roadmap_track_autosave(void) { const char *name; if (!RoadMapTrackModified) return; ! name = roadmap_config_get (&RoadMapConfigTrackName); ! roadmap_gpx_write_track(roadmap_path_trips(), name, RoadMapTrack); RoadMapTrackModified = 0; --- 268,303 ---- } + static const char *roadmap_track_filename(int *defaulted) { + const char *name; + name = roadmap_config_get (&RoadMapConfigTrackName); + if (!name[0]) { + name = "currenttrack.gpx"; + *defaulted = 1; + } else { + if (strcasecmp(name, "NONE") == 0) { + return NULL; + } + *defaulted = 0; + } + return name; + } + void roadmap_track_autosave(void) { const char *name; + int defaulted, ret; if (!RoadMapTrackModified) return; ! name = roadmap_track_filename (&defaulted); ! if (name == NULL) return; ! ret = roadmap_gpx_write_track(roadmap_path_trips(), name, RoadMapTrack); ! ! if (ret == 0) return; ! ! if (defaulted) { ! roadmap_config_set (&RoadMapConfigTrackName, name); ! } RoadMapTrackModified = 0; *************** *** 286,299 **** const char *name; const char *path = roadmap_path_trips(); ! name = roadmap_config_get (&RoadMapConfigTrackName); ! if (name[0] == 0) { ! /* Use the default file, if it exists. */ ! name = "current_track.gpx"; ! if (! roadmap_file_exists(path, name)) return; /* not an error. */ } - roadmap_gpx_read_one_track(path, name, &RoadMapTrack); RoadMapTrackModified = 0; --- 309,327 ---- const char *name; const char *path = roadmap_path_trips(); + int defaulted, ret; ! name = roadmap_track_filename (&defaulted); ! if (name == NULL) return; ! if (! roadmap_file_exists(path, name)) return; /* not an error. */ ! ! ret = roadmap_gpx_read_one_track(path, name, &RoadMapTrack); ! ! if (ret == 0) return; ! ! if (defaulted) { ! roadmap_config_set (&RoadMapConfigTrackName, name); } RoadMapTrackModified = 0; Index: roadmap_landmark.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_landmark.h 7 Dec 2005 14:06:03 -0000 1.1 --- roadmap_landmark.h 8 Dec 2005 21:13:55 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- void roadmap_landmark_initialize (void); void roadmap_landmark_save (void); + void roadmap_landmark_load (void); void roadmap_landmark_load(void); void roadmap_landmark_merge(void); Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** roadmap_start.c 7 Dec 2005 18:57:35 -0000 1.89 --- roadmap_start.c 8 Dec 2005 21:13:55 -0000 1.90 *************** *** 927,930 **** --- 927,932 ---- roadmap_math_initialize (); roadmap_trip_initialize (); + roadmap_track_initialize (); + roadmap_landmark_initialize (); roadmap_pointer_initialize (); roadmap_screen_initialize (); *************** *** 971,974 **** --- 973,977 ---- roadmap_track_autoload (); + roadmap_landmark_load (); roadmap_driver_activate (); *************** *** 1002,1008 **** roadmap_driver_shutdown (); roadmap_history_save(); - roadmap_config_save (0); roadmap_track_autosave (); roadmap_landmark_save (); roadmap_trip_save (roadmap_trip_current(), 0); } --- 1005,1011 ---- roadmap_driver_shutdown (); roadmap_history_save(); roadmap_track_autosave (); roadmap_landmark_save (); roadmap_trip_save (roadmap_trip_current(), 0); + roadmap_config_save (0); } |
From: Paul F. <pg...@us...> - 2005-12-08 21:14:03
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30069 Modified Files: README Log Message: changes to improve the management of the landmark and current track files, especially their default values. Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** README 7 Dec 2005 18:58:29 -0000 1.85 --- README 8 Dec 2005 21:13:54 -0000 1.86 *************** *** 1524,1528 **** by the user will be continuously recorded by RoadMap. By default this "breadcrumb trail" will be displayed on the map, but this can ! be suppressed with the "Show/Hide Track" toggle command. The frequency at which points for the track are recorded is --- 1524,1529 ---- by the user will be continuously recorded by RoadMap. By default this "breadcrumb trail" will be displayed on the map, but this can ! be suppressed with the "Show/Hide Track" toggle command. Whether ! the track is displayed initially is also configurable. The frequency at which points for the track are recorded is *************** *** 1543,1546 **** --- 1544,1555 ---- points. [ Currently unimplemented. ] + * If "Off" is chosen, then no track points will be saved. + + Normally the recorded track will be saved in the configured filename. + The default for this file is "current_track.gpx". If one wishes to + record tracks, but never save them to disk, set the filename to the + special value "NONE". + + * DRIVERS |
From: Paul F. <pg...@us...> - 2005-12-08 21:02:22
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27293 Modified Files: roadmap_gpx.c Log Message: don't leak track memory if reading a track fails Index: roadmap_gpx.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gpx.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_gpx.c 7 Dec 2005 14:06:03 -0000 1.1 --- roadmap_gpx.c 8 Dec 2005 21:02:13 -0000 1.2 *************** *** 103,108 **** ret = roadmap_gpx_read_file(path, name, NULL, NULL, &tracklist); ! if (!ret || QUEUE_EMPTY(&tracklist)) return 0; trk = (route_head *)QUEUE_FIRST(&tracklist); --- 103,110 ---- ret = roadmap_gpx_read_file(path, name, NULL, NULL, &tracklist); ! if (!ret || QUEUE_EMPTY(&tracklist)) { ! route_flush_queue(&tracklist); return 0; + } trk = (route_head *)QUEUE_FIRST(&tracklist); |
From: Ehud S. <esh...@us...> - 2005-12-08 16:24:28
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19753 Modified Files: roadmap_street.c Log Message: Fix a wrong calculation. Index: roadmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_street.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** roadmap_street.c 7 Dec 2005 00:54:59 -0000 1.19 --- roadmap_street.c 8 Dec 2005 16:24:02 -0000 1.20 *************** *** 786,790 **** position->longitude = (from.longitude + to.longitude) / 2; ! position->latitude = (from.latitude - to.latitude) / 2; } else { --- 786,790 ---- position->longitude = (from.longitude + to.longitude) / 2; ! position->latitude = (from.latitude + to.latitude) / 2; } else { |
From: Paul F. <pg...@us...> - 2005-12-08 13:21:44
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12743 Modified Files: roadmap_landmark.c Log Message: don't write an empty landmark file. Index: roadmap_landmark.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_landmark.c 8 Dec 2005 07:17:22 -0000 1.2 --- roadmap_landmark.c 8 Dec 2005 13:21:32 -0000 1.3 *************** *** 117,122 **** name = roadmap_config_get (&RoadMapConfigLandmarkName); ! roadmap_gpx_write_waypoints(roadmap_path_trips(), name, &RoadMapLandmarkHead); RoadMapLandmarkModified = 0; --- 117,124 ---- name = roadmap_config_get (&RoadMapConfigLandmarkName); ! if (name && name[0]) { ! roadmap_gpx_write_waypoints(roadmap_path_trips(), name, &RoadMapLandmarkHead); + } RoadMapLandmarkModified = 0; *************** *** 178,186 **** name = roadmap_config_get (&RoadMapConfigLandmarkName); ! if (name[0] == 0) { ! /* Load the default file, if it exists. */ ! name = "landmarks.gpx"; ! if (! roadmap_file_exists (path, name)) return; /* Not an error. */ ! } QUEUE_INIT(&tmp_waypoint_list); --- 180,184 ---- name = roadmap_config_get (&RoadMapConfigLandmarkName); ! if ( ! roadmap_file_exists (path, name)) return; QUEUE_INIT(&tmp_waypoint_list); *************** *** 206,210 **** roadmap_config_declare ! ("preferences", &RoadMapConfigLandmarkName, ""); QUEUE_INIT(&RoadMapLandmarkHead); --- 204,208 ---- roadmap_config_declare ! ("preferences", &RoadMapConfigLandmarkName, "landmarks.gpx"); QUEUE_INIT(&RoadMapLandmarkHead); |
From: Pascal F M. <pas...@us...> - 2005-12-08 07:18:53
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4468 Modified Files: roadmap_track.c Log Message: Should not be an error if I have notrack file Index: roadmap_track.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_track.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_track.c 7 Dec 2005 17:19:31 -0000 1.2 --- roadmap_track.c 8 Dec 2005 07:18:44 -0000 1.3 *************** *** 285,292 **** const char *name; name = roadmap_config_get (&RoadMapConfigTrackName); ! roadmap_gpx_read_one_track(roadmap_path_trips(), name, &RoadMapTrack); RoadMapTrackModified = 0; --- 285,299 ---- const char *name; + const char *path = roadmap_path_trips(); name = roadmap_config_get (&RoadMapConfigTrackName); ! if (name[0] == 0) { ! /* Use the default file, if it exists. */ ! name = "current_track.gpx"; ! if (! roadmap_file_exists(path, name)) return; /* not an error. */ ! } ! ! roadmap_gpx_read_one_track(path, name, &RoadMapTrack); RoadMapTrackModified = 0; *************** *** 314,318 **** roadmap_config_declare ! ("preferences", &RoadMapConfigTrackName, "current_track.gpx"); roadmap_config_declare_enumeration --- 321,325 ---- roadmap_config_declare ! ("preferences", &RoadMapConfigTrackName, ""); roadmap_config_declare_enumeration |