{"id":21819946,"url":"https://github.com/ngageoint/geopackage-mobile-optimizer","last_synced_at":"2026-05-03T05:32:52.895Z","repository":{"id":57130599,"uuid":"483753017","full_name":"ngageoint/geopackage-mobile-optimizer","owner":"ngageoint","description":"GeoPackage Mobile Optimizer","archived":false,"fork":false,"pushed_at":"2022-10-31T14:35:46.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-08-21T20:31:42.862Z","etag":null,"topics":["geopackage","mobile","web"],"latest_commit_sha":null,"homepage":"http://ngageoint.github.io/geopackage-mobile-optimizer/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngageoint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-20T17:35:57.000Z","updated_at":"2022-10-31T14:36:26.000Z","dependencies_parsed_at":"2023-01-21T00:47:58.927Z","dependency_job_id":null,"html_url":"https://github.com/ngageoint/geopackage-mobile-optimizer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ngageoint/geopackage-mobile-optimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fgeopackage-mobile-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fgeopackage-mobile-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fgeopackage-mobile-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fgeopackage-mobile-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngageoint","download_url":"https://codeload.github.com/ngageoint/geopackage-mobile-optimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fgeopackage-mobile-optimizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32559715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T03:21:47.309Z","status":"ssl_error","status_checked_at":"2026-05-03T03:21:43.884Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geopackage","mobile","web"],"created_at":"2024-11-27T16:27:22.666Z","updated_at":"2026-05-03T05:32:52.876Z","avatar_url":"https://github.com/ngageoint.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @ngageoint/geopackage-mobile-optimizer \u0026mdash; Optimize GeoPackages for mobile consumption\n\nThis utility will convert a GeoPackage into a GeoPackage which allows for friendly consumption on a web mercator mobile or web map.  The utility will convert to EPSG:3857 and place tiles aligned with regular XYZ coordinates.  This allows the clients to read the tiles from the tile tables without reprojecting or cropping.\n\n### Installation ###\n\n[![NPM](https://img.shields.io/npm/v/@ngageoint/geopackage-mobile-optimizer.svg)](https://www.npmjs.com/package/@ngageoint/geopackage-mobile-optimizer)\n\n```sh\n$ npm install @ngageoint/geopackage-mobile-optimizer\n```\n\n### Usage\n\n#### Command Line\n\n```sh\n./mobile-optimizer /path/to/file/to/convert.gpkg /path/to/file/to/create.gpkg\n```\n\n#### Javascript\n```javascript\nconst fs = require('fs');\nconst { GeoPackageAPI, setCanvasKitWasmLocateFile } = require('@ngageoint/geopackage');\nconst GeoPackageOptimizer = require('@ngageoint/geopackage-mobile-optimizer');\nconst path = require('path');\nconst async = require('async');\n\nconst geoPackageFile = '/path/to/file/to/convert.gpkg';\nconst outputGeoPackageFile = '/path/to/file/to/create.gpkg';\nconst same = outputGeoPackageFile === geoPackageFile;\n\nsetCanvasKitWasmLocateFile(file =\u003e path.join(__dirname, 'node_modules', '@ngageoint', 'geopackage', 'dist', 'canvaskit', file));\n\nasync.series({\n    fileExists: function(callback) {\n      fs.stat(geoPackageFile, function(err, stats) {\n        if (err || !stats || !stats.isFile()) {\n          return callback('File does not exist.');\n        } else {\n          return callback(null, true);\n        }\n      });\n    },\n    geoPackage: function(callback) {\n      GeoPackageAPI.open(geoPackageFile).then((result) =\u003e {\n        console.log('Processing %s', geoPackageFile);\n        return callback(null, result);\n      }).catch(() =\u003e {\n        return callback('Invalid GeoPackage file.');\n      });\n    },\n    outputGeoPackage: function (callback) {\n      GeoPackageAPI.create(outputGeoPackageFile).then((result) =\u003e {\n        return callback(null, result);\n      }).catch(() =\u003e {\n        return callback('Invalid GeoPackage file.');\n      });\n    }\n  },\n  function(err, results) {\n    if (err) {\n      console.log('Failed to convert with error', err);\n      process.exit(1);\n    } else {\n      GeoPackageOptimizer.optimize({inputGeoPackage: results.geoPackage, outputGeoPackage: results.outputGeoPackage, same: same}, (err) =\u003e {\n        if (err) {\n          console.error('Optimization Failed: ' + err);\n        } else {\n          console.log('Optimization Complete, optimized file: %s', outputGeoPackageFile);\n        }\n        process.exit(0);\n      });\n    }\n  });\n```\n\n#### GeoPackage JS Library ####\n\nThe [GeoPackage Libraries](http://ngageoint.github.io/GeoPackage/) were developed at the [National Geospatial-Intelligence Agency (NGA)](http://www.nga.mil/) in collaboration with [BIT Systems](http://www.bit-sys.com/). The government has \"unlimited rights\" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the [MIT license](http://choosealicense.com/licenses/mit/).\n\n### Pull Requests ###\nIf you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license.\n\nSoftware source code previously released under an open source license and then modified by NGA staff is considered a \"joint work\" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license.\n\n\n### Changelog\n\n\n##### 4.1.0\n\n- Update to GeoPackage JS 4.1.0.\n\n##### 1.0.0\n\n- Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Fgeopackage-mobile-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngageoint%2Fgeopackage-mobile-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Fgeopackage-mobile-optimizer/lists"}