Skip to content

Commit

Permalink
set $Strassen::Util::cacheprefix for osm data
Browse files Browse the repository at this point in the history
... so there's no cache clash when loading different osm data into the
perl/tk app.
  • Loading branch information
eserte committed Jul 7, 2019
1 parent 661524b commit 4f495b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Geography/FromMeta.pm
@@ -1,10 +1,9 @@
# -*- perl -*-

#
# $Id: FromMeta.pm,v 1.7 2009/06/27 15:34:38 eserte Exp $
# Author: Slaven Rezic
#
# Copyright (C) 2009 Slaven Rezic. All rights reserved.
# Copyright (C) 2009,2019 Slaven Rezic. All rights reserved.
# This package is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
Expand Down Expand Up @@ -60,6 +59,7 @@ sub center {
sub center_name { shift->{center_name} }

sub bbox { shift->{bbox} }
sub bbox_wgs84 { shift->{bbox_wgs84} }
sub skip_features { %{ shift->{skip_features} || {} } }
sub skip_feature {
my($self, $feature) = @_;
Expand Down
4 changes: 4 additions & 0 deletions bbbike
Expand Up @@ -809,6 +809,10 @@ if ($city_obj->can("skip_features")) {
if ($city_obj->is_osm_source) {
$sBAB_two_track_width = 9999; # effectively turning off
}
if ($city_obj->is_osm_source) {
my $cacheprefix = ($city_obj->center_name || 'osm') . "_" . join("_", @{ $city_obj->bbox_wgs84 });
$Strassen::Util::cacheprefix = $cacheprefix;
}

# define_item_attribs should be called after determining the $city
define_item_attribs();
Expand Down

0 comments on commit 4f495b1

Please sign in to comment.