@cpp.js/package-geotiff-multithread 2.0.0-beta.1

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,81 @@
1
+
2
+ libgeotiff Licensing
3
+ ====================
4
+
5
+ All the source code in this toolkit are either in the public domain, or under
6
+ the MIT License. In any event it is all considered to be free to use
7
+ for any purpose (including commercial software). No credit is required
8
+ though some of the code requires that the specific source code modules
9
+ retain their existing copyright statements. In
10
+ particular, no part of this code is "copyleft", nor does it imply any
11
+ requirement for users to disclose this or their own source code.
12
+
13
+ All components not carrying their own copyright message, but distributed
14
+ with libgeotiff should be considered to be under the same license as
15
+ Niles' code.
16
+
17
+ ---------
18
+
19
+ Code by Frank Warmerdam has this copyright notice (directly copied from
20
+ X Consortium licence):
21
+
22
+ * Copyright (c) 1999, Frank Warmerdam
23
+ *
24
+ * Permission is hereby granted, free of charge, to any person obtaining a
25
+ * copy of this software and associated documentation files (the "Software"),
26
+ * to deal in the Software without restriction, including without limitation
27
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28
+ * and/or sell copies of the Software, and to permit persons to whom the
29
+ * Software is furnished to do so, subject to the following conditions:
30
+ *
31
+ * The above copyright notice and this permission notice shall be included
32
+ * in all copies or substantial portions of the Software.
33
+ *
34
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
35
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
37
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
40
+ * DEALINGS IN THE SOFTWARE.
41
+
42
+ -----------
43
+
44
+ Code by Niles Ritter is under this licence:
45
+
46
+ * Written By: Niles D. Ritter.
47
+ *
48
+ * copyright (c) 1995 Niles D. Ritter
49
+ *
50
+ * Permission granted to use this software, so long as this copyright
51
+ * notice accompanies any products derived therefrom.
52
+
53
+ ----------
54
+
55
+ The cmake/*.cmake macros are under the following BSD license. This does
56
+ not affect produced binaries or the library.
57
+
58
+ --
59
+
60
+ Redistribution and use in source and binary forms, with or without
61
+ modification, are permitted provided that the following conditions
62
+ are met:
63
+
64
+ 1. Redistributions of source code must retain the copyright
65
+ notice, this list of conditions and the following disclaimer.
66
+ 2. Redistributions in binary form must reproduce the copyright
67
+ notice, this list of conditions and the following disclaimer in the
68
+ documentation and/or other materials provided with the distribution.
69
+ 3. The name of the author may not be used to endorse or promote products
70
+ derived from this software without specific prior written permission.
71
+
72
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
73
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
74
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
75
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
76
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
77
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
78
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
79
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
80
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
81
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @cpp.js/package-geotiff
2
+ **Precompiled geotiff library built with cpp.js for seamless integration in JavaScript, WebAssembly and React Native projects.**
3
+
4
+ <a href="https://www.npmjs.com/package/@cpp.js/package-geotiff">
5
+ <img alt="NPM version" src="https://img.shields.io/npm/v/@cpp.js/package-geotiff?style=for-the-badge" />
6
+ </a>
7
+ <a href="https://github.com/OSGeo/libgeotiff">
8
+ <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Funpkg.com%2F%40cpp.js%2Fpackage-geotiff%2Fpackage.json&query=%24.nativeVersion&style=for-the-badge&label=GeoTIFF" />
9
+ </a>
10
+ <a href="https://github.com/OSGeo/libgeotiff/blob/master/libgeotiff/LICENSE">
11
+ <img alt="License" src="https://img.shields.io/npm/l/%40cpp.js%2Fpackage-geotiff?style=for-the-badge" />
12
+ </a>
13
+
14
+ ## Integration
15
+ Start by installing these package with the following command:
16
+
17
+ ```sh
18
+ npm install @cpp.js/package-geotiff
19
+ ```
20
+
21
+ To enable the library, modify the cppjs.config.js file as shown below.
22
+ ```diff
23
+ +import geotiff from '@cpp.js/package-geotiff/cppjs.config.js';
24
+
25
+ export default {
26
+ dependencies: [
27
+ + geotiff
28
+ ]
29
+ paths: {
30
+ config: import.meta.url,
31
+ }
32
+ };
33
+ ```
34
+
35
+ ## Usage
36
+ Below are the steps to use the geotiff in your C++ or JavaScript code.
37
+
38
+ ### Usage in C++ Code
39
+ ```diff
40
+ +#include <geotiff.h>
41
+
42
+ std::string Native::sample() {
43
+ + return to_string(LIBGEOTIFF_VERSION);
44
+ }
45
+ ```
46
+
47
+ ## License
48
+ This project includes the precompiled libgeotiff library, which is distributed under the [MIT License](https://github.com/OSGeo/libgeotiff/blob/master/libgeotiff/LICENSE).
49
+
50
+ GeoTiff Homepage: [https://github.com/OSGeo/libgeotiff](https://github.com/OSGeo/libgeotiff)
package/cppjs.build.js ADDED
@@ -0,0 +1,32 @@
1
+ const platformBuild = {
2
+ 'Emscripten-x86_64': ['--enable-shared=no', '--host=x86_64-pc-linux-gnu'],
3
+ 'Android-arm64-v8a': ['--enable-static=no', '--host=aarch64-linux-android'],
4
+ 'Android-x86_64': ['--enable-static=no', '--host=x86_64-linux-android'],
5
+ 'iOS-iphoneos': ['--enable-shared=no', '--host=arm-apple-darwin'],
6
+ 'iOS-iphonesimulator': ['--enable-shared=no', '--host=x86_64-apple-darwin'],
7
+ };
8
+
9
+ const platformExtraLibs = {
10
+ 'Emscripten-x86_64': ['-lsqlite3'],
11
+ 'Android-arm64-v8a': ['-lstdc++'],
12
+ 'Android-x86_64': ['-lstdc++'],
13
+ 'iOS-iphoneos': ['-lstdc++'],
14
+ 'iOS-iphonesimulator': ['-lstdc++'],
15
+ };
16
+
17
+ export default {
18
+ getURL: (version) => `https://download.osgeo.org/geotiff/libgeotiff/libgeotiff-${version}.tar.gz`,
19
+ buildType: 'configure',
20
+ getBuildParams: (platform, depPaths) => [
21
+ ...(platformBuild[platform] || []),
22
+ `--with-proj=${depPaths.proj.root}`, `--with-libtiff=${depPaths.tiff.root}`, `--with-zlib=${depPaths.z.root}`,
23
+ ],
24
+ getExtraLibs: (platform) => platformExtraLibs[platform] || [],
25
+ replaceList: [
26
+ {
27
+ regex: 'double GTIFAtof\\(const char',
28
+ replacement: 'double GTIFAtof2(const char',
29
+ paths: ['geo_strtod.c'],
30
+ },
31
+ ],
32
+ };
@@ -0,0 +1,14 @@
1
+ import geotiffWasmMultithread from '@cpp.js/package-geotiff-wasm-multithread/cppjs.config.js';
2
+ import geotiffAndroidMultithread from '@cpp.js/package-geotiff-android-multithread/cppjs.config.js';
3
+ import geotiffIosMultithread from '@cpp.js/package-geotiff-ios-multithread/cppjs.config.js';
4
+
5
+ export default {
6
+ dependencies: [
7
+ geotiffWasmMultithread,
8
+ geotiffAndroidMultithread,
9
+ geotiffIosMultithread,
10
+ ],
11
+ paths: {
12
+ config: import.meta.url
13
+ }
14
+ };
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@cpp.js/package-geotiff-multithread",
3
+ "version": "2.0.0-beta.1",
4
+ "nativeVersion": "1.7.4",
5
+ "description": "This package provides the precompiled geotiff library, built using cpp.js, for easy integration into JavaScript, WebAssembly and React Native projects. Designed for working with GeoTIFF files, offering robust support for geospatial metadata handling, ensuring high performance and cross-platform compatibility. Ideal for use in web and mobile applications.",
6
+ "homepage": "https://github.com/bugra9/cpp.js/tree/main/packages/cppjs-package-geotiff#readme",
7
+ "repository": "https://github.com/bugra9/cpp.js.git",
8
+ "type": "module",
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "geotiff",
12
+ "libgeotiff",
13
+ "cpp.js-package",
14
+ "webassembly",
15
+ "react-native"
16
+ ],
17
+ "devDependencies": {
18
+ "@cpp.js/package-geotiff-wasm-multithread": "^2.0.0-beta.1",
19
+ "cpp.js": "^2.0.0-beta.1",
20
+ "@cpp.js/package-geotiff-android-multithread": "^2.0.0-beta.1",
21
+ "@cpp.js/package-geotiff-ios-multithread": "^2.0.0-beta.1"
22
+ }
23
+ }