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

adding convenience streetAddress property #204

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Skoti
Copy link

@Skoti Skoti commented Feb 13, 2020

Hi

I would like to add a convenience streetAddress property for MBPlacemark.

I have noticed that for .address features name property contains only a street name and the house number is contained in address property.
The formattedName property already does it correctly (as it is defined as a street address for .address features), and also handles house number correctly putting it before or after a street name. So I have just extracted this logic into a separate method.
For non-address features I use the logic from addressDictionary which looks for an address first in properties?.address and then address property.

@Skoti Skoti requested a review from frederoni February 20, 2020 08:42
@frederoni
Copy link
Contributor

frederoni commented Feb 21, 2020

Thank you for your contributions. I added @1ec5 as a reviewer as I believe he has more context.

@frederoni frederoni requested a review from 1ec5 February 21, 2020 12:35
@Skoti
Copy link
Author

Skoti commented Apr 14, 2020

Any chance to start a review?

@JLZ
Copy link

JLZ commented Aug 13, 2020

I'd love to see this get reviewed and merged. As it stands now, if I want to create an address with custom formatting, I have 2 options (neither are great):

  1. Parse MBPlacemark.qualifiedName
  2. Use the address and name properties for street address and dig into postalAddress to get city, state, zip info. It doesn't make sense to have to use bits of data from both objects to build an address.

This PR solves this problem in one way. Another option would be to add the address number to MBPlacemark.postalAddress.street. Then, an address could be pieced together using the postalAddress (CNPostalAddress) property alone.

@1ec5 1ec5 changed the base branch from master to main October 7, 2020 23:59
@S2Ler
Copy link

S2Ler commented Jun 24, 2021

@1ec5 This look ok to me although we need new tests to cover this functionality

@Skoti
Copy link
Author

Skoti commented Jul 10, 2021

I've rebased the PR and added, in existing tests, a simple check for street address. Let me know if you have more sample data to test against.

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.

4 participants