coastlines 0.0.3-alpha.0 → 0.0.5-alpha.0

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
@@ -19,3 +19,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
+
23
+ ---
24
+
25
+ The code and documentation are MIT, above. The data ships under its own
26
+ terms, unchanged: Natural Earth is public domain; the GSHHG shoreline is
27
+ LGPL-3.0-or-later, with its copyright and permission notice at
28
+ data/gshhg-licence.txt and the licence text at data/gshhg-copying-lesser.txt.
29
+ The package's SPDX expression, `MIT AND LGPL-3.0-or-later`, names both.
package/README.md CHANGED
@@ -20,7 +20,16 @@ const world = JSON.parse(await readFile(localUrl(entry), 'utf8'))
20
20
  ```
21
21
 
22
22
  The subpath `coastlines/data/<id>` resolves to the `.geojson` file for any
23
- tool that can load one; `manifest.json` and `charts.json` are plain JSON.
23
+ tool that can load one; `manifest.json` and `charts.json` are plain JSON. A
24
+ file in another format carries its extension, `coastlines/data/gshhg-land-h.shp`,
25
+ and `shapefilePolygons` from the package reads it:
26
+
27
+ ```js
28
+ import { find, localUrl, shapefilePolygons } from 'coastlines'
29
+
30
+ const land = find('gshhg-land-h') // { source: 'gshhg', format: 'shp', … }
31
+ const polygons = shapefilePolygons(await readFile(localUrl(land))) // 144,749 of [outerRing]
32
+ ```
24
33
 
25
34
  **See it:** [the basemap on GitHub Pages](https://mark-brannan.github.io/coastlines/),
26
35
  the three default charts, drawn with the styles the plugin will serve.
@@ -45,9 +54,12 @@ draws.
45
54
 
46
55
  ## The catalogue
47
56
 
48
- 33 files. Every 50m and 110m file in the marine catalogue, and at 10m the
49
- coastline, the land and every other file that fits a 5 MB response body.
50
- The rest of 10m and the bathymetry set belong to companion packages.
57
+ 36 files from two sources. From Natural Earth, every 50m and 110m file in
58
+ the marine catalogue, and at 10m the coastline, the land and every other file
59
+ that fits a 5 MB response body; the rest of 10m and the bathymetry set belong
60
+ to companion packages. From GSHHG 2.3.7, the "h" land polygons, the next rung
61
+ of coastline above Natural Earth's 10m (vertex spacing median 707 m), as the
62
+ published shapefile, with the two licence notices that travel with it.
51
63
 
52
64
  <!-- catalogue:start -->
53
65
  | Import `coastlines/data/…` | Layer | Scale | Geometry | Raw | Why a boat wants it |
@@ -70,6 +82,7 @@ The rest of 10m and the bathymetry set belong to companion packages.
70
82
  | `ne-admin-0-boundary-lines-maritime-indicator-50m` | admin_0_boundary_lines_maritime_indicator | 50m | lines | 193 KB | The maritime boundaries Natural Earth draws |
71
83
  | `ne-admin-0-countries-50m` | admin_0_countries | 50m | polygons | 2.9 MB | Courtesy flag, VHF scheme, customs |
72
84
  | `ne-populated-places-50m` | populated_places | 50m | points | 3.2 MB | Labels |
85
+ | `ne-urban-areas-50m` | urban_areas | 50m | polygons | 1.2 MB | Built-up footprints of cities |
73
86
  | `ne-lakes-50m` | lakes | 50m | polygons | 855 KB | Inland context |
74
87
  | `ne-rivers-lake-centerlines-50m` | rivers_lake_centerlines | 50m | lines | 808 KB | Inland context |
75
88
  | `ne-glaciated-areas-50m` | glaciated_areas | 50m | polygons | 500 KB | Polar context |
@@ -85,17 +98,33 @@ The rest of 10m and the bathymetry set belong to companion packages.
85
98
  | `ne-admin-0-disputed-areas-10m` | admin_0_disputed_areas | 10m | polygons | 685 KB | Honesty on the borders layer |
86
99
  | `ne-ports-10m` | ports | 10m | points | 273 KB | Harbours |
87
100
  | `ne-antarctic-ice-shelves-polys-10m` | antarctic_ice_shelves_polys | 10m | polygons | 548 KB | Polar context |
101
+ | `gshhg-land-h.shp` | land | h | polygons | 32.5 MB | Land, the GSHHS shoreline at high resolution; 144,749 polygons |
102
+ | `gshhg-licence.txt` | — | — | — | 1 KB | The GSHHG copyright and permission notice; travels with every copy |
103
+ | `gshhg-copying-lesser.txt` | — | — | — | 8 KB | The GNU Lesser General Public License, version 3 |
88
104
  <!-- catalogue:end -->
89
105
 
90
106
  ![Every file, rendered equirectangular](docs/layers.png)
91
107
 
92
108
  Ids follow the file: `ne-<layer>-<scale>` is `ne_<scale>_<layer>.geojson` in
93
- the Natural Earth tree. `coastlines/manifest.json` is the machine-readable
94
- form of this table, with the bytes and sha256 of each file.
109
+ the Natural Earth tree; `gshhg-land-h` is `GSHHS_shp/h/GSHHS_h_L1.shp` inside
110
+ the GSHHG zip. `coastlines/manifest.json` is the machine-readable form of this
111
+ table, with the bytes and sha256 of each file and, under `sources`, of the
112
+ zip itself.
113
+
114
+ ### Sources and licences
115
+
116
+ Natural Earth is public domain. GSHHG (Wessel & Smith, the Global
117
+ Self-consistent, Hierarchical, High-resolution Geography database) is
118
+ LGPL-3.0-or-later with a permission notice that asks for the copyright and
119
+ permission notice to appear in all copies; both ship unchanged as
120
+ `data/gshhg-licence.txt` and `data/gshhg-copying-lesser.txt`, pinned like the
121
+ data. Cite: Wessel, P., and W. H. F. Smith, A global, self-consistent,
122
+ hierarchical, high-resolution shoreline database, _J. Geophys. Res._, 101(B4),
123
+ 8741–8743, 1996.
95
124
 
96
125
  ## The charts
97
126
 
98
- A plotter does not want 33 files; it wants a basemap to tick. `charts.json`
127
+ A plotter does not want 36 files; it wants a basemap to tick. `charts.json`
99
128
  groups the files into three charts, each at one scale, and gives every layer
100
129
  its zoom range. `styles/<chart>.json` is a Mapbox style, hand-written, one
101
130
  per chart; the demo draws it over GeoJSON sources, and the plugin will serve
@@ -112,14 +141,14 @@ consumer written against one chart reads any.
112
141
 
113
142
  ## Provenance, and checking rather than trusting
114
143
 
115
- `data/` is not in git. `npm run sync` fetches each file from the pinned
144
+ `data/` is not in git. `npm run sync` fetches each file from its pinned
116
145
  release and refuses any byte that disagrees with `manifest.json`; `npm pack`
117
146
  runs it first, so a tarball never ships a file the manifest did not promise.
118
147
 
119
148
  ```shell
