-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #534 from mapzen/524-confidence-score-geocode
Use confidence score
- Loading branch information
Showing
14 changed files
with
321 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 14 additions & 11 deletions
25
app/src/main/kotlin/com/mapzen/erasermap/model/AppSettings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
package com.mapzen.erasermap.model | ||
|
||
import android.content.Context | ||
import android.location.Location | ||
import com.mapzen.pelias.SavedSearch | ||
import com.mapzen.valhalla.Router | ||
import java.io.File | ||
|
||
public interface AppSettings { | ||
public var distanceUnits: Router.DistanceUnits | ||
public var isMockLocationEnabled: Boolean | ||
public var mockLocation: Location | ||
public var isMockRouteEnabled: Boolean | ||
public var mockRoute: File | ||
public var isTileDebugEnabled: Boolean | ||
public var isLabelDebugEnabled: Boolean | ||
public var isTangramInfosDebugEnabled: Boolean | ||
public var isCacheSearchResultsEnabled: Boolean | ||
interface AppSettings { | ||
var distanceUnits: Router.DistanceUnits | ||
var isMockLocationEnabled: Boolean | ||
var mockLocation: Location | ||
var isMockRouteEnabled: Boolean | ||
var mockRoute: File | ||
var isTileDebugEnabled: Boolean | ||
var isLabelDebugEnabled: Boolean | ||
var isTangramInfosDebugEnabled: Boolean | ||
var isCacheSearchResultsEnabled: Boolean | ||
|
||
public fun initTangramDebugFlags() | ||
fun initTangramDebugFlags() | ||
fun initSearchResultVersion(context: Context, savedSearch: SavedSearch) | ||
} |
22 changes: 22 additions & 0 deletions
22
app/src/main/kotlin/com/mapzen/erasermap/model/ConfidenceHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.mapzen.erasermap.model | ||
|
||
import com.mapzen.erasermap.presenter.MainPresenter | ||
|
||
class ConfidenceHandler(val presenter: MainPresenter) { | ||
|
||
var longPressed = false; | ||
|
||
companion object { | ||
const val CONFIDENCE_THRESHOLD = 0.8 | ||
const val CONFIDENCE_MISSING = -1.0 | ||
} | ||
|
||
fun useRawLatLng(confidence: Double): Boolean { | ||
if (confidence == CONFIDENCE_MISSING || !longPressed) { | ||
return false; | ||
} | ||
return confidence < CONFIDENCE_THRESHOLD | ||
&& presenter?.reverseGeoLngLat != null | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.