1

My imported postgres database size for plane.osm is more than 300GB under slim mode.

It added four tables for Tiles Creation.

planet_osm_line, planet_osm_road, planet_osm_polygon, planet_osm_point

Each Table contains attributes which are:

osm_id
access
addr:housename
addr:housenumber
addr:interpolation admin_level
aerialway
aeroway
amenity
area
barrier
bicycle
brand
bridge
boundary
building
construction
covered
culvert
cutting
denomination
disused
embankment
foot
generator:source
harbour
highway
historic
horse
intermittent
junction
landuse
layer
leisure
lock
man_made
military
motorcar
name
natural
office
oneway
operator
place
population
power
power_source
public_transport
railway
ref
religion
route
service
shop
sport
surface
toll
tourism
tower:type
tracktype
tunnel
water
waterway
wetland
width
wood
z_order
way_area
way

Now I want to configure it to Geoserver for a specific attribute.

Example: in polygon, I need to import building alone.

I am following this GeoServer and OpenStreetMap and Publishing a PostGIS Table but it's not specificly clear about the above.

I need to know if it's possible in Geoserver? And how ?

1

Configure your layer as SQL View - link to the docs

For your case (buildings), the SQL statement for filtering will be:

SELECT * FROM planet_osm_polygon WHERE building IS NOT NULL

And then, publish the layer as usual.

  • And for improving the speed you may want to create an index on osm_polygon table for the building column. – user30184 Aug 11 '14 at 18:08
  • @user30184 i cant index planet_osm_polygon's building attribute because it may contain duplicate values. – Arunkmp Aug 13 '14 at 6:57
  • There is nothing wrong with indexing a non-unique column in Postgres. Just don't try to put unique constraint on it. – Michal Mackiewicz Aug 13 '14 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.