[Geoserver-users] stroke-width precision

Hi,
I have problem with precision of SLD parameter stroke-width. It seems that
if I enter any stroke-width value from interval 0 -- 1.49, the line has also
the same width (1.00 I guess). Then, there is some break between values 1.49
and 1.50 -- just look at these two pictures:

1.49:
http://www.nabble.com/file/6837/1.49.bmp
1.50:
http://www.nabble.com/file/6838/1.50.bmp

The width changes continously from 1.5 to higher values and there are no
more break points (like 2.49 and 2.50).

I'm using GeoServer 1.5.0-RC1, slow Batik SVG rendering, antialiasing and
bicubic interpolation. I tried also GeoServer 1.4.0, but result is the same.

Does anyone know, what's the problem with unchanging width from interval 0
-- 1.49? Am I doing something wrong?

Thanks,
Jiri

Here is the SLD:
<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor version="1.0.0">
  <NamedLayer>
    <Name>topp:sil_2065</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1.49</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
--
View this message in context: http://www.nabble.com/stroke-width-precision-tf3307858.html#a9201142
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Jiri,

Does the problem only occur when you render with svg? Do you find the
same problem when you render to another format, like png for instance?

Also, which svg viewer are you using? I wonder if the problem is
persistent among different viewers.

-Justin

Jiri Kozel wrote:

Hi,
I have problem with precision of SLD parameter stroke-width. It seems that
if I enter any stroke-width value from interval 0 -- 1.49, the line has also
the same width (1.00 I guess). Then, there is some break between values 1.49
and 1.50 -- just look at these two pictures:

1.49:
http://www.nabble.com/file/6837/1.49.bmp
1.50:
http://www.nabble.com/file/6838/1.50.bmp

The width changes continously from 1.5 to higher values and there are no
more break points (like 2.49 and 2.50).

I'm using GeoServer 1.5.0-RC1, slow Batik SVG rendering, antialiasing and
bicubic interpolation. I tried also GeoServer 1.4.0, but result is the same.

Does anyone know, what's the problem with unchanging width from interval 0
-- 1.49? Am I doing something wrong?

Thanks,
Jiri

Here is the SLD:
<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor version="1.0.0">
  <NamedLayer>
    <Name>topp:sil_2065</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1.49</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hi Justin,
Little misunderstanding, I think. I don't use SVG viewer, but there is a
property in Geoserver called Rendering (Config > WMS > Rendering) and it is
set to "Batik (Slow, but full styling)". I have thought it could be relevant
to my problem.
I have tried png, jpeg and gif, but with the same result.
Jiri

Continuum-3 wrote:

Hi Jiri,

Does the problem only occur when you render with svg? Do you find the
same problem when you render to another format, like png for instance?

Also, which svg viewer are you using? I wonder if the problem is
persistent among different viewers.

-Justin

Jiri Kozel wrote:

Hi,
I have problem with precision of SLD parameter stroke-width. It seems
that
if I enter any stroke-width value from interval 0 -- 1.49, the line has
also
the same width (1.00 I guess). Then, there is some break between values
1.49
and 1.50 -- just look at these two pictures:

1.49:
http://www.nabble.com/file/6837/1.49.bmp
1.50:
http://www.nabble.com/file/6838/1.50.bmp

The width changes continously from 1.5 to higher values and there are no
more break points (like 2.49 and 2.50).

I'm using GeoServer 1.5.0-RC1, slow Batik SVG rendering, antialiasing and
bicubic interpolation. I tried also GeoServer 1.4.0, but result is the
same.

Does anyone know, what's the problem with unchanging width from interval
0
-- 1.49? Am I doing something wrong?

Thanks,
Jiri

Here is the SLD:
<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor version="1.0.0">
  <NamedLayer>
    <Name>topp:sil_2065</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1.49</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/stroke-width-precision-tf3307858.html#a9206510
Sent from the GeoServer - User mailing list archive at Nabble.com.

On 2/28/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Hi,
I have problem with precision of SLD parameter stroke-width. It seems that
if I enter any stroke-width value from interval 0 -- 1.49, the line has also
the same width (1.00 I guess). Then, there is some break between values 1.49
and 1.50 -- just look at these two pictures:

The stroke width is an integer width in pixels. So I guess we're doing
some rounding. I guess that values below 0.5 become 0 which geoserver
bumps up to 1 so that something gets drawn.

