@developmentseed/deck.gl-geotiff 0.1.0-beta.4
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/README.md +6 -0
- package/dist/cog-layer.d.ts +53 -0
- package/dist/cog-layer.d.ts.map +1 -0
- package/dist/cog-layer.js +178 -0
- package/dist/cog-layer.js.map +1 -0
- package/dist/cog-tile-matrix-set.d.ts +11 -0
- package/dist/cog-tile-matrix-set.d.ts.map +1 -0
- package/dist/cog-tile-matrix-set.js +179 -0
- package/dist/cog-tile-matrix-set.js.map +1 -0
- package/dist/ellipsoids.d.ts +153 -0
- package/dist/ellipsoids.d.ts.map +1 -0
- package/dist/ellipsoids.js +153 -0
- package/dist/ellipsoids.js.map +1 -0
- package/dist/geotiff-layer.d.ts +55 -0
- package/dist/geotiff-layer.d.ts.map +1 -0
- package/dist/geotiff-layer.js +64 -0
- package/dist/geotiff-layer.js.map +1 -0
- package/dist/geotiff-reprojection.d.ts +31 -0
- package/dist/geotiff-reprojection.d.ts.map +1 -0
- package/dist/geotiff-reprojection.js +172 -0
- package/dist/geotiff-reprojection.js.map +1 -0
- package/dist/geotiff.d.ts +31 -0
- package/dist/geotiff.d.ts.map +1 -0
- package/dist/geotiff.js +70 -0
- package/dist/geotiff.js.map +1 -0
- package/dist/index.cjs +181 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/pool.d.ts +1 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js +2 -0
- package/dist/pool.js.map +1 -0
- package/dist/src/geotiff-reprojection.d.ts +10 -0
- package/dist/src/geotiff-reprojection.d.ts.map +1 -0
- package/dist/src/geotiff-reprojection.js +159 -0
- package/dist/src/geotiff-reprojection.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/tests/placeholder.test.d.ts +2 -0
- package/dist/tests/placeholder.test.d.ts.map +1 -0
- package/dist/tests/placeholder.test.js +7 -0
- package/dist/tests/placeholder.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +69 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var proj4 = require('proj4');
|
|
4
|
+
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var proj4__default = /*#__PURE__*/_interopDefault(proj4);
|
|
8
|
+
|
|
9
|
+
// ../raster-reproject/src/reprojection/affine.ts
|
|
10
|
+
function invertGeoTransform(gt) {
|
|
11
|
+
if (isDegenerate(gt)) {
|
|
12
|
+
throw new Error("Cannot invert degenerate transform");
|
|
13
|
+
}
|
|
14
|
+
const idet = 1 / determinant(gt);
|
|
15
|
+
const [sa, sb, sc, sd, se, sf] = gt;
|
|
16
|
+
const ra = se * idet;
|
|
17
|
+
const rb = -sb * idet;
|
|
18
|
+
const rd = -sd * idet;
|
|
19
|
+
const re = sa * idet;
|
|
20
|
+
return [
|
|
21
|
+
ra,
|
|
22
|
+
rb,
|
|
23
|
+
-sc * ra - sf * rb,
|
|
24
|
+
rd,
|
|
25
|
+
re,
|
|
26
|
+
-sc * rd - sf * re
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
function isDegenerate(gt) {
|
|
30
|
+
return determinant(gt) === 0;
|
|
31
|
+
}
|
|
32
|
+
function determinant(gt) {
|
|
33
|
+
const [a, b, _c, d, e, _f] = gt;
|
|
34
|
+
return a * e - b * d;
|
|
35
|
+
}
|
|
36
|
+
function applyAffine(x, y, gt) {
|
|
37
|
+
const [a, b, c, d, e, f] = gt;
|
|
38
|
+
return [a * x + b * y + c, d * x + e * y + f];
|
|
39
|
+
}
|
|
40
|
+
var OGC_84 = {
|
|
41
|
+
$schema: "https://proj.org/schemas/v0.7/projjson.schema.json",
|
|
42
|
+
type: "GeographicCRS",
|
|
43
|
+
name: "WGS 84 (CRS84)",
|
|
44
|
+
datum_ensemble: {
|
|
45
|
+
name: "World Geodetic System 1984 ensemble",
|
|
46
|
+
members: [
|
|
47
|
+
{
|
|
48
|
+
name: "World Geodetic System 1984 (Transit)",
|
|
49
|
+
id: { authority: "EPSG", code: 1166 }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "World Geodetic System 1984 (G730)",
|
|
53
|
+
id: { authority: "EPSG", code: 1152 }
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "World Geodetic System 1984 (G873)",
|
|
57
|
+
id: { authority: "EPSG", code: 1153 }
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "World Geodetic System 1984 (G1150)",
|
|
61
|
+
id: { authority: "EPSG", code: 1154 }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "World Geodetic System 1984 (G1674)",
|
|
65
|
+
id: { authority: "EPSG", code: 1155 }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "World Geodetic System 1984 (G1762)",
|
|
69
|
+
id: { authority: "EPSG", code: 1156 }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "World Geodetic System 1984 (G2139)",
|
|
73
|
+
id: { authority: "EPSG", code: 1309 }
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
ellipsoid: {
|
|
77
|
+
name: "WGS 84",
|
|
78
|
+
semi_major_axis: 6378137,
|
|
79
|
+
inverse_flattening: 298.257223563
|
|
80
|
+
},
|
|
81
|
+
accuracy: "2.0",
|
|
82
|
+
id: { authority: "EPSG", code: 6326 }
|
|
83
|
+
},
|
|
84
|
+
coordinate_system: {
|
|
85
|
+
subtype: "ellipsoidal",
|
|
86
|
+
axis: [
|
|
87
|
+
{
|
|
88
|
+
name: "Geodetic longitude",
|
|
89
|
+
abbreviation: "Lon",
|
|
90
|
+
direction: "east",
|
|
91
|
+
unit: "degree"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "Geodetic latitude",
|
|
95
|
+
abbreviation: "Lat",
|
|
96
|
+
direction: "north",
|
|
97
|
+
unit: "degree"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
scope: "Not known.",
|
|
102
|
+
area: "World.",
|
|
103
|
+
bbox: {
|
|
104
|
+
south_latitude: -90,
|
|
105
|
+
west_longitude: -180,
|
|
106
|
+
north_latitude: 90,
|
|
107
|
+
east_longitude: 180
|
|
108
|
+
},
|
|
109
|
+
// @ts-expect-error - proj4 types are incomplete
|
|
110
|
+
id: { authority: "OGC", code: "CRS84" }
|
|
111
|
+
};
|
|
112
|
+
async function extractGeotiffReprojectors(tiff, outputCrs = OGC_84) {
|
|
113
|
+
const image = await tiff.getImage();
|
|
114
|
+
const geoKeys = image.getGeoKeys();
|
|
115
|
+
const projectionCode = geoKeys.ProjectedCSTypeGeoKey || geoKeys.GeographicTypeGeoKey || null;
|
|
116
|
+
const baseGeotransform = extractGeotransform(image);
|
|
117
|
+
const sourceProjection = await getProjjson(projectionCode);
|
|
118
|
+
if (sourceProjection === null) {
|
|
119
|
+
throw new Error(
|
|
120
|
+
"Could not determine source projection from GeoTIFF geo keys"
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
const converter = proj4__default.default(sourceProjection, outputCrs);
|
|
124
|
+
const { pixelToInputCRS, inputCRSToPixel } = fromGeoTransform(baseGeotransform);
|
|
125
|
+
return {
|
|
126
|
+
pixelToInputCRS,
|
|
127
|
+
inputCRSToPixel,
|
|
128
|
+
forwardReproject: (x, y) => converter.forward([x, y], false),
|
|
129
|
+
inverseReproject: (x, y) => converter.inverse([x, y], false)
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function fromGeoTransform(geotransform) {
|
|
133
|
+
const inverseGeotransform = invertGeoTransform(geotransform);
|
|
134
|
+
return {
|
|
135
|
+
pixelToInputCRS: (x, y) => applyAffine(x, y, geotransform),
|
|
136
|
+
inputCRSToPixel: (x, y) => applyAffine(x, y, inverseGeotransform)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
async function getProjjson(projectionCode) {
|
|
140
|
+
if (projectionCode === null) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
const url = `https://epsg.io/${projectionCode}.json`;
|
|
144
|
+
const response = await fetch(url);
|
|
145
|
+
if (!response.ok) {
|
|
146
|
+
throw new Error(`Failed to fetch projection data from ${url}`);
|
|
147
|
+
}
|
|
148
|
+
const data = await response.json();
|
|
149
|
+
return data;
|
|
150
|
+
}
|
|
151
|
+
function extractGeotransform(image) {
|
|
152
|
+
const origin = image.getOrigin();
|
|
153
|
+
const resolution = image.getResolution();
|
|
154
|
+
const fileDirectory = image.getFileDirectory();
|
|
155
|
+
const modelTransformation = fileDirectory.ModelTransformation;
|
|
156
|
+
let b = 0;
|
|
157
|
+
let d = 0;
|
|
158
|
+
if (modelTransformation && modelTransformation.length >= 16) {
|
|
159
|
+
b = modelTransformation[1];
|
|
160
|
+
d = modelTransformation[4];
|
|
161
|
+
}
|
|
162
|
+
return [
|
|
163
|
+
resolution[0],
|
|
164
|
+
// a: pixel width
|
|
165
|
+
b,
|
|
166
|
+
// b: row rotation
|
|
167
|
+
origin[0],
|
|
168
|
+
// c: x origin
|
|
169
|
+
d,
|
|
170
|
+
// d: column rotation
|
|
171
|
+
resolution[1],
|
|
172
|
+
// e: pixel height (often negative)
|
|
173
|
+
origin[1]
|
|
174
|
+
// f: y origin
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
exports.extractGeotiffReprojectors = extractGeotiffReprojectors;
|
|
179
|
+
exports.fromGeoTransform = fromGeoTransform;
|
|
180
|
+
//# sourceMappingURL=index.cjs.map
|
|
181
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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MAAM,IAAA,GAAO,MAAM,QAAA,CAAS,IAAA,EAAK;AACjC,EAAA,OAAO,IAAA;AACT;AAYA,SAAS,oBACP,KAAA,EACkD;AAClD,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,EAAU;AAC/B,EAAA,MAAM,UAAA,GAAa,MAAM,aAAA,EAAc;AAMvC,EAAA,MAAM,aAAA,GAAgB,MAAM,gBAAA,EAAiB;AAC7C,EAAA,MAAM,sBAAsB,aAAA,CAAc,mBAAA;AAE1C,EAAA,IAAI,CAAA,GAAI,CAAA;AACR,EAAA,IAAI,CAAA,GAAI,CAAA;AAER,EAAA,IAAI,mBAAA,IAAuB,mBAAA,CAAoB,MAAA,IAAU,EAAA,EAAI;AAM3D,IAAA,CAAA,GAAI,oBAAoB,CAAC,CAAA;AACzB,IAAA,CAAA,GAAI,oBAAoB,CAAC,CAAA;AAAA,EAC3B;AAGA,EAAA,OAAO;AAAA,IACL,WAAW,CAAC,CAAA;AAAA;AAAA,IACZ,CAAA;AAAA;AAAA,IACA,OAAO,CAAC,CAAA;AAAA;AAAA,IACR,CAAA;AAAA;AAAA,IACA,WAAW,CAAC,CAAA;AAAA;AAAA,IACZ,OAAO,CAAC;AAAA;AAAA,GACV;AACF","file":"index.cjs","sourcesContent":["export type GeoTransform = [number, number, number, number, number, number];\n\n/**\n * Find the inverse of this GeoTransform.\n *\n * Ported from rasterio/affine:\n * https://github.com/rasterio/affine/blob/a7a916fc7012f8afeb6489246ada61a76ccb8bc7/src/affine.py#L671-L692\n * under the BSD-3-Clause License.\n *\n * @param {GeoTransform} gt Geotransform.\n *\n * @return {GeoTransform} Inverse of the geotransform.\n */\nexport function invertGeoTransform(gt: GeoTransform): GeoTransform {\n if (isDegenerate(gt)) {\n throw new Error(\"Cannot invert degenerate transform\");\n }\n\n const idet = 1.0 / determinant(gt);\n const [sa, sb, sc, sd, se, sf] = gt;\n const ra = se * idet;\n const rb = -sb * idet;\n const rd = -sd * idet;\n const re = sa * idet;\n // prettier-ignore\n return [\n ra, rb, -sc * ra - sf * rb,\n rd, re, -sc * rd - sf * re,\n ];\n}\n\nfunction isDegenerate(gt: GeoTransform): boolean {\n return determinant(gt) === 0;\n}\n\nfunction determinant(gt: GeoTransform): number {\n const [a, b, _c, d, e, _f] = gt;\n return a * e - b * d;\n}\n\n/**\n * Apply a GeoTransform to a coordinate.\n */\nexport function applyAffine(\n x: number,\n y: number,\n gt: [number, number, number, number, number, number],\n): [number, number] {\n const [a, b, c, d, e, f] = gt;\n return [a * x + b * y + c, d * x + e * y + f];\n}\n","/* eslint-env browser */\n\nimport type { GeoTIFF, GeoTIFFImage } from \"geotiff\";\nimport { ReprojectionFns } from \"../../raster-reproject/src/reprojection/delatin\";\nimport {\n applyAffine,\n invertGeoTransform,\n} from \"../../raster-reproject/src/reprojection/affine\";\nimport proj4 from \"proj4\";\nimport type { PROJJSONDefinition } from \"proj4/dist/lib/core\";\nimport type Projection from \"proj4/dist/lib/Proj\";\n\nconst OGC_84: PROJJSONDefinition = {\n $schema: \"https://proj.org/schemas/v0.7/projjson.schema.json\",\n type: \"GeographicCRS\",\n name: \"WGS 84 (CRS84)\",\n datum_ensemble: {\n name: \"World Geodetic System 1984 ensemble\",\n members: [\n {\n name: \"World Geodetic System 1984 (Transit)\",\n id: { authority: \"EPSG\", code: 1166 },\n },\n {\n name: \"World Geodetic System 1984 (G730)\",\n id: { authority: \"EPSG\", code: 1152 },\n },\n {\n name: \"World Geodetic System 1984 (G873)\",\n id: { authority: \"EPSG\", code: 1153 },\n },\n {\n name: \"World Geodetic System 1984 (G1150)\",\n id: { authority: \"EPSG\", code: 1154 },\n },\n {\n name: \"World Geodetic System 1984 (G1674)\",\n id: { authority: \"EPSG\", code: 1155 },\n },\n {\n name: \"World Geodetic System 1984 (G1762)\",\n id: { authority: \"EPSG\", code: 1156 },\n },\n {\n name: \"World Geodetic System 1984 (G2139)\",\n id: { authority: \"EPSG\", code: 1309 },\n },\n ],\n ellipsoid: {\n name: \"WGS 84\",\n semi_major_axis: 6378137,\n inverse_flattening: 298.257223563,\n },\n accuracy: \"2.0\",\n id: { authority: \"EPSG\", code: 6326 },\n },\n coordinate_system: {\n subtype: \"ellipsoidal\",\n axis: [\n {\n name: \"Geodetic longitude\",\n abbreviation: \"Lon\",\n direction: \"east\",\n unit: \"degree\",\n },\n {\n name: \"Geodetic latitude\",\n abbreviation: \"Lat\",\n direction: \"north\",\n unit: \"degree\",\n },\n ],\n },\n scope: \"Not known.\",\n area: \"World.\",\n bbox: {\n south_latitude: -90,\n west_longitude: -180,\n north_latitude: 90,\n east_longitude: 180,\n },\n // @ts-expect-error - proj4 types are incomplete\n id: { authority: \"OGC\", code: \"CRS84\" },\n};\n\n// Derived from existing work here:\n// https://github.com/developmentseed/lonboard/blob/35a1f3d691604ad9e083bf10a4bfde4158171486/src/cog-tileset/claude-tileset-2d-improved.ts#L141\n//\n// TODO: return a RasterReprojector instance, given the IFD and tile of interest?\nexport async function extractGeotiffReprojectors(\n tiff: GeoTIFF,\n outputCrs: string | PROJJSONDefinition | Projection = OGC_84,\n): Promise<ReprojectionFns> {\n const image = await tiff.getImage();\n\n const geoKeys = image.getGeoKeys();\n const projectionCode: number | null =\n geoKeys.ProjectedCSTypeGeoKey || geoKeys.GeographicTypeGeoKey || null;\n\n // Extract geotransform from full-resolution image\n // Only the top-level IFD has geo keys, so we'll derive overviews from this\n const baseGeotransform = extractGeotransform(image);\n\n const sourceProjection = await getProjjson(projectionCode);\n if (sourceProjection === null) {\n throw new Error(\n \"Could not determine source projection from GeoTIFF geo keys\",\n );\n }\n const converter = proj4(sourceProjection, outputCrs);\n const { pixelToInputCRS, inputCRSToPixel } =\n fromGeoTransform(baseGeotransform);\n\n return {\n pixelToInputCRS,\n inputCRSToPixel,\n forwardReproject: (x: number, y: number) =>\n converter.forward([x, y], false),\n inverseReproject: (x: number, y: number) =>\n converter.inverse([x, y], false),\n };\n}\n\nexport function fromGeoTransform(\n geotransform: [number, number, number, number, number, number],\n): {\n pixelToInputCRS: (x: number, y: number) => [number, number];\n inputCRSToPixel: (x: number, y: number) => [number, number];\n} {\n const inverseGeotransform = invertGeoTransform(geotransform);\n return {\n pixelToInputCRS: (x: number, y: number) => applyAffine(x, y, geotransform),\n inputCRSToPixel: (x: number, y: number) =>\n applyAffine(x, y, inverseGeotransform),\n };\n}\n\n/** Query epsg.io for the PROJJSON corresponding to the given EPSG code. */\nasync function getProjjson(projectionCode: number | null) {\n if (projectionCode === null) {\n return null;\n }\n\n const url = `https://epsg.io/${projectionCode}.json`;\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch projection data from ${url}`);\n }\n const data = await response.json();\n return data;\n}\n\n/**\n * Extract affine geotransform from a GeoTIFF image.\n *\n * Returns a 6-element array in Python `affine` package ordering:\n * [a, b, c, d, e, f] where:\n * - x_geo = a * col + b * row + c\n * - y_geo = d * col + e * row + f\n *\n * This is NOT GDAL ordering, which is [c, a, b, f, d, e].\n */\nfunction extractGeotransform(\n image: GeoTIFFImage,\n): [number, number, number, number, number, number] {\n const origin = image.getOrigin();\n const resolution = image.getResolution();\n\n // origin: [x, y, z]\n // resolution: [x_res, y_res, z_res]\n\n // Check for rotation/skew in the file directory\n const fileDirectory = image.getFileDirectory();\n const modelTransformation = fileDirectory.ModelTransformation;\n\n let b = 0; // row rotation\n let d = 0; // column rotation\n\n if (modelTransformation && modelTransformation.length >= 16) {\n // ModelTransformation is a 4x4 matrix in row-major order\n // [0 1 2 3 ] [a b 0 c]\n // [4 5 6 7 ] = [d e 0 f]\n // [8 9 10 11] [0 0 1 0]\n // [12 13 14 15] [0 0 0 1]\n b = modelTransformation[1];\n d = modelTransformation[4];\n }\n\n // Return in affine package ordering: [a, b, c, d, e, f]\n return [\n resolution[0]!, // a: pixel width\n b, // b: row rotation\n origin[0]!, // c: x origin\n d, // d: column rotation\n resolution[1]!, // e: pixel height (often negative)\n origin[1]!, // f: y origin\n ];\n}\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { COGLayer } from "./cog-layer.js";
|
|
2
|
+
export type { COGLayerProps } from "./cog-layer.js";
|
|
3
|
+
export { parseCOGTileMatrixSet } from "./cog-tile-matrix-set.js";
|
|
4
|
+
export { GeoTIFFLayer } from "./geotiff-layer.js";
|
|
5
|
+
export type { GeoTIFFLayerProps } from "./geotiff-layer.js";
|
|
6
|
+
export { extractGeotiffReprojectors, fromGeoTransform, getGeoTIFFProjection, } from "./geotiff-reprojection.js";
|
|
7
|
+
export { loadRgbImage } from "./geotiff.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { COGLayer } from "./cog-layer.js";
|
|
2
|
+
export { parseCOGTileMatrixSet } from "./cog-tile-matrix-set.js";
|
|
3
|
+
export { GeoTIFFLayer } from "./geotiff-layer.js";
|
|
4
|
+
export { extractGeotiffReprojectors, fromGeoTransform, getGeoTIFFProjection, } from "./geotiff-reprojection.js";
|
|
5
|
+
export { loadRgbImage } from "./geotiff.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/pool.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":""}
|
package/dist/pool.js
ADDED
package/dist/pool.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.js","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GeoTIFF } from "geotiff";
|
|
2
|
+
import type { ReprojectionFns } from "@developmentseed/raster-reproject";
|
|
3
|
+
import type { PROJJSONDefinition } from "proj4/dist/lib/core";
|
|
4
|
+
import type Projection from "proj4/dist/lib/Proj";
|
|
5
|
+
export declare function extractGeotiffReprojectors(tiff: GeoTIFF, outputCrs?: string | PROJJSONDefinition | Projection): Promise<ReprojectionFns>;
|
|
6
|
+
export declare function fromGeoTransform(geotransform: [number, number, number, number, number, number]): {
|
|
7
|
+
pixelToInputCRS: (x: number, y: number) => [number, number];
|
|
8
|
+
inputCRSToPixel: (x: number, y: number) => [number, number];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=geotiff-reprojection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geotiff-reprojection.d.ts","sourceRoot":"","sources":["../../src/geotiff-reprojection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAMzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AA+ElD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,OAAO,EACb,SAAS,GAAE,MAAM,GAAG,kBAAkB,GAAG,UAAmB,GAC3D,OAAO,CAAC,eAAe,CAAC,CA6B1B;AAED,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAC7D;IACD,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5D,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7D,CAOA"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/* eslint-env browser */
|
|
2
|
+
import { applyAffine, invertGeoTransform, } from "@developmentseed/raster-reproject";
|
|
3
|
+
import proj4 from "proj4";
|
|
4
|
+
const OGC_84 = {
|
|
5
|
+
$schema: "https://proj.org/schemas/v0.7/projjson.schema.json",
|
|
6
|
+
type: "GeographicCRS",
|
|
7
|
+
name: "WGS 84 (CRS84)",
|
|
8
|
+
datum_ensemble: {
|
|
9
|
+
name: "World Geodetic System 1984 ensemble",
|
|
10
|
+
members: [
|
|
11
|
+
{
|
|
12
|
+
name: "World Geodetic System 1984 (Transit)",
|
|
13
|
+
id: { authority: "EPSG", code: 1166 },
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "World Geodetic System 1984 (G730)",
|
|
17
|
+
id: { authority: "EPSG", code: 1152 },
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "World Geodetic System 1984 (G873)",
|
|
21
|
+
id: { authority: "EPSG", code: 1153 },
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "World Geodetic System 1984 (G1150)",
|
|
25
|
+
id: { authority: "EPSG", code: 1154 },
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "World Geodetic System 1984 (G1674)",
|
|
29
|
+
id: { authority: "EPSG", code: 1155 },
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "World Geodetic System 1984 (G1762)",
|
|
33
|
+
id: { authority: "EPSG", code: 1156 },
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "World Geodetic System 1984 (G2139)",
|
|
37
|
+
id: { authority: "EPSG", code: 1309 },
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
ellipsoid: {
|
|
41
|
+
name: "WGS 84",
|
|
42
|
+
semi_major_axis: 6378137,
|
|
43
|
+
inverse_flattening: 298.257223563,
|
|
44
|
+
},
|
|
45
|
+
accuracy: "2.0",
|
|
46
|
+
id: { authority: "EPSG", code: 6326 },
|
|
47
|
+
},
|
|
48
|
+
coordinate_system: {
|
|
49
|
+
subtype: "ellipsoidal",
|
|
50
|
+
axis: [
|
|
51
|
+
{
|
|
52
|
+
name: "Geodetic longitude",
|
|
53
|
+
abbreviation: "Lon",
|
|
54
|
+
direction: "east",
|
|
55
|
+
unit: "degree",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "Geodetic latitude",
|
|
59
|
+
abbreviation: "Lat",
|
|
60
|
+
direction: "north",
|
|
61
|
+
unit: "degree",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
scope: "Not known.",
|
|
66
|
+
area: "World.",
|
|
67
|
+
bbox: {
|
|
68
|
+
south_latitude: -90,
|
|
69
|
+
west_longitude: -180,
|
|
70
|
+
north_latitude: 90,
|
|
71
|
+
east_longitude: 180,
|
|
72
|
+
},
|
|
73
|
+
// @ts-expect-error - proj4 types are incomplete
|
|
74
|
+
id: { authority: "OGC", code: "CRS84" },
|
|
75
|
+
};
|
|
76
|
+
// Derived from existing work here:
|
|
77
|
+
// https://github.com/developmentseed/lonboard/blob/35a1f3d691604ad9e083bf10a4bfde4158171486/src/cog-tileset/claude-tileset-2d-improved.ts#L141
|
|
78
|
+
//
|
|
79
|
+
// TODO: return a RasterReprojector instance, given the IFD and tile of interest?
|
|
80
|
+
export async function extractGeotiffReprojectors(tiff, outputCrs = OGC_84) {
|
|
81
|
+
const image = await tiff.getImage();
|
|
82
|
+
const geoKeys = image.getGeoKeys();
|
|
83
|
+
const projectionCode = geoKeys.ProjectedCSTypeGeoKey || geoKeys.GeographicTypeGeoKey || null;
|
|
84
|
+
// Extract geotransform from full-resolution image
|
|
85
|
+
// Only the top-level IFD has geo keys, so we'll derive overviews from this
|
|
86
|
+
const baseGeotransform = extractGeotransform(image);
|
|
87
|
+
const sourceProjection = await getProjjson(projectionCode);
|
|
88
|
+
if (sourceProjection === null) {
|
|
89
|
+
throw new Error("Could not determine source projection from GeoTIFF geo keys");
|
|
90
|
+
}
|
|
91
|
+
const converter = proj4(sourceProjection, outputCrs);
|
|
92
|
+
const { pixelToInputCRS, inputCRSToPixel } = fromGeoTransform(baseGeotransform);
|
|
93
|
+
return {
|
|
94
|
+
pixelToInputCRS,
|
|
95
|
+
inputCRSToPixel,
|
|
96
|
+
forwardReproject: (x, y) => converter.forward([x, y], false),
|
|
97
|
+
inverseReproject: (x, y) => converter.inverse([x, y], false),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export function fromGeoTransform(geotransform) {
|
|
101
|
+
const inverseGeotransform = invertGeoTransform(geotransform);
|
|
102
|
+
return {
|
|
103
|
+
pixelToInputCRS: (x, y) => applyAffine(x, y, geotransform),
|
|
104
|
+
inputCRSToPixel: (x, y) => applyAffine(x, y, inverseGeotransform),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** Query epsg.io for the PROJJSON corresponding to the given EPSG code. */
|
|
108
|
+
async function getProjjson(projectionCode) {
|
|
109
|
+
if (projectionCode === null) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const url = `https://epsg.io/${projectionCode}.json`;
|
|
113
|
+
const response = await fetch(url);
|
|
114
|
+
if (!response.ok) {
|
|
115
|
+
throw new Error(`Failed to fetch projection data from ${url}`);
|
|
116
|
+
}
|
|
117
|
+
const data = await response.json();
|
|
118
|
+
return data;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Extract affine geotransform from a GeoTIFF image.
|
|
122
|
+
*
|
|
123
|
+
* Returns a 6-element array in Python `affine` package ordering:
|
|
124
|
+
* [a, b, c, d, e, f] where:
|
|
125
|
+
* - x_geo = a * col + b * row + c
|
|
126
|
+
* - y_geo = d * col + e * row + f
|
|
127
|
+
*
|
|
128
|
+
* This is NOT GDAL ordering, which is [c, a, b, f, d, e].
|
|
129
|
+
*/
|
|
130
|
+
function extractGeotransform(image) {
|
|
131
|
+
const origin = image.getOrigin();
|
|
132
|
+
const resolution = image.getResolution();
|
|
133
|
+
// origin: [x, y, z]
|
|
134
|
+
// resolution: [x_res, y_res, z_res]
|
|
135
|
+
// Check for rotation/skew in the file directory
|
|
136
|
+
const fileDirectory = image.getFileDirectory();
|
|
137
|
+
const modelTransformation = fileDirectory.ModelTransformation;
|
|
138
|
+
let b = 0; // row rotation
|
|
139
|
+
let d = 0; // column rotation
|
|
140
|
+
if (modelTransformation && modelTransformation.length >= 16) {
|
|
141
|
+
// ModelTransformation is a 4x4 matrix in row-major order
|
|
142
|
+
// [0 1 2 3 ] [a b 0 c]
|
|
143
|
+
// [4 5 6 7 ] = [d e 0 f]
|
|
144
|
+
// [8 9 10 11] [0 0 1 0]
|
|
145
|
+
// [12 13 14 15] [0 0 0 1]
|
|
146
|
+
b = modelTransformation[1];
|
|
147
|
+
d = modelTransformation[4];
|
|
148
|
+
}
|
|
149
|
+
// Return in affine package ordering: [a, b, c, d, e, f]
|
|
150
|
+
return [
|
|
151
|
+
resolution[0], // a: pixel width
|
|
152
|
+
b, // b: row rotation
|
|
153
|
+
origin[0], // c: x origin
|
|
154
|
+
d, // d: column rotation
|
|
155
|
+
resolution[1], // e: pixel height (often negative)
|
|
156
|
+
origin[1],
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=geotiff-reprojection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geotiff-reprojection.js","sourceRoot":"","sources":["../../src/geotiff-reprojection.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAIxB,OAAO,EACL,WAAW,EACX,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,GAAuB;IACjC,OAAO,EAAE,oDAAoD;IAC7D,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,gBAAgB;IACtB,cAAc,EAAE;QACd,IAAI,EAAE,qCAAqC;QAC3C,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,sCAAsC;gBAC5C,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;aACtC;YACD;gBACE,IAAI,EAAE,mCAAmC;gBACzC,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;aACtC;YACD;gBACE,IAAI,EAAE,mCAAmC;gBACzC,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;aACtC;YACD;gBACE,IAAI,EAAE,oCAAoC;gBAC1C,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;aACtC;YACD;gBACE,IAAI,EAAE,oCAAoC;gBAC1C,EAAE,EAAE,E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AAiB;QACjC,CAAC,EAAE,kBAAkB;QACrB,MAAM,CAAC,CAAC,CAAE,EAAE,cAAc;QAC1B,CAAC,EAAE,qBAAqB;QACxB,UAAU,CAAC,CAAC,CAAE,EAAE,mCAAmC;QACnD,MAAM,CAAC,CAAC,CAAE;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.test.d.ts","sourceRoot":"","sources":["../../tests/placeholder.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.test.js","sourceRoot":"","sources":["../../tests/placeholder.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|