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

Update ACS offering (special case for 2020 geographies) #152

Open
jbousquin opened this issue Sep 30, 2022 · 3 comments
Open

Update ACS offering (special case for 2020 geographies) #152

jbousquin opened this issue Sep 30, 2022 · 3 comments

Comments

@jbousquin
Copy link

With PR #127 to dynamically update layers most ACS updates will only need an update to the years supported (3 lines), i.e., for 2020;

    def __init__(self, year="latest"):
        self._cache = dict()
        if year == "latest":
            year = 2020
        if year not in list(range(2017,2021)):
            raise NotImplementedError(
                "The requested year ({}) is too early/late. "
                "Only 2017, 2018, 2019 or 2020 are supported.".format(year)
            )

However, because ACS 2020 does not have it's own tiger MapService it's a special case and needs additional handling to redirect it to the 2020 census geographies. This could be in products, remote or tiger so it may merit discussion. My preference is remote where self.mapservice is assigned, e.g.,:

        if isinstance(key, tig.TigerConnection):
            self.mapservice = key
        elif isinstance(key, str):
            if key == 'tigerWMS_ACS2020':
                # No unique layer use census 2020 geographies
                self.mapservice = tig.TigerConnection(name='tigerWMS_Census2020')
            else:
                self.mapservice = tig.TigerConnection(name=key)
        return self

Open to more elegant solution than above, but should work.

@fedderw
Copy link

fedderw commented Oct 3, 2022

Is this true for 2021 ACS as well?

@jbousquin
Copy link
Author

Only 2020 will be a special case. ACS 2021 and 2022 geographies are available and should work with the dynamic layer PR so just the years have to be updated once the data is available (5-year ACS 2021 is scheduled for December).

@jbousquin
Copy link
Author

Confirmed - PR #127 works as intended for the recently released 5-year 2021 vintage:

    def __init__(self, year="latest"):
        self._cache = dict()
        if year == "latest":
            year = 2021
        if year not in list(range(2017,2022)):
            raise NotImplementedError(
                "The requested year ({}) is too early/late. "
                "Only 2017, 2018, 2019, 2020, or 2021 are supported.".format(year)
            )

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

No branches or pull requests

2 participants