[Geoserver-users] shape file for background layer?

Hi

I have a shapefile for the world that I am using with an SLD to fill the polygons, and a background color.

The shapefile came from freegis and is 28 meg in size. However, it is pretty slow to render – my dev box is 3gig processor with 3 gig memory, and this is the war release on tomcat – should it really take 10 secs to render the maps at 1024 x 768 into openlayers?

Should I be using tiled TIFFs for the background?

I am trying to get oscache working, but it seems to always return miss on cache checking, but I think that 10 secs to render the map is probably not correct anyway.

Thanks

Tim

Tim Robertson ha scritto:

Hi

I have a shapefile for the world that I am using with an SLD to fill the polygons, and a background color.

The shapefile came from freegis and is 28 meg in size. However, it is pretty slow to render – my dev box is 3gig processor with 3 gig memory, and this is the war release on tomcat – should it really take 10 secs to render the maps at 1024 x 768 into openlayers?

The problem is, afaik, that the map is quite detailed, but you don't need all that detail when rendering at 1024x768.
Can you post the link to the file? I can see if there's anything
wrong with Geoserver rendering it.
Anyways, I would suggest you to go multiresolution if you want good
performance at all levels:
* load the data into postgis
* create new geometric columns for the simplified geometries
* use the postgis Simplify(geometry, tolerance) command, along with
   an insert, to create the simplified geometries
* use SLD to decide which column to render depending on the zoom
   level.

As an alternative, if you're using Geoserver 1.5.0, ask getMap to
produce a big Geotiff image (format=image/geotiff if I remember properly) and then use gdaladdo to add overviews, then reuse it
in Geoserver as a raster layer (the catch here is that Geoserver
will render the full image in memory, so you'll risk an OOM unless
you did start Geoserver with a high -Xmx value, such as -Xmx1024m).

Hope this helps
Cheers
Andrea

You should probably use TileCache, if you can install python. That's our currently recommended way to do caching.

http://docs.codehaus.org/display/GEOSDOC/TileCache+Tutorial

Chris

Tim Robertson wrote:

Hi

I have a shapefile for the world that I am using with an SLD to fill the polygons, and a background color.

The shapefile came from freegis and is 28 meg in size. However, it is pretty slow to render – my dev box is 3gig processor with 3 gig memory, and this is the war release on tomcat – should it really take 10 secs to render the maps at 1024 x 768 into openlayers?

Should I be using tiled TIFFs for the background?

I am trying to get oscache working, but it seems to always return miss on cache checking, but I think that 10 secs to render the map is probably not correct anyway.

Thanks

Tim

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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

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

_______________________________________________
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

Hi Andrea,

Thank you very much for this - followed it all except for the "use an SLD
to determine which column to render"... I know you can set the min/max
scale denominators, but I dont know how to pick a column based on this -
could you please elaborate?

Many thanks again

Tim

Tim Robertson ha scritto:

Hi

I have a shapefile for the world that I am using with an SLD to fill the
polygons, and a background color.

The shapefile came from freegis and is 28 meg in size. However, it is
pretty slow to render – my dev box is 3gig processor with 3 gig memory,
and this is the war release on tomcat – should it really take 10 secs to
render the maps at 1024 x 768 into openlayers?

The problem is, afaik, that the map is quite detailed, but you don't
need all that detail when rendering at 1024x768.
Can you post the link to the file? I can see if there's anything
wrong with Geoserver rendering it.
Anyways, I would suggest you to go multiresolution if you want good
performance at all levels:
* load the data into postgis
* create new geometric columns for the simplified geometries
* use the postgis Simplify(geometry, tolerance) command, along with
   an insert, to create the simplified geometries
* use SLD to decide which column to render depending on the zoom
   level.

As an alternative, if you're using Geoserver 1.5.0, ask getMap to
produce a big Geotiff image (format=image/geotiff if I remember
properly) and then use gdaladdo to add overviews, then reuse it
in Geoserver as a raster layer (the catch here is that Geoserver
will render the full image in memory, so you'll risk an OOM unless
you did start Geoserver with a high -Xmx value, such as -Xmx1024m).

Hope this helps
Cheers
Andrea

Hi Andrea,

With regard to selecting the column to render...

<PolygonSymbolizer>
  <GeometryProperty><ogc:PropertyName>highlevel</ogc:PropertyName></GeometryProperty>
  <Fill>
    <CssParameter name="fill">#DDDDDD</CssParameter>
    <CssParameter name="fill-opacity">1</CssParameter>
  </Fill>
</PolygonSymbolizer>

