Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I spent a long time looking for an example using OpenLayers to call ArcGIS WFS, however, almost none is found... currently the code I wrote is based on the example of GeoServer, however, no feature is returned...

new OpenLayers.Layer.Vector("ArcGIS WFS layer", {
    strategies: [new OpenLayers.Strategy.BBOX()],
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.1.0",
        srsName: "urn:ogc:def:crs:EPSG:6.9:26912",
            url: "http://XXXX/Geodatabase_SDE/geodataserver/WFSServer?request=getFeature",
        featureType: "TEST_SAMPLE",
        featureNS: "http://XXXX/Geodatabase_SDE/geodataserver/WFSServer",
        geometryName: "Shape"
    })
});

I am wondering if it's doable in OpenLayers? if so, an example is much appreciated!

thanks!

UPDATE Request XML:

<wfs:GetFeature service="WFS" version="1.1.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
  <wfs:Query srsName="EPSG:26912" typeName="feature:TEST_SAMPLE" xmlns:feature="http://XXXX/Geodatabase_SDE/geodataserver/WFSServer">
    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:BBOX>
        <ogc:PropertyName>
          Shape
        </ogc:PropertyName>
        <gml:Envelope srsName="EPSG:26912" xmlns:gml="http://www.opengis.net/gml">
          <gml:lowerCorner>
            447517.58546862 4364229.0103902
          </gml:lowerCorner>
          <gml:upperCorner>
            455008.41453138 4384331.9496098
          </gml:upperCorner>
        </gml:Envelope>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

Response XML:

<wfs:FeatureCollection xmlns:Geodatabase_SDE="http://XXXXX/Geodatabase_SDE/GeoDataServer/WFSServer" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://XXXXX/Geodatabase_SDE/GeoDataServer/WFSServer http://XXXXX/Geodatabase_SDE/geodataserver/WFSServer?request=DescribeFeatureType%26version=1.1.0%26typename=TEST_SAMPLE http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
    <gml:Envelope srsName="EPSG:26912">
      <gml:lowerCorner>
        NaN NaN
      </gml:lowerCorner>
      <gml:upperCorner>
        NaN NaN
      </gml:upperCorner>
    </gml:Envelope>
  </gml:boundedBy>
</wfs:FeatureCollection>
share|improve this question
    
Do you have a public facing URL we can test on? –  CaptDragon Jan 25 '12 at 14:12
    
i don't have public accessible WFS. i was looking for one in order to test, but didn't find anything online... –  Simon Jan 25 '12 at 14:58
    
Yeah, i couldn't find a public ArcGIS WFS service either. –  CaptDragon Jan 25 '12 at 15:09
add comment

1 Answer 1

up vote 3 down vote accepted

What is the response from the server (the XML that is returned) - does it show any warnings?

Also try setting your srsName to a simpler form such as:

srsName: "EPSG:26912"

I've been through the same (unpleasant) process of configuring OpenLayers and MapServer WFS. There are details at http://geographika.co.uk/mapserver-openlayers-and-the-wfs-maze

The most confusing piece was that even if the XML request included the SRS, I also had to pass it as a parameter in the URL:

http://localhost/mapserver/?map=C:/PathToMapFile/mymap.map&SERVICE=WFS&VERSION=1.1.0&srsName=EPSG:900913

This may or may not apply to all WFS servers - I'd be interested to know if it is also the case with ArcGIS.

A few other things to check are:

  • is the projection set up on the ArcGIS Server
  • if you run a profiler on your database, what SQL is running - and are the correct bounding boxes being used?
  • what projection is your OpenLayers basemap in? Do you have proj4js added into the web page?

The request looks good, but clearly the repsonse and the NaN (not a number) show something is wrong.

share|improve this answer
    
thanks. I just added the response XML. –  Simon Jan 25 '12 at 13:47
    
@Simon Can you also post the request XML - this should include the bounds sent to the server. –  geographika Jan 25 '12 at 14:47
    
just updated! thanks for your attention. –  Simon Jan 25 '12 at 15:04
    
thanks very much for advice. since it's not me setting up the arcgis server, it may take some time to figure out the projection issue on server...and i assume it's very possible due to that.. i just added VERSION&srsName to URL, not succeed. –  Simon Jan 25 '12 at 16:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.