Hi,
True, OSM data imported to PostGIS database with osm2pgsql tool creates table named by default as planet_osm_roads, and it does have an attribute column named "ref". I have no idea about why your filter does not work because I am not familiar with using SLD. Otherwise, you may know that once you get the system working it would be better to use planet_osm_line table for building a styled map? Osm_roads contains just a subset of all highways but osm_line has them all and it has much more attributes to be used for filters. Myself I am usually doing either views or new tables by quering motorways, trunks, primary roads etc. with SQL like "select * from osm_line where highway='primary' or highway='primary_link'" and used those as feature types for Geoserver.
Hope you get your filter to work. It would be very nice to have one day some kind of SLD gallery for styling OSM data for WMS service.
-Jukka Rahkonen-
-----Alkuperäinen viesti-----
Lähettäjä: geoserver-users-bounces@lists.sourceforge.net puolesta: Xiaoyu Guan
Lähetetty: ma 23.6.2008 14:12
Vastaanottaja: geoserver-users@lists.sourceforge.net
Aihe: [Geoserver-users] error on SLD,geoserver could not find attribute table
Dear all:
I had a problem about styling postgis file. The version is 1.6.4b.
The situations is that I stored OSM data in PostGIS, I am restyling the OSM
data via SLD.
When I add filter in the SLD script, the geoserver had errors.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE
ServiceExceptionReport SYSTEM "
http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1" > <ServiceException>
The requested Style can not be used with this layer. The style
specifies an attribute of REF and the layer is: topp:planet_osm_roads
</ServiceException></ServiceExceptionReport>
I am sure REF is an attribute of topp:planet_osm_roads. because When I view
the data by openlayers, I could read the attribute table.
my SLD file looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sldStyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a named layer is the basic building block of an sld document -->
<NamedLayer>
<Name>OSM Line</Name>
<UserStyle>
<!-- they have names, titles and abstracts -->
<Title>Motified lines</Title>
<Abstract>different scales with different line styles.</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- a feature type for lines -->
<FeatureTypeStyle>
<!--FeatureTypeName>Feature</FeatureTypeName-->
<Rule>
<Name>Rule 1</Name>
<Title>osm highways</Title>
<Abstract>A green line with a 2 pixel width</Abstract>
<!-- like a polygonsymbolizer -->
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>REF</ogc:PropertyName>
<ogc:Literal>A1</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>1000000</MinScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0000FF</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
............................
is there anybody faced the same situation before? Thanks in advace
All the best
Xiaoyu
--
Xiaoyu Guan (Sam)
Geo-information Science
Wageningen UR