[Geoserver-users] Drawing a line between two features & Labelling a feature

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 the message
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---

There 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+Usage

Brent 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 the message
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---

Hi Brent Owens,

Thanks for your reply. I'll take a look at the tutorials.

As for the labeling of features on a map, I have managed to figure it out
with the tutorial at
http://docs.codehaus.org/display/GEOSDOC/ComplexLabelingExample. The
OpenGISR Styled Layer Descriptor (SLD) Implementation Specification
(https://portal.opengeospatial.org/files/?artifact_id=1188) is also useful.
Thus I am just posting in here in case it might be useful to somebody else
:slight_smile:

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 feature

There 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+Usage

Brent 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 the

message

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 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

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 feature

There 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+Usage

Brent 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 the

message

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 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

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 below such
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 inline feature
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&quot;&gt;
          <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 feature

There 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+Usage

Brent 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 the

message

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 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

pic1.jpg

Hi,

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 it

In 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 below such
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 inline feature
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&quot;&gt;
          <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 feature

There 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+Usage

Brent 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 the
    

message
  

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 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
  
------------------------------------------------------------------------

Hi Brent Owens,

Thanks for the reply.

Pardon my ignorance, but do I make WMS or WFS requests for steps 1 and 2?
Specifically, what are the requests I need to make? Thanks.

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 feature

Hi,

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 it

In 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 below

such

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 inline

feature

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&quot;&gt;
          <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 feature

There 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+Usage

Brent 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 the
    

message
  

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 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
  
------------------------------------------------------------------------

The first request would be a WFS getFeature request. This will return you GML (step 2) that you can parse into points. Then from that you can generate lines. Then send back a WMS request with the inline features passed in the SLD post getMap request.

Here is some clarification on the types of requests:
WFS: returns GML features. These have attributes and geometries. It is all XML
WMS: returns raster images (jpeg, png...), a map

Take a look at the specs to learn a little more about them. It is good to get a broad sense at what the capabilities are of both types of requests: http://www.opengeospatial.org/specs/?page=specs

cheers

Brent Owens
(The Open Planning Project)

Lee Wai See wrote:

Hi Brent Owens,

Thanks for the reply.

Pardon my ignorance, but do I make WMS or WFS requests for steps 1 and 2?
Specifically, what are the requests I need to make? Thanks.

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 feature

Hi,

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 it

In 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 below
    

such
  

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 inline
    

feature
  

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&quot;&gt;
          <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 feature

There 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+Usage

Brent 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 the
    

message
  

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 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
  
------------------------------------------------------------------------

Hi,

I did a getFeature request for step 1 and I've got the following xml result
as below. Sorry for the messy code pasted here, but if you notice, the fid
are not in any specified order. I want to order my featureMembers to be
retrieved in a sorted (ascending/descending) order. How can I go about doing
it? Is there any <sequence> tag or some sort? I looked at the GML specs but
couldn't really make much sense out of their <sequenceRule> tag, thus owoul
appreciate some help here.

<?xml version="1.0" encoding="UTF-8" ?>
- <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:prrm="http://www.capdeveloper.com/prrm&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.capdeveloper.com/prrm
http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=prrm:histor
y_track http://www.opengis.net/wfs
http://localhost:8080/geoserver/data/capabilities/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
- <gml:boundedBy>
- <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
  <gml:coordinates decimal="." cs="," ts="">103.71185303,1.31773615
103.9850235,1.37810004</gml:coordinates>
  </gml:Box>
  </gml:boundedBy>
- <gml:featureMember>
- <prrm:history_track fid="history_track.3">
  <prrm:vehicle_number>SGD7575D</prrm:vehicle_number>
- <prrm:the_geom>
- <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
  <gml:coordinates decimal="." cs=","
ts="">103.71185485,1.33011334</gml:coordinates>
  </gml:Point>
  </prrm:the_geom>
  </prrm:history_track>
  </gml:featureMember>
- <gml:featureMember>
- <prrm:history_track fid="history_track.5">
  <prrm:vehicle_number>SGD7575D</prrm:vehicle_number>
- <prrm:the_geom>
- <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
  <gml:coordinates decimal="." cs=","
ts="">103.98502,1.3781</gml:coordinates>
  </gml:Point>
  </prrm:the_geom>
  </prrm:history_track>
  </gml:featureMember>
- <gml:featureMember>
- <prrm:history_track fid="history_track.2">
  <prrm:vehicle_number>SGD7575D</prrm:vehicle_number>
- <prrm:the_geom>
- <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
  <gml:coordinates decimal="." cs=","
ts="">103.86274805,1.31773619</gml:coordinates>
  </gml:Point>
  </prrm:the_geom>
  </prrm:history_track>
  </gml:featureMember>
- <gml:featureMember>
- <prrm:history_track fid="history_track.6">
  <prrm:vehicle_number>SGD7575D</prrm:vehicle_number>
- <prrm:the_geom>
- <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
  <gml:coordinates decimal="." cs=","
ts="">103.79606578,1.32699762</gml:coordinates>
  </gml:Point>
  </prrm:the_geom>
  </prrm:history_track>
  </gml:featureMember>
  </wfs:FeatureCollection>

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: Friday, March 03, 2006 9:12 AM
To: Lee Wai See
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Drawing a line between two features &
Labelling a feature

The first request would be a WFS getFeature request. This will return
you GML (step 2) that you can parse into points. Then from that you can
generate lines. Then send back a WMS request with the inline features
passed in the SLD post getMap request.

Here is some clarification on the types of requests:
WFS: returns GML features. These have attributes and geometries. It is
all XML
WMS: returns raster images (jpeg, png...), a map

Take a look at the specs to learn a little more about them. It is good
to get a broad sense at what the capabilities are of both types of
requests: http://www.opengeospatial.org/specs/?page=specs

cheers

Brent Owens
(The Open Planning Project)

Lee Wai See wrote:

Hi Brent Owens,

Thanks for the reply.

Pardon my ignorance, but do I make WMS or WFS requests for steps 1 and 2?
Specifically, what are the requests I need to make? Thanks.

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 feature

Hi,

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 it

In 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 below
    

such
  

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 inline
    

feature
  

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&quot;&gt;
          <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 feature

There 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+Usage

Brent 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 the
    

message
  

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 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
  
------------------------------------------------------------------------

-------------------------------------------------------
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

Hi,

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 feature

Hi,

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 it

In 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 below

such

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 inline

feature

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&quot;&gt;
          <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 feature

There 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+Usage

Brent 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 the
    

message
  

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 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
  
------------------------------------------------------------------------