NSG GeoPackage Raster Tile Support #6
Replies: 11 comments
-
I've read through the NSG spec a few times now. The libraries support everything in the NSG spec except for SRS organization codes of NGA. I've left the library specific tickets open for tracking:
Anything using the EPSG organization should work. Nothing in the NSG spec built on top of the OGC GeoPackage spec should break any core functionality. What additional "NSG GeoPackage Raster Tile Support" issue are you referring to? The libraries support and/or do not prohibit the NSG requirements of:
I ran through the NSG GeoPackages here and they almost all function correctly. There was a bug in geopackage-js using proj4js on the Blue Marble GeoPackage causing high level and edge tiles to not display. This has been fixed by @danielbarela. Please feel free to create library specific issues including sample files and issues you are seeing. This will help us identify issues, resolve problems, and improve the libraries. These are license friendly open source libraries often maintained with less than FTE, so issues and pull requests are welcome. For SRS NGA organization codes, we need a custom or license-friendly WKT coordinate parsing solution. Until then there are some possible work arounds including manually setting the proj4 value for an organization code or adding a NGA proj4 property file. This would require obtaining a list of proj4 values for each NGA organization srs_id WKT value in the NSG spec 7.2 Well Known Text section. |
Beta Was this translation helpful? Give feedback.
-
The problem with the NSG GPKG that I have is the Tile Numbers (Zoom Column Rows) don't match Google XYZ or TMS tile numbers. So the data will display but be in the wrong place! I have several NSG GPKG from the NGA/DoD Map of the World and from the US Navy Research Lab https://geoint.nrlssc.navy.mil/gpkg/ |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
In addition, the NSG GPKG I've gotten or downloaded don't have any metadata records denoting they are special or no GeoPackage Extension. It's hard to expect a mapping client just to work without noting the difference between XYZ/TMS and NSG |
Beta Was this translation helpful? Give feedback.
-
The NSG spec does not redefine how tiles are stored in a GeoPackage. It only defines permitted extensions and restrictions on top of the OGC GeoPackage spec. It is basically a spec on top of a spec, but does not change anything in the base spec. See this answer for more details. Any implementation that supports base GeoPackage functionality also supports NSG GeoPackages.
This should be the assumption for all GeoPackages, not just NSG. For full details you can view the tiles section of the spec. In summary, the Tile Matrix Set defines the exact bounds of the tiles while the Tile Matrix defines the structure of the tiles within each zoom level. The tiles in the user table contain zoom, column, and row values defining where they belong in the defined Tile Matrix Set and Tile Matrix. This has nothing to do with XYZ or TMS tiles. Those transformations are handled elsewhere in the libraries. If you are using the libraries to manually read those tile rows with the assumption the coordinates map to an alternate tile system, that would cause expected problems.
There is no additional metadata or extensions required as the dimensions are mathematically defined by the Tile Matrix Set and Tile Matrix. Here are some U.S. Naval Research Laboratory NSG GeoPackage examples loaded into geopackage-js (you can also view them in Android, iOS, or pull the tiles out in Java): If you are able to provide detailed steps, examples, source code, and/or sample files that demonstrate the erroneous results you are seeing, we are happy to help. These libraries do currently support NSG GeoPackages using a Spatial Reference System organization of EPSG. |
Beta Was this translation helpful? Give feedback.
-
Also note that the raw tiles from the tile table may not be projected as Web Mercator. And even when they are, they may not have the same tile boundaries as XYZ or TMS tiles. These libraries handle the image projections and cropping to obtain the requested XYZ or TMS tile. |
Beta Was this translation helpful? Give feedback.
-
Not understanding how to get the data to show up in the right place. The Z-zoom/Column-X/Row-Y.png |
Beta Was this translation helpful? Give feedback.
-
GeoPackageJS has a convenience method module.exports.getTileFromXYZ = function(geopackage, table, x, y, z, width, height, callback) which will get the correct tile(s) from the GeoPackage that correspond to the xyz tile specified and will callback with the image. Please see line 444 in https://github.com/ngageoint/geopackage-js/blob/master/docs/common.js for an example. |
Beta Was this translation helpful? Give feedback.
-
These libraries handle retrieving projected bounded tiles in addition to the raw tiles from the user tile table. It sounds like your issue is not NSG related as any GeoPackage would cause you issues when not saved to mirror XYZ tiles. Here are a few to try from the OGC GeoPackage sample data:
AndroidIf you are using the default Android map, geopackage-mapcache-android is an entire app demonstrating usage. An APK can be downloaded here. It relies on geopackage-android-map. Add a tile layer to the map:
If you want to pull out the tiles manually or use a different map that relies only on geopackage-android (something osmdroid does), see TileCreator or GeoPackageTileRetriever. TileCreator allows you to pull out a tile for a provided bounding box in either the tile projection or a request projection. TileRetriever allows you to pull out a tile for a XYZ coordinate. You can use it with a TMS coordinate by converting the Y value using this method, which is something geopackage-java does. iOSgeopackage-mapcache-ios is an entire app demonstrating usage that can be built and run.
Similar to Android, see GPKGTileCreator for retrieving tiles by bounding box and GPKGGeoPackageTileRetriever for retrieving tiles by XYZ (or TMS). |
Beta Was this translation helpful? Give feedback.
-
NSG is fully supported except for NGA authored CRS WKT coordinate system values. This can be supported currently by providing those values in advance. Will be handled automatically in the future as part of the following: |
Beta Was this translation helpful? Give feedback.
-
Complete and explicit DGIWG (Defence Geospatial Information Working Group) GeoPackage Profile support for the current working version, previously known as the NSG Profile, has been added in the following libraries: |
Beta Was this translation helpful? Give feedback.
-
Can you please add support in all the Libraries for NSG GPKG Support
Beta Was this translation helpful? Give feedback.
All reactions