mapnik / mapnik

Mapnik is an open source toolkit for developing mapping applications

Home Page:http://mapnik.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support of `segmentize` parameter to every symbolizer that supports simplification and smoothing

zdila opened this issue · comments

Add support of segmentize="<number>" attribute to every symbolizer that supports simplification and smoothing. See https://postgis.net/docs/ST_Segmentize.html.

Reason: If a line is simplified then it looses too many points for its straight parts which causes it to become severely smoothed if smooth is used.

Order should be:

  1. simplify
  2. segmentize
  3. smooth

Current workaround is to do it in SQL query (ST_Segmentize(ST_Simplify(geometry, 20), 200) AS geometry) and then only use smooth attribute.

Sample:

Without segmentization this linestring

image

becomes

image

which will be smoothed like this

image

With segmentization it would be something like this:

image

Problem with doing it in SQL is that parameterization (variables) can't be used there. An for other datasource types I see no other alternative at all.

Problem with doing it in SQL is that parameterization (variables) can't be used there.

Variables should actually be supported in SQL escaped by !: !@variable!