A JavaScript library for reading and rendering OGC GeoPackage files in both browser and Node.js environments.
GeoPackage JS is a JavaScript library that implements the Open Geospatial Consortium (OGC) GeoPackage specification. It enables developers to read, query, and visualize geospatial data stored in GeoPackage files, which are portable, self-contained databases for geographic information. The library works in both web browsers and Node.js environments.
Web and server application developers who need to handle geospatial data in the OGC GeoPackage format, particularly those building mapping applications, geospatial data processing tools, or services requiring portable geospatial databases.
Developers choose GeoPackage JS because it provides a complete, standards-compliant JavaScript interface to the GeoPackage format, with cross-platform compatibility and features like tile rendering, feature data access, and Web Worker support for performance. It is an official OGC GeoPackage implementation maintained by the National Geospatial-Intelligence Agency.
GeoPackage JavaScript Library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works seamlessly in web browsers using HTML5 Canvas and sql.js, and in Node.js with PureImage and node-sqlite3, as shown in the detailed usage examples for both environments.
Provides utilities like GeoPackageTileRetriever and FeatureTiles to retrieve and draw map tiles stored in GeoPackage files, enabling direct visualization in canvases without external services.
Supports querying vector features with spatial indexing and exports data to GeoJSON format using methods like queryForGeoJSONFeatures, simplifying integration with other geospatial tools.
Includes comprehensive examples for offloading heavy geoprocessing to Web Workers, as demonstrated in the worker.js setup, preventing main thread blockage in browsers.
The library emphasizes reading GeoPackage files, with the README stating it 'currently provides the ability to read,' limiting use cases to data consumption rather than creation or modification.
Requires managing WASM files (e.g., sql-wasm.wasm) and different backends for browser vs. Node.js, adding configuration overhead as highlighted in the setSqljsWasmLocateFile and setCanvasKitWasmLocateFile calls.
In Node.js, users must explicitly dispose of GeoPackageImage and Canvas objects to prevent memory leaks, as noted in the code comments, increasing development complexity and error risk.