MacHu-GWU / uszipcode-project

USA zipcode programmable database, includes up-to-date census and geometry information.
MIT License
229 stars 49 forks source link

Way to extract ''border polygon'' #64

Open ismaelahrazem opened 2 years ago

ismaelahrazem commented 2 years ago

Good morning,

I'm interested in finding the polygon that encapsulate a specific zip code.

Such that, given a zip code, i.e., zipcode = 10001, I would like to find the shape as the corresponding polygon.

In case that query is possible, what would the piece of code I should write to extract that information?

Thanks for your help

mPyth commented 2 years ago

with a "small" delay, next code should work:

from uszipcode import SearchEngine
with SearchEngine(simple_or_comprehensive = SearchEngine.SimpleOrComprehensiveArgEnum.comprehensive) as se:
    zip = se.by_zipcode('90008')
    requiredPolygon = zip.polygon