--
-- clip the ocean_all table to the working area Taiwan
--
-- Modified by Geoffrey Yu-kai SHEA
-- 05-APR-2026
--

CREATE TABLE ocean AS
WITH bounds AS (
  SELECT ST_SetSRID(ST_Extent(way)::geometry,4326) AS geom
  FROM planet_osm_line
  )
SELECT 1 AS id, ST_Intersection(b.geom, o.geom) AS geom
FROM bounds b, ocean_all o
WHERE ST_Intersects(b.geom, o.geom);
