CUSP Coastline: Difference between revisions
m (→Lines to area) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 58: | Line 58: | ||
</source> | </source> | ||
You can also use v.centroids to add area centroids and v.dissolve to remove any inland lakes. | You can also use {{cmd|v.centroids}} to add area centroids (thus turning a boundary map into an area map) and {{cmd|v.dissolve}} to remove any inland lakes. | ||
To use v.dissolve first set <tt>step=0</tt> in v.centroids or v.category so that all areas are the same category number. | To use v.dissolve first set <tt>step=0</tt> in v.centroids or {{cmd|v.category}} so that all areas are the same category number. | ||
Sometimes the coastline is broken, either where the lines end somewhere up a river, or else just a small misalignment somewhere. | |||
You can use the {{cmd|v.clean}} module with a reasonably small snapping threshold or for regional coastline extracts just edit the boundary vector map by hand with {{cmd|v.digit}} in GRASS 6 or the vector editing tool in GRASS 7 before converting the boundary map to an area map. (Area maps are simply boundary maps with centroids added. The centroids carry the category number, the boundaries should not contain category numbers in most cases.) | |||
=== See also === | === See also === |
Latest revision as of 05:17, 1 December 2020
NOAA's CUSP: Continually Updated Shoreline for the USA and its territories
- "This data set was created to deliver continuous shoreline with frequent updates to support various GIS applications including coastal and marine spatial planning, tsunami and storm surge modeling, hazard delineation and mitigation, environmental studies and may assist in nautical chart updates."
Retrieving data
- Visit NOAA's CUSP data access site
- Zoom into your area of interest
- (since it's running OpenLayers you can do the nice shift+left-mouse-drag trick to quickly zoom into a box of interest)
- Along the top of the map is a tool bar, click on "Download" on the right end and then select CUSP
- You can now either select by rectangle, or by named region if you want a large area
- Draw a box on the map, it will then ask you if you want a Shapefile or KML
- Select Shapefile and the .zip data will be prepared for download
Import and cleanup
You can import the Shapefile or KML into a lat/long location with v.in.ogr.
The data comes as many discrete line segments. It may be useful to combine those into individual polylines. Fortunately they all seem to touch so doing that is fairly simple with the v.build.polylines module. If in some areas they aren't exactly touching the v.clean module's snap tool can be used with a very small threshold value to fix that.
- d.vect's '-c' flag can be used to color each of the various line segments with a different random color.
Combine line segments into continuous islands
# Import the Shapefile. The '-o' flag is used here to ignore NAD83 -> WGS84 datum mismatch
v.in.ogr dsn=CUSPLine.shp out=CUSP_coastline_extract_raw -o
# if needed: (wasn't for me)
# v.clean tool=snap threshold=0.000001
# n.b. there's a bug in GRASS v6.4; use GRASS v7 or apply bugfix of Jan. 5, 2013
v.build.polylines cats=first type=line --verbose \
in=CUSP_coastline_extract_raw out=CUSP_coastline_extract_polyline
# you can keep the table if you like, but note the values are only valid for the first segment
v.db.droptable -f CUSP_coastline_extract_polyline
# export again as a Shapefile
v.out.ogr format=ESRI_Shapefile \
in=CUSP_coastline_extract_polyline dsn=CUSP_coastline_extract.shp
Lines to area
If you want filled areas not lines you can use the following commands:
# convert lines to boundaries
v.type from_type=line to_type=boundary
# remove line segment category numbers from boundaries
v.category option=del
# create areas (adds centroids)
v.category option=add type=area
You can also use v.centroids to add area centroids (thus turning a boundary map into an area map) and v.dissolve to remove any inland lakes. To use v.dissolve first set step=0 in v.centroids or v.category so that all areas are the same category number.
Sometimes the coastline is broken, either where the lines end somewhere up a river, or else just a small misalignment somewhere. You can use the v.clean module with a reasonably small snapping threshold or for regional coastline extracts just edit the boundary vector map by hand with v.digit in GRASS 6 or the vector editing tool in GRASS 7 before converting the boundary map to an area map. (Area maps are simply boundary maps with centroids added. The centroids carry the category number, the boundaries should not contain category numbers in most cases.)
See also
- The v.clean module's 'tool=rmsa' to remove small angles (spikes)
- The v.generalize module to simplify the coastline
- Global datasets