[Geoserver-users] Drawing a line using inline features

Hi

I'm trying to draw a map, where the data is taken from a postgres database,
and it is working now. The next step is putting a mark of some kind at the
center of the map. This is used to indicate the spot the user is interested
in.
I'm trying to draw the mark using a inline feature. I've already tried to
draw it based on the inlinefeature tutorial. But I'm trying to use a
LineString to draw a cross, and nothing is loaded when i post the xml
request using the demo page.

Can anybody see what i'm doing wrong?

<?xml version="1.0" encoding="UTF-8"?>
<ogc:GetMap xmlns:ogc="http://www.opengis.net/ows&quot;
            xmlns:gml="http://www.opengis.net/gml&quot;
            version="1.2.0"
            service="WMS">

  <StyledLayerDescriptor version="1.0.0"
                         xsi:schemaLocation="http://www.opengis.net/sld
StyledLayerDescriptor.xsd"
                         xmlns="http://www.opengis.net/sld&quot;
                         xmlns:ogc="http://www.opengis.net/ogc&quot;
                         xmlns:xlink="http://www.w3.org/1999/xlink&quot;
                         xmlns:dave="http://blasby.com"
                        
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    <UserLayer>
    <Name>Inline</Name>
      <InlineFeature>
        <FeatureCollection>
          <featureMember>
            <BodyPart>
              <Type>Vline</Type>
              <gml:LineString>
     <gml:coordinates>10, 10 10, 20</gml:coordinates>
   </gml:LineString>
            </BodyPart>
          </featureMember>
        </FeatureCollection>
      </InlineFeature>

      <UserStyle>
        <FeatureTypeStyle>
          <Rule>
            <Filter>
               <PropertyIsEqualTo>
                 <PropertyName>Type</PropertyName>
                 <Literal>Vline</Literal>
               </PropertyIsEqualTo>
            </Filter>
            <LineSymbolizer>
              <Stroke>
                <CssParameter name="stroke">
                  <ogc:Literal>#222222</ogc:Literal>
     </CssParameter>
                <CssParameter name="stroke-width">
                  <ogc:Literal>2</ogc:Literal>
     </CssParameter>
              </Stroke>
            </LineSymbolizer>
          </Rule>
        </FeatureTypeStyle>
      </UserStyle>
    </UserLayer>
  </StyledLayerDescriptor>

  <BoundingBox>
    <gml:coord>
      <gml:X>0</gml:X>
      <gml:Y>0</gml:Y>
    </gml:coord>
    <gml:coord>
      <gml:X>50</gml:X>
      <gml:Y>50</gml:Y>
    </gml:coord>
  </BoundingBox>

  <Output>
    <Format>image/jpeg</Format>
    <Transparent>false</Transparent>
    <Size>
      <Width>500</Width>
      <Height>500</Height>
    </Size>
  </Output>

  <Exceptions>application/vnd.ogc.se+xml</Exceptions>

</ogc:GetMap>

Rolf

--
View this message in context: http://www.nabble.com/Drawing-a-line-using-inline-features-tf4285946.html#a12200327
Sent from the GeoServer - User mailing list archive at Nabble.com.

RolfKristensen ha scritto:

Hi

I'm trying to draw a map, where the data is taken from a postgres database,
and it is working now. The next step is putting a mark of some kind at the
center of the map. This is used to indicate the spot the user is interested
in.
I'm trying to draw the mark using a inline feature. I've already tried to
draw it based on the inlinefeature tutorial. But I'm trying to use a
LineString to draw a cross, and nothing is loaded when i post the xml
request using the demo page.

Can anybody see what i'm doing wrong?

Two things. The first one is that you're not declaring any tag for the
geometric attribute, but start directly with its value (linestring).
The second one is that you're adding spaces between the coordinates,
and there should be none.

The attached xml draws a cross :slight_smile:
Yet, I'm wondering, if you need to display a marker in your data,
why not use something like OpenLayers and use marker layers instead?
It's easier.
Cheers
Andrea

cross.xml (2.42 KB)