ThinkGeo Raster Sampling Logic and Behavior Matrix¶
Last Updated: February 24, 2026
Validated Against:thinkgeosdkcommit0918c8b2f
1. v14 Preset Behaviors (v14.4.4 Summary)¶
In v14.4.4, raster sampling followed a mostly path-driven model.
v14 Preset (DrawingQuality) | Vector/Text AA | Optimized Drawing Path | Normal Drawing Path |
|---|---|---|---|
HighSpeed | ON (default) | SKFilterQuality.High | SKFilterQuality.Low (bilinear) |
Default | ON (default) | SKFilterQuality.High | SKFilterQuality.Medium |
Medium | ON (default) | SKFilterQuality.High | SKFilterQuality.Medium |
HighQuality | ON (forced) | SKFilterQuality.High | SKFilterQuality.High |
SKFilterQuality.High in v14 was adaptive in practice:
- Upsample: bicubic-style filtering (Mitchell family behavior).
- Downsample: engine-level optimization that could apply mip-like behavior.
- Many map-related render paths were effectively forced to high-quality filtering.
2. v15 DrawingQuality Presets (Current)¶
In current v15 code, DrawingQuality maps to RenderingOptions and only controls anti-aliasing flags.
Preset (DrawingQuality) | Image AA | Vector AA | Text AA |
|---|---|---|---|
Standard (recommended) | OFF | ON | ON |
HighSpeed | OFF | OFF | OFF |
Default (deprecated) | OFF | ON | ON |
Medium (deprecated) | OFF | ON | ON |
HighQuality (deprecated) | OFF | ON | ON |
Sampling is configured independently (Section 3) and is not controlled by DrawingQuality.
3. Current Resampling Architecture¶
The runtime is not a single pipeline. There are two entry paths.
3.1 Layer-Based Path (LayerBase)¶
Used by most async/online/tile/vector layer draw paths:
Layer RasterContentType
-> LayerBase.GetRasterResamplingMode()
-> RasterResamplingMode
-> SkiaSamplingHelper.Resolve(...)
-> SKSamplingOptions
LayerBase.GetRasterResamplingMode() mapping:
Layer RasterContentType | Mode |
|---|---|
CategoricalRaster | NearestNeighbor |
CartographicTiles | CartographicAuto |
Imagery / ContinuousRaster / Unspecified | Auto |
3.2 RasterSource-Based Path (RasterLayer)¶
RasterLayer draw flow uses imageSource.GetResolvedMode() instead of LayerBase.GetRasterResamplingMode().
For GeoTiffRasterSource and SkiaRasterSource:
- If
ResamplingMode != Auto, use it directly. - Else if
GetRasterContentType() == CategoricalRaster, useNearestNeighbor. - Else return
Auto.
Important consequence:
- In this path, cartographic content does not automatically switch to
CartographicAuto; it remainsAutounless explicitly set.
3.3 WPF Raster Path (WpfRasterSource)¶
WpfRasterSource uses WPF BitmapScalingMode for resize operations:
- Explicit
ResamplingModewins when set. - If
Unspecified, default by content type: CategoricalRaster/CartographicTiles->NearestNeighborImagery/ContinuousRaster->LinearUnspecified->Unspecified
This path uses WPF scaling (RenderOptions.SetBitmapScalingMode) rather than Skia sampling options.
3.4 Skia Scale-Adaptive Rules¶
SkiaSamplingHelper.Resolve(...) behavior:
| Mode | Near Identity (0.95 <= scale <= 1.05) | Upsample (>1.05) | Downsample (<0.95) |
|---|---|---|---|
Auto | Mitchell | Mitchell | Linear + Mipmap |
CartographicAuto | Nearest | Mitchell | Linear + Mipmap |
NearestNeighbor | Nearest | Nearest | Nearest |
Bilinear | Bilinear | Bilinear | Bilinear |
Trilinear | Linear + Mipmap | Linear + Mipmap | Linear + Mipmap |
Bicubic | Mitchell | Mitchell | Mitchell |
4. How Content Type Is Determined (Current Code)¶
4.1 Feature Layers¶
FeatureLayer: scans styles; if anyHeatStyleexists ->ContinuousRaster; otherwise ->CartographicTiles.
4.2 Internet and Cloud Layers¶
Dynamic Imagery vs CartographicTiles by map/style type:
GoogleMapsAsyncLayerBingMapsAsyncLayerHereMapsRasterTileAsyncLayerMapBoxStaticTilesAsyncLayerThinkGeoRasterMapsAsyncLayerAzureMapsRasterAsyncLayer(also has weather tile sets mapped toContinuousRaster)
Always cartographic:
OpenStreetMapAsyncLayerThinkGeoVectorMapsAsyncLayer
4.3 Protocol Layers¶
Default to CartographicTiles:
WmsAsyncLayerWmtsAsyncLayerArcGisServerRestAsyncLayerArcGisServerRestVectorAsyncLayerWfsV2AsyncLayer
4.4 Raster Sources¶
GeoTiffRasterSource,SkiaRasterSource, andWpfRasterSourcecurrently do not overrideGetRasterContentTypeCore(), so default content type isUnspecifiedunless subclassed.- Their effective behavior therefore depends on explicit
ResamplingModeand/or source-specific fallback logic.
5. Practical Override Patterns¶
5.1 Override Layer Content Type¶
public class MyFeatureLayer : ShapeFileFeatureLayer
{
protected override RasterContentType GetRasterContentTypeCore()
=> RasterContentType.CartographicTiles;
}
5.2 Override Raster Source Content Type¶
public class MyGeoTiffSource : GeoTiffRasterSource
{
public MyGeoTiffSource(string path) : base(path) { }
protected override RasterContentType GetRasterContentTypeCore()
=> RasterContentType.CategoricalRaster;
}
5.3 Force an Explicit Resampling Mode¶
var layer = new GeoTiffRasterLayer("data.tif");
layer.ResamplingMode = RasterResamplingMode.CartographicAuto;
Use explicit mode when you need deterministic behavior independent of inferred content type.