The next version of SLD will allow you to specify a unit of
measurement with your width but we don't support that yet, may be in
the summer when I have some time.

Ian

Hi Jiri,
The stroke width is the width in pixles. So it has to be whole numbers.

Brent Owens
(The Open Planning Project)

Jiri Kozel wrote:

Hi,
I have problem with precision of SLD parameter stroke-width. It seems that
if I enter any stroke-width value from interval 0 -- 1.49, the line has also
the same width (1.00 I guess). Then, there is some break between values 1.49
and 1.50 -- just look at these two pictures:

1.49:
http://www.nabble.com/file/6837/1.49.bmp 1.50:
http://www.nabble.com/file/6838/1.50.bmp

The width changes continously from 1.5 to higher values and there are no
more break points (like 2.49 and 2.50).

I'm using GeoServer 1.5.0-RC1, slow Batik SVG rendering, antialiasing and
bicubic interpolation. I tried also GeoServer 1.4.0, but result is the same.

Does anyone know, what's the problem with unchanging width from interval 0
-- 1.49? Am I doing something wrong?

Thanks,
Jiri

Here is the SLD:
<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor version="1.0.0">
  <NamedLayer>
    <Name>topp:sil_2065</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1.49</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
  

Hi Ian,

If it's true, I think it's a bug, because stroke-width is defined as a float
in current SLD specification.
Still, I can't understand why Geoserver renders width in floating-point
number greater than 1.49 correctly, but lesser then or equal to 1.49
incorrectly.

At any rate, I would appreciate if Geoserver could render stroke-width in
any floating-point number correctly. It sould not be great problem if
Geoserver uses Batik for rendering.

Thanks,
Jiri

Ian Turton wrote:

On 2/28/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Hi,
I have problem with precision of SLD parameter stroke-width. It seems
that
if I enter any stroke-width value from interval 0 -- 1.49, the line has
also
the same width (1.00 I guess). Then, there is some break between values
1.49
and 1.50 -- just look at these two pictures:

The stroke width is an integer width in pixels. So I guess we're doing
some rounding. I guess that values below 0.5 become 0 which geoserver
bumps up to 1 so that something gets drawn.

The next version of SLD will allow you to specify a unit of
measurement with your width but we don't support that yet, may be in
the summer when I have some time.

Ian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/stroke-width-precision-tf3307858.html#a9208970
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Brent,

I know it is in pixels, but stroke-width is defined as a float in current
SLD specification. Width as a floating-point number (even in pixels) is
common, also in SVG. I thought GeoServer uses SVG Batik for rendering (at
least optional), or not?

In addition, as I wrote to Ian, I can't understand why Geoserver renders
width in floating-point number greater than 1.49 correctly, but lesser then
or equal to 1.49 incorrectly.

Jiri Kozel

Brent Owens wrote:

Hi Jiri,
The stroke width is the width in pixles. So it has to be whole numbers.

Brent Owens
(The Open Planning Project)

Jiri Kozel wrote:

Hi,
I have problem with precision of SLD parameter stroke-width. It seems
that
if I enter any stroke-width value from interval 0 -- 1.49, the line has
also
the same width (1.00 I guess). Then, there is some break between values
1.49
and 1.50 -- just look at these two pictures:

1.49:
http://www.nabble.com/file/6837/1.49.bmp
1.50:
http://www.nabble.com/file/6838/1.50.bmp

The width changes continously from 1.5 to higher values and there are no
more break points (like 2.49 and 2.50).

I'm using GeoServer 1.5.0-RC1, slow Batik SVG rendering, antialiasing and
bicubic interpolation. I tried also GeoServer 1.4.0, but result is the
same.

Does anyone know, what's the problem with unchanging width from interval
0
-- 1.49? Am I doing something wrong?

Thanks,
Jiri

Here is the SLD:
<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor version="1.0.0">
  <NamedLayer>
    <Name>topp:sil_2065</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1.49</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
  
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/stroke-width-precision-tf3307858.html#a9215485
Sent from the GeoServer - User mailing list archive at Nabble.com.

Jiri Kozel ha scritto:

Hi Brent,

I know it is in pixels, but stroke-width is defined as a float in current
SLD specification.

We do implement SLD 1.0, not the latest, but I may be wrong.
The SLD engine wasn't changed in the last two years afaik.

Width as a floating-point number (even in pixels) is
common, also in SVG. I thought GeoServer uses SVG Batik for rendering (at
least optional), or not?

It uses batik only if you're requesting SVG output.

Cheers
Andrea

On 2/28/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Hi Ian,

If it's true, I think it's a bug, because stroke-width is defined as a float
in current SLD specification.

The specification actually says:
"The "stroke-width" CssParameter element gives the absolute width
(thickness) of a
stroke in pixels encoded as a float. (Arguably, more units could be
provided for encoding sizes, such as millimeters or typesetter's
points.) The default is 1.0. Fractional numbers are allowed (with a
system-dependent interpretation) but negative numbers are not. "

So in fact GeoServer is allowed to do anything it like with a
fractional value. So no it's not a bug.

As I say I'm not sure what happens below 0.5 (what does the renderer
do with a value of 0 width?) that might be a bug, but why would you
want to draw a line with no width so I guess drawing something is the
'right thing to do".

Ian

Ian,
You're right, I haven't read the last sentence about fractional numbers and
system dependance. So sorry for my bad opinion.

Value 0 returns the same width as anyother value lesser than 1.5, but as you
say: "drawing something is the 'right thing to do'" :slight_smile:

Anyway, it would be nice if GeoServer could draw lines with fractional value
width. There is a quite great difference between visual appearance of 1.49
and 1.5 width (mainly in png format).

Jiri

Ian Turton wrote:

On 2/28/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Hi Ian,

If it's true, I think it's a bug, because stroke-width is defined as a
float
in current SLD specification.

The specification actually says:
"The "stroke-width" CssParameter element gives the absolute width
(thickness) of a
stroke in pixels encoded as a float. (Arguably, more units could be
provided for encoding sizes, such as millimeters or typesetter's
points.) The default is 1.0. Fractional numbers are allowed (with a
system-dependent interpretation) but negative numbers are not. "

So in fact GeoServer is allowed to do anything it like with a
fractional value. So no it's not a bug.

As I say I'm not sure what happens below 0.5 (what does the renderer
do with a value of 0 width?) that might be a bug, but why would you
want to draw a line with no width so I guess drawing something is the
'right thing to do".

Ian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/stroke-width-precision-tf3307858.html#a9248033
Sent from the GeoServer - User mailing list archive at Nabble.com.

On 3/1/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Ian,
You're right, I haven't read the last sentence about fractional numbers and
system dependance. So sorry for my bad opinion.

Value 0 returns the same width as anyother value lesser than 1.5, but as you
say: "drawing something is the 'right thing to do'" :slight_smile:

Anyway, it would be nice if GeoServer could draw lines with fractional value
width. There is a quite great difference between visual appearance of 1.49
and 1.5 width (mainly in png format).

