@math.gl/crs 4.2.0-alpha.5

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 ADDED
@@ -0,0 +1,140 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Uber Technologies, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
23
+ ---
24
+
25
+ Some primitive tessellation approaches were originally inspired by the TDL WebGL samples under
26
+ the New BSD License:
27
+
28
+ Copyright (c) 2011, Google Inc. All rights reserved.
29
+
30
+ Redistribution and use in source and binary forms, with or without modification, are permitted
31
+ provided that the following conditions are met:
32
+
33
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions
34
+ and the following disclaimer.
35
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of
36
+ conditions and the following disclaimer in the documentation and/or other materials provided
37
+ with the distribution.
38
+ 3. Neither the name of Google Inc. nor the names of its contributors may be used to endorse or
39
+ promote products derived from this software without specific prior written permission.
40
+
41
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
42
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
43
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
44
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
47
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
+
50
+ ---
51
+
52
+ math.gl builds on docs and code from "gl-matrix", which is MIT licensed as follows:
53
+
54
+ Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
55
+
56
+ Permission is hereby granted, free of charge, to any person obtaining a copy
57
+ of this software and associated documentation files (the "Software"), to deal
58
+ in the Software without restriction, including without limitation the rights
59
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
+ copies of the Software, and to permit persons to whom the Software is
61
+ furnished to do so, subject to the following conditions:
62
+
63
+ The above copyright notice and this permission notice shall be included in
64
+ all copies or substantial portions of the Software.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
72
+ THE SOFTWARE.
73
+
74
+ --
75
+
76
+ math.gl builds on docs and code from THREE.js, which is MIT licensed as follows:
77
+
78
+ The MIT License
79
+
80
+ Copyright © 2010-2017 three.js authors
81
+
82
+ Permission is hereby granted, free of charge, to any person obtaining a copy
83
+ of this software and associated documentation files (the "Software"), to deal
84
+ in the Software without restriction, including without limitation the rights
85
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
86
+ copies of the Software, and to permit persons to whom the Software is
87
+ furnished to do so, subject to the following conditions:
88
+
89
+ The above copyright notice and this permission notice shall be included in
90
+ all copies or substantial portions of the Software.
91
+
92
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
94
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
95
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
96
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
97
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
98
+ THE SOFTWARE.
99
+
100
+ ---
101
+
102
+ math.gl includes certain files from Cesium (https://github.com/AnalyticalGraphicsInc/cesium) under the Apache 2 License:
103
+
104
+ Copyright 2011-2018 CesiumJS Contributors
105
+
106
+ Licensed under the Apache License, Version 2.0 (the "License");
107
+ you may not use this file except in compliance with the License.
108
+ You may obtain a copy of the License at
109
+ http://www.apache.org/licenses/LICENSE-2.0
110
+
111
+ Unless required by applicable law or agreed to in writing, software
112
+ distributed under the License is distributed on an "AS IS" BASIS,
113
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114
+ See the License for the specific language governing permissions and limitations under the License.
115
+
116
+ Cesium-derived code can be found in the submodule: modules/3d-tiles
117
+
118
+ ---
119
+
120
+ The @math.gl/geometry primitive tessellators are adapted from luma.gl under the MIT License:
121
+
122
+ Copyright (c) 2020 vis.gl contributors
123
+
124
+ Permission is hereby granted, free of charge, to any person obtaining a copy
125
+ of this software and associated documentation files (the "Software"), to deal
126
+ in the Software without restriction, including without limitation the rights
127
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
128
+ copies of the Software, and to permit persons to whom the Software is
129
+ furnished to do so, subject to the following conditions:
130
+
131
+ The above copyright notice and this permission notice shall be included in
132
+ all copies or substantial portions of the Software.
133
+
134
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
135
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
136
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
137
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
138
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
139
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
140
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @math.gl/crs
2
+
3
+ Proj4-independent coordinate reference system definitions shared by math.gl integrations.
4
+
5
+ PROJJSON is an OSGeo/PROJ specification, not an independently published OGC or ISO standard. It
6
+ is designed as a lossless JSON encoding of OGC WKT2:2019 / ISO 19162:2019 and is referenced by OGC
7
+ standards. This package uses strict PROJJSON v0.7 as its semantic CRS object model. Authority codes,
8
+ PROJ strings, WKT2, WKT1, and vendor WKT dialects remain string serializations. WKT and PROJ
9
+ syntax trees preserve the serializations without claiming semantic conversion to PROJJSON.
10
+
11
+ ```ts
12
+ import {parsePROJString, parseWKTCRS} from '@math.gl/crs';
13
+ import type {CRSDefinition, PROJJSONCRS} from '@math.gl/crs';
14
+
15
+ const authorityCode: CRSDefinition = 'EPSG:4326';
16
+ const projString: CRSDefinition = '+proj=longlat +datum=WGS84 +no_defs';
17
+ const projjson: PROJJSONCRS = {
18
+ type: 'GeographicCRS',
19
+ name: 'WGS 84',
20
+ datum: {
21
+ name: 'World Geodetic System 1984',
22
+ ellipsoid: {
23
+ name: 'WGS 84',
24
+ semi_major_axis: 6378137,
25
+ inverse_flattening: 298.257223563
26
+ }
27
+ }
28
+ };
29
+
30
+ const wkt = parseWKTCRS('GEOGCRS["WGS 84",ID["EPSG",4326]]');
31
+ const proj = parsePROJString('+proj=longlat +datum=WGS84 +no_defs');
32
+ ```
33
+
34
+ The official PROJJSON v0.7 JSON Schema is vendored unchanged under its MIT license and exported as
35
+ `@math.gl/crs/projjson.schema.json`. It is the source of truth for the checked-in generated
36
+ TypeScript declarations. This package has no runtime dependencies. Its runtime APIs parse, encode,
37
+ and validate serialization syntax only: they do not perform registry lookup, semantic equivalence,
38
+ coordinate transformation, or general conversion between WKT, PROJ, and PROJJSON.
39
+
40
+ See the [PROJJSON specification](https://proj.org/en/stable/specifications/projjson.html).
package/dist/crs.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { PROJJSONCRS } from "./projjson-types.js";
2
+ /** A registered or named CRS identifier, such as `EPSG:4326` or `WGS84`. */
3
+ export type CRSIdentifier = string;
4
+ /** A coordinate reference system serialized using WKT1 or WKT2. */
5
+ export type WKTCRSDefinition = string;
6
+ /** A coordinate reference system serialized using PROJ string syntax. */
7
+ export type PROJStringDefinition = string;
8
+ /** A serialized or named coordinate reference system definition. */
9
+ export type CRSStringDefinition = CRSIdentifier | WKTCRSDefinition | PROJStringDefinition;
10
+ /** Top-level coordinate reference system object types defined by PROJJSON v0.7. */
11
+ export type PROJJSONCRSType = NonNullable<PROJJSONCRS['type']>;
12
+ type PROJJSONCRSBranchByType<CRS, T> = CRS extends {
13
+ type?: infer Type;
14
+ } ? T extends Type ? CRS & {
15
+ type: T;
16
+ } : never : never;
17
+ /** Selects PROJJSON CRS objects with a specific required top-level `type`. */
18
+ export type PROJJSONCRSByType<T extends PROJJSONCRSType> = T extends unknown ? PROJJSONCRSBranchByType<PROJJSONCRS, T> : never;
19
+ /** A serialized CRS definition or a standards-based PROJJSON CRS object. */
20
+ export type CRSDefinition<T extends PROJJSONCRS = PROJJSONCRS> = CRSStringDefinition | T;
21
+ export type { PROJJSONCRS };
22
+ //# sourceMappingURL=crs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crs.d.ts","sourceRoot":"","sources":["../src/crs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAC,4BAAyB;AAElD,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,mEAAmE;AACnE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC,yEAAyE;AACzE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAE1F,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AAE/D,KAAK,uBAAuB,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,SAAS;IAAC,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;CAAC,GAClE,CAAC,SAAS,IAAI,GACZ,GAAG,GAAG;IAAC,IAAI,EAAE,CAAC,CAAA;CAAC,GACf,KAAK,GACP,KAAK,CAAC;AAEV,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,SAAS,OAAO,GACxE,uBAAuB,CAAC,WAAW,EAAE,CAAC,CAAC,GACvC,KAAK,CAAC;AAEV,4EAA4E;AAC5E,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAEzF,YAAY,EAAC,WAAW,EAAC,CAAC"}
package/dist/crs.js ADDED
@@ -0,0 +1,5 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export {};
5
+ //# sourceMappingURL=crs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crs.js","sourceRoot":"","sources":["../src/crs.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC"}