ParseException thrown with SLD filter and PointSymbolizer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ParseException thrown with SLD filter and PointSymbolizer

Ken Pawliw
Hello,
 
I am having the following problem attempting to use a Filter with PointSymbolizer in an existing SLD file. The log information of the exception stack frame is similar to another problem that was posted in Feb. 2005 (msgid=10936321) which I do not believe was resolved.
 
I am running Geoserver 1.2.4 with TomCat 5.5 on Windows XP. The data store is on PostgreSQL 8.0.
 
The following XML SLD will generate the points correctly. Note that I have intentionlly left the <ogc:Or></ogc:Or> empty.
 
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
    <sld:NamedLayer>
        <sld:Name>georgia_pts</sld:Name>
        <sld:Title>Georgia Points</sld:Title>
        <sld:Abstract>Dynamically created custom style.</sld:Abstract>
        <sld:UserStyle>
            <sld:FeatureTypeStyle>
                <sld:FeatureTypeName>feature</sld:FeatureTypeName>
                <sld:Rule>
                    <sld:Name>Rule 3</sld:Name>
                    <sld:Abstract>Abstract</sld:Abstract>
                    <sld:Title>title</sld:Title>
                    <ogc:Filter>
                        <ogc:Or>
                        </ogc:Or>     
                    </ogc:Filter>     
                    <sld:PointSymbolizer> 
                    <sld:Graphic>
                     <sld:Mark>
                       <sld:WellKnownName>star</sld:WellKnownName>
                       <sld:Fill>
                        <sld:CssParameter name="fill">#000000</sld:CssParameter>
                       </sld:Fill>
                       <sld:Stroke>
                        <sld:CssParameter name="stroke">#000000</sld:CssParameter>
                       </sld:Stroke>
                     </sld:Mark>
                     <sld:Opacity>1.0</sld:Opacity>
                     <sld:Size>8.0</sld:Size> 
                    </sld:Graphic> 
                    </sld:PointSymbolizer>
                </sld:Rule>
                <sld:Rule>
                    <sld:Name>Default Rule</sld:Name>
                    <sld:Abstract>Abstract</sld:Abstract>
                    <sld:Title>title</sld:Title>
                    <sld:ElseFilter/>
                     <sld:PointSymbolizer> 
                     <sld:Graphic>
                       <sld:Mark>
                           <sld:WellKnownName>star</sld:WellKnownName>
                           <sld:Fill>
                            <sld:CssParameter name="fill">#FF0000</sld:CssParameter>
                           </sld:Fill>
                           <sld:Stroke>
                            <sld:CssParameter name="stroke">#000000</sld:CssParameter>
                           </sld:Stroke>
                       </sld:Mark>
                       <sld:Opacity>1.0</sld:Opacity>
                       <sld:Size>8.0</sld:Size> 
                    </sld:Graphic> 
                    </sld:PointSymbolizer>     
                </sld:Rule>        
            </sld:FeatureTypeStyle>
        </sld:UserStyle>
    </sld:NamedLayer>
</sld:StyledLayerDescriptor>
 
When I add the following to <ogc:Or></ogc:Or> component of the SDL, the points are not rendered and an exception is thrown.
 
                        <ogc:Or>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>name</ogc:PropertyName>
                                <ogc:Literal>Taliaferro</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>name</ogc:PropertyName>
                                <ogc:Literal>Webster</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                        </ogc:Or>
The exception stack trace is the following.
 
 66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - calling sql builder with filter [ geom bbox POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943)) ]
 66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - sql is SELECT gid, AsText(force_2d("geom")), "name" FROM "georgia_pts" WHERE "geom" && GeometryFromText('POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943))', -1)
 66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - About to execure query: SELECT gid, AsText(force_2d("geom")), "name" FROM "georgia_pts" WHERE "geom" && GeometryFromText('POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943))', -1)
 66078 [FINE] org.geotools.data.jdbc.ConnectionPool - Getting available connection.
 66094 [WARNING] org.geotools.renderer.lite.LiteRenderer - Exception org.geotools.data.DataSourceException: Could not parse WKT rendering layer [hidden email]
