signature:
public class IconCache { /** * Create or retrieve from cache an icon bitmap for the icon row
 * @ param icon icon row
 * @ param density display density : { @ link android . util . DisplayMetrics # density }
 * @ param iconCache icon cache
 * @ return icon bitmap */
public static Bitmap createIcon ( IconRow icon , float density , IconCache iconCache ) { } }

implementation: Bitmap iconImage = null ; if ( icon != null ) { if ( iconCache != null ) { iconImage = iconCache . get ( icon . getId ( ) ) ; } if ( iconImage == null ) { BitmapFactory . Options options = icon . getDataBounds ( ) ; int dataWidth = options . outWidth ; int dataHeight = options . outHeight ; double styleWidth = dataWidth ; double styleHeight = dataHeight ; double widthDensity = DisplayMetrics . DENSITY_DEFAULT ; double heightDensity = DisplayMetrics . DENSITY_DEFAULT ; if ( icon . getWidth ( ) != null ) { styleWidth = icon . getWidth ( ) ; double widthRatio = dataWidth / styleWidth ; widthDensity *= widthRatio ; if ( icon . getHeight ( ) == null ) { heightDensity = widthDensity ; } } if ( icon . getHeight ( ) != null ) { styleHeight = icon . getHeight ( ) ; double heightRatio = dataHeight / styleHeight ; heightDensity *= heightRatio ; if ( icon . getWidth ( ) == null ) { widthDensity = heightDensity ; } } options = new BitmapFactory . Options ( ) ; options . inDensity = ( int ) ( Math . min ( widthDensity , heightDensity ) + 0.5f ) ; options . inTargetDensity = ( int ) ( DisplayMetrics . DENSITY_DEFAULT * density + 0.5f ) ; iconImage = icon . getDataBitmap ( options ) ; if ( widthDensity != heightDensity ) { int width = ( int ) ( styleWidth * density + 0.5f ) ; int height = ( int ) ( styleHeight * density + 0.5f ) ; if ( width != iconImage . getWidth ( ) || height != iconImage . getHeight ( ) ) { Bitmap scaledBitmap = Bitmap . createScaledBitmap ( iconImage , width , height , false ) ; iconImage . recycle ( ) ; iconImage = scaledBitmap ; } } if ( iconCache != null ) { iconCache . put ( icon . getId ( ) , iconImage ) ; } } } return iconImage ;


signature:
public class FeatureTableReader { /** * { @ inheritDoc } */
@ Override protected FeatureTable createTable ( String tableName , List < FeatureColumn > columnList ) { } }

implementation: return new FeatureTable ( tableName , columnList ) ;


signature:
public class FeatureTableReader { /** * { @ inheritDoc } */
@ Override protected FeatureColumn createColumn ( FeatureCursor cursor , int index , String name , String type , Long max , boolean notNull , int defaultValueIndex , boolean primaryKey ) { } }

implementation: boolean geometry = name . equalsIgnoreCase ( geometryColumns . getColumnName ( ) ) ; GeometryType geometryType = null ; GeoPackageDataType dataType = null ; if ( geometry ) { geometryType = GeometryType . fromName ( type ) ; dataType = GeoPackageDataType . BLOB ; } else { dataType = GeoPackageDataType . fromName ( type ) ; } Object defaultValue = cursor . getValue ( defaultValueIndex , dataType ) ; FeatureColumn column = new FeatureColumn ( index , name , dataType , max , notNull , defaultValue , primaryKey , geometryType ) ; return column ;


signature:
public class FeatureIndexMetadataResults { /** * { @ inheritDoc } */
@ Override public Iterator < FeatureRow > iterator ( ) { } }

implementation: return new Iterator < FeatureRow > ( ) { @ Override public boolean hasNext ( ) { return ! geometryMetadata . isLast ( ) ; } @ Override public FeatureRow next ( ) { geometryMetadata . moveToNext ( ) ; FeatureRow featureRow = featureIndexer . getFeatureRow ( geometryMetadata ) ; return featureRow ; } } ;


signature:
public class SQLUtils { /** * Wrap the content values names in quotes
 * @ param values content values
 * @ return quoted content values */
public static ContentValues quoteWrap ( ContentValues values ) { } }

implementation: ContentValues quoteValues = null ; if ( values != null ) { Map < String , Object > quoteMap = new HashMap < > ( ) ; for ( Map . Entry < String , Object > value : values . valueSet ( ) ) { quoteMap . put ( CoreSQLUtils . quoteWrap ( value . getKey ( ) ) , value . getValue ( ) ) ; } Parcel parcel = Parcel . obtain ( ) ; parcel . writeMap ( quoteMap ) ; parcel . setDataPosition ( 0 ) ; quoteValues = ContentValues . CREATOR . createFromParcel ( parcel ) ; parcel . recycle ( ) ; } return quoteValues ;


signature:
public class FeatureTileCanvas { /** * Create the final bitmap from the layers , resets the layers
 * @ return bitmap */
public Bitmap createBitmap ( ) { } }

implementation: Bitmap bitmap = null ; Canvas canvas = null ; for ( int layer = 0 ; layer < 4 ; layer ++ ) { Bitmap layerBitmap = layeredBitmap [ layer ] ; if ( layerBitmap != null ) { if ( bitmap == null ) { bitmap = layerBitmap ; canvas = layeredCanvas [ layer ] ; } else { canvas . drawBitmap ( layerBitmap , new Matrix ( ) , null ) ; layerBitmap . recycle ( ) ; } layeredBitmap [ layer ] = null ; layeredCanvas [ layer ] = null ; } } return bitmap ;


signature:
public class FeatureTileCanvas { /** * Recycle the layered bitmaps */
public void recycle ( ) { } }

implementation: for ( int layer = 0 ; layer < 4 ; layer ++ ) { Bitmap bitmap = layeredBitmap [ layer ] ; if ( bitmap != null ) { bitmap . recycle ( ) ; layeredBitmap [ layer ] = null ; layeredCanvas [ layer ] = null ; } }


signature:
public class FeatureTileCanvas { /** * Get the bitmap for the layer index
 * @ param layer layer index
 * @ return bitmap */
private Bitmap getBitmap ( int layer ) { } }

implementation: Bitmap bitmap = layeredBitmap [ layer ] ; if ( bitmap == null ) { createBitmapAndCanvas ( layer ) ; bitmap = layeredBitmap [ layer ] ; } return bitmap ;


signature:
public class FeatureTileCanvas { /** * Get the canvas for the layer index
 * @ param layer layer index
 * @ return canvas */
private Canvas getCanvas ( int layer ) { } }

implementation: Canvas canvas = layeredCanvas [ layer ] ; if ( canvas == null ) { createBitmapAndCanvas ( layer ) ; canvas = layeredCanvas [ layer ] ; } return canvas ;


signature:
public class FeatureTileCanvas { /** * Create a new empty Bitmap and Canvas
 * @ param layer layer index */
private void createBitmapAndCanvas ( int layer ) { } }

implementation: layeredBitmap [ layer ] = Bitmap . createBitmap ( tileWidth , tileHeight , Bitmap . Config . ARGB_8888 ) ; layeredCanvas [ layer ] = new Canvas ( layeredBitmap [ layer ] ) ;


signature:
public class FeatureStyleExtension { /** * Get a Style Mapping DAO from a table name
 * @ param tablePrefix table name prefix
 * @ param featureTable feature table
 * @ return style mapping dao */
private StyleMappingDao getMappingDao ( String tablePrefix , String featureTable ) { } }

implementation: String tableName = tablePrefix + featureTable ; StyleMappingDao dao = null ; if ( geoPackage . isTable ( tableName ) ) { dao = new StyleMappingDao ( relatedTables . getUserDao ( tableName ) ) ; } return dao ;


signature:
public class FeatureStyleExtension { /** * Get a style DAO
 * @ return style DAO */
public StyleDao getStyleDao ( ) { } }

implementation: StyleDao styleDao = null ; if ( geoPackage . isTable ( StyleTable . TABLE_NAME ) ) { AttributesDao attributesDao = getGeoPackage ( ) . getAttributesDao ( StyleTable . TABLE_NAME ) ; styleDao = new StyleDao ( attributesDao ) ; relatedTables . setContents ( styleDao . getTable ( ) ) ; } return styleDao ;


signature:
public class FeatureStyleExtension { /** * Get a icon DAO
 * @ return icon DAO */
public IconDao getIconDao ( ) { } }

implementation: IconDao iconDao = null ; if ( geoPackage . isTable ( IconTable . TABLE_NAME ) ) { iconDao = new IconDao ( relatedTables . getUserDao ( IconTable . TABLE_NAME ) ) ; relatedTables . setContents ( iconDao . getTable ( ) ) ; } return iconDao ;


signature:
public class FeatureStyleExtension { /** * Get the feature table default feature styles
 * @ param featureTable feature table
 * @ return table feature styles or null */
public FeatureStyles getTableFeatureStyles ( String featureTable ) { } }

implementation: FeatureStyles featureStyles = null ; Long id = contentsId . getId ( featureTable ) ; if ( id != null ) { Styles styles = getTableStyles ( featureTable , id ) ; Icons icons = getTableIcons ( featureTable , id ) ; if ( styles != null || icons != null ) { featureStyles = new FeatureStyles ( styles , icons ) ; } } return featureStyles ;


signature:
public class FeatureStyleExtension { /** * Get the feature table default styles
 * @ param featureTable feature table
 * @ return table styles or null */
public Styles getTableStyles ( String featureTable ) { } }

implementation: Styles styles = null ; Long id = contentsId . getId ( featureTable ) ; if ( id != null ) { styles = getTableStyles ( featureTable , id ) ; } return styles ;


signature:
public class FeatureStyleExtension { /** * Get the style of the feature table and geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type
 * @ return style row */
public StyleRow getTableStyle ( String featureTable , GeometryType geometryType ) { } }

implementation: StyleRow styleRow = null ; Styles tableStyles = getTableStyles ( featureTable ) ; if ( tableStyles != null ) { styleRow = tableStyles . getStyle ( geometryType ) ; } return styleRow ;


signature:
public class FeatureStyleExtension { /** * Get the feature table default icons
 * @ param featureTable feature table
 * @ return table icons or null */
public Icons getTableIcons ( String featureTable ) { } }

implementation: Icons icons = null ; Long id = contentsId . getId ( featureTable ) ; if ( id != null ) { icons = getTableIcons ( featureTable , id ) ; } return icons ;


signature:
public class FeatureStyleExtension { /** * Get the icon of the feature table and geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type
 * @ return icon row */
public IconRow getTableIcon ( String featureTable , GeometryType geometryType ) { } }

implementation: IconRow iconRow = null ; Icons tableIcons = getTableIcons ( featureTable ) ; if ( tableIcons != null ) { iconRow = tableIcons . getIcon ( geometryType ) ; } return iconRow ;


signature:
public class FeatureStyleExtension { /** * Get the feature styles for the feature row
 * @ param featureRow feature row
 * @ return feature styles or null */
public FeatureStyles getFeatureStyles ( FeatureRow featureRow ) { } }

implementation: return getFeatureStyles ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) ) ;


signature:
public class FeatureStyleExtension { /** * Get the feature styles for the feature table and feature id
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ return feature styles or null */
public FeatureStyles getFeatureStyles ( String featureTable , long featureId ) { } }

implementation: Styles styles = getStyles ( featureTable , featureId ) ; Icons icons = getIcons ( featureTable , featureId ) ; FeatureStyles featureStyles = null ; if ( styles != null || icons != null ) { featureStyles = new FeatureStyles ( styles , icons ) ; } return featureStyles ;


