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: Ehud S. <esh...@us...> - 2005-12-01 16:49:45
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3543 Modified Files: roadmap_config.c Log Message: Don't ignore UTF-8 characters. Index: roadmap_config.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_config.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_config.c 15 Oct 2005 22:18:48 -0000 1.1.1.1 --- roadmap_config.c 1 Dec 2005 16:49:35 -0000 1.2 *************** *** 424,428 **** static char *roadmap_config_skip_until (char *p, char c) { ! while (*p != '\n' && *p != c && *p > 0) p++; return p; } --- 424,428 ---- static char *roadmap_config_skip_until (char *p, char c) { ! while (*p != '\n' && *p != c && *p != 0) p++; return p; } |
From: Ehud S. <esh...@us...> - 2005-12-01 16:49:05
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3386 Modified Files: editor_track_filter.c editor_track_filter.h Log Message: Fix a warning message. Index: editor_track_filter.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_filter.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_track_filter.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_track_filter.c 1 Dec 2005 16:48:54 -0000 1.2 *************** *** 46,55 **** int max_distance; ! int max_time; int point_distance; int first_point; RoadMapGpsPosition last_gps_point; ! int last_gps_time; int last_azymuth; --- 46,55 ---- int max_distance; ! time_t max_time; int point_distance; int first_point; RoadMapGpsPosition last_gps_point; ! time_t last_gps_time; int last_azymuth; Index: editor_track_filter.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_filter.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_track_filter.h 28 Nov 2005 19:47:50 -0000 1.1 --- editor_track_filter.h 1 Dec 2005 16:48:54 -0000 1.2 *************** *** 32,37 **** struct GPSFilter *editor_track_filter_new (int max_distance, ! int max_time, ! int point_distance); int editor_track_filter_add (struct GPSFilter *filter, --- 32,37 ---- struct GPSFilter *editor_track_filter_new (int max_distance, ! int max_time, ! int point_distance); int editor_track_filter_add (struct GPSFilter *filter, |
From: Ehud S. <esh...@us...> - 2005-12-01 16:48:23
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3221 Modified Files: editor_trkseg.c Log Message: Fix a warning message. Index: editor_trkseg.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_trkseg.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_trkseg.c 1 Dec 2005 12:17:18 -0000 1.2 --- editor_trkseg.c 1 Dec 2005 16:48:13 -0000 1.3 *************** *** 468,472 **** (shape_pos.longitude - from.longitude, shape_pos.latitude - from.latitude, ! shape_time - start_time); if (new_last_shape == -1) { --- 468,472 ---- (shape_pos.longitude - from.longitude, shape_pos.latitude - from.latitude, ! (short)(shape_time - start_time)); if (new_last_shape == -1) { |
From: Ehud S. <esh...@us...> - 2005-12-01 12:30:26
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3622 Modified Files: roadmap_trip.c Log Message: Set default location to Israel. Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_trip.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_trip.c 28 Nov 2005 19:36:34 -0000 1.3 --- roadmap_trip.c 1 Dec 2005 12:30:12 -0000 1.4 *************** *** 65,70 **** ! /* Default location is: 1 market St, san Francisco, California. */ ! #define ROADMAP_DEFAULT_POSITION "-122394181, 37794928" static int RoadMapTripRotate = 1; --- 65,70 ---- ! /* Default location is: Kikar Ha-Medina, Tel Aviv, Israel. */ ! #define ROADMAP_DEFAULT_POSITION "34794810, 32106010" static int RoadMapTripRotate = 1; |
From: Ehud S. <esh...@us...> - 2005-12-01 12:29:33
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3516 Modified Files: roadmap_start.c Log Message: Changed editor initialization location. Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_start.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_start.c 30 Nov 2005 08:09:47 -0000 1.4 --- roadmap_start.c 1 Dec 2005 12:29:26 -0000 1.5 *************** *** 872,875 **** --- 872,877 ---- roadmap_screen_subscribe_after_refresh (roadmap_start_after_refresh); + editor_main_initialize (); + roadmap_trip_restore_focus (); *************** *** 880,885 **** roadmap_locator_declare (&roadmap_start_no_download); roadmap_main_set_periodic (200, roadmap_start_periodic); - - editor_main_initialize (); } --- 882,885 ---- |
From: Ehud S. <esh...@us...> - 2005-12-01 12:28:29
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3358 Modified Files: roadmap_locator.c Log Message: Import metadada layer from the HEAD branch. Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_locator.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_locator.c 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_locator.c 1 Dec 2005 12:28:18 -0000 1.3 *************** *** 45,48 **** --- 45,49 ---- #include "roadmap_polygon.h" #include "roadmap_county.h" + #include "roadmap_metadata.h" #include "roadmap_locator.h" *************** *** 82,85 **** --- 83,89 ---- RoadMapCountyModel = roadmap_db_register + (RoadMapCountyModel, "metadata", &RoadMapMetadataHandler); + RoadMapCountyModel = + roadmap_db_register (RoadMapCountyModel, "zip", &RoadMapZipHandler); RoadMapCountyModel = |
From: Ehud S. <esh...@us...> - 2005-12-01 12:26:57
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2994 Modified Files: roadmap_display.c Log Message: Added text to speech field support. Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_display.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_display.c 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_display.c 1 Dec 2005 12:26:47 -0000 1.3 *************** *** 508,511 **** --- 508,512 ---- roadmap_message_set ('#', properties.address); roadmap_message_set ('N', properties.street); + roadmap_message_set ('T', properties.street_t2s); roadmap_message_set ('C', properties.city); |
From: Ehud S. <esh...@us...> - 2005-12-01 12:26:18
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2887 Modified Files: Makefile Log Message: Added some new files. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 30 Nov 2005 08:05:23 -0000 1.6 --- Makefile 1 Dec 2005 12:26:09 -0000 1.7 *************** *** 88,93 **** ! CFLAGS=$(MODECFLAGS) $(SQLCFLAGS) $(ROADMAP_USE_SHAPEFILES) -I/usr/local/include -I$(PWD) ! LDFLAGS=$(MODELDFLAGS) $(SQLLDFLAGS) $(SHAPELDFLAGS) RDMLIBS=libroadmap.a unix/libosroadmap.a --- 88,93 ---- ! CFLAGS=$(MODECFLAGS) $(SQLCFLAGS) $(ROADMAP_USE_SHAPEFILES) -I/usr/local/include -I$(PWD) -DROADMAP_USE_POSTGRES ! LDFLAGS=$(MODELDFLAGS) $(SQLLDFLAGS) $(SHAPELDFLAGS) -lpq RDMLIBS=libroadmap.a unix/libosroadmap.a *************** *** 104,107 **** --- 104,108 ---- roadmap_config.c \ roadmap_option.c \ + roadmap_metadata.c \ roadmap_county.c \ roadmap_locator.c \ *************** *** 177,180 **** --- 178,182 ---- editor/db/editor_dictionary.c \ buildmap_dbwrite.c \ + buildmap_metadata.c \ buildmap_messages.c \ editor/db/editor_override.c \ *************** *** 199,202 **** --- 201,205 ---- buildmap_dictionary.c \ buildmap_dbwrite.c \ + buildmap_metadata.c \ buildmap_city.c \ buildmap_square.c \ *************** *** 212,215 **** --- 215,219 ---- buildmap_shapefile.c \ buildmap_empty.c \ + buildmap_postgres.c \ buildmap_place.c \ buildmap_main.c |
From: Ehud S. <esh...@us...> - 2005-12-01 12:25:52
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2803 Modified Files: buildmap_shape.c Log Message: Merged shape creation bug fix. Index: buildmap_shape.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_shape.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_shape.c 28 Nov 2005 19:36:34 -0000 1.2 --- buildmap_shape.c 1 Dec 2005 12:25:42 -0000 1.3 *************** *** 278,307 **** (abs(one_shape->latitude - latitude) > 0x7fff)) { - double a = (1.0 * (one_shape->latitude - latitude)) - / (one_shape->longitude - longitude); - short delta_longitude; short delta_latitude; ! if (one_shape->longitude - longitude > 0x7fff) { ! delta_longitude = 0x7fff; ! delta_latitude = (a * 0x7fff); ! } else if (longitude - one_shape->longitude > 0x7fff) { ! delta_longitude = 0 - 0x7fff; ! delta_latitude = 0 - (short) (a * 0x7fff); ! } else if (one_shape->latitude - latitude > 0x7fff) { ! delta_latitude = 0x7fff; ! delta_longitude = (short) (0x7fff / a); ! } else { ! delta_latitude = 0 - 0x7fff; ! delta_longitude = 0 - (short) (0x7fff / a); } --- 278,320 ---- (abs(one_shape->latitude - latitude) > 0x7fff)) { short delta_longitude; short delta_latitude; ! if (one_shape->longitude == longitude) { ! delta_longitude = 0; ! if (one_shape->latitude - latitude > 0x7fff) { ! delta_latitude = 0x7fff; ! } else { ! delta_latitude = 0 - 0x7fff; ! } ! } else { ! double a = (1.0 * (one_shape->latitude - latitude)) ! / (one_shape->longitude - longitude); ! if ((a <= 1) && (a >= -1)) { ! if (one_shape->longitude - longitude > 0x7fff) { ! delta_longitude = 0x7fff; ! delta_latitude = (a * 0x7fff); ! } else { ! delta_longitude = 0 - 0x7fff; ! delta_latitude = 0 - (short) (a * 0x7fff); ! } ! } else { ! ! if (one_shape->latitude - latitude > 0x7fff) { ! delta_latitude = 0x7fff; ! delta_longitude = (short) (0x7fff / a); ! } else { ! delta_latitude = 0 - 0x7fff; ! delta_longitude = 0 - (short) (0x7fff / a); ! } ! } } *************** *** 377,406 **** (abs(one_shape->latitude - latitude) > 0x7fff)) { - double a = (1.0 * (one_shape->latitude - latitude)) - / (one_shape->longitude - longitude); - short delta_longitude; short delta_latitude; ! if (one_shape->longitude - longitude > 0x7fff) { ! delta_longitude = 0x7fff; ! delta_latitude = (a * 0x7fff); ! } else if (longitude - one_shape->longitude > 0x7fff) { ! delta_longitude = 0 - 0x7fff; ! delta_latitude = 0 - (short) (a * 0x7fff); ! } else if (one_shape->latitude - latitude > 0x7fff) { ! delta_latitude = 0x7fff; ! delta_longitude = (short) (0x7fff / a); ! } else { ! delta_latitude = 0 - 0x7fff; ! delta_longitude = 0 - (short) (0x7fff / a); } --- 390,432 ---- (abs(one_shape->latitude - latitude) > 0x7fff)) { short delta_longitude; short delta_latitude; ! if (one_shape->longitude == longitude) { ! delta_longitude = 0; ! if (one_shape->latitude - latitude > 0x7fff) { ! delta_latitude = 0x7fff; ! } else { ! delta_latitude = 0 - 0x7fff; ! } ! } else { ! double a = (1.0 * (one_shape->latitude - latitude)) ! / (one_shape->longitude - longitude); ! if ((a <= 1) && (a >= -1)) { ! if (one_shape->longitude - longitude > 0x7fff) { ! delta_longitude = 0x7fff; ! delta_latitude = (a * 0x7fff); ! } else { ! delta_longitude = 0 - 0x7fff; ! delta_latitude = 0 - (short) (a * 0x7fff); ! } ! } else { ! ! if (one_shape->latitude - latitude > 0x7fff) { ! delta_latitude = 0x7fff; ! delta_longitude = (short) (0x7fff / a); ! } else { ! delta_latitude = 0 - 0x7fff; ! delta_longitude = 0 - (short) (0x7fff / a); ! } ! } } |
From: Ehud S. <esh...@us...> - 2005-12-01 12:24:23
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2525 Added Files: buildmap_metadata.c buildmap_metadata.h roadmap_db_metadata.h roadmap_metadata.c roadmap_metadata.h Log Message: Import metadada layer from the HEAD branch. --- NEW FILE: roadmap_metadata.h --- /* roadmap_metadata.h - Interface to the map metadata information. * * LICENSE: * * Copyright 2002 Pascal F. Martin * * 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 INCLUDED__ROADMAP_METADATA__H #define INCLUDED__ROADMAP_METADATA__H #include "roadmap_types.h" #include "roadmap_dbread.h" const char *roadmap_metadata_get_attribute (const char *category, const char *name); extern roadmap_db_handler RoadMapMetadataHandler; #endif // INCLUDED__ROADMAP_METADATA__H --- NEW FILE: roadmap_db_metadata.h --- /* roadmap_db_attributes.h - the format of the attributes table used by RoadMap. * * LICENSE: * * Copyright 2002 Pascal F. Martin * * 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: * * The RoadMap map attributes are described by the following table: * * metadata/attributes The list of attributes associated with this map. */ #ifndef INCLUDED__ROADMAP_DB_ATTRIBUTES__H #define INCLUDED__ROADMAP_DB_ATTRIBUTES__H #include "roadmap_types.h" typedef struct { /* table metadata/attributes */ RoadMapString category; RoadMapString name; RoadMapString value; RoadMapString filler; } RoadMapAttribute; #endif // INCLUDED__ROADMAP_DB_ATTRIBUTES__H --- NEW FILE: buildmap_metadata.h --- /* buildmap_metadata.h - Build a table containing the map's metadata. * * LICENSE: * * Copyright 2002 Pascal F. Martin * * 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 INCLUDED__BUILDMAP_METADATA__H #define INCLUDED__BUILDMAP_METADATA__H void buildmap_metadata_initialize (void); void buildmap_metadata_add_attribute (const char *category, const char *name, const char *value); void buildmap_metadata_sort (void); void buildmap_metadata_save (void); void buildmap_metadata_summary (void); void buildmap_metadata_reset (void); #endif // INCLUDED__BUILDMAP_METADATA__H --- NEW FILE: roadmap_metadata.c --- /* roadmap_metadata.c - Manage the map metadata information. * * LICENSE: * * Copyright 2002 Pascal F. Martin * * 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: * * const char *roadmap_metadata_get_attribute (const char *category, * const char *name); * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_dictionary.h" #include "roadmap_metadata.h" #include "roadmap_db_metadata.h" static const char *RoadMapMetadataType = "RoadMapMetadataContext"; typedef struct { const char *type; RoadMapAttribute *Attributes; int AttributesCount; RoadMapDictionary RoadMapAttributeStrings; } RoadMapMetadataContext; static RoadMapMetadataContext *RoadMapMetadataActive = NULL; static void *roadmap_metadata_map (roadmap_db *root) { RoadMapMetadataContext *context; roadmap_db *attributes_table; context = (RoadMapMetadataContext *) malloc (sizeof(RoadMapMetadataContext)); if (context == NULL) { roadmap_log (ROADMAP_ERROR, "no more memory"); return NULL; } context->type = RoadMapMetadataType; context->RoadMapAttributeStrings = NULL; attributes_table = roadmap_db_get_subsection (root, "attributes"); context->Attributes = (RoadMapAttribute *) roadmap_db_get_data (attributes_table); context->AttributesCount = roadmap_db_get_count (attributes_table); if (roadmap_db_get_size (attributes_table) != context->AttributesCount * sizeof(RoadMapAttribute)) { roadmap_log (ROADMAP_ERROR, "invalid metadata/attributes structure"); goto roadmap_metadata_map_abort; } return context; roadmap_metadata_map_abort: free(context); return NULL; } static void roadmap_metadata_activate (void *context) { RoadMapMetadataContext *this = (RoadMapMetadataContext *) context; if (this != NULL) { if (this->type != RoadMapMetadataType) { roadmap_log (ROADMAP_FATAL, "invalid metadata context activated"); } if (this->RoadMapAttributeStrings == NULL) { this->RoadMapAttributeStrings = roadmap_dictionary_open ("attributes"); } if (this->RoadMapAttributeStrings == NULL) { roadmap_log (ROADMAP_FATAL, "cannot open dictionary"); } } RoadMapMetadataActive = this; } static void roadmap_metadata_unmap (void *context) { RoadMapMetadataContext *this = (RoadMapMetadataContext *) context; if (this->type != RoadMapMetadataType) { roadmap_log (ROADMAP_FATAL, "unmapping invalid line context"); } if (RoadMapMetadataActive == this) { RoadMapMetadataActive = NULL; } free (this); } roadmap_db_handler RoadMapMetadataHandler = { "metadata", roadmap_metadata_map, roadmap_metadata_activate, roadmap_metadata_unmap }; const char *roadmap_metadata_get_attribute (const char *category, const char *name) { int i; RoadMapString coded_category = roadmap_dictionary_locate (RoadMapMetadataActive->RoadMapAttributeStrings, category); RoadMapString coded_name = roadmap_dictionary_locate (RoadMapMetadataActive->RoadMapAttributeStrings, name); for (i = RoadMapMetadataActive->AttributesCount - 1; i >= 0; --i) { if (RoadMapMetadataActive->Attributes[i].name == coded_name && RoadMapMetadataActive->Attributes[i].category == coded_category) { return roadmap_dictionary_get (RoadMapMetadataActive->RoadMapAttributeStrings, RoadMapMetadataActive->Attributes[i].value); } } return ""; } --- NEW FILE: buildmap_metadata.c --- /* buildmap_metadata.c - Build a table containing the map's metadata. * * LICENSE: * * Copyright 2002 Pascal F. Martin * * 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_metadata_initialize (void); * void buildmap_metadata_add_attribute (const char *category, * const char *name, * const char *value); * * void buildmap_metadata_sort (void); * void buildmap_metadata_save (void); * void buildmap_metadata_summary (void); * void buildmap_metadata_reset (void); * * These functions are used to build a table of attributes that describe * what this map file contains. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_db_metadata.h" #include "roadmap_hash.h" #include "buildmap.h" #include "buildmap_metadata.h" static int AttributeCount = 0; static RoadMapAttribute *Attribute[BUILDMAP_BLOCK] = {NULL}; static RoadMapHash *AttributeByName = NULL; BuildMapDictionary AttributeDictionary = NULL; void buildmap_metadata_initialize (void) { AttributeByName = roadmap_hash_new ("AttributeByName", BUILDMAP_BLOCK); Attribute[0] = calloc (BUILDMAP_BLOCK, sizeof(RoadMapAttribute)); if (Attribute[0] == NULL) { buildmap_fatal (0, "no more memory"); } AttributeDictionary = buildmap_dictionary_open ("attributes"); } void buildmap_metadata_add_attribute (const char *category, const char *name, const char *value) { int i; int block; int offset; RoadMapAttribute *this_attribute; /* First check if the attribute is already known. */ RoadMapString coded_category = buildmap_dictionary_add (AttributeDictionary, category, strlen(category)); RoadMapString coded_name = buildmap_dictionary_add (AttributeDictionary, name, strlen(name)); RoadMapString coded_value = buildmap_dictionary_add (AttributeDictionary, value, strlen(value)); for (i = roadmap_hash_get_first (AttributeByName, coded_name); i >= 0; i = roadmap_hash_get_next (AttributeByName, i)) { this_attribute = Attribute[i / BUILDMAP_BLOCK] + (i % BUILDMAP_BLOCK); if ((this_attribute->name == coded_name) && (this_attribute->category == coded_category)) { if (this_attribute->value != coded_value) { roadmap_log (ROADMAP_FATAL, "attribute %s.%s changed to %s", category, name, value); } return; } } /* This is a new attribute: create a new entry. */ block = AttributeCount / BUILDMAP_BLOCK; offset = AttributeCount % BUILDMAP_BLOCK; if (Attribute[block] == NULL) { /* We need to add a new block to the table. */ Attribute[block] = calloc (BUILDMAP_BLOCK, sizeof(RoadMapAttribute)); if (Attribute[block] == NULL) { buildmap_fatal (0, "no more memory"); } roadmap_hash_resize (AttributeByName, (block+1) * BUILDMAP_BLOCK); } roadmap_hash_add (AttributeByName, coded_name, AttributeCount); this_attribute = Attribute[block] + offset; this_attribute->category = coded_category; this_attribute->name = coded_name; this_attribute->value = coded_value; AttributeCount += 1; } void buildmap_metadata_sort (void) {} void buildmap_metadata_save (void) { int i; RoadMapAttribute *one_attribute; RoadMapAttribute *db_attributes; buildmap_db *root; buildmap_db *table_attributes; buildmap_info ("saving %d attributes...", AttributeCount); root = buildmap_db_add_section (NULL, "metadata"); table_attributes = buildmap_db_add_section (root, "attributes"); buildmap_db_add_data (table_attributes, AttributeCount, sizeof(RoadMapAttribute)); db_attributes = (RoadMapAttribute *) buildmap_db_get_data (table_attributes); for (i = 0; i < AttributeCount; ++i) { one_attribute = Attribute[i/BUILDMAP_BLOCK] + (i % BUILDMAP_BLOCK); db_attributes[i] = *one_attribute; db_attributes[i].filler = 0; } } void buildmap_metadata_summary (void) { fprintf (stderr, "-- metadata table statistics: %d attributes, %d bytes used\n", AttributeCount, AttributeCount * sizeof(RoadMapAttribute)); } void buildmap_metadata_reset (void) { int i; for (i = 0; i < BUILDMAP_BLOCK; i++) { if (Attribute[i] != NULL) { free (Attribute[i]); Attribute[i] = NULL; } } AttributeCount = 0; AttributeByName = NULL; } |
From: Ehud S. <esh...@us...> - 2005-12-01 12:23:24
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2272 Modified Files: buildmap_main.c Added Files: buildmap_postgres.c buildmap_postgres.h Log Message: Add initial postgres DB support. Index: buildmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** buildmap_main.c 28 Nov 2005 19:36:34 -0000 1.3 --- buildmap_main.c 1 Dec 2005 12:23:16 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- #include <sys/types.h> #include <popt.h> + #include <time.h> #include "roadmap_types.h" *************** *** 36,39 **** --- 37,41 ---- #include "buildmap_shapefile.h" #include "buildmap_empty.h" + #include "buildmap_postgres.h" #include "buildmap_square.h" *************** *** 47,50 **** --- 49,53 ---- #include "buildmap_area.h" #include "buildmap_polygon.h" + #include "buildmap_metadata.h" *************** *** 53,56 **** --- 56,60 ---- #define BUILDMAP_FORMAT_DCW 3 #define BUILDMAP_FORMAT_EMPTY 4 + #define BUILDMAP_FORMAT_PG 5 static int BuildMapFormatFamily = 0; *************** *** 67,71 **** {"format", 'f', POPT_ARG_STRING, &BuildMapFormat, 0, ! "Input files format (Tiger or ShapeFile)", "2000|2002|SHAPE|DCW"}, POPT_TABLEEND --- 71,75 ---- {"format", 'f', POPT_ARG_STRING, &BuildMapFormat, 0, ! "Input files format (Tiger or ShapeFile)", "2000|2002|SHAPE|DCW|EMPTY|PG"}, POPT_TABLEEND *************** *** 134,137 **** --- 138,149 ---- BuildMapFormatFamily = BUILDMAP_FORMAT_DCW; + } else if (strcmp (BuildMapFormat, "EMPTY") == 0) { + + BuildMapFormatFamily = BUILDMAP_FORMAT_EMPTY; + + } else if (strcmp (BuildMapFormat, "PG") == 0) { + + BuildMapFormatFamily = BUILDMAP_FORMAT_PG; + } else { fprintf (stderr, "%s: unsupported input format\n", BuildMapFormat); *************** *** 152,155 **** --- 164,168 ---- buildmap_street_initialize(); buildmap_area_initialize(); + buildmap_metadata_initialize(); } *************** *** 162,165 **** --- 175,179 ---- buildmap_shape_sort (); buildmap_polygon_sort (); + buildmap_metadata_sort (); } *************** *** 192,195 **** --- 206,210 ---- buildmap_polygon_save (); buildmap_zip_save (); + buildmap_metadata_save (); buildmap_db_close (); *************** *** 205,208 **** --- 220,224 ---- buildmap_city_reset (); buildmap_street_reset (); + buildmap_metadata_reset (); buildmap_range_reset (); buildmap_polygon_reset (); *************** *** 215,218 **** --- 231,236 ---- int verbose, int canals, int rivers) { + time_t current_time; + buildmap_county_initialize (); *************** *** 230,235 **** --- 248,265 ---- buildmap_shapefile_dcw_process (source, verbose, canals, rivers); break; + + case BUILDMAP_FORMAT_EMPTY: + buildmap_empty_process (source); + break; + + case BUILDMAP_FORMAT_PG: + buildmap_postgres_process (source, verbose, canals, rivers); + break; } + time (¤t_time); + buildmap_metadata_add_attribute ("Version", "Date", + asctime (gmtime (¤t_time))); + buildmap_county_sort(); *************** *** 246,249 **** --- 276,280 ---- buildmap_shape_summary (); buildmap_polygon_summary (); + buildmap_metadata_summary (); } --- NEW FILE: buildmap_postgres.h --- /* buildmap_shapefile.h - Read shapefiles. * * LICENSE: * * Copyright 2004 Stephen Woodbridge * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef INCLUDE__BUILDMAP_POSTGRES__H #define INCLUDE__BUILDMAP_POSTGRES__H void buildmap_postgres_process (const char *source, int verbose, int canals, int rivers); #endif // INCLUDE__BUILDMAP_POSTGRES__H --- NEW FILE: buildmap_postgres.c --- /* buildmap_postgres.c - a module to read postgis DB. * * 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: * * see buildmap_postgres.h */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mman.h> #if ROADMAP_USE_POSTGRES #include <libpq-fe.h> #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_math.h" #include "roadmap_path.h" #include "buildmap.h" #include "buildmap_zip.h" #include "buildmap_shapefile.h" #include "buildmap_city.h" #include "buildmap_square.h" #include "buildmap_point.h" #include "buildmap_line.h" #include "buildmap_street.h" #include "buildmap_range.h" #include "buildmap_area.h" #include "buildmap_shape.h" #include "buildmap_polygon.h" /* DB schemes */ #define BordersTlidStart 1000000 #define WaterTlidStart 1100000 /* 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; static BuildMapDictionary DictionaryCity; static BuildMapDictionary DictionaryLandmark; static int BuildMapCanals = ROADMAP_WATER_RIVER; static int BuildMapRivers = ROADMAP_WATER_RIVER; static int BuildMapSea = ROADMAP_WATER_SEA; static int BuildMapBorders = ROADMAP_WATER_SHORELINE; PGconn *hPGConn; static RoadMapString str2dict (BuildMapDictionary d, const char *string) { if (!strlen(string)) { return buildmap_dictionary_add (d, "", 0); } return buildmap_dictionary_add (d, (char *) string, strlen(string)); } static int type2layer (const char *type) { return ROADMAP_ROAD_STREET; } static void postgres_summary (int verbose, int count) { buildmap_summary (verbose, "%d records", count); } static int decode_line_string(char *linestring, float **lon, float **lat) { char *itr = linestring; char *tmp; char *end = linestring + strlen(linestring); char token[100]; int num = 0; int curr_size = 100; *lon = malloc(sizeof(float) * curr_size); *lat = malloc(sizeof(float) * curr_size); if (strncmp(linestring, "LINESTRING(", 11) == 0) { itr += 11; } else if (strncmp(linestring, "MULTILINESTRING(", 16) == 0) { itr += 17; } else if (strncmp(linestring, "POLYGON(", 8) == 0) { itr += 9; } else { fprintf(stderr, "this is not a linestring: %s\n", linestring); exit(-1); } while ((itr+1) < end) { tmp = strchr(itr, ' '); if ((!tmp) || ((unsigned)(tmp-itr) > sizeof(token))) { fprintf(stderr, "Can't decode this part of linestring: %s\n", itr); exit(-1); } strncpy(token, itr, tmp-itr); token[tmp-itr] = '\0'; (*lon)[num] = atof(token); itr = tmp+1; tmp = strchr(itr, ','); if (!tmp) { tmp = strchr(itr, ')'); } if ((!tmp) || ((unsigned)(tmp-itr) > sizeof(token))) { fprintf(stderr, "Can't decode this part of linestring: %s\n", itr); exit(-1); } strncpy(token, itr, tmp-itr); token[tmp-itr] = '\0'; (*lat)[num] = atof(token); itr = tmp+1; num++; if (num == curr_size) { curr_size *= 2; *lon = realloc(*lon, sizeof(float) * curr_size); *lat = realloc(*lat, sizeof(float) * curr_size); } } return num; } static void buildmap_postgres_connect (const char *source) { buildmap_set_source(source); hPGConn = PQconnectdb(source); if( hPGConn == NULL || PQstatus(hPGConn) == CONNECTION_BAD ) { fprintf(stderr, "Can't open postgres database: %s\n", PQerrorMessage(hPGConn)); PQfinish(hPGConn); exit(1); } } static int db_result_ok (PGresult *result) { if (!result || ((PQresultStatus(result) != PGRES_TUPLES_OK)) || (PQntuples(result) < 0)) { return 0; } return 1; } static void buildmap_postgres_read_borders_lines (int verbose) { int irec; int record_count; int line; int tlid; int frlong; int frlat; int tolong; int tolat; int from_point; int to_point; PGresult *db_result; db_result = PQexec(hPGConn, country_borders_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++) { float *lon_arr; 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; 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); to_point = buildmap_point_add (tolong, tolat); line = buildmap_line_add (tlid, BuildMapBorders, from_point, to_point); free (lon_arr); free (lat_arr); } PQclear(db_result); return; } static void buildmap_postgres_read_borders_shape_points (int verbose) { int irec; int record_count; int line_index; int tlid; int j, lat, lon; PGresult *db_result; db_result = PQexec(hPGConn, country_borders_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++) { float *lon_arr; 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); line_index = buildmap_line_find_sorted(tlid); if (line_index >= 0) { for (j=1; j<num_points-1; j++) { lon = lon_arr[j] * 1000000.0; lat = lat_arr[j] * 1000000.0; buildmap_shape_add(line_index, j-1, lon, lat); } } free (lon_arr); free (lat_arr); if (verbose) { if ((irec & 0xff) == 0) { buildmap_progress (irec, record_count); } } } PQclear(db_result); postgres_summary (verbose, record_count); } 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); 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); free (lat_arr); } PQclear(db_result); return; } static void buildmap_postgres_read_water_shape_points (int verbose) { int irec; int record_count; int line_index; int tlid; int j, lat, lon; 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); for (irec=0; irec<record_count; irec++) { float *lon_arr; float *lat_arr; int num_points; buildmap_set_line (irec); tlid = WaterTlidStart + atoi(PQgetvalue(db_result, irec, 0)); num_points = decode_line_string (PQgetvalue(db_result, irec, 1), &lon_arr, &lat_arr); line_index = buildmap_line_find_sorted(tlid); if (line_index >= 0) { for (j=1; j<num_points-1; j++) { lon = lon_arr[j] * 1000000.0; lat = lat_arr[j] * 1000000.0; buildmap_shape_add(line_index, j-1, lon, lat); } } free (lon_arr); free (lat_arr); if (verbose) { if ((irec & 0xff) == 0) { buildmap_progress (irec, record_count); } } } PQclear(db_result); postgres_summary (verbose, record_count); } static void buildmap_postgres_read_water_polygons (int verbose) { int irec; int record_count; int tlid; int landid = 0; int polyid = 0; int cenid = 0; PGresult *db_result; DictionaryLandmark = buildmap_dictionary_open ("landmark"); 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); buildmap_polygon_add_landmark (++landid, BuildMapSea, buildmap_dictionary_add (DictionaryLandmark, "", 0)); buildmap_polygon_add (landid, ++cenid, ++polyid); for (j=1; j<num_points; j++) { buildmap_polygon_add_line (cenid, polyid, tlid++, POLYGON_SIDE_LEFT); } free (lon_arr); free (lat_arr); } PQclear(db_result); return; } #endif // ROADMAP_USE_POSTGRES void buildmap_postgres_process (const char *source, int verbose, int canals, int rivers) { #if ROADMAP_USE_POSTGRES DictionaryPrefix = buildmap_dictionary_open ("prefix"); DictionaryStreet = buildmap_dictionary_open ("street"); DictionaryType = buildmap_dictionary_open ("type"); DictionarySuffix = buildmap_dictionary_open ("suffix"); DictionaryCity = buildmap_dictionary_open ("city"); if (! canals) { BuildMapCanals = 0; } if (! rivers) { BuildMapRivers = 0; } buildmap_postgres_connect (source); buildmap_postgres_read_borders_lines (verbose); buildmap_postgres_read_water_lines (verbose); buildmap_line_sort(); buildmap_postgres_read_borders_shape_points (verbose); //buildmap_postgres_read_water_shape_points (verbose); buildmap_postgres_read_water_polygons (verbose); PQfinish (hPGConn); #else fprintf (stderr, "cannot process %s: built with no postgres support.\n", source); exit(1); #endif // ROADMAP_USE_POSTGRES } |
From: Ehud S. <esh...@us...> - 2005-12-01 12:22:19
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2040 Modified Files: buildmap_dictionary.c buildmap_messages.c Log Message: Add const declarations. Index: buildmap_dictionary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_dictionary.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_dictionary.c 28 Nov 2005 19:36:34 -0000 1.2 --- buildmap_dictionary.c 1 Dec 2005 12:22:11 -0000 1.3 *************** *** 240,244 **** buildmap_dictionary_search (struct dictionary_volume *dictionary, ! char *string, int length, struct dictionary_tree **last_tree) { --- 240,244 ---- buildmap_dictionary_search (struct dictionary_volume *dictionary, ! const char *string, int length, struct dictionary_tree **last_tree) { *************** *** 248,253 **** int i; ! char *cursor; ! char *stored; --- 248,253 ---- int i; ! const char *cursor; ! const char *stored; *************** *** 606,610 **** RoadMapString buildmap_dictionary_add ! (BuildMapDictionary dictionary, char *string, int length) { int cursor; --- 606,610 ---- RoadMapString buildmap_dictionary_add ! (BuildMapDictionary dictionary, const char *string, int length) { int cursor; *************** *** 739,743 **** RoadMapString buildmap_dictionary_locate ! (BuildMapDictionary dictionary, char *string) { struct dictionary_tree *tree; --- 739,743 ---- RoadMapString buildmap_dictionary_locate ! (BuildMapDictionary dictionary, const char *string) { struct dictionary_tree *tree; Index: buildmap_messages.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_messages.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_messages.c 28 Nov 2005 19:36:34 -0000 1.2 --- buildmap_messages.c 1 Dec 2005 12:22:11 -0000 1.3 *************** *** 55,61 **** ! void buildmap_set_source (char *name) { ! char *p; /* Get the file's base name (for error display purpose). */ --- 55,61 ---- ! void buildmap_set_source (const char *name) { ! const char *p; /* Get the file's base name (for error display purpose). */ |
From: Ehud S. <esh...@us...> - 2005-12-01 12:21:34
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1893 Modified Files: buildmap.h Log Message: Add const declarations. Index: buildmap.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap.h 28 Nov 2005 19:36:34 -0000 1.2 --- buildmap.h 1 Dec 2005 12:21:21 -0000 1.3 *************** *** 31,35 **** ! void buildmap_set_source (char *name); void buildmap_set_line (int line); --- 31,35 ---- ! void buildmap_set_source (const char *name); void buildmap_set_line (int line); *************** *** 47,54 **** BuildMapDictionary buildmap_dictionary_open (char *name); RoadMapString buildmap_dictionary_add ! (BuildMapDictionary dictionary, char *string, int length); RoadMapString buildmap_dictionary_locate ! (BuildMapDictionary dictionary, char *string); char *buildmap_dictionary_get (BuildMapDictionary dictionary, RoadMapString index); --- 47,54 ---- BuildMapDictionary buildmap_dictionary_open (char *name); RoadMapString buildmap_dictionary_add ! (BuildMapDictionary dictionary, const char *string, int length); RoadMapString buildmap_dictionary_locate ! (BuildMapDictionary dictionary, const char *string); char *buildmap_dictionary_get (BuildMapDictionary dictionary, RoadMapString index); |
From: Ehud S. <esh...@us...> - 2005-12-01 12:19:08
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1189 Modified Files: editor_track_main.c editor_track_main.h editor_track_util.c editor_track_util.h Log Message: Fix focus issues. Index: editor_track_util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_track_util.c 30 Nov 2005 08:14:39 -0000 1.2 --- editor_track_util.c 1 Dec 2005 12:19:00 -0000 1.3 *************** *** 59,63 **** #include "editor_track_util.h" ! #define FOCUS_RANGE 1000 #define SPLIT_START 0x1 --- 59,63 ---- #include "editor_track_util.h" ! #define FOCUS_RANGE 10000 #define SPLIT_START 0x1 *************** *** 67,71 **** ! static void editor_track_util_set_focus(const RoadMapPosition *position) { RoadMapArea focus; --- 67,71 ---- ! void editor_track_util_set_focus(const RoadMapPosition *position) { RoadMapArea focus; *************** *** 80,84 **** ! static void editor_track_util_release_focus() { roadmap_math_release_focus (); --- 80,84 ---- ! void editor_track_util_release_focus() { roadmap_math_release_focus (); *************** *** 398,411 **** editor_track_util_node_pos (node, &split_position); ! editor_track_util_set_focus(&split_position); if (!roadmap_plugin_get_distance (&split_position, line, &result)) { assert (0); ! roadmap_math_release_focus(); node->id = -1; return; } ! editor_track_util_release_focus (); assert (result.distance < 3*editor_track_point_distance ()); --- 398,411 ---- editor_track_util_node_pos (node, &split_position); ! //editor_track_util_set_focus(&split_position); if (!roadmap_plugin_get_distance (&split_position, line, &result)) { assert (0); ! //editor_track_util_release_focus (); node->id = -1; return; } ! //editor_track_util_release_focus (); assert (result.distance < 3*editor_track_point_distance ()); *************** *** 455,464 **** int res; ! editor_track_util_set_focus(point); roadmap_plugin_activate_db (line); res = roadmap_plugin_get_distance (point, line, result); ! roadmap_math_release_focus(); return res; } --- 455,464 ---- int res; ! //editor_track_util_set_focus (point); roadmap_plugin_activate_db (line); res = roadmap_plugin_get_distance (point, line, result); ! //editor_track_util_release_focus (); return res; } *************** *** 486,490 **** } ! editor_track_util_set_focus((RoadMapPosition*)gps_position); layer_count = roadmap_layer_all_roads (layers, 128); --- 486,490 ---- } ! //editor_track_util_set_focus((RoadMapPosition*)gps_position); layer_count = roadmap_layer_all_roads (layers, 128); *************** *** 498,502 **** neighbourhood, count, max); ! editor_track_util_release_focus (); --- 498,502 ---- neighbourhood, count, max); ! //editor_track_util_release_focus (); Index: editor_track_util.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_track_util.h 28 Nov 2005 19:47:50 -0000 1.1 --- editor_track_util.h 1 Dec 2005 12:19:00 -0000 1.2 *************** *** 79,82 **** --- 79,85 ---- int editor_track_util_create_db (const RoadMapPosition *pos); + void editor_track_util_set_focus(const RoadMapPosition *position); + void editor_track_util_release_focus(); + #endif // INCLUDE__EDITOR_TRACK_UTIL__H Index: editor_track_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_main.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_track_main.h 30 Nov 2005 08:15:57 -0000 1.2 --- editor_track_main.h 1 Dec 2005 12:19:00 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- #include "roadmap_gps.h" + #include "roadmap_canvas.h" typedef struct { *************** *** 53,56 **** --- 54,58 ---- RoadMapGpsPosition *track_point_gps (int index); int track_point_time (int index); + int editor_track_draw_current (RoadMapPen pen); void editor_track_end (void); Index: editor_track_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_track_main.c 30 Nov 2005 08:15:57 -0000 1.2 --- editor_track_main.c 1 Dec 2005 12:19:00 -0000 1.3 *************** *** 474,478 **** --- 474,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 (); } } |
From: Ehud S. <esh...@us...> - 2005-12-01 12:18:23
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/export In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv880 Modified Files: editor_export.c Log Message: Fix new file creation. Index: editor_export.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_export.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_export.c 30 Nov 2005 08:13:27 -0000 1.2 --- editor_export.c 1 Dec 2005 12:18:15 -0000 1.3 *************** *** 104,108 **** static FILE *create_export_file(const char *name) { ! FILE *file = roadmap_file_fopen (roadmap_path_user(), name, "w"); if (file == NULL) return NULL; --- 104,108 ---- static FILE *create_export_file(const char *name) { ! FILE *file = roadmap_file_fopen (NULL, name, "w"); if (file == NULL) return NULL; *************** *** 364,367 **** --- 364,369 ---- } + editor_track_end (); + trkseg = editor_trkseg_get_next_export (); *************** *** 493,498 **** void editor_export_gpx (void) { - editor_track_end (); - roadmap_fileselection_new ("Export data", NULL, /* no filter. */ --- 495,498 ---- |
From: Ehud S. <esh...@us...> - 2005-12-01 12:17:47
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv430 Modified Files: editor_street.c Log Message: Fix find connected lines. Index: editor_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_street.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_street.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_street.c 1 Dec 2005 12:17:40 -0000 1.2 *************** *** 365,369 **** roadmap_plugin_set_line ! (&plugin_lines[count++], EditorPluginID, i, cfcc, fips); if (count >= size) return count; --- 365,369 ---- roadmap_plugin_set_line ! (&plugin_lines[count++], EditorPluginID, line, cfcc, fips); if (count >= size) return count; |
From: Ehud S. <esh...@us...> - 2005-12-01 12:17:26
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32751 Modified Files: editor_trkseg.c Log Message: Fix focus issues. Index: editor_trkseg.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_trkseg.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_trkseg.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_trkseg.c 1 Dec 2005 12:17:18 -0000 1.2 *************** *** 283,287 **** focus.north = split_position->latitude + 1000; ! roadmap_math_set_focus (&focus); editor_point_position (trk_from, &to); --- 283,287 ---- focus.north = split_position->latitude + 1000; ! //roadmap_math_set_focus (&focus); editor_point_position (trk_from, &to); *************** *** 317,321 **** } ! roadmap_math_release_focus (); if (smallest_distance == 0x7fffffff) { --- 317,321 ---- } ! //roadmap_math_release_focus (); if (smallest_distance == 0x7fffffff) { |
From: Ehud S. <esh...@us...> - 2005-12-01 12:17:09
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32551 Modified Files: editor_square.c Log Message: Check consistency between RoadMap's DB version and Editor DB. Index: editor_square.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_square.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_square.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_square.c 1 Dec 2005 12:16:51 -0000 1.2 *************** *** 52,55 **** --- 52,60 ---- RoadMapArea *edges = editor_db_get_active_edges (); + if (edges == NULL) { + ActiveSquaresDB = NULL; + return; + } + ActiveSquaresDB = (editor_db_section *) context; longitude_count = abs( |
From: Ehud S. <esh...@us...> - 2005-12-01 12:16:16
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32275 Modified Files: editor_point.c Log Message: A temporary fix for growing the DB. Index: editor_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_point.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_point.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_point.c 1 Dec 2005 12:16:07 -0000 1.2 *************** *** 83,86 **** --- 83,88 ---- } + /* FIXME this is a temporary solution for my bad DB design */ + editor_db_check_grow (); return id; } |
From: Ehud S. <esh...@us...> - 2005-12-01 12:15:21
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32061 Modified Files: editor_db.c editor_db.h Log Message: Check consistency between RoadMap's DB version and Editor DB. Index: editor_db.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_db.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_db.h 28 Nov 2005 19:47:50 -0000 1.1 --- editor_db.h 1 Dec 2005 12:15:09 -0000 1.2 *************** *** 53,56 **** --- 53,57 ---- int num_used_blocks; int file_size; + char rm_map_date[40]; } editor_db_header; *************** *** 75,78 **** --- 76,80 ---- int editor_db_grow (void); RoadMapArea *editor_db_get_active_edges(void); + void editor_db_check_grow (void); #endif // INCLUDE__EDITOR_DB__H Index: editor_db.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_db.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_db.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_db.c 1 Dec 2005 12:15:09 -0000 1.2 *************** *** 37,40 **** --- 37,42 ---- #include "roadmap_line.h" #include "roadmap_locator.h" + #include "roadmap_metadata.h" + #include "roadmap_messagebox.h" #include "buildmap.h" *************** *** 75,79 **** --- 77,107 ---- static void editor_header_activate (void *context) { + + int current_fips = roadmap_locator_active (); + ActiveDBHeader = (editor_db_header *) context; + + if (roadmap_locator_activate (ActiveDBHeader->fips) != ROADMAP_US_OK) { + + roadmap_messagebox + ("Error", "Can't activate roadmap's internal database"); + ActiveDBHeader = NULL; + return; + } + + if (strcmp + (ActiveDBHeader->rm_map_date, + roadmap_metadata_get_attribute ("Version", "Date"))) { + + roadmap_messagebox + ("Error", + "RoadMap database does match Editor data.\n Delete the editor database."); + ActiveDBHeader = NULL; + return; + } + + if ((current_fips >= 0) && (current_fips != roadmap_locator_active ())) { + roadmap_locator_activate (current_fips); + } } *************** *** 269,272 **** --- 297,301 ---- char name[100]; + const char *map_creation_date; buildmap_db *root; editor_db_header *header; *************** *** 299,302 **** --- 328,343 ---- } + map_creation_date = roadmap_metadata_get_attribute ("Version", "Date"); + + if (!strlen (map_creation_date) || + (strlen (map_creation_date) >= (sizeof (header->rm_map_date) - 1))) { + + editor_log + (ROADMAP_ERROR, + "Can't create new database (RM map has no valid timestamp): %s/%s", + roadmap_path_user(), name); + editor_log_pop (); + return -1; + } root = buildmap_db_add_section (NULL, "header"); *************** *** 310,313 **** --- 351,355 ---- header->block_size = DB_DEFAULT_BLOCK_SIZE; header->num_total_blocks = DB_DEFAULT_INITIAL_BLOCKS; + strcpy (header->rm_map_date, map_creation_date); add_db_section *************** *** 390,393 **** --- 432,438 ---- roadmap_db_activate (map_name); + + if (ActiveDBHeader == NULL) return -1; + EditorActiveCounty = fips; *************** *** 415,418 **** --- 460,465 ---- } + if (ActiveDBHeader == NULL) return -1; + EditorCache[oldest].fips = fips; EditorCache[oldest].last_access = access; *************** *** 629,633 **** */ ! if (ActiveDBHeader->num_used_blocks < ActiveDBHeader->num_total_blocks) { return 0; } --- 676,682 ---- */ ! if (ActiveDBHeader->num_used_blocks < ! (ActiveDBHeader->num_total_blocks - 10)) { ! return 0; } *************** *** 686,693 **** --- 735,755 ---- + void editor_db_check_grow (void) { + + if (ActiveDBHeader == NULL) return; + + if (ActiveDBHeader->num_used_blocks >= + (ActiveDBHeader->num_total_blocks - 10)) { + + editor_db_grow (); + } + } + + void *editor_map (roadmap_db *root) { return roadmap_db_get_data (root); } + void editor_unmap (void *context) {} |
From: Ehud S. <esh...@us...> - 2005-12-01 12:13:44
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31655 Modified Files: editor_screen.c Log Message: Show current street sign when a street is clicked on. Index: editor_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_screen.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** editor_screen.c 28 Nov 2005 20:42:59 -0000 1.4 --- editor_screen.c 1 Dec 2005 12:13:33 -0000 1.5 *************** *** 33,36 **** --- 33,38 ---- #include "roadmap_canvas.h" #include "roadmap_screen.h" + #include "roadmap_trip.h" + #include "roadmap_display.h" #include "roadmap_math.h" #include "roadmap_navigate.h" *************** *** 56,60 **** #include "static/editor_dialog.h" ! #include "track/editor_track.h" #include "editor_screen.h" --- 58,62 ---- #include "static/editor_dialog.h" ! #include "track/editor_track_main.h" #include "editor_screen.h" *************** *** 213,216 **** --- 215,219 ---- RoadMapPosition position; PluginLine line; + PluginStreet street; int distance; *************** *** 223,229 **** --- 226,234 ---- select_count = 0; + roadmap_display_hide ("Selected Street"); roadmap_screen_redraw (); return; } + for (i=0; i<select_count; i++) { if (roadmap_plugin_same_line(&SelectedLines[i].line, &line)) break; *************** *** 238,250 **** select_count--; - roadmap_screen_redraw (); - return; - } ! if (select_count == MAX_LINE_SELECTIONS) return; ! SelectedLines[select_count].line = line; ! select_count++; roadmap_screen_redraw (); } --- 243,258 ---- select_count--; ! } else { ! if (select_count < MAX_LINE_SELECTIONS) { + SelectedLines[select_count].line = line; + select_count++; + } + } + + roadmap_trip_set_point ("Selection", &position); + roadmap_display_activate ("Selected Street", &line, &position, &street); roadmap_screen_redraw (); } |
From: Ehud S. <esh...@us...> - 2005-12-01 12:12:55
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31403 Modified Files: editor_main.c Log Message: Fix include file Index: editor_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editor_main.c 28 Nov 2005 20:42:59 -0000 1.3 --- editor_main.c 1 Dec 2005 12:12:43 -0000 1.4 *************** *** 32,36 **** #include "editor_screen.h" ! #include "track/editor_track.h" #include "editor_plugin.h" #include "editor_main.h" --- 32,36 ---- #include "editor_screen.h" ! #include "track/editor_track_main.h" #include "editor_plugin.h" #include "editor_main.h" |
From: Ehud S. <esh...@us...> - 2005-11-30 08:16:06
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9462 Modified Files: editor_track_main.c editor_track_main.h Log Message: Added shutdown callback. Index: editor_track_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_track_main.h 28 Nov 2005 19:47:50 -0000 1.1 --- editor_track_main.h 30 Nov 2005 08:15:57 -0000 1.2 *************** *** 25,28 **** --- 25,30 ---- #define INCLUDE__EDITOR_TRACK_MAIN__H + #include "roadmap_gps.h" + typedef struct { *************** *** 51,54 **** --- 53,57 ---- RoadMapGpsPosition *track_point_gps (int index); int track_point_time (int index); + void editor_track_end (void); #endif // INCLUDE__EDITOR_TRACK_MAIN__H Index: editor_track_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_track_main.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_track_main.c 30 Nov 2005 08:15:57 -0000 1.2 *************** *** 114,119 **** points_count -= last_point_id; ! memmove (TrackPoints, TrackPoints + last_point_id, ! sizeof(TrackPoints[0]) * points_count); } --- 114,121 ---- points_count -= last_point_id; ! if (points_count > 0) { ! memmove (TrackPoints, TrackPoints + last_point_id, ! sizeof(TrackPoints[0]) * points_count); ! } } *************** *** 443,473 **** * This is probably a new GPS track. */ - if (cur_active_line) { - - TrackNewSegment segment; - - segment.point_id = points_count - 1; - segment.type = TRACK_ROAD_REG; - - end_unknown_segments (&segment, 1); - cur_active_line = 0; - } else { ! if (TrackConfirmedStreet.valid) { ! editor_track_known_end_segment ! (&TrackPreviousLine.line, ! points_count - 1, ! &TrackConfirmedLine.line, ! is_new_track); ! } ! } ! ! TrackConfirmedStreet.valid = 0; ! track_reset_points (points_count); ! cur_node.id = -1; ! is_new_track = 1; return; } ! while ((filtered_gps_point = editor_track_filter_get (filter)) != NULL) { --- 445,453 ---- * This is probably a new GPS track. */ ! editor_track_end (); return; } ! while ((filtered_gps_point = editor_track_filter_get (filter)) != NULL) { *************** *** 518,521 **** --- 498,533 ---- + void editor_track_end (void) { + + if (points_count > 1) { + + if (cur_active_line) { + + TrackNewSegment segment; + + segment.point_id = points_count - 1; + segment.type = TRACK_ROAD_REG; + + end_unknown_segments (&segment, 1); + cur_active_line = 0; + } else { + + if (TrackConfirmedStreet.valid) { + editor_track_known_end_segment + (&TrackPreviousLine.line, + points_count - 1, + &TrackConfirmedLine.line, + is_new_track); + } + } + } + + TrackConfirmedStreet.valid = 0; + track_reset_points (points_count); + cur_node.id = -1; + is_new_track = 1; + } + + static void editor_track_shape_position (int shape, RoadMapPosition *position) { |
From: Ehud S. <esh...@us...> - 2005-11-30 08:14:50
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9093 Modified Files: editor_track_util.c Log Message: Added speed limit attribute. Index: editor_track_util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_track_util.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_track_util.c 30 Nov 2005 08:14:39 -0000 1.2 *************** *** 748,751 **** --- 748,752 ---- short from_flags; short to_flags; + short speed_limit = 0; if (plugin_id == ROADMAP_PLUGIN_ID) { *************** *** 757,764 **** if (route == -1) { ! route = editor_route_segment_add (0, 0); from_flags = to_flags = 0; } else { ! editor_route_segment_get (route, &from_flags, &to_flags); } --- 758,765 ---- 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); } *************** *** 772,776 **** if (route != -1) { ! editor_route_segment_set (route, from_flags, to_flags); } } --- 773,777 ---- if (route != -1) { ! editor_route_segment_set (route, from_flags, to_flags, speed_limit); } } *************** *** 877,881 **** editor_line_set_trksegs (line_id, trkseg, trkseg2); ! route = editor_route_segment_add (ED_ROUTE_CAR, 0); editor_line_set_route (line_id, route); --- 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); |
From: Ehud S. <esh...@us...> - 2005-11-30 08:14:05
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/static In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8891 Modified Files: editor_dialog.c Log Message: Added speed limit attribute. Fixed find near street. Index: editor_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/static/editor_dialog.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_dialog.c 28 Nov 2005 19:47:50 -0000 1.1 --- editor_dialog.c 30 Nov 2005 08:13:57 -0000 1.2 *************** *** 139,142 **** --- 139,146 ---- sizeof(neighbours) / sizeof(RoadMapNeighbour)); + count = roadmap_plugin_get_closest + (&point, layers, layers_count, neighbours, count, + sizeof(neighbours) / sizeof(RoadMapNeighbour)); + for (i = 0; i < count; ++i) { *************** *** 212,215 **** --- 216,222 ---- char *zip = (char *) roadmap_dialog_get_data ("General", "Zip code"); + char *speed_limit_str = + (char *) roadmap_dialog_get_data ("General", "Speed Limit"); + int street_id; int street_range_id; *************** *** 219,226 **** --- 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++) { *************** *** 282,290 **** if (route_id == -1) { ! route_id = editor_route_segment_add (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); } --- 291,299 ---- 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); } *************** *** 303,307 **** if (route_id != -1) { editor_route_segment_set ! (route_id, route_from_flags, route_to_flags); } --- 312,316 ---- if (route_id != -1) { editor_route_segment_set ! (route_id, route_from_flags, route_to_flags, speed_limit); } *************** *** 348,354 **** --- 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; *************** *** 373,376 **** --- 384,388 ---- int this_r_to = -1; int this_direction = 0; + short this_speed_limit = 0; int route_id; *************** *** 406,409 **** --- 418,422 ---- this_direction = editor_route_get_direction (route_id, ED_ROUTE_CAR); + editor_route_segment_get (route_id, NULL, NULL, &this_speed_limit); } } *************** *** 442,445 **** --- 455,459 ---- this_direction = editor_route_get_direction (route_id, ED_ROUTE_CAR); + editor_route_segment_get (route_id, NULL, NULL, &this_speed_limit); } } *************** *** 489,492 **** --- 503,518 ---- } + if (same_speed_limit) { + + if (!speed_limit) { + speed_limit = this_speed_limit; + } else { + if (this_speed_limit && (speed_limit != this_speed_limit)) { + speed_limit = 0; + same_speed_limit = 0; + } + } + } + if (same_l_city) { if (!strlen(l_city)) { *************** *** 575,578 **** --- 601,607 ---- } roadmap_dialog_set_data ("General", "Direction", (void *)direction); + + snprintf(range_str, sizeof(range_str), "%d", speed_limit); + roadmap_dialog_set_data ("General", "Speed Limit", range_str); /* Left side */ *************** *** 650,653 **** --- 679,683 ---- roadmap_dialog_new_choice ("General", "Direction", 4, direction_txts, (void**)direction_values, NULL); + roadmap_dialog_new_entry ("General", "Speed Limit"); roadmap_dialog_add_button ("Cancel", editor_segments_cancel); |