Last active
July 30, 2022 23:59
-
-
Save typebrook/c5e5f0a235eb12d8b18729c2e20e1ff2 to your computer and use it in GitHub Desktop.
[gov-data] Address location in Tainan, thanks kiang! #gov #data #addr #csv
This file contains hidden or 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
| all: 108.csv output.csv output.geojson | |
| # CSV file for address in Tainan | |
| # see dataset at web page: https://data.tainan.gov.tw/dataset/108-address-location | |
| 108.csv: | |
| curl -LO https://data.tainan.gov.tw/dataset/32d604ed-9c9e-4d12-9c55-d33b1bb5fd60/resource/2389d5b2-451b-4b6a-b808-d2803717b196/download/108.csv | |
| # Transform from TWD97 to EPSG:4326 | |
| # see GDAL release page: https://gdal.org/download.html | |
| # and doc for CSV driver: https://gdal.org/drivers/vector/csv.html | |
| output.csv: | |
| ogr2ogr output.csv 108.csv \ | |
| -lco GEOMETRY=AS_XY \ | |
| -oo X_POSSIBLE_NAMES=橫座標 -oo Y_POSSIBLE_NAMES=縱座標 \ | |
| -s_srs "EPSG:3826" -t_srs "EPSG:4326" \ | |
| -oo KEEP_GEOM_COLUMNS=NO | |
| # Get GeoJSON format. Caution! it is over 100M | |
| output.geojson: | |
| ogr2ogr output.geojson output.csv \ | |
| -oo X_POSSIBLE_NAMES=X -oo Y_POSSIBLE_NAMES=Y \ | |
| -oo KEEP_GEOM_COLUMNS=NO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment