[Geoserver-users] SLD and Pointsize

Hi,

i'm very new with geoserver.
I my SLD, I want to define the Size of a symbol in meters not in pixels. I
have no idea how to do that.

--
View this message in context: http://www.nabble.com/SLD-and-Pointsize-tp18236733p18236733.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Henry Green ha scritto:

Hi,

i'm very new with geoserver.
I my SLD, I want to define the Size of a symbol in meters not in pixels. I
have no idea how to do that.

This is not possible with SLD 1.0.
SLD 1.1/SE 1.1 added this capability, but we don't support that standard yet.

Cheers
Andrea

The only workarounds I can see for this is to:

A. Convert your point/shape to a polygon so you can provide it with the appropriate size/shape.

B. Do a little bit a math to figure out how many pixels per meter and create different size rules for different zoom levels.

Neither one of these are pretty, though.

Thanks,
Mike

Henry Green wrote:

Hi,

i'm very new with geoserver.
I my SLD, I want to define the Size of a symbol in meters not in pixels. I
have no idea how to do that.

Hi,

I started to test new OpenJUMP WFS plugin that now supports also WFS version 1.1.0 and WFS-T. The plugin is developed against deegree2 WFS server but I am testing it with GeoServer release 1.6.4b that is running on Windows Vista computer.

First trials with GeoServer demo feature types like "states" and "tasmania_water_bodies" were promising and the plugin can read features from GeoServer both with WFS version 1.0.0 and 1.1.0. However, I am having problems with my own feature type that is OpenStreetMap data held in PostGIS v. 8.2 database in projection epsg:2393. This feature type works fine if I send WFS 1.0.0 requests and even if I send 1.1.0 request but set the outputformat as GML2. But if I use WFS 1.1.0 and outputformat "text/xml; subtype=gml/3.1.1" then GeoServer sends this response:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:ows="http://www.opengis.net/ows&quot;&gt;
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.NullPointerException
null</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

The request that OpenJUMP WFSPlugin sends is this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.1.0" maxFeatures="1" outputFormat="text/xml; subtype=gml/3.1.1">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; srsName="urn:x-ogc:def:crs:EPSG:6.11.2:2393" typeName="topp:OSM_viivat">
</wfs:Query>
</wfs:GetFeature>

Finally text that appears on GeoServer console is as follows:

09 heinõ 19:42:26 INFO [geoserver.filters] - 127.0.0.1 "POST /geoserver/wfs" "Ja
karta Commons-HttpClient/3.0-beta1" ""
09 heinõ 19:42:26 INFO [geoserver.wfs] -
Request: getFeature
        handle = null
        service = WFS
        version = 1.1.0
        baseUrl = http://localhost:8080/geoserver/
        query = [net.opengis.wfs.impl.QueryTypeImpl@anonymised.com (group: null, proper
tyName: null, function: null, filter: null, sortBy: null, featureVersion: null,
handle: null, srsName: urn:x-ogc:def:crs:EPSG:6.11.2:2393, typeName: [{http://ww
w.openplans.org/topp}OSM_viivat])]
        maxFeatures = 1
        outputFormat = text/xml; subtype=gml/3.1.1
        resultType = results
        traverseXlinkDepth = null
        traverseXlinkExpiry = null

Result:
SELECT "oid", "osm_id", "access", "admin_level", "address", "aeroway", "amenity"
, "bicycle", "bridge", "boundary", "building", "cutting", "embankment", "foot",
"highway", "historic", "horse", "int_ref", "is_in", "junction", "landuse", "laye
r", "learning", "leisure", "man_made", "military", "motorcar", "name", "natural"
, "oneway", "power", "place", "postal_code", "railway", "ref", "religion", "resi
dence", "route", "sport", "shop", "telephone", "tourism", "tunnel", "URL", "wate
rway", "z_order", "way_area", encode(asBinary(force_2d("way"),'XDR'),'base64')
09 heinõ 19:42:26 WARN [geoserver.ows] -
java.lang.NullPointerException
        at org.geotools.gml2.FeaturePropertyExtractor.properties(FeatureProperty
Extractor.java:60)
        at org.geotools.xml.Encoder.encode(Encoder.java:573)
        at org.geotools.xml.Encoder.encode(Encoder.java:320)
        at org.geoserver.wfs.xml.GML3OutputFormat.write(GML3OutputFormat.java:12
2)
        at org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutput
Format.java:137)
        at org.geoserver.ows.Dispatcher.response(Dispatcher.java:615)
        at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:19
2)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(
AbstractController.java:139)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.ha
ndle(SimpleControllerHandlerAdapter.java:44)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch
erServlet.java:684)
        at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:625)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
workServlet.java:392)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ
let.java:357)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459
)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1054)
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCha
racterEncodingFilter.java:108)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1045)
        at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:69)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1045)
        at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1045)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:264)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(Filt
erSecurityInterceptor.java:107)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(Fi
lterSecurityInterceptor.java:72)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:274)
        at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTra
nslationFilter.java:110)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:274)
        at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFil
ter(AnonymousProcessingFilter.java:125)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:274)
        at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicPr
ocessingFilter.java:178)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:274)
        at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilte
r(HttpSessionContextIntegrationFilter.java:229)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:274)
        at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.jav
a:148)
        at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.j
ava:98)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1045)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3
58)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:2
31)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:6
29)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)

        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:149)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.
java:123)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
41)
        at org.mortbay.jetty.Server.handle(Server.java:303)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:45
2)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnectio
n.java:735)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:320)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool
.java:475)
09 heinõ 19:42:26 INFO [geoserver.filters] - 127.0.0.1 "POST /geoserver/wfs" too
k 503ms

Any idea if the error is on GeoServer or on tht client side?

-Jukka Rahkonen-

Thank you for your reply, Mike.
The B-solution is the one I will use. But creating 10 or more rules doesn't
sound nice.
Is it possible to obtain the current scale in a parameter, so I can set the
size dynamically ?

Thanks,

Stefan.

Mike Pumphrey-2 wrote:

The only workarounds I can see for this is to:

A. Convert your point/shape to a polygon so you can provide it with the
appropriate size/shape.

B. Do a little bit a math to figure out how many pixels per meter and
create different size rules for different zoom levels.

Neither one of these are pretty, though.

Thanks,
Mike

Henry Green wrote:

Hi,

i'm very new with geoserver.
I my SLD, I want to define the Size of a symbol in meters not in pixels.
I
have no idea how to do that.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/SLD-and-Pointsize-tp18236733p18366116.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

That would be an excellent idea, but I'm not sure if something dynamic exists like that. (Someone please feel free to correct me.) Although it's a fair amount of copy/paste, creating multiple rules (that differ only by scale and point size) isn't all that difficult, just a little clunky.

Thanks,
Mike

Henry Green wrote:

Thank you for your reply, Mike.
The B-solution is the one I will use. But creating 10 or more rules doesn't
sound nice.
Is it possible to obtain the current scale in a parameter, so I can set the
size dynamically ?

Thanks,

Stefan.

Mike Pumphrey-2 wrote:

The only workarounds I can see for this is to:

A. Convert your point/shape to a polygon so you can provide it with the appropriate size/shape.

B. Do a little bit a math to figure out how many pixels per meter and create different size rules for different zoom levels.

Neither one of these are pretty, though.

Thanks,
Mike

Henry Green wrote:

Hi,

i'm very new with geoserver.
I my SLD, I want to define the Size of a symbol in meters not in pixels.
I
have no idea how to do that.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Rahkonen Jukka ha scritto:

Hi,

I started to test new OpenJUMP WFS plugin that now supports also WFS version 1.1.0 and WFS-T. The plugin is developed against deegree2 WFS server but I am testing it with GeoServer release 1.6.4b that is running on Windows Vista computer.

First trials with GeoServer demo feature types like "states" and "tasmania_water_bodies" were promising and the plugin can read features from GeoServer both with WFS version 1.0.0 and 1.1.0. However, I am having problems with my own feature type that is OpenStreetMap data held in PostGIS v. 8.2 database in projection epsg:2393. This feature type works fine if I send WFS 1.0.0 requests and even if I send 1.1.0 request but set the outputformat as GML2. But if I use WFS 1.1.0 and outputformat "text/xml; subtype=gml/3.1.1" then GeoServer sends this response:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:ows="http://www.opengis.net/ows&quot;&gt;
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.NullPointerException
null</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

The request that OpenJUMP WFSPlugin sends is this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.1.0" maxFeatures="1" outputFormat="text/xml; subtype=gml/3.1.1">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; srsName="urn:x-ogc:def:crs:EPSG:6.11.2:2393" typeName="topp:OSM_viivat">
</wfs:Query>
</wfs:GetFeature>

Finally text that appears on GeoServer console is as follows:

09 heinõ 19:42:26 INFO [geoserver.filters] - 127.0.0.1 "POST /geoserver/wfs" "Ja
karta Commons-HttpClient/3.0-beta1" ""
09 heinõ 19:42:26 INFO [geoserver.wfs] -
Request: getFeature
        handle = null
        service = WFS
        version = 1.1.0
        baseUrl = http://localhost:8080/geoserver/
        query = [net.opengis.wfs.impl.QueryTypeImpl@anonymised.com (group: null, proper
tyName: null, function: null, filter: null, sortBy: null, featureVersion: null,
handle: null, srsName: urn:x-ogc:def:crs:EPSG:6.11.2:2393, typeName: [{http://ww
w.openplans.org/topp}OSM_viivat])]
        maxFeatures = 1
        outputFormat = text/xml; subtype=gml/3.1.1
        resultType = results
        traverseXlinkDepth = null
        traverseXlinkExpiry = null

Result:
SELECT "oid", "osm_id", "access", "admin_level", "address", "aeroway", "amenity"
, "bicycle", "bridge", "boundary", "building", "cutting", "embankment", "foot",
"highway", "historic", "horse", "int_ref", "is_in", "junction", "landuse", "laye
r", "learning", "leisure", "man_made", "military", "motorcar", "name", "natural"
, "oneway", "power", "place", "postal_code", "railway", "ref", "religion", "resi
dence", "route", "sport", "shop", "telephone", "tourism", "tunnel", "URL", "wate
rway", "z_order", "way_area", encode(asBinary(force_2d("way"),'XDR'),'base64')
09 heinõ 19:42:26 WARN [geoserver.ows] -
java.lang.NullPointerException
        at org.geotools.gml2.FeaturePropertyExtractor.properties(FeatureProperty
Extractor.java:60)

Hum, this error usually occurs when there is a discrepancy between the
XML schema the encoder is using and the one that's in the schemas cache... Are you using a schema.xsd file to try and alter the published
schema, or have you changed the structure of you database tables after
registering the feature type in GeoServer?

If none of the above applies, can you open a jira issue attaching some
sample data and steps to reproduce?

Cheers
Andrea

Hi,

Thanks for suggestions. I deleted the problematic feature type, created it again and now it works fine also with WFS 1.1.0 and gml/3.1.1 output. The feature type was originally created with GeoServer 1.6.2 which I updated to 1.6.4 but kept the old data directory. Perhaps this has something to do with the problem. I hadn't touched the database or schema.xsd file, and WFS 1.0.0 worked OK all the time.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: geoserver-users-bounces@lists.sourceforge.net puolesta: Andrea Aime
Lähetetty: ma 14.7.2008 10:45
Vastaanottaja: Rahkonen Jukka
Kopio: geoserver-users@lists.sourceforge.net
Aihe: Re: [Geoserver-users] WFS 1.1.0 getFeature fails with PG backend and "text/xml; subtype=gml/3.1.1"

Rahkonen Jukka ha scritto:

Hi,

I started to test new OpenJUMP WFS plugin that now supports also WFS version 1.1.0 and WFS-T. The plugin is developed against deegree2 WFS server but I am testing it with GeoServer release 1.6.4b that is running on Windows Vista computer.

First trials with GeoServer demo feature types like "states" and "tasmania_water_bodies" were promising and the plugin can read features from GeoServer both with WFS version 1.0.0 and 1.1.0. However, I am having problems with my own feature type that is OpenStreetMap data held in PostGIS v. 8.2 database in projection epsg:2393. This feature type works fine if I send WFS 1.0.0 requests and even if I send 1.1.0 request but set the outputformat as GML2. But if I use WFS 1.1.0 and outputformat "text/xml; subtype=gml/3.1.1" then GeoServer sends this response:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:ows="http://www.opengis.net/ows&quot;&gt;
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.NullPointerException
null</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

The request that OpenJUMP WFSPlugin sends is this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.1.0" maxFeatures="1" outputFormat="text/xml; subtype=gml/3.1.1">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; srsName="urn:x-ogc:def:crs:EPSG:6.11.2:2393" typeName="topp:OSM_viivat">
</wfs:Query>
</wfs:GetFeature>

Finally text that appears on GeoServer console is as follows:

09 heinõ 19:42:26 INFO [geoserver.filters] - 127.0.0.1 "POST /geoserver/wfs" "Ja
karta Commons-HttpClient/3.0-beta1" ""
09 heinõ 19:42:26 INFO [geoserver.wfs] -
Request: getFeature
        handle = null
        service = WFS
        version = 1.1.0
        baseUrl = http://localhost:8080/geoserver/
        query = [net.opengis.wfs.impl.QueryTypeImpl@anonymised.com (group: null, proper
tyName: null, function: null, filter: null, sortBy: null, featureVersion: null,
handle: null, srsName: urn:x-ogc:def:crs:EPSG:6.11.2:2393, typeName: [{http://ww
w.openplans.org/topp}OSM_viivat])]
        maxFeatures = 1
        outputFormat = text/xml; subtype=gml/3.1.1
        resultType = results
        traverseXlinkDepth = null
        traverseXlinkExpiry = null

Result:
SELECT "oid", "osm_id", "access", "admin_level", "address", "aeroway", "amenity"
, "bicycle", "bridge", "boundary", "building", "cutting", "embankment", "foot",
"highway", "historic", "horse", "int_ref", "is_in", "junction", "landuse", "laye
r", "learning", "leisure", "man_made", "military", "motorcar", "name", "natural"
, "oneway", "power", "place", "postal_code", "railway", "ref", "religion", "resi
dence", "route", "sport", "shop", "telephone", "tourism", "tunnel", "URL", "wate
rway", "z_order", "way_area", encode(asBinary(force_2d("way"),'XDR'),'base64')
09 heinõ 19:42:26 WARN [geoserver.ows] -
java.lang.NullPointerException
        at org.geotools.gml2.FeaturePropertyExtractor.properties(FeatureProperty
Extractor.java:60)

Hum, this error usually occurs when there is a discrepancy between the
XML schema the encoder is using and the one that's in the schemas
cache... Are you using a schema.xsd file to try and alter the published
schema, or have you changed the structure of you database tables after
registering the feature type in GeoServer?

If none of the above applies, can you open a jira issue attaching some
sample data and steps to reproduce?

Cheers
Andrea

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Rahkonen Jukka ha scritto:

Hi,

Thanks for suggestions. I deleted the problematic feature type,
created it again and now it works fine also with WFS 1.1.0 and
gml/3.1.1 output. The feature type was originally created with
GeoServer 1.6.2 which I updated to 1.6.4 but kept the old data
directory. Perhaps this has something to do with the problem. I
hadn't touched the database or schema.xsd file, and WFS 1.0.0 worked
OK all the time.

Uh, quite curious... I have no idea what might have changed.
Ah, btw, where can one download that plugin? Does it come along
with an official OpenJump release?

Cheers
Andrea