signature:
public class FeatureStyleExtension { /** * Get the feature style ( style and icon ) of the feature row with the
 * provided geometry type , searching in order : feature geometry type style
 * or icon , feature default style or icon , table geometry type style or
 * icon , table default style or icon
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ return feature style */
public FeatureStyle getFeatureStyle ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: return getFeatureStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Get the feature style default ( style and icon ) of the feature row ,
 * searching in order : feature default style or icon , table default style or
 * icon
 * @ param featureRow feature row
 * @ return feature style */
public FeatureStyle getFeatureStyleDefault ( FeatureRow featureRow ) { } }

implementation: return getFeatureStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , null ) ;


signature:
public class FeatureStyleExtension { /** * Get the styles for the feature row
 * @ param featureRow feature row
 * @ return styles or null */
public Styles getStyles ( FeatureRow featureRow ) { } }

implementation: return getStyles ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) ) ;


signature:
public class FeatureStyleExtension { /** * Get the style of the feature row with the provided geometry type ,
 * searching in order : feature geometry type style , feature default style ,
 * table geometry type style , table default style
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ return style row */
public StyleRow getStyle ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: return getStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Get the default style of the feature row , searching in order : feature
 * default style , table default style
 * @ param featureRow feature row
 * @ return style row */
public StyleRow getStyleDefault ( FeatureRow featureRow ) { } }

implementation: return getStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , null ) ;


signature:
public class FeatureStyleExtension { /** * Get the style of the feature , searching in order : feature geometry type
 * style , feature default style , table geometry type style , table default
 * style
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ return style row */
public StyleRow getStyle ( String featureTable , long featureId , GeometryType geometryType ) { } }

implementation: return getStyle ( featureTable , featureId , geometryType , true ) ;


signature:
public class FeatureStyleExtension { /** * Get the default style of the feature , searching in order : feature default
 * style , table default style
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ return style row */
public StyleRow getStyleDefault ( String featureTable , long featureId ) { } }

implementation: return getStyle ( featureTable , featureId , null , true ) ;


signature:
public class FeatureStyleExtension { /** * Get the style of the feature , searching in order : feature geometry type
 * style , feature default style , when tableStyle enabled continue searching :
 * table geometry type style , table default style
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param tableStyle when true and a feature style is not found , query for a
 * matching table style
 * @ return style row */
public StyleRow getStyle ( String featureTable , long featureId , GeometryType geometryType , boolean tableStyle ) { } }

implementation:
StyleRow styleRow = null ; // Feature Style
Styles styles = getStyles ( featureTable , featureId ) ; if ( styles != null ) { styleRow = styles . getStyle ( geometryType ) ; } if ( styleRow == null && tableStyle ) { // Table Style
styleRow = getTableStyle ( featureTable , geometryType ) ; } return styleRow ;


signature:
public class FeatureStyleExtension { /** * Get the default style of the feature , searching in order : feature default
 * style , when tableStyle enabled continue searching : table default style
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param tableStyle when true and a feature style is not found , query for a
 * matching table style
 * @ return style row */
public StyleRow getStyleDefault ( String featureTable , long featureId , boolean tableStyle ) { } }

implementation: return getStyle ( featureTable , featureId , null , tableStyle ) ;


signature:
public class FeatureStyleExtension { /** * Get the icons for the feature row
 * @ param featureRow feature row
 * @ return icons or null */
public Icons getIcons ( FeatureRow featureRow ) { } }

implementation: return getIcons ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) ) ;


signature:
public class FeatureStyleExtension { /** * Get the icon of the feature row with the provided geometry type ,
 * searching in order : feature geometry type icon , feature default icon ,
 * table geometry type icon , table default icon
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ return icon row */
public IconRow getIcon ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: return getIcon ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Get the default icon of the feature row , searching in order : feature
 * default icon , table default icon
 * @ param featureRow feature row
 * @ return icon row */
public IconRow getIconDefault ( FeatureRow featureRow ) { } }

implementation: return getIcon ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , null ) ;


signature:
public class FeatureStyleExtension { /** * Get the icon of the feature , searching in order : feature geometry type
 * icon , feature default icon , table geometry type icon , table default icon
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ return icon row */
public IconRow getIcon ( String featureTable , long featureId , GeometryType geometryType ) { } }

implementation: return getIcon ( featureTable , featureId , geometryType , true ) ;


signature:
public class FeatureStyleExtension { /** * Get the default icon of the feature , searching in order : feature default
 * icon , table default icon
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ return icon row */
public IconRow getIconDefault ( String featureTable , long featureId ) { } }

implementation: return getIcon ( featureTable , featureId , null , true ) ;


signature:
public class FeatureStyleExtension { /** * Get the icon of the feature , searching in order : feature geometry type
 * icon , feature default icon , when tableIcon enabled continue searching :
 * table geometry type icon , table default icon
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param tableIcon when true and a feature icon is not found , query for a
 * matching table icon
 * @ return icon row */
public IconRow getIcon ( String featureTable , long featureId , GeometryType geometryType , boolean tableIcon ) { } }

implementation:
IconRow iconRow = null ; // Feature Icon
Icons icons = getIcons ( featureTable , featureId ) ; if ( icons != null ) { iconRow = icons . getIcon ( geometryType ) ; } if ( iconRow == null && tableIcon ) { // Table Icon
iconRow = getTableIcon ( featureTable , geometryType ) ; } return iconRow ;


signature:
public class FeatureStyleExtension { /** * Get the default icon of the feature , searching in order : feature default
 * icon , when tableIcon enabled continue searching : table default icon
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param tableIcon when true and a feature icon is not found , query for a
 * matching table icon
 * @ return icon row */
public IconRow getIconDefault ( String featureTable , long featureId , boolean tableIcon ) { } }

implementation: return getIcon ( featureTable , featureId , null , tableIcon ) ;


signature:
public class FeatureStyleExtension { /** * Get the styles for feature id from the style mapping dao
 * @ param featureId geometry feature id or feature table id
 * @ param mappingDao style mapping dao
 * @ return styles */
private Styles getStyles ( long featureId , StyleMappingDao mappingDao ) { } }

implementation: Styles styles = null ; if ( mappingDao != null ) { StyleDao styleDao = getStyleDao ( ) ; if ( styleDao != null ) { List < StyleMappingRow > styleMappingRows = mappingDao . queryByBaseFeatureId ( featureId ) ; if ( ! styleMappingRows . isEmpty ( ) ) { for ( StyleMappingRow styleMappingRow : styleMappingRows ) { StyleRow styleRow = styleDao . queryForRow ( styleMappingRow ) ; if ( styleRow != null ) { if ( styles == null ) { styles = new Styles ( ) ; } styles . setStyle ( styleRow , styleMappingRow . getGeometryType ( ) ) ; } } } } } return styles ;


signature:
public class FeatureStyleExtension { /** * Get the icons for feature id from the icon mapping dao
 * @ param featureId geometry feature id or feature table id
 * @ param mappingDao icon mapping dao
 * @ return icons */
private Icons getIcons ( long featureId , StyleMappingDao mappingDao ) { } }

implementation: Icons icons = null ; if ( mappingDao != null ) { IconDao iconDao = getIconDao ( ) ; if ( iconDao != null ) { List < StyleMappingRow > styleMappingRows = mappingDao . queryByBaseFeatureId ( featureId ) ; if ( ! styleMappingRows . isEmpty ( ) ) { for ( StyleMappingRow styleMappingRow : styleMappingRows ) { IconRow iconRow = iconDao . queryForRow ( styleMappingRow ) ; if ( iconRow != null ) { if ( icons == null ) { icons = new Icons ( ) ; } icons . setIcon ( iconRow , styleMappingRow . getGeometryType ( ) ) ; } } } } } return icons ;


signature:
public class FeatureStyleExtension { /** * Set the feature table default feature styles
 * @ param featureTable feature table
 * @ param featureStyles default feature styles */
public void setTableFeatureStyles ( String featureTable , FeatureStyles featureStyles ) { } }

implementation: if ( featureStyles != null ) { setTableStyles ( featureTable , featureStyles . getStyles ( ) ) ; setTableIcons ( featureTable , featureStyles . getIcons ( ) ) ; } else { deleteTableFeatureStyles ( featureTable ) ; }


signature:
public class FeatureStyleExtension { /** * Set the feature table default styles
 * @ param featureTable feature table
 * @ param styles default styles */
public void setTableStyles ( String featureTable , Styles styles ) { } }

implementation: deleteTableStyles ( featureTable ) ; if ( styles != null ) { if ( styles . getDefault ( ) != null ) { setTableStyleDefault ( featureTable , styles . getDefault ( ) ) ; } for ( Entry < GeometryType , StyleRow > style : styles . getStyles ( ) . entrySet ( ) ) { setTableStyle ( featureTable , style . getKey ( ) , style . getValue ( ) ) ; } }


signature:
public class FeatureStyleExtension { /** * Set the feature table style for the geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type
 * @ param style style row */
public void setTableStyle ( FeatureTable featureTable , GeometryType geometryType , StyleRow style ) { } }

implementation: setTableStyle ( featureTable . getTableName ( ) , geometryType , style ) ;


signature:
public class FeatureStyleExtension { /** * Set the feature table style for the geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type
 * @ param style style row */
public void setTableStyle ( String featureTable , GeometryType geometryType , StyleRow style ) { } }

implementation: deleteTableStyle ( featureTable , geometryType ) ; if ( style != null ) { createTableStyleRelationship ( featureTable ) ; long featureContentsId = contentsId . getOrCreateId ( featureTable ) ; long styleId = getOrInsertStyle ( style ) ; StyleMappingDao mappingDao = getTableStyleMappingDao ( featureTable ) ; insertStyleMapping ( mappingDao , featureContentsId , styleId , geometryType ) ; }


signature:
public class FeatureStyleExtension { /** * Set the feature table default icons
 * @ param featureTable feature table
 * @ param icons default icons */
public void setTableIcons ( String featureTable , Icons icons ) { } }

implementation: deleteTableIcons ( featureTable ) ; if ( icons != null ) { if ( icons . getDefault ( ) != null ) { setTableIconDefault ( featureTable , icons . getDefault ( ) ) ; } for ( Entry < GeometryType , IconRow > icon : icons . getIcons ( ) . entrySet ( ) ) { setTableIcon ( featureTable , icon . getKey ( ) , icon . getValue ( ) ) ; } }


signature:
public class FeatureStyleExtension { /** * Set the feature table icon for the geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type
 * @ param icon icon row */
public void setTableIcon ( FeatureTable featureTable , GeometryType geometryType , IconRow icon ) { } }

implementation: setTableIcon ( featureTable . getTableName ( ) , geometryType , icon ) ;


signature:
public class FeatureStyleExtension { /** * Set the feature table icon for the geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type
 * @ param icon icon row */
public void setTableIcon ( String featureTable , GeometryType geometryType , IconRow icon ) { } }

implementation: deleteTableIcon ( featureTable , geometryType ) ; if ( icon != null ) { createTableIconRelationship ( featureTable ) ; long featureContentsId = contentsId . getOrCreateId ( featureTable ) ; long iconId = getOrInsertIcon ( icon ) ; StyleMappingDao mappingDao = getTableIconMappingDao ( featureTable ) ; insertStyleMapping ( mappingDao , featureContentsId , iconId , geometryType ) ; }


signature:
public class FeatureStyleExtension { /** * Set the feature styles for the feature row
 * @ param featureRow feature row
 * @ param featureStyles feature styles */
public void setFeatureStyles ( FeatureRow featureRow , FeatureStyles featureStyles ) { } }

implementation: setFeatureStyles ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , featureStyles ) ;


signature:
public class FeatureStyleExtension { /** * Set the feature styles for the feature table and feature id
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param featureStyles feature styles */
public void setFeatureStyles ( String featureTable , long featureId , FeatureStyles featureStyles ) { } }

implementation: if ( featureStyles != null ) { setStyles ( featureTable , featureId , featureStyles . getStyles ( ) ) ; setIcons ( featureTable , featureId , featureStyles . getIcons ( ) ) ; } else { deleteStyles ( featureTable , featureId ) ; deleteIcons ( featureTable , featureId ) ; }


signature:
public class FeatureStyleExtension { /** * Set the feature style ( style and icon ) of the feature row
 * @ param featureRow feature row
 * @ param featureStyle feature style */
public void setFeatureStyle ( FeatureRow featureRow , FeatureStyle featureStyle ) { } }

implementation: setFeatureStyle ( featureRow , featureRow . getGeometryType ( ) , featureStyle ) ;


signature:
public class FeatureStyleExtension { /** * Set the feature style ( style and icon ) of the feature row for the
 * specified geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ param featureStyle feature style */
public void setFeatureStyle ( FeatureRow featureRow , GeometryType geometryType , FeatureStyle featureStyle ) { } }

implementation: setFeatureStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType , featureStyle ) ;


signature:
public class FeatureStyleExtension { /** * Set the feature style default ( style and icon ) of the feature row
 * @ param featureRow feature row
 * @ param featureStyle feature style */
public void setFeatureStyleDefault ( FeatureRow featureRow , FeatureStyle featureStyle ) { } }

implementation: setFeatureStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , null , featureStyle ) ;


signature:
public class FeatureStyleExtension { /** * Set the feature style ( style and icon ) of the feature
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param featureStyle feature style */
public void setFeatureStyle ( String featureTable , long featureId , GeometryType geometryType , FeatureStyle featureStyle ) { } }

implementation: if ( featureStyle != null ) { setStyle ( featureTable , featureId , geometryType , featureStyle . getStyle ( ) ) ; setIcon ( featureTable , featureId , geometryType , featureStyle . getIcon ( ) ) ; } else { deleteStyle ( featureTable , featureId , geometryType ) ; deleteIcon ( featureTable , featureId , geometryType ) ; }


signature:
public class FeatureStyleExtension { /** * Set the feature style ( style and icon ) of the feature
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param featureStyle feature style */
public void setFeatureStyleDefault ( String featureTable , long featureId , FeatureStyle featureStyle ) { } }

implementation: setFeatureStyle ( featureTable , featureId , null , featureStyle ) ;


signature:
public class FeatureStyleExtension { /** * Set the styles for the feature row
 * @ param featureRow feature row
 * @ param styles styles */
public void setStyles ( FeatureRow featureRow , Styles styles ) { } }

implementation: setStyles ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , styles ) ;


signature:
public class FeatureStyleExtension { /** * Set the styles for the feature table and feature id
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param styles styles */
public void setStyles ( String featureTable , long featureId , Styles styles ) { } }

implementation: deleteStyles ( featureTable , featureId ) ; if ( styles != null ) { if ( styles . getDefault ( ) != null ) { setStyleDefault ( featureTable , featureId , styles . getDefault ( ) ) ; } for ( Entry < GeometryType , StyleRow > style : styles . getStyles ( ) . entrySet ( ) ) { setStyle ( featureTable , featureId , style . getKey ( ) , style . getValue ( ) ) ; } }


signature:
public class FeatureStyleExtension { /** * Set the style of the feature row
 * @ param featureRow feature row
 * @ param style style row */
public void setStyle ( FeatureRow featureRow , StyleRow style ) { } }

implementation: setStyle ( featureRow , featureRow . getGeometryType ( ) , style ) ;


signature:
public class FeatureStyleExtension { /** * Set the style of the feature row for the specified geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ param style style row */
public void setStyle ( FeatureRow featureRow , GeometryType geometryType , StyleRow style ) { } }

implementation: setStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType , style ) ;


signature:
public class FeatureStyleExtension { /** * Set the default style of the feature row
 * @ param featureRow feature row
 * @ param style style row */
public void setStyleDefault ( FeatureRow featureRow , StyleRow style ) { } }

implementation: setStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , null , style ) ;


signature:
public class FeatureStyleExtension { /** * Set the style of the feature
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param style style row */
public void setStyle ( String featureTable , long featureId , GeometryType geometryType , StyleRow style ) { } }

implementation: deleteStyle ( featureTable , featureId , geometryType ) ; if ( style != null ) { createStyleRelationship ( featureTable ) ; long styleId = getOrInsertStyle ( style ) ; StyleMappingDao mappingDao = getStyleMappingDao ( featureTable ) ; insertStyleMapping ( mappingDao , featureId , styleId , geometryType ) ; }


signature:
public class FeatureStyleExtension { /** * Set the default style of the feature
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param style style row */
public void setStyleDefault ( String featureTable , long featureId , StyleRow style ) { } }

implementation: setStyle ( featureTable , featureId , null , style ) ;


signature:
public class FeatureStyleExtension { /** * Set the icons for the feature row
 * @ param featureRow feature row
 * @ param icons icons */
public void setIcons ( FeatureRow featureRow , Icons icons ) { } }

implementation: setIcons ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , icons ) ;


signature:
public class FeatureStyleExtension { /** * Set the icons for the feature table and feature id
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param icons icons */
public void setIcons ( String featureTable , long featureId , Icons icons ) { } }

implementation: deleteIcons ( featureTable , featureId ) ; if ( icons != null ) { if ( icons . getDefault ( ) != null ) { setIconDefault ( featureTable , featureId , icons . getDefault ( ) ) ; } for ( Entry < GeometryType , IconRow > icon : icons . getIcons ( ) . entrySet ( ) ) { setIcon ( featureTable , featureId , icon . getKey ( ) , icon . getValue ( ) ) ; } }


signature:
public class FeatureStyleExtension { /** * Set the icon of the feature row
 * @ param featureRow feature row
 * @ param icon icon row */
public void setIcon ( FeatureRow featureRow , IconRow icon ) { } }

implementation: setIcon ( featureRow , featureRow . getGeometryType ( ) , icon ) ;


signature:
public class FeatureStyleExtension { /** * Set the icon of the feature row for the specified geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ param icon icon row */
public void setIcon ( FeatureRow featureRow , GeometryType geometryType , IconRow icon ) { } }

implementation: setIcon ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType , icon ) ;


signature:
public class FeatureStyleExtension { /** * Set the default icon of the feature row
 * @ param featureRow feature row
 * @ param icon icon row */
public void setIconDefault ( FeatureRow featureRow , IconRow icon ) { } }

implementation: setIcon ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , null , icon ) ;


signature:
public class FeatureStyleExtension { /** * Get the icon of the feature , searching in order : feature geometry type
 * icon , feature default icon , table geometry type icon , table default icon
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param icon icon row */
public void setIcon ( String featureTable , long featureId , GeometryType geometryType , IconRow icon ) { } }

implementation: deleteIcon ( featureTable , featureId , geometryType ) ; if ( icon != null ) { createIconRelationship ( featureTable ) ; long iconId = getOrInsertIcon ( icon ) ; StyleMappingDao mappingDao = getIconMappingDao ( featureTable ) ; insertStyleMapping ( mappingDao , featureId , iconId , geometryType ) ; }


signature:
public class FeatureStyleExtension { /** * Set the default icon of the feature
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param icon icon row */
public void setIconDefault ( String featureTable , long featureId , IconRow icon ) { } }

implementation: setIcon ( featureTable , featureId , null , icon ) ;


signature:
public class FeatureStyleExtension { /** * Get the style id , either from the existing style or by inserting a new
 * one
 * @ param style style row
 * @ return style id */
private long getOrInsertStyle ( StyleRow style ) { } }

implementation: long styleId ; if ( style . hasId ( ) ) { styleId = style . getId ( ) ; } else { StyleDao styleDao = getStyleDao ( ) ; styleId = styleDao . create ( style ) ; } return styleId ;


signature:
public class FeatureStyleExtension { /** * Get the icon id , either from the existing icon or by inserting a new one
 * @ param icon icon row
 * @ return icon id */
private long getOrInsertIcon ( IconRow icon ) { } }

implementation: long iconId ; if ( icon . hasId ( ) ) { iconId = icon . getId ( ) ; } else { IconDao iconDao = getIconDao ( ) ; iconId = iconDao . create ( icon ) ; } return iconId ;


signature:
public class FeatureStyleExtension { /** * Insert a style mapping row
 * @ param mappingDao mapping dao
 * @ param baseId base id , either contents id or feature id
 * @ param relatedId related id , either style or icon id
 * @ param geometryType geometry type or null */
private void insertStyleMapping ( StyleMappingDao mappingDao , long baseId , long relatedId , GeometryType geometryType ) { } }

implementation: StyleMappingRow row = mappingDao . newRow ( ) ; row . setBaseId ( baseId ) ; row . setRelatedId ( relatedId ) ; row . setGeometryType ( geometryType ) ; mappingDao . insert ( row ) ;


signature:
public class FeatureStyleExtension { /** * Delete the feature table style for the geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type */
public void deleteTableStyle ( String featureTable , GeometryType geometryType ) { } }

implementation: deleteTableMapping ( getTableStyleMappingDao ( featureTable ) , featureTable , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Delete the feature table icon for the geometry type
 * @ param featureTable feature table
 * @ param geometryType geometry type */
public void deleteTableIcon ( String featureTable , GeometryType geometryType ) { } }

implementation: deleteTableMapping ( getTableIconMappingDao ( featureTable ) , featureTable , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Delete the table style mappings
 * @ param mappingDao mapping dao
 * @ param featureTable feature table */
private void deleteTableMappings ( StyleMappingDao mappingDao , String featureTable ) { } }

implementation: if ( mappingDao != null ) { Long featureContentsId = contentsId . getId ( featureTable ) ; if ( featureContentsId != null ) { mappingDao . deleteByBaseId ( featureContentsId ) ; } }


signature:
public class FeatureStyleExtension { /** * Delete the table style mapping with the geometry type value
 * @ param mappingDao mapping dao
 * @ param featureTable feature table
 * @ param geometryType geometry type */
private void deleteTableMapping ( StyleMappingDao mappingDao , String featureTable , GeometryType geometryType ) { } }

implementation: if ( mappingDao != null ) { Long featureContentsId = contentsId . getId ( featureTable ) ; if ( featureContentsId != null ) { mappingDao . deleteByBaseId ( featureContentsId , geometryType ) ; } }


signature:
public class FeatureStyleExtension { /** * Delete the feature row style for the geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type */
public void deleteStyle ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: deleteStyle ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Delete the feature row style for the geometry type
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type */
public void deleteStyle ( String featureTable , long featureId , GeometryType geometryType ) { } }

implementation: deleteMapping ( getStyleMappingDao ( featureTable ) , featureId , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Delete the feature row icon for the geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type */
public void deleteIcon ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: deleteIcon ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Delete the feature row icon for the geometry type
 * @ param featureTable feature table
 * @ param featureId feature id
 * @ param geometryType geometry type */
public void deleteIcon ( String featureTable , long featureId , GeometryType geometryType ) { } }

implementation: deleteMapping ( getIconMappingDao ( featureTable ) , featureId , geometryType ) ;


signature:
public class FeatureStyleExtension { /** * Delete the style mapping with the geometry type value
 * @ param mappingDao mapping dao
 * @ param featureId feature id
 * @ param geometryType geometry type */
private void deleteMapping ( StyleMappingDao mappingDao , long featureId , GeometryType geometryType ) { } }

implementation: if ( mappingDao != null ) { mappingDao . deleteByBaseId ( featureId , geometryType ) ; }


signature:
public class FeatureStyleExtension { /** * Get all the unique style row ids the table maps to
 * @ param featureTable feature table
 * @ return style row ids */
public List < Long > getAllTableStyleIds ( String featureTable ) { } }

implementation: List < Long > styleIds = null ; StyleMappingDao mappingDao = getTableStyleMappingDao ( featureTable ) ; if ( mappingDao != null ) { styleIds = mappingDao . uniqueRelatedIds ( ) ; } return styleIds ;


