Java Code Examples for mil.nga.geopackage.features.user.FeatureDao#getTableName()

The following examples show how to use mil.nga.geopackage.features.user.FeatureDao#getTableName() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: geopackage-android   File: FeaturePreview.java    License: MIT License 5 votes vote down vote up
/**
 * Draw a preview image
 *
 * @return preview image
 */
public Bitmap draw() {

    Bitmap image = null;

    FeatureDao featureDao = featureTiles.getFeatureDao();
    String table = featureDao.getTableName();

    Projection webMercator = ProjectionFactory
            .getProjection(ProjectionConstants.EPSG_WEB_MERCATOR);

    BoundingBox boundingBox = geoPackage.getFeatureBoundingBox(webMercator,
            table, false);
    if (boundingBox == null) {
        boundingBox = geoPackage.getContentsBoundingBox(webMercator, table);
    }
    if (boundingBox == null && manual) {
        boundingBox = geoPackage.getFeatureBoundingBox(webMercator, table,
                manual);
    }
    if (boundingBox != null) {
        boundingBox = TileBoundingBoxUtils
                .boundWebMercatorBoundingBox(boundingBox);
        BoundingBox expandedBoundingBox = boundingBox
                .squareExpand(bufferPercentage);
        expandedBoundingBox = TileBoundingBoxUtils
                .boundWebMercatorBoundingBox(expandedBoundingBox);
        int zoom = TileBoundingBoxUtils.getZoomLevel(expandedBoundingBox);

        FeatureCursor results = featureDao.query(
                columns.toArray(new String[]{}), where, whereArgs, null,
                null, null, limit != null ? limit.toString() : null);
        image = featureTiles.drawTile(zoom, expandedBoundingBox, results);
    }

    return image;
}
 
Example 2
Source Project: geopackage-java   File: FeaturePreview.java    License: MIT License 5 votes vote down vote up
/**
 * Draw a preview image
 * 
 * @return preview image
 */
public BufferedImage draw() {

	BufferedImage image = null;

	FeatureDao featureDao = featureTiles.getFeatureDao();
	String table = featureDao.getTableName();

	Projection webMercator = ProjectionFactory
			.getProjection(ProjectionConstants.EPSG_WEB_MERCATOR);

	BoundingBox boundingBox = geoPackage.getFeatureBoundingBox(webMercator,
			table, false);
	if (boundingBox == null) {
		boundingBox = geoPackage.getContentsBoundingBox(webMercator, table);
	}
	if (boundingBox == null && manual) {
		boundingBox = geoPackage.getFeatureBoundingBox(webMercator, table,
				manual);
	}
	if (boundingBox != null) {
		boundingBox = TileBoundingBoxUtils
				.boundWebMercatorBoundingBox(boundingBox);
		BoundingBox expandedBoundingBox = boundingBox
				.squareExpand(bufferPercentage);
		expandedBoundingBox = TileBoundingBoxUtils
				.boundWebMercatorBoundingBox(expandedBoundingBox);
		int zoom = TileBoundingBoxUtils.getZoomLevel(expandedBoundingBox);

		FeatureResultSet results = featureDao.query(
				columns.toArray(new String[] {}), where, whereArgs, null,
				null, null, limit != null ? limit.toString() : null);
		image = featureTiles.drawTile(zoom, expandedBoundingBox, results);
	}

	return image;
}
 
Example 3
/**
 * Constructor
 *
 * @param context    context
 * @param featureDao feature dao
 */
public FeatureInfoBuilder(Context context, FeatureDao featureDao) {

    this.featureDao = featureDao;

    geometryType = featureDao.getGeometryType();
    name = featureDao.getDatabase() + " - " + featureDao.getTableName();

    Resources resources = context.getResources();

    maxPointDetailedInfo = resources.getInteger(R.integer.map_feature_max_point_detailed_info);
    maxFeatureDetailedInfo = resources.getInteger(R.integer.map_feature_max_feature_detailed_info);

    detailedInfoPrintPoints = resources.getBoolean(R.bool.map_feature_detailed_info_print_points);
    detailedInfoPrintFeatures = resources.getBoolean(R.bool.map_feature_detailed_info_print_features);
}
 
Example 4
Source Project: geopackage-android   File: FeatureTableIndex.java    License: MIT License 2 votes vote down vote up
/**
 * Constructor
 *
 * @param geoPackage GeoPackage
 * @param featureDao feature dao
 */
public FeatureTableIndex(GeoPackage geoPackage, FeatureDao featureDao) {
    super(geoPackage, featureDao.getTableName(), featureDao
            .getGeometryColumnName());
    this.featureDao = featureDao;
}
 
Example 5
Source Project: geopackage-java   File: FeatureTableIndex.java    License: MIT License 2 votes vote down vote up
/**
 * Constructor
 * 
 * @param geoPackage
 *            GeoPackage
 * @param featureDao
 *            feature dao
 */
public FeatureTableIndex(GeoPackage geoPackage, FeatureDao featureDao) {
	super(geoPackage, featureDao.getTableName(),
			featureDao.getGeometryColumnName());
	this.featureDao = featureDao;
}