aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-07-12 19:23:16 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-07-12 19:23:16 +0100
commit8490c84456f437c50f3075f5b44cfa2e726337ab (patch)
treeae7f7975f921689f77dde80999c60822368a6658 /perllib/FixMyStreet/Cobrand
parentd2d54ea0d9844833ab8544c3df34f9043b21a6a7 (diff)
Get OSM lookup hopefully working, does #95 except for bin scripts.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/FiksGataMi.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
index 3ba449a33..7251f2c6a 100644
--- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
+++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
@@ -92,6 +92,23 @@ sub find_closest {
return FixMyStreet::Geocode::OSM::closest_road_text( $self, $latitude, $longitude );
}
+# Used by send-reports, calling find_closest, calling OSM geocoding
+sub guess_road_operator {
+ my ( $self, $inforef ) = @_;
+
+ my $highway = $inforef->{highway} || "unknown";
+ my $refs = $inforef->{ref} || "unknown";
+
+ return "Statens vegvesen"
+ if $highway eq "trunk" || $highway eq "primary";
+
+ for my $ref (split(/;/, $refs)) {
+ return "Statens vegvesen"
+ if $ref =~ m/E ?\d+/ || $ref =~ m/Fv\d+/i;
+ }
+ return '';
+}
+
sub remove_redundant_councils {
my $self = shift;
my $all_councils = shift;