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

Stephen Woodbridge woodbri at swoodbridge.com
Tue Feb 19 08:09:40 PST 2013


On 2/19/2013 10:30 AM, Alan Boudreault wrote:
> Thanks Daniel for the good explanation. If everyone agree, I'll add this
> information in the RFC.
>
> Steve, in the code, if the UNITS is specified... it will be used. Else,
> I'll try to get the projection unit, and finally default to degree. Is
> this ok?

Yes, that sounds like the best effort that you can do. I agree with the 
change. If the user needs it to be more precise then they need to 
specify UNITS. Please add this detail to the RFC because it will need to 
be documented when everything is done.

Thanks,
   -Steve W

> Thanks,
> Alan
>
> On 13-02-19 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