signature:
public class FeatureStyleExtension { /** * Get all the unique icon row ids the table maps to
 * @ param featureTable feature table
 * @ return icon row ids */
public List < Long > getAllTableIconIds ( String featureTable ) { } }

implementation: List < Long > iconIds = null ; StyleMappingDao mappingDao = getTableIconMappingDao ( featureTable ) ; if ( mappingDao != null ) { iconIds = mappingDao . uniqueRelatedIds ( ) ; } return iconIds ;


signature:
public class FeatureStyleExtension { /** * Get all the unique style row ids the features map to
 * @ param featureTable feature table
 * @ return style row ids */
public List < Long > getAllStyleIds ( String featureTable ) { } }

implementation: List < Long > styleIds = null ; StyleMappingDao mappingDao = getStyleMappingDao ( featureTable ) ; if ( mappingDao != null ) { styleIds = mappingDao . uniqueRelatedIds ( ) ; } return styleIds ;


signature:
public class FeatureStyleExtension { /** * Get all the unique icon row ids the features map to
 * @ param featureTable feature table
 * @ return icon row ids */
public List < Long > getAllIconIds ( String featureTable ) { } }

implementation: List < Long > iconIds = null ; StyleMappingDao mappingDao = getIconMappingDao ( featureTable ) ; if ( mappingDao != null ) { iconIds = mappingDao . uniqueRelatedIds ( ) ; } return iconIds ;


signature:
public class CoverageDataPngImage { /** * Get the image bytes
 * @ return image bytes */
public byte [ ] getImageBytes ( ) { } }

implementation: byte [ ] bytes = null ; if ( imageBytes != null ) { bytes = imageBytes ; } else if ( outputStream != null ) { bytes = outputStream . toByteArray ( ) ; } return bytes ;


signature:
public class CoverageDataPngImage { /** * Flush the output stream and set the image bytes , close the stream */
public void flushStream ( ) { } }

implementation: if ( outputStream != null ) { if ( imageBytes == null ) { imageBytes = outputStream . toByteArray ( ) ; } try { outputStream . close ( ) ; } catch ( IOException e ) { Log . w ( CoverageDataPngImage . class . getSimpleName ( ) , "Failed to close output stream" , e ) ; } }


signature:
public class CoverageDataPngImage { /** * Get the pixel at the coordinate
 * @ param x x coordinate
 * @ param y y coordinate
 * @ return pixel value */
public int getPixel ( int x , int y ) { } }

implementation: int pixel = - 1 ; if ( pixels == null ) { readPixels ( ) ; } if ( pixels != null ) { pixel = pixels [ y ] [ x ] ; } else { throw new GeoPackageException ( "Could not retrieve pixel value" ) ; } return pixel ;


signature:
public class CoverageDataPngImage { /** * Read all the pixels from the image */
private void readPixels ( ) { } }

implementation: if ( reader != null ) { pixels = new int [ reader . imgInfo . rows ] [ reader . imgInfo . cols ] ; int rowCount = 0 ; while ( reader . hasMoreRows ( ) ) { ImageLineInt row = reader . readRowInt ( ) ; int [ ] columnValues = new int [ reader . imgInfo . cols ] ; System . arraycopy ( row . getScanline ( ) , 0 , columnValues , 0 , columnValues . length ) ; pixels [ rowCount ++ ] = columnValues ; } reader . close ( ) ; }


signature:
public class GeoPackageMetadataDb { /** * { @ inheritDoc } */
@ Override public void onCreate ( SQLiteDatabase db ) { } }

implementation: db . execSQL ( GeoPackageMetadata . CREATE_SQL ) ; db . execSQL ( TableMetadata . CREATE_SQL ) ; db . execSQL ( GeometryMetadata . CREATE_SQL ) ;


signature:
public class GeoPackageMetadataDb { /** * { @ inheritDoc } */
@ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } }

implementation: db . execSQL ( "DROP TABLE IF EXISTS " + GeometryMetadata . TABLE_NAME ) ; db . execSQL ( "DROP TABLE IF EXISTS " + TableMetadata . TABLE_NAME ) ; db . execSQL ( "DROP TABLE IF EXISTS " + GeoPackageMetadata . TABLE_NAME ) ; onCreate ( db ) ;


signature:
public class DefaultFeatureTiles { /** * { @ inheritDoc } */
@ Override public Bitmap drawTile ( int zoom , BoundingBox boundingBox , List < FeatureRow > featureRow ) { } }

implementation: FeatureTileCanvas canvas = new FeatureTileCanvas ( tileWidth , tileHeight ) ; ProjectionTransform transform = getProjectionToWebMercatorTransform ( featureDao . getProjection ( ) ) ; BoundingBox expandedBoundingBox = expandBoundingBox ( boundingBox ) ; boolean drawn = false ; for ( FeatureRow row : featureRow ) { if ( drawFeature ( zoom , boundingBox , expandedBoundingBox , transform , canvas , row ) ) { drawn = true ; } } Bitmap bitmap = null ; if ( drawn ) { bitmap = canvas . createBitmap ( ) ; bitmap = checkIfDrawn ( bitmap ) ; } else { canvas . recycle ( ) ; } return bitmap ;


signature:
public class DefaultFeatureTiles { /** * Draw the feature on the canvas
 * @ param zoom zoom level
 * @ param boundingBox bounding box
 * @ param expandedBoundingBox expanded bounding box
 * @ param transform projection transform
 * @ param canvas feature tile canvas
 * @ param row feature row
 * @ return true if at least one feature was drawn */
private boolean drawFeature ( int zoom , BoundingBox boundingBox , BoundingBox expandedBoundingBox , ProjectionTransform transform , FeatureTileCanvas canvas , FeatureRow row ) { } }

implementation: boolean drawn = false ; try { GeoPackageGeometryData geomData = row . getGeometry ( ) ; if ( geomData != null ) { Geometry geometry = geomData . getGeometry ( ) ; if ( geometry != null ) { GeometryEnvelope envelope = geomData . getOrBuildEnvelope ( ) ; BoundingBox geometryBoundingBox = new BoundingBox ( envelope ) ; BoundingBox transformedBoundingBox = geometryBoundingBox . transform ( transform ) ; if ( expandedBoundingBox . intersects ( transformedBoundingBox , true ) ) { double simplifyTolerance = TileBoundingBoxUtils . toleranceDistance ( zoom , tileWidth , tileHeight ) ; drawn = drawShape ( simplifyTolerance , boundingBox , transform , canvas , row , geometry ) ; } } } } catch ( Exception e ) { Log . e ( DefaultFeatureTiles . class . getSimpleName ( ) , "Failed to draw feature in tile. Table: " + featureDao . getTableName ( ) , e ) ; } return drawn ;


signature:
public class DefaultFeatureTiles { /** * Draw the geometry on the canvas
 * @ param simplifyTolerance simplify tolerance in meters
 * @ param boundingBox bounding box
 * @ param transform projection transform
 * @ param canvas feature tile canvas
 * @ param featureRow feature row
 * @ param geometry feature geometry
 * @ return true if drawn */
private boolean drawShape ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , FeatureTileCanvas canvas , FeatureRow featureRow , Geometry geometry ) { } }

implementation: boolean drawn = false ; GeometryType geometryType = geometry . getGeometryType ( ) ; FeatureStyle featureStyle = getFeatureStyle ( featureRow , geometryType ) ; switch ( geometryType ) { case POINT : Point point = ( Point ) geometry ; drawn = drawPoint ( boundingBox , transform , canvas , point , featureStyle ) ; break ; case LINESTRING : case CIRCULARSTRING : LineString lineString = ( LineString ) geometry ; Path linePath = new Path ( ) ; addLineString ( simplifyTolerance , boundingBox , transform , linePath , lineString ) ; drawn = drawLinePath ( canvas , linePath , featureStyle ) ; break ; case POLYGON : case TRIANGLE : Polygon polygon = ( Polygon ) geometry ; Path polygonPath = new Path ( ) ; addPolygon ( simplifyTolerance , boundingBox , transform , polygonPath , polygon ) ; drawn = drawPolygonPath ( canvas , polygonPath , featureStyle ) ; break ; case MULTIPOINT : MultiPoint multiPoint = ( MultiPoint ) geometry ; for ( Point pointFromMulti : multiPoint . getPoints ( ) ) { drawn = drawPoint ( boundingBox , transform , canvas , pointFromMulti , featureStyle ) || drawn ; } break ; case MULTILINESTRING : MultiLineString multiLineString = ( MultiLineString ) geometry ; Path multiLinePath = new Path ( ) ; for ( LineString lineStringFromMulti : multiLineString . getLineStrings ( ) ) { addLineString ( simplifyTolerance , boundingBox , transform , multiLinePath , lineStringFromMulti ) ; } drawn = drawLinePath ( canvas , multiLinePath , featureStyle ) ; break ; case MULTIPOLYGON : MultiPolygon multiPolygon = ( MultiPolygon ) geometry ; Path multiPolygonPath = new Path ( ) ; for ( Polygon polygonFromMulti : multiPolygon . getPolygons ( ) ) { addPolygon ( simplifyTolerance , boundingBox , transform , multiPolygonPath , polygonFromMulti ) ; } drawn = drawPolygonPath ( canvas , multiPolygonPath , featureStyle ) ; break ; case COMPOUNDCURVE : CompoundCurve compoundCurve = ( CompoundCurve ) geometry ; Path compoundCurvePath = new Path ( ) ; for ( LineString lineStringFromCompoundCurve : compoundCurve . getLineStrings ( ) ) { addLineString ( simplifyTolerance , boundingBox , transform , compoundCurvePath , lineStringFromCompoundCurve ) ; } drawn = drawLinePath ( canvas , compoundCurvePath , featureStyle ) ; break ; case POLYHEDRALSURFACE : case TIN : PolyhedralSurface polyhedralSurface = ( PolyhedralSurface ) geometry ; Path polyhedralSurfacePath = new Path ( ) ; for ( Polygon polygonFromPolyhedralSurface : polyhedralSurface . getPolygons ( ) ) { addPolygon ( simplifyTolerance , boundingBox , transform , polyhedralSurfacePath , polygonFromPolyhedralSurface ) ; } drawn = drawPolygonPath ( canvas , polyhedralSurfacePath , featureStyle ) ; break ; case GEOMETRYCOLLECTION : @ SuppressWarnings ( "unchecked" ) GeometryCollection < Geometry > geometryCollection = ( GeometryCollection ) geometry ; List < Geometry > geometries = geometryCollection . getGeometries ( ) ; for ( Geometry geometryFromCollection : geometries ) { drawn = drawShape ( simplifyTolerance , boundingBox , transform , canvas , featureRow , geometryFromCollection ) || drawn ; } break ; default : throw new GeoPackageException ( "Unsupported Geometry Type: " + geometry . getGeometryType ( ) . getName ( ) ) ; } return drawn ;


signature:
public class DefaultFeatureTiles { /** * Draw the line path on the canvas
 * @ param canvas canvas
 * @ param path path
 * @ param featureStyle feature style
 * @ return true if drawn */
private boolean drawLinePath ( FeatureTileCanvas canvas , Path path , FeatureStyle featureStyle ) { } }

implementation: Canvas lineCanvas = canvas . getLineCanvas ( ) ; Paint pathPaint = getLinePaint ( featureStyle ) ; lineCanvas . drawPath ( path , pathPaint ) ; return true ;


signature:
public class DefaultFeatureTiles { /** * Draw the path on the canvas
 * @ param canvas canvas
 * @ param path path
 * @ param featureStyle feature style */
private boolean drawPolygonPath ( FeatureTileCanvas canvas , Path path , FeatureStyle featureStyle ) { } }

implementation: Canvas polygonCanvas = canvas . getPolygonCanvas ( ) ; Paint fillPaint = getPolygonFillPaint ( featureStyle ) ; if ( fillPaint != null ) { path . setFillType ( Path . FillType . EVEN_ODD ) ; polygonCanvas . drawPath ( path , fillPaint ) ; } Paint pathPaint = getPolygonPaint ( featureStyle ) ; polygonCanvas . drawPath ( path , pathPaint ) ; return true ;


signature:
public class DefaultFeatureTiles { /** * Add the linestring to the path
 * @ param simplifyTolerance simplify tolerance in meters
 * @ param boundingBox bounding box
 * @ param transform projection transform
 * @ param path path
 * @ param lineString line string */
private void addLineString ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , Path path , LineString lineString ) { } }

implementation:
List < Point > points = lineString . getPoints ( ) ; if ( points . size ( ) >= 2 ) { // Try to simplify the number of points in the LineString
points = simplifyPoints ( simplifyTolerance , points ) ; for ( int i = 0 ; i < points . size ( ) ; i ++ ) { Point point = points . get ( i ) ; Point webMercatorPoint = transform . transform ( point ) ; float x = TileBoundingBoxUtils . getXPixel ( tileWidth , boundingBox , webMercatorPoint . getX ( ) ) ; float y = TileBoundingBoxUtils . getYPixel ( tileHeight , boundingBox , webMercatorPoint . getY ( ) ) ; if ( i == 0 ) { path . moveTo ( x , y ) ; } else { path . lineTo ( x , y ) ; } } }


signature:
public class DefaultFeatureTiles { /** * Add the polygon on the canvas
 * @ param simplifyTolerance simplify tolerance in meters
 * @ param boundingBox bounding box
 * @ param transform projection transform
 * @ param path path
 * @ param polygon polygon */
private void addPolygon ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , Path path , Polygon polygon ) { } }

implementation:
List < LineString > rings = polygon . getRings ( ) ; if ( ! rings . isEmpty ( ) ) { // Add the polygon points
LineString polygonLineString = rings . get ( 0 ) ; List < Point > polygonPoints = polygonLineString . getPoints ( ) ; if ( polygonPoints . size ( ) >= 2 ) { addRing ( simplifyTolerance , boundingBox , transform , path , polygonPoints ) ; // Add the holes
for ( int i = 1 ; i < rings . size ( ) ; i ++ ) { LineString holeLineString = rings . get ( i ) ; List < Point > holePoints = holeLineString . getPoints ( ) ; if ( holePoints . size ( ) >= 2 ) { addRing ( simplifyTolerance , boundingBox , transform , path , holePoints ) ; } } } }


signature:
public class DefaultFeatureTiles { /** * Draw the point on the canvas
 * @ param boundingBox bounding box
 * @ param transform projection transform
 * @ param canvas draw canvas
 * @ param point point
 * @ param featureStyle feature style
 * @ return true if drawn */
private boolean drawPoint ( BoundingBox boundingBox , ProjectionTransform transform , FeatureTileCanvas canvas , Point point , FeatureStyle featureStyle ) { } }

implementation: boolean drawn = false ; Point webMercatorPoint = transform . transform ( point ) ; float x = TileBoundingBoxUtils . getXPixel ( tileWidth , boundingBox , webMercatorPoint . getX ( ) ) ; float y = TileBoundingBoxUtils . getYPixel ( tileHeight , boundingBox , webMercatorPoint . getY ( ) ) ; if ( featureStyle != null && featureStyle . hasIcon ( ) ) { IconRow iconRow = featureStyle . getIcon ( ) ; Bitmap icon = getIcon ( iconRow ) ; int width = icon . getWidth ( ) ; int height = icon . getHeight ( ) ; if ( x >= 0 - width && x <= tileWidth + width && y >= 0 - height && y <= tileHeight + height ) { float anchorU = ( float ) iconRow . getAnchorUOrDefault ( ) ; float anchorV = ( float ) iconRow . getAnchorVOrDefault ( ) ; float left = x - ( anchorU * width ) ; float right = left + width ; float top = y - ( anchorV * height ) ; float bottom = top + height ; RectF destination = new RectF ( left , top , right , bottom ) ; Canvas iconCanvas = canvas . getIconCanvas ( ) ; iconCanvas . drawBitmap ( icon , null , destination , pointPaint ) ; drawn = true ; } } else if ( pointIcon != null ) { float width = this . density * pointIcon . getWidth ( ) ; float height = this . density * pointIcon . getHeight ( ) ; if ( x >= 0 - width && x <= tileWidth + width && y >= 0 - height && y <= tileHeight + height ) { Canvas iconCanvas = canvas . getIconCanvas ( ) ; float left = x - this . density * pointIcon . getXOffset ( ) ; float top = y - this . density * pointIcon . getYOffset ( ) ; RectF rect = new RectF ( left , top , left + width , top + height ) ; iconCanvas . drawBitmap ( pointIcon . getIcon ( ) , null , rect , pointPaint ) ; drawn = true ; } } else { Float radius = null ; if ( featureStyle != null ) { StyleRow styleRow = featureStyle . getStyle ( ) ; if ( styleRow != null ) { radius = this . density * ( float ) ( styleRow . getWidthOrDefault ( ) / 2.0f ) ; } } if ( radius == null ) { radius = this . density * pointRadius ; } if ( x >= 0 - radius && x <= tileWidth + radius && y >= 0 - radius && y <= tileHeight + radius ) { Paint pointPaint = getPointPaint ( featureStyle ) ; Canvas pointCanvas = canvas . getPointCanvas ( ) ; pointCanvas . drawCircle ( x , y , radius , pointPaint ) ; drawn = true ; } } return drawn ;


signature:
public class FeatureCacheTables { /** * Get or create a feature row cache for the table name
 * @ param tableName feature table name
 * @ return feature row cache */
public FeatureCache getCache ( String tableName ) { } }

implementation: FeatureCache cache = tableCache . get ( tableName ) ; if ( cache == null ) { cache = new FeatureCache ( maxCacheSize ) ; tableCache . put ( tableName , cache ) ; } return cache ;


signature:
public class FeatureCacheTables { /** * Remove the cached feature row
 * @ param featureRow feature row
 * @ return removed feature row or null */
public FeatureRow remove ( FeatureRow featureRow ) { } }

implementation: return remove ( featureRow . getTable ( ) . getTableName ( ) , featureRow . getId ( ) ) ;


signature:
public class FeatureCacheTables { /** * Clear and resize all caches and update the max cache size
 * @ param maxCacheSize max cache size */
public void clearAndResize ( int maxCacheSize ) { } }

implementation: setMaxCacheSize ( maxCacheSize ) ; for ( FeatureCache cache : tableCache . values ( ) ) { cache . clearAndResize ( maxCacheSize ) ; }


signature:
public class FeatureTableStyles { /** * Get the cached table styles , querying and caching if needed
 * @ return cached table styles */
public Styles getCachedTableStyles ( ) { } }

implementation: Styles styles = cachedTableFeatureStyles . getStyles ( ) ; if ( styles == null ) { synchronized ( cachedTableFeatureStyles ) { styles = cachedTableFeatureStyles . getStyles ( ) ; if ( styles == null ) { styles = getTableStyles ( ) ; if ( styles == null ) { styles = new Styles ( ) ; } cachedTableFeatureStyles . setStyles ( styles ) ; } } } if ( styles . isEmpty ( ) ) { styles = null ; } return styles ;


signature:
public class FeatureTableStyles { /** * Get the cached table icons , querying and caching if needed
 * @ return cached table icons */
public Icons getCachedTableIcons ( ) { } }

implementation: Icons icons = cachedTableFeatureStyles . getIcons ( ) ; if ( icons == null ) { synchronized ( cachedTableFeatureStyles ) { icons = cachedTableFeatureStyles . getIcons ( ) ; if ( icons == null ) { icons = getTableIcons ( ) ; if ( icons == null ) { icons = new Icons ( ) ; } cachedTableFeatureStyles . setIcons ( icons ) ; } } } if ( icons . isEmpty ( ) ) { icons = null ; } return icons ;


