From 020d8635453035652c165d3a6cd67c3f86bdabb6 Mon Sep 17 00:00:00 2001 From: Kevin Kamps <167181728+ndwlocatieservices@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:25:55 +0100 Subject: [PATCH] #81873 - Fixed routing-map-matcher incompatability issues. --- .../graphhopper/factory/IsochroneServiceFactory.java | 6 ++++-- .../backend/graphhopper/AccessibilityMapITConfig.java | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/accessibility/src/main/java/nu/ndw/nls/accessibilitymap/accessibility/graphhopper/factory/IsochroneServiceFactory.java b/accessibility/src/main/java/nu/ndw/nls/accessibilitymap/accessibility/graphhopper/factory/IsochroneServiceFactory.java index 1e4a0099..77fb535f 100644 --- a/accessibility/src/main/java/nu/ndw/nls/accessibilitymap/accessibility/graphhopper/factory/IsochroneServiceFactory.java +++ b/accessibility/src/main/java/nu/ndw/nls/accessibilitymap/accessibility/graphhopper/factory/IsochroneServiceFactory.java @@ -9,7 +9,7 @@ import lombok.RequiredArgsConstructor; import nu.ndw.nls.accessibilitymap.accessibility.graphhopper.IsochroneService; import nu.ndw.nls.geometry.distance.FractionAndDistanceCalculator; - +import nu.ndw.nls.geometry.factories.GeometryFactoryWgs84; import nu.ndw.nls.routingmapmatcher.isochrone.algorithm.ShortestPathTreeFactory; import nu.ndw.nls.routingmapmatcher.isochrone.mappers.IsochroneMatchMapper; import nu.ndw.nls.routingmapmatcher.network.NetworkGraphHopper; @@ -24,10 +24,12 @@ public class IsochroneServiceFactory { private final FractionAndDistanceCalculator fractionAndDistanceCalculator; + private final GeometryFactoryWgs84 geometryFactory; + public IsochroneService createService(NetworkGraphHopper network) { EncodingManager encodingManager = network.getEncodingManager(); IsochroneMatchMapper isochroneMatchMapper = new IsochroneMatchMapper(encodingManager, - edgeIteratorStateReverseExtractor, new PointListUtil(), fractionAndDistanceCalculator); + edgeIteratorStateReverseExtractor, new PointListUtil(geometryFactory), fractionAndDistanceCalculator); Weighting weighting = network.createWeighting(PROFILE, new PMap()); ShortestPathTreeFactory shortestPathTreeFactory = new ShortestPathTreeFactory(weighting,encodingManager); return new IsochroneService(encodingManager, isochroneMatchMapper, shortestPathTreeFactory); diff --git a/backend/src/test/java/nu/ndw/nls/accessibilitymap/backend/graphhopper/AccessibilityMapITConfig.java b/backend/src/test/java/nu/ndw/nls/accessibilitymap/backend/graphhopper/AccessibilityMapITConfig.java index 2760ea5c..b5d348c4 100644 --- a/backend/src/test/java/nu/ndw/nls/accessibilitymap/backend/graphhopper/AccessibilityMapITConfig.java +++ b/backend/src/test/java/nu/ndw/nls/accessibilitymap/backend/graphhopper/AccessibilityMapITConfig.java @@ -27,11 +27,17 @@ public AccessibilityMapFactory accessibilityMapFactory() { RestrictionMapperProvider restrictionMapperProvider = new RestrictionMapperProvider(); VehicleRestrictionsModelFactory vehicleRestrictionsModelFactory = new VehicleRestrictionsModelFactory( restrictionMapperProvider); + EdgeIteratorStateReverseExtractor edgeIteratorStateReverseExtractor = new EdgeIteratorStateReverseExtractor(); GeodeticCalculatorFactory geodeticCalculatorFactory = new GeodeticCalculatorFactory(); IsochroneServiceFactory isochroneServiceFactory = new IsochroneServiceFactory( - edgeIteratorStateReverseExtractor, new FractionAndDistanceCalculator(geodeticCalculatorFactory, - List.of(new GeometryFactoryWgs84()), new BearingCalculator(geodeticCalculatorFactory))); + edgeIteratorStateReverseExtractor, + new FractionAndDistanceCalculator( + geodeticCalculatorFactory, + List.of(new GeometryFactoryWgs84()), + new BearingCalculator(geodeticCalculatorFactory)), + new GeometryFactoryWgs84()); + return new AccessibilityMapFactory(vehicleRestrictionsModelFactory, isochroneServiceFactory); }