Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonw/us-counties-datasette
A Datasette instance exposing names, FIPS codes and polygons of US counties
https://github.com/simonw/us-counties-datasette
datasette
Last synced: 27 days ago
JSON representation
A Datasette instance exposing names, FIPS codes and polygons of US counties
- Host: GitHub
- URL: https://github.com/simonw/us-counties-datasette
- Owner: simonw
- Created: 2021-03-08T02:16:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T23:46:10.000Z (almost 2 years ago)
- Last Synced: 2024-10-06T20:57:27.454Z (about 1 month ago)
- Topics: datasette
- Language: Shell
- Homepage: https://us-counties.datasette.io
- Size: 7.81 KB
- Stars: 9
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# us-counties-datasette
https://us-counties.datasette.io/
A Datasette instance exposing US counties, FIPS codes and polygons.
Source data: the `cb_2018_us_county_500k.zip` shapefile released by the US census.
Download that from https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html
Run `./build.sh` to build the database.
To run locally:
datasette counties.db -m metadata.yml --load-extension=spatialite
I run `./deploy.sh` to deploy it to Cloud Run.
## API
This query will return the county for a latitude and longitude:
https://us-counties.datasette.io/counties/county_for_latitude_longitude
Here's that as a JSON API:
https://us-counties.datasette.io/counties/county_for_latitude_longitude.json?longitude=-122.676968&latitude=45.266289&_shape=array