Is this correct? I am not convinced that it is working, as I have both
"geom" and "highlevel" (daft names I know but this is just prototyping at
the moment) columns in the DB - however, when I try and use
ogc:PropertyName's that dont exist in the SLD it still renders fine. I am
not convinced it is picking up the "low res" geometry column, with that
SLD snippet above.

Incidentally, loading the shapefile into postgis alone sped things up
massively, but I'd still like to tile/layer it.

Thanks

Tim

Tim Robertson ha scritto:

Hi

I have a shapefile for the world that I am using with an SLD to fill the
polygons, and a background color.

The shapefile came from freegis and is 28 meg in size. However, it is
pretty slow to render – my dev box is 3gig processor with 3 gig memory,
and this is the war release on tomcat – should it really take 10 secs to
render the maps at 1024 x 768 into openlayers?

The problem is, afaik, that the map is quite detailed, but you don't
need all that detail when rendering at 1024x768.
Can you post the link to the file? I can see if there's anything
wrong with Geoserver rendering it.
Anyways, I would suggest you to go multiresolution if you want good
performance at all levels:
* load the data into postgis
* create new geometric columns for the simplified geometries
* use the postgis Simplify(geometry, tolerance) command, along with
   an insert, to create the simplified geometries
* use SLD to decide which column to render depending on the zoom
   level.

As an alternative, if you're using Geoserver 1.5.0, ask getMap to
produce a big Geotiff image (format=image/geotiff if I remember
properly) and then use gdaladdo to add overviews, then reuse it
in Geoserver as a raster layer (the catch here is that Geoserver
will render the full image in memory, so you'll risk an OOM unless
you did start Geoserver with a high -Xmx value, such as -Xmx1024m).

Hope this helps
Cheers
Andrea

trobertson@anonymised.com ha scritto:

Hi Andrea,

With regard to selecting the column to render...

<PolygonSymbolizer>
  <GeometryProperty><ogc:PropertyName>highlevel</ogc:PropertyName></GeometryProperty>
  <Fill>
    <CssParameter name="fill">#DDDDDD</CssParameter>
    <CssParameter name="fill-opacity">1</CssParameter>
  </Fill>
</PolygonSymbolizer>

Is this correct?

Yes, it is.

I am not convinced that it is working, as I have both
"geom" and "highlevel" (daft names I know but this is just prototyping at
the moment) columns in the DB - however, when I try and use
ogc:PropertyName's that dont exist in the SLD it still renders fine. I am
not convinced it is picking up the "low res" geometry column, with that
SLD snippet above.

Funny... I just tried on my PC, and could not reproduce, it's throwing an error complaining about a non existent attribute... wait...
there's one thing you may not know. Geoserver parses the style on first usage, and it keeps the parsed version in memory. So, if you alter the
sld directly on disk, Geoserver wont' notice and will keep using the
old pre-parsed sld.
If you update the file directly, you'll have to restart GeoServer as well. It's a pity, I know.

Incidentally, loading the shapefile into postgis alone sped things up
massively, but I'd still like to tile/layer it.

Hum... interesting. Usually postgis is faster when zoomed in, that is,
when spatial indexes can make the difference, but slower when displaying
the full map. In your case it's always faster (even without the generalized geometries)? What shapefile datastore are you using, the standard one, or the indexed one?

Cheers
Andrea

Hi Andrea,

Thanks again for reply.

I am not convinced that it is working, as I have both
"geom" and "highlevel" (daft names I know but this is just prototyping at
the moment) columns in the DB - however, when I try and use
ogc:PropertyName's that dont exist in the SLD it still renders fine. I am
not convinced it is picking up the "low res" geometry column, with that
SLD snippet above.

- Funny... I just tried on my PC, and could not reproduce, it's throwing
- an error complaining about a non existent attribute... wait...
- there's one thing you may not know. Geoserver parses the style on first
- usage, and it keeps the parsed version in memory. So, if you alter the
- sld directly on disk, Geoserver wont' notice and will keep using the
- old pre-parsed sld.
- If you update the file directly, you'll have to restart GeoServer as
- well. It's a pity, I know.

I do restart tomcat to pick it up. I'll work out how to log SQL on
postgres, and see exactly what is being issued to see if there is an issue.
Perhaps it is the rendering itself as I have no JAI as I am on Mac?

Incidentally, loading the shapefile into postgis alone sped things up
massively, but I'd still like to tile/layer it.

- Hum... interesting. Usually postgis is faster when zoomed in, that is,
- when spatial indexes can make the difference, but slower when displaying
- the full map. In your case it's always faster (even without the
- generalized geometries)? What shapefile datastore are you using, the
- standard one, or the indexed one?

It was the non indexed one, so I guess that would explain it.

Cheers
Andrea