All Projects → ngageoint → geopackage-android-map

ngageoint / geopackage-android-map

Licence: MIT license
GeoPackage Android Map Library

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to geopackage-android-map

geopackage-mapcache-android
GeoPackage MapCache Android App
Stars: ✭ 33 (+26.92%)
Mutual labels:  geopackage-libraries, nga, geopackage, geopackage-mapcache, geopackage-android, geopackage-functionality, geopackage-tiles
geopackage-mapcache-ios
GeoPackage MapCache iOS App
Stars: ✭ 20 (-23.08%)
Mutual labels:  geopackage-libraries, nga, geopackage, geopackage-mapcache, geopackage-functionality, geopackage-tiles
geopackage-ios
GeoPackage iOS Library
Stars: ✭ 45 (+73.08%)
Mutual labels:  geopackage-libraries, nga, geopackage, geopackage-mapcache, geopackage-functionality
tiff-ios
Tagged Image File Format iOS Library
Stars: ✭ 26 (+0%)
Mutual labels:  geopackage-libraries, nga, geopackage
tiff-java
Tagged Image File Format Java Library
Stars: ✭ 65 (+150%)
Mutual labels:  geopackage-libraries, nga, geopackage
pygeopackage
A Python package to read/write spatial data to a geopackage.
Stars: ✭ 33 (+26.92%)
Mutual labels:  geopackage-libraries, geopackage
Optivideoeditor For Android
Native Video editor : Video trim, Audio, Video merge, Slow and fast motion, Text and image, etc...
Stars: ✭ 209 (+703.85%)
Mutual labels:  android-sdk
Swarmer
Reactive tool to create and start multiple Android Emulators in parallel.
Stars: ✭ 203 (+680.77%)
Mutual labels:  android-sdk
Qiscus Sdk Android
Qiscus provide everything you need to power up your app with chats. And it's now made simple.
Stars: ✭ 175 (+573.08%)
Mutual labels:  android-sdk
Awesomedialog
A Beautiful Dialog Library for Kotlin Android
Stars: ✭ 163 (+526.92%)
Mutual labels:  android-sdk
Android-Clean-Architecture
This is a sample movie list Android application built to demonstrate use of Clean Architecture tools. Dedicated to all Android Developers - (Kotlin, MVVM, Clean Architecture, Rx-Java, Dagger, OkHttp, Unit Testing, SOLID principles, Code Coverage)
Stars: ✭ 268 (+930.77%)
Mutual labels:  android-sdk
ValidUtil
No description or website provided.
Stars: ✭ 23 (-11.54%)
Mutual labels:  android-sdk
Myokhttp
对Okhttp3进行二次封装,对外提供了POST请求、GET请求、PATCH请求、PUT请求、DELETE请求、上传文件、下载文件、取消请求、Raw/Json/Gson返回、后台下载管理等功能
Stars: ✭ 236 (+807.69%)
Mutual labels:  android-sdk
Venom
A lightweight tool that simplifies testing of the process death scenario.
Stars: ✭ 218 (+738.46%)
Mutual labels:  android-sdk
Biometric Auth Sample
Add Biometric Authentication to any Android app
Stars: ✭ 232 (+792.31%)
Mutual labels:  android-sdk
Docker Android Sdk
Stars: ✭ 171 (+557.69%)
Mutual labels:  android-sdk
chef-android-sdk
Development repository for Android SDK Chef Cookbook
Stars: ✭ 26 (+0%)
Mutual labels:  android-sdk
Why bump android minsdk
Why you should bump your Android app minsdk?
Stars: ✭ 226 (+769.23%)
Mutual labels:  android-sdk
Material Backdrop
A simple solution for implementing Backdrop pattern for Android
Stars: ✭ 221 (+750%)
Mutual labels:  android-sdk
epsAndroidPlayer
易居PGC直播Saas平台Android播放器SDK,Android平台原生播放器,性能高,画质好,直播延迟最低可达1秒。支持HLS,RTMP等流媒体协议,支持H264,AAC音视频编码技术。可灵活设置画幅,显示方向。
Stars: ✭ 13 (-50%)
Mutual labels:  android-sdk

GeoPackage Android Map

GeoPackage Android Map Lib

The GeoPackage Libraries were developed at the National Geospatial-Intelligence Agency (NGA) in collaboration with BIT Systems. 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.

Pull Requests

If 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.

Software 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.

About

GeoPackage Android Map is a GeoPackage Library SDK implementation of the Open Geospatial Consortium GeoPackage spec. It is listed as an OGC GeoPackage Implementation by the National Geospatial-Intelligence Agency.

The GeoPackage Android Map SDK provides Google Map library implementations in addition to the inherited base GeoPackage Android functionality. The library provides TileProvider overlay implementations and Google Map shape translations.

Usage

View the latest Javadoc

Implementations

GeoPackage MapCache

The GeoPackage MapCache app provides an extensive standalone example on how to use the SDK.

MAGE

The Mobile Awareness GEOINT Environment (MAGE) app provides mobile situational awareness capabilities. It uses the SDK to provide GeoPackage functionality.

Example

// Context context = ...;
// File geoPackageFile = ...;
// GoogleMap map = ...;

// Get a manager
GeoPackageManager manager = GeoPackageFactory.getManager(context);

// Import database
boolean imported = manager.importGeoPackage(geoPackageFile);

// Available databases
List<String> databases = manager.databases();

// Open database
GeoPackage geoPackage = manager.open(databases.get(0));

// GeoPackage Table DAOs
SpatialReferenceSystemDao srsDao = geoPackage.getSpatialReferenceSystemDao();
ContentsDao contentsDao = geoPackage.getContentsDao();
GeometryColumnsDao geomColumnsDao = geoPackage.getGeometryColumnsDao();
TileMatrixSetDao tileMatrixSetDao = geoPackage.getTileMatrixSetDao();
TileMatrixDao tileMatrixDao = geoPackage.getTileMatrixDao();
SchemaExtension schemaExtension = new SchemaExtension(geoPackage);
DataColumnsDao dao = schemaExtension.getDataColumnsDao();
DataColumnConstraintsDao dataColumnConstraintsDao = schemaExtension
        .getDataColumnConstraintsDao();
MetadataExtension metadataExtension = new MetadataExtension(geoPackage);
MetadataDao metadataDao = metadataExtension.getMetadataDao();
MetadataReferenceDao metadataReferenceDao = metadataExtension
        .getMetadataReferenceDao();
ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();

// Feature and tile tables
List<String> features = geoPackage.getFeatureTables();
List<String> tiles = geoPackage.getTileTables();

// Query Features
String featureTable = features.get(0);
FeatureDao featureDao = geoPackage.getFeatureDao(featureTable);
GoogleMapShapeConverter converter = new GoogleMapShapeConverter(
        featureDao.getProjection());
FeatureCursor featureCursor = featureDao.queryForAll();
try {
    for (FeatureRow featureRow : featureCursor) {
        GeoPackageGeometryData geometryData = featureRow.getGeometry();
        if (geometryData != null && !geometryData.isEmpty()) {
            Geometry geometry = geometryData.getGeometry();
            GoogleMapShape shape = converter.toShape(geometry);
            GoogleMapShape mapShape = GoogleMapShapeConverter
                    .addShapeToMap(map, shape);
            // ...
        }
    }
} finally {
    featureCursor.close();
}

// Query Tiles
String tileTable = tiles.get(0);
TileDao tileDao = geoPackage.getTileDao(tileTable);
TileCursor tileCursor = tileDao.queryForAll();
try {
    for (TileRow tileRow : tileCursor) {
        byte[] tileBytes = tileRow.getTileData();
        Bitmap tileBitmap = tileRow.getTileDataBitmap();
        // ...
    }
} finally {
    tileCursor.close();
}

// Retrieve Tiles by XYZ
GeoPackageTileRetriever retriever = new GeoPackageTileRetriever(tileDao);
GeoPackageTile geoPackageTile = retriever.getTile(2, 2, 2);
if (geoPackageTile != null) {
    byte[] tileBytes = geoPackageTile.getData();
    Bitmap tileBitmap = geoPackageTile.getBitmap();
    // ...
}

// Retrieve Tiles by Bounding Box
TileCreator tileCreator = new TileCreator(
        tileDao, ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM));
GeoPackageTile geoPackageTile2 = tileCreator.getTile(
        new BoundingBox(-90.0, 0.0, 0.0, 66.513260));
if (geoPackageTile2 != null) {
    byte[] tileBytes = geoPackageTile2.getData();
    Bitmap tileBitmap = geoPackageTile2.getBitmap();
    // ...
}

// Tile Provider (GeoPackage or Google API)
TileProvider overlay = GeoPackageOverlayFactory
        .getTileProvider(tileDao);
TileOverlayOptions overlayOptions = new TileOverlayOptions();
overlayOptions.tileProvider(overlay);
overlayOptions.zIndex(-1);
map.addTileOverlay(overlayOptions);

BoundingBox boundingBox = BoundingBox.worldWebMercator();
Projection projection = ProjectionFactory
        .getProjection(ProjectionConstants.EPSG_WEB_MERCATOR);

// Index Features
FeatureIndexManager indexer = new FeatureIndexManager(context, geoPackage, featureDao);
indexer.setIndexLocation(FeatureIndexType.GEOPACKAGE);
int indexedCount = indexer.index();

// Query Indexed Features in paginated chunks
FeatureIndexResults indexResults = indexer.queryForChunk(boundingBox,
        projection, 50);
FeaturePaginatedCursor paginatedCursor = indexer
        .paginate(indexResults);
for (FeatureRow featureRow : paginatedCursor) {
    GeoPackageGeometryData geometryData = featureRow.getGeometry();
    if (geometryData != null && !geometryData.isEmpty()) {
        Geometry geometry = geometryData.getGeometry();
        // ...
    }
}

// Feature Tile Provider (dynamically draw tiles from features)
FeatureTiles featureTiles = new DefaultFeatureTiles(context, featureDao, context.getResources().getDisplayMetrics().density);
featureTiles.setMaxFeaturesPerTile(1000); // Set max features to draw per tile
NumberFeaturesTile numberFeaturesTile = new NumberFeaturesTile(context); // Custom feature tile implementation
featureTiles.setMaxFeaturesTileDraw(numberFeaturesTile); // Draw feature count tiles when max features passed
featureTiles.setIndexManager(indexer); // Set index manager to query feature indices
FeatureOverlay featureOverlay = new FeatureOverlay(featureTiles);
featureOverlay.setMinZoom(featureDao.getZoomLevel()); // Set zoom level to start showing tiles
TileOverlayOptions featureOverlayOptions = new TileOverlayOptions();
featureOverlayOptions.tileProvider(featureOverlay);
featureOverlayOptions.zIndex(-1); // Draw the feature tiles behind map markers
map.addTileOverlay(featureOverlayOptions);

// URL Tile Generator (generate tiles from a URL)
TileGenerator urlTileGenerator = new UrlTileGenerator(context, geoPackage,
        "url_tile_table", "http://url/{z}/{x}/{y}.png", 0, 0, boundingBox, projection);
int urlTileCount = urlTileGenerator.generateTiles();

// Feature Tile Generator (generate tiles from features)
TileGenerator featureTileGenerator = new FeatureTileGenerator(context, geoPackage,
        "tiles_" + featureTable, featureTiles, 1, 2, boundingBox, projection);
int featureTileCount = featureTileGenerator.generateTiles();

// Close feature tiles (and indexer)
featureTiles.close();

// Close database when done
geoPackage.close();

Installation

Pull from the Maven Central Repository (AAR, POM, Source, Javadoc)

api 'mil.nga.geopackage.map:geopackage-android-map:6.7.0'

Build

Build Artifacts Test

Build this repository using Android Studio and/or Gradle.

Project Setup

Include as repositories in your project build.gradle:

repositories {
    google()
    mavenCentral()
    mavenLocal()
}
Normal Build

Include the dependency in your module build.gradle with desired version number:

api 'mil.nga.geopackage.map:geopackage-android-map:6.7.0'

As part of the build process, run the "publishToMavenLocal" task on the geopackage-map Gradle script to update the Maven local repository.

Local Build

Replace the normal build dependency in your module build.gradle with:

api project(':geopackage-map')

Include in your settings.gradle:

include ':geopackage-map'

From your project directory, link the cloned SDK directory:

ln -s ../geopackage-android-map/geopackage-map geopackage-map

Remote Dependencies

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].