Skip to content

Commit

Permalink
[Bristol] Their WFS returns reversed co-ordinates.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Feb 19, 2025
1 parent a4fd028 commit 66e76b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions perllib/FixMyStreet/Cobrand/Bristol.pm
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ sub lookup_site_code_config {
version => '2.0.0',
srsname => "urn:ogc:def:crs:EPSG::27700",
accept_feature => sub { 1 },
reversed_coordinates => 1,
};
}

Expand Down
5 changes: 5 additions & 0 deletions perllib/FixMyStreet/Cobrand/UKCouncils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ _nearest_uses_latlon config key is set by lookup_site_code_config, in which
case lat/lons (EPSG 4326) are used. Useful if the assets are served by e.g.
Alloy, not Confirm.
Supply reversed_coordinates flag if the data from the WFS service returns
co-ordinates the wrong way round (N/E or lat/lon).
=cut

Expand All @@ -528,6 +530,9 @@ sub lookup_site_code {
if ($cfg->{_nearest_uses_latlon}) {
($x, $y) = ($row->longitude, $row->latitude);
}
if ($cfg->{reversed_coordinates}) {
($x, $y) = ($y, $x);
}
return $self->_nearest_feature($cfg, $x, $y, $features);
}

Expand Down

0 comments on commit 66e76b1

Please sign in to comment.