[Geoserver-users] Polygons with outlines using gradients

Hello all,

Is it possible to style polygons so that their outline appears as a gradient? I’d like to define a coastline, for example, using a line that is, say 5 pixels wide, but whose colour fades to transparent. The gradient should be oriented with the solid colour closest to the inside of the polygon and the lighter colour furthest away from the polygon.

Not the best explanation, but hopefully you will understand what I mean!

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

Chris,

My approach would be to use the geometric transformation “buffer” several times on the polygon. Using a negative value, you would get polygons smaller than the input area. with every transformation you set a different colour to achieve a fading line effect, though generated using polygons.

Kind regards,

Edward


From: CHaste@anonymised.com
To: geoserver-users@lists.sourceforge.net
Date: Fri, 11 Jan 2013 08:10:38 -0500
Subject: [Geoserver-users] Polygons with outlines using gradients

Hello all,

Is it possible to style polygons so that their outline appears as a gradient? I’d like to define a coastline, for example, using a line that is, say 5 pixels wide, but whose colour fades to transparent. The gradient should be oriented with the solid colour closest to the inside of the polygon and the lighter colour furthest away from the polygon.

Not the best explanation, but hopefully you will understand what I mean!

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only – learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users

Thank you, Edward.

I wouldn’t want to end up with the polygon being smaller, so would that approach still work if a positive value was used?

From: Edward Mac Gillavry [mailto:emacgillavry@anonymised.com]
Sent: 11 January 2013 13:24
To: geoserver-users@anonymised.comt
Subject: Re: [Geoserver-users] Polygons with outlines using gradients

Chris,

My approach would be to use the geometric transformation “buffer” several times on the polygon. Using a negative value, you would get polygons smaller than the input area. with every transformation you set a different colour to achieve a fading line effect, though generated using polygons.

Kind regards,

Edward


From: CHaste@anonymised.com
To: geoserver-users@anonymised.comnet
Date: Fri, 11 Jan 2013 08:10:38 -0500
Subject: [Geoserver-users] Polygons with outlines using gradients

Hello all,

Is it possible to style polygons so that their outline appears as a gradient? I’d like to define a coastline, for example, using a line that is, say 5 pixels wide, but whose colour fades to transparent. The gradient should be oriented with the solid colour closest to the inside of the polygon and the lighter colour furthest away from the polygon.

Not the best explanation, but hopefully you will understand what I mean!

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only – learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hy Chris,

If you can understand french, I found a tutorial on a blog about this question, some weeks ago. As Edward wrote it, you cna do it with buffers, and then display it wih different opacities.
Here is the article : http://simonmercier.net/blog/?p=1214

He creates buffers that do not overlap (“ring” buffers) on the server side, and then applie transparency and color with MapServer.

Gabriel

Indeed, if you take the land mass polygons as a starting point, you’d indeed want to use a positive value for the buffer to extend the vignette into the water.

@Gabriel: Thanks for the reference to Simon Mercier’s blog! That’s invaluable!

Edward


From: CHaste@anonymised.com
To: emacgillavry@anonymised.com…95…; geoserver-users@lists.sourceforge.net
Date: Fri, 11 Jan 2013 08:34:02 -0500
Subject: RE: [Geoserver-users] Polygons with outlines using gradients

Thank you, Edward.

I wouldn’t want to end up with the polygon being smaller, so would that approach still work if a positive value was used?

From: Edward Mac Gillavry [mailto:emacgillavry@anonymised.com]
Sent: 11 January 2013 13:24
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Polygons with outlines using gradients

Chris,

My approach would be to use the geometric transformation “buffer” several times on the polygon. Using a negative value, you would get polygons smaller than the input area. with every transformation you set a different colour to achieve a fading line effect, though generated using polygons.

Kind regards,

Edward


From: CHaste@anonymised.com
To: geoserver-users@anonymised.com.net
Date: Fri, 11 Jan 2013 08:10:38 -0500
Subject: [Geoserver-users] Polygons with outlines using gradients

Hello all,

Is it possible to style polygons so that their outline appears as a gradient? I’d like to define a coastline, for example, using a line that is, say 5 pixels wide, but whose colour fades to transparent. The gradient should be oriented with the solid colour closest to the inside of the polygon and the lighter colour furthest away from the polygon.

Not the best explanation, but hopefully you will understand what I mean!

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only – learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users

http://sig.cmparks.net/cmp-ms-90x122.pngStephen V. Mather
GIS Manager
(216) 635-3243 (Work)
clevelandmetroparks.com

···

From: Edward Mac Gillavry [mailto:emacgillavry@anonymised.com]
Sent: 11 January 2013 13:24
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Polygons with outlines using gradients

Chris,

My approach would be to use the geometric transformation “buffer” several times on the polygon. Using a negative value, you would get polygons smaller than the input area. with every transformation you set a different colour to achieve a fading line effect, though generated using polygons.

Kind regards,

Edward


From: CHaste@anonymised.com
To: geoserver-users@lists.sourceforge.net
Date: Fri, 11 Jan 2013 08:10:38 -0500
Subject: [Geoserver-users] Polygons with outlines using gradients

