[mapserver-users] Fractional line widths?
Dane Springmeyer
blake at hailmail.net
Fri Oct 10 17:03:57 PDT 2008
Hi All,
So, as of r7923 MapServer can now render some super thin lines using
the subpixel rendering of AGG. The change allows you to enter values
for the WIDTH parameter as doubles/fractions which can give the result
I've been looking for.
I think is really cool, and if anyone is interested in the different
results you can check out the image comparisons I've posted on this
ticket:
http://trac.osgeo.org/mapserver/ticket/2745#comment:6
Thanks dmorrissette, sdlime, and tbonfort for making this happen!
Dane
On Sep 4, 2008, at 7:10 PM, Dane Springmeyer wrote:
> Thomas,
>
> Thanks for the tip, but I think I don't quite understand the right
> syntax.
>
> First of all, I'm running the mac binary from kyngchaos, version 5.2.0
>
> I've tried to add two style blocks like:
>
> LAYER
> NAME world_opacity
> DATA world_borders.shp
> STATUS ON
> TYPE POLYGON
> CLASS
> NAME "World"
> STYLE
> COLOR 242 239 249
> OUTLINECOLOR -1 -1 -1
> END
> STYLE
> COLOR -1 -1 -1
> OUTLINECOLOR 127 127 127
> OPACITY 50
> WIDTH 1
> END
> END # class
> END # layer
>
> to create this full mapfile: http://mapnik-utils.googlecode.com/svn/trunk/tutorials/hello_world/mapserver_comparison/mapfile_config/world.map
>
> But that does not produce a result more akin to WIDTH 0.5, from what
> I can tell. It simply lightens the color of the outline, and in this
> case make it 'seem' even thicker. It is as if the opacity is not
> working as a true alpha opacity.
>
> Here is the example output with OPACITY 50:
>
> http://mapnik-utils.googlecode.com/svn/trunk/tutorials/hello_world/mapserver_comparison/mapfile_config/map/hello_world_with_mapserver_mapfile_opacity.png
>
> Is this the expected behavior or have I made an error in my mapfile
> syntax (highly likely). Perhaps I am not correctly turning off the
> outline for the first style?
>
> The issue may also be with my OUTPUTFORMAT, which is not using the
> RGBA:
>
> OUTPUTFORMAT
> NAME 'AGG'
> DRIVER AGG/PNG
> IMAGEMODE RGB
> MIMETYPE "image/png"
> END
>
> I also tried with:
>
> OUTPUTFORMAT
> NAME 'AGGA'
> DRIVER AGG/PNG
> IMAGEMODE RGBA
> MIMETYPE "image/png"
> END
>
> but I get an error when I add the 'AGGA' (based on reading http://mapserver.gis.umn.edu/docs/howto/agg-rendering-specifics)
> :
>
> msPostMapParseOutputFormatSetup(): General error message. Unable to
> select IMAGETYPE `AGG'.
>
>
> Any thoughts?
>
> Thanks,
>
> Dane
>
>
>
> On Aug 31, 2008, at 2:50 PM, thomas bonfort wrote:
>
>> hi.
>> yes, you need two style blocks inside your class
>> cheers,
>> thomas
>>
>> On Sun, Aug 31, 2008 at 9:43 PM, Dane Springmeyer
>> <blake at hailmail.net> wrote:
>>> Hi Thomas,
>>>
>>> Thanks for the followup.
>>>
>>> The OPACITY keyword seems to apply to both the polyon fill (COLOR)
>>> and the
>>> outline (OUTLINECOLOR).
>>>
>>> What is the trick to apply it to only the outline? I tried
>>> OUTLINEOPACITY,
>>> which of course does not exist.
>>>
>>> Do I need to pull out a style class for just the outline?
>>>
>>> Here is the mapfile I am working from:
>>>
>>> http://mapnik-utils.googlecode.com/svn/trunk/tutorials/hello_world/mapserver_comparison/mapfile_config/world.map
>>>
>>> Thanks,
>>>
>>> Dane
>>>
>>>
>>> On Aug 30, 2008, at 12:22 AM, thomas bonfort wrote:
>>>
>>>> Sorry for not hopping into the thread earlier, blame holidays :)
>>>>
>>>> For the time being, you can achieve similar output with mapserver
>>>> 5.2,
>>>> by using the OPACITY keyword at the style level
>>>>
>>>> STYLE
>>>> COLOR r g b
>>>> OPACITY 50 # essentially the same as WIDTH 0.5
>>>> WIDTH 1
>>>> END
>>>>
>>>> cheers,
>>>> thomas
>>>>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081010/2b584205/attachment.htm>
More information about the MapServer-users
mailing list