[mapserver-dev] RFC 89 Layer Geomtransform: Call for vote

Stephen Woodbridge woodbri at swoodbridge.com
Tue Feb 19 07:25:11 PST 2013


Daniel,

I think this makes sense for a consistency point of view, but how then 
we also need to consider how to handle this when the UNITS tag is 
defined. I hate to make this more complicated but I think you need to 
consider this.

-Steve W

On 2/19/2013 10:12 AM, Daniel Morissette wrote:
> Alan, All,
>
> As we looked into the implementation details with Alan, we found out
> that the STYLE-level GEOMTRANSFORM receives a shape in pixel
> coordinates, whereas the LAYER-level GEOMTRANSFORM will receive the raw
> shape in ground coordinates (meters, degrees, etc.)
>
> This poses a little potential for confusion in the user's mind as the
> argument to methods such as simplify() must be in the same units as the
> coordinates of the shapes at that point of the rendering workflow, i.e.
> pixels at the STYLE-level and in ground units at the LAYER-level.
>
> e.g.
>
> LAYER NAME "my_layer"
>    TYPE LINE
>    STATUS DEFAULT
>    DATA "lines.shp"
>    GEOMTRANSFORM (simplify([shape], 10))  ## 10 ground units
>    CLASS
>      STYLE
>        GEOMTRANSFORM (buffer([shape], 5)  ## 5 pixels
>        WIDTH 2
>        COLOR 255 0 0
>      END
>    END
> END
>
>
> It would be possible (but messy) to include some maths at the
> layer-level to allow passing a value in pixels at the layer level as
> well. This way things would be consistent between STYLE level and LAYER
> level as we would always pass args in pixels, but this may not be what
> we want in lots of cases, for instance if a LAYER-level GEOMTRANSFORM is
> used to simplify shapes in a WFS context where pixel size makes no or
> little sense.
>
> It is also not possible at all to deal with values in ground units at
> the style level because we do not have information about map cellsize at
> that level in the code (so passing values in ground units at the style
> level is not an option without messy code changes)
>
> Note that in cases where we want to pass a pixel value at the layer
> level, a [map_cellsize]  variable will be available, e.g.
>
> LAYER NAME "my_layer"
>    TYPE LINE
>    STATUS DEFAULT
>    DATA "lines.shp"
>    # 10 * [map_cellsize] == 10 pixels converted to ground units
>    GEOMTRANSFORM (simplify([shape], [map_cellsize]*10))
>    ...
>
>
> It seems that our best option would be to keep the values as pixels at
> the style level and ground units at the layer level, and properly
> document the difference, and hope that users won't be too confused.
>
> What do you all think?
>
> Daniel
>
>
>
> On 13-02-14 6:58 AM, Alan Boudreault wrote:
>> Hi devs,
>>
>> Please vote on RFC 89, Layer Geomtransform (
>> http://mapserver.org/trunk/development/rfc/ms-rfc-89.html )
>>
>> I'll start with my +1.
>>
>> Thanks,
>> Alan
>>
>
>



More information about the mapserver-dev mailing list