idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
3,700 | public String header ( ) { StringBuilder output = new StringBuilder ( ) ; output . append ( "GeoPackage File: " + geoPackage . getPath ( ) ) ; output . append ( "\nGeoPackage Name: " + geoPackage . getName ( ) ) ; return output . toString ( ) ; } | Get the GeoPackage file and name header text |
3,701 | public String tileTable ( String table ) { StringBuilder output = new StringBuilder ( ) ; TileDao tileDao = geoPackage . getTileDao ( table ) ; output . append ( "Table Name: " + tileDao . getTableName ( ) ) ; long minZoom = tileDao . getMinZoom ( ) ; long maxZoom = tileDao . getMaxZoom ( ) ; output . append ( "\nMin Z... | Build text from a tile table |
3,702 | public String textOutput ( SpatialReferenceSystem srs ) { StringBuilder output = new StringBuilder ( ) ; output . append ( "\tSRS " + SpatialReferenceSystem . COLUMN_ORGANIZATION + ": " + srs . getOrganization ( ) ) ; output . append ( "\n\tSRS " + SpatialReferenceSystem . COLUMN_ORGANIZATION_COORDSYS_ID + ": " + srs .... | Text output from a SRS |
3,703 | public String textOutput ( Contents contents ) { StringBuilder output = new StringBuilder ( ) ; output . append ( "\t" + Contents . COLUMN_TABLE_NAME + ": " + contents . getTableName ( ) ) ; output . append ( "\n\t" + Contents . COLUMN_DATA_TYPE + ": " + contents . getDataType ( ) ) ; output . append ( "\n\t" + Content... | Text output from a Contents |
3,704 | public String textOutput ( TileMatrixSet tileMatrixSet ) { StringBuilder output = new StringBuilder ( ) ; output . append ( "\t" + TileMatrixSet . COLUMN_TABLE_NAME + ": " + tileMatrixSet . getTableName ( ) ) ; output . append ( "\n" + textOutput ( tileMatrixSet . getSrs ( ) ) ) ; output . append ( "\n\t" + TileMatrixS... | Text output from a TileMatrixSet |
3,705 | public String textOutput ( TileMatrix tileMatrix ) { StringBuilder output = new StringBuilder ( ) ; output . append ( "\t" + TileMatrix . COLUMN_TABLE_NAME + ": " + tileMatrix . getTableName ( ) ) ; output . append ( "\n\t" + TileMatrix . COLUMN_ZOOM_LEVEL + ": " + tileMatrix . getZoomLevel ( ) ) ; output . append ( "\... | Text output from a Tile Matrix |
3,706 | public String textOutput ( BoundingBox boundingBox ) { StringBuilder output = new StringBuilder ( ) ; output . append ( "\tMin Longitude: " + boundingBox . getMinLongitude ( ) ) ; output . append ( "\n\tMin Latitude: " + boundingBox . getMinLatitude ( ) ) ; output . append ( "\n\tMax Longitude: " + boundingBox . getMax... | Text output from a bounding box |
3,707 | public void writeTiff ( ) { if ( directory . getWriteRasters ( ) != null ) { TIFFImage tiffImage = new TIFFImage ( ) ; tiffImage . add ( directory ) ; try { imageBytes = TiffWriter . writeTiffToBytes ( tiffImage ) ; } catch ( IOException e ) { throw new GeoPackageException ( "Failed to write TIFF image" , e ) ; } } } | Write the TIFF file to the image bytes |
3,708 | public float getPixel ( int x , int y ) { float pixel = - 1 ; if ( rasters == null ) { readPixels ( ) ; } if ( rasters != null ) { pixel = rasters . getFirstPixelSample ( x , y ) . floatValue ( ) ; } else { throw new GeoPackageException ( "Could not retrieve pixel value" ) ; } return pixel ; } | Get the pixel at the coordinate |
3,709 | public void setStyle ( StyleRow styleRow , GeometryType geometryType ) { if ( geometryType != null ) { if ( styleRow != null ) { styles . put ( geometryType , styleRow ) ; } else { styles . remove ( geometryType ) ; } } else { defaultStyle = styleRow ; } } | Set the style for the geometry type |
3,710 | public StyleRow getStyle ( GeometryType geometryType ) { StyleRow styleRow = null ; if ( geometryType != null && ! styles . isEmpty ( ) ) { List < GeometryType > geometryTypes = GeometryUtils . parentHierarchy ( geometryType ) ; geometryTypes . add ( 0 , geometryType ) ; for ( GeometryType type : geometryTypes ) { styl... | Get the style for the geometry type |
3,711 | protected int count ( UserCustomResultSet resultSet ) { int count = 0 ; try { count = resultSet . getCount ( ) ; } finally { resultSet . close ( ) ; } return count ; } | Get the count of the result set and close it |
3,712 | public static UserCustomDao readTable ( String database , GeoPackageConnection connection , String tableName ) { UserCustomConnection userDb = new UserCustomConnection ( connection ) ; UserCustomTable userCustomTable = UserCustomTableReader . readTable ( userDb , tableName ) ; UserCustomDao dao = new UserCustomDao ( da... | Read the database table and create a DAO |
3,713 | private ResultSet integrityCheck ( ResultSet resultSet ) { try { if ( resultSet . next ( ) ) { String value = resultSet . getString ( 1 ) ; if ( value . equals ( "ok" ) ) { resultSet . close ( ) ; resultSet = null ; } } } catch ( SQLException e ) { throw new GeoPackageException ( "Integrity check failed on database: " ... | Check the result set returned from the integrity check to see if things are ok |
3,714 | public void setTileFormat ( TileFormatType tileFormat ) { if ( tileFormat == null ) { tileFormat = TileFormatType . STANDARD ; } else { switch ( tileFormat ) { case STANDARD : case TMS : this . tileFormat = tileFormat ; break ; default : throw new GeoPackageException ( "Unsupported Tile Format Type for URL Tile Generat... | Set the tile format |
3,715 | private String replaceXYZ ( String url , int z , long x , long y ) { url = url . replaceAll ( Z_VARIABLE , String . valueOf ( z ) ) ; url = url . replaceAll ( X_VARIABLE , String . valueOf ( x ) ) ; url = url . replaceAll ( Y_VARIABLE , String . valueOf ( y ) ) ; return url ; } | Replace x y and z in the url |
3,716 | private String replaceBoundingBox ( String url , BoundingBox boundingBox ) { url = url . replaceAll ( MIN_LAT_VARIABLE , String . valueOf ( boundingBox . getMinLatitude ( ) ) ) ; url = url . replaceAll ( MAX_LAT_VARIABLE , String . valueOf ( boundingBox . getMaxLatitude ( ) ) ) ; url = url . replaceAll ( MIN_LON_VARIAB... | Replace the url parts with the bounding box |
3,717 | private byte [ ] downloadTile ( String zoomUrl , URL url , int z , long x , long y ) { byte [ ] bytes = null ; HttpURLConnection connection = null ; try { connection = ( HttpURLConnection ) url . openConnection ( ) ; connection . connect ( ) ; int responseCode = connection . getResponseCode ( ) ; if ( responseCode == H... | Download the tile from the URL |
3,718 | private boolean drawFeature ( int zoom , BoundingBox boundingBox , BoundingBox expandedBoundingBox , ProjectionTransform transform , FeatureTileGraphics graphics , FeatureRow row ) { boolean drawn = false ; try { GeoPackageGeometryData geomData = row . getGeometry ( ) ; if ( geomData != null ) { Geometry geometry = geo... | Draw the feature |
3,719 | private boolean drawLineString ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , FeatureTileGraphics graphics , LineString lineString , FeatureStyle featureStyle ) { Path2D path = getPath ( simplifyTolerance , boundingBox , transform , lineString ) ; return drawLine ( graphics , pat... | Draw a LineString |
3,720 | private boolean drawPolygon ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , FeatureTileGraphics graphics , Polygon polygon , FeatureStyle featureStyle ) { Area polygonArea = getArea ( simplifyTolerance , boundingBox , transform , polygon ) ; return drawPolygon ( graphics , polygon... | Draw a Polygon |
3,721 | private Path2D getPath ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , LineString lineString ) { Path2D path = null ; List < Point > lineStringPoints = simplifyPoints ( simplifyTolerance , lineString . getPoints ( ) ) ; for ( Point point : lineStringPoints ) { Point projectedPoint... | Get the path of the line string |
3,722 | private boolean drawLine ( FeatureTileGraphics graphics , Path2D line , FeatureStyle featureStyle ) { Graphics2D lineGraphics = graphics . getLineGraphics ( ) ; Paint paint = getLinePaint ( featureStyle ) ; lineGraphics . setColor ( paint . getColor ( ) ) ; lineGraphics . setStroke ( paint . getStroke ( ) ) ; boolean d... | Draw the line |
3,723 | private Area getArea ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , Polygon polygon ) { Area area = null ; for ( LineString ring : polygon . getRings ( ) ) { Path2D path = getPath ( simplifyTolerance , boundingBox , transform , ring ) ; Area ringArea = new Area ( path ) ; if ( ar... | Get the area of the polygon |
3,724 | private boolean drawPolygon ( FeatureTileGraphics graphics , Area polygon , FeatureStyle featureStyle ) { Graphics2D polygonGraphics = graphics . getPolygonGraphics ( ) ; Paint fillPaint = getPolygonFillPaint ( featureStyle ) ; if ( fillPaint != null ) { polygonGraphics . setColor ( fillPaint . getColor ( ) ) ; polygon... | Draw the polygon |
3,725 | public FeatureRow getFeatureRow ( UserCustomResultSet resultSet ) { RTreeIndexTableRow row = getRow ( resultSet ) ; return getFeatureRow ( row ) ; } | Get the feature row from the RTree Index Table row |
3,726 | public UserCustomResultSet query ( BoundingBox boundingBox , Projection projection ) { BoundingBox featureBoundingBox = projectBoundingBox ( boundingBox , projection ) ; return query ( featureBoundingBox ) ; } | Query for rows within the bounding box in the provided projection |
3,727 | public UserCustomResultSet query ( GeometryEnvelope envelope ) { return query ( envelope . getMinX ( ) , envelope . getMinY ( ) , envelope . getMaxX ( ) , envelope . getMaxY ( ) ) ; } | Query for rows within the geometry envelope |
3,728 | public UserCustomResultSet query ( double minX , double minY , double maxX , double maxY ) { validateRTree ( ) ; String where = buildWhere ( minX , minY , maxX , maxY ) ; String [ ] whereArgs = buildWhereArgs ( minX , minY , maxX , maxY ) ; return query ( where , whereArgs ) ; } | Query for rows within the bounds |
3,729 | public long count ( double minX , double minY , double maxX , double maxY ) { validateRTree ( ) ; String where = buildWhere ( minX , minY , maxX , maxY ) ; String [ ] whereArgs = buildWhereArgs ( minX , minY , maxX , maxY ) ; return count ( where , whereArgs ) ; } | Count the rows within the bounds |
3,730 | public void setData ( BufferedImage image , String imageFormat ) throws IOException { setData ( image , imageFormat , null ) ; } | Set the data from an image |
3,731 | public void setData ( BufferedImage image , String imageFormat , Float quality ) throws IOException { setData ( ImageUtils . writeImageToBytes ( image , imageFormat , quality ) ) ; } | Set the data from an image with optional quality |
3,732 | public TileResultSet queryForTilesInColumn ( long column , long zoomLevel ) { Map < String , Object > fieldValues = new HashMap < String , Object > ( ) ; fieldValues . put ( TileTable . COLUMN_TILE_COLUMN , column ) ; fieldValues . put ( TileTable . COLUMN_ZOOM_LEVEL , zoomLevel ) ; return queryForFieldValues ( fieldVa... | Query for Tiles at a zoom level and column |
3,733 | public TileResultSet queryForTilesInRow ( long row , long zoomLevel ) { Map < String , Object > fieldValues = new HashMap < String , Object > ( ) ; fieldValues . put ( TileTable . COLUMN_TILE_ROW , row ) ; fieldValues . put ( TileTable . COLUMN_ZOOM_LEVEL , zoomLevel ) ; return queryForFieldValues ( fieldValues ) ; } | Query for Tiles at a zoom level and row |
3,734 | public TileResultSet queryByTileGrid ( TileGrid tileGrid , long zoomLevel , String orderBy ) { TileResultSet tileCursor = null ; if ( tileGrid != null ) { StringBuilder where = new StringBuilder ( ) ; where . append ( buildWhere ( TileTable . COLUMN_ZOOM_LEVEL , zoomLevel ) ) ; where . append ( " AND " ) ; where . appe... | Query by tile grid and zoom level |
3,735 | public BufferedImage put ( IconRow iconRow , BufferedImage image ) { return put ( iconRow . getId ( ) , image ) ; } | Cache the icon image for the icon row |
3,736 | public static BufferedImage createIcon ( IconRow icon , float scale , IconCache iconCache ) { BufferedImage iconImage = null ; if ( icon != null ) { if ( iconCache != null ) { iconImage = iconCache . get ( icon . getId ( ) ) ; } if ( iconImage == null ) { try { iconImage = icon . getDataImage ( ) ; } catch ( IOExceptio... | Create or retrieve from cache an icon image for the icon row |
3,737 | private int indexRows ( TableIndex tableIndex , FeatureResultSet resultSet ) { int count = - 1 ; try { while ( ( progress == null || progress . isActive ( ) ) && resultSet . moveToNext ( ) ) { if ( count < 0 ) { count ++ ; } try { FeatureRow row = resultSet . getRow ( ) ; boolean indexed = index ( tableIndex , row . ge... | Index the feature rows in the cursor |
3,738 | public UserCustomDao getUserDao ( String tableName ) { return UserCustomDao . readTable ( getGeoPackage ( ) . getName ( ) , connection , tableName ) ; } | Get a User Custom DAO from a table name |
3,739 | public MediaDao getMediaDao ( String tableName ) { MediaDao mediaDao = new MediaDao ( getUserDao ( tableName ) ) ; setContents ( mediaDao . getTable ( ) ) ; return mediaDao ; } | Get a related media table DAO |
3,740 | public List < Long > getMappingsForBase ( String tableName , long baseId ) { List < Long > relatedIds = new ArrayList < > ( ) ; UserMappingDao userMappingDao = getMappingDao ( tableName ) ; UserCustomResultSet resultSet = userMappingDao . queryByBaseId ( baseId ) ; try { while ( resultSet . moveToNext ( ) ) { UserMappi... | Get the related id mappings for the base id |
3,741 | public List < Long > getMappingsForRelated ( String tableName , long relatedId ) { List < Long > baseIds = new ArrayList < > ( ) ; UserMappingDao userMappingDao = getMappingDao ( tableName ) ; UserCustomResultSet resultSet = userMappingDao . queryByRelatedId ( relatedId ) ; try { while ( resultSet . moveToNext ( ) ) { ... | Get the base id mappings for the related id |
3,742 | public boolean hasMapping ( String tableName , long baseId , long relatedId ) { UserMappingDao userMappingDao = getMappingDao ( tableName ) ; return userMappingDao . countByIds ( baseId , relatedId ) > 0 ; } | Determine if the base id and related id mapping exists |
3,743 | public static void execSQL ( Connection connection , String sql ) { Statement statement = null ; try { statement = connection . createStatement ( ) ; statement . execute ( sql ) ; } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to execute SQL statement: " + sql , e ) ; } finally { closeStatement ( ... | Execute the SQL |
3,744 | public static ResultSet query ( Connection connection , String sql , String [ ] selectionArgs ) { PreparedStatement statement = null ; ResultSet resultSet = null ; try { statement = connection . prepareStatement ( sql ) ; setArguments ( statement , selectionArgs ) ; resultSet = statement . executeQuery ( ) ; } catch ( ... | Query for results |
3,745 | public static int count ( Connection connection , String sql , String [ ] selectionArgs ) { if ( ! sql . toLowerCase ( ) . contains ( " count(*) " ) ) { int index = sql . toLowerCase ( ) . indexOf ( " from " ) ; if ( index == - 1 ) { return - 1 ; } sql = "select count(*)" + sql . substring ( index ) ; } int count = que... | Attempt to count the results of the query |
3,746 | public static Integer max ( Connection connection , String table , String column , String where , String [ ] args ) { Integer max = null ; if ( count ( connection , table , where , args ) > 0 ) { StringBuilder maxQuery = new StringBuilder ( ) ; maxQuery . append ( "select max(" ) . append ( CoreSQLUtils . quoteWrap ( c... | Get the max query result |
3,747 | private static int querySingleInteger ( Connection connection , String sql , String [ ] args , boolean allowEmptyResults ) { int result = 0 ; Object value = querySingleResult ( connection , sql , args , 0 , GeoPackageDataType . MEDIUMINT ) ; if ( value != null ) { result = ( ( Number ) value ) . intValue ( ) ; } else i... | Query the SQL for a single integer result |
3,748 | public static List < Object > querySingleColumnResults ( Connection connection , String sql , String [ ] args , int column , GeoPackageDataType dataType , Integer limit ) { ResultSetResult result = wrapQuery ( connection , sql , args ) ; List < Object > results = ResultUtils . buildSingleColumnResults ( result , column... | Query for values from a single column up to the limit |
3,749 | public static List < List < Object > > queryResults ( Connection connection , String sql , String [ ] args , GeoPackageDataType [ ] dataTypes , Integer limit ) { ResultSetResult result = wrapQuery ( connection , sql , args ) ; List < List < Object > > results = ResultUtils . buildResults ( result , dataTypes , limit ) ... | Query for values up to the limit |
3,750 | public static int delete ( Connection connection , String table , String where , String [ ] args ) { StringBuilder delete = new StringBuilder ( ) ; delete . append ( "delete from " ) . append ( CoreSQLUtils . quoteWrap ( table ) ) ; if ( where != null ) { delete . append ( " where " ) . append ( where ) ; } String sql ... | Execute a deletion |
3,751 | public static int update ( Connection connection , String table , ContentValues values , String whereClause , String [ ] whereArgs ) { StringBuilder update = new StringBuilder ( ) ; update . append ( "update " ) . append ( CoreSQLUtils . quoteWrap ( table ) ) . append ( " set " ) ; int setValuesSize = values . size ( )... | Update table rows |
3,752 | public static void setArguments ( PreparedStatement statement , Object [ ] selectionArgs ) throws SQLException { if ( selectionArgs != null ) { for ( int i = 0 ; i < selectionArgs . length ; i ++ ) { statement . setObject ( i + 1 , selectionArgs [ i ] ) ; } } } | Set the prepared statement arguments |
3,753 | public static void closeStatement ( Statement statement , String sql ) { if ( statement != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { log . log ( Level . WARNING , "Failed to close SQL Statement: " + sql , e ) ; } } } | Close the statement |
3,754 | public static void closeResultSet ( ResultSet resultSet , String sql ) { if ( resultSet != null ) { try { resultSet . close ( ) ; } catch ( SQLException e ) { log . log ( Level . WARNING , "Failed to close SQL ResultSet: " + sql , e ) ; } } } | Close the ResultSet |
3,755 | public static void closeResultSetStatement ( ResultSet resultSet , String sql ) { if ( resultSet != null ) { try { resultSet . getStatement ( ) . close ( ) ; } catch ( SQLException e ) { log . log ( Level . WARNING , "Failed to close SQL ResultSet: " + sql , e ) ; } } } | Close the ResultSet Statement from which it was created which closes all ResultSets as well |
3,756 | public static ResultSetResult wrapQuery ( Connection connection , String sql , String [ ] selectionArgs ) { return new ResultSetResult ( query ( connection , sql , selectionArgs ) ) ; } | Perform the query and wrap as a result |
3,757 | public double [ ] getDerivedDimensions ( ) { Double width = getWidth ( ) ; Double height = getHeight ( ) ; if ( width == null || height == null ) { int dataWidth ; int dataHeight ; try { BufferedImage image = getDataImage ( ) ; dataWidth = image . getWidth ( ) ; dataHeight = image . getHeight ( ) ; } catch ( IOExceptio... | Get the derived width and height from the values and icon data scaled as needed |
3,758 | public static void main ( String [ ] args ) throws Exception { boolean valid = true ; boolean requiredArguments = false ; String imageFormat = null ; boolean rawImage = false ; File inputDirectory = null ; TileFormatType tileType = null ; File geoPackageFile = null ; String tileTable = null ; for ( int i = 0 ; valid &&... | Main method to read tiles from the file system into a GeoPackage |
3,759 | public int update ( ContentValues values , String whereClause , String [ ] whereArgs ) { return SQLUtils . update ( connection , getTableName ( ) , values , whereClause , whereArgs ) ; } | Update all rows matching the where clause with the provided values |
3,760 | private static void finish ( ) { if ( progress . getMax ( ) != null ) { StringBuilder output = new StringBuilder ( ) ; output . append ( "\nTile Generation: " ) . append ( progress . getProgress ( ) ) . append ( " of " ) . append ( progress . getMax ( ) ) ; if ( geoPackage != null ) { try { GeoPackageTextOutput textOut... | Finish tile generation |
3,761 | public short getPixelValue ( BufferedImage image , int x , int y ) { validateImageType ( image ) ; WritableRaster raster = image . getRaster ( ) ; short pixelValue = getPixelValue ( raster , x , y ) ; return pixelValue ; } | Get the pixel value as an unsigned short |
3,762 | public short getPixelValue ( WritableRaster raster , int x , int y ) { Object pixelData = raster . getDataElements ( x , y , null ) ; short sdata [ ] = ( short [ ] ) pixelData ; if ( sdata . length != 1 ) { throw new UnsupportedOperationException ( "This method is not supported by this color model" ) ; } short pixelVal... | Get the pixel value as an unsigned short from the raster and the coordinate |
3,763 | public short [ ] getPixelValues ( BufferedImage image ) { validateImageType ( image ) ; WritableRaster raster = image . getRaster ( ) ; short [ ] pixelValues = getPixelValues ( raster ) ; return pixelValues ; } | Get the pixel values of the buffered image as unsigned shorts |
3,764 | public int [ ] getUnsignedPixelValues ( BufferedImage image ) { short [ ] pixelValues = getPixelValues ( image ) ; int [ ] unsignedPixelValues = getUnsignedPixelValues ( pixelValues ) ; return unsignedPixelValues ; } | Get the pixel values of the buffered image as 16 bit unsigned integer values |
3,765 | public short [ ] getPixelValues ( WritableRaster raster ) { DataBufferUShort buffer = ( DataBufferUShort ) raster . getDataBuffer ( ) ; short [ ] pixelValues = buffer . getData ( ) ; return pixelValues ; } | Get the pixel values of the raster as unsigned shorts |
3,766 | public int [ ] getUnsignedPixelValues ( WritableRaster raster ) { short [ ] pixelValues = getPixelValues ( raster ) ; int [ ] unsignedPixelValues = getUnsignedPixelValues ( pixelValues ) ; return unsignedPixelValues ; } | Get the pixel values of the raster as 16 bit unsigned integer values |
3,767 | public void validateImageType ( BufferedImage image ) { if ( image == null ) { throw new GeoPackageException ( "The image is null" ) ; } if ( image . getColorModel ( ) . getTransferType ( ) != DataBuffer . TYPE_USHORT ) { throw new GeoPackageException ( "The coverage data tile is expected to be a 16 bit unsigned short,... | Validate that the image type is an unsigned short |
3,768 | public byte [ ] getImageBytes ( BufferedImage image ) { byte [ ] bytes = null ; try { bytes = ImageUtils . writeImageToBytes ( image , ImageUtils . IMAGE_FORMAT_PNG ) ; } catch ( IOException e ) { throw new GeoPackageException ( "Failed to write image to " + ImageUtils . IMAGE_FORMAT_PNG + " bytes" , e ) ; } return byt... | Get the image as PNG bytes |
3,769 | public void setPixelValue ( WritableRaster raster , int x , int y , short pixelValue ) { short data [ ] = new short [ ] { pixelValue } ; raster . setDataElements ( x , y , data ) ; } | Set the unsigned short pixel value into the image raster |
3,770 | public void setPixelValue ( WritableRaster raster , int x , int y , int unsignedPixelValue ) { short pixelValue = getPixelValue ( unsignedPixelValue ) ; setPixelValue ( raster , x , y , pixelValue ) ; } | Set the unsigned 16 bit integer pixel value into the image raster |
3,771 | public Stroke getStroke ( ) { Stroke theStroke = stroke ; if ( theStroke == null ) { theStroke = new BasicStroke ( strokeWidth ) ; stroke = theStroke ; } return theStroke ; } | Get the stroke created from the stroke width |
3,772 | public List < StyleMappingRow > queryByBaseFeatureId ( long id ) { List < StyleMappingRow > rows = new ArrayList < > ( ) ; UserCustomResultSet resultSet = queryByBaseId ( id ) ; try { while ( resultSet . moveToNext ( ) ) { rows . add ( getRow ( resultSet ) ) ; } } finally { resultSet . close ( ) ; } return rows ; } | Query for style mappings by base id |
3,773 | public ImageRectangle round ( ) { return new ImageRectangle ( Math . round ( left ) , Math . round ( top ) , Math . round ( right ) , Math . round ( bottom ) ) ; } | Round the floating point rectangle to an integer rectangle |
3,774 | private static int writeGeoPackageFormatTiles ( TileDao tileDao , File directory , String imageFormat , Integer width , Integer height , boolean rawImage ) throws IOException { int tileCount = 0 ; for ( long zoomLevel = tileDao . getMinZoom ( ) ; zoomLevel <= tileDao . getMaxZoom ( ) ; zoomLevel ++ ) { TileMatrix tileM... | Write GeoPackage formatted tiles |
3,775 | private static double getLength ( BoundingBox boundingBox , ProjectionTransform toWebMercatorTransform ) { BoundingBox transformedBoundingBox = boundingBox . transform ( toWebMercatorTransform ) ; return getLength ( transformedBoundingBox ) ; } | Get the length of the bounding box projected using the transformation |
3,776 | private static double getLength ( BoundingBox boundingBox ) { double width = boundingBox . getMaxLongitude ( ) - boundingBox . getMinLongitude ( ) ; double height = boundingBox . getMaxLatitude ( ) - boundingBox . getMinLatitude ( ) ; double length = Math . min ( width , height ) ; return length ; } | Get the length of the bounding box |
3,777 | public GeoPackage getOrOpen ( String name , File file ) { return getOrOpen ( name , file , true ) ; } | Get the cached GeoPackage or open and cache the GeoPackage file |
3,778 | public static ImageRectangle getRectangle ( long width , long height , BoundingBox boundingBox , BoundingBox boundingBoxSection ) { ImageRectangleF rectF = getFloatRectangle ( width , height , boundingBox , boundingBoxSection ) ; ImageRectangle rect = rectF . round ( ) ; return rect ; } | Get a rectangle using the tile width height bounding box and the bounding box section within the outer box to build the rectangle from |
3,779 | public static ImageRectangleF getRoundedFloatRectangle ( long width , long height , BoundingBox boundingBox , BoundingBox boundingBoxSection ) { ImageRectangle rect = getRectangle ( width , height , boundingBox , boundingBoxSection ) ; ImageRectangleF rectF = new ImageRectangleF ( rect ) ; return rectF ; } | Get a rectangle with rounded floating point boundaries using the tile width height bounding box and the bounding box section within the outer box to build the rectangle from |
3,780 | public static ImageRectangleF getFloatRectangle ( long width , long height , BoundingBox boundingBox , BoundingBox boundingBoxSection ) { float left = TileBoundingBoxUtils . getXPixel ( width , boundingBox , boundingBoxSection . getMinLongitude ( ) ) ; float right = TileBoundingBoxUtils . getXPixel ( width , boundingBo... | Get a rectangle with floating point boundaries using the tile width height bounding box and the bounding box section within the outer box to build the rectangle from |
3,781 | public static synchronized String getProperty ( String key , boolean required ) { if ( mProperties == null ) { mProperties = initializeConfigurationProperties ( ) ; } String value = mProperties . getProperty ( key ) ; if ( value == null && required ) { throw new RuntimeException ( "Property not found: " + key ) ; } ret... | Get a property by key |
3,782 | public static String getProperty ( String base , String property ) { return getProperty ( base , property , true ) ; } | Get a required property by base property and property name |
3,783 | public static Integer getIntegerProperty ( String key , boolean required ) { Integer value = null ; String stringValue = getProperty ( key , required ) ; if ( stringValue != null ) { value = Integer . valueOf ( stringValue ) ; } return value ; } | Get an integer property by key |
3,784 | public static Float getFloatProperty ( String key , boolean required ) { Float value = null ; String stringValue = getProperty ( key , required ) ; if ( stringValue != null ) { value = Float . valueOf ( stringValue ) ; } return value ; } | Get a float by key |
3,785 | public static Boolean getBooleanProperty ( String key , boolean required ) { Boolean value = null ; String stringValue = getProperty ( key , required ) ; if ( stringValue != null ) { value = Boolean . valueOf ( stringValue ) ; } return value ; } | Get a boolean by key |
3,786 | public static Boolean getBooleanProperty ( String base , String property , boolean required ) { return getBooleanProperty ( base + JavaPropertyConstants . PROPERTY_DIVIDER + property , required ) ; } | Get a boolean property by base property and property name |
3,787 | public static Color getColorProperty ( String key , boolean required ) { Color value = null ; String redProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_RED ; String greenProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_GREEN ; String blu... | Get a color by key |
3,788 | public static Color getColorProperty ( String base , String property ) { return getColorProperty ( base , property , true ) ; } | Get a required color property by base property and property name |
3,789 | public void resize ( int maxCacheSize ) { setMaxCacheSize ( maxCacheSize ) ; for ( FeatureCache cache : tableCache . values ( ) ) { cache . resize ( maxCacheSize ) ; } } | Resize all caches and update the max cache size |
3,790 | public void setFlag ( CodecFlag flag ) throws JavaAVException { if ( flag == null ) throw new JavaAVException ( "Could not set codec flag. Null provided." ) ; flags . add ( flag ) ; } | Set a codec flag . |
3,791 | private void createImageBuffer ( ) throws JavaAVException { int format = pixelFormat . value ( ) ; int width = avContext . width ( ) ; int height = avContext . height ( ) ; picture = new AVPicture ( ) ; if ( avpicture_alloc ( picture , format , width , height ) < 0 ) throw new JavaAVException ( "Could not allocate pict... | Create resampled picture buffer . This is only needed if the decoded picture format differs from the desired format . |
3,792 | public static Codec getEncoderById ( CodecID codecId ) throws JavaAVException { if ( codecId == null ) throw new NullPointerException ( "CodecID is null." ) ; AVCodec avCodec = avcodec_find_encoder ( codecId . value ( ) ) ; if ( avCodec == null || avCodec . isNull ( ) ) throw new JavaAVException ( "Encoder not found: "... | Create a new encoder with specified codec id . |
3,793 | public static Codec getDecoderById ( CodecID codecId ) throws JavaAVException { if ( codecId == null ) throw new NullPointerException ( "CodecID is null." ) ; AVCodec avCodec = avcodec_find_decoder ( codecId . value ( ) ) ; if ( avCodec == null || avCodec . isNull ( ) ) throw new JavaAVException ( "Decoder not found: "... | Create a new decoder with specified codec id . |
3,794 | public static Codec getEncoderByName ( String avCodecName ) throws JavaAVException { if ( avCodecName == null || avCodecName . isEmpty ( ) ) throw new NullPointerException ( "Codec name is null or empty." ) ; AVCodec avCodec = avcodec_find_encoder_by_name ( avCodecName ) ; if ( avCodec == null || avCodec . isNull ( ) )... | Create a new encoder with specified codec name . |
3,795 | public static Codec getDecoderByName ( String avCodecName ) throws JavaAVException { if ( avCodecName == null || avCodecName . isEmpty ( ) ) throw new NullPointerException ( "Codec name is null or empty." ) ; AVCodec avCodec = avcodec_find_decoder_by_name ( avCodecName ) ; if ( avCodec == null || avCodec . isNull ( ) )... | Create a new decoder with specified codec name . |
3,796 | public static String [ ] getInstalledCodecs ( ) { Set < String > names = new TreeSet < String > ( ) ; AVCodec codec = null ; while ( ( codec = av_codec_next ( codec ) ) != null ) { String shortName = codec . name ( ) . getString ( ) ; String type = MediaType . byId ( codec . type ( ) ) . toString ( ) . substring ( 0 , ... | Get all names of codecs that are compiled into FFmpeg . |
3,797 | public MediaFrame readFrame ( ) throws JavaAVException { MediaFrame mediaFrame = new MediaFrame ( ) ; while ( mediaFrame != null && ! mediaFrame . hasFrame ( ) ) { if ( av_read_frame ( formatContext , avPacket ) < 0 ) { if ( videoDecoders . get ( avPacket . stream_index ( ) ) != null ) { avPacket . data ( null ) ; avPa... | Consecutively retrieves media frames from previously specified input source . The media type of the returned frame may alter between consecutive calls . One call may return an audio frame and the next call may return a video frame . |
3,798 | public static int getFormatDepth ( SampleFormat format ) { switch ( format ) { case U8 : case U8P : return 1 ; case S16 : case S16P : return 2 ; case S32 : case S32P : return 4 ; case FLT : case FLTP : return 4 ; case DBL : case DBLP : return 8 ; default : return 0 ; } } | Get number of bytes per sample for specified sample format . |
3,799 | public synchronized void clear ( ) { for ( int i = 0 ; i < planes ; i ++ ) { readPointer [ i ] = writePointer [ i ] = 0 ; bytesToRead [ i ] = 0 ; bytesToWrite [ i ] = buffer [ i ] . capacity ( ) ; } } | Resets the read and write pointers . The internal buffer remains unaffected . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.