org.geotools.data.DataSourceException: Could not parse WKT
 at org.geotools.data.jdbc.attributeio.WKTAttributeIO.read(WKTAttributeIO.java:79)
 at org.geotools.data.jdbc.QueryData.read(QueryData.java:183)
 at org.geotools.data.jdbc.JDBCFeatureReader.readFeature(JDBCFeatureReader.java:106)
 at org.geotools.data.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:86)
 at org.geotools.renderer.lite.LiteRenderer.processStylers(LiteRenderer.java:900)
 at org.geotools.renderer.lite.LiteRenderer.paint(LiteRenderer.java:498)
 at org.vfny.geoserver.responses.wms.map.JAIMapResponse.execute(JAIMapResponse.java:344)
 at org.vfny.geoserver.responses.wms.map.GetMapDelegate.execute(GetMapDelegate.java:148)
 at org.vfny.geoserver.responses.wms.map.GetMapDelegate.execute(GetMapDelegate.java:108)
 at org.vfny.geoserver.responses.wms.GetMapResponse.execute(GetMapResponse.java:74)
 at org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:362)
 at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:235)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.vfny.geoserver.servlets.wms.WmsDispatcher.doResponse(WmsDispatcher.java:164)
 at org.vfny.geoserver.servlets.wms.WmsDispatcher.doGet(WmsDispatcher.java:111)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Thread.java:595)
Caused by: com.vividsolutions.jts.io.ParseException: Unknown type: COOK
 at com.vividsolutions.jts.io.WKTReader.readGeometryTaggedText(Unknown Source)
 at com.vividsolutions.jts.io.WKTReader.read(Unknown Source)
 at com.vividsolutions.jts.io.WKTReader.read(Unknown Source)
 at org.geotools.data.jdbc.attributeio.WKTAttributeIO.read(WKTAttributeIO.java:75)
 ... 31 more
 66172 [FINE] org.vfny.geoserver.responses.wms.map.JAIMapResponse - called renderer
 66172 [FINE] org.vfny.geoserver.servlets.AbstractService - mime type is: image/png
 66406 [INFO] org.vfny.geoserver.servlets.AbstractService - Service handled
 
The table being queried is defined as follows.
 
CREATE TABLE georgia_pts
(
  gid serial NOT NULL,
  name varchar,
  geom geometry,
  CONSTRAINT georgia_pts_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (ndims(geom) = 2),
  CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text OR geom IS NULL),
  CONSTRAINT enforce_srid_geom CHECK (srid(geom) = -1)
)
WITH OIDS;
ALTER TABLE georgia_pts OWNER TO "Ken";
 
There are a few things to note from the log information above.
First, the sql statement in the log entry above
66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - sql is SELECT gid, AsText(force_2d("geom")), "name" FROM "georgia_pts" WHERE "geom" && GeometryFromText('POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943))', -1)
works fine when executed in PostgreSQL.
Second, the value of the "name" field of the first row of output generated in PostgreSQL is "COOK" which corresponds with the following entry in the log entry above
Caused by: com.vividsolutions.jts.io.ParseException: Unknown type: COOK
I've attempted various permutations trying to flush out more information but have been unsuccessful. I'd appreciate any suggestions.
 
Ken
 
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

RE: ParseException thrown with SLD filter and PointSymbolizer

Ken Pawliw
Another message posted this month (WMS SLD problem - follow up) pointed me to the cause of this problem. As in the WMS SLD problem, I was also using
 
                        <ogc:Or>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>name</ogc:PropertyName>
                                <ogc:Literal>Taliaferro</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>name</ogc:PropertyName>
                                <ogc:Literal>Webster</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                        </ogc:Or>
where name is of type String. Creating another field of type integer and filtering on it instead works fine and resolves the problem.
 
Ken
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of Ken Pawliw
Sent: June 13, 2005 7:05 PM
To: [hidden email]
Subject: [Geoserver-users] ParseException thrown with SLD filter and PointSymbolizer

Hello,
 
I am having the following problem attempting to use a Filter with PointSymbolizer in an existing SLD file. The log information of the exception stack frame is similar to another problem that was posted in Feb. 2005 (msgid=10936321) which I do not believe was resolved.
 
I am running Geoserver 1.2.4 with TomCat 5.5 on Windows XP. The data store is on PostgreSQL 8.0.
 
The following XML SLD will generate the points correctly. Note that I have intentionlly left the <ogc:Or></ogc:Or> empty.
 
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
    <sld:NamedLayer>
        <sld:Name>georgia_pts</sld:Name>
        <sld:Title>Georgia Points</sld:Title>
        <sld:Abstract>Dynamically created custom style.</sld:Abstract>
        <sld:UserStyle>
            <sld:FeatureTypeStyle>
                <sld:FeatureTypeName>feature</sld:FeatureTypeName>
                <sld:Rule>
                    <sld:Name>Rule 3</sld:Name>
                    <sld:Abstract>Abstract</sld:Abstract>
                    <sld:Title>title</sld:Title>
                    <ogc:Filter>
                        <ogc:Or>
                        </ogc:Or>     
                    </ogc:Filter>     
                    <sld:PointSymbolizer> 
                    <sld:Graphic>
                     <sld:Mark>
                       <sld:WellKnownName>star</sld:WellKnownName>
                       <sld:Fill>
                        <sld:CssParameter name="fill">#000000</sld:CssParameter>
                       </sld:Fill>
                       <sld:Stroke>
                        <sld:CssParameter name="stroke">#000000</sld:CssParameter>
                       </sld:Stroke>
                     </sld:Mark>
                     <sld:Opacity>1.0</sld:Opacity>
                     <sld:Size>8.0</sld:Size> 
                    </sld:Graphic> 
                    </sld:PointSymbolizer>
                </sld:Rule>
                <sld:Rule>
                    <sld:Name>Default Rule</sld:Name>
                    <sld:Abstract>Abstract</sld:Abstract>
                    <sld:Title>title</sld:Title>
                    <sld:ElseFilter/>
                     <sld:PointSymbolizer> 
                     <sld:Graphic>
                       <sld:Mark>
                           <sld:WellKnownName>star</sld:WellKnownName>
                           <sld:Fill>
                            <sld:CssParameter name="fill">#FF0000</sld:CssParameter>
                           </sld:Fill>
                           <sld:Stroke>
                            <sld:CssParameter name="stroke">#000000</sld:CssParameter>
                           </sld:Stroke>
                       </sld:Mark>
                       <sld:Opacity>1.0</sld:Opacity>
                       <sld:Size>8.0</sld:Size> 
                    </sld:Graphic> 
                    </sld:PointSymbolizer>     
                </sld:Rule>        
            </sld:FeatureTypeStyle>
        </sld:UserStyle>
    </sld:NamedLayer>
</sld:StyledLayerDescriptor>
 
When I add the following to <ogc:Or></ogc:Or> component of the SDL, the points are not rendered and an exception is thrown.
 
                        <ogc:Or>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>name</ogc:PropertyName>
                                <ogc:Literal>Taliaferro</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>name</ogc:PropertyName>
                                <ogc:Literal>Webster</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                        </ogc:Or>
The exception stack trace is the following.
 
 66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - calling sql builder with filter [ geom bbox POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943)) ]
 66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - sql is SELECT gid, AsText(force_2d("geom")), "name" FROM "georgia_pts" WHERE "geom" && GeometryFromText('POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943))', -1)
 66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - About to execure query: SELECT gid, AsText(force_2d("geom")), "name" FROM "georgia_pts" WHERE "geom" && GeometryFromText('POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943))', -1)
 66078 [FINE] org.geotools.data.jdbc.ConnectionPool - Getting available connection.
 66094 [WARNING] org.geotools.renderer.lite.LiteRenderer - Exception org.geotools.data.DataSourceException: Could not parse WKT rendering layer [hidden email]
org.geotools.data.DataSourceException: Could not parse WKT
 at org.geotools.data.jdbc.attributeio.WKTAttributeIO.read(WKTAttributeIO.java:79)
 at org.geotools.data.jdbc.QueryData.read(QueryData.java:183)
 at org.geotools.data.jdbc.JDBCFeatureReader.readFeature(JDBCFeatureReader.java:106)
 at org.geotools.data.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:86)
 at org.geotools.renderer.lite.LiteRenderer.processStylers(LiteRenderer.java:900)
 at org.geotools.renderer.lite.LiteRenderer.paint(LiteRenderer.java:498)
 at org.vfny.geoserver.responses.wms.map.JAIMapResponse.execute(JAIMapResponse.java:344)
 at org.vfny.geoserver.responses.wms.map.GetMapDelegate.execute(GetMapDelegate.java:148)
 at org.vfny.geoserver.responses.wms.map.GetMapDelegate.execute(GetMapDelegate.java:108)
 at org.vfny.geoserver.responses.wms.GetMapResponse.execute(GetMapResponse.java:74)
 at org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:362)
 at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:235)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.vfny.geoserver.servlets.wms.WmsDispatcher.doResponse(WmsDispatcher.java:164)
 at org.vfny.geoserver.servlets.wms.WmsDispatcher.doGet(WmsDispatcher.java:111)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Thread.java:595)
Caused by: com.vividsolutions.jts.io.ParseException: Unknown type: COOK
 at com.vividsolutions.jts.io.WKTReader.readGeometryTaggedText(Unknown Source)
 at com.vividsolutions.jts.io.WKTReader.read(Unknown Source)
 at com.vividsolutions.jts.io.WKTReader.read(Unknown Source)
 at org.geotools.data.jdbc.attributeio.WKTAttributeIO.read(WKTAttributeIO.java:75)
 ... 31 more
 66172 [FINE] org.vfny.geoserver.responses.wms.map.JAIMapResponse - called renderer
 66172 [FINE] org.vfny.geoserver.servlets.AbstractService - mime type is: image/png
 66406 [INFO] org.vfny.geoserver.servlets.AbstractService - Service handled
 
The table being queried is defined as follows.
 
CREATE TABLE georgia_pts
(
  gid serial NOT NULL,
  name varchar,
  geom geometry,
  CONSTRAINT georgia_pts_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (ndims(geom) = 2),
  CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text OR geom IS NULL),
  CONSTRAINT enforce_srid_geom CHECK (srid(geom) = -1)
)
WITH OIDS;
ALTER TABLE georgia_pts OWNER TO "Ken";
 
There are a few things to note from the log information above.
First, the sql statement in the log entry above
66078 [FINE] org.geotools.data.jdbc.JDBCDataStore - sql is SELECT gid, AsText(force_2d("geom")), "name" FROM "georgia_pts" WHERE "geom" && GeometryFromText('POLYGON ((-85.6089602162505 30.361291834125943, -85.6089602162505 35.00036670813102, -80.89475357951517 35.00036670813102, -80.89475357951517 30.361291834125943, -85.6089602162505 30.361291834125943))', -1)
works fine when executed in PostgreSQL.
Second, the value of the "name" field of the first row of output generated in PostgreSQL is "COOK" which corresponds with the following entry in the log entry above
Caused by: com.vividsolutions.jts.io.ParseException: Unknown type: COOK
I've attempted various permutations trying to flush out more information but have been unsuccessful. I'd appreciate any suggestions.
 
Ken