GPU rendering (15.0.0-beta202): thin dark line along the centre of polygon outlines and lines, classic renders correctly

Environment

  • ThinkGeo.Core / ThinkGeo.UI.Wpf / ThinkGeo.Gpu 15.0.0-beta202
  • .NET 8 WPF, Windows
  • Styles translated with FeatureLayerTranslator.Translate(layer, source, source.TileMatrixSet.GetScales()) , added with new MapStyle().AddFeatureLayer(translation) and shown through GpuBasemap
  • Native EPSG:25832 grid ( FeatureSourceVectorTileSource with bounds (0, 10000000, 1000000, 0) , GeographyUnit.Meter )

Problem In GPU mode, polygon borders (and line features) show a thin dark/black line running along the middle of the stroke. With the same layers and styles, classic LayerOverlay rendering looks correct: a solid, evenly coloured border.

The translation reports no warnings. The styles are plain solid pens and solid brushes, with no dashes, hatches, gradients or offsets.

Minimal setup

using System.Collections.Generic;
using ThinkGeo.Core;

var layer = new InMemoryFeatureLayer();
layer.InternalFeatures.Add(new Feature(
    "POLYGON((640000 5350000,640100 5350000,640100 5350100," +
    "640000 5350100,640000 5350000))"));
layer.InternalFeatures.Add(new Feature(
    "LINESTRING(640000 5349980,640100 5349980)"));

var zoom = layer.ZoomLevelSet.ZoomLevel01;
zoom.DefaultAreaStyle = new AreaStyle(
    new GeoPen(GeoColors.Blue, 6), new GeoSolidBrush(GeoColor.FromArgb(120, GeoColors.LightBlue)));
zoom.DefaultLineStyle = new LineStyle(
    new GeoPen(GeoColors.Blue, 6), new GeoPen(GeoColors.Yellow, 3));
zoom.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

var source = new FeatureSourceVectorTileSource(
    new RectangleShape(0, 10000000, 1000000, 0), GeographyUnit.Meter)
{
    SourceId = "outline-probe",
    MaxConcurrentEncodes = 1
};
source.MaxDataZoom = source.TileMatrixSet.TileMatrices.Count - 1;
source.FeatureSources.Add("features", layer.FeatureSource);

var translation = FeatureLayerTranslator.Translate(
    layer, source, source.TileMatrixSet.GetScales());
var style = new MapStyle().AddFeatureLayer(translation);
style.SetBackground(GeoColors.White);
// map.MapUnit = GeographyUnit.Meter;
// map.Basemap = new GpuBasemap(style);
// view extent (639950, 5350150, 640150, 5349950)

For comparison, draw the same layer in a LayerOverlay at that extent.

Expected: a solid 6 px blue border around the polygon, and a blue line with a yellow core, the same as classic. Actual (GPU): a thin dark line along the centre of the stroke.

What we checked on our side

  • The translator output is as expected: a fill layer plus a separate outline line layer for the polygon, and outer/inner line layers for the line style. Transparent pens are skipped and colours keep their alpha.
  • Our application doesn’t add any extra pens. The polygon uses a single outline pen.

Hi Julian,

It’s fixed in 15.0.0-beta204.

The dark line is not the stroke — it is two pens meeting. Your zoom level carries an area style and a line style, and the translated layers never said which geometry each one draws, so the line style’s pens were stroking the polygon’s rings as well. Across your six-pixel blue border that gives blue, the blend at (136,136,119), the line style’s yellow, then blue again. With a narrower inner pen the yellow is too thin to see and only the grey seam shows, which is what you were looking at. It went the other way too: the area style’s outline pen was stroking your line features.

Classic skips a feature that is not its kind — AreaStyle passes over anything that is not a polygon, LineStyle over anything that is not a line. The translation now says the same thing, so your border comes out as six pixels of solid blue, and a line under an area style alone is not drawn at all. Nothing to change on your side.

Just FYI: MapStyle and FeatureLayerTranslator are now within the ThinkGeo.Core.Styling namespace. We are doing the API review and you might see some other name changes in the future betas.

Thanks,
Ben

1 Like