Package com.luciad.fusion.util
Class TLfnScaleUtil
java.lang.Object
com.luciad.fusion.util.TLfnScaleUtil
Utility to calculate scales and levels for various inputs.
- Since:
- 11.0
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
computeScaleDenominator
(ILcdModel aModel, ILcdStatusListener aStatusListener) Compute the scale of a model.static int
convertPixelDensityToScaleDenominator
(double aPixelDensity, ILcdGeoReference aGeoReference) Calculates the scale denominator that corresponds to the pixel density, assuming a pixel size of 0.28 mm.static int
getMaxLevel
(ILcdBounds aBounds, ILcdGeoReference aGeoReference, long aLevel0Rows, long aLevel0Columns, List<TLfnVectorAssetMetadata> aAllAssetMetadata) Computes the most detailed level that is needed for the assets in a coverage.static int
getOptimalScaleDenominator
(ILcdBounds aBounds, ILcdGeoReference aGeoReference, long aLevel0Rows, long aLevel0Columns, int aLevel) Compute the optimal scale of a coverage at the specified level.
-
Field Details
-
UNKNOWN_SCALE_DENOMINATOR
public static final int UNKNOWN_SCALE_DENOMINATOR- See Also:
-
-
Method Details
-
convertPixelDensityToScaleDenominator
public static int convertPixelDensityToScaleDenominator(double aPixelDensity, ILcdGeoReference aGeoReference) Calculates the scale denominator that corresponds to the pixel density, assuming a pixel size of 0.28 mm.- Parameters:
aPixelDensity
- the pixel density in pixels per square model unitaGeoReference
- the geographic reference- Returns:
- the scale denominator, such that scale = (1 / scale denominator)
-
getMaxLevel
public static int getMaxLevel(ILcdBounds aBounds, ILcdGeoReference aGeoReference, long aLevel0Rows, long aLevel0Columns, List<TLfnVectorAssetMetadata> aAllAssetMetadata) Computes the most detailed level that is needed for the assets in a coverage. The level is chosen such that its scale is greater than or equal to the largest asset scale.- Parameters:
aBounds
- the coverage boundsaGeoReference
- the coverage geographic referenceaLevel0Rows
- the number of rows at level 0 in the coverageaLevel0Columns
- the number of columns at level 0 in the coverageaAllAssetMetadata
- all the asset metadata to compute the max. level for- Returns:
- the most detailed level, such that # levels = (max. level + 1)
-
getOptimalScaleDenominator
public static int getOptimalScaleDenominator(ILcdBounds aBounds, ILcdGeoReference aGeoReference, long aLevel0Rows, long aLevel0Columns, int aLevel) Compute the optimal scale of a coverage at the specified level. The scale is such that a tile will be mapped to 256x256 pixels.- Parameters:
aBounds
- the coverage boundsaGeoReference
- the coverage geographic referenceaLevel0Rows
- the number of rows at level 0aLevel0Columns
- the number of columns at level 0aLevel
- the level- Returns:
- the scale denominator, ie. scale = (1 / scaledenominator)
-
computeScaleDenominator
Compute the scale of a model. The status listener can be used to monitor the progress of the computation.- Parameters:
aModel
- the modelaStatusListener
- the status listener ornull
- Returns:
- the scale denominator, ie. scale = (1 / scaledenominator)
-