geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java
public void calculateDrawOverlap() {

        if (pointIcon != null) {
            heightOverlap = this.density * pointIcon.getHeight();
            widthOverlap = this.density * pointIcon.getWidth();
        } else {
            heightOverlap = this.density * pointRadius;
            widthOverlap = this.density * pointRadius;
        }

        float linePaintHalfStroke = this.density * lineStrokeWidth / 2.0f;
        heightOverlap = Math.max(heightOverlap, linePaintHalfStroke);
        widthOverlap = Math.max(widthOverlap, linePaintHalfStroke);

        float polygonPaintHalfStroke = this.density * polygonStrokeWidth / 2.0f;
        heightOverlap = Math.max(heightOverlap, polygonPaintHalfStroke);
        widthOverlap = Math.max(widthOverlap, polygonPaintHalfStroke);

        if (featureTableStyles != null && featureTableStyles.has()) {

            // Style Rows
            Set<Long> styleRowIds = new HashSet<>();
            List<Long> tableStyleIds = featureTableStyles.getAllTableStyleIds();
            if (tableStyleIds != null) {
                styleRowIds.addAll(tableStyleIds);
            }
            List<Long> styleIds = featureTableStyles.getAllStyleIds();
            if (styleIds != null) {
                styleRowIds.addAll(styleIds);
            }

            StyleDao styleDao = featureTableStyles.getStyleDao();
            for (long styleRowId : styleRowIds) {
                StyleRow styleRow = styleDao.getRow(styleDao.queryForIdRow(styleRowId));
                float styleHalfWidth = this.density * (float) (styleRow.getWidthOrDefault() / 2.0f);
                widthOverlap = Math.max(widthOverlap, styleHalfWidth);
                heightOverlap = Math.max(heightOverlap, styleHalfWidth);
            }

            // Icon Rows
            Set<Long> iconRowIds = new HashSet<>();
            List<Long> tableIconIds = featureTableStyles.getAllTableIconIds();
            if (tableIconIds != null) {
                iconRowIds.addAll(tableIconIds);
            }
            List<Long> iconIds = featureTableStyles.getAllIconIds();
            if (iconIds != null) {
                iconRowIds.addAll(iconIds);
            }

            IconDao iconDao = featureTableStyles.getIconDao();
            for (long iconRowId : iconRowIds) {
                IconRow iconRow = iconDao.getRow(iconDao.queryForIdRow(iconRowId));
                double[] iconDimensions = iconRow.getDerivedDimensions();
                float iconWidth = this.density * (float) Math.ceil(iconDimensions[0]);
                float iconHeight = this.density * (float) Math.ceil(iconDimensions[1]);
                widthOverlap = Math.max(widthOverlap, iconWidth);
                heightOverlap = Math.max(heightOverlap, iconHeight);
            }

        }

    }
public void calculateDrawOverlap() {

        if (pointIcon != null) {
            heightOverlap = this.density * pointIcon.getHeight();
            widthOverlap = this.density * pointIcon.getWidth();
        } else {
            heightOverlap = this.density * pointRadius;
            widthOverlap = this.density * pointRadius;
        }

        float linePaintHalfStroke = this.density * lineStrokeWidth / 2.0f;
        heightOverlap = Math.max(heightOverlap, linePaintHalfStroke);
        widthOverlap = Math.max(widthOverlap, linePaintHalfStroke);

        float polygonPaintHalfStroke = this.density * polygonStrokeWidth / 2.0f;
        heightOverlap = Math.max(heightOverlap, polygonPaintHalfStroke);
        widthOverlap = Math.max(widthOverlap, polygonPaintHalfStroke);

        if (featureTableStyles != null && featureTableStyles.has()) {

            // Style Rows
            Set<Long> styleRowIds = new HashSet<>();
            List<Long> tableStyleIds = featureTableStyles.getAllTableStyleIds();
            if (tableStyleIds != null) {
                styleRowIds.addAll(tableStyleIds);
            }
            List<Long> styleIds = featureTableStyles.getAllStyleIds();
            if (styleIds != null) {
                styleRowIds.addAll(styleIds);
            }

            StyleDao styleDao = featureTableStyles.getStyleDao();
            for (long styleRowId : styleRowIds) {
                StyleRow styleRow = styleDao.getRow(styleDao.queryForIdRow(styleRowId));
                float styleHalfWidth = this.density * (float) (styleRow.getWidthOrDefault() / 2.0f);
                widthOverlap = Math.max(widthOverlap, styleHalfWidth);
                heightOverlap = Math.max(heightOverlap, styleHalfWidth);
            }

            // Icon Rows
            Set<Long> iconRowIds = new HashSet<>();
            List<Long> tableIconIds = featureTableStyles.getAllTableIconIds();
            if (tableIconIds != null) {
                iconRowIds.addAll(tableIconIds);
            }
            List<Long> iconIds = featureTableStyles.getAllIconIds();
            if (iconIds != null) {
                iconRowIds.addAll(iconIds);
            }

            IconDao iconDao = featureTableStyles.getIconDao();
            for (long iconRowId : iconRowIds) {
                IconRow iconRow = iconDao.getRow(iconDao.queryForIdRow(iconRowId));
                double[] iconDimensions = iconRow.getDerivedDimensions();
                float iconWidth = this.density * (float) Math.ceil(iconDimensions[0]);
                float iconHeight = this.density * (float) Math.ceil(iconDimensions[1]);
                widthOverlap = Math.max(widthOverlap, iconWidth);
                heightOverlap = Math.max(heightOverlap, iconHeight);
            }

        }

    }