signature:
public class FeatureTableStyles { /** * Get the feature style ( style and icon ) of the feature row with the
 * provided geometry type , searching in order : feature geometry type style
 * or icon , feature default style or icon , table geometry type style or
 * icon , table default style or icon
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ return feature style */
public FeatureStyle getFeatureStyle ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: return getFeatureStyle ( featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureTableStyles { /** * Get the feature style ( style and icon ) of the feature , searching in
 * order : feature geometry type style or icon , feature default style or
 * icon , table geometry type style or icon , table default style or icon
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ return feature style */
public FeatureStyle getFeatureStyle ( long featureId , GeometryType geometryType ) { } }

implementation: FeatureStyle featureStyle = null ; StyleRow style = getStyle ( featureId , geometryType ) ; IconRow icon = getIcon ( featureId , geometryType ) ; if ( style != null || icon != null ) { featureStyle = new FeatureStyle ( style , icon ) ; } return featureStyle ;


signature:
public class FeatureTableStyles { /** * Get the style of the feature row with the provided geometry type ,
 * searching in order : feature geometry type style , feature default style ,
 * table geometry type style , table default style
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ return style row */
public StyleRow getStyle ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: return getStyle ( featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureTableStyles { /** * Get the style of the feature , searching in order : feature geometry type
 * style , feature default style , table geometry type style , table default
 * style
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ return style row */
public StyleRow getStyle ( long featureId , GeometryType geometryType ) { } }

implementation:
StyleRow styleRow = featureStyleExtension . getStyle ( tableName , featureId , geometryType , false ) ; if ( styleRow == null ) { // Table Style
Styles styles = getCachedTableStyles ( ) ; if ( styles != null ) { styleRow = styles . getStyle ( geometryType ) ; } } return styleRow ;


signature:
public class FeatureTableStyles { /** * Get the icon of the feature row with the provided geometry type ,
 * searching in order : feature geometry type icon , feature default icon ,
 * table geometry type icon , table default icon
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ return icon row */
public IconRow getIcon ( FeatureRow featureRow , GeometryType geometryType ) { } }

implementation: return getIcon ( featureRow . getId ( ) , geometryType ) ;


signature:
public class FeatureTableStyles { /** * Get the icon of the feature , searching in order : feature geometry type
 * icon , feature default icon , table geometry type icon , table default icon
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ return icon row */
public IconRow getIcon ( long featureId , GeometryType geometryType ) { } }

implementation:
IconRow iconRow = featureStyleExtension . getIcon ( tableName , featureId , geometryType , false ) ; if ( iconRow == null ) { // Table Icon
Icons icons = getCachedTableIcons ( ) ; if ( icons != null ) { iconRow = icons . getIcon ( geometryType ) ; } } return iconRow ;


signature:
public class FeatureTableStyles { /** * Set the feature table style for the geometry type
 * @ param geometryType geometry type
 * @ param style style row */
public void setTableStyle ( GeometryType geometryType , StyleRow style ) { } }

implementation: featureStyleExtension . setTableStyle ( tableName , geometryType , style ) ; clearCachedTableStyles ( ) ;


signature:
public class FeatureTableStyles { /** * Set the feature table icon for the geometry type
 * @ param geometryType geometry type
 * @ param icon icon row */
public void setTableIcon ( GeometryType geometryType , IconRow icon ) { } }

implementation: featureStyleExtension . setTableIcon ( tableName , geometryType , icon ) ; clearCachedTableIcons ( ) ;


signature:
public class FeatureTableStyles { /** * Set the feature style ( style and icon ) of the feature row for the
 * specified geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ param featureStyle feature style */
public void setFeatureStyle ( FeatureRow featureRow , GeometryType geometryType , FeatureStyle featureStyle ) { } }

implementation: featureStyleExtension . setFeatureStyle ( featureRow , geometryType , featureStyle ) ;


signature:
public class FeatureTableStyles { /** * Set the feature style ( style and icon ) of the feature
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param featureStyle feature style */
public void setFeatureStyle ( long featureId , GeometryType geometryType , FeatureStyle featureStyle ) { } }

implementation: featureStyleExtension . setFeatureStyle ( tableName , featureId , geometryType , featureStyle ) ;


signature:
public class FeatureTableStyles { /** * Set the style of the feature row for the specified geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ param style style row */
public void setStyle ( FeatureRow featureRow , GeometryType geometryType , StyleRow style ) { } }

implementation: featureStyleExtension . setStyle ( featureRow , geometryType , style ) ;


signature:
public class FeatureTableStyles { /** * Set the style of the feature
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param style style row */
public void setStyle ( long featureId , GeometryType geometryType , StyleRow style ) { } }

implementation: featureStyleExtension . setStyle ( tableName , featureId , geometryType , style ) ;


signature:
public class FeatureTableStyles { /** * Set the icon of the feature row for the specified geometry type
 * @ param featureRow feature row
 * @ param geometryType geometry type
 * @ param icon icon row */
public void setIcon ( FeatureRow featureRow , GeometryType geometryType , IconRow icon ) { } }

implementation: featureStyleExtension . setIcon ( featureRow , geometryType , icon ) ;


signature:
public class FeatureTableStyles { /** * Get the icon of the feature , searching in order : feature geometry type
 * icon , feature default icon , table geometry type icon , table default icon
 * @ param featureId feature id
 * @ param geometryType geometry type
 * @ param icon icon row */
public void setIcon ( long featureId , GeometryType geometryType , IconRow icon ) { } }

implementation: featureStyleExtension . setIcon ( tableName , featureId , geometryType , icon ) ;


signature:
public class TileTableReader { /** * { @ inheritDoc } */
@ Override protected TileTable createTable ( String tableName , List < TileColumn > columnList ) { } }

implementation: return new TileTable ( tableName , columnList ) ;


signature:
public class TileTableReader { /** * { @ inheritDoc } */
@ Override protected TileColumn createColumn ( TileCursor cursor , int index , String name , String type , Long max , boolean notNull , int defaultValueIndex , boolean primaryKey ) { } }

implementation: GeoPackageDataType dataType = getDataType ( type ) ; Object defaultValue = cursor . getValue ( defaultValueIndex , dataType ) ; TileColumn column = new TileColumn ( index , name , dataType , max , notNull , defaultValue , primaryKey ) ; return column ;


signature:
public class RTreeIndexExtension { /** * Get a RTree Index Table DAO for the feature dao
 * @ param featureDao feature DAO
 * @ return RTree Index Table DAO
 * @ since 3.1.0 */
public RTreeIndexTableDao getTableDao ( FeatureDao featureDao ) { } }

implementation: GeoPackageConnection connection = getGeoPackage ( ) . getConnection ( ) ; UserCustomConnection userDb = new UserCustomConnection ( connection ) ; UserCustomTable userCustomTable = getRTreeTable ( featureDao . getTable ( ) ) ; UserCustomDao userCustomDao = new UserCustomDao ( geoPackage . getName ( ) , connection , userDb , userCustomTable ) ; return new RTreeIndexTableDao ( this , userCustomDao , featureDao ) ;


signature:
public class RTreeIndexExtension { /** * { @ inheritDoc } */
@ Override protected void executeSQL ( String sql , boolean trigger ) { } }

implementation: if ( trigger ) { connection . execSQL ( sql ) ; } else { database . execSQL ( sql ) ; }


signature:
public class IconRow { /** * Set the width
 * @ param width Icon display width , when null use actual icon width */
public void setWidth ( Double width ) { } }

implementation: if ( width != null && width < 0.0 ) { throw new GeoPackageException ( "Width must be greater than or equal to 0.0, invalid value: " + width ) ; } setValue ( getWidthColumnIndex ( ) , width ) ;


signature:
public class IconRow { /** * Set the height
 * @ param height Icon display height , when null use actual icon height */
public void setHeight ( Double height ) { } }

implementation: if ( height != null && height < 0.0 ) { throw new GeoPackageException ( "Height must be greater than or equal to 0.0, invalid value: " + height ) ; } setValue ( getHeightColumnIndex ( ) , height ) ;


signature:
public class IconRow { /** * Get the derived width and height from the values and icon data , scaled as
 * needed
 * @ return derived dimensions array with two values , width at index 0 , height at index 1 */
public double [ ] getDerivedDimensions ( ) { } }

implementation: Double width = getWidth ( ) ; Double height = getHeight ( ) ; if ( width == null || height == null ) { BitmapFactory . Options options = getDataBounds ( ) ; int dataWidth = options . outWidth ; int dataHeight = options . outHeight ; if ( width == null ) { width = ( double ) dataWidth ; if ( height != null ) { width *= ( height / dataHeight ) ; } } if ( height == null ) { height = ( double ) dataHeight ; if ( width != null ) { height *= ( width / dataWidth ) ; } } } return new double [ ] { width , height } ;


signature:
public class TileUtils { /** * Get the tile side ( width and height ) dimension based upon the display density scale
 * @ param density display density : { @ link android . util . DisplayMetrics # density }
 * @ return default tile length */
public static int tileLength ( float density ) { } }

implementation: int length ; if ( density < HIGH_DENSITY ) { length = TILE_PIXELS_DEFAULT ; } else { length = TILE_PIXELS_HIGH ; } return length ;


signature:
public class TileUtils { /** * Get the tile density based upon the display density scale and tile dimensions
 * @ param density display density : { @ link android . util . DisplayMetrics # density }
 * @ param tileWidth tile width
 * @ param tileHeight tile height
 * @ return tile density */
public static float tileDensity ( float density , int tileWidth , int tileHeight ) { } }

implementation: return tileDensity ( density , Math . min ( tileWidth , tileHeight ) ) ;


signature:
public class UserInvalidCursor { /** * { @ inheritDoc } */
@ Override public boolean moveToNext ( ) { } }

implementation: boolean hasNext = false ; currentPosition ++ ; if ( currentPosition < invalidPositions . size ( ) ) { int invalidPosition = invalidPositions . get ( currentPosition ) ; hasNext = cursor . moveToPosition ( invalidPosition ) ; } return hasNext ;


signature:
public class UserInvalidCursor { /** * { @ inheritDoc } */
@ Override public TRow getRow ( ) { } }

implementation: TRow row = cursor . getRow ( ) ; if ( row . hasId ( ) ) { for ( UserColumn column : blobColumns ) { readBlobValue ( row , column ) ; } } return row ;


signature:
public class UserInvalidCursor { /** * Read the blob column value in chunks
 * @ param row user row
 * @ param column user blob column */
private void readBlobValue ( UserRow row , UserColumn column ) { } }

implementation: ByteArrayOutputStream byteStream = new ByteArrayOutputStream ( ) ; try { byte [ ] blobChunk = new byte [ ] { 0 } ; for ( int i = 1 ; blobChunk . length > 0 ; i += CHUNK_SIZE ) { if ( i > 1 ) { byteStream . write ( blobChunk ) ; } blobChunk = new byte [ ] { } ; String query = "select substr(" + CoreSQLUtils . quoteWrap ( column . getName ( ) ) + ", " + i + ", " + CHUNK_SIZE + ") from " + CoreSQLUtils . quoteWrap ( dao . getTableName ( ) ) + " where " + CoreSQLUtils . quoteWrap ( row . getPkColumn ( ) . getName ( ) ) + " = " + row . getId ( ) ; Cursor blobCursor = dao . getDatabaseConnection ( ) . getDb ( ) . rawQuery ( query , null ) ; try { if ( blobCursor . moveToNext ( ) ) { blobChunk = blobCursor . getBlob ( 0 ) ; } } finally { blobCursor . close ( ) ; } } byte [ ] blob = byteStream . toByteArray ( ) ; row . setValue ( column . getIndex ( ) , blob ) ; } catch ( IOException e ) { Log . e ( UserInvalidCursor . class . getSimpleName ( ) , "Failed to read large blob value. Table: " + dao . getTableName ( ) + ", Column: " + column . getName ( ) + ", Position: " + getPosition ( ) , e ) ; } finally { IOUtils . closeQuietly ( byteStream ) ; }


signature:
public class UserInvalidCursor { /** * { @ inheritDoc } */
@ Override public TRow getRow ( int [ ] columnTypes , Object [ ] values ) { } }

implementation: return cursor . getRow ( columnTypes , values ) ;


signature:
public class UserInvalidCursor { /** * { @ inheritDoc } */
@ Override public Object getValue ( int index , GeoPackageDataType dataType ) { } }

implementation: return cursor . getValue ( index , dataType ) ;


signature:
public class UserInvalidCursor { /** * { @ inheritDoc } */
@ Override public boolean moveToPosition ( int position ) { } }

implementation: boolean moved = false ; if ( position < invalidPositions . size ( ) ) { currentPosition = position ; int invalidPosition = invalidPositions . get ( currentPosition ) ; moved = cursor . moveToPosition ( invalidPosition ) ; } return moved ;


signature:
public class UserCustomTableReader { /** * { @ inheritDoc } */
@ Override protected UserCustomTable createTable ( String tableName , List < UserCustomColumn > columnList ) { } }

implementation: return new UserCustomTable ( tableName , columnList ) ;


signature:
public class UserCustomTableReader { /** * Read the table
 * @ param connection GeoPackage connection
 * @ param tableName table name
 * @ return table */
public static UserCustomTable readTable ( GeoPackageConnection connection , String tableName ) { } }

implementation: UserCustomTableReader tableReader = new UserCustomTableReader ( tableName ) ; UserCustomTable customTable = tableReader . readTable ( new UserCustomWrapperConnection ( connection ) ) ; return customTable ;


signature:
public class StyleRow { /** * Set the color
 * @ param color color */
public void setColor ( Color color ) { } }

implementation: String hex = null ; Double opacity = null ; if ( color != null ) { hex = color . getColorHexShorthand ( ) ; opacity = new Double ( color . getOpacity ( ) ) ; } setColor ( hex ) ; setOpacity ( opacity ) ;


signature:
public class StyleRow { /** * Get the color or default value
 * @ return color */
public Color getColorOrDefault ( ) { } }

implementation: Color color = getColor ( ) ; if ( color == null ) { color = new Color ( ) ; } return color ;


signature:
public class StyleRow { /** * Set the color
 * @ param color color */
public void setFillColor ( Color color ) { } }

implementation: String hex = null ; Double opacity = null ; if ( color != null ) { hex = color . getColorHexShorthand ( ) ; opacity = new Double ( color . getOpacity ( ) ) ; } setFillColor ( hex ) ; setFillOpacity ( opacity ) ;


signature:
public class StyleRow { /** * Validate and adjust the color value
 * @ param color color */
private String validateColor ( String color ) { } }

implementation: String validated = color ; if ( color != null ) { if ( ! color . startsWith ( "#" ) ) { validated = "#" + color ; } if ( ! colorPattern . matcher ( validated ) . matches ( ) ) { throw new GeoPackageException ( "Color must be in hex format #RRGGBB or #RGB, invalid value: " + color ) ; } validated = validated . toUpperCase ( ) ; } return validated ;


signature:
public class StyleRow { /** * Create a color from the hex color and opacity
 * @ param hexColor hex color
 * @ param opacity opacity
 * @ return color or null */
private Color createColor ( String hexColor , Double opacity ) { } }

implementation: Color color = null ; if ( hexColor != null || opacity != null ) { color = new Color ( ) ; if ( hexColor != null ) { color . setColor ( hexColor ) ; } if ( opacity != null ) { color . setOpacity ( opacity . floatValue ( ) ) ; } } return color ;


signature:
public class GeoPackageFactory { /** * Get a GeoPackage Manager
 * @ param context context
 * @ return GeoPackage manager */
public static GeoPackageManager getManager ( Context context ) { } }

implementation: Thread . currentThread ( ) . setContextClassLoader ( GeoPackageManager . class . getClassLoader ( ) ) ; return new GeoPackageManagerImpl ( context ) ;


signature:
public class FeatureIndexManager { /** * Prioritize the query location order . All types are placed at the front of the query order
 * in the order they are given . Omitting a location leaves it at it ' s current priority location .
 * @ param types feature index types
 * @ since 3.1.0 */
public void prioritizeQueryLocation ( Collection < FeatureIndexType > types ) { } }

implementation: prioritizeQueryLocation ( types . toArray ( new FeatureIndexType [ types . size ( ) ] ) ) ;


signature:
public class FeatureIndexManager { /** * Prioritize the query location order . All types are placed at the front of the query order
 * in the order they are given . Omitting a location leaves it at it ' s current priority location .
 * @ param types feature index types */
public void prioritizeQueryLocation ( FeatureIndexType ... types ) { } }

implementation:
// Create a new query order set
Set < FeatureIndexType > queryOrder = new LinkedHashSet < > ( ) ; for ( FeatureIndexType type : types ) { if ( type != FeatureIndexType . NONE ) { queryOrder . add ( type ) ; } } // Add any locations not provided to this method
queryOrder . addAll ( indexLocationQueryOrder ) ; // Update the query order set
indexLocationQueryOrder = queryOrder ;


signature:
public class FeatureIndexManager { /** * Set the index location order , overriding all previously set types
 * @ param types feature index types
 * @ since 3.1.0 */
public void setIndexLocationOrder ( Collection < FeatureIndexType > types ) { } }

implementation: setIndexLocationOrder ( types . toArray ( new FeatureIndexType [ types . size ( ) ] ) ) ;


signature:
public class FeatureIndexManager { /** * Set the index location order , overriding all previously set types
 * @ param types feature index types
 * @ since 3.1.0 */
public void setIndexLocationOrder ( FeatureIndexType ... types ) { } }

implementation:
// Create a new query order set
Set < FeatureIndexType > queryOrder = new LinkedHashSet < > ( ) ; for ( FeatureIndexType type : types ) { if ( type != FeatureIndexType . NONE ) { queryOrder . add ( type ) ; } } // Update the query order set
indexLocationQueryOrder = queryOrder ;


signature:
public class FeatureIndexManager { /** * Set the GeoPackage Progress
 * @ param progress GeoPackage progress */
public void setProgress ( GeoPackageProgress progress ) { } }

implementation: featureTableIndex . setProgress ( progress ) ; featureIndexer . setProgress ( progress ) ; rTreeIndexTableDao . setProgress ( progress ) ;


signature:
public class FeatureIndexManager { /** * Index the feature tables for the index types
 * @ param force true to force re - indexing
 * @ param types feature index types
 * @ return largest count of indexed features
 * @ since 2.0.0 */
public int index ( boolean force , List < FeatureIndexType > types ) { } }

implementation: int count = 0 ; for ( FeatureIndexType type : types ) { int typeCount = index ( type , force ) ; count = Math . max ( count , typeCount ) ; } return count ;


signature:
public class FeatureIndexManager { /** * Index the feature table
 * @ param type index location type
 * @ param force true to force re - indexing
 * @ return count */
public int index ( FeatureIndexType type , boolean force ) { } }

implementation: if ( type == null ) { throw new GeoPackageException ( "FeatureIndexType is required to index" ) ; } int count = 0 ; switch ( type ) { case GEOPACKAGE : count = featureTableIndex . index ( force ) ; break ; case METADATA : count = featureIndexer . index ( force ) ; break ; case RTREE : boolean rTreeIndexed = rTreeIndexTableDao . has ( ) ; if ( ! rTreeIndexed || force ) { if ( rTreeIndexed ) { rTreeIndexTableDao . delete ( ) ; } rTreeIndexTableDao . create ( ) ; count = rTreeIndexTableDao . count ( ) ; } break ; default : throw new GeoPackageException ( "Unsupported FeatureIndexType: " + type ) ; } return count ;


signature:
public class FeatureIndexManager { /** * Index the feature row for the index types .
 * This method assumes that indexing has been completed and
 * maintained as the last indexed time is updated .
 * @ param row feature row to index
 * @ param types feature index types
 * @ return true if indexed from any type
 * @ since 2.0.0 */
public boolean index ( FeatureRow row , List < FeatureIndexType > types ) { } }

implementation: boolean indexed = false ; for ( FeatureIndexType type : types ) { if ( index ( type , row ) ) { indexed = true ; } } return indexed ;


signature:
public class FeatureIndexManager { /** * Index the feature row . This method assumes that indexing has been completed and
 * maintained as the last indexed time is updated .
 * @ param type index location type
 * @ param row feature row to index
 * @ return true if indexed */
public boolean index ( FeatureIndexType type , FeatureRow row ) { } }

implementation:
boolean indexed = false ; if ( type == null ) { throw new GeoPackageException ( "FeatureIndexType is required to index" ) ; } switch ( type ) { case GEOPACKAGE : indexed = featureTableIndex . index ( row ) ; break ; case METADATA : indexed = featureIndexer . index ( row ) ; break ; case RTREE : // Updated by triggers , ignore for RTree
indexed = true ; break ; default : throw new GeoPackageException ( "Unsupported FeatureIndexType: " + type ) ; } return indexed ;


signature:
public class FeatureIndexManager { /** * Delete the feature index from the index types
 * @ param types feature index types
 * @ return true if deleted from any type
 * @ since 2.0.0 */
public boolean deleteIndex ( Collection < FeatureIndexType > types ) { } }

implementation: boolean deleted = false ; for ( FeatureIndexType type : types ) { if ( deleteIndex ( type ) ) { deleted = true ; } } return deleted ;


signature:
public class FeatureIndexManager { /** * Delete the feature index for the feature row from the index types
 * @ param row feature row
 * @ param types feature index types
 * @ return true if deleted from any type
 * @ since 2.0.0 */
public boolean deleteIndex ( FeatureRow row , List < FeatureIndexType > types ) { } }

implementation: boolean deleted = false ; for ( FeatureIndexType type : types ) { if ( deleteIndex ( type , row ) ) { deleted = true ; } } return deleted ;


signature:
public class FeatureIndexManager { /** * Delete the feature index for the geometry id from the index types
 * @ param geomId geometry id
 * @ param types feature index types
 * @ return true if deleted from any type
 * @ since 2.0.0 */
public boolean deleteIndex ( long geomId , List < FeatureIndexType > types ) { } }

implementation: boolean deleted = false ; for ( FeatureIndexType type : types ) { if ( deleteIndex ( type , geomId ) ) { deleted = true ; } } return deleted ;


signature:
public class FeatureIndexManager { /** * Delete the feature index for the geometry id
 * @ param type feature index type
 * @ param geomId geometry id
 * @ return true if deleted */
public boolean deleteIndex ( FeatureIndexType type , long geomId ) { } }

implementation:
if ( type == null ) { throw new GeoPackageException ( "FeatureIndexType is required to delete index" ) ; } boolean deleted = false ; switch ( type ) { case GEOPACKAGE : deleted = featureTableIndex . deleteIndex ( geomId ) > 0 ; break ; case METADATA : deleted = featureIndexer . deleteIndex ( geomId ) ; break ; case RTREE : // Updated by triggers , ignore for RTree
deleted = true ; break ; default : throw new GeoPackageException ( "Unsupported FeatureIndexType: " + type ) ; } return deleted ;


signature:
public class FeatureIndexManager { /** * Retain the feature index from the index types and delete the others
 * @ param type feature index type to retain
 * @ return true if deleted from any type
 * @ since 3.1.0 */
public boolean retainIndex ( FeatureIndexType type ) { } }

implementation: List < FeatureIndexType > retain = new ArrayList < FeatureIndexType > ( ) ; retain . add ( type ) ; return retainIndex ( retain ) ;


signature:
public class FeatureIndexManager { /** * Retain the feature index from the index types and delete the others
 * @ param types feature index types to retain
 * @ return true if deleted from any type
 * @ since 3.1.0 */
public boolean retainIndex ( Collection < FeatureIndexType > types ) { } }

implementation: Set < FeatureIndexType > delete = new HashSet < > ( indexLocationQueryOrder ) ; delete . removeAll ( types ) ; return deleteIndex ( delete ) ;


signature:
public class FeatureIndexManager { /** * Determine if the feature table is indexed
 * @ return true if indexed */
public boolean isIndexed ( ) { } }

implementation: boolean indexed = false ; for ( FeatureIndexType type : indexLocationQueryOrder ) { indexed = isIndexed ( type ) ; if ( indexed ) { break ; } } return indexed ;


signature:
public class FeatureIndexManager { /** * Get the indexed types that are currently indexed
 * @ return indexed types
 * @ since 2.0.0 */
public List < FeatureIndexType > getIndexedTypes ( ) { } }

implementation: List < FeatureIndexType > indexed = new ArrayList < > ( ) ; for ( FeatureIndexType type : indexLocationQueryOrder ) { if ( isIndexed ( type ) ) { indexed . add ( type ) ; } } return indexed ;


signature:
public class FeatureIndexManager { /** * Get the date last indexed
 * @ return last indexed date or null */
public Date getLastIndexed ( ) { } }

implementation: Date lastIndexed = null ; for ( FeatureIndexType type : indexLocationQueryOrder ) { lastIndexed = getLastIndexed ( type ) ; if ( lastIndexed != null ) { break ; } } return lastIndexed ;


signature:
public class FeatureIndexManager { /** * Query for all feature index results
 * @ return feature index results , close when done */
public FeatureIndexResults query ( ) { } }

implementation: FeatureIndexResults results = null ; switch ( getIndexedType ( ) ) { case GEOPACKAGE : long count = featureTableIndex . count ( ) ; CloseableIterator < GeometryIndex > geometryIndices = featureTableIndex . query ( ) ; results = new FeatureIndexGeoPackageResults ( featureTableIndex , count , geometryIndices ) ; break ; case METADATA : Cursor geometryMetadata = featureIndexer . query ( ) ; results = new FeatureIndexMetadataResults ( featureIndexer , geometryMetadata ) ; break ; case RTREE : UserCustomCursor cursor = rTreeIndexTableDao . queryForAll ( ) ; results = new FeatureIndexRTreeResults ( rTreeIndexTableDao , cursor ) ; break ; default : FeatureCursor featureCursor = featureDao . queryForAll ( ) ; results = new FeatureIndexFeatureResults ( featureCursor ) ; } return results ;


signature:
public class FeatureIndexManager { /** * Query for all feature index count
 * @ return count */
public long count ( ) { } }

implementation: long count = 0 ; switch ( getIndexedType ( ) ) { case GEOPACKAGE : count = featureTableIndex . count ( ) ; break ; case METADATA : count = featureIndexer . count ( ) ; break ; case RTREE : count = rTreeIndexTableDao . count ( ) ; break ; default : count = manualFeatureQuery . countWithGeometries ( ) ; } return count ;


signature:
public class FeatureIndexManager { /** * Query for the feature index bounds
 * @ return bounding box */
public BoundingBox getBoundingBox ( ) { } }

implementation: BoundingBox bounds = null ; switch ( getIndexedType ( ) ) { case GEOPACKAGE : bounds = featureTableIndex . getBoundingBox ( ) ; break ; case METADATA : bounds = featureIndexer . getBoundingBox ( ) ; break ; case RTREE : bounds = rTreeIndexTableDao . getBoundingBox ( ) ; break ; default : bounds = manualFeatureQuery . getBoundingBox ( ) ; } return bounds ;


signature:
public class FeatureIndexManager { /** * Query for feature index results within the bounding box in
 * the provided projection
 * @ param boundingBox bounding box
 * @ param projection projection
 * @ return feature index results , close when done */
public FeatureIndexResults query ( BoundingBox boundingBox , Projection projection ) { } }

implementation: FeatureIndexResults results = null ; switch ( getIndexedType ( ) ) { case GEOPACKAGE : long count = featureTableIndex . count ( boundingBox , projection ) ; CloseableIterator < GeometryIndex > geometryIndices = featureTableIndex . query ( boundingBox , projection ) ; results = new FeatureIndexGeoPackageResults ( featureTableIndex , count , geometryIndices ) ; break ; case METADATA : Cursor geometryMetadata = featureIndexer . query ( boundingBox , projection ) ; results = new FeatureIndexMetadataResults ( featureIndexer , geometryMetadata ) ; break ; case RTREE : UserCustomCursor cursor = rTreeIndexTableDao . query ( boundingBox , projection ) ; results = new FeatureIndexRTreeResults ( rTreeIndexTableDao , cursor ) ; break ; default : results = manualFeatureQuery . query ( boundingBox , projection ) ; } return results ;


signature:
public class FeatureIndexManager { /** * Get the indexed type or throw an error if not indexed */
private FeatureIndexType getIndexedType ( ) { } }

implementation:
FeatureIndexType indexType = FeatureIndexType . NONE ; // Check for an indexed type
for ( FeatureIndexType type : indexLocationQueryOrder ) { if ( isIndexed ( type ) ) { indexType = type ; break ; } } return indexType ;


signature:
public class GeoPackageTileRetriever { /** * { @ inheritDoc } */
@ Override public boolean hasTile ( int x , int y , int zoom ) { } }

implementation:
// Get the bounding box of the requested tile
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils . getWebMercatorBoundingBox ( x , y , zoom ) ; boolean hasTile = tileCreator . hasTile ( webMercatorBoundingBox ) ; return hasTile ;


signature:
public class GeoPackageTileRetriever { /** * { @ inheritDoc } */
@ Override public GeoPackageTile getTile ( int x , int y , int zoom ) { } }

implementation:
// Get the bounding box of the requested tile
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils . getWebMercatorBoundingBox ( x , y , zoom ) ; GeoPackageTile tile = tileCreator . getTile ( webMercatorBoundingBox ) ; return tile ;


signature:
public class ContextIOUtils { /** * Get the internal storage file for the file path
 * @ param context context
 * @ param filePath file path
 * @ return file */
public static File getInternalFile ( Context context , String filePath ) { } }

implementation: File internalFile = null ; if ( filePath != null ) { internalFile = new File ( context . getFilesDir ( ) , filePath ) ; } else { internalFile = context . getFilesDir ( ) ; } return internalFile ;


signature:
public class ContextIOUtils { /** * Get the internal storage patch for the file path
 * @ param context context
 * @ param filePath file path
 * @ return file path */
public static String getInternalFilePath ( Context context , String filePath ) { } }

implementation: return getInternalFile ( context , filePath ) . getAbsolutePath ( ) ;


signature:
public class StyleMappingRow { /** * Get the geometry type
 * @ return geometry type */
public GeometryType getGeometryType ( ) { } }

implementation: GeometryType geometryType = null ; String geometryTypeName = getGeometryTypeName ( ) ; if ( geometryTypeName != null ) { geometryType = GeometryType . fromName ( geometryTypeName ) ; } return geometryType ;


signature:
public class StyleMappingRow { /** * Set the geometry type
 * @ param geometryType geometry type */
public void setGeometryType ( GeometryType geometryType ) { } }

implementation: String geometryTypeName = null ; if ( geometryType != null ) { geometryTypeName = geometryType . getName ( ) ; } setValue ( getGeometryTypeNameColumnIndex ( ) , geometryTypeName ) ;


signature:
public class UrlTileGenerator { /** * Determine if the url has bounding box variables
 * @ param url
 * @ return */
private boolean hasBoundingBox ( String url ) { } }

implementation: String replacedUrl = replaceBoundingBox ( url , boundingBox ) ; boolean hasBoundingBox = ! replacedUrl . equals ( url ) ; return hasBoundingBox ;


signature:
public class UrlTileGenerator { /** * Replace x , y , and z in the url
 * @ param url
 * @ param z
 * @ param x
 * @ param y
 * @ return */
private String replaceXYZ ( String url , int z , long x , long y ) { } }

implementation: url = url . replaceAll ( context . getString ( R . string . tile_generator_variable_z ) , String . valueOf ( z ) ) ; url = url . replaceAll ( context . getString ( R . string . tile_generator_variable_x ) , String . valueOf ( x ) ) ; url = url . replaceAll ( context . getString ( R . string . tile_generator_variable_y ) , String . valueOf ( y ) ) ; return url ;


signature:
public class UrlTileGenerator { /** * Determine if the url has x , y , or z variables
 * @ param url
 * @ return */
private boolean hasXYZ ( String url ) { } }

implementation: String replacedUrl = replaceXYZ ( url , 0 , 0 , 0 ) ; boolean hasXYZ = ! replacedUrl . equals ( url ) ; return hasXYZ ;


signature:
public class UrlTileGenerator { /** * Replace the bounding box coordinates in the url
 * @ param url
 * @ param z
 * @ param x
 * @ param y
 * @ return */
private String replaceBoundingBox ( String url , int z , long x , long y ) { } }

implementation: BoundingBox boundingBox = TileBoundingBoxUtils . getProjectedBoundingBox ( projection , x , y , z ) ; url = replaceBoundingBox ( url , boundingBox ) ; return url ;


signature:
public class UrlTileGenerator { /** * Replace the url parts with the bounding box
 * @ param url
 * @ param boundingBox
 * @ return */
private String replaceBoundingBox ( String url , BoundingBox boundingBox ) { } }

implementation: url = url . replaceAll ( context . getString ( R . string . tile_generator_variable_min_lat ) , String . valueOf ( boundingBox . getMinLatitude ( ) ) ) ; url = url . replaceAll ( context . getString ( R . string . tile_generator_variable_max_lat ) , String . valueOf ( boundingBox . getMaxLatitude ( ) ) ) ; url = url . replaceAll ( context . getString ( R . string . tile_generator_variable_min_lon ) , String . valueOf ( boundingBox . getMinLongitude ( ) ) ) ; url = url . replaceAll ( context . getString ( R . string . tile_generator_variable_max_lon ) , String . valueOf ( boundingBox . getMaxLongitude ( ) ) ) ; return url ;


signature:
public class UrlTileGenerator { /** * { @ inheritDoc } */
@ Override protected byte [ ] createTile ( int z , long x , long y ) { } }

implementation:
byte [ ] bytes = null ; String zoomUrl = tileUrl ; // Replace x , y , and z
if ( urlHasXYZ ) { long yRequest = y ; // If TMS , flip the y value
if ( tms ) { yRequest = TileBoundingBoxUtils . getYAsOppositeTileFormat ( z , ( int ) y ) ; } zoomUrl = replaceXYZ ( zoomUrl , z , x , yRequest ) ; } // Replace bounding box
if ( urlHasBoundingBox ) { zoomUrl = replaceBoundingBox ( zoomUrl , z , x , y ) ; } URL url ; try { url = new URL ( zoomUrl ) ; } catch ( MalformedURLException e ) { throw new GeoPackageException ( "Failed to download tile. URL: " + zoomUrl + ", z=" + z + ", x=" + x + ", y=" + y , e ) ; } HttpURLConnection connection = null ; try { connection = ( HttpURLConnection ) url . openConnection ( ) ; connection . connect ( ) ; int responseCode = connection . getResponseCode ( ) ; if ( responseCode == HttpURLConnection . HTTP_MOVED_PERM || responseCode == HttpURLConnection . HTTP_MOVED_TEMP || responseCode == HttpURLConnection . HTTP_SEE_OTHER ) { String redirect = connection . getHeaderField ( "Location" ) ; connection . disconnect ( ) ; url = new URL ( redirect ) ; connection = ( HttpURLConnection ) url . openConnection ( ) ; connection . connect ( ) ; } if ( connection . getResponseCode ( ) != HttpURLConnection . HTTP_OK ) { throw new GeoPackageException ( "Failed to download tile. URL: " + zoomUrl + ", z=" + z + ", x=" + x + ", y=" + y ) ; } InputStream geoPackageStream = connection . getInputStream ( ) ; bytes = GeoPackageIOUtils . streamBytes ( geoPackageStream ) ; } catch ( IOException e ) { throw new GeoPackageException ( "Failed to download tile. URL: " + zoomUrl + ", z=" + z + ", x=" + x + ", y=" + y , e ) ; } finally { if ( connection != null ) { connection . disconnect ( ) ; } } return bytes ;


signature:
public class FeatureCursor { /** * { @ inheritDoc } */
@ Override public FeatureRow getRow ( int [ ] columnTypes , Object [ ] values ) { } }

implementation: return new FeatureRow ( getTable ( ) , columnTypes , values ) ;


signature:
public class FeatureCursor { /** * { @ inheritDoc }
 * Handles geometries */
@ Override public Object getValue ( FeatureColumn column ) { } }

implementation: Object value ; if ( column . isGeometry ( ) ) { value = getGeometry ( ) ; } else { value = super . getValue ( column ) ; } return value ;


signature:
public class FeatureCursor { /** * Get the geometry
 * @ return geometry data */
public GeoPackageGeometryData getGeometry ( ) { } }

implementation: GeoPackageGeometryData geometry = null ; int columnIndex = getTable ( ) . getGeometryColumnIndex ( ) ; int type = getType ( columnIndex ) ; if ( type != FIELD_TYPE_NULL ) { byte [ ] geometryBytes = getBlob ( columnIndex ) ; if ( geometryBytes != null ) { geometry = new GeoPackageGeometryData ( geometryBytes ) ; } } return geometry ;


signature:
public class FeatureCursor { /** * { @ inheritDoc } */
@ Override protected UserInvalidCursor < FeatureColumn , FeatureTable , FeatureRow , ? extends UserCursor < FeatureColumn , FeatureTable , FeatureRow > , ? extends UserDao < FeatureColumn , FeatureTable , FeatureRow , ? extends UserCursor < FeatureColumn , FeatureTable , FeatureRow > > > createInvalidCursor ( UserDao dao , UserCursor cursor , List < Integer > invalidPositions , List < FeatureColumn > blobColumns ) { } }

implementation: return new FeatureInvalidCursor ( ( FeatureDao ) dao , ( FeatureCursor ) cursor , invalidPositions , blobColumns ) ;


signature:
public class FeatureIndexer { /** * Index the feature row . This method assumes that indexing has been completed and
 * maintained as the last indexed time is updated .
 * @ param row feature row
 * @ return true if indexed */
public boolean index ( FeatureRow row ) { } }

implementation:
long geoPackageId = geometryMetadataDataSource . getGeoPackageId ( featureDao . getDatabase ( ) ) ; boolean indexed = index ( geoPackageId , row , true ) ; // Update the last indexed time
updateLastIndexed ( db , geoPackageId ) ; return indexed ;


signature:
public class FeatureIndexer { /** * Index the feature table
 * @ return count */
private int indexTable ( ) { } }

implementation:
int count = 0 ; // Get or create the table metadata
TableMetadataDataSource tableDs = new TableMetadataDataSource ( db ) ; TableMetadata metadata = tableDs . getOrCreate ( featureDao . getDatabase ( ) , featureDao . getTableName ( ) ) ; // Delete existing index rows
geometryMetadataDataSource . delete ( featureDao . getDatabase ( ) , featureDao . getTableName ( ) ) ; long offset = 0 ; int chunkCount = 0 ; // Index all features
while ( chunkCount >= 0 ) { FeatureCursor cursor = featureDao . queryForChunk ( chunkLimit , offset ) ; chunkCount = indexRows ( metadata . getGeoPackageId ( ) , cursor ) ; if ( chunkCount > 0 ) { count += chunkCount ; } offset += chunkLimit ; } // Update the last indexed time
if ( progress == null || progress . isActive ( ) ) { updateLastIndexed ( db , metadata . getGeoPackageId ( ) ) ; } return count ;