Hello all,

Is it possible to style polygons so that their outline appears as a gradient? I’d like to define a coastline, for example, using a line that is, say 5 pixels wide, but whose colour fades to transparent. The gradient should be oriented with the solid colour closest to the inside of the polygon and the lighter colour furthest away from the polygon.

Not the best explanation, but hopefully you will understand what I mean!

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only – learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users

http://sig.cmparks.net/cmp-ms-90x122.pngStephen V. Mather
GIS Manager
(216) 635-3243 (Work)
clevelandmetroparks.com

···

From: Edward Mac Gillavry [mailto:emacgillavry@anonymised.com]
Sent: 11 January 2013 13:24
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Polygons with outlines using gradients

Chris,

My approach would be to use the geometric transformation “buffer” several times on the polygon. Using a negative value, you would get polygons smaller than the input area. with every transformation you set a different colour to achieve a fading line effect, though generated using polygons.

Kind regards,

Edward


From: CHaste@anonymised.com
To: geoserver-users@lists.sourceforge.net
Date: Fri, 11 Jan 2013 08:10:38 -0500
Subject: [Geoserver-users] Polygons with outlines using gradients

Hello all,

Is it possible to style polygons so that their outline appears as a gradient? I’d like to define a coastline, for example, using a line that is, say 5 pixels wide, but whose colour fades to transparent. The gradient should be oriented with the solid colour closest to the inside of the polygon and the lighter colour furthest away from the polygon.

Not the best explanation, but hopefully you will understand what I mean!

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only – learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users

You could also try to make a rendering transformation for it, see http://docs.geoserver.org/stable/en/user/styling/sld-extensions/rendering-transform.html for a start.

So instead of storing the rings in your database you could have geoserver create them on the fly with a WPS process that’s only applied at render time.

···

On Fri, Jan 11, 2013 at 10:10 AM, Gabriel Vatin <gabriel.vatin@anonymised.com> wrote:

True that this kind of buffers is quite good… if you keep the same resolution. If you zoom in or out too much, it looses its interest.
Thanks Stephen for the triggered buffers, it’s good to know !

On 11/01/2013 15:23, Stephen V. Mather wrote:

Not a bad way to go, doesn’t show you the styling but in mapserver. The advantage to this approach is you are not recalculating the buffers each time. The disadvantage is the same-- they are static, so to change them requires creating new geometry in the database.

Here it is in broken (google) English:

http://translate.google.com/translate?sl=auto&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&eotf=1&u=http%3A%2F%2Fsimonmercier.net%2Fblog%2F%3Fp%3D1214

Also, I have a pretty old post on this with the buffers created as a trigger on insert (probably requires an update trigger as well which is not in this example-- also may not be the best plpgsql, so buyer beware):

https://smathermather.wordpress.com/2010/05/26/multi-ring-buffers-in-postgis/

Depending on your geometry, this could be quite expensive computationally.

Best,
Steve

Stephen V. Mather
GIS Manager
(216) 635-3243 (Work)
clevelandmetroparks.com


From: Gabriel Vatin [gabriel.vatin@anonymised.com]
Sent: Friday, January 11, 2013 8:42 AM
To: Chris Haste
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Polygons with outlines using gradients

Hy Chris,

If you can understand french, I found a tutorial on a blog about this question, some weeks ago. As Edward wrote it, you cna do it with buffers, and then display it wih different opacities.
Here is the article : http://simonmercier.net/blog/?p=1214

He creates buffers that do not overlap (“ring” buffers) on the server side, and then applie transparency and color with MapServer.

Gabriel

On 11/01/2013 14:34, Chris Haste wrote:

Thank you, Edward.

I wouldn’t want to end up with the polygon being smaller, so would that approach still work if a positive value was used?

From: Edward Mac Gillavry [mailto:emacgillavry@anonymised.com]
Sent: 11 January 2013 13:24
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Polygons with outlines using gradients

Chris,

My approach would be to use the geometric transformation “buffer” several times on the polygon. Using a negative value, you would get polygons smaller than the input area. with every transformation you set a different colour to achieve a fading line effect, though generated using polygons.

Kind regards,

Edward


From: CHaste@anonymised.com
To: geoserver-users@lists.sourceforge.net
Date: Fri, 11 Jan 2013 08:10:38 -0500
Subject: [Geoserver-users] Polygons with outlines using gradients

Hello all,

Is it possible to style polygons so that their outline appears as a gradient? I’d like to define a coastline, for example, using a line that is, say 5 pixels wide, but whose colour fades to transparent. The gradient should be oriented with the solid colour closest to the inside of the polygon and the lighter colour furthest away from the polygon.

Not the best explanation, but hopefully you will understand what I mean!

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only – learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users


------------------------------------------------------------------------------
Master HTML5, CSS3, [ASP.NET](http://ASP.NET), MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
[http://p.sf.net/sfu/learnmore_122812](http://p.sf.net/sfu/learnmore_122812)

_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)


Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only – learn more at:
http://p.sf.net/sfu/learnmore_122812


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