120
- npm run sync # fetch what is missing, verify everything (45 MB, ~15 s)
149
+ npm run sync # fetch what is missing, verify everything (45 MB + 149 MB zip)
121
150
  npm run sync:check # verify only, no network
122
- npm run sync:refresh # move the pin: refetch all and rewrite bytes and sha256
151
+ npm run sync:refresh # move the pins: refetch all and rewrite bytes and sha256
123
152
  ```
124
153
 
125
154
  To check a published tarball against Natural Earth yourself:
@@ -136,4 +165,8 @@ permission needed, no attribution required. Credited anyway:
136
165
 
137
166
  > Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com
138
167
 
168
+ The GSHHG shoreline is [LGPL-3.0-or-later][gshhg]; its notices ship beside it
169
+ ([Sources and licences](#sources-and-licences)).
170
+
139
171
  [ne]: https://www.naturalearthdata.com/
172
+ [gshhg]: https://www.soest.hawaii.edu/pwessel/gshhg/
package/charts.json CHANGED
@@ -10,9 +10,24 @@
10
10
  { "id": "ne-land-110m", "name": "land", "minzoom": 0, "maxzoom": 4 },
11
11
  { "id": "ne-glaciated-areas-110m", "name": "glaciated_areas", "minzoom": 2, "maxzoom": 4 },
12
12
  { "id": "ne-lakes-110m", "name": "lakes", "minzoom": 2, "maxzoom": 4 },
13
- { "id": "ne-rivers-lake-centerlines-110m", "name": "rivers_lake_centerlines", "minzoom": 3, "maxzoom": 4 },
14
- { "id": "ne-admin-0-countries-110m", "name": "admin_0_countries", "minzoom": 2, "maxzoom": 4 },
15
- { "id": "ne-admin-0-boundary-lines-land-110m", "name": "admin_0_boundary_lines_land", "minzoom": 1, "maxzoom": 4 },
13
+ {
14
+ "id": "ne-rivers-lake-centerlines-110m",
15
+ "name": "rivers_lake_centerlines",
16
+ "minzoom": 3,
17
+ "maxzoom": 4
18
+ },
19
+ {
20
+ "id": "ne-admin-0-countries-110m",
21
+ "name": "admin_0_countries",
22
+ "minzoom": 2,
23
+ "maxzoom": 4
24
+ },
25
+ {
26
+ "id": "ne-admin-0-boundary-lines-land-110m",
27
+ "name": "admin_0_boundary_lines_land",
28
+ "minzoom": 1,
29
+ "maxzoom": 4
30
+ },
16
31
  { "id": "ne-coastline-110m", "name": "coastline", "minzoom": 0, "maxzoom": 4 },
17
32
  { "id": "ne-geographic-lines-110m", "name": "geographic_lines", "minzoom": 0, "maxzoom": 4 },
18
33
  { "id": "ne-populated-places-110m", "name": "populated_places", "minzoom": 2, "maxzoom": 4 }
@@ -27,13 +42,33 @@
27
42
  "layers": [
28
43
  { "id": "ne-ocean-50m", "name": "ocean", "minzoom": 0, "maxzoom": 7 },
29
44
  { "id": "ne-land-50m", "name": "land", "minzoom": 0, "maxzoom": 7 },
30
- { "id": "ne-antarctic-ice-shelves-polys-50m", "name": "antarctic_ice_shelves_polys", "minzoom": 2, "maxzoom": 7 },
45
+ {
46
+ "id": "ne-antarctic-ice-shelves-polys-50m",
47
+ "name": "antarctic_ice_shelves_polys",
48
+ "minzoom": 2,
49
+ "maxzoom": 7
50
+ },
31
51
  { "id": "ne-glaciated-areas-50m", "name": "glaciated_areas", "minzoom": 3, "maxzoom": 7 },
32
52
  { "id": "ne-lakes-50m", "name": "lakes", "minzoom": 3, "maxzoom": 7 },
33
- { "id": "ne-rivers-lake-centerlines-50m", "name": "rivers_lake_centerlines", "minzoom": 4, "maxzoom": 7 },
53
+ {
54
+ "id": "ne-rivers-lake-centerlines-50m",
55
+ "name": "rivers_lake_centerlines",
56
+ "minzoom": 4,
57
+ "maxzoom": 7
58
+ },
34
59
  { "id": "ne-admin-0-countries-50m", "name": "admin_0_countries", "minzoom": 3, "maxzoom": 7 },
35
- { "id": "ne-admin-0-boundary-lines-land-50m", "name": "admin_0_boundary_lines_land", "minzoom": 2, "maxzoom": 7 },
36
- { "id": "ne-admin-0-boundary-lines-maritime-indicator-50m", "name": "admin_0_boundary_lines_maritime_indicator", "minzoom": 3, "maxzoom": 7 },
60
+ {
61
+ "id": "ne-admin-0-boundary-lines-land-50m",
62
+ "name": "admin_0_boundary_lines_land",
63
+ "minzoom": 2,
64
+ "maxzoom": 7
65
+ },
66
+ {
67
+ "id": "ne-admin-0-boundary-lines-maritime-indicator-50m",
68
+ "name": "admin_0_boundary_lines_maritime_indicator",
69
+ "minzoom": 3,
70
+ "maxzoom": 7
71
+ },
37
72
  { "id": "ne-coastline-50m", "name": "coastline", "minzoom": 0, "maxzoom": 7 },
38
73
  { "id": "ne-geographic-lines-50m", "name": "geographic_lines", "minzoom": 0, "maxzoom": 7 },
39
74
  { "id": "ne-populated-places-50m", "name": "populated_places", "minzoom": 3, "maxzoom": 7 }
@@ -45,8 +80,6 @@
45
80
  "description": "The finest coastline alone, to zoom 12, the layer a distance-to-shore reads",
46
81
  "minzoom": 0,
47
82
  "maxzoom": 12,
48
- "layers": [
49
- { "id": "ne-coastline-10m", "name": "coastline", "minzoom": 0, "maxzoom": 12 }
50
- ]
83
+ "layers": [{ "id": "ne-coastline-10m", "name": "coastline", "minzoom": 0, "maxzoom": 12 }]
51
84
  }
52
85
  ]
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/data/gshhg-land-h.shp
3
+ size: 34129516 bytes
4
+ sha256: d870bdbc90a074f87a8c09a9630abb5f18916314b9a196dba2e6866fd51ef325
@@ -0,0 +1,23 @@
1
+ $LastChangedDate: 2013-11-24 09:26:07 -1000 (Sun, 24 Nov 2013) $
2
+ $Revision: 594 $
3
+
4
+ As of GSHHG 2.2.2, GSHHG is distributed under the GNU Lesser General Public
5
+ License (LGPL) version 3 or later. Copies of the The GNU General Public
6
+ License (GPL) and the GNU Lesser General Public License (LGPL) are
7
+ distributed along with the sources. Refer to the files COPYINGv3 and
8
+ COPYING.LESSERv3.
9
+
10
+ Permission to use, copy, modify, and distribute (with no more than a
11
+ reasonable redistribution fee) this data and its documentation for
12
+ any purpose is hereby granted, provided that the above copyright notice
13
+ appear in all copies, that both that copyright notice and this
14
+ permission notice appear in supporting documentation, and that the name
15
+ of GSHHG not be used in advertising or publicity pertaining to
16
+ distribution of the software without specific, written prior permission.
17
+ The GSHHG package may be included in a bundled distribution of software
18
+ for which a fee may be charged. The University of Hawaii (UH) and the
19
+ National Oceanic and Atmospheric Administration (NOAA) make no
20
+ representations about the suitability of this software for any purpose.
21
+ It is provided "as is" without expressed or implied warranty. It is
22
+ provided with no support and without obligation on the part of UH or
23
+ NOAA, to assist in its use, correction, modification, or enhancement.