From 8633838f065a5a339f7a895099c40ee68943dbf1 Mon Sep 17 00:00:00 2001 From: Rohit Sarathy Date: Tue, 21 May 2024 23:55:41 -0700 Subject: [PATCH 1/3] Use line breaks to make the docker run command readable. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9042346..2538f6e 100644 --- a/README.md +++ b/README.md @@ -31,5 +31,11 @@ docker build . -t osm-extractor:testing-new-extract ``` 7. (test) Generate the extract by running the docker container. This should create a new .pbf file in `./volumes/output`. ``` -docker run -v ./volumes/output:/mnt/output -v ./volumes/input:/mnt/input osm-extractor:testing-new-extract osmium extract -d /mnt/output -c /app/config.json /mnt/input/latest.osm.pbf +docker run \ +-v ./volumes/output:/mnt/output \ +-v ./volumes/input:/mnt/input \ +osm-extractor:testing-new-extract osmium extract \ + -d /mnt/output \ + -c /app/config.json \ + /mnt/input/latest.osm.pbf ``` From fb5ab4ed6b2f782c9ba0a80cce13db2b738a27e1 Mon Sep 17 00:00:00 2001 From: Rohit Sarathy Date: Wed, 22 May 2024 00:06:30 -0700 Subject: [PATCH 2/3] Genericize mapshaper sample command. --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2538f6e..88a003a 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,14 @@ Below is an explication for how to make this tool make your own cutouts. Follow ``` curl 'https://download.geofabrik.de/north-america/us/california/norcal-latest.osm.pbf' -o ./volumes/input/latest.osm.pbf ``` -2. Decide what counties you want to include in your OSM cutout. Find each county in [counties-usa.geojson](counties-usa.geojson), confirm spelling, capitalization, etc... -3. Add all of the counties you want in your extract as a comma seperated list in the follow command, replacing `Alameda,Contra Costa,Marin,Napa,San Mateo,Santa Clara,Solano,Sonoma,San Francisco`. Set the name of the output file (replacing `bay-area-geometry.geojson` with something that makes sense). Then run it. This should create a geojson file in the `./polygons` directory. -``` -npx --yes mapshaper -i counties-usa.geojson -filter '"Alameda,Contra Costa,Marin,Napa,San Mateo,Santa Clara,Solano,Sonoma,San Francisco".indexOf(NAME) > -1' -dissolve2 -o ./polygons/san-francisco-bay-area.geojson geojson-type=Feature +2. Decide which counties you want to include in your OSM cutout. Find each county in [counties-usa.geojson](counties-usa.geojson), confirm spelling, capitalization, etc... +3. Add all the counties you want in your extract as a comma seperated list in the following command, e.g. `Alameda,Contra Costa,Marin,Napa,San Mateo,Santa Clara,Solano,Sonoma,San Francisco`. Set the name of the output file. Then run it. This should create a geojson file in the `./polygons` directory. +``` +npx --yes mapshaper \ + -i counties-usa.geojson \ + -filter '"{list-of-comma-separated-county-names}".indexOf(NAME) > -1' \ + -dissolve2 \ + -o ./polygons/{my-region-name}.geojson geojson-type=Feature ``` 4. (optional) Create a convex hull of the counties. This is useful when the group of counties don't make a solid shape. Use the geojson file created in the previous step to make a new geojson file. ``` From c8d4e200cdeeec0c7be1077ececb8aeb2d5c0775 Mon Sep 17 00:00:00 2001 From: Rohit Sarathy Date: Wed, 22 May 2024 00:08:51 -0700 Subject: [PATCH 3/3] corresponding typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88a003a..0010ec7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Makes OSM cutouts from the larger USA data set. ## How to use -Add a geojson file that contains a Feature into the `./polygons` directory, add a coorosponding entry in `./config.json`, then build and run docker container. +Add a geojson file that contains a Feature into the `./polygons` directory, add a corresponding entry in `./config.json`, then build and run docker container. Below is an explication for how to make this tool make your own cutouts. Follow the steps below. The San Francisco Bay Area consists of nine counties; they are used in the following example. The tools requires: