CUSP Coastline

From GRASS-Wiki
Jump to navigation Jump to search

NOAA's CUSP: Continually Updated Shoreline

"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

# can keep, but values are only valid for the first segment
v.db.droptable -f CUSP_coastline_extract_polyline

# export shapefile
v.out.ogr format=ESRI_Shapefile \
  in=CUSP_coastline_extract_polyline \
  out=CUSP_coastline_extract_polyline.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

See also