Infrastructure Map Server General

Reply
Contributor
ca0v
Posts: 11
Registered: ‎11-27-2012
Message 1 of 3 (1,473 Views)
Accepted Solution

GetFeature - how to declare wfs, ogc, gml namespaces?

1473 Views, 2 Replies
12-11-2012 12:13 PM

I've asked a very similar question on this same forum but the answer (though accepted) was incomplete.  I have a GetFeature request which declares the wfs, ogc, gml namespaces correctly yet it fails.  When I remove the prefix from the xmlns declaration (e.g. xmlns:smileysurprised:gc -> xmlns, xmlns:gml -> xmlns) the request succeeds.  

 

It even works when I completely remove the xmlns declaration!  Is this a defect or is my request not correct?

 

FAILS:

<wfs:GetFeature service="WFS" version="1.1.0" maxFeatures="500"
xmlns:wfs="http://www.opengis.net/wfs">
  <wfs:Query typeName="Water:WA_HYDRANT" SRSNAME="EPSG:26910">
    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:Intersects>
        <ogc:PropertyName>Geometry</ogc:PropertyName>
        <gml:Polygon srsName="EPSG:26910"
        xmlns:gml="http://www.opengis.net/gml">
          <gml:exterior>
            <gml:LinearRing>
            	<gml:posList>...</gml:posList>
            </gml:LinearRing>
          </gml:exterior>
        </gml:Polygon>
      </ogc:Intersects>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

WORKS:

<wfs:GetFeature service="WFS" version="1.1.0" maxFeatures="1"
xmlns:wfs="http://www.opengis.net/wfs">
  <wfs:Query typeName="Water:WA_HYDRANT" SRSNAME="EPSG:26910">
    <ogc:Filter xmlns="http://www.opengis.net/ogc">
      <ogc:Intersects>
        <ogc:PropertyName>Geometry</ogc:PropertyName>
        <gml:Polygon srsName="EPSG:26910"
        xmlns="http://www.opengis.net/gml">
          <gml:exterior>
            <gml:LinearRing>
            	<gml:posList>...</gml:posList>
            </gml:LinearRing>
          </gml:exterior>
        </gml:Polygon>
      </ogc:Intersects>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

 

Even this works:

 

WORKS:

<wfs:GetFeature service="WFS" version="1.1.0" maxFeatures="500"
xmlns:wfs="http://www.opengis.net/wfs">
  <wfs:Query typeName="Water:WA_HYDRANT" SRSNAME="EPSG:26910">
    <ogc:Filter>
      <ogc:Intersects>
        <ogc:PropertyName>Geometry</ogc:PropertyName>
        <gml:Polygon srsName="EPSG:26910">
          <gml:exterior>
            <gml:LinearRing>
              <gml:posList>...</gml:posList>
            </gml:LinearRing>
          </gml:exterior>
        </gml:Polygon>
      </ogc:Intersects>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

 

Contributor
ca0v
Posts: 11
Registered: ‎11-27-2012
Message 2 of 3 (1,469 Views)

Re: GetFeature - how to declare wfs, ogc, gml namespaces?

12-11-2012 01:41 PM in reply to: ca0v

Simpler comparision between a working and failing request:

 

WORKS:

<wfs:GetFeature service="WFS" version="1.1.0" maxFeatures="10"
xmlns:wfs="http://www.opengis.net/wfs">
  <wfs:Query typeName="Water:WA_LARGE_VALVE" SRSNAME="EPSG:26910">
    <Filter xmlns="http://www.opengis.net/ogc">
      <Intersects xmlns="http://www.opengis.net/gml">
        <PropertyName>Geometry</PropertyName>
        <Envelope srsName="EPSG:26910">
          <lowerCorner>491784.0 5456759.0</lowerCorner>
          <upperCorner>491809.0 5456805.0</upperCorner>
        </Envelope>
      </Intersects>
    </Filter>
  </wfs:Query>
</wfs:GetFeature>

FAILS (replace Envelope with Polygon):

<wfs:GetFeature service="WFS" version="1.1.0" maxFeatures="1"
xmlns:wfs="http://www.opengis.net/wfs">
  <wfs:Query typeName="Water:WA_LARGE_VALVE" SRSNAME="EPSG:26910">
    <Filter xmlns="http://www.opengis.net/ogc">
		<Intersects xmlns="http://www.opengis.net/gml">
		<PropertyName>Geometry</PropertyName>
		<Polygon srsName="EPSG:26910">
		  <exterior>
		    <LinearRing>
		      <posList>489093.629 5456057.158 489092.66826402
		      5456047.4034839 489089.822976626 5456038.02382838
		      489085.202480615 5456029.37948835 489078.984339059
		      5456021.80266094 489071.407511651 5456015.58451938
		      489062.763171618 5456010.96402337 489053.383516101
		      5456008.11873598 489043.629 5456007.158 489033.874483899
		      5456008.11873598 489024.494828382 5456010.96402337
		      489015.850488349 5456015.58451938 489008.273660941
		      5456021.80266094 489002.055519385 5456029.37948835
		      488997.435023374 5456038.02382838 488994.58973598 5456047.4034839
		      488993.629 5456057.158 488994.58973598 5456066.9125161
		      488997.435023374 5456076.29217162 489002.055519385
		      5456084.93651165 489008.273660941 5456092.51333906
		      489015.850488349 5456098.73148062 489024.494828382
		      5456103.35197663 489033.874483899 5456106.19726402 489043.629
		      5456107.158 489053.383516101 5456106.19726402 489062.763171618
		      5456103.35197663 489071.407511651 5456098.73148062
		      489078.984339059 5456092.51333906 489085.202480615
		      5456084.93651165 489089.822976626 5456076.29217162
		      489092.66826402 5456066.9125161 489093.629
		      5456057.158</posList>
		    </LinearRing>
		  </exterior>
		</Polygon>
		</Intersects>
    </Filter>
  </wfs:Query>
</wfs:GetFeature>

 

Contributor
ca0v
Posts: 11
Registered: ‎11-27-2012
Message 3 of 3 (1,394 Views)

Re: GetFeature - how to declare wfs, ogc, gml namespaces?

12-14-2012 08:14 AM in reply to: ca0v

Couple problems, first doesn't seem to matter, second seems to be a defect.

 

1. Move the gml declaration into the polygon (does not resolve issue)

2. Add a space after the <posList> (<posList> 489093.629)

 

Now it works.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community