@neaps/tide-database 0.0.20251221 → 0.1.20260107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -3,7 +3,8 @@ NOT WITHIN THE "data" DIRECTORY. EACH DATA FILE HAS ITS OWN LICENSE INFORMATION.
3
3
 
4
4
  The MIT License (MIT)
5
5
 
6
- Copyright (c) 2015 gatsbyjs
6
+ Copyright (c) 2019 Kevin Miller
7
+ Copyright (c) 2025 Brandon Keepers
7
8
 
8
9
  Permission is hereby granted, free of charge, to any person obtaining a copy
9
10
  of this software and associated documentation files (the "Software"), to deal
@@ -22,4 +23,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
23
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
24
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
25
  SOFTWARE.
25
-
package/README.md CHANGED
@@ -1,56 +1,62 @@
1
- ## Tide harmonics database
1
+ # Neaps Tide Database
2
2
 
3
- The availability of good harmonic constituent data varies from country
4
- to country, resulting in very different tide predeictions depending on
5
- what products you use. Within the United States, NOAA provides excellent
6
- harmonic constituents for free, but internationally it is a different
7
- story.
3
+ > A public database of tide harmonics
8
4
 
9
- We first observed these challenges in Gulfo Nuevo in Argentina. The gulf
10
- is very deep, with a narrow mouth to the Atlantic and sloping benthic
11
- profile. As a result, the difference between high and low tides is
12
- consistently 5 meters or more. Various websites and products we used had
13
- different levels of accuracy when predicting the tides. We found one
14
- that was just predicting tides from a station over 200km away, outside
15
- the gulf, and therefore completely different in terms of water level and
16
- timing.
5
+ This database includes harmonic constituents for tide prediction from various sources around the world. These constants can be used with a tide harmonic calculator like [Neaps](https://github.com/neaps/neaps) to create astronomical tide predictions.
17
6
 
18
- The various surf or weather report apps either use old data, or base
19
- large areas of coastline on one station. Many people are still using
20
- pre-2004 data published in Xtide's Harmbase. Harmbase is great, but it's
21
- data is locked in binary files and SQL, and the maintainer [has given up on maintaining it outside the US](https://flaterco.com/xtide/faq.html#60)
22
- .
7
+ ## Sources
23
8
 
24
- **All** constituent data is delivered in Meters.
9
+ - ✅ [**NOAA**](https://tidesandcurrents.noaa.gov): National Oceanic and Atmospheric Administration
10
+ ~3379 stations, mostly in the United States and its territories. Updated monthly via [NOAA's API](https://api.tidesandcurrents.noaa.gov/mdapi/prod/).
25
11
 
26
- Much effort has been made to cover the [requirements from libTCD](https://flaterco.com/xtide/libtcd.html).
12
+ - 🔜 [**TICON-4**](https://www.seanoe.org/data/00980/109129/): TIdal CONstants based on GESLA-4 sea-level records
13
+ 4,838 global stations - ([#16](https://github.com/neaps/tide-database/pull/16))
27
14
 
28
- ## Submitting data
15
+ If you know of other public sources of harmonic constituents, please [open an issue](https://github.com/neaps/tide-database/issues/new) to discuss adding them.
29
16
 
30
- If you have **at least a year** of hourly water level observations, you can convert those to harmonic constituents and [submit them to this database online](https://neaps.js.org/harmonics) with a simple form.
17
+ ## Usage
31
18
 
32
- Your submission will be automatically converted to a Pull Request to this repository.
19
+ The database is currently only available as an NPM package, but may be available in other formats like [sqlite](https://github.com/neaps/tide-database/issues/18) and [xtide's tcd format](https://github.com/neaps/tide-database/issues/19) in the future.
33
20
 
34
- ## Installation
21
+ ### JavaScript / TypeScript
35
22
 
36
- ```bash
37
- npm install @neaps/tide-stations
23
+ Install the package:
24
+
25
+ ```sh
26
+ $ npm install @neaps/tide-database
38
27
  ```
39
28
 
40
- ## Usage
29
+ The package exports an array of all tide stations in the database:
41
30
 
42
31
  ```typescript
43
- import { nearest, near, stations } from '@neaps/tide-stations';
32
+ import { constituents, stations } from '@neaps/tide-database';
33
+
34
+ // Constituents is an array of all harmonic constituents used in the database with a description and speed.
35
+ console.log('Total constituents:', constituents.length);
36
+ console.log(constituents[0]);
44
37
 
45
- // All stations
38
+ // Stations is an array of all the files in `data/`
46
39
  console.log('Total stations:', stations.length);
40
+ console.log(stations[0]);
41
+ ```
47
42
 
48
- // Find the nearest station to a given lat/lon
49
- console.log(`Nearest station:`, nearest({ lat: 26.722, lon: -80.031 }));
43
+ ## Data Format
50
44
 
51
- // Find the 10 nearest stations to a given lat/lon, in order of distance
52
- console.log('5 nearest stations:', near({ lat: 26.722, lon: -80.031 }, 10));
53
- ```
45
+ Each tide station is defined in a single JSON file in the [`data/`](./data) directory that includes basic station information, like location and name, and harmonics or subordinate station offsets. The format is defined by the schema in [../schemas/station.schema.json](schemas/station.schema.json), which includes more detailed descriptions of each field. All data is validated against this schema automatically on each change.
46
+
47
+ ## Station Types
48
+
49
+ Stations can either be _reference_ or _subordinate_, defined in the station's `type` field.
50
+
51
+ ### Reference station
52
+
53
+ Reference stations have defined harmonic constituents. They should have an array of `harmonic_constituents`. These are usually stations that have a long selection of real water level observations.
54
+
55
+ ### Subordinate station
56
+
57
+ Subordinate stations are locations that have very similar tides to a reference station. Usually these are geographically close to another reference station.
58
+
59
+ Subordinate stations have four kinds of offsets, two to correct for water level, and two for the time of high and low tide. They use an `offsets` object to define these items, along with the name of the reference station they are based on.
54
60
 
55
61
  ## Maintenance
56
62
 
@@ -65,7 +71,7 @@ You can also manually trigger the workflow from the Actions tab in GitHub.
65
71
  To manually update NOAA stations:
66
72
 
67
73
  ```bash
68
- $ tools/update-noaa-stations
74
+ $ tools/update-noaa-stations.ts
69
75
  ```
70
76
 
71
77
  This will scan all existing NOAA station files, fetch any new stations from NOAA's API, and update harmonic constituents for all stations.
@@ -77,3 +83,17 @@ Releases of this database use [Semantic Versioning](https://semver.org/), with t
77
83
  * Major version changes indicate breaking changes to the data structure or APIs. However, as long as the version is "0.x", breaking changes may occur without a major version bump.
78
84
  * Minor version changes indicate backward-compatible additions to the data structure or APIs, such as new fields.
79
85
  * Patch version changes indicate updates to station data, and will always be the current date. For example, "0.1.20260101".
86
+
87
+ ## Releasing
88
+
89
+ Releases are created by [running the Publish action](https://github.com/neaps/tide-database/actions/workflows/publish.yml) on GitHub Actions. This action will use the major and minor `version` defined in `package.json`, and set the patch version to the current date.
90
+
91
+ ## License
92
+
93
+ * All code in this repository is licensed under the [MIT License](./LICENSE).
94
+ * The `license` field of each station's JSON file specifies the license for that station.
95
+ * Unless otherwise noted, All other data is licensed under the [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) license.
96
+
97
+ If using this project, please attribute it as:
98
+
99
+ > Tide harmonic constituents from the Neaps tide database (https://github.com/neaps/tide-database)