UserLocator implements HistogramConsumer { NicGeoPoint calculateSimpleWaySnapPoint(final NicGeoPoint point) { if (wayManager != null) { final Collection<Edge> edges = wayManager.getEdges(); if (edges != null && !edges.isEmpty()) { final SimpleWaySnap sws = new SimpleWaySnap(new NicGeoPointFactory(), edges); return sws.snap(point); } } else { Log.e(TAG, "MapMatchingMode is MAP_MATCHING_MODE_SIMPLE_WAY_SNAP but not WayManager is defined!"); } return point; } UserLocator(final Context ctx,
                       final FingerprintManager fingerprintManager,
                       final UserPositionManager userPositionManager,
                       final WayManager wayManager);  UserLocator(final Context ctx,
                       final FingerprintManager fingerprintManager,
                       final UserPositionManager userPositionManager,
                       final WayManager wayManager,
                       final History history); static void setScale(float scale); ParticleFilter getParticleFilter(); void resetParticleFilter(); void addSensorCollector(SensorCollector collector); void removeSensorCollector(SensorCollector collector); void startTracking(); void stopTracking(); void localisationLoop(); @Override void addHistogram(final Histogram histogram); void disablePosition(); void setOutlierMode(final int outlierMode); void setStatisticFilterMode(final int statisticFilterMode); void setMapMatchingMode(final int mapMatchingMode); void setCompassFilterEnabled(final boolean enabled); void setLocalizationMethod(final int localizationMode); static final String TAG; static final int OUTLIER_MODE_NO_DETECTION; static final int OUTLIER_MODE_CME; static final int OUTLIER_MODE_PLASMONA; static final int STATISTIC_FILTER_MODE_NO_FILTER; static final int STATISTIC_FILTER_MODE_MEDIAN; static final int STATISTIC_FILTER_MODE_AVERAGE; static final int MAP_MATCHING_MODE_NONE; static final int MAP_MATCHING_MODE_SIMPLE_WAY_SNAP; static final int LOCALIZATION_MODE_PARTICLEFILTER; static final int LOCALIZATION_MODE_WIFI; static final int LOCALIZATION_MODE_DEADRECKONING; }
@Test public void testNoWayManager() { NicGeoPoint test = new NicGeoPointImpl(); test.setXY(10.f, 12.f); userLocator = new UserLocator(context, fingerprintManager, userPositionManager, null, history); NicGeoPoint result = userLocator.calculateSimpleWaySnapPoint(test); assertEquals(10.f, result.getX(), 0.15f); assertEquals(12.f, result.getY(), 0.15f); }