Difference between revisions of "CUSP Coastline"

From GRASS-Wiki
Jump to: navigation, search
m (Lines to area)
m (Lines to area)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
== NOAA's CUSP: Continually Updated Shoreline ==
+
== NOAA's CUSP: Continually Updated Shoreline for the USA and its territories ==
  
 
* [https://shoreline.noaa.gov/data/datasheets/cusp.html Description]
 
* [https://shoreline.noaa.gov/data/datasheets/cusp.html Description]
Line 16: Line 16:
 
=== Import and cleanup ===
 
=== Import and cleanup ===
  
You can import the Shapefile or KML with v.in.ogr.
+
You can import the Shapefile or KML into a lat/long location with {{cmd|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.
+
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 {{cmd|v.build.polylines}} module. If in some areas they aren't exactly touching the {{cmd|v.clean}} module's ''snap'' tool can be used with a very small threshold value to fix that.
 +
 
 +
* {{cmd|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 ====
 
==== Combine line segments into continuous islands ====
Line 33: Line 35:
 
   in=CUSP_coastline_extract_raw out=CUSP_coastline_extract_polyline
 
   in=CUSP_coastline_extract_raw out=CUSP_coastline_extract_polyline
  
# can keep, but values are only valid for the first segment
+
# 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
 
v.db.droptable -f CUSP_coastline_extract_polyline
  
# export shapefile
+
# export again as a Shapefile
 
v.out.ogr format=ESRI_Shapefile \
 
v.out.ogr format=ESRI_Shapefile \
   in=CUSP_coastline_extract_polyline \
+
   in=CUSP_coastline_extract_polyline dsn=CUSP_coastline_extract.shp
  out=CUSP_coastline_extract_polyline.shp
 
 
</source>
 
</source>
  
Line 56: Line 57:
 
v.category option=add type=area
 
v.category option=add type=area
 
</source>
 
</source>
 +
 +
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 {{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 ===
  
 +
* The {{cmd|v.clean}} module's 'tool=rmsa' to remove small angles (spikes)
 +
* The [[V.generalize tutorial|v.generalize]] module to simplify the coastline
 
* [[Global datasets]]
 
* [[Global datasets]]
  
 
[[Category: Geodata]]
 
[[Category: Geodata]]
 
[[Category: Import]]
 
[[Category: Import]]

Latest revision as of 22:17, 30 November 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

(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