[Geoserver-users] proper SLD to display oceans from OSM data?

Hi,

I wonder what the proper way is to render maps that show oceans in a
proper manner (say, oceans being blue), based on OSM data? (when having
an OSM planet imported into a PostGIS database)?

it seems that trying to use natural=coastline doesn't work, as the
coastline encloses the land mass, not the water

all tips welcome

Akos

Hi,

The trick they use in the Mapnik maps is not to colour the oceans because 70% of Earth is water. Therefore the background colour is set to ocean blue and land masses are drawn above it from the land polygons data set http://openstreetmapdata.com/data/land-polygons.

-Jukka Rahkonen-

Ákos Maróy wrote:

Hi,

I wonder what the proper way is to render maps that show oceans in a
proper manner (say, oceans being blue), based on OSM data? (when having
an OSM planet imported into a PostGIS database)?

it seems that trying to use natural=coastline doesn't work, as the
coastline encloses the land mass, not the water

all tips welcome

Akos

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On 22/10/13 06:13, Rahkonen Jukka wrote:

The trick they use in the Mapnik maps is not to colour the oceans because 70% of Earth is water. Therefore the background colour is set to ocean blue and land masses are drawn above it from the land polygons data set http://openstreetmapdata.com/data/land-polygons.

can you be more specific on how to solve this using SLDs? I can't see a
generic background option in SLD :frowning:

On Tue, Oct 22, 2013 at 8:08 AM, Ákos Maróy <akos@anonymised.com> wrote:

On 22/10/13 06:13, Rahkonen Jukka wrote:
> The trick they use in the Mapnik maps is not to colour the oceans
because 70% of Earth is water. Therefore the background colour is set to
ocean blue and land masses are drawn above it from the land polygons data
set http://openstreetmapdata.com/data/land-polygons.
>
can you be more specific on how to solve this using SLDs? I can't see a
generic background option in SLD :frowning:

Because there is none. You have to ask for the bgcolor in the GetMap request

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

Yes, unless you get/generate ocean polygons and style them with a fill.

···

On Tue, Oct 22, 2013 at 5:16 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Tue, Oct 22, 2013 at 8:08 AM, Ákos Maróy <akos@anonymised.com> wrote:


October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk


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

On 22/10/13 06:13, Rahkonen Jukka wrote:

The trick they use in the Mapnik maps is not to colour the oceans because 70% of Earth is water. Therefore the background colour is set to ocean blue and land masses are drawn above it from the land polygons data set http://openstreetmapdata.com/data/land-polygons.

can you be more specific on how to solve this using SLDs? I can’t see a
generic background option in SLD :frowning:

Because there is none. You have to ask for the bgcolor in the GetMap request

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Tue, Oct 22, 2013 at 8:20 AM, Chris Berkhout <chrisberkhout@anonymised.com>wrote:

Yes, unless you get/generate ocean polygons and style them with a fill.

No need to actually make ocean polygons. In the default GeoServer data dir
there
is this "giant polygon" layer which is really just a rectangle in 4326
covering the entire
world.

Color it blue, put it at the bottom of your map stack using SLD, done, and
faster
than having to load the detailed coastlines another time just to paint
water blue
(useful in case you're not controlling the clients)

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

I see as I’m using custom code that calls GeoTools to render data, I guess I’ll have to force my own background color in there somehow via code then

···

On 22/10/13 08:16, Andrea Aime wrote:

On Tue, Oct 22, 2013 at 8:08 AM, Ákos Maróy <akos@anonymised.com> wrote:

On 22/10/13 06:13, Rahkonen Jukka wrote:

The trick they use in the Mapnik maps is not to colour the oceans because 70% of Earth is water. Therefore the background colour is set to ocean blue and land masses are drawn above it from the land polygons data set http://openstreetmapdata.com/data/land-polygons.

can you be more specific on how to solve this using SLDs? I can’t see a
generic background option in SLD :frowning:

Because there is none. You have to ask for the bgcolor in the GetMap request

On Tue, Oct 22, 2013 at 8:35 AM, Ákos Maróy <akos@anonymised.com> wrote:

On 22/10/13 08:16, Andrea Aime wrote:

On Tue, Oct 22, 2013 at 8:08 AM, Ákos Maróy <akos@anonymised.com> wrote:

On 22/10/13 06:13, Rahkonen Jukka wrote:
> The trick they use in the Mapnik maps is not to colour the oceans
because 70% of Earth is water. Therefore the background colour is set to
ocean blue and land masses are drawn above it from the land polygons data
set http://openstreetmapdata.com/data/land-polygons.
>
can you be more specific on how to solve this using SLDs? I can't see a
generic background option in SLD :frowning:

Because there is none. You have to ask for the bgcolor in the GetMap
request

  I see

as I'm using custom code that calls GeoTools to render data, I guess I'll
have to force my own background color in there somehow via code then

Yep. Paint your image blue before giving the graphics object to the
Geotools renderer

Cheers
Anmdrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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