public void calculateDrawOverlap ( ) { if ( pointIcon != null ) { heightOverlap = this . density * pointIcon . getHeight ( ) ; widthOverlap = this . density * pointIcon . getWidth ( ) ; } else { heightOverlap = this . density * pointRadius ; widthOverlap = this . density * pointRadius ; } float linePaintHalfStroke = this . density * lineStrokeWidth / 2.0f ; heightOverlap = Math . max ( heightOverlap , linePaintHalfStroke ) ; widthOverlap = Math . max ( widthOverlap , linePaintHalfStroke ) ; float polygonPaintHalfStroke = this . density * polygonStrokeWidth / 2.0f ; heightOverlap = Math . max ( heightOverlap , polygonPaintHalfStroke ) ; widthOverlap = Math . max ( widthOverlap , polygonPaintHalfStroke ) ; if ( featureTableStyles != null && featureTableStyles . has ( ) ) { // Style Rows Set < Long > styleRowIds = new HashSet <> ( ) ; List < Long > tableStyleIds = featureTableStyles . getAllTableStyleIds ( ) ; if ( tableStyleIds != null ) { styleRowIds . addAll ( tableStyleIds ) ; } List < Long > styleIds = featureTableStyles . getAllStyleIds ( ) ; if ( styleIds != null ) { styleRowIds . addAll ( styleIds ) ; } StyleDao styleDao = featureTableStyles . getStyleDao ( ) ; for ( long styleRowId : styleRowIds ) { StyleRow styleRow = styleDao . getRow ( styleDao . queryForIdRow ( styleRowId ) ) ; float styleHalfWidth = this . density * ( float ) ( styleRow . getWidthOrDefault ( ) / 2.0f ) ; widthOverlap = Math . max ( widthOverlap , styleHalfWidth ) ; heightOverlap = Math . max ( heightOverlap , styleHalfWidth ) ; } // Icon Rows Set < Long > iconRowIds = new HashSet <> ( ) ; List < Long > tableIconIds = featureTableStyles . getAllTableIconIds ( ) ; if ( tableIconIds != null ) { iconRowIds . addAll ( tableIconIds ) ; } List < Long > iconIds = featureTableStyles . getAllIconIds ( ) ; if ( iconIds != null ) { iconRowIds . addAll ( iconIds ) ; } IconDao iconDao = featureTableStyles . getIconDao ( ) ; for ( long iconRowId : iconRowIds ) { IconRow iconRow = iconDao . getRow ( iconDao . queryForIdRow ( iconRowId ) ) ; double [ ] iconDimensions = iconRow . getDerivedDimensions ( ) ; float iconWidth = this . density * ( float ) Math . ceil ( iconDimensions [ 0 ] ) ; float iconHeight = this . density * ( float ) Math . ceil ( iconDimensions [ 1 ] ) ; widthOverlap = Math . max ( widthOverlap , iconWidth ) ; heightOverlap = Math . max ( heightOverlap , iconHeight ) ; } } }
Call after making changes to the point icon, point radius, or paint stroke widths.
Determines the pixel overlap between tiles
Call after making changes to the point icon point radius or paint stroke widths . Determines the pixel overlap between tiles