Skip to content

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

Open
@jbousquin

Description

@jbousquin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions