idx
int64 0
41.2k
| question
stringlengths 74
4.21k
| target
stringlengths 5
888
|
|---|---|---|
1,700
|
public Extensions queryByExtension ( String extensionName , String tableName , String columnName ) throws SQLException { QueryBuilder < Extensions , Void > qb = queryBuilder ( ) ; setUniqueWhere ( qb . where ( ) , extensionName , true , tableName , true , columnName ) ; List < Extensions > extensions = qb . query ( ) ; Extensions extension = null ; if ( extensions . size ( ) > 1 ) { throw new GeoPackageException ( "More than one " + Extensions . class . getSimpleName ( ) + " existed for unique combination of Extension Name: " + extensionName + ", Table Name: " + tableName + ", Column Name: " + columnName ) ; } else if ( extensions . size ( ) == 1 ) { extension = extensions . get ( 0 ) ; } return extension ; }
|
Query by extension name table name and column name
|
1,701
|
public static void deleteTableExtensions ( GeoPackageCore geoPackage , String table ) { deleteGeometryIndex ( geoPackage , table ) ; deleteFeatureTileLink ( geoPackage , table ) ; deleteTileScaling ( geoPackage , table ) ; deleteProperties ( geoPackage , table ) ; deleteFeatureStyle ( geoPackage , table ) ; deleteContentsId ( geoPackage , table ) ; }
|
Delete all NGA table extensions for the table within the GeoPackage
|
1,702
|
public static void deleteExtensions ( GeoPackageCore geoPackage ) { deleteGeometryIndexExtension ( geoPackage ) ; deleteFeatureTileLinkExtension ( geoPackage ) ; deleteTileScalingExtension ( geoPackage ) ; deletePropertiesExtension ( geoPackage ) ; deleteFeatureStyleExtension ( geoPackage ) ; deleteContentsIdExtension ( geoPackage ) ; }
|
Delete all NGA extensions including custom extension tables for the GeoPackage
|
1,703
|
public static void deleteGeometryIndex ( GeoPackageCore geoPackage , String table ) { TableIndexDao tableIndexDao = geoPackage . getTableIndexDao ( ) ; ExtensionsDao extensionsDao = geoPackage . getExtensionsDao ( ) ; try { if ( tableIndexDao . isTableExists ( ) ) { tableIndexDao . deleteByIdCascade ( table ) ; } if ( extensionsDao . isTableExists ( ) ) { extensionsDao . deleteByExtension ( FeatureTableCoreIndex . EXTENSION_NAME , table ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete Table Index. GeoPackage: " + geoPackage . getName ( ) + ", Table: " + table , e ) ; } }
|
Delete the Geometry Index extension for the table
|
1,704
|
public static void deleteGeometryIndexExtension ( GeoPackageCore geoPackage ) { GeometryIndexDao geometryIndexDao = geoPackage . getGeometryIndexDao ( ) ; TableIndexDao tableIndexDao = geoPackage . getTableIndexDao ( ) ; ExtensionsDao extensionsDao = geoPackage . getExtensionsDao ( ) ; try { if ( geometryIndexDao . isTableExists ( ) ) { geoPackage . dropTable ( geometryIndexDao . getTableName ( ) ) ; } if ( tableIndexDao . isTableExists ( ) ) { geoPackage . dropTable ( tableIndexDao . getTableName ( ) ) ; } if ( extensionsDao . isTableExists ( ) ) { extensionsDao . deleteByExtension ( FeatureTableCoreIndex . EXTENSION_NAME ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete Table Index extension and tables. GeoPackage: " + geoPackage . getName ( ) , e ) ; } }
|
Delete the Geometry Index extension including the extension entries and custom tables
|
1,705
|
public static void deleteFeatureTileLink ( GeoPackageCore geoPackage , String table ) { FeatureTileLinkDao featureTileLinkDao = geoPackage . getFeatureTileLinkDao ( ) ; try { if ( featureTileLinkDao . isTableExists ( ) ) { featureTileLinkDao . deleteByTableName ( table ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete Feature Tile Link. GeoPackage: " + geoPackage . getName ( ) + ", Table: " + table , e ) ; } }
|
Delete the Feature Tile Link extensions for the table
|
1,706
|
public static void deleteFeatureTileLinkExtension ( GeoPackageCore geoPackage ) { FeatureTileLinkDao featureTileLinkDao = geoPackage . getFeatureTileLinkDao ( ) ; ExtensionsDao extensionsDao = geoPackage . getExtensionsDao ( ) ; try { if ( featureTileLinkDao . isTableExists ( ) ) { geoPackage . dropTable ( featureTileLinkDao . getTableName ( ) ) ; } if ( extensionsDao . isTableExists ( ) ) { extensionsDao . deleteByExtension ( FeatureTileTableCoreLinker . EXTENSION_NAME ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete Feature Tile Link extension and table. GeoPackage: " + geoPackage . getName ( ) , e ) ; } }
|
Delete the Feature Tile Link extension including the extension entries and custom tables
|
1,707
|
public static void deleteTileScaling ( GeoPackageCore geoPackage , String table ) { TileScalingDao tileScalingDao = geoPackage . getTileScalingDao ( ) ; ExtensionsDao extensionsDao = geoPackage . getExtensionsDao ( ) ; try { if ( tileScalingDao . isTableExists ( ) ) { tileScalingDao . deleteById ( table ) ; } if ( extensionsDao . isTableExists ( ) ) { extensionsDao . deleteByExtension ( TileTableScaling . EXTENSION_NAME , table ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete Tile Scaling. GeoPackage: " + geoPackage . getName ( ) + ", Table: " + table , e ) ; } }
|
Delete the Tile Scaling extensions for the table
|
1,708
|
public static void deleteTileScalingExtension ( GeoPackageCore geoPackage ) { TileScalingDao tileScalingDao = geoPackage . getTileScalingDao ( ) ; ExtensionsDao extensionsDao = geoPackage . getExtensionsDao ( ) ; try { if ( tileScalingDao . isTableExists ( ) ) { geoPackage . dropTable ( tileScalingDao . getTableName ( ) ) ; } if ( extensionsDao . isTableExists ( ) ) { extensionsDao . deleteByExtension ( TileTableScaling . EXTENSION_NAME ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete Tile Scaling extension and table. GeoPackage: " + geoPackage . getName ( ) , e ) ; } }
|
Delete the Tile Scaling extension including the extension entries and custom tables
|
1,709
|
public static void deleteProperties ( GeoPackageCore geoPackage , String table ) { if ( table . equalsIgnoreCase ( PropertiesCoreExtension . TABLE_NAME ) ) { deletePropertiesExtension ( geoPackage ) ; } }
|
Delete the Properties extension if the deleted table is the properties table
|
1,710
|
public static void deletePropertiesExtension ( GeoPackageCore geoPackage ) { ExtensionsDao extensionsDao = geoPackage . getExtensionsDao ( ) ; if ( geoPackage . isTable ( PropertiesCoreExtension . TABLE_NAME ) ) { ContentsDao contentsDao = geoPackage . getContentsDao ( ) ; contentsDao . deleteTable ( PropertiesCoreExtension . TABLE_NAME ) ; } try { if ( extensionsDao . isTableExists ( ) ) { extensionsDao . deleteByExtension ( PropertiesCoreExtension . EXTENSION_NAME , PropertiesCoreExtension . TABLE_NAME ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete Properties extension. GeoPackage: " + geoPackage . getName ( ) , e ) ; } }
|
Delete the properties extension from the GeoPackage
|
1,711
|
public static void deleteFeatureStyle ( GeoPackageCore geoPackage , String table ) { FeatureCoreStyleExtension featureStyleExtension = getFeatureStyleExtension ( geoPackage ) ; if ( featureStyleExtension . has ( table ) ) { featureStyleExtension . deleteRelationships ( table ) ; } }
|
Delete the Feature Style extensions for the table
|
1,712
|
public static void deleteFeatureStyleExtension ( GeoPackageCore geoPackage ) { FeatureCoreStyleExtension featureStyleExtension = getFeatureStyleExtension ( geoPackage ) ; if ( featureStyleExtension . has ( ) ) { featureStyleExtension . removeExtension ( ) ; } }
|
Delete the Feature Style extension including the extension entries and custom tables
|
1,713
|
private static FeatureCoreStyleExtension getFeatureStyleExtension ( GeoPackageCore geoPackage ) { RelatedTablesCoreExtension relatedTables = new RelatedTablesCoreExtension ( geoPackage ) { public String getPrimaryKeyColumnName ( String tableName ) { return null ; } } ; return new FeatureCoreStyleExtension ( geoPackage , relatedTables ) { } ; }
|
Get a Feature Style Extension used only for deletions
|
1,714
|
public static void deleteContentsId ( GeoPackageCore geoPackage , String table ) { ContentsIdExtension contentsIdExtension = new ContentsIdExtension ( geoPackage ) ; if ( contentsIdExtension . has ( ) ) { contentsIdExtension . delete ( table ) ; } }
|
Delete the Contents Id extensions for the table
|
1,715
|
public static void deleteContentsIdExtension ( GeoPackageCore geoPackage ) { ContentsIdExtension contentsIdExtension = new ContentsIdExtension ( geoPackage ) ; if ( contentsIdExtension . has ( ) ) { contentsIdExtension . removeExtension ( ) ; } }
|
Delete the Contents Id extension including the extension entries and custom tables
|
1,716
|
public static GeometryEnvelope buildEnvelope ( BoundingBox boundingBox ) { GeometryEnvelope envelope = new GeometryEnvelope ( ) ; envelope . setMinX ( boundingBox . getMinLongitude ( ) ) ; envelope . setMaxX ( boundingBox . getMaxLongitude ( ) ) ; envelope . setMinY ( boundingBox . getMinLatitude ( ) ) ; envelope . setMaxY ( boundingBox . getMaxLatitude ( ) ) ; return envelope ; }
|
Build a Geometry Envelope from the bounding box
|
1,717
|
public BoundingBox complementary ( double maxProjectionLongitude ) { BoundingBox complementary = null ; Double adjust = null ; if ( this . maxLongitude > maxProjectionLongitude ) { if ( this . minLongitude >= - maxProjectionLongitude ) { adjust = - 2 * maxProjectionLongitude ; } } else if ( this . minLongitude < - maxProjectionLongitude ) { if ( this . maxLongitude <= maxProjectionLongitude ) { adjust = 2 * maxProjectionLongitude ; } } if ( adjust != null ) { complementary = new BoundingBox ( this ) ; complementary . setMinLongitude ( complementary . getMinLongitude ( ) + adjust ) ; complementary . setMaxLongitude ( complementary . getMaxLongitude ( ) + adjust ) ; } return complementary ; }
|
If the bounding box spans the Anti - Meridian attempt to get a complementary bounding box using the max longitude of the unit projection
|
1,718
|
public BoundingBox boundCoordinates ( double maxProjectionLongitude ) { BoundingBox bounded = new BoundingBox ( this ) ; double minLongitude = ( getMinLongitude ( ) + maxProjectionLongitude ) % ( 2 * maxProjectionLongitude ) - maxProjectionLongitude ; double maxLongitude = ( getMaxLongitude ( ) + maxProjectionLongitude ) % ( 2 * maxProjectionLongitude ) - maxProjectionLongitude ; bounded . setMinLongitude ( minLongitude ) ; bounded . setMaxLongitude ( maxLongitude ) ; return bounded ; }
|
Bound the bounding box longitudes within the min and max possible projection values . This may result in a max longitude numerically lower than the min longitude .
|
1,719
|
public BoundingBox expandCoordinates ( double maxProjectionLongitude ) { BoundingBox expanded = new BoundingBox ( this ) ; double minLongitude = getMinLongitude ( ) ; double maxLongitude = getMaxLongitude ( ) ; if ( minLongitude > maxLongitude ) { int worldWraps = 1 + ( int ) ( ( minLongitude - maxLongitude ) / ( 2 * maxProjectionLongitude ) ) ; maxLongitude += ( worldWraps * 2 * maxProjectionLongitude ) ; expanded . setMaxLongitude ( maxLongitude ) ; } return expanded ; }
|
Expand the bounding box max longitude above the max possible projection value if needed to create a bounding box where the max longitude is numerically larger than the min longitude .
|
1,720
|
public BoundingBox transform ( ProjectionTransform transform ) { BoundingBox transformed = this ; if ( transform . isSameProjection ( ) ) { transformed = new BoundingBox ( transformed ) ; } else { if ( transform . getFromProjection ( ) . isUnit ( Units . DEGREES ) ) { transformed = TileBoundingBoxUtils . boundDegreesBoundingBoxWithWebMercatorLimits ( transformed ) ; } GeometryEnvelope envelope = buildEnvelope ( transformed ) ; GeometryEnvelope transformedEnvelope = transform . transform ( envelope ) ; transformed = new BoundingBox ( transformedEnvelope ) ; } return transformed ; }
|
Transform the bounding box using the provided projection transform
|
1,721
|
public BoundingBox overlap ( BoundingBox boundingBox , boolean allowEmpty ) { double minLongitude = Math . max ( getMinLongitude ( ) , boundingBox . getMinLongitude ( ) ) ; double maxLongitude = Math . min ( getMaxLongitude ( ) , boundingBox . getMaxLongitude ( ) ) ; double minLatitude = Math . max ( getMinLatitude ( ) , boundingBox . getMinLatitude ( ) ) ; double maxLatitude = Math . min ( getMaxLatitude ( ) , boundingBox . getMaxLatitude ( ) ) ; BoundingBox overlap = null ; if ( ( minLongitude < maxLongitude && minLatitude < maxLatitude ) || ( allowEmpty && minLongitude <= maxLongitude && minLatitude <= maxLatitude ) ) { overlap = new BoundingBox ( minLongitude , minLatitude , maxLongitude , maxLatitude ) ; } return overlap ; }
|
Get the overlapping bounding box with the provided bounding box
|
1,722
|
public boolean contains ( BoundingBox boundingBox ) { return getMinLongitude ( ) <= boundingBox . getMinLongitude ( ) && getMaxLongitude ( ) >= boundingBox . getMaxLongitude ( ) && getMinLatitude ( ) <= boundingBox . getMinLatitude ( ) && getMaxLatitude ( ) >= boundingBox . getMaxLatitude ( ) ; }
|
Determine if inclusively contains the provided bounding box
|
1,723
|
public void setTableIndex ( TableIndex tableIndex ) { this . tableIndex = tableIndex ; if ( tableIndex != null ) { tableName = tableIndex . getTableName ( ) ; } else { tableName = null ; } }
|
Set the table index
|
1,724
|
public BoundingBox projectBoundingBox ( BoundingBox boundingBox , Projection projection ) { ProjectionTransform projectionTransform = projection . getTransformation ( getProjection ( ) ) ; BoundingBox projectedBoundingBox = boundingBox . transform ( projectionTransform ) ; return projectedBoundingBox ; }
|
Project the provided bounding box in the declared projection to the user DAO projection
|
1,725
|
public TResult queryForAll ( ) { TResult result = userDb . query ( getTableName ( ) , table . getColumnNames ( ) , null , null , null , null , null ) ; prepareResult ( result ) ; return result ; }
|
Query for all rows
|
1,726
|
public TResult queryForChunk ( int limit , long offset ) { return queryForChunk ( table . getPkColumn ( ) . getName ( ) , limit , offset ) ; }
|
Query for id ordered rows starting at the offset and returning no more than the limit .
|
1,727
|
public TResult queryForChunk ( String orderBy , int limit , long offset ) { return query ( null , null , null , null , orderBy , buildLimit ( limit , offset ) ) ; }
|
Query for ordered rows starting at the offset and returning no more than the limit .
|
1,728
|
public int delete ( TRow row ) { int numDeleted ; if ( row . hasId ( ) ) { numDeleted = deleteById ( row . getId ( ) ) ; } else { numDeleted = delete ( buildValueWhere ( row . getAsMap ( ) ) , buildWhereArgs ( row . getValues ( ) ) ) ; } return numDeleted ; }
|
Delete the row
|
1,729
|
public int delete ( String whereClause , String [ ] whereArgs ) { return db . delete ( getTableName ( ) , whereClause , whereArgs ) ; }
|
Delete rows matching the where clause
|
1,730
|
public int delete ( Map < String , Object > fieldValues ) { String whereClause = buildWhere ( fieldValues . entrySet ( ) ) ; String [ ] whereArgs = buildWhereArgs ( fieldValues . values ( ) ) ; return delete ( whereClause , whereArgs ) ; }
|
Delete rows matching the field values
|
1,731
|
public int count ( String where , String [ ] args ) { return db . count ( getTableName ( ) , where , args ) ; }
|
Get the count
|
1,732
|
public Integer min ( String column , String where , String [ ] args ) { return db . min ( getTableName ( ) , column , where , args ) ; }
|
Get the min result of the column
|
1,733
|
public Integer max ( String column , String where , String [ ] args ) { return db . max ( getTableName ( ) , column , where , args ) ; }
|
Get the max result of the column
|
1,734
|
public < T > T querySingleTypedResult ( String sql , String [ ] args , int column ) { return db . querySingleTypedResult ( sql , args , column ) ; }
|
Query the SQL for a single result typed object
|
1,735
|
public < T > T querySingleTypedResult ( String sql , String [ ] args , int column , GeoPackageDataType dataType ) { return db . querySingleTypedResult ( sql , args , column , dataType ) ; }
|
Query the SQL for a single result typed object with the expected data type
|
1,736
|
public List < Object > querySingleColumnResults ( String sql , String [ ] args , int column ) { return db . querySingleColumnResults ( sql , args , column ) ; }
|
Query for values from a single column
|
1,737
|
public < T > List < T > querySingleColumnTypedResults ( String sql , String [ ] args , int column ) { return db . querySingleColumnTypedResults ( sql , args , column ) ; }
|
Query for typed values from a single column
|
1,738
|
public int getZoomLevel ( ) { Projection projection = getProjection ( ) ; if ( projection == null ) { throw new GeoPackageException ( "No projection was set which is required to determine the zoom level" ) ; } int zoomLevel = 0 ; BoundingBox boundingBox = getBoundingBox ( ) ; if ( boundingBox != null ) { if ( projection . isUnit ( Units . DEGREES ) ) { boundingBox = TileBoundingBoxUtils . boundDegreesBoundingBoxWithWebMercatorLimits ( boundingBox ) ; } ProjectionTransform webMercatorTransform = projection . getTransformation ( ProjectionConstants . EPSG_WEB_MERCATOR ) ; BoundingBox webMercatorBoundingBox = boundingBox . transform ( webMercatorTransform ) ; zoomLevel = TileBoundingBoxUtils . getZoomLevel ( webMercatorBoundingBox ) ; } return zoomLevel ; }
|
Get the approximate zoom level of where the bounding box of the user data fits into the world
|
1,739
|
public String [ ] buildColumnsAs ( Map < String , String > columns ) { String [ ] columnNames = table . getColumnNames ( ) ; String [ ] columnsAs = new String [ columnNames . length ] ; for ( int i = 0 ; i < columnNames . length ; i ++ ) { String column = columnNames [ i ] ; columnsAs [ i ] = columns . get ( column ) ; } return columnsAs ; }
|
Build columns as values for the table column to value mapping
|
1,740
|
private String [ ] buildColumnsArray ( List < TColumn > columns ) { String [ ] columnsArray = new String [ columns . size ( ) ] ; for ( int i = 0 ; i < columns . size ( ) ; i ++ ) { TColumn column = columns . get ( i ) ; columnsArray [ i ] = column . getName ( ) ; } return columnsArray ; }
|
Build a columns name array from the list of columns
|
1,741
|
private String [ ] getValueToleranceRange ( ColumnValue value ) { double doubleValue = ( ( Number ) value . getValue ( ) ) . doubleValue ( ) ; double tolerance = value . getTolerance ( ) ; return new String [ ] { Double . toString ( doubleValue - tolerance ) , Double . toString ( doubleValue + tolerance ) } ; }
|
Get the value tolerance range min and max values
|
1,742
|
public DataColumns getDataColumn ( String tableName , String columnName ) throws SQLException { TableColumnKey id = new TableColumnKey ( tableName , columnName ) ; return queryForId ( id ) ; }
|
Get DataColumn by column name and table name
|
1,743
|
public int deleteCascade ( DataColumnConstraints constraints ) throws SQLException { int count = 0 ; if ( constraints != null ) { List < DataColumnConstraints > remainingConstraints = queryByConstraintName ( constraints . getConstraintName ( ) ) ; if ( remainingConstraints . size ( ) == 1 ) { DataColumnConstraints remainingConstraint = remainingConstraints . get ( 0 ) ; if ( remainingConstraint . getConstraintName ( ) . equals ( constraints . getConstraintName ( ) ) && remainingConstraint . getConstraintType ( ) . equals ( constraints . getConstraintType ( ) ) && ( remainingConstraint . getValue ( ) == null ? constraints . getValue ( ) == null : remainingConstraint . getValue ( ) . equals ( constraints . getValue ( ) ) ) ) { DataColumnsDao dao = getDataColumnsDao ( ) ; List < DataColumns > dataColumnsCollection = dao . queryByConstraintName ( constraints . getConstraintName ( ) ) ; if ( ! dataColumnsCollection . isEmpty ( ) ) { dao . delete ( dataColumnsCollection ) ; } } } count = delete ( constraints ) ; } return count ; }
|
Delete the Data Columns Constraints cascading
|
1,744
|
public int deleteCascade ( Collection < DataColumnConstraints > constraintsCollection ) throws SQLException { int count = 0 ; if ( constraintsCollection != null ) { for ( DataColumnConstraints constraints : constraintsCollection ) { count += deleteCascade ( constraints ) ; } } return count ; }
|
Delete the collection of Data Column Constraints cascading
|
1,745
|
public int deleteCascade ( PreparedQuery < DataColumnConstraints > preparedDelete ) throws SQLException { int count = 0 ; if ( preparedDelete != null ) { List < DataColumnConstraints > constraintsList = query ( preparedDelete ) ; count = deleteCascade ( constraintsList ) ; } return count ; }
|
Delete the Data Column Constraints matching the prepared query cascading
|
1,746
|
private DataColumnsDao getDataColumnsDao ( ) throws SQLException { if ( dataColumnsDao == null ) { dataColumnsDao = DaoManager . createDao ( connectionSource , DataColumns . class ) ; } return dataColumnsDao ; }
|
Get or create a Data Columns DAO
|
1,747
|
public DataColumnConstraints queryByUnique ( String constraintName , DataColumnConstraintType constraintType , String value ) throws SQLException { DataColumnConstraints constraint = null ; QueryBuilder < DataColumnConstraints , Void > qb = queryBuilder ( ) ; setUniqueWhere ( qb . where ( ) , constraintName , constraintType , value ) ; List < DataColumnConstraints > constraints = qb . query ( ) ; if ( ! constraints . isEmpty ( ) ) { if ( constraints . size ( ) > 1 ) { throw new GeoPackageException ( "More than one " + DataColumnConstraints . class . getSimpleName ( ) + " was found for unique constraint. Name: " + constraintName + ", Type: " + constraintType + ", Value: " + value ) ; } constraint = constraints . get ( 0 ) ; } return constraint ; }
|
Query by the unique column values
|
1,748
|
public void setTileMatrixSet ( TileMatrixSet tileMatrixSet ) { this . tileMatrixSet = tileMatrixSet ; if ( tileMatrixSet != null ) { tileMatrixSetName = tileMatrixSet . getTableName ( ) ; } else { tileMatrixSetName = null ; } }
|
Set the tile matrix set
|
1,749
|
public static UserCustomColumn createPrimaryKeyColumn ( int index , String name ) { return new UserCustomColumn ( index , name , GeoPackageDataType . INTEGER , null , true , null , true ) ; }
|
Create a new primary key column
|
1,750
|
public TileScaling get ( ) { TileScaling tileScaling = null ; if ( has ( ) ) { try { tileScaling = tileScalingDao . queryForId ( tableName ) ; } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to query for tile scaling for GeoPackage: " + geoPackage . getName ( ) + ", Tile Table: " + tableName , e ) ; } } return tileScaling ; }
|
Get the tile scaling
|
1,751
|
public boolean createOrUpdate ( TileScaling tileScaling ) { boolean success = false ; tileScaling . setTableName ( tableName ) ; getOrCreateExtension ( ) ; try { if ( ! tileScalingDao . isTableExists ( ) ) { geoPackage . createTileScalingTable ( ) ; } CreateOrUpdateStatus status = tileScalingDao . createOrUpdate ( tileScaling ) ; success = status . isCreated ( ) || status . isUpdated ( ) ; } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to create or update tile scaling for GeoPackage: " + geoPackage . getName ( ) + ", Tile Table: " + tableName , e ) ; } return success ; }
|
Create or update the tile scaling
|
1,752
|
public boolean delete ( ) { boolean deleted = false ; ExtensionsDao extensionsDao = geoPackage . getExtensionsDao ( ) ; try { if ( tileScalingDao . isTableExists ( ) ) { deleted = tileScalingDao . deleteById ( tableName ) > 0 ; } if ( extensionsDao . isTableExists ( ) ) { deleted = extensionsDao . deleteByExtension ( EXTENSION_NAME , tableName ) > 0 || deleted ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to delete tile table scaling for GeoPackage: " + geoPackage . getName ( ) + ", Table: " + tableName , e ) ; } return deleted ; }
|
Delete the tile table scaling for the tile table
|
1,753
|
public List < String > getBaseTables ( ) throws SQLException { List < String > baseTables = new ArrayList < String > ( ) ; List < ExtendedRelation > extendedRelations = queryForAll ( ) ; for ( ExtendedRelation extendedRelation : extendedRelations ) { baseTables . add ( extendedRelation . getBaseTableName ( ) ) ; } return baseTables ; }
|
Get all the base table names
|
1,754
|
public List < String > getRelatedTables ( ) throws SQLException { List < String > relatedTables = new ArrayList < String > ( ) ; List < ExtendedRelation > extendedRelations = queryForAll ( ) ; for ( ExtendedRelation extendedRelation : extendedRelations ) { relatedTables . add ( extendedRelation . getRelatedTableName ( ) ) ; } return relatedTables ; }
|
Get all the related table names
|
1,755
|
public List < ExtendedRelation > getBaseTableRelations ( String baseTable ) throws SQLException { return queryForEq ( ExtendedRelation . COLUMN_BASE_TABLE_NAME , baseTable ) ; }
|
Get the relations to the base table
|
1,756
|
public List < ExtendedRelation > getRelatedTableRelations ( String relatedTable ) throws SQLException { return queryForEq ( ExtendedRelation . COLUMN_RELATED_TABLE_NAME , relatedTable ) ; }
|
Get the relations to the related table
|
1,757
|
public List < ExtendedRelation > getTableRelations ( String table ) throws SQLException { QueryBuilder < ExtendedRelation , Long > qb = queryBuilder ( ) ; qb . where ( ) . like ( ExtendedRelation . COLUMN_BASE_TABLE_NAME , table ) . or ( ) . like ( ExtendedRelation . COLUMN_RELATED_TABLE_NAME , table ) ; PreparedQuery < ExtendedRelation > preparedQuery = qb . prepare ( ) ; return query ( preparedQuery ) ; }
|
Get the relations to the table both base table and related table
|
1,758
|
private Where < ExtendedRelation , Long > addToWhere ( QueryBuilder < ExtendedRelation , Long > qb , Where < ExtendedRelation , Long > where ) { if ( where == null ) { where = qb . where ( ) ; } else { where . and ( ) ; } return where ; }
|
Add to the where clause either as new or with an and
|
1,759
|
public static void unregisterDaos ( ConnectionSource connectionSource ) { unregisterDao ( connectionSource , Contents . class , SpatialReferenceSystem . class , SpatialReferenceSystemSfSql . class , SpatialReferenceSystemSqlMm . class , Extensions . class , GriddedCoverage . class , GriddedTile . class , GeometryIndex . class , TableIndex . class , FeatureTileLink . class , ExtendedRelation . class , TileScaling . class , GeometryColumns . class , GeometryColumnsSfSql . class , GeometryColumnsSqlMm . class , Metadata . class , MetadataReference . class , DataColumns . class , DataColumnConstraints . class , TileMatrix . class , TileMatrixSet . class , ContentsId . class ) ; }
|
Unregister all GeoPackage DAO with the connection source
|
1,760
|
public static void unregisterDao ( ConnectionSource connectionSource , Class < ? > ... classes ) { for ( Class < ? > clazz : classes ) { unregisterDao ( connectionSource , clazz ) ; } }
|
Unregister the provided DAO class types with the connection source
|
1,761
|
public static void unregisterDao ( ConnectionSource connectionSource , Class < ? > clazz ) { Dao < ? , ? > dao = DaoManager . lookupDao ( connectionSource , clazz ) ; if ( dao != null ) { DaoManager . unregisterDao ( connectionSource , dao ) ; } }
|
Unregister the provided
|
1,762
|
public GeometryColumns getGeometryColumns ( ) { GeometryColumns result = null ; if ( geometryColumns . size ( ) > 1 ) { throw new GeoPackageException ( "Unexpected state. More than one GeometryColumn has a foreign key to the Contents. Count: " + geometryColumns . size ( ) ) ; } else if ( geometryColumns . size ( ) == 1 ) { CloseableIterator < GeometryColumns > iterator = geometryColumns . closeableIterator ( ) ; try { result = iterator . next ( ) ; } finally { try { iterator . close ( ) ; } catch ( IOException e ) { throw new GeoPackageException ( "Failed to close the Geometry Columns iterator" , e ) ; } } } return result ; }
|
Get the Geometry Columns should only return one or no value
|
1,763
|
public TileMatrixSet getTileMatrixSet ( ) { TileMatrixSet result = null ; if ( tileMatrixSet . size ( ) > 1 ) { throw new GeoPackageException ( "Unexpected state. More than one TileMatrixSet has a foreign key to the Contents. Count: " + tileMatrixSet . size ( ) ) ; } else if ( tileMatrixSet . size ( ) == 1 ) { CloseableIterator < TileMatrixSet > iterator = tileMatrixSet . closeableIterator ( ) ; try { result = iterator . next ( ) ; } finally { try { iterator . close ( ) ; } catch ( IOException e ) { throw new GeoPackageException ( "Failed to close the Tile Matrix Set iterator" , e ) ; } } } return result ; }
|
Get the Tile Matrix Set should only return one or no value
|
1,764
|
public String getTypeName ( ) { String type = null ; if ( dataType != null ) { type = dataType . name ( ) ; } return type ; }
|
Get the database type name
|
1,765
|
private void validateMax ( ) { if ( max != null ) { if ( dataType == null ) { throw new GeoPackageException ( "Column max is only supported for data typed columns. column: " + name + ", max: " + max ) ; } else if ( dataType != GeoPackageDataType . TEXT && dataType != GeoPackageDataType . BLOB ) { throw new GeoPackageException ( "Column max is only supported for " + GeoPackageDataType . TEXT . name ( ) + " and " + GeoPackageDataType . BLOB . name ( ) + " columns. column: " + name + ", max: " + max + ", type: " + dataType . name ( ) ) ; } } }
|
Validate that if max is set the data type is text or blob
|
1,766
|
public static DateConverter converter ( GeoPackageDataType type ) { DateConverter converter = null ; switch ( type ) { case DATE : converter = dateConverter ( ) ; break ; case DATETIME : converter = dateTimeConverter ( ) ; break ; default : throw new GeoPackageException ( "Not a date data type: " + type ) ; } return converter ; }
|
Get a date converter for the data type
|
1,767
|
public String stringValue ( Date date ) { String value = null ; if ( date != null ) { SimpleDateFormat sdf = formatters . get ( 0 ) ; synchronized ( sdf ) { value = sdf . format ( date ) ; } } return value ; }
|
Get the formatted string date value of the date
|
1,768
|
public Date dateValue ( String date ) { Date value = null ; if ( date != null ) { ParseException exception = null ; for ( SimpleDateFormat sdf : formatters ) { try { synchronized ( sdf ) { value = sdf . parse ( date ) ; } break ; } catch ( ParseException e ) { if ( exception == null ) { exception = e ; } } } if ( value == null ) { throw new GeoPackageException ( "Failed to parse date string: " + date , exception ) ; } } return value ; }
|
Get the date value of the formatted string date
|
1,769
|
public void setAlgorithm ( CoverageDataAlgorithm algorithm ) { if ( algorithm == null ) { algorithm = CoverageDataAlgorithm . NEAREST_NEIGHBOR ; } this . algorithm = algorithm ; }
|
Set the interpolation algorithm
|
1,770
|
public void setEncoding ( GriddedCoverageEncodingType encoding ) { if ( encoding == null ) { encoding = GriddedCoverageEncodingType . CENTER ; } this . encoding = encoding ; }
|
Set the value pixel encoding type
|
1,771
|
public GriddedCoverage queryGriddedCoverage ( ) { try { if ( griddedCoverageDao . isTableExists ( ) ) { griddedCoverage = griddedCoverageDao . query ( tileMatrixSet ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to get Gridded Coverage for table name: " + tileMatrixSet . getTableName ( ) , e ) ; } return griddedCoverage ; }
|
Query and update the gridded coverage
|
1,772
|
public List < GriddedTile > getGriddedTile ( ) { List < GriddedTile > griddedTile = null ; try { if ( griddedTileDao . isTableExists ( ) ) { griddedTile = griddedTileDao . query ( tileMatrixSet . getTableName ( ) ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to get Gridded Tile for table name: " + tileMatrixSet . getTableName ( ) , e ) ; } return griddedTile ; }
|
Get the gridded tile
|
1,773
|
public Double getDataNull ( ) { Double dataNull = null ; if ( griddedCoverage != null ) { dataNull = griddedCoverage . getDataNull ( ) ; } return dataNull ; }
|
Get the data null value
|
1,774
|
public boolean isDataNull ( double value ) { Double dataNull = getDataNull ( ) ; boolean isDataNull = dataNull != null && dataNull == value ; return isDataNull ; }
|
Check the pixel value to see if it is the null equivalent
|
1,775
|
protected Double [ ] [ ] reprojectCoverageData ( Double [ ] [ ] values , int requestedCoverageWidth , int requestedCoverageHeight , BoundingBox requestBoundingBox , ProjectionTransform transformRequestToCoverage , BoundingBox coverageBoundingBox ) { final double requestedWidthUnitsPerPixel = ( requestBoundingBox . getMaxLongitude ( ) - requestBoundingBox . getMinLongitude ( ) ) / requestedCoverageWidth ; final double requestedHeightUnitsPerPixel = ( requestBoundingBox . getMaxLatitude ( ) - requestBoundingBox . getMinLatitude ( ) ) / requestedCoverageHeight ; final double tilesDistanceWidth = coverageBoundingBox . getMaxLongitude ( ) - coverageBoundingBox . getMinLongitude ( ) ; final double tilesDistanceHeight = coverageBoundingBox . getMaxLatitude ( ) - coverageBoundingBox . getMinLatitude ( ) ; final int width = values [ 0 ] . length ; final int height = values . length ; Double [ ] [ ] projectedValues = new Double [ requestedCoverageHeight ] [ requestedCoverageWidth ] ; for ( int y = 0 ; y < requestedCoverageHeight ; y ++ ) { for ( int x = 0 ; x < requestedCoverageWidth ; x ++ ) { double longitude = requestBoundingBox . getMinLongitude ( ) + ( x * requestedWidthUnitsPerPixel ) ; double latitude = requestBoundingBox . getMaxLatitude ( ) - ( y * requestedHeightUnitsPerPixel ) ; ProjCoordinate fromCoord = new ProjCoordinate ( longitude , latitude ) ; ProjCoordinate toCoord = transformRequestToCoverage . transform ( fromCoord ) ; double projectedLongitude = toCoord . x ; double projectedLatitude = toCoord . y ; int xPixel = ( int ) Math . round ( ( ( projectedLongitude - coverageBoundingBox . getMinLongitude ( ) ) / tilesDistanceWidth ) * width ) ; int yPixel = ( int ) Math . round ( ( ( coverageBoundingBox . getMaxLatitude ( ) - projectedLatitude ) / tilesDistanceHeight ) * height ) ; xPixel = Math . max ( 0 , xPixel ) ; xPixel = Math . min ( width - 1 , xPixel ) ; yPixel = Math . max ( 0 , yPixel ) ; yPixel = Math . min ( height - 1 , yPixel ) ; Double coverageData = values [ yPixel ] [ xPixel ] ; projectedValues [ y ] [ x ] = coverageData ; } } return projectedValues ; }
|
Reproject the coverage data to the requested projection
|
1,776
|
protected Double [ ] [ ] formatUnboundedResults ( TileMatrix tileMatrix , Map < Long , Map < Long , Double [ ] [ ] > > rowsMap , int tileCount , long minRow , long maxRow , long minColumn , long maxColumn ) { Double [ ] [ ] values = null ; if ( ! rowsMap . isEmpty ( ) ) { if ( tileCount == 1 ) { values = rowsMap . get ( minRow ) . get ( minColumn ) ; } else { Double [ ] [ ] topLeft = rowsMap . get ( minRow ) . get ( minColumn ) ; Double [ ] [ ] bottomRight = rowsMap . get ( maxRow ) . get ( maxColumn ) ; int firstWidth = topLeft [ 0 ] . length ; int firstHeight = topLeft . length ; int width = firstWidth ; int height = firstHeight ; if ( minColumn < maxColumn ) { width += bottomRight [ 0 ] . length ; long middleColumns = maxColumn - minColumn - 1 ; if ( middleColumns > 0 ) { width += ( middleColumns * tileMatrix . getTileWidth ( ) ) ; } } if ( minRow < maxRow ) { height += bottomRight . length ; long middleRows = maxRow - minRow - 1 ; if ( middleRows > 0 ) { height += ( middleRows * tileMatrix . getTileHeight ( ) ) ; } } values = new Double [ height ] [ width ] ; for ( Map . Entry < Long , Map < Long , Double [ ] [ ] > > rows : rowsMap . entrySet ( ) ) { long row = rows . getKey ( ) ; int baseRow = 0 ; if ( minRow < row ) { baseRow = firstHeight + ( int ) ( ( row - minRow - 1 ) * tileMatrix . getTileHeight ( ) ) ; } Map < Long , Double [ ] [ ] > columnsMap = rows . getValue ( ) ; for ( Map . Entry < Long , Double [ ] [ ] > columns : columnsMap . entrySet ( ) ) { long column = columns . getKey ( ) ; int baseColumn = 0 ; if ( minColumn < column ) { baseColumn = firstWidth + ( int ) ( ( column - minColumn - 1 ) * tileMatrix . getTileWidth ( ) ) ; } Double [ ] [ ] localValues = columns . getValue ( ) ; for ( int localRow = 0 ; localRow < localValues . length ; localRow ++ ) { int globalRow = baseRow + localRow ; System . arraycopy ( localValues [ localRow ] , 0 , values [ globalRow ] , baseColumn , localValues [ localRow ] . length ) ; } } } } } return values ; }
|
Format the unbounded results from coverage data tiles into a single double array of coverage data
|
1,777
|
protected float getXSource ( int x , float destLeft , float srcLeft , float widthRatio ) { float dest = getXEncodedLocation ( x , encoding ) ; float source = getSource ( dest , destLeft , srcLeft , widthRatio ) ; return source ; }
|
Determine the x source pixel location
|
1,778
|
protected float getYSource ( int y , float destTop , float srcTop , float heightRatio ) { float dest = getYEncodedLocation ( y , encoding ) ; float source = getSource ( dest , destTop , srcTop , heightRatio ) ; return source ; }
|
Determine the y source pixel location
|
1,779
|
private float getSource ( float dest , float destMin , float srcMin , float ratio ) { float destDistance = dest - destMin ; float srcDistance = destDistance * ratio ; float ySource = srcMin + srcDistance ; return ySource ; }
|
Determine the source pixel location
|
1,780
|
private float getXEncodedLocation ( float x , GriddedCoverageEncodingType encodingType ) { float xLocation = x ; switch ( encodingType ) { case CENTER : case AREA : xLocation += 0.5f ; break ; case CORNER : break ; default : throw new GeoPackageException ( "Unsupported Encoding Type: " + encodingType ) ; } return xLocation ; }
|
Get the X encoded location from the base provided x
|
1,781
|
private float getYEncodedLocation ( float y , GriddedCoverageEncodingType encodingType ) { float yLocation = y ; switch ( encodingType ) { case CENTER : case AREA : yLocation += 0.5f ; break ; case CORNER : yLocation += 1.0f ; break ; default : throw new GeoPackageException ( "Unsupported Encoding Type: " + encodingType ) ; } return yLocation ; }
|
Get the Y encoded location from the base provided y
|
1,782
|
protected List < int [ ] > getNearestNeighbors ( float xSource , float ySource ) { List < int [ ] > results = new ArrayList < int [ ] > ( ) ; CoverageDataSourcePixel xPixel = getXSourceMinAndMax ( xSource ) ; CoverageDataSourcePixel yPixel = getYSourceMinAndMax ( ySource ) ; int firstX ; int secondX ; float xDistance ; if ( xPixel . getOffset ( ) > .5 ) { firstX = xPixel . getMax ( ) ; secondX = xPixel . getMin ( ) ; xDistance = 1.0f - xPixel . getOffset ( ) ; } else { firstX = xPixel . getMin ( ) ; secondX = xPixel . getMax ( ) ; xDistance = xPixel . getOffset ( ) ; } int firstY ; int secondY ; float yDistance ; if ( yPixel . getOffset ( ) > .5 ) { firstY = yPixel . getMax ( ) ; secondY = yPixel . getMin ( ) ; yDistance = 1.0f - yPixel . getOffset ( ) ; } else { firstY = yPixel . getMin ( ) ; secondY = yPixel . getMax ( ) ; yDistance = yPixel . getOffset ( ) ; } results . add ( new int [ ] { firstX , firstY } ) ; if ( xDistance <= yDistance ) { results . add ( new int [ ] { secondX , firstY } ) ; results . add ( new int [ ] { firstX , secondY } ) ; } else { results . add ( new int [ ] { firstX , secondY } ) ; results . add ( new int [ ] { secondX , firstY } ) ; } results . add ( new int [ ] { secondX , secondY } ) ; if ( xPixel . getOffset ( ) == 0 ) { results . add ( new int [ ] { xPixel . getMin ( ) - 1 , yPixel . getMin ( ) } ) ; results . add ( new int [ ] { xPixel . getMin ( ) - 1 , yPixel . getMax ( ) } ) ; } if ( yPixel . getOffset ( ) == 0 ) { results . add ( new int [ ] { xPixel . getMin ( ) , yPixel . getMin ( ) - 1 } ) ; results . add ( new int [ ] { xPixel . getMax ( ) , yPixel . getMin ( ) - 1 } ) ; } if ( xPixel . getOffset ( ) == 0 && yPixel . getOffset ( ) == 0 ) { results . add ( new int [ ] { xPixel . getMin ( ) - 1 , yPixel . getMin ( ) - 1 } ) ; } return results ; }
|
Determine the nearest neighbors of the source pixel sorted by closest to farthest neighbor
|
1,783
|
protected CoverageDataSourcePixel getXSourceMinAndMax ( float source ) { int floor = ( int ) Math . floor ( source ) ; float valueLocation = getXEncodedLocation ( floor , griddedCoverage . getGridCellEncodingType ( ) ) ; CoverageDataSourcePixel pixel = getSourceMinAndMax ( source , floor , valueLocation ) ; return pixel ; }
|
Get the min max and offset of the source X pixel
|
1,784
|
protected CoverageDataSourcePixel getYSourceMinAndMax ( float source ) { int floor = ( int ) Math . floor ( source ) ; float valueLocation = getYEncodedLocation ( floor , griddedCoverage . getGridCellEncodingType ( ) ) ; CoverageDataSourcePixel pixel = getSourceMinAndMax ( source , floor , valueLocation ) ; return pixel ; }
|
Get the min max and offset of the source Y pixel
|
1,785
|
private CoverageDataSourcePixel getSourceMinAndMax ( float source , int sourceFloor , float valueLocation ) { int min = sourceFloor ; int max = sourceFloor ; float offset ; if ( source < valueLocation ) { min -- ; offset = 1.0f - ( valueLocation - source ) ; } else { max ++ ; offset = source - valueLocation ; } return new CoverageDataSourcePixel ( source , min , max , offset ) ; }
|
Get the min max and offset of the source pixel
|
1,786
|
protected BoundingBox padBoundingBox ( TileMatrix tileMatrix , BoundingBox boundingBox , int overlap ) { double lonPixelPadding = tileMatrix . getPixelXSize ( ) * overlap ; double latPixelPadding = tileMatrix . getPixelYSize ( ) * overlap ; BoundingBox paddedBoundingBox = new BoundingBox ( boundingBox . getMinLongitude ( ) - lonPixelPadding , boundingBox . getMinLatitude ( ) - latPixelPadding , boundingBox . getMaxLongitude ( ) + lonPixelPadding , boundingBox . getMaxLatitude ( ) + latPixelPadding ) ; return paddedBoundingBox ; }
|
Pad the bounding box with extra space for the overlapping pixels
|
1,787
|
public int getUnsignedPixelValue ( short [ ] pixelValues , int width , int x , int y ) { short pixelValue = getPixelValue ( pixelValues , width , x , y ) ; int unsignedPixelValue = getUnsignedPixelValue ( pixelValue ) ; return unsignedPixelValue ; }
|
Get the pixel value as a 16 bit unsigned value as an integer
|
1,788
|
public int [ ] getUnsignedPixelValues ( short [ ] pixelValues ) { int [ ] unsignedValues = new int [ pixelValues . length ] ; for ( int i = 0 ; i < pixelValues . length ; i ++ ) { unsignedValues [ i ] = getUnsignedPixelValue ( pixelValues [ i ] ) ; } return unsignedValues ; }
|
Get the unsigned pixel values . The values saved as unsigned shorts in the short array is returned as an integer which stores the positive 16 bit value
|
1,789
|
private Double pixelValueToValue ( GriddedTile griddedTile , Double pixelValue ) { Double value = pixelValue ; if ( griddedCoverage != null && griddedCoverage . getDataType ( ) == GriddedCoverageDataType . INTEGER ) { if ( griddedTile != null ) { value *= griddedTile . getScale ( ) ; value += griddedTile . getOffset ( ) ; } value *= griddedCoverage . getScale ( ) ; value += griddedCoverage . getOffset ( ) ; } return value ; }
|
Convert integer coverage typed pixel value to a coverage data value through scales and offsets
|
1,790
|
public static TileMatrixSet createTileTableWithMetadata ( GeoPackageCore geoPackage , String tableName , BoundingBox contentsBoundingBox , long contentsSrsId , BoundingBox tileMatrixSetBoundingBox , long tileMatrixSetSrsId ) { TileMatrixSet tileMatrixSet = geoPackage . createTileTableWithMetadata ( ContentsDataType . GRIDDED_COVERAGE , tableName , contentsBoundingBox , contentsSrsId , tileMatrixSetBoundingBox , tileMatrixSetSrsId ) ; return tileMatrixSet ; }
|
Create the coverage data tile table with metadata
|
1,791
|
public int getUnsignedPixelValue ( GriddedTile griddedTile , Double value ) { int unsignedPixelValue = 0 ; if ( value == null ) { if ( griddedCoverage != null ) { unsignedPixelValue = griddedCoverage . getDataNull ( ) . intValue ( ) ; } } else { double pixelValue = valueToPixelValue ( griddedTile , value ) ; unsignedPixelValue = ( int ) Math . round ( pixelValue ) ; } return unsignedPixelValue ; }
|
Get the unsigned 16 bit integer pixel value of the coverage data value
|
1,792
|
private double valueToPixelValue ( GriddedTile griddedTile , double value ) { double pixelValue = value ; if ( griddedCoverage != null && griddedCoverage . getDataType ( ) == GriddedCoverageDataType . INTEGER ) { pixelValue -= griddedCoverage . getOffset ( ) ; pixelValue /= griddedCoverage . getScale ( ) ; if ( griddedTile != null ) { pixelValue -= griddedTile . getOffset ( ) ; pixelValue /= griddedTile . getScale ( ) ; } } return pixelValue ; }
|
Convert integer coverage typed coverage data value to a pixel value through offsets and scales
|
1,793
|
public short getPixelValue ( GriddedTile griddedTile , Double value ) { int unsignedPixelValue = getUnsignedPixelValue ( griddedTile , value ) ; short pixelValue = getPixelValue ( unsignedPixelValue ) ; return pixelValue ; }
|
Get the unsigned short pixel value of the coverage data value
|
1,794
|
public Double getValue ( GriddedTile griddedTile , float pixelValue ) { Double value = null ; if ( ! isDataNull ( pixelValue ) ) { value = pixelValueToValue ( griddedTile , new Double ( pixelValue ) ) ; } return value ; }
|
Get the coverage data value for the pixel value
|
1,795
|
public float getFloatPixelValue ( GriddedTile griddedTile , Double value ) { double pixel = 0 ; if ( value == null ) { if ( griddedCoverage != null ) { pixel = griddedCoverage . getDataNull ( ) ; } } else { pixel = valueToPixelValue ( griddedTile , value ) ; } float pixelValue = ( float ) pixel ; return pixelValue ; }
|
Get the pixel value of the coverage data value
|
1,796
|
public Double getValue ( double latitude , double longitude ) { CoverageDataRequest request = new CoverageDataRequest ( latitude , longitude ) ; CoverageDataResults values = getValues ( request , 1 , 1 ) ; Double value = null ; if ( values != null ) { value = values . getValues ( ) [ 0 ] [ 0 ] ; } return value ; }
|
Get the coverage data value at the coordinate
|
1,797
|
public CoverageDataResults getValues ( BoundingBox requestBoundingBox ) { CoverageDataRequest request = new CoverageDataRequest ( requestBoundingBox ) ; CoverageDataResults values = getValues ( request ) ; return values ; }
|
Get the coverage data values within the bounding box
|
1,798
|
public CoverageDataResults getValues ( BoundingBox requestBoundingBox , Integer width , Integer height ) { CoverageDataRequest request = new CoverageDataRequest ( requestBoundingBox ) ; CoverageDataResults values = getValues ( request , width , height ) ; return values ; }
|
Get the coverage data values within the bounding box with the requested width and height result size
|
1,799
|
public CoverageDataResults getValues ( CoverageDataRequest request ) { CoverageDataResults values = getValues ( request , width , height ) ; return values ; }
|
Get the requested coverage data values
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.