The problem is what does 1.5 pixels mean. Even when we move to the new
symbology encoding spec
(http://www.opengeospatial.org/standards/symbol) which allows you to
specify a width of 5 metres for your line, its still going to be an
integer number of pixels wide when its drawn.

Ian
--

Ian Turton
http://www.geotools.org
http://pennspace.blogspot.com/

I'm not a graphic specialist, but I think it has something to do with
anti-aliasing. SVG renderering could be good example. Look at the picture,
it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
http://www.nabble.com/file/6868/1-2.bmp

The second thing is, that Geoserver can already draw lines of fractional
width, but only from 1.5 to greater values (I've tried it). Furthermore,
output GeoServer's PNGs look like antialiased, so I guess it already do some
kind of anti-aliasing.

Jiri

Ian Turton wrote:

On 3/1/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Ian,
You're right, I haven't read the last sentence about fractional numbers
and
system dependance. So sorry for my bad opinion.

Value 0 returns the same width as anyother value lesser than 1.5, but as
you
say: "drawing something is the 'right thing to do'" :slight_smile:

Anyway, it would be nice if GeoServer could draw lines with fractional
value
width. There is a quite great difference between visual appearance of
1.49
and 1.5 width (mainly in png format).

The problem is what does 1.5 pixels mean. Even when we move to the new
symbology encoding spec
(http://www.opengeospatial.org/standards/symbol) which allows you to
specify a width of 5 metres for your line, its still going to be an
integer number of pixels wide when its drawn.

Ian
--

Ian Turton
http://www.geotools.org
http://pennspace.blogspot.com/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/stroke-width-precision-tf3307858.html#a9254043
Sent from the GeoServer - User mailing list archive at Nabble.com.

Jiri Kozel ha scritto:

I'm not a graphic specialist, but I think it has something to do with
anti-aliasing. SVG renderering could be good example. Look at the
picture, it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
http://www.nabble.com/file/6868/1-2.bmp

The second thing is, that Geoserver can already draw lines of
fractional width, but only from 1.5 to greater values (I've tried
it). Furthermore, output GeoServer's PNGs look like antialiased, so I
guess it already do some kind of anti-aliasing.

Ok, time for a wild guess. I kind of remember that a long long time ago,
when antialiasing was not used, we added a speed optimization to the
renderer: if the line width was too small, it was dropped down to 0
because the java2d routines were much faster with "0" width and the
result was exactly the same.
Without antialiasing, everything under 1.5 would be drawn as a single
pixel line anyways, but it may be that with antialiasing on things are
different.

I don't have time to check, but if that optimization is still there
(years have passed in the meantime) then it may be the cause for this
strange effect. If so, we should try if the perf difference is still
there, and eventually removing the optimization for antialiased drawing
(people are already paying quite a performance drop due to antialiasing,
I guess paying a little more won't make much of a difference).

Cheers
Andrea

Yeah, we use anti-aliasing extensively, it tends to make things look a lot better.

SVG, however, is one that probably benefits very little from anti-aliasing, since it's a vector format (though I could be wrong).

I think the batik rendering route is less than ideal, since it turns it in to a raster and then constructs a vector out of that, which is silly because we're going from vectors in our data.

The solution would be to make a special SVG output format that doesn't use batik.

Chris

Jiri Kozel wrote:

I'm not a graphic specialist, but I think it has something to do with
anti-aliasing. SVG renderering could be good example. Look at the picture,
it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
http://www.nabble.com/file/6868/1-2.bmp

The second thing is, that Geoserver can already draw lines of fractional
width, but only from 1.5 to greater values (I've tried it). Furthermore,
output GeoServer's PNGs look like antialiased, so I guess it already do some
kind of anti-aliasing.

Jiri

Ian Turton wrote:

On 3/1/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Ian,
You're right, I haven't read the last sentence about fractional numbers
and
system dependance. So sorry for my bad opinion.

Value 0 returns the same width as anyother value lesser than 1.5, but as
you
say: "drawing something is the 'right thing to do'" :slight_smile:

Anyway, it would be nice if GeoServer could draw lines with fractional
value
width. There is a quite great difference between visual appearance of
1.49
and 1.5 width (mainly in png format).

The problem is what does 1.5 pixels mean. Even when we move to the new
symbology encoding spec
(http://www.opengeospatial.org/standards/symbol) which allows you to
specify a width of 5 metres for your line, its still going to be an
integer number of pixels wide when its drawn.

Ian
--

Ian Turton
http://www.geotools.org
http://pennspace.blogspot.com/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

The solution would be to make a special SVG output format that doesn't
use batik.

I guess we are already part of the way there, we have the fast svg
renderer that Gabriel wrote. Might be worth spending some time having it
better support SLD.

Chris

Jiri Kozel wrote:

I'm not a graphic specialist, but I think it has something to do with
anti-aliasing. SVG renderering could be good example. Look at the
picture,
it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
http://www.nabble.com/file/6868/1-2.bmp
The second thing is, that Geoserver can already draw lines of fractional
width, but only from 1.5 to greater values (I've tried it). Furthermore,
output GeoServer's PNGs look like antialiased, so I guess it already
do some
kind of anti-aliasing.

Jiri

Ian Turton wrote:

On 3/1/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Ian,
You're right, I haven't read the last sentence about fractional numbers
and
system dependance. So sorry for my bad opinion.

Value 0 returns the same width as anyother value lesser than 1.5,
but as
you
say: "drawing something is the 'right thing to do'" :slight_smile:

Anyway, it would be nice if GeoServer could draw lines with fractional
value
width. There is a quite great difference between visual appearance of
1.49
and 1.5 width (mainly in png format).

The problem is what does 1.5 pixels mean. Even when we move to the new
symbology encoding spec
(http://www.opengeospatial.org/standards/symbol) which allows you to
specify a width of 5 metres for your line, its still going to be an
integer number of pixels wide when its drawn.

Ian
--

Ian Turton
http://www.geotools.org
http://pennspace.blogspot.com/

-------------------------------------------------------------------------

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

!DSPAM:1004,45e73319162772207481331!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1004,45e73319162772207481331!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira wrote:

The solution would be to make a special SVG output format that doesn't
use batik.

I guess we are already part of the way there, we have the fast svg
renderer that Gabriel wrote. Might be worth spending some time having it
better support SLD.

Yeah, except that's a non-trivial task. I agree his is a decent start, but getting styling on it is quite a bit harder.

I think the ideal is that we rework the renderer to factor out all the specific java2d stuff, so all the set up to get features in to layers and call their SLDs and the like is done there, but then passes off rendering to Java2d or KML or SVG.

Chris

Chris

Jiri Kozel wrote:

I'm not a graphic specialist, but I think it has something to do with
anti-aliasing. SVG renderering could be good example. Look at the
picture,
it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
http://www.nabble.com/file/6868/1-2.bmp
The second thing is, that Geoserver can already draw lines of fractional
width, but only from 1.5 to greater values (I've tried it). Furthermore,
output GeoServer's PNGs look like antialiased, so I guess it already
do some
kind of anti-aliasing.

Jiri

Ian Turton wrote:

On 3/1/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Ian,
You're right, I haven't read the last sentence about fractional numbers
and
system dependance. So sorry for my bad opinion.

Value 0 returns the same width as anyother value lesser than 1.5,
but as
you
say: "drawing something is the 'right thing to do'" :slight_smile:

Anyway, it would be nice if GeoServer could draw lines with fractional
value
width. There is a quite great difference between visual appearance of
1.49
and 1.5 width (mainly in png format).

The problem is what does 1.5 pixels mean. Even when we move to the new
symbology encoding spec
(http://www.opengeospatial.org/standards/symbol) which allows you to
specify a width of 5 metres for your line, its still going to be an
integer number of pixels wide when its drawn.

Ian
--

Ian Turton
http://www.geotools.org
http://pennspace.blogspot.com/

-------------------------------------------------------------------------

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1004,45e73319162772207481331!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

I guess you have guessed it. It could really cause the strange effect I was
writing about. I have tried to find this part of code, but it seems it is
located in one of jars without source code.

I believe it would be useful also for other people to set this strange
effect right.

Anyway, thanks for your reactions.

Jiri

aaime wrote:

Jiri Kozel ha scritto:

I'm not a graphic specialist, but I think it has something to do with
anti-aliasing. SVG renderering could be good example. Look at the
picture, it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
http://www.nabble.com/file/6868/1-2.bmp

The second thing is, that Geoserver can already draw lines of
fractional width, but only from 1.5 to greater values (I've tried
it). Furthermore, output GeoServer's PNGs look like antialiased, so I
guess it already do some kind of anti-aliasing.

Ok, time for a wild guess. I kind of remember that a long long time ago,
when antialiasing was not used, we added a speed optimization to the
renderer: if the line width was too small, it was dropped down to 0
because the java2d routines were much faster with "0" width and the
result was exactly the same.
Without antialiasing, everything under 1.5 would be drawn as a single
pixel line anyways, but it may be that with antialiasing on things are
different.

I don't have time to check, but if that optimization is still there
(years have passed in the meantime) then it may be the cause for this
strange effect. If so, we should try if the perf difference is still
there, and eventually removing the optimization for antialiased drawing
(people are already paying quite a performance drop due to antialiasing,
I guess paying a little more won't make much of a difference).

Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/stroke-width-precision-tf3307858.html#a9271728
Sent from the GeoServer - User mailing list archive at Nabble.com.

catching up...
On Thursday 01 March 2007 21:02, Chris Holmes wrote:

Yeah, we use anti-aliasing extensively, it tends to make things look a
lot better.

SVG, however, is one that probably benefits very little from
anti-aliasing, since it's a vector format (though I could be wrong).

the antialiasing rendering hint has no effect for the batik Graphics2D
implementation, it just don't apply. But almost everytime you see an svg
graphic you're seeing it antialiased though, since thats just a viewer option
and most viewers use antialiasing by default to present svg.

I think the batik rendering route is less than ideal, since it turns it
in to a raster and then constructs a vector out of that, which is silly
because we're going from vectors in our data.

uglier than that, it turns it into a DOM and then serializes the dom.

The solution would be to make a special SVG output format that doesn't
use batik.

Or to find out an "extension point" on the batik that writes the content right
away to an outputstream instead of building a DOM, or to just steal the batik
code that generates the svg stying from the Graphic2D methods, make a prescan
based on the SLD and build a map of SLD stylers/SVG style, write them at the
svg header, and then use the streaming encoder and set a class property for
each geometry which xlinks to the correct style...

sounds easy but I got lost more than once trying to do that. Never had enough
time to try seriously though, and you know I'm slow :slight_smile:

Cheers,

Gabriel

Chris

Jiri Kozel wrote:
> I'm not a graphic specialist, but I think it has something to do with
> anti-aliasing. SVG renderering could be good example. Look at the
> picture, it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
> http://www.nabble.com/file/6868/1-2.bmp
>
> The second thing is, that Geoserver can already draw lines of fractional
> width, but only from 1.5 to greater values (I've tried it). Furthermore,
> output GeoServer's PNGs look like antialiased, so I guess it already do
> some kind of anti-aliasing.
>
> Jiri
>
> Ian Turton wrote:
>> On 3/1/07, Jiri Kozel <jirikozel@anonymised.com> wrote:
>>> Ian,
>>> You're right, I haven't read the last sentence about fractional numbers
>>> and
>>> system dependance. So sorry for my bad opinion.
>>>
>>> Value 0 returns the same width as anyother value lesser than 1.5, but
>>> as you
>>> say: "drawing something is the 'right thing to do'" :slight_smile:
>>>
>>> Anyway, it would be nice if GeoServer could draw lines with fractional
>>> value
>>> width. There is a quite great difference between visual appearance of
>>> 1.49
>>> and 1.5 width (mainly in png format).
>>
>> The problem is what does 1.5 pixels mean. Even when we move to the new
>> symbology encoding spec
>> (http://www.opengeospatial.org/standards/symbol) which allows you to
>> specify a width of 5 metres for your line, its still going to be an
>> integer number of pixels wide when its drawn.
>>
>> Ian
>> --
>>
>> Ian Turton
>> http://www.geotools.org
>> http://pennspace.blogspot.com/
>>
>> ------------------------------------------------------------------------
>>- Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
>>V _______________________________________________
>> Geoserver-users mailing list
>> Geoserver-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users

The solution would be to make a special SVG output format that doesn't
use batik.

Or to find out an "extension point" on the batik that writes the content right away to an outputstream instead of building a DOM, or to just steal the batik code that generates the svg stying from the Graphic2D methods, make a prescan based on the SLD and build a map of SLD stylers/SVG style, write them at the svg header, and then use the streaming encoder and set a class property for each geometry which xlinks to the correct style...

sounds easy but I got lost more than once trying to do that. Never had enough time to try seriously though, and you know I'm slow :slight_smile:

Yeah, it'd be nice to get an engine that does the sld prescan and builds a map of stylers, since KML could use it as well - it basically has the same data with presentation mix that SVG has.

Chris

Cheers,

Gabriel

Chris

Jiri Kozel wrote:

I'm not a graphic specialist, but I think it has something to do with
anti-aliasing. SVG renderering could be good example. Look at the
picture, it shows black line with width 1.0, 1.25, 1.5, 1.75 and 2.0.
http://www.nabble.com/file/6868/1-2.bmp

The second thing is, that Geoserver can already draw lines of fractional
width, but only from 1.5 to greater values (I've tried it). Furthermore,
output GeoServer's PNGs look like antialiased, so I guess it already do
some kind of anti-aliasing.

Jiri

Ian Turton wrote:

On 3/1/07, Jiri Kozel <jirikozel@anonymised.com> wrote:

Ian,
You're right, I haven't read the last sentence about fractional numbers
and
system dependance. So sorry for my bad opinion.

Value 0 returns the same width as anyother value lesser than 1.5, but
as you
say: "drawing something is the 'right thing to do'" :slight_smile:

Anyway, it would be nice if GeoServer could draw lines with fractional
value
width. There is a quite great difference between visual appearance of
1.49
and 1.5 width (mainly in png format).

The problem is what does 1.5 pixels mean. Even when we move to the new
symbology encoding spec
(http://www.opengeospatial.org/standards/symbol) which allows you to
specify a width of 5 metres for your line, its still going to be an
integer number of pixels wide when its drawn.

Ian
--

Ian Turton
http://www.geotools.org
http://pennspace.blogspot.com/

------------------------------------------------------------------------
- Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V _______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,45e85f2923367731818748!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org