Java Code Examples for mil.nga.geopackage.extension.style.FeatureTableStyles#has()
The following examples show how to use
mil.nga.geopackage.extension.style.FeatureTableStyles#has() .
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 File: FeatureTiles.java From geopackage-android with MIT License | 4 votes |
/** * Constructor, auto creates the index manager for indexed tables and feature styles for styled tables * * @param context context * @param geoPackage GeoPackage * @param featureDao feature dao * @param density display density: {@link android.util.DisplayMetrics#density} * @param width drawn tile width * @param height drawn tile height * @since 3.2.0 */ public FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density, int width, int height) { this.context = context; this.featureDao = featureDao; if (featureDao != null) { this.projection = featureDao.getProjection(); } this.density = TileUtils.tileDensity(density, width, height); tileWidth = width; tileHeight = height; createEmptyImage(); compressFormat = CompressFormat.valueOf(context.getString(R.string.feature_tiles_compress_format)); pointPaint.setAntiAlias(true); pointRadius = Float.valueOf(context.getString(R.string.feature_tiles_point_radius)); linePaint.setAntiAlias(true); lineStrokeWidth = Float.valueOf(context.getString(R.string.feature_tiles_line_stroke_width)); linePaint.setStrokeWidth(this.density * lineStrokeWidth); linePaint.setStyle(Style.STROKE); polygonPaint.setAntiAlias(true); polygonStrokeWidth = Float.valueOf(context.getString(R.string.feature_tiles_polygon_stroke_width)); polygonPaint.setStrokeWidth(this.density * polygonStrokeWidth); polygonPaint.setStyle(Style.STROKE); Resources resources = context.getResources(); fillPolygon = resources.getBoolean(R.bool.feature_tiles_polygon_fill); polygonFillPaint.setAntiAlias(true); polygonFillPaint.setStyle(Style.FILL); polygonFillPaint.setAlpha(resources.getInteger(R.integer.feature_tiles_polygon_fill_alpha)); if (geoPackage != null) { indexManager = new FeatureIndexManager(context, geoPackage, featureDao); if (!indexManager.isIndexed()) { indexManager.close(); indexManager = null; } featureTableStyles = new FeatureTableStyles(geoPackage, featureDao.getTable()); if (!featureTableStyles.has()) { featureTableStyles = null; } } calculateDrawOverlap(); }
Example 2
Source File: FeatureTiles.java From geopackage-java with MIT License | 4 votes |
/** * Constructor, auto creates the index manager for indexed tables and * feature styles for styled tables * * @param geoPackage * GeoPackage * @param featureDao * feature dao * @param scale * scale factor * @param width * drawn tile width * @param height * drawn tile height * @since 3.2.0 */ public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale, int width, int height) { this.featureDao = featureDao; if (featureDao != null) { this.projection = featureDao.getProjection(); } this.scale = scale; tileWidth = width; tileHeight = height; compressFormat = GeoPackageJavaProperties.getProperty( JavaPropertyConstants.FEATURE_TILES, JavaPropertyConstants.FEATURE_TILES_COMPRESS_FORMAT); pointRadius = GeoPackageJavaProperties.getFloatProperty( JavaPropertyConstants.FEATURE_TILES_POINT, JavaPropertyConstants.FEATURE_TILES_RADIUS); pointPaint.setColor(GeoPackageJavaProperties.getColorProperty( JavaPropertyConstants.FEATURE_TILES_POINT, JavaPropertyConstants.FEATURE_TILES_COLOR)); lineStrokeWidth = GeoPackageJavaProperties.getFloatProperty( JavaPropertyConstants.FEATURE_TILES_LINE, JavaPropertyConstants.FEATURE_TILES_STROKE_WIDTH); linePaint.setStrokeWidth(this.scale * lineStrokeWidth); linePaint.setColor(GeoPackageJavaProperties.getColorProperty( JavaPropertyConstants.FEATURE_TILES_LINE, JavaPropertyConstants.FEATURE_TILES_COLOR)); polygonStrokeWidth = GeoPackageJavaProperties.getFloatProperty( JavaPropertyConstants.FEATURE_TILES_POLYGON, JavaPropertyConstants.FEATURE_TILES_STROKE_WIDTH); polygonPaint.setStrokeWidth(this.scale * polygonStrokeWidth); polygonPaint.setColor(GeoPackageJavaProperties.getColorProperty( JavaPropertyConstants.FEATURE_TILES_POLYGON, JavaPropertyConstants.FEATURE_TILES_COLOR)); fillPolygon = GeoPackageJavaProperties.getBooleanProperty( JavaPropertyConstants.FEATURE_TILES_POLYGON_FILL); polygonFillPaint.setColor(GeoPackageJavaProperties.getColorProperty( JavaPropertyConstants.FEATURE_TILES_POLYGON_FILL, JavaPropertyConstants.FEATURE_TILES_COLOR)); if (geoPackage != null) { featureIndex = new FeatureTableIndex(geoPackage, featureDao); if (!featureIndex.isIndexed()) { featureIndex.close(); featureIndex = null; } featureTableStyles = new FeatureTableStyles(geoPackage, featureDao.getTable()); if (!featureTableStyles.has()) { featureTableStyles = null; } } calculateDrawOverlap(); }