Skip to content

Commit

Permalink
#81873 - Fixed routing-map-matcher incompatability issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndwlocatieservices committed Oct 30, 2024
1 parent 9f3a554 commit 020d863
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 020d863

Please sign in to comment.