{"_id":"@cooljapan/oxigeo","_rev":"4-58bd75b9057c469a69f8b78479b40910","name":"@cooljapan/oxigeo","dist-tags":{"latest":"0.2.4"},"versions":{"0.2.0":{"name":"@cooljapan/oxigeo","version":"0.2.0","keywords":["wasm","science","cog","browser","webassembly"],"license":"Apache-2.0","_id":"@cooljapan/oxigeo@0.2.0","maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"homepage":"https://github.com/cool-japan/oxigeo","bugs":{"url":"https://github.com/cool-japan/oxigeo/issues"},"dist":{"shasum":"ff2cff4d1ee13d3ff1c156d41d958be70da36427","tarball":"https://registry.npmjs.org/@cooljapan/oxigeo/-/oxigeo-0.2.0.tgz","fileCount":6,"integrity":"sha512-SUmWqG2qu9V/v7HQrb9g3PC0/8qF6j0FVei80VECeS4OPwP9927LY34bfXzinaTNmrPzn2BKO2eJ0rO21hGy3w==","signatures":[{"sig":"MEYCIQD3Lyde/KthIB077NirhFQdBY/Buk4XQMt3Tyd/GG2JEwIhAKZGb+yTXucYdn1XS0vwKyOSeTLQWfAFdfw4HP36eZ11","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1039817},"main":"oxigeo_wasm.js","type":"module","types":"oxigeo_wasm.d.ts","_npmUser":{"name":"kitasan","email":"info@kitasan.io"},"repository":{"url":"git+https://github.com/cool-japan/oxigeo.git","type":"git"},"_npmVersion":"10.9.8","description":"WebAssembly bindings for OxiGeo - Browser-based geospatial processing","directories":{},"sideEffects":["./oxigeo_wasm.js","./snippets/*"],"_nodeVersion":"22.23.1","collaborators":["COOLJAPAN OU (Team Kitasan)"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/oxigeo_0.2.0_1784548905580_0.3159770754356803","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@cooljapan/oxigeo","version":"0.2.2","keywords":["wasm","science","cog","browser","webassembly"],"license":"Apache-2.0","_id":"@cooljapan/oxigeo@0.2.2","maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"homepage":"https://github.com/cool-japan/oxigeo","bugs":{"url":"https://github.com/cool-japan/oxigeo/issues"},"dist":{"shasum":"58f701df684ef07cf3807271cba801ee4bef877c","tarball":"https://registry.npmjs.org/@cooljapan/oxigeo/-/oxigeo-0.2.2.tgz","fileCount":6,"integrity":"sha512-9uHCOAQphj58zlQrb/E300WQtc8SOKZEriffVn8LzsH6PpeSOmFAKm41e3fUIFkcp/hi22L3ijKr0zp2m1Nhpw==","signatures":[{"sig":"MEYCIQDvBgp+GUkxIPtfYX6ZpAaAGdVgFX4V/dZ789pcPAlt4QIhAMhbA41+CBPjhaPepTw3w4yH8F7Geg3zjhEyUIxWFTXV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1094366},"main":"oxigeo_wasm.js","type":"module","types":"oxigeo_wasm.d.ts","_npmUser":{"name":"kitasan","email":"info@kitasan.io"},"repository":{"url":"git+https://github.com/cool-japan/oxigeo.git","type":"git"},"_npmVersion":"10.9.8","description":"WebAssembly bindings for OxiGeo - Browser-based geospatial processing","directories":{},"sideEffects":["./oxigeo_wasm.js","./snippets/*"],"_nodeVersion":"22.23.1","collaborators":["COOLJAPAN OU (Team Kitasan)"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/oxigeo_0.2.2_1785388209174_0.12508957294917566","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@cooljapan/oxigeo","version":"0.2.3","keywords":["wasm","science","cog","browser","webassembly"],"license":"Apache-2.0","_id":"@cooljapan/oxigeo@0.2.3","maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"homepage":"https://github.com/cool-japan/oxigeo","bugs":{"url":"https://github.com/cool-japan/oxigeo/issues"},"dist":{"shasum":"d6dc81769c022c87c700bdb61b47c02af12c6c53","tarball":"https://registry.npmjs.org/@cooljapan/oxigeo/-/oxigeo-0.2.3.tgz","fileCount":6,"integrity":"sha512-H/4PatCVW8mnRjN92vrUbMEEhBaXBe8u3dJ33CVMRaqOkbRXpFPFD6fAKo3pgvqxyz988d8DArroHJtYlunNSA==","signatures":[{"sig":"MEQCIFhABW2fGIRxH5vBr5OezYObr929Gp+jRxWk7gG+BCarAiAoOl/STyK6Cj/fzCiWHnC2KQ7d4b4VO1299UkOXVh5ww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1094367},"main":"oxigeo_wasm.js","type":"module","types":"oxigeo_wasm.d.ts","_npmUser":{"name":"kitasan","email":"info@kitasan.io"},"repository":{"url":"git+https://github.com/cool-japan/oxigeo.git","type":"git"},"_npmVersion":"10.9.8","description":"WebAssembly bindings for OxiGeo - Browser-based geospatial processing","directories":{},"sideEffects":["./oxigeo_wasm.js","./snippets/*"],"_nodeVersion":"22.23.1","collaborators":["COOLJAPAN OU (Team Kitasan)"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/oxigeo_0.2.3_1785925332738_0.6281218143502001","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@cooljapan/oxigeo","type":"module","collaborators":["COOLJAPAN OU (Team Kitasan)"],"description":"WebAssembly bindings for OxiGeo - Browser-based geospatial processing","version":"0.2.4","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/cool-japan/oxigeo.git"},"main":"oxigeo_wasm.js","homepage":"https://github.com/cool-japan/oxigeo","types":"oxigeo_wasm.d.ts","sideEffects":["./oxigeo_wasm.js","./snippets/*"],"keywords":["wasm","science","cog","browser","webassembly"],"_id":"@cooljapan/oxigeo@0.2.4","bugs":{"url":"https://github.com/cool-japan/oxigeo/issues"},"_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-ya91sjfZuFLRQ2+WXLccJF9R0WRsReehqspW9L/ix6TEMUZ77MMyBK+GqYpayepfiAs1DvSFfJNXdk0im4+LCQ==","shasum":"6c80a2bf439261634d015461f477ef1037d60fa0","tarball":"https://registry.npmjs.org/@cooljapan/oxigeo/-/oxigeo-0.2.4.tgz","fileCount":6,"unpackedSize":1151754,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFOyGpIWZkyW4BHt94eZOci4ypvKeDbGKRgWEpaF1zfsAiBg+p6Uw5R6/0VyfYRBDUoXfcrBB+PCxBRtOEybs/qrew=="}]},"_npmUser":{"name":"kitasan","email":"info@kitasan.io"},"directories":{},"maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oxigeo_0.2.4_1787052916369_0.24559096010705161"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-20T12:01:45.456Z","modified":"2026-08-18T11:35:16.764Z","0.2.0":"2026-07-20T12:01:45.854Z","0.2.2":"2026-07-30T05:10:09.377Z","0.2.3":"2026-08-05T10:22:12.893Z","0.2.4":"2026-08-18T11:35:16.574Z"},"bugs":{"url":"https://github.com/cool-japan/oxigeo/issues"},"license":"Apache-2.0","homepage":"https://github.com/cool-japan/oxigeo","keywords":["wasm","science","cog","browser","webassembly"],"repository":{"type":"git","url":"git+https://github.com/cool-japan/oxigeo.git"},"description":"WebAssembly bindings for OxiGeo - Browser-based geospatial processing","maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"readme":"# oxigeo-wasm\n\nWebAssembly bindings for OxiGeo - geospatial processing in the browser.\n\n[![Documentation](https://docs.rs/oxigeo-wasm/badge.svg)](https://docs.rs/oxigeo-wasm)\n[![License](https://img.shields.io/crates/l/oxigeo-wasm)](LICENSE)\n\n## Overview\n\n`oxigeo-wasm` enables client-side geospatial processing in the browser:\n\n- **COG Viewer** - Display Cloud Optimized GeoTIFFs without a backend\n- **Tile Caching** - LRU cache for optimal performance\n- **Web Workers** - Parallel tile loading\n- **Image Processing** - Contrast enhancement, color manipulation\n- **Zero Server** - All processing happens client-side\n\n## Features\n\n- ✅ Browser-based COG viewing\n- ✅ HTTP range request support\n- ✅ Tile pyramid navigation\n- ✅ Viewport management (pan/zoom)\n- ✅ Image enhancement\n- ✅ Statistics computation\n- ✅ GeoJSON export\n\n## Building\n\n```bash\n# Install wasm-pack\ncurl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh\n\n# Build\nwasm-pack build --target web\n```\n\n## Installation (when published)\n\n```bash\nnpm install @cooljapan/oxigeo\n```\n\n## Quick Start\n\n### Basic COG Viewing\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n    <title>COG Viewer</title>\n</head>\n<body>\n    <canvas id=\"map\" width=\"800\" height=\"600\"></canvas>\n\n    <script type=\"module\">\n        import init, { WasmCogViewer } from './pkg/oxigeo_wasm.js';\n\n        await init();\n\n        const viewer = new WasmCogViewer();\n        await viewer.open('https://example.com/satellite.tif');\n\n        console.log(`Size: ${viewer.width()}x${viewer.height()}`);\n        console.log(`Bands: ${viewer.band_count()}`);\n        console.log(`EPSG: ${viewer.epsg_code()}`);\n\n        // Read and display a tile\n        const imageData = await viewer.read_tile_as_image_data(0, 0, 0);\n\n        const canvas = document.getElementById('map');\n        const ctx = canvas.getContext('2d');\n        ctx.putImageData(imageData, 0, 0);\n    </script>\n</body>\n</html>\n```\n\n### Advanced Viewer with Caching\n\n```javascript\nimport { AdvancedCogViewer } from './pkg/oxigeo_wasm.js';\n\nconst viewer = new AdvancedCogViewer();\n\n// Open with 50MB cache\nawait viewer.open(url, 50);\n\n// Set viewport\nviewer.setViewportSize(800, 600);\nviewer.fitToImage();\n\n// Pan and zoom\nviewer.pan(100, 100);\nviewer.zoomIn();\n\n// Read with caching\nconst imageData = await viewer.readTileAsImageData(0, 0, 0);\n\n// Check cache stats\nconst stats = JSON.parse(viewer.getCacheStats());\nconsole.log('Cache hit rate:', stats.hitRate);\n```\n\n### Interactive Map\n\n```javascript\nclass InteractiveMap {\n    constructor(canvasId) {\n        this.canvas = document.getElementById(canvasId);\n        this.ctx = this.canvas.getContext('2d');\n        this.viewer = new AdvancedCogViewer();\n        this.setupInteraction();\n    }\n\n    async open(url) {\n        await this.viewer.open(url, 100);\n        this.viewer.setViewportSize(\n            this.canvas.width,\n            this.canvas.height\n        );\n        this.viewer.fitToImage();\n        await this.render();\n    }\n\n    setupInteraction() {\n        let dragging = false;\n        let lastX, lastY;\n\n        this.canvas.addEventListener('mousedown', (e) => {\n            dragging = true;\n            lastX = e.clientX;\n            lastY = e.clientY;\n        });\n\n        this.canvas.addEventListener('mousemove', async (e) => {\n            if (dragging) {\n                const dx = e.clientX - lastX;\n                const dy = e.clientY - lastY;\n                this.viewer.pan(-dx, -dy);\n                await this.render();\n                lastX = e.clientX;\n                lastY = e.clientY;\n            }\n        });\n\n        this.canvas.addEventListener('mouseup', () => {\n            dragging = false;\n        });\n\n        this.canvas.addEventListener('wheel', async (e) => {\n            e.preventDefault();\n            if (e.deltaY < 0) {\n                this.viewer.zoomIn();\n            } else {\n                this.viewer.zoomOut();\n            }\n            await this.render();\n        });\n    }\n\n    async render() {\n        // Render visible tiles\n        const imageData = await this.viewer.readTileAsImageData(0, 0, 0);\n        this.ctx.putImageData(imageData, 0, 0);\n    }\n}\n\n// Usage\nconst map = new InteractiveMap('map');\nawait map.open('https://example.com/satellite.tif');\n```\n\n### Image Enhancement\n\n```javascript\n// Read tile with contrast enhancement\nconst imageData = await viewer.readTileWithContrast(\n    0, 0, 0,\n    'linear'  // 'linear', 'histogram', or 'adaptive'\n);\n\n// Compute statistics\nconst stats = JSON.parse(await viewer.computeStats(0, 0, 0));\nconsole.log('Min:', stats.min, 'Max:', stats.max);\n\n// Compute histogram\nconst hist = JSON.parse(await viewer.computeHistogram(0, 0, 0));\n```\n\n### Batch Tile Loading\n\n```javascript\nimport { BatchTileLoader } from './pkg/oxigeo_wasm.js';\n\nconst loader = new BatchTileLoader(4); // 4 parallel requests\nawait loader.open(url, 50);\n\nconst coords = [\n    0, 0,  // Tile (0, 0)\n    1, 0,  // Tile (1, 0)\n    0, 1,  // Tile (0, 1)\n    1, 1,  // Tile (1, 1)\n];\n\nconst results = await loader.loadTilesBatch(0, coords);\nresults.forEach((imageData, i) => {\n    // Render each tile\n});\n```\n\n### Web Workers\n\n```javascript\nimport { WasmWorkerPool } from './pkg/oxigeo_wasm.js';\n\nconst pool = new WasmWorkerPool(4);\nawait pool.init();\n\nawait pool.loadCog(url);\n\nconst tasks = [\n    { level: 0, x: 0, y: 0 },\n    { level: 0, x: 1, y: 0 },\n];\n\nconst results = await Promise.all(\n    tasks.map(task => pool.processTile(task))\n);\n\npool.terminate();\n```\n\n## API Reference\n\n### WasmCogViewer\n\nBasic COG viewer:\n\n- `open(url)` - Open a COG file\n- `width()` - Get image width\n- `height()` - Get image height\n- `tile_width()` - Get tile width\n- `tile_height()` - Get tile height\n- `band_count()` - Get number of bands\n- `overview_count()` - Get number of overviews\n- `epsg_code()` - Get EPSG code\n- `read_tile(level, x, y)` - Read tile bytes\n- `read_tile_as_image_data(level, x, y)` - Read as ImageData\n\n### AdvancedCogViewer\n\nAdvanced viewer with caching and viewport:\n\n- `open(url, cache_size_mb)` - Open with cache\n- `setViewportSize(width, height)` - Set viewport\n- `fitToImage()` - Fit viewport to image\n- `pan(dx, dy)` - Pan viewport\n- `zoomIn()` / `zoomOut()` - Zoom controls\n- `setZoom(level)` - Set zoom level\n- `readTileAsImageData(level, x, y)` - Read with cache\n- `readTileWithContrast(level, x, y, method)` - Read with enhancement\n- `computeStats(level, x, y)` - Compute statistics\n- `getCacheStats()` - Get cache statistics\n- `clearCache()` - Clear cache\n\n## Demo Application\n\nA complete COG viewer demo is available in `demo/cog-viewer/`:\n\n```bash\ncd demo/cog-viewer\nnpm install\nnpm run dev\n```\n\n## Browser Support\n\n| Browser | Minimum Version |\n|---------|----------------|\n| Chrome | 87+ |\n| Firefox | 89+ |\n| Safari | 15+ |\n| Edge | 87+ |\n\nRequires WebAssembly, ES6 modules, and Fetch API.\n\n## Performance Tips\n\n1. **Enable caching** - Use AdvancedCogViewer with appropriate cache size\n2. **Use overviews** - Read from appropriate zoom level\n3. **Batch requests** - Use BatchTileLoader for parallel fetching\n4. **Prefetch** - Set prefetch strategy for smoother navigation\n5. **Web Workers** - Offload processing to background threads\n\n## COOLJAPAN Policies\n\n- ✅ Pure Rust (compiles to WASM)\n- ✅ No unwrap() - Safe error handling\n- ✅ Zero external dependencies\n- ✅ Production ready\n\n## License\n\nLicensed under Apache-2.0.\n\nCopyright © 2026 COOLJAPAN OU (Team Kitasan)\n\n## See Also\n\n- [WASM Guide](/tmp/oxigeo_wasm_guide.md)\n- [API Documentation](https://docs.rs/oxigeo-wasm)\n- [Demo Application](../../demo/cog-viewer/)\n- [wasm-pack Documentation](https://rustwasm.github.io/wasm-pack/)\n","readmeFilename":"README.md"}