You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(59) |
Sep
(43) |
Oct
(95) |
Nov
(135) |
Dec
(108) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(229) |
Feb
(141) |
Mar
(59) |
Apr
(70) |
May
(64) |
Jun
(87) |
Jul
(57) |
Aug
(108) |
Sep
(74) |
Oct
(203) |
Nov
(141) |
Dec
(108) |
| 2009 |
Jan
(114) |
Feb
(91) |
Mar
(101) |
Apr
(69) |
May
(54) |
Jun
(82) |
Jul
(49) |
Aug
(109) |
Sep
(81) |
Oct
(93) |
Nov
(100) |
Dec
(79) |
| 2010 |
Jan
(46) |
Feb
(36) |
Mar
(135) |
Apr
(103) |
May
(116) |
Jun
(130) |
Jul
(52) |
Aug
(31) |
Sep
(46) |
Oct
(48) |
Nov
(98) |
Dec
(110) |
| 2011 |
Jan
(234) |
Feb
(184) |
Mar
(150) |
Apr
(43) |
May
(53) |
Jun
(52) |
Jul
(112) |
Aug
(72) |
Sep
(79) |
Oct
(23) |
Nov
(6) |
Dec
(30) |
| 2012 |
Jan
(39) |
Feb
(37) |
Mar
(49) |
Apr
(60) |
May
(63) |
Jun
(38) |
Jul
(33) |
Aug
(24) |
Sep
(20) |
Oct
(14) |
Nov
(23) |
Dec
(50) |
| 2013 |
Jan
(30) |
Feb
(32) |
Mar
(27) |
Apr
(41) |
May
(59) |
Jun
(21) |
Jul
(10) |
Aug
(73) |
Sep
(23) |
Oct
(60) |
Nov
(14) |
Dec
(15) |
| 2014 |
Jan
(4) |
Feb
(8) |
Mar
(11) |
Apr
(6) |
May
(27) |
Jun
(4) |
Jul
(29) |
Aug
(62) |
Sep
(11) |
Oct
(17) |
Nov
(58) |
Dec
(9) |
| 2015 |
Jan
(23) |
Feb
(3) |
Mar
(26) |
Apr
(47) |
May
(8) |
Jun
(28) |
Jul
(10) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <md...@us...> - 2013-04-07 21:16:18
|
Revision: 5430
http://navit.svn.sourceforge.net/navit/?rev=5430&view=rev
Author: mdankov
Date: 2013-04-07 21:16:03 +0000 (Sun, 07 Apr 2013)
Log Message:
-----------
Add:maptool:Process de:place=city tags for German town boundaries not marked as admin_level=8.
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-04-06 21:19:46 UTC (rev 5429)
+++ trunk/navit/navit/maptool/osm.c 2013-04-07 21:16:03 UTC (rev 5430)
@@ -717,6 +717,7 @@
"w place=municipality poly_place4\n"
"w place=town poly_place5\n"
"w place=city poly_place6\n"
+ "w de:place=city poly_place6\n"
"w power=line powerline\n"
"w railway=abandoned rail_abandoned\n"
"w railway=disused rail_disused\n"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-04-06 21:19:56
|
Revision: 5429
http://navit.svn.sourceforge.net/navit/?rev=5429&view=rev
Author: mdankov
Date: 2013-04-06 21:19:46 +0000 (Sat, 06 Apr 2013)
Log Message:
-----------
Add:gui_internatl:In town and street search dialogs, select default keyboard based on the country selected, not on interface language. Expand Cyrillic country list.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_bookmark.c
trunk/navit/navit/gui/internal/gui_internal_command.c
trunk/navit/navit/gui/internal/gui_internal_html.c
trunk/navit/navit/gui/internal/gui_internal_keyboard.c
trunk/navit/navit/gui/internal/gui_internal_keyboard.h
trunk/navit/navit/gui/internal/gui_internal_poi.c
trunk/navit/navit/gui/internal/gui_internal_search.c
Modified: trunk/navit/navit/gui/internal/gui_internal_bookmark.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_bookmark.c 2013-04-06 09:27:53 UTC (rev 5428)
+++ trunk/navit/navit/gui/internal/gui_internal_bookmark.c 2013-04-06 21:19:46 UTC (rev 5429)
@@ -1,4 +1,5 @@
#include <glib.h>
+#include <stdlib.h>
#include "color.h"
#include "coord.h"
#include "point.h"
@@ -102,7 +103,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode(getenv("LANG"))));
gui_internal_menu_render(this);
}
@@ -130,7 +131,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode(getenv("LANG"))));
gui_internal_menu_render(this);
}
@@ -159,7 +160,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode(getenv("LANG"))));
gui_internal_menu_render(this);
}
Modified: trunk/navit/navit/gui/internal/gui_internal_command.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_command.c 2013-04-06 09:27:53 UTC (rev 5428)
+++ trunk/navit/navit/gui/internal/gui_internal_command.c 2013-04-06 21:19:46 UTC (rev 5429)
@@ -827,7 +827,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode(getenv("LANG"))));
gui_internal_menu_render(this);
gui_internal_leave(this);
}
Modified: trunk/navit/navit/gui/internal/gui_internal_html.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_html.c 2013-04-06 09:27:53 UTC (rev 5428)
+++ trunk/navit/navit/gui/internal/gui_internal_html.c 2013-04-06 21:19:46 UTC (rev 5429)
@@ -486,7 +486,7 @@
g_free(doc);
if (this->keyboard_required && this->keyboard) {
this->html_container->flags=gravity_center|orientation_vertical|flags_expand|flags_fill;
- gui_internal_widget_append(this->html_container, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
+ gui_internal_widget_append(this->html_container, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode(getenv("LANG"))));
}
gui_internal_menu_render(this);
graphics_draw_mode(this->gra, draw_mode_end);
Modified: trunk/navit/navit/gui/internal/gui_internal_keyboard.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_keyboard.c 2013-04-06 09:27:53 UTC (rev 5428)
+++ trunk/navit/navit/gui/internal/gui_internal_keyboard.c 2013-04-06 21:19:46 UTC (rev 5429)
@@ -330,22 +330,31 @@
gui_internal_keyboard_do(this, key->data, key->datai);
}
int
-gui_internal_keyboard_init_mode(void)
+gui_internal_keyboard_init_mode(char *lang)
{
-/*
- Set cyrillic keyboard for Russia, Ukraine, Belarus, Kazakhstan
-*/
- int ret;
- char *lang;
- lang=getenv("LANG");
- ret=0;
+ int ret=0;
+ /*
+ * Set cyrillic keyboard for countries using Cyrillic alphabet
+ */
if (strstr(lang,"RU"))
ret = 40;
if (strstr(lang,"UA"))
ret = 40;
if (strstr(lang,"BY"))
ret = 40;
+ if (strstr(lang,"RS"))
+ ret = 40;
+ if (strstr(lang,"BG"))
+ ret = 40;
+ if (strstr(lang,"MK"))
+ ret = 40;
if (strstr(lang,"KZ"))
ret = 40;
+ if (strstr(lang,"KG"))
+ ret = 40;
+ if (strstr(lang,"TJ"))
+ ret = 40;
+ if (strstr(lang,"MN"))
+ ret = 40;
return ret;
}
Modified: trunk/navit/navit/gui/internal/gui_internal_keyboard.h
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_keyboard.h 2013-04-06 09:27:53 UTC (rev 5428)
+++ trunk/navit/navit/gui/internal/gui_internal_keyboard.h 2013-04-06 21:19:46 UTC (rev 5429)
@@ -3,5 +3,5 @@
struct widget;
struct widget *gui_internal_keyboard_do(struct gui_priv *this, struct widget *wkbdb, int mode);
struct widget *gui_internal_keyboard(struct gui_priv *this, int mode);
-int gui_internal_keyboard_init_mode(void);
+int gui_internal_keyboard_init_mode(char *lang);
/* end of prototypes */
Modified: trunk/navit/navit/gui/internal/gui_internal_poi.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_poi.c 2013-04-06 09:27:53 UTC (rev 5428)
+++ trunk/navit/navit/gui/internal/gui_internal_poi.c 2013-04-06 21:19:46 UTC (rev 5429)
@@ -484,7 +484,7 @@
{
struct widget *wb, *w, *wr, *wk, *we;
int keyboard_mode;
- keyboard_mode=2+gui_internal_keyboard_init_mode();
+ keyboard_mode=2+gui_internal_keyboard_init_mode(getenv("LANG"));
wb=gui_internal_menu(this,"Filter");
w=gui_internal_box_new(this, gravity_center|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(wb, w);
Modified: trunk/navit/navit/gui/internal/gui_internal_search.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_search.c 2013-04-06 09:27:53 UTC (rev 5428)
+++ trunk/navit/navit/gui/internal/gui_internal_search.c 2013-04-06 21:19:46 UTC (rev 5429)
@@ -1,4 +1,5 @@
#include <glib.h>
+#include <stdlib.h>
#include "config.h"
#include "color.h"
#include "coord.h"
@@ -479,8 +480,8 @@
struct widget *wb,*wk,*w,*wr,*we,*wl,*wnext=NULL;
char *country;
int keyboard_mode;
- keyboard_mode=2+gui_internal_keyboard_init_mode();
gui_internal_search_list_new(this);
+ keyboard_mode=2+gui_internal_keyboard_init_mode(this->country_iso2?this->country_iso2:getenv("LANG"));
wb=gui_internal_menu(this, what);
w=gui_internal_box_new(this, gravity_center|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(wb, w);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-04-06 09:28:01
|
Revision: 5428
http://navit.svn.sourceforge.net/navit/?rev=5428&view=rev
Author: mdankov
Date: 2013-04-06 09:27:53 +0000 (Sat, 06 Apr 2013)
Log Message:
-----------
Add:maptool:Consider empty member roles ot be "outer" in town boundary polygons.
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-04-02 21:21:44 UTC (rev 5427)
+++ trunk/navit/navit/maptool/osm.c 2013-04-06 09:27:53 UTC (rev 5428)
@@ -1951,7 +1951,7 @@
GList *s=b->sorted_segments;
while(s) {
struct geom_poly_segment *seg=s->data;
- if(seg->type==geom_poly_segment_type_way_outer && coord_is_equal(*seg->first,*seg->last)) {
+ if((seg->type==geom_poly_segment_type_way_outer || seg->type==geom_poly_segment_type_way_unknown) && coord_is_equal(*seg->first,*seg->last)) {
struct item_bin *ib=init_item(b->ib->type);
void *a;
item_bin_add_coord(ib, seg->first, seg->last-seg->first+1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-04-02 21:21:53
|
Revision: 5427
http://navit.svn.sourceforge.net/navit/?rev=5427&view=rev
Author: mdankov
Date: 2013-04-02 21:21:44 +0000 (Tue, 02 Apr 2013)
Log Message:
-----------
Add:maptool:Convert France regions,departments,communes to navit's states,counties,towns. Related to #1097.
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-04-02 20:46:21 UTC (rev 5426)
+++ trunk/navit/navit/maptool/osm.c 2013-04-02 21:21:44 UTC (rev 5427)
@@ -204,7 +204,7 @@
{ 242,"Fiji"},
{ 246,"Finland,Suomi"},
{ 248,"Åland Islands"},
- { 250,"France,République française,FR"},
+ { 250,"France,République française,FR","3s5c7M"},
{ 254,"French Guiana"},
{ 258,"French Polynesia"},
{ 260,"French Southern Territories"},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-04-02 20:46:28
|
Revision: 5426
http://navit.svn.sourceforge.net/navit/?rev=5426&view=rev
Author: mdankov
Date: 2013-04-02 20:46:21 +0000 (Tue, 02 Apr 2013)
Log Message:
-----------
Fix:maptool:Let towns_poly temp file be removed.
Modified Paths:
--------------
trunk/navit/navit/maptool/maptool.c
trunk/navit/navit/maptool/maptool.h
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/maptool.c
===================================================================
--- trunk/navit/navit/maptool/maptool.c 2013-04-01 21:17:32 UTC (rev 5425)
+++ trunk/navit/navit/maptool/maptool.c 2013-04-02 20:46:21 UTC (rev 5426)
@@ -714,6 +714,7 @@
tempfile_unlink(suffix,"boundaries");
tempfile_unlink(suffix,"way2poi_result");
tempfile_unlink(suffix,"coastline_result");
+ tempfile_unlink(suffix,"towns_poly");
unlink("coords.tmp");
}
if (last) {
@@ -896,7 +897,7 @@
if (towns) {
boundaries=tempfile(suffix,"boundaries",0);
ways=tempfile(suffix,"ways_split",0);
- osm_process_towns(towns,boundaries,ways);
+ osm_process_towns(towns,boundaries,ways,suffix);
fclose(ways);
fclose(boundaries);
fclose(towns);
Modified: trunk/navit/navit/maptool/maptool.h
===================================================================
--- trunk/navit/navit/maptool/maptool.h 2013-04-01 21:17:32 UTC (rev 5425)
+++ trunk/navit/navit/maptool/maptool.h 2013-04-02 20:46:21 UTC (rev 5426)
@@ -270,7 +270,7 @@
void process_way2poi(FILE *in, FILE *out, int type);
int map_find_intersections(FILE *in, FILE *out, FILE *out_index, FILE *out_graph, FILE *out_coastline, int final);
void write_countrydir(struct zip_info *zip_info, int max_index_size);
-void osm_process_towns(FILE *in, FILE *boundaries, FILE *ways);
+void osm_process_towns(FILE *in, FILE *boundaries, FILE *ways, char *suffix);
void load_countries(void);
void remove_countryfiles(void);
struct country_table * country_from_iso2(char *iso);
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-04-01 21:17:32 UTC (rev 5425)
+++ trunk/navit/navit/maptool/osm.c 2013-04-02 20:46:21 UTC (rev 5426)
@@ -1973,7 +1973,7 @@
void
-osm_process_towns(FILE *in, FILE *boundaries, FILE *ways)
+osm_process_towns(FILE *in, FILE *boundaries, FILE *ways, char *suffix)
{
struct item_bin *ib;
GList *bl;
@@ -2057,7 +2057,7 @@
}
}
- towns_poly=tempfile("","towns_poly",1);
+ towns_poly=tempfile(suffix,"towns_poly",1);
osm_town_relations_to_poly(bl, towns_poly);
fclose(towns_poly);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-04-01 21:17:39
|
Revision: 5425
http://navit.svn.sourceforge.net/navit/?rev=5425&view=rev
Author: mdankov
Date: 2013-04-01 21:17:32 +0000 (Mon, 01 Apr 2013)
Log Message:
-----------
Fix:core:Remove excessive NULL check which is anyway done in the map_search_destroy.
Modified Paths:
--------------
trunk/navit/navit/mapset.c
Modified: trunk/navit/navit/mapset.c
===================================================================
--- trunk/navit/navit/mapset.c 2013-04-01 21:10:44 UTC (rev 5424)
+++ trunk/navit/navit/mapset.c 2013-04-01 21:17:32 UTC (rev 5425)
@@ -394,8 +394,7 @@
mapset_search_destroy(struct mapset_search *this_)
{
if (this_) {
- if(this_->ms)
- map_search_destroy(this_->ms);
+ map_search_destroy(this_->ms);
g_free(this_);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-04-01 21:10:51
|
Revision: 5424
http://navit.svn.sourceforge.net/navit/?rev=5424&view=rev
Author: mdankov
Date: 2013-04-01 21:10:44 +0000 (Mon, 01 Apr 2013)
Log Message:
-----------
Add:maptool:Merge to mainstream current experimental features to convert town border relations to town polygones.
Modified Paths:
--------------
trunk/navit/navit/maptool/maptool.c
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/maptool.c
===================================================================
--- trunk/navit/navit/maptool/maptool.c 2013-04-01 21:05:34 UTC (rev 5423)
+++ trunk/navit/navit/maptool/maptool.c 2013-04-01 21:10:44 UTC (rev 5424)
@@ -832,7 +832,7 @@
exit(0);
}
}
-#if 0
+#if 1
if (experimental) {
fprintf(stderr,"No experimental features available\n");
exit(0);
@@ -922,6 +922,8 @@
if (p.process_relations) {
filenames[filename_count]="relations";
referencenames[filename_count++]=NULL;
+ filenames[filename_count]="towns_poly";
+ referencenames[filename_count++]=NULL;
}
if (p.process_ways) {
filenames[filename_count]="ways_split";
@@ -935,10 +937,6 @@
filenames[filename_count]="way2poi_result";
referencenames[filename_count++]=NULL;
}
- if(experimental) {
- filenames[filename_count]="towns_poly";
- referencenames[filename_count++]=NULL;
- }
for (i = suffix_start ; i < suffix_count ; i++) {
suffix=suffixes[i];
if (start_phase(&p,"generating tiles")) {
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-04-01 21:05:34 UTC (rev 5423)
+++ trunk/navit/navit/maptool/osm.c 2013-04-01 21:10:44 UTC (rev 5424)
@@ -1552,7 +1552,7 @@
in_relation=0;
- if(experimental && attr_longest_match(attr_mapping_rel2poly_place, attr_mapping_rel2poly_place_count, &type, 1)) {
+ if(attr_longest_match(attr_mapping_rel2poly_place, attr_mapping_rel2poly_place_count, &type, 1)) {
item_bin->type=type;
}
else
@@ -1627,8 +1627,7 @@
item_bin_add_attr_string(item_bin, attr_osm_tag, tag);
}
- if(experimental)
- osm_update_attr_present(k,v);
+ osm_update_attr_present(k,v);
}
@@ -1907,8 +1906,7 @@
attr_type=attr_county_name;
break;
case 'M':
- if(experimental)
- b->ib->type=type_poly_place6;
+ b->ib->type=type_poly_place6;
case 'm':
attr_type=attr_municipality_name;
break;
@@ -1981,6 +1979,7 @@
GList *bl;
GHashTable *town_hash;
struct attr attrs[11];
+ FILE *towns_poly;
profile(0,NULL);
bl=process_boundaries(boundaries, ways);
@@ -2058,11 +2057,9 @@
}
}
- if(experimental) {
- FILE *f=tempfile("","towns_poly",1);
- osm_town_relations_to_poly(bl, f);
- fclose(f);
- }
+ towns_poly=tempfile("","towns_poly",1);
+ osm_town_relations_to_poly(bl, towns_poly);
+ fclose(towns_poly);
g_hash_table_destroy(town_hash);
profile(0, "Finished processing towns\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-04-01 21:05:44
|
Revision: 5423
http://navit.svn.sourceforge.net/navit/?rev=5423&view=rev
Author: mdankov
Date: 2013-04-01 21:05:34 +0000 (Mon, 01 Apr 2013)
Log Message:
-----------
Fix:core:Do not ignore attr_[search_]active on the first map in mapset when doing a search. Properly call map_search_destroy from mapset_search* functions.
Modified Paths:
--------------
trunk/navit/navit/mapset.c
Modified: trunk/navit/navit/mapset.c
===================================================================
--- trunk/navit/navit/mapset.c 2013-03-25 20:58:08 UTC (rev 5422)
+++ trunk/navit/navit/mapset.c 2013-04-01 21:05:34 UTC (rev 5423)
@@ -284,6 +284,7 @@
struct item *item; /**< "Superior" item. */
struct attr *search_attr; /**< Attribute to be searched for. */
int partial; /**< Indicates if one would like to have partial matches */
+ struct mapset *mapset; /**< reference to current mapset. Set to NULL when all maps are searched */
};
/**
@@ -313,11 +314,10 @@
this=g_new0(struct mapset_search,1);
if(this != NULL && ms!=NULL )
{
- this->map=ms->maps;
+ this->mapset=ms;
this->item=item;
this->search_attr=search_attr;
this->partial=partial;
- this->ms=map_search_new(this->map->data, item, search_attr, partial);
return this;
}
else
@@ -341,14 +341,30 @@
{
struct item *ret=NULL;
struct attr active_attr;
+ int country_search=this_->search_attr->type >= attr_country_all && this_->search_attr->type <= attr_country_name;
- while ((this_) && (!this_->ms || !(ret=map_search_get_item(this_->ms)))) { /* The current map has no more items to be returned */
- if (this_->search_attr->type >= attr_country_all && this_->search_attr->type <= attr_country_name)
+ while ((this_) && (this_->mapset) && (!this_->ms || !(ret=map_search_get_item(this_->ms)))) { /* The current map has no more items to be returned */
+
+ /* Use only the first map from the mapset to search for country codes. */
+ if (this_->map && country_search)
break;
+
for (;;) {
- this_->map=g_list_next(this_->map);
- if (! this_->map)
+ if (!this_->map)
+ this_->map=this_->mapset->maps;
+ else
+ this_->map=g_list_next(this_->map);
+
+ if (!this_->map) {
+ /* No more maps left, mark this mapset_search as finished */
+ this_->mapset=NULL;
break;
+ }
+
+ /* Any map can be used for country search, regardless of it's attr_active value */
+ if(country_search)
+ break;
+
if (map_get_attr(this_->map->data, attr_search_active, &active_attr, NULL)) {
if (!active_attr.u.num)
continue;
@@ -358,9 +374,12 @@
if (active_attr.u.num)
break;
}
+ if(this_->ms) {
+ map_search_destroy(this_->ms);
+ this_->ms=NULL;
+ }
if (! this_->map)
break;
- map_search_destroy(this_->ms);
this_->ms=map_search_new(this_->map->data, this_->item, this_->search_attr, this_->partial);
}
return ret;
@@ -375,7 +394,8 @@
mapset_search_destroy(struct mapset_search *this_)
{
if (this_) {
- map_search_destroy(this_->ms);
+ if(this_->ms)
+ map_search_destroy(this_->ms);
g_free(this_);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wor...@us...> - 2013-03-25 20:58:15
|
Revision: 5422
http://navit.svn.sourceforge.net/navit/?rev=5422&view=rev
Author: worldcitizen
Date: 2013-03-25 20:58:08 +0000 (Mon, 25 Mar 2013)
Log Message:
-----------
Fixed:
warning: implicit declaration of function 'getenv'
compile issue
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_keyboard.c
Modified: trunk/navit/navit/gui/internal/gui_internal_keyboard.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_keyboard.c 2013-03-24 11:36:01 UTC (rev 5421)
+++ trunk/navit/navit/gui/internal/gui_internal_keyboard.c 2013-03-25 20:58:08 UTC (rev 5422)
@@ -1,4 +1,5 @@
#include <glib.h>
+#include <stdlib.h>
#include "color.h"
#include "coord.h"
#include "point.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-24 11:36:11
|
Revision: 5421
http://navit.svn.sourceforge.net/navit/?rev=5421&view=rev
Author: martin-s
Date: 2013-03-24 11:36:01 +0000 (Sun, 24 Mar 2013)
Log Message:
-----------
Add:gui_internal:Select cyrillian keyboard for cyrillic languages|Thanks alx
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_bookmark.c
trunk/navit/navit/gui/internal/gui_internal_command.c
trunk/navit/navit/gui/internal/gui_internal_html.c
trunk/navit/navit/gui/internal/gui_internal_keyboard.c
trunk/navit/navit/gui/internal/gui_internal_keyboard.h
trunk/navit/navit/gui/internal/gui_internal_poi.c
trunk/navit/navit/gui/internal/gui_internal_search.c
Modified: trunk/navit/navit/gui/internal/gui_internal_bookmark.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_bookmark.c 2013-03-24 00:19:03 UTC (rev 5420)
+++ trunk/navit/navit/gui/internal/gui_internal_bookmark.c 2013-03-24 11:36:01 UTC (rev 5421)
@@ -15,7 +15,6 @@
#include "gui_internal_keyboard.h"
#include "gui_internal_bookmark.h"
-
static void
gui_internal_cmd_add_bookmark_do(struct gui_priv *this, struct widget *widget)
{
@@ -103,7 +102,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
}
@@ -131,7 +130,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
}
@@ -160,7 +159,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
}
Modified: trunk/navit/navit/gui/internal/gui_internal_command.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_command.c 2013-03-24 00:19:03 UTC (rev 5420)
+++ trunk/navit/navit/gui/internal/gui_internal_command.c 2013-03-24 11:36:01 UTC (rev 5421)
@@ -827,7 +827,7 @@
wl=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(w, wl);
if (this->keyboard)
- gui_internal_widget_append(w, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(w, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
gui_internal_menu_render(this);
gui_internal_leave(this);
}
Modified: trunk/navit/navit/gui/internal/gui_internal_html.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_html.c 2013-03-24 00:19:03 UTC (rev 5420)
+++ trunk/navit/navit/gui/internal/gui_internal_html.c 2013-03-24 11:36:01 UTC (rev 5421)
@@ -486,7 +486,7 @@
g_free(doc);
if (this->keyboard_required && this->keyboard) {
this->html_container->flags=gravity_center|orientation_vertical|flags_expand|flags_fill;
- gui_internal_widget_append(this->html_container, gui_internal_keyboard(this,2));
+ gui_internal_widget_append(this->html_container, gui_internal_keyboard(this,2+gui_internal_keyboard_init_mode()));
}
gui_internal_menu_render(this);
graphics_draw_mode(this->gra, draw_mode_end);
Modified: trunk/navit/navit/gui/internal/gui_internal_keyboard.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_keyboard.c 2013-03-24 00:19:03 UTC (rev 5420)
+++ trunk/navit/navit/gui/internal/gui_internal_keyboard.c 2013-03-24 11:36:01 UTC (rev 5421)
@@ -328,3 +328,23 @@
{
gui_internal_keyboard_do(this, key->data, key->datai);
}
+int
+gui_internal_keyboard_init_mode(void)
+{
+/*
+ Set cyrillic keyboard for Russia, Ukraine, Belarus, Kazakhstan
+*/
+ int ret;
+ char *lang;
+ lang=getenv("LANG");
+ ret=0;
+ if (strstr(lang,"RU"))
+ ret = 40;
+ if (strstr(lang,"UA"))
+ ret = 40;
+ if (strstr(lang,"BY"))
+ ret = 40;
+ if (strstr(lang,"KZ"))
+ ret = 40;
+ return ret;
+}
Modified: trunk/navit/navit/gui/internal/gui_internal_keyboard.h
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_keyboard.h 2013-03-24 00:19:03 UTC (rev 5420)
+++ trunk/navit/navit/gui/internal/gui_internal_keyboard.h 2013-03-24 11:36:01 UTC (rev 5421)
@@ -3,4 +3,5 @@
struct widget;
struct widget *gui_internal_keyboard_do(struct gui_priv *this, struct widget *wkbdb, int mode);
struct widget *gui_internal_keyboard(struct gui_priv *this, int mode);
+int gui_internal_keyboard_init_mode(void);
/* end of prototypes */
Modified: trunk/navit/navit/gui/internal/gui_internal_poi.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_poi.c 2013-03-24 00:19:03 UTC (rev 5420)
+++ trunk/navit/navit/gui/internal/gui_internal_poi.c 2013-03-24 11:36:01 UTC (rev 5421)
@@ -483,7 +483,8 @@
gui_internal_cmd_pois_filter(struct gui_priv *this, struct widget *wm, void *data)
{
struct widget *wb, *w, *wr, *wk, *we;
- int keyboard_mode=2;
+ int keyboard_mode;
+ keyboard_mode=2+gui_internal_keyboard_init_mode();
wb=gui_internal_menu(this,"Filter");
w=gui_internal_box_new(this, gravity_center|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(wb, w);
Modified: trunk/navit/navit/gui/internal/gui_internal_search.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_search.c 2013-03-24 00:19:03 UTC (rev 5420)
+++ trunk/navit/navit/gui/internal/gui_internal_search.c 2013-03-24 11:36:01 UTC (rev 5421)
@@ -478,7 +478,8 @@
{
struct widget *wb,*wk,*w,*wr,*we,*wl,*wnext=NULL;
char *country;
- int keyboard_mode=2;
+ int keyboard_mode;
+ keyboard_mode=2+gui_internal_keyboard_init_mode();
gui_internal_search_list_new(this);
wb=gui_internal_menu(this, what);
w=gui_internal_box_new(this, gravity_center|orientation_vertical|flags_expand|flags_fill);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-03-24 00:19:14
|
Revision: 5420
http://navit.svn.sourceforge.net/navit/?rev=5420&view=rev
Author: mdankov
Date: 2013-03-24 00:19:03 +0000 (Sun, 24 Mar 2013)
Log Message:
-----------
Add:maptool:Experimental feature to convert DE municipality (admin_level=8) boundaries to city borders.
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-03-19 21:27:24 UTC (rev 5419)
+++ trunk/navit/navit/maptool/osm.c 2013-03-24 00:19:03 UTC (rev 5420)
@@ -213,7 +213,7 @@
{ 268,"Georgia"},
{ 270,"Gambia"},
{ 275,"Palestinian Territory, Occupied"},
- { 276,"Germany,Deutschland,Bundesrepublik Deutschland","345c7m"},
+ { 276,"Germany,Deutschland,Bundesrepublik Deutschland","345c7M"},
{ 288,"Ghana"},
{ 292,"Gibraltar"},
{ 296,"Kiribati"},
@@ -1906,6 +1906,9 @@
case 'c':
attr_type=attr_county_name;
break;
+ case 'M':
+ if(experimental)
+ b->ib->type=type_poly_place6;
case 'm':
attr_type=attr_municipality_name;
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-03-19 21:27:30
|
Revision: 5419
http://navit.svn.sourceforge.net/navit/?rev=5419&view=rev
Author: sleske
Date: 2013-03-19 21:27:24 +0000 (Tue, 19 Mar 2013)
Log Message:
-----------
Fix:core:Clean up debugging.
Modified Paths:
--------------
trunk/navit/navit/graphics.c
trunk/navit/navit/transform.c
Modified: trunk/navit/navit/graphics.c
===================================================================
--- trunk/navit/navit/graphics.c 2013-03-18 22:19:15 UTC (rev 5418)
+++ trunk/navit/navit/graphics.c 2013-03-19 21:27:24 UTC (rev 5419)
@@ -1638,8 +1638,10 @@
segment_end.x=pa[i].x;
segment_end.y=pa[i].y;
segment_end.w=width[i];
+ dbg(3, "Segment: [%d, %d] - [%d, %d]...\n", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
clip_result=clip_line(&segment_start, &segment_end, &r);
if (clip_result != CLIPRES_INVISIBLE) {
+ dbg(3, "....clipped to [%d, %d] - [%d, %d]\n", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
if ((i == 1) || (clip_result & CLIPRES_START_CLIPPED)) {
points_to_draw[points_to_draw_cnt].x=segment_start.x;
points_to_draw[points_to_draw_cnt].y=segment_start.y;
Modified: trunk/navit/navit/transform.c
===================================================================
--- trunk/navit/navit/transform.c 2013-03-18 22:19:15 UTC (rev 5418)
+++ trunk/navit/navit/transform.c 2013-03-19 21:27:24 UTC (rev 5419)
@@ -432,6 +432,7 @@
int i,j = 0,k=0;
dbg(3,"count=%d\n", count);
for (i=0; i < count; i++) {
+ dbg(3, "input coord %d: (%d, %d)\n", i, c[i].x, c[i].y);
if (pro == t->pro) {
xc=c[i].x;
yc=c[i].y;
@@ -452,19 +453,16 @@
if (t->ddd) {
zc=(xc*t->m20+yc*t->m21+HOG(*t)*t->m22);
zc+=t->offz << POST_SHIFT;
- dbg(1,"zc=%d\n", zc);
- dbg(1,"zc(%d)=xc(%d)*m20(%d)+yc(%d)*m21(%d)\n", (xc*t->m20+yc*t->m21), xc, t->m20, yc, t->m21);
+ dbg(3,"zc(%d)=xc(%d)*m20(%d)+yc(%d)*m21(%d)\n", zc, xc, t->m20, yc, t->m21);
/* visibility */
visible=(zc < zlimit ? 0:1);
- dbg(1,"visible=%d old %d\n", visible, visibleo);
if (visible != visibleo && visibleo != -1) {
- dbg(1,"clipping (%d,%d,%d)-(%d,%d,%d) (%d,%d,%d)\n", xcn, ycn, zc, xco, yco, zco, xco-xcn, yco-ycn, zco-zc);
if (zco != zc) {
xcn=xcn+(long long)(xco-xcn)*(zlimit-zc)/(zco-zc);
ycn=ycn+(long long)(yco-ycn)*(zlimit-zc)/(zco-zc);
}
- dbg(1,"result (%d,%d,%d) * %d / %d\n", xcn,ycn,zc,zlimit-zc,zco-zc);
zc=zlimit;
+ dbg(3,"clip result: (%d,%d,%d)\n", xcn,ycn,zc);
xco=xcn;
yco=ycn;
zco=zc;
@@ -479,9 +477,6 @@
if (! visible)
continue;
}
- dbg(1,"zc=%d\n", zc);
- dbg(1,"xcn %d ycn %d\n", xcn, ycn);
- dbg(1,"%d,%d %d\n",xc,yc,zc);
xc=(long long)xcn*t->xscale/zc;
yc=(long long)ycn*t->yscale/zc;
} else {
@@ -492,6 +487,7 @@
}
xc+=t->offx;
yc+=t->offy;
+ dbg(3,"result: (%d, %d)\n", xc, yc);
if (i != 0 && i != count-1 && mindist) {
/* We expect values of mindist to be within 0..5 pixels for nice looking screens.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-03-18 22:19:21
|
Revision: 5418
http://navit.svn.sourceforge.net/navit/?rev=5418&view=rev
Author: sleske
Date: 2013-03-18 22:19:15 +0000 (Mon, 18 Mar 2013)
Log Message:
-----------
Fix:core:Fix signed int overflow in polygon clipping, to fix rendering errors in high zoom levels.|May be related to #1062.
Modified Paths:
--------------
trunk/navit/navit/graphics.c
Modified: trunk/navit/navit/graphics.c
===================================================================
--- trunk/navit/navit/graphics.c 2013-03-18 22:18:53 UTC (rev 5417)
+++ trunk/navit/navit/graphics.c 2013-03-18 22:19:15 UTC (rev 5418)
@@ -1689,19 +1689,19 @@
int dy=p2->y-p1->y;
switch(edge) {
case 0:
- ret->y=p1->y+(r->lu.x-p1->x)*dy/dx;
+ ret->y=p1->y+((float)r->lu.x-p1->x)*dy/dx;
ret->x=r->lu.x;
break;
case 1:
- ret->y=p1->y+(r->rl.x-p1->x)*dy/dx;
+ ret->y=p1->y+((float)r->rl.x-p1->x)*dy/dx;
ret->x=r->rl.x;
break;
case 2:
- ret->x=p1->x+(r->lu.y-p1->y)*dx/dy;
+ ret->x=p1->x+((float)r->lu.y-p1->y)*dx/dy;
ret->y=r->lu.y;
break;
case 3:
- ret->x=p1->x+(r->rl.y-p1->y)*dx/dy;
+ ret->x=p1->x+((float)r->rl.y-p1->y)*dx/dy;
ret->y=r->rl.y;
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2013-03-18 22:19:00
|
Revision: 5417
http://navit.svn.sourceforge.net/navit/?rev=5417&view=rev
Author: sleske
Date: 2013-03-18 22:18:53 +0000 (Mon, 18 Mar 2013)
Log Message:
-----------
Fix:core:Do not use max. linewidth for clipping rectangle, as linewidth may itself need clipping.|May fix #1062.
Modified Paths:
--------------
trunk/navit/navit/graphics.c
Modified: trunk/navit/navit/graphics.c
===================================================================
--- trunk/navit/navit/graphics.c 2013-03-17 20:25:39 UTC (rev 5416)
+++ trunk/navit/navit/graphics.c 2013-03-18 22:18:53 UTC (rev 5417)
@@ -1612,20 +1612,22 @@
struct wpoint segment_start,segment_end;
int i,points_to_draw_cnt=0;
int clip_result;
- int wmax;
+ int r_width, r_height;
struct point_rect r=gra->r;
- wmax=width[0];
- for (i = 1 ; i < count ; i++) {
- if (width[i] > wmax)
- wmax=width[i];
- }
- if (wmax <= 0)
- return;
- r.lu.x-=wmax;
- r.lu.y-=wmax;
- r.rl.x+=wmax;
- r.rl.y+=wmax;
+ r_width=r.rl.x-r.lu.x;
+ r_height=r.rl.y-r.lu.y;
+
+ // Expand clipping rect by 1/3 so wide, slanted lines do not
+ // partially end before screen border.
+ // Ideally we would expand by the line width here, but in 3D
+ // mode the width is variable and needs clipping itself, so that
+ // would get complicated. Anyway, 1/3 of screen size should be
+ // enough...
+ r.lu.x-=r_width/3;
+ r.lu.y-=r_height/3;
+ r.rl.x+=r_width/3;
+ r.rl.y+=r_height/3;
// Iterate over line segments, push them into points_to_draw
// until we reach a completely invisible segment...
for (i = 0 ; i < count ; i++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-03-17 20:25:45
|
Revision: 5416
http://navit.svn.sourceforge.net/navit/?rev=5416&view=rev
Author: mdankov
Date: 2013-03-17 20:25:39 +0000 (Sun, 17 Mar 2013)
Log Message:
-----------
Add:maptool:Refactor experimental place relations to polygones conversion feature to use common attr_mapping rules.
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-03-17 11:22:33 UTC (rev 5415)
+++ trunk/navit/navit/maptool/osm.c 2013-03-17 20:25:39 UTC (rev 5416)
@@ -87,7 +87,11 @@
static int attr_mapping_way_count;
static struct attr_mapping **attr_mapping_way2poi;
static int attr_mapping_way2poi_count;
+static struct attr_mapping **attr_mapping_rel2poly_place;
+static int attr_mapping_rel2poly_place_count;
+static int attr_longest_match(struct attr_mapping **mapping, int mapping_count, enum item_type *types, int types_count);
+static void attr_longest_match_clear();
enum attr_strings {
@@ -707,6 +711,8 @@
"w piste:type=nordic piste_nordic\n"
"w place=suburb poly_place1\n"
"w place=hamlet poly_place2\n"
+ "w place=isolated_dwelling poly_place2\n"
+ "w place=locality poly_place2\n"
"w place=village poly_place3\n"
"w place=municipality poly_place4\n"
"w place=town poly_place5\n"
@@ -744,7 +750,6 @@
"w barrier=city_wall city_wall\n"
};
-
static void
build_attrmap_line(char *line)
{
@@ -788,6 +793,10 @@
if (t[0]== 'w') {
attr_mapping_way=g_realloc(attr_mapping_way, sizeof(*attr_mapping_way)*(attr_mapping_way_count+1));
attr_mapping_way[attr_mapping_way_count++]=attr_mapping;
+ if(item_is_poly_place(*attr_mapping)) {
+ attr_mapping_rel2poly_place=g_realloc(attr_mapping_rel2poly_place, sizeof(*attr_mapping_rel2poly_place)*(attr_mapping_rel2poly_place_count+1));
+ attr_mapping_rel2poly_place[attr_mapping_rel2poly_place_count++]=attr_mapping;
+ }
}
if (t[0]== '?' && doway2poi) {
attr_mapping_way2poi=g_realloc(attr_mapping_way2poi, sizeof(*attr_mapping_way2poi)*(attr_mapping_way2poi_count+1));
@@ -960,11 +969,13 @@
return 3;
}
+static void
+osm_update_attr_present(char *k, char *v);
+
void
osm_add_tag(char *k, char *v)
{
- int idx,level=2;
- char buffer[BUFFER_SIZE*2+2], *p;
+ int level=2;
if (in_relation) {
relation_add_tag(k,v);
return;
@@ -1196,6 +1207,15 @@
if (level < 6)
node_is_tagged=1;
+ osm_update_attr_present(k, v);
+}
+
+static void
+osm_update_attr_present(char *k, char *v)
+{
+ int idx;
+ char *p, buffer[BUFFER_SIZE*2+2];
+
strcpy(buffer,"*=*");
if ((idx=(int)(long)g_hash_table_lookup(attr_hash, buffer)))
attr_present[idx]=1;
@@ -1473,7 +1493,6 @@
char iso_code[BUFFER_SIZE];
int admin_level;
int boundary;
-int place;
void
osm_add_relation(osmid id)
@@ -1485,7 +1504,6 @@
iso_code[0]='\0';
admin_level=-1;
boundary=0;
- place=0;
item_bin_init(item_bin, type_none);
item_bin_add_attr_longlong(item_bin, attr_osm_relationid, current_id);
}
@@ -1530,8 +1548,17 @@
void
osm_end_relation(struct maptool_osm *osm)
{
+ enum item_type type;
+
in_relation=0;
- if ((!strcmp(relation_type, "multipolygon") || !strcmp(relation_type, "boundary")) && (boundary || (place&&experimental))) {
+
+ if(experimental && attr_longest_match(attr_mapping_rel2poly_place, attr_mapping_rel2poly_place_count, &type, 1)) {
+ item_bin->type=type;
+ }
+ else
+ type=type_none;
+
+ if ((!strcmp(relation_type, "multipolygon") || !strcmp(relation_type, "boundary")) && (boundary || type!=type_none)) {
#if 0
if (admin_level == 2) {
FILE *f;
@@ -1547,6 +1574,8 @@
if (!strcmp(relation_type, "restriction") && (item_bin->type == type_street_turn_restriction_no || item_bin->type == type_street_turn_restriction_only))
item_bin_write(item_bin, osm->turn_restrictions);
+
+ attr_longest_match_clear();
}
void
@@ -1590,21 +1619,6 @@
}
} else if (!strcmp(k,"ISO3166-1")) {
strcpy(iso_code, v);
- } else if(experimental && !strcmp(k,"place") && item_bin->type==type_none) {
- place=1;
- if (!strcmp(v,"city")) {
- item_bin->type=type_poly_place6;
- } else if (!strcmp(v,"town")) {
- item_bin->type=type_poly_place5;
- } else if (!strcmp(v,"village")) {
- item_bin->type=type_poly_place3;
- } else if (!strcmp(v,"hamlet")) {
- item_bin->type=type_poly_place2;
- } else if (!strcmp(v,"isolated_dwelling")) {
- item_bin->type=type_poly_place2;
- } else if (!strcmp(v,"locality")) {
- item_bin->type=type_poly_place2;
- }
}
if (add_tag) {
char *tag;
@@ -1612,6 +1626,9 @@
sprintf(tag,"%s=%s",k,v);
item_bin_add_attr_string(item_bin, attr_osm_tag, tag);
}
+
+ if(experimental)
+ osm_update_attr_present(k,v);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-03-17 11:22:41
|
Revision: 5415
http://navit.svn.sourceforge.net/navit/?rev=5415&view=rev
Author: mdankov
Date: 2013-03-17 11:22:33 +0000 (Sun, 17 Mar 2013)
Log Message:
-----------
Add:map_binfile:Use exact town polygons instead of their bounding boxes for street search. Do not find streets of nearby towns.
Modified Paths:
--------------
trunk/navit/navit/map/binfile/binfile.c
Modified: trunk/navit/navit/map/binfile/binfile.c
===================================================================
--- trunk/navit/navit/map/binfile/binfile.c 2013-03-17 11:19:40 UTC (rev 5414)
+++ trunk/navit/navit/map/binfile/binfile.c 2013-03-17 11:22:33 UTC (rev 5415)
@@ -38,6 +38,7 @@
#include "endianess.h"
#include "callback.h"
#include "types.h"
+#include "geom.h"
static int map_id;
@@ -166,6 +167,7 @@
struct item *item;
struct attr search;
struct map_selection ms;
+ GList *boundaries;
int partial;
int mode;
GHashTable *search_results;
@@ -456,13 +458,21 @@
t->pos_coord=t->pos_coord_start;
}
+static inline int
+binfile_coord_left(void *priv_data)
+{
+ struct map_rect_priv *mr=priv_data;
+ struct tile *t=mr->t;
+ return (t->pos_attr_start-t->pos_coord)/2;
+}
+
static int
binfile_coord_get(void *priv_data, struct coord *c, int count)
{
struct map_rect_priv *mr=priv_data;
struct tile *t=mr->t;
int max,ret=0;
- max=(t->pos_attr_start-t->pos_coord)/2;
+ max=binfile_coord_left(priv_data);
if (count > max)
count=max;
#if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -1879,7 +1889,7 @@
}
static struct map_rect_priv *
-binmap_search_street_by_place(struct map_priv *map, struct item *town, struct coord *c, struct map_selection *sel)
+binmap_search_street_by_place(struct map_priv *map, struct item *town, struct coord *c, struct map_selection *sel, GList **boundaries)
{
struct attr town_name, poly_town_name;
struct map_rect_priv *map_rec2;
@@ -1898,13 +1908,20 @@
if (item_is_poly_place(*place) &&
item_attr_get(place, attr_label, &poly_town_name) &&
!strcmp(poly_town_name.u.str,town_name.u.str)) {
- struct coord c[128];
+ struct coord *c;
int i,count;
+ struct geom_poly_segment *bnd;
+ count=binfile_coord_left(map_rec2);
+ c=g_new(struct coord,count);
found=1;
- while ((count=item_coord_get(place, c, 128))) {
- for (i = 0 ; i < count ; i++)
- coord_rect_extend(&sel->u.c_rect, &c[i]);
- }
+ item_coord_get(place, c, count);
+ for (i = 0 ; i < count ; i++)
+ coord_rect_extend(&sel->u.c_rect, &c[i]);
+ bnd=g_new(struct geom_poly_segment,1);
+ bnd->first=c;
+ bnd->last=c+count-1;
+ bnd->type=geom_poly_segment_type_way_outer;
+ *boundaries=g_list_prepend(*boundaries,bnd);
}
}
map_rect_destroy_binfile(map_rec2);
@@ -2043,7 +2060,7 @@
msp->mode = 1;
else {
if (item_coord_get(town, &c, 1)) {
- if ((msp->mr=binmap_search_street_by_place(map, town, &c, &msp->ms)))
+ if ((msp->mr=binmap_search_street_by_place(map, town, &c, &msp->ms, &msp->boundaries)))
msp->mode = 2;
else {
msp->mr=binmap_search_street_by_estimate(map, town, &c, &msp->ms);
@@ -2168,6 +2185,23 @@
return 2;
}
+static int
+item_inside_poly_list(struct item *it, GList *l)
+{
+ while(l) {
+ struct geom_poly_segment *p=l->data;
+ int count=p->last-p->first+1;
+ struct coord c;
+ item_coord_rewind(it);
+ while(item_coord_get(it,&c,1)>0) {
+ if(geom_poly_point_inside(p->first,count,&c))
+ return 1;
+ }
+ l=g_list_next(l);
+ }
+ return 0;
+}
+
static struct item *
binmap_search_get_item(struct map_search_priv *map_search)
{
@@ -2204,10 +2238,19 @@
}
if (item_is_street(*it)) {
struct attr at;
- if (map_selection_contains_item_rect(map_search->mr->sel, it) && binfile_attr_get(it->priv_data, attr_label, &at)) {
+ if (!map_selection_contains_item_rect(map_search->mr->sel, it))
+ break;
+ if(map_search->boundaries && !item_inside_poly_list(it,map_search->boundaries))
+ break;
+
+ if(binfile_attr_get(it->priv_data, attr_label, &at)) {
int i,match=0;
- char *str=g_strdup(at.u.str);
- char *word=str;
+ char *str;
+ char *word;
+ struct coord c[128];
+
+ str=g_strdup(at.u.str);
+ word=str;
do {
for (i = 0 ; i < 3 ; i++) {
char *name=linguistics_expand_special(word,i);
@@ -2222,6 +2265,9 @@
word=linguistics_next_word(word);
} while (word);
g_free(str);
+
+ /* Extracting all coords here makes duplicate() not consider them. */
+ while(item_coord_get(it,c,128)>0);
if (match && !duplicate(map_search, it, attr_label)) {
item_coord_rewind(it);
return it;
@@ -2278,6 +2324,10 @@
map_rect_destroy_binfile(ms->mr_item);
if (ms->mr)
map_rect_destroy_binfile(ms->mr);
+ while(ms->boundaries) {
+ geom_poly_segment_destroy(ms->boundaries->data);
+ ms->boundaries=g_list_delete_link(ms->boundaries,ms->boundaries);
+ }
g_free(ms);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2013-03-17 11:19:47
|
Revision: 5414
http://navit.svn.sourceforge.net/navit/?rev=5414&view=rev
Author: mdankov
Date: 2013-03-17 11:19:40 +0000 (Sun, 17 Mar 2013)
Log Message:
-----------
Fix:core:Make geom.c code usable in the navit core.
Modified Paths:
--------------
trunk/navit/navit/geom.c
trunk/navit/navit/geom.h
trunk/navit/navit/start_real.c
Modified: trunk/navit/navit/geom.c
===================================================================
--- trunk/navit/navit/geom.c 2013-03-13 08:14:42 UTC (rev 5413)
+++ trunk/navit/navit/geom.c 2013-03-17 11:19:40 UTC (rev 5414)
@@ -512,3 +512,6 @@
}
}
+void geom_init()
+{
+}
Modified: trunk/navit/navit/geom.h
===================================================================
--- trunk/navit/navit/geom.h 2013-03-13 08:14:42 UTC (rev 5413)
+++ trunk/navit/navit/geom.h 2013-03-17 11:19:40 UTC (rev 5414)
@@ -16,6 +16,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+#ifndef NAVIT_GEOM_H
+#define NAVIT_GEOM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <glib.h>
#include "config.h"
#include "coord.h"
@@ -41,7 +48,7 @@
enum geom_poly_segment_type type;
struct coord *first,*last;
};
-
+/* prototypes */
void geom_coord_copy(struct coord *from, struct coord *to, int count, int reverse);
void geom_coord_revert(struct coord *c, int count);
int geom_line_middle(struct coord *p, int count, struct coord *c);
@@ -58,4 +65,11 @@
int geom_clip_line_code(struct coord *p1, struct coord *p2, struct rect *r);
int geom_is_inside(struct coord *p, struct rect *r, int edge);
void geom_poly_intersection(struct coord *p1, struct coord *p2, struct rect *r, int edge, struct coord *ret);
+void geom_init(void);
+/* end of prototypes */
+#ifdef __cplusplus
+}
+#endif
+#endif
+
Modified: trunk/navit/navit/start_real.c
===================================================================
--- trunk/navit/navit/start_real.c 2013-03-13 08:14:42 UTC (rev 5413)
+++ trunk/navit/navit/start_real.c 2013-03-17 11:19:40 UTC (rev 5414)
@@ -110,6 +110,7 @@
tracking_init();
search_init();
linguistics_init();
+ geom_init();
config_file=NULL;
#ifdef HAVE_GETOPT_H
opterr=0; //don't bomb out on errors.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-13 08:14:49
|
Revision: 5413
http://navit.svn.sourceforge.net/navit/?rev=5413&view=rev
Author: martin-s
Date: 2013-03-13 08:14:42 +0000 (Wed, 13 Mar 2013)
Log Message:
-----------
Add:vehicle_demo:Emit synthesized nmea data
Modified Paths:
--------------
trunk/navit/navit/vehicle/demo/vehicle_demo.c
Modified: trunk/navit/navit/vehicle/demo/vehicle_demo.c
===================================================================
--- trunk/navit/navit/vehicle/demo/vehicle_demo.c 2013-03-11 22:07:25 UTC (rev 5412)
+++ trunk/navit/navit/vehicle/demo/vehicle_demo.c 2013-03-13 08:14:42 UTC (rev 5413)
@@ -19,6 +19,7 @@
#include <glib.h>
#include <string.h>
+#include <math.h>
#include "config.h"
#include "debug.h"
#include "coord.h"
@@ -47,6 +48,7 @@
struct callback *timer_callback;
struct event_timeout *timer;
char *timep;
+ char *nmea;
};
@@ -60,10 +62,25 @@
g_free(priv);
}
+static void
+nmea_chksum(char *nmea)
+{
+ int i;
+ if (nmea && strlen(nmea) > 3) {
+ unsigned char csum=0;
+ for (i = 1 ; i < strlen(nmea)-4 ; i++)
+ csum^=(unsigned char)(nmea[i]);
+ sprintf(nmea+strlen(nmea)-3,"%02X\n",csum);
+ }
+}
+
static int
vehicle_demo_position_attr_get(struct vehicle_priv *priv,
enum attr_type type, struct attr *attr)
{
+ char ns='N',ew='E',*timep,*rmc,*gga;
+ int hr,min,sec,year,mon,day;
+ double lat,lng;
switch (type) {
case attr_position_speed:
attr->u.numd = &priv->speed;
@@ -85,6 +102,30 @@
case attr_position_sats_used:
attr->u.num = 9;
break;
+ case attr_position_nmea:
+ lat=priv->geo.lat;
+ if (lat < 0) {
+ lat=-lat;
+ ns='S';
+ }
+ lng=priv->geo.lng;
+ if (lng < 0) {
+ lng=-lng;
+ ew='W';
+ }
+ timep=current_to_iso8601();
+ sscanf(timep,"%d-%d-%dT%d:%d:%d",&year,&mon,&day,&hr,&min,&sec);
+ g_free(timep);
+ gga=g_strdup_printf("$GPGGA,%02d%02d%02d,%02.0f%07.4f,%c,%03.0f%07.4f,%c,1,08,2.5,0,M,,,,0000* \n",hr,min,sec,floor(lat),(lat-floor(lat))*60.0,ns,floor(lng),(lng-floor(lng))*60,ew);
+ nmea_chksum(gga);
+ rmc=g_strdup_printf("$GPRMC,%02d%02d%02d,A,%02.0f%07.4f,%c,%03.0f%07.4f,%c,%3.1f,%3.1f,%02d%02d%02d,,* \n",hr,min,sec,floor(lat),(lat-floor(lat))*60.0,ns,floor(lng),(lng-floor(lng))*60,ew,priv->speed/1.852,(double)priv->direction,day,mon,year%100);
+ nmea_chksum(rmc);
+ g_free(priv->nmea);
+ priv->nmea=g_strdup_printf("%s%s",gga,rmc);
+ g_free(gga);
+ g_free(rmc);
+ attr->u.str=priv->nmea;
+ break;
default:
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-11 22:07:32
|
Revision: 5412
http://navit.svn.sourceforge.net/navit/?rev=5412&view=rev
Author: martin-s
Date: 2013-03-11 22:07:25 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Fix:Core:Consider route_depth of profile options
Modified Paths:
--------------
trunk/navit/navit/route.c
trunk/navit/navit/vehicleprofile.c
trunk/navit/navit/vehicleprofile.h
Modified: trunk/navit/navit/route.c
===================================================================
--- trunk/navit/navit/route.c 2013-03-11 20:43:52 UTC (rev 5411)
+++ trunk/navit/navit/route.c 2013-03-11 22:07:25 UTC (rev 5412)
@@ -970,8 +970,7 @@
struct map_selection *ret=NULL;
int i;
struct coord_rect r;
- char *str, *tok;
- struct attr attr;
+ char *depth, *str, *tok;
if (!count)
return NULL;
@@ -980,12 +979,11 @@
for (i = 1 ; i < count ; i++)
coord_rect_extend(&r, &c[i]);
- if(!vehicleprofile_get_attr(profile,attr_route_depth, &attr, NULL) || attr.u.str==NULL) {
- attr.u.str="4:25%,8:40000,18:10000";
- }
+ depth=profile->route_depth;
+ if (!depth)
+ depth="4:25%,8:40000,18:10000";
+ depth=str=g_strdup(depth);
- attr.u.str=str=g_strdup(attr.u.str);
-
while((tok=strtok(str,","))!=NULL) {
int order=0, dist=0;
sscanf(tok,"%d:%d",&order,&dist);
@@ -998,7 +996,7 @@
str=NULL;
}
- g_free(attr.u.str);
+ g_free(depth);
return ret;
}
Modified: trunk/navit/navit/vehicleprofile.c
===================================================================
--- trunk/navit/navit/vehicleprofile.c 2013-03-11 20:43:52 UTC (rev 5411)
+++ trunk/navit/navit/vehicleprofile.c 2013-03-11 22:07:25 UTC (rev 5412)
@@ -53,6 +53,11 @@
/* previously used strdupn not available on win32 */
this_->name = g_strdup(attr->u.str);
break;
+ case attr_route_depth:
+ if(this_->route_depth)
+ g_free(this_->route_depth);
+ this_->route_depth = g_strdup(attr->u.str);
+ break;
case attr_vehicle_axle_weight:
this_->axle_weight=attr->u.num;
break;
@@ -113,6 +118,8 @@
this_->static_distance=0;
g_free(this_->name);
this_->name=NULL;
+ g_free(this_->route_depth);
+ this_->route_depth=NULL;
this_->dangerous_goods=0;
this_->length=-1;
this_->width=-1;
Modified: trunk/navit/navit/vehicleprofile.h
===================================================================
--- trunk/navit/navit/vehicleprofile.h 2013-03-11 20:43:52 UTC (rev 5411)
+++ trunk/navit/navit/vehicleprofile.h 2013-03-11 22:07:25 UTC (rev 5412)
@@ -31,6 +31,7 @@
int static_speed; /**< Maximum speed of vehicle to consider it stationary */
int static_distance; /**< Maximum distance of previous position of vehicle to consider it stationary */
char *name; /**< the vehicle profile name */
+ char *route_depth; /**< the route depth attribute */
int width; /**< Width of the vehicle in cm */
int height; /**< Height of the vehicle in cm */
int length; /**< Length of the vehicle in cm */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-11 20:44:00
|
Revision: 5411
http://navit.svn.sourceforge.net/navit/?rev=5411&view=rev
Author: martin-s
Date: 2013-03-11 20:43:52 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Fix:Core:Improved pedestrian profile
Modified Paths:
--------------
trunk/navit/navit/item.c
trunk/navit/navit/navit_shipped.xml
Modified: trunk/navit/navit/item.c
===================================================================
--- trunk/navit/navit/item.c 2013-03-11 20:41:40 UTC (rev 5410)
+++ trunk/navit/navit/item.c 2013-03-11 20:43:52 UTC (rev 5411)
@@ -72,6 +72,7 @@
{type_steps, AF_PBH},
{type_street_pedestrian, AF_PBH},
{type_hiking_mountain, AF_PEDESTRIAN},
+ {type_hiking, AF_PEDESTRIAN},
};
Modified: trunk/navit/navit/navit_shipped.xml
===================================================================
--- trunk/navit/navit/navit_shipped.xml 2013-03-11 20:41:40 UTC (rev 5410)
+++ trunk/navit/navit/navit_shipped.xml 2013-03-11 20:43:52 UTC (rev 5411)
@@ -511,12 +511,17 @@
<announcement level="1" distance_metric="100"/>
<announcement level="2" distance_metric="200"/>
</roadprofile>
+ <roadprofile item_types="hiking_mountain" speed="4" route_weight="4">
+ <announcement level="0" distance_metric="25"/>
+ <announcement level="1" distance_metric="100"/>
+ <announcement level="2" distance_metric="200"/>
+ </roadprofile>
<roadprofile item_types="living_street,street_pedestrian" speed="5" route_weight="5">
<announcement level="0" distance_metric="25"/>
<announcement level="1" distance_metric="100"/>
<announcement level="2" distance_metric="200"/>
</roadprofile>
- <roadprofile item_types="track_gravelled" speed="5" route_weight="5">
+ <roadprofile item_types="track_gravelled,track_unpaved,track_grass,track_ground,hiking" speed="5" route_weight="5">
<announcement level="0" distance_metric="25"/>
<announcement level="1" distance_metric="100"/>
<announcement level="2" distance_metric="200"/>
@@ -1088,18 +1093,18 @@
<itemgra item_types="track_paved" order="10-">
<polyline color="#000000" width="1"/>
</itemgra>
- <itemgra item_types="track_gravelled" order="10-12">
+ <itemgra item_types="track_gravelled,track_grass" order="10-12">
<polyline color="#800000" width="1" dash="3,6"/>
</itemgra>
- <itemgra item_types="track_gravelled" order="13-14">
+ <itemgra item_types="track_gravelled,track_grass" order="13-14">
<polyline color="#ffffff" width="4" dash="4,8"/>
<polyline color="#800000" width="2" dash="4,8"/>
</itemgra>
- <itemgra item_types="track_gravelled" order="15-16">
+ <itemgra item_types="track_gravelled,track_grass" order="15-16">
<polyline color="#ffffff" width="5" dash="5,10"/>
<polyline color="#800000" width="3" dash="5,10"/>
</itemgra>
- <itemgra item_types="track_gravelled" order="17-">
+ <itemgra item_types="track_gravelled,track_grass" order="17-">
<polyline color="#ffffff" width="7" dash="7,15"/>
<polyline color="#800000" width="5" dash="7,15"/>
</itemgra>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-11 20:41:48
|
Revision: 5410
http://navit.svn.sourceforge.net/navit/?rev=5410&view=rev
Author: martin-s
Date: 2013-03-11 20:41:40 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Fix:maptool:Make node hash work on 64 bit
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-03-11 18:53:43 UTC (rev 5409)
+++ trunk/navit/navit/maptool/osm.c 2013-03-11 20:41:40 UTC (rev 5410)
@@ -1328,7 +1328,7 @@
}
if (node_hash) {
int i;
- i=(int)(long)(g_hash_table_lookup(node_hash, (gpointer)(long)id));
+ i=(int)(long)(g_hash_table_lookup(node_hash, (gpointer)(long)(unsigned int)id));
return ni+i;
}
if (ni[0].id > id)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-11 18:53:50
|
Revision: 5409
http://navit.svn.sourceforge.net/navit/?rev=5409&view=rev
Author: martin-s
Date: 2013-03-11 18:53:43 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Add:Core:Allow hiking path for pedestrians
Modified Paths:
--------------
trunk/navit/navit/item.c
Modified: trunk/navit/navit/item.c
===================================================================
--- trunk/navit/navit/item.c 2013-03-11 18:52:51 UTC (rev 5408)
+++ trunk/navit/navit/item.c 2013-03-11 18:53:43 UTC (rev 5409)
@@ -71,6 +71,7 @@
{type_path, AF_PBH},
{type_steps, AF_PBH},
{type_street_pedestrian, AF_PBH},
+ {type_hiking_mountain, AF_PEDESTRIAN},
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-11 18:52:58
|
Revision: 5408
http://navit.svn.sourceforge.net/navit/?rev=5408&view=rev
Author: martin-s
Date: 2013-03-11 18:52:51 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Fix:maptool:Allow access tag to be overriden by individual tags
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2013-03-10 21:48:13 UTC (rev 5407)
+++ trunk/navit/navit/maptool/osm.c 2013-03-11 18:52:51 UTC (rev 5408)
@@ -57,6 +57,7 @@
char debug_attr_buffer[BUFFER_SIZE];
int flags[4];
+int flagsa[4];
int flags_attr_value;
@@ -1019,7 +1020,7 @@
}
if (! strcmp(k,"access")) {
if (strcmp(v,"destination"))
- flags[access_value(v)] |= AF_DANGEROUS_GOODS|AF_EMERGENCY_VEHICLES|AF_TRANSPORT_TRUCK|AF_DELIVERY_TRUCK|AF_PUBLIC_BUS|AF_TAXI|AF_HIGH_OCCUPANCY_CAR|AF_CAR|AF_MOTORCYCLE|AF_MOPED|AF_HORSE|AF_BIKE|AF_PEDESTRIAN;
+ flagsa[access_value(v)] |= AF_DANGEROUS_GOODS|AF_EMERGENCY_VEHICLES|AF_TRANSPORT_TRUCK|AF_DELIVERY_TRUCK|AF_PUBLIC_BUS|AF_TAXI|AF_HIGH_OCCUPANCY_CAR|AF_CAR|AF_MOTORCYCLE|AF_MOPED|AF_HORSE|AF_BIKE|AF_PEDESTRIAN;
else
flags[0] |= AF_THROUGH_TRAFFIC_LIMIT;
level=5;
@@ -1458,6 +1459,7 @@
maxspeed_attr_value=0;
flags_attr_value = 0;
memset(flags, 0, sizeof(flags));
+ memset(flagsa, 0, sizeof(flagsa));
debug_attr_buffer[0]='\0';
osmid_attr_value=id;
if (wayid < wayid_last && !way_hash) {
@@ -1692,7 +1694,7 @@
nodes_ref_item_bin(item_bin);
def_flags=item_get_default_flags(types[i]);
if (def_flags) {
- flags_attr_value=(*def_flags | flags[0] | flags[1]) & ~flags[2];
+ flags_attr_value=((*def_flags & ~flagsa[2]) | flags[0] | flags[1] | flagsa[1]) & ~flags[2];
if (flags_attr_value != *def_flags)
add_flags=1;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-10 21:48:21
|
Revision: 5407
http://navit.svn.sourceforge.net/navit/?rev=5407&view=rev
Author: martin-s
Date: 2013-03-10 21:48:13 +0000 (Sun, 10 Mar 2013)
Log Message:
-----------
Add:Core:Further work on vehicleprofile_options
Modified Paths:
--------------
trunk/navit/navit/profile_option.c
trunk/navit/navit/roadprofile.c
trunk/navit/navit/roadprofile.h
trunk/navit/navit/vehicleprofile.c
trunk/navit/navit/xmlconfig.c
trunk/navit/navit/xmlconfig.h
Modified: trunk/navit/navit/profile_option.c
===================================================================
--- trunk/navit/navit/profile_option.c 2013-03-10 20:23:59 UTC (rev 5406)
+++ trunk/navit/navit/profile_option.c 2013-03-10 21:48:13 UTC (rev 5407)
@@ -34,6 +34,7 @@
po->func=&profile_option_func;
navit_object_ref((struct navit_object *)po);
po->attrs=attr_list_dup(attrs);
+ dbg(0,"return %p\n",po);
return po;
}
@@ -48,8 +49,8 @@
attr_profile_option,
(object_func_new)profile_option_new,
(object_func_get_attr)navit_object_get_attr,
- (object_func_iter_new)NULL,
- (object_func_iter_destroy)NULL,
+ (object_func_iter_new)navit_object_attr_iter_new,
+ (object_func_iter_destroy)navit_object_attr_iter_destroy,
(object_func_set_attr)navit_object_set_attr,
(object_func_add_attr)navit_object_add_attr,
(object_func_remove_attr)navit_object_remove_attr,
Modified: trunk/navit/navit/roadprofile.c
===================================================================
--- trunk/navit/navit/roadprofile.c 2013-03-10 20:23:59 UTC (rev 5406)
+++ trunk/navit/navit/roadprofile.c 2013-03-10 21:48:13 UTC (rev 5407)
@@ -20,6 +20,7 @@
#include <glib.h>
#include "debug.h"
#include "item.h"
+#include "xmlconfig.h"
#include "roadprofile.h"
static void
@@ -46,8 +47,10 @@
struct roadprofile *this_;
struct attr **attr;
this_=g_new0(struct roadprofile, 1);
+ this_->func=&roadprofile_func;
+ navit_object_ref((struct navit_object *)this_);
+
this_->attrs=attr_list_dup(attrs);
- this_->maxspeed=0;
for (attr=attrs;*attr; attr++)
roadprofile_set_attr_do(this_, *attr);
return this_;
@@ -84,7 +87,7 @@
struct attr_iter *
roadprofile_attr_iter_new(void)
{
- return g_new0(void *,1);
+ return (struct attr_iter *)g_new0(void *,1);
}
void
@@ -92,3 +95,37 @@
{
g_free(iter);
}
+
+struct roadprofile *
+roadprofile_dup(struct roadprofile *this_)
+{
+ struct roadprofile *ret=g_new(struct roadprofile, 1);
+ *ret=*this_;
+ ret->refcount=1;
+ ret->attrs=attr_list_dup(this_->attrs);
+ return ret;
+}
+
+void
+roadprofile_destroy(struct roadprofile *this_)
+{
+ attr_list_free(this_->attrs);
+ g_free(this_);
+}
+
+
+struct object_func roadprofile_func = {
+ attr_roadprofile,
+ (object_func_new)roadprofile_new,
+ (object_func_get_attr)roadprofile_get_attr,
+ (object_func_iter_new)roadprofile_attr_iter_new,
+ (object_func_iter_destroy)roadprofile_attr_iter_destroy,
+ (object_func_set_attr)roadprofile_set_attr,
+ (object_func_add_attr)roadprofile_add_attr,
+ (object_func_remove_attr)roadprofile_remove_attr,
+ (object_func_init)NULL,
+ (object_func_destroy)roadprofile_destroy,
+ (object_func_dup)roadprofile_dup,
+ (object_func_ref)navit_object_ref,
+ (object_func_unref)navit_object_unref,
+};
Modified: trunk/navit/navit/roadprofile.h
===================================================================
--- trunk/navit/navit/roadprofile.h 2013-03-10 20:23:59 UTC (rev 5406)
+++ trunk/navit/navit/roadprofile.h 2013-03-10 21:48:13 UTC (rev 5407)
@@ -22,7 +22,7 @@
extern "C" {
#endif
struct roadprofile {
- struct attr **attrs;
+ NAVIT_OBJECT
int speed;
int route_weight;
int maxspeed;
Modified: trunk/navit/navit/vehicleprofile.c
===================================================================
--- trunk/navit/navit/vehicleprofile.c 2013-03-10 20:23:59 UTC (rev 5406)
+++ trunk/navit/navit/vehicleprofile.c 2013-03-10 21:48:13 UTC (rev 5407)
@@ -86,23 +86,122 @@
}
static void
+vehicleprofile_free_hash_item(gpointer key, gpointer value, gpointer user_data)
+{
+ struct navit_object *obj=value;
+ obj->func->unref(obj);
+}
+
+static void
+vehicleprofile_free_hash(struct vehicleprofile *this_)
+{
+ if (this_->roadprofile_hash) {
+ g_hash_table_foreach(this_->roadprofile_hash, vehicleprofile_free_hash_item, NULL);
+ g_hash_table_destroy(this_->roadprofile_hash);
+ }
+}
+
+static void
vehicleprofile_clear(struct vehicleprofile *this_)
{
- if (this_->roadprofile_hash)
- g_hash_table_destroy(this_->roadprofile_hash);
- this_->roadprofile_hash=g_hash_table_new(NULL, NULL);
+ this_->mode=0;
+ this_->flags_forward_mask=0;
+ this_->flags_reverse_mask=0;
+ this_->flags=0;
+ this_->maxspeed_handling=0;
+ this_->static_speed=0;
+ this_->static_distance=0;
+ g_free(this_->name);
+ this_->name=NULL;
+ this_->dangerous_goods=0;
this_->length=-1;
this_->width=-1;
this_->height=-1;
this_->weight=-1;
this_->axle_weight=-1;
this_->through_traffic_penalty=9000;
+ vehicleprofile_free_hash(this_);
+ this_->roadprofile_hash=g_hash_table_new(NULL, NULL);
}
static void
+vehicleprofile_apply_roadprofile(struct vehicleprofile *this_, struct navit_object *rp, int is_option)
+{
+ struct attr item_types_attr;
+ if (rp->func->get_attr(rp, attr_item_types, &item_types_attr, NULL)) {
+ enum item_type *types=item_types_attr.u.item_types;
+ while (*types != type_none) {
+ struct navit_object *oldrp;
+ /* Maptool won't place any access flags for roads which don't have default access flags set. Warn user. */
+ if(!item_get_default_flags(*types))
+ dbg(0,"On '%s' roads used in '%s' vehicleprofile access restrictions are ignored. You might even be directed to drive in wrong direction on a one-way road. "
+ "Please define default access flags for above road type to item.c and rebuild the map.\n", item_to_name(*types), this_->name);
+ oldrp=g_hash_table_lookup(this_->roadprofile_hash, (void *)(long)(*types));
+ if (is_option && oldrp) {
+ struct navit_object *newrp;
+ struct attr_iter *iter=rp->func->iter_new(NULL);
+ struct attr attr;
+ dbg(1,"patching roadprofile\n");
+ newrp=oldrp->func->dup(oldrp);
+ while (rp->func->get_attr(rp, attr_any, &attr, iter))
+ newrp->func->set_attr(newrp, &attr);
+ oldrp->func->iter_destroy(iter);
+ oldrp->func->unref(oldrp);
+ g_hash_table_insert(this_->roadprofile_hash, (void *)(long)(*types), newrp);
+ } else {
+ if (oldrp)
+ oldrp->func->unref(oldrp);
+ g_hash_table_insert(this_->roadprofile_hash, (void *)(long)(*types), rp->func->ref(rp));
+ }
+ types++;
+ }
+ }
+}
+
+static void
+vehicleprofile_apply_attrs(struct vehicleprofile *this_, struct navit_object *obj, int is_option)
+{
+ struct attr attr;
+ struct attr_iter *iter=obj->func->iter_new(NULL);
+ while (obj->func->get_attr(obj, attr_any, &attr, iter)) {
+ dbg(1,"%s\n",attr_to_name(attr.type));
+ if (attr.type == attr_roadprofile)
+ vehicleprofile_apply_roadprofile(this_, attr.u.navit_object, is_option);
+ else if (attr.type != attr_profile_option)
+ vehicleprofile_set_attr_do(this_, &attr);
+ }
+ obj->func->iter_destroy(iter);
+}
+
+static void
+vehicleprofile_debug_roadprofile(gpointer key, gpointer value, gpointer user_data)
+{
+ struct roadprofile *rp=value;
+ dbg(0,"type %s avg %d weight %d max %d\n",item_to_name((int)(long)key),rp->speed,rp->route_weight,rp->maxspeed);
+}
+
+static void
vehicleprofile_update(struct vehicleprofile *this_)
{
+ struct attr_iter *iter=vehicleprofile_attr_iter_new();
+ struct attr profile_option;
dbg(0,"enter\n");
+ vehicleprofile_clear(this_);
+ vehicleprofile_apply_attrs(this_, (struct navit_object *)this_, 0);
+ while (vehicleprofile_get_attr(this_, attr_profile_option, &profile_option, iter)) {
+ struct attr active, name;
+ if (!profile_option.u.navit_object->func->get_attr(profile_option.u.navit_object, attr_active, &active, NULL))
+ active.u.num=0;
+ if (profile_option.u.navit_object->func->get_attr(profile_option.u.navit_object, attr_name, &name, NULL))
+ dbg(0,"%p %s %d\n",profile_option.u.navit_object,name.u.str,active.u.num);
+ if (active.u.num)
+ vehicleprofile_apply_attrs(this_, profile_option.u.navit_object, 1);
+ }
+ vehicleprofile_attr_iter_destroy(iter);
+ dbg(0,"result l %d w %d h %d wg %d awg %d pen %d\n",this_->length,this_->width,this_->height,this_->weight,this_->axle_weight,this_->through_traffic_penalty);
+ dbg(0,"m %d fwd 0x%x rev 0x%x flags 0x%x max %d stsp %d stdst %d dg %d\n",this_->mode,this_->flags_forward_mask,this_->flags_reverse_mask, this_->flags, this_->maxspeed_handling, this_->static_speed, this_->static_distance, this_->dangerous_goods);
+ g_hash_table_foreach(this_->roadprofile_hash, vehicleprofile_debug_roadprofile, NULL);
+
}
@@ -156,21 +255,10 @@
int
vehicleprofile_add_attr(struct vehicleprofile *this_, struct attr *attr)
{
- struct attr item_types_attr;
this_->attrs=attr_generic_add_attr(this_->attrs, attr);
switch (attr->type) {
case attr_roadprofile:
- if (roadprofile_get_attr(attr->u.roadprofile, attr_item_types, &item_types_attr, NULL)) {
- enum item_type *types=item_types_attr.u.item_types;
- while (*types != type_none) {
- /* Maptool won't place any access flags for roads which don't have default access flags set. Warn user. */
- if(!item_get_default_flags(*types))
- dbg(0,"On '%s' roads used in '%s' vehicleprofile access restrictions are ignored. You might even be directed to drive in wrong direction on a one-way road. "
- "Please define default access flags for above road type to item.c and rebuild the map.\n", item_to_name(*types), this_->name);
- g_hash_table_insert(this_->roadprofile_hash, (void *)(long)(*types), attr->u.roadprofile);
- types++;
- }
- }
+ vehicleprofile_apply_roadprofile(this_, attr->u.navit_object, 0);
break;
case attr_profile_option:
attr->u.navit_object->func->add_attr(attr->u.navit_object, &this_->active_callback);
@@ -197,7 +285,7 @@
char *
vehicleprofile_get_name(struct vehicleprofile *this_)
{
- return this_->name;
+ return this_->name;
}
struct object_func vehicleprofile_func = {
Modified: trunk/navit/navit/xmlconfig.c
===================================================================
--- trunk/navit/navit/xmlconfig.c 2013-03-10 20:23:59 UTC (rev 5406)
+++ trunk/navit/navit/xmlconfig.c 2013-03-10 21:48:13 UTC (rev 5407)
@@ -50,7 +50,6 @@
#include "log.h"
#include "announcement.h"
#include "vehicleprofile.h"
-#include "roadprofile.h"
#include "callback.h"
#include "config_.h"
@@ -261,7 +260,6 @@
{ attr_plugin, NEW(plugin_new)},
{ attr_polygon, NEW(polygon_new), NULL, NULL, NULL, NULL, ADD(element_add_attr)},
{ attr_polyline, NEW(polyline_new), NULL, NULL, NULL, NULL, ADD(element_add_attr)},
- { attr_roadprofile,NEW(roadprofile_new), GET(roadprofile_get_attr), NULL, NULL, SET(roadprofile_set_attr), ADD(roadprofile_add_attr) },
{ attr_route, NEW(route_new), GET(route_get_attr), NULL, NULL, SET(route_set_attr), ADD(route_add_attr), REMOVE(route_remove_attr)},
{ attr_speech, NEW(speech_new), GET(speech_get_attr), NULL, NULL, SET(speech_set_attr)},
{ attr_text, NEW(text_new)},
@@ -288,6 +286,8 @@
return &navit_func;
case attr_profile_option:
return &profile_option_func;
+ case attr_roadprofile:
+ return &roadprofile_func;
case attr_osd:
return &osd_func;
case attr_trackingo:
Modified: trunk/navit/navit/xmlconfig.h
===================================================================
--- trunk/navit/navit/xmlconfig.h 2013-03-10 20:23:59 UTC (rev 5406)
+++ trunk/navit/navit/xmlconfig.h 2013-03-10 21:48:13 UTC (rev 5407)
@@ -54,9 +54,9 @@
void *(*unref)(void *);
};
-extern struct object_func map_func, mapset_func, navit_func, osd_func, tracking_func, vehicle_func, maps_func, layout_func, vehicleprofile_func, layer_func, config_func, profile_option_func;
+extern struct object_func map_func, mapset_func, navit_func, osd_func, tracking_func, vehicle_func, maps_func, layout_func, roadprofile_func, vehicleprofile_func, layer_func, config_func, profile_option_func;
-#define HAS_OBJECT_FUNC(x) ((x) == attr_map || (x) == attr_mapset || (x) == attr_navit || (x) == attr_osd || (x) == attr_trackingo || (x) == attr_vehicle || (x) == attr_maps || (x) == attr_layout || (x) == attr_vehicleprofile || (x) == attr_layer || (x) == attr_config || (x) == attr_profile_option)
+#define HAS_OBJECT_FUNC(x) ((x) == attr_map || (x) == attr_mapset || (x) == attr_navit || (x) == attr_osd || (x) == attr_trackingo || (x) == attr_vehicle || (x) == attr_maps || (x) == attr_layout || (x) == attr_roadprofile || (x) == attr_vehicleprofile || (x) == attr_layer || (x) == attr_config || (x) == attr_profile_option)
#define NAVIT_OBJECT struct object_func *func; int refcount; struct attr **attrs;
struct navit_object {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2013-03-10 20:24:07
|
Revision: 5406
http://navit.svn.sourceforge.net/navit/?rev=5406&view=rev
Author: martin-s
Date: 2013-03-10 20:23:59 +0000 (Sun, 10 Mar 2013)
Log Message:
-----------
Add:Core:Further work on vehicleprofile_options
Modified Paths:
--------------
trunk/navit/navit/profile_option.c
trunk/navit/navit/vehicleprofile.c
trunk/navit/navit/vehicleprofile.h
Modified: trunk/navit/navit/profile_option.c
===================================================================
--- trunk/navit/navit/profile_option.c 2013-03-10 20:13:49 UTC (rev 5405)
+++ trunk/navit/navit/profile_option.c 2013-03-10 20:23:59 UTC (rev 5406)
@@ -47,12 +47,12 @@
struct object_func profile_option_func = {
attr_profile_option,
(object_func_new)profile_option_new,
- (object_func_get_attr)NULL,
+ (object_func_get_attr)navit_object_get_attr,
(object_func_iter_new)NULL,
(object_func_iter_destroy)NULL,
- (object_func_set_attr)NULL,
- (object_func_add_attr)NULL,
- (object_func_remove_attr)NULL,
+ (object_func_set_attr)navit_object_set_attr,
+ (object_func_add_attr)navit_object_add_attr,
+ (object_func_remove_attr)navit_object_remove_attr,
(object_func_init)NULL,
(object_func_destroy)profile_option_destroy,
(object_func_dup)NULL,
Modified: trunk/navit/navit/vehicleprofile.c
===================================================================
--- trunk/navit/navit/vehicleprofile.c 2013-03-10 20:13:49 UTC (rev 5405)
+++ trunk/navit/navit/vehicleprofile.c 2013-03-10 20:23:59 UTC (rev 5406)
@@ -25,6 +25,7 @@
#include "xmlconfig.h"
#include "roadprofile.h"
#include "vehicleprofile.h"
+#include "callback.h"
static void
vehicleprofile_set_attr_do(struct vehicleprofile *this_, struct attr *attr)
@@ -84,6 +85,27 @@
}
}
+static void
+vehicleprofile_clear(struct vehicleprofile *this_)
+{
+ if (this_->roadprofile_hash)
+ g_hash_table_destroy(this_->roadprofile_hash);
+ this_->roadprofile_hash=g_hash_table_new(NULL, NULL);
+ this_->length=-1;
+ this_->width=-1;
+ this_->height=-1;
+ this_->weight=-1;
+ this_->axle_weight=-1;
+ this_->through_traffic_penalty=9000;
+}
+
+static void
+vehicleprofile_update(struct vehicleprofile *this_)
+{
+ dbg(0,"enter\n");
+}
+
+
struct vehicleprofile *
vehicleprofile_new(struct attr *parent, struct attr **attrs)
{
@@ -96,13 +118,9 @@
this_->func=&vehicleprofile_func;
navit_object_ref((struct navit_object *)this_);
this_->attrs=attr_list_dup(attrs);
- this_->roadprofile_hash=g_hash_table_new(NULL, NULL);
- this_->length=-1;
- this_->width=-1;
- this_->height=-1;
- this_->weight=-1;
- this_->axle_weight=-1;
- this_->through_traffic_penalty=9000;
+ this_->active_callback.type=attr_callback;
+ this_->active_callback.u.callback=callback_new_attr_1(callback_cast(vehicleprofile_update), attr_active, this_);
+ vehicleprofile_clear(this_);
for (attr=attrs;*attr; attr++)
vehicleprofile_set_attr_do(this_, *attr);
return this_;
@@ -111,7 +129,7 @@
struct attr_iter *
vehicleprofile_attr_iter_new(void)
{
- return g_new0(void *,1);
+ return (struct attr_iter *)g_new0(void *,1);
}
void
@@ -154,6 +172,9 @@
}
}
break;
+ case attr_profile_option:
+ attr->u.navit_object->func->add_attr(attr->u.navit_object, &this_->active_callback);
+ break;
default:
break;
}
Modified: trunk/navit/navit/vehicleprofile.h
===================================================================
--- trunk/navit/navit/vehicleprofile.h 2013-03-10 20:13:49 UTC (rev 5405)
+++ trunk/navit/navit/vehicleprofile.h 2013-03-10 20:23:59 UTC (rev 5406)
@@ -39,6 +39,7 @@
int dangerous_goods; /**< Flags of dangerous goods present */
int through_traffic_penalty; /**< Penalty when driving on a through traffic limited road */
GHashTable *roadprofile_hash;
+ struct attr active_callback;
};
struct vehicleprofile * vehicleprofile_new(struct attr *parent, struct attr **attrs);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|