Created
May 31, 2020 06:10
-
-
Save ceteri/7b0294d2f87405363a05a2f9924501c9 to your computer and use it in GitHub Desktop.
Geo 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_state_20m.zip | |
mkdir maps | |
cd maps | |
unzip ../cb_2018_us_state_20m.zip |
Here's an equivalent in Python:
import io
import requests
import zipfile
url = "https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_state_20m.zip"
r = requests.get(url, stream=True)
z = zipfile.ZipFile(io.BytesIO(r.content))
z.extractall("maps")
Thank you for your response!
What if I don't save the zip code? I want to call the geo and then after preparing some queries, save a new database which includes geometry (longitude/latitude).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi- How can I get via python?