Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode and Decode Placemark.relevance #157

Merged
merged 1 commit into from
Sep 6, 2018
Merged

Encode and Decode Placemark.relevance #157

merged 1 commit into from
Sep 6, 2018

Conversation

frederoni
Copy link
Contributor

Fixes #156 Add relevance property to GeocodedPlacemark

cc @1ec5

@@ -486,6 +491,8 @@ open class GeocodedPlacemark: Placemark {
return properties?.maki
}

open var relevance: Double?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we expose this property to Obj-C and workaround bridgability with a -1 constant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I’m uncertain what the magic number should be – whether it should be –1 or whether it should be Double.max to avoid a collision with a legitimate value.

@akitchen akitchen requested a review from 1ec5 August 27, 2018 17:23
how well each returned feature matches the query. You can use the this
property to remove results that don’t fully match the query.
*/
open var relevance: Double?
Copy link
Contributor

@1ec5 1ec5 Aug 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this property non-optional so that Objective-C code can access it. Use −1 to mark the absence of a relevance in the API response. According to the documentation and this line in Carmen, we can count on a present value to never dip below 0.

@@ -486,6 +491,13 @@ open class GeocodedPlacemark: Placemark {
return properties?.maki
}

/**
A numerical score from 0 (least relevant) to 0.99 (most relevant) measuring
how well each returned feature matches the query. You can use the this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the this
Use this

how well each returned feature matches the query. You can use the this
property to remove results that don’t fully match the query.
*/
open var relevance: Double?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Float would probably have sufficient precision, but I guess there’s no harm in using double here.

@frederoni frederoni merged commit 5332289 into master Sep 6, 2018
@frederoni frederoni deleted the fred/relevance branch September 6, 2018 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants