Hi Chris,
Thanks a lot for your reply. Your suggestions and links are a great help.
I managed to achieve the inline feature successfully.
However, I now have a question. I am not sure whether this is the right
mailing list to ask, but just thought I might just give it a try. The
situation now here is this: When I meant I managed to get the inline
feature up, I was referring to the case when I typed in the request
manually in a browser. Actually my eventual aim is to use the SLD_BODY
part of this request in MapBuilder, which I failed to do so. The strange
thing is that there is no errors logged at all, which leaves me not
knowing how to proceed on. So any idea if inline feature can be used in
MapBuilder? I thought it should be able to?
Thanks.
Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd
-----Original Message-----
From: geoserver-users-admin@lists.sourceforge.net
[mailto:geoserver-users-admin@lists.sourceforge.net] On Behalf Of Chris
Holmes
Sent: Thursday, March 09, 2006 11:41 PM
To: Lee Wai See
Cc: 'Brent Owens'; geoserver-users@lists.sourceforge.net;
dblasby@anonymised.com
Subject: Re: [Geoserver-users] Drawing a line between two features &
Labelling a feature
Unfortunately Brent's on vacation, but David might be able to help you
out, I think he wrote a good portion if not all of the docs.
Have you found the sld specification?
http://www.opengeospatial.org/docs/02-070.pdf It might have some answers
for you. Though some of this stuff isn't in the 1.0 spec, it will be in
the next spec.
Looking at your feature and the example, it looks like it should be more
like:
<InlineFeature>
<FeatureCollection>
<featureMember>
<lineFeature>
<lineStringProperty>
<gml:LineString>
<gml:coordinates>103.94479827880852,1.325985083
103.91832203784215,1.307173827
</gml:coordinates>
</gml:LineString>
</lineFeature>
</lineStringProperty>
</featureMember>
</FeatureCollection>
</InlineFeature>
lineFeature is the name of your feature, and lineStringProperty is the
name of your geometry. For a full feature you need to have the name and
the name of the geometry, you can't just include a straight geometry.
I'm not sure how you declare the feature though, I don't know the inLine
stuff very well.
Also you need to be sure to define your namespaces, did you see the
email from Miles? http://www.nabble.com/SAXParseException-t1238071.html
You need to put the declarations in your request, at the beginning of
the xml.
You also can try getmap post, see:
http://docs.codehaus.org/display/GEOTOOLS/WMS+Post which has a link to
the spec.
best regards,
Chris
Lee Wai See wrote:
Hi,
I apologise for emailing again, but I really have no idea how to resolve my
bugs and feeling kind of desperate.I must admit that http://docs.codehaus.org/display/GEOSDOC/InlineFeature
and
http://docs.codehaus.org/display/GEOSDOC/ComplexLabelingExample are great
examples to learn about inline features. However, I still have some doubts
about the elements:1. Elements like <POI>, <BodyPart>, <Type>: I suppose they are self-defined
elements. Where am I supposed to declare them? Or they work simply just by
putting them in the descriptor? If so, how come when I tried something like
<Type>HistoryLine</Type>, it fails?2. Element <Name>: I suppose this is the name of the layer that contains
the
inline feature. Is this layer just a temporary dynamic layer or a
pre-existing permanent layer? I thought it is the former, so using the last
request that I have emailed, I tried something like <Name>Inline</Name>.
But
now I have the following error:
24879156 [INFO] org.geotools.styling.SLDParser - layer name: Inline
java.lang.Exception: couldnt parse geometry in SLD inline feature. Is it
valid? Have you nested it too much?I am sure the authors of the two examples can help clear my doubts, thus
would greatly appreciate it. Thanks in advance!Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd-----Original Message-----
From: Lee Wai See [mailto:leewse@anonymised.com]
Sent: Thursday, March 09, 2006 3:13 PM
To: 'Brent Owens'
Cc: 'geoserver-users@lists.sourceforge.net'
Subject: RE: [Geoserver-users] Drawing a line between two features &
Labelling a featureHi,
For this error that I have got:
org.xml.sax.SAXParseException: XML document structures must start and end
within the same entity.I have figured it out what's wrong. It was a silly mistake of missing out
the encoding of the character "#".But still, would appreciate it if someone could answer my question on
inline
feature. Thanks.
Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd-----Original Message-----
From: Lee Wai See [mailto:leewse@anonymised.com]
Sent: Thursday, March 09, 2006 1:45 PM
To: 'Brent Owens'
Cc: 'geoserver-users@lists.sourceforge.net'
Subject: RE: [Geoserver-users] Drawing a line between two features &
Labelling a featureHi,
Another question on the example given in
http://docs.codehaus.org/display/GEOSDOC/InlineFeature. There is this
<BodyPart> tag. Can I know where and how this tag is declared? I tried
doing
something similar in my request but I ended up getting this error for the
tag <HistoryLine> I put in:java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in
escape (%) pattern - For input string: "Hi"Thanks.
Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd-----Original Message-----
From: Lee Wai See [mailto:leewse@anonymised.com]
Sent: Thursday, March 09, 2006 12:02 PM
To: 'Brent Owens'
Cc: 'geoserver-users@lists.sourceforge.net'
Subject: RE: [Geoserver-users] Drawing a line between two features &
Labelling a featureHi,
Following the example in
http://docs.codehaus.org/display/GEOSDOC/ComplexLabelingExample, I did a
getMap request for an inline feature. However, I encounter a
ServiceException that says the following:
org.xml.sax.SAXParseException: XML document structures must start and end
within the same entity.Could someone be kind enough to point out where I have gone wrong (my
request is as below)? I understand that it might be tedious to read the
chunk but as I am still playing around with inline feature, so would
greatly
appreciate any help. Thanks.
http://localhost:8080/geoserver/wms?bbox=103.59736493356376,1.17866724157080
97,104.09707604959173,1.4807073969316509&Format=image/png&request=GetMap&wid
th=800&height=400&srs=EPSG:4326&SLD_BODY=
<StyledLayerDescriptor version="1.0.0">
<UserLayer>
<Name>Inline</Name>
<InlineFeature>
<FeatureCollection>
<featureMember>
<gml:LineString>
<gml:coordinates>103.94479827880852,1.325985083
103.91832203784215,1.307173827
</gml:coordinates>
</gml:LineString>
</featureMember>
</FeatureCollection>
</InlineFeature>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">
<ogc:Literal>#0000FF</ogc:Literal>
</CssParameter>
<CssParameter name="stroke-width">
<ogc:Literal>2</ogc:Literal>
</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</UserLayer>
</StyledLayerDescriptor>Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd-----Original Message-----
From: Brent Owens [mailto:brentowens@anonymised.com]
Sent: Thursday, March 02, 2006 3:25 PM
To: Lee Wai See
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Drawing a line between two features &
Labelling a featureHi,
You will first need to create the lines from the points you receive. The
line just has to be made of two of the points: start point and end
point. Then you need to format those lines into GML:<gml:LineString>
<gml:coordinates>x1,y1 x2,y2</gml:coordinates>
</gml:LineString>Then you will send a new SLD back to Geoserver, with a getmap request, that
has the inline features. (follow this tutorial but change the polygons to
linestrings: http://docs.codehaus.org/display/GEOSDOC/InlineFeature).
You will get back the correct map that has the lines drawn between the
points.So to summarize how it will work:
1) client -> geoserver: normal get feature request
2) client <- geoserver: gml of the point fetures
3) client: build up lines from the returned points
4) client: create SLD with inline features containing the lines
5) client -> geoserver: getMap SLD post request with the new SLD file
6) client <- geoserver: map with the lines drawn in itIn the <UserSytle> section of the SLD you will have to point to the inline
feature names.
I haven't played around with inline features much, so you will have to
tinker and play with the tutorial to get it working.Brent Owens
(The Open Planning Project)Lee Wai See wrote:
Hi,
I went through the tutorials but am still not sure how I can apply the
inline feature to my implementation.To be more precise, the map I retrieved using the following request
returns
me a layer with four features (as shown in the attachment, if it can be
received by the mailing list). How can I actually change the SLD belowsuch
that I can draw lines that joins up the four features (again, shown as red
lines in the attachment if it's viewable)? How can I use the inlinefeature
to do that?
http://localhost:8080/geoserver/wms?bbox=103.59736493356376,1.17866724157080
97,104.09707604959173,1.4807073969316509&Format=image/png&request=GetMap&wid
th=800&height=400&srs=EPSG:4326&SLD_BODY=
<StyledLayerDescriptor version="1.0.0">
<UserLayer>
<Name>prrm:history_track</Name>
<UserStyle>
<Title>Default Styler</Title>
<Abstract></Abstract>
<FeatureTypeStyle>
<FeatureTypeName>Feature</FeatureTypeName>
<Rule>
<Filter
xmlns:gml="http://www.opengis.net/gml">
<PropertyIsEqualTo><PropertyName>vehicle_number</PropertyName>
<Literal>SGD7575D</Literal>
</PropertyIsEqualTo>
</Filter>
<PointSymbolizer>
<Graphic>
<Mark><WellKnownName>triangle</WellKnownName>
<Fill>
<CssParameter
name="fill">%23F000000</CssParameter>
</Fill>
</Mark>
<Size>10.0</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</UserLayer>
</StyledLayerDescriptor>Thank you.
Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd-----Original Message-----
From: geoserver-users-admin@lists.sourceforge.net
[mailto:geoserver-users-admin@lists.sourceforge.net] On Behalf Of Brent
Owens
Sent: Wednesday, March 01, 2006 2:33 PM
To: Lee Wai See
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Drawing a line between two features &
Labelling a featureThere are a couple ways you can do this. Are these line features that
you wish to draw going to be permanent, or just temporary?If you want them to be in the dataset permanently, then just use a WFS
request and insert the feature. But if you want it just as a dynamic,
temporary, feature then you can draw the line using an SLD post request
with an inline feature. Here are a couple of tutorials on inline
features using SLD post:
http://docs.codehaus.org/display/GEOSDOC/InlineFeature
http://docs.codehaus.org/display/GEOSDOC/InLineFeature+UsageBrent Owens
(The Open Planning Project)Lee Wai See wrote:
Hi,
I have features on a map layer:
1. Is it possible for me to draw a line from one feature to
another, that is, drawing a line between two features?2. Is it possible to attach a label to a feature?
How can I go about doing these two implementations? Is it possible for
me to do it through requests sent to the GeoServer? Any references
would be greatly appreciated. Thank you.Regards,
Lee Wai See
ST Electronics (Info-Software Systems) Pte Ltd[This e-mail is confidential and may be priviledged. If you are not the
intended recipient, please kindly notify us immediately and delete themessage
from your system; please do not copy or use it for any purpose, nor
disclose
its contents to any other person. Thank you.]
---ST Electronics Group----------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scriptinglanguage
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users------------------------------------------------------------------------
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Chris Holmes
The Open Planning Project
thoughts at: http://cholmes.wordpress.com