Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erroneous extra outlines when using WIDTH based on an attribute #7051

Open
Skrol29 opened this issue Mar 14, 2024 · 4 comments
Open

erroneous extra outlines when using WIDTH based on an attribute #7051

Skrol29 opened this issue Mar 14, 2024 · 4 comments

Comments

@Skrol29
Copy link

Skrol29 commented Mar 14, 2024

Expected behavior and actual behavior

Actual behavior :

When displaying polygon outlines, some extra borders are added on the edge of the image,
sometimes like if they should close the partial polygons,
sometimes on a full edge.

This happens when using an outline WIDTH based on an attribute, and when then values of this attribute is equal or higher that 7.
The greater the width is, the more obvious the error is.

Example with a WMS tiled web page (width given with an attribute’s value equal to 9)

error_example_tiles

Expected behavior :

No extra borders on the edges of the image.

Steps to reproduce the problem

  1. Make a layer that should display polygons, layer must also has data which gives an numerical attribute.
  2. For this layer, define a simple style using a fixed OUTLINECOLOR and a WIDTH based on the attribute.
    Example : STYLE OUTLINECOLOR '#00ff00' WIDTH [my_width] END
  3. In the data source, change the attribute value to be 7 or more (14 for example).
  4. Output an image with a BBOX that is supposed to display partially a polygon.

Attach simple test case

border_issue.zip

Operating system

Rocky Linux release 8.9
Windows 11 - 23H2

MapServer version and installation method

MapServer version 8.0.1

Linux: build from source, on Rocky Linux release 8.9 (Green Obsidian)
Windows: build provided by GisInternals (https://www.gisinternals.com)

Other examples

Layer example with PostGis

  LAYER

    NAME 'layer_test'
    TYPE polygon
    CONNECTIONTYPE postgis
    CONNECTION "host=xxx user=xxx dbname=xxx port=5432 password=xxx"
    DATA "geom FROM (
      SELECT 29 as id
      , st_buffer(
          t_setsrid(st_makepoint(1.99, 46.50), 4326)::geography
          ,
          115 * 1000
        ) AS geom
      , 14 AS my_width
     ) AS t USING UNIQUE id USING SRID=4326"

    CLASS
      STYLE
        OUTLINECOLOR '#00ff00'
        WIDTH [my_width]
      END
    END
  
  END

Produced tile on BBOX 0,45.0890,2.8125,47.0401 (wgs84) :
error_example_circle

Other single tile

error_example_polygon

@geographika
Copy link
Member

@Skrol29 - it looks like the features are clipped and then the OUTLINECOLOR is applied to the clipped feature.

It doesn't seem to address this case, but you could try testing against the main branch, which includes changes relating to attribute binding and WIDTH/OUTLINEWIDTH in #6964.

I presume non-titled requests are fine?

You could also see if adding a buffer around the edge of the tile (I guess to the max value in your [my_width] attribute).

  WEB
    METADATA
      "tile_map_edge_buffer" "10"
      "tile_metatile_level" "0"
    END #metadata

@Skrol29
Copy link
Author

Skrol29 commented Mar 18, 2024

@geographika

I presume non-titled requests are fine?

The problem occurs only for polygons that are partially drawn in the frame. Thus, only for framed rendering.

You could also see if adding a buffer around the edge of the tile (I guess to the max value in your [my_width] attribute).

We have lot of layers in our Mapfile, so such a configuration could penalize other layers.
Another point is, in this case, the attribute [my_width] is made for the user to freely choose the width of the rendering. So it could theoretically be more than 10 pixel width wanted.

@Skrol29
Copy link
Author

Skrol29 commented Mar 18, 2024

@geographika

It doesn't seem to address this case, but you could try testing against the main branch, which includes changes relating to attribute binding and WIDTH/OUTLINEWIDTH in #6964.

I’ve tested the main branch, and the problem still occurs.

@geographika
Copy link
Member

@Skrol29 - as the features draw without issues when using a fixed width it is likely to be a combination of not calling msBindLayerToShape in mapdraw.c at the correct place, possibly in combination with the logic in msOutlineRenderingPrepareStyle in maprendering.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants