[OpenLayers-Users] Question about GML/WFS compatibility and Styling

Aaron_Gundel at sjwater.com Aaron_Gundel at sjwater.com
Thu Aug 13 13:12:30 EDT 2009


Not a problem, Christopher...

Here's the raw response I get back from geoserver (minus a couple of 
unrelated and superflouous elements)... 

<wfs:FeatureCollection xsi:schemaLocation="http://devinside.sjwater.com/ 
http://localhost:8080/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=SJW:pg_station 
http://www.opengis.net/wfs 
http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates decimal="." cs="," ts=" ">
-121.93380447,37.30239967 -121.93192514,37.30404022
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<SJW:pg_station fid="pg_station.91">
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates decimal="." cs="," ts=" ">
-121.93380447,37.30239967 -121.93192514,37.30404022
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<SJW:gdo_geometry>
<gml:MultiPolygon srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">
-121.93192514,37.30239967 -121.93193417,37.30397591 
-121.93193649,37.30398413 -121.93193987,37.30399212 
-121.93194428,37.30399977 -121.93194967,37.30400702 
-121.93195598,37.30401378 -121.93196313,37.30401997 
-121.93197106,37.30402553 -121.93197967,37.3040304 
-121.93198887,37.30403452 -121.93200793,37.30404022 
-121.93227819,37.30402362 -121.93244372,37.30401651 
-121.93260937,37.30401171 -121.9327751,37.30400922 
-121.93380447,37.30399679 -121.93380408,37.30382777 
-121.93380369,37.30366524 -121.93380331,37.30350359 
-121.93380296,37.30335164 -121.93380258,37.30319194 
-121.93380227,37.30305845 -121.93380187,37.30289095 
-121.93380152,37.3027424 -121.93380111,37.30256592 
-121.93380073,37.30240301 -121.93368572,37.30240281 
-121.93346706,37.30240242 -121.93313702,37.30240183 
-121.93279384,37.30240122 -121.93192514,37.30239967
</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
</gml:MultiPolygon>
</SJW:gdo_geometry>
</SJW:pg_station>
</gml:featureMember>
</wfs:FeatureCollection>

If I modify this to fit into the mapserver namespace like so, It shows up 
correctly on the map. 

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:FeatureCollection  xmlns:ms="http://google.com/mapserver" 
xmlns:wfs="http://www.opengis.net/wfs" 
xmlns:gml="http://www.opengis.net/gml" 
xmlns:ogc="http://www.opengis.net/ogc" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>
-121.93380447,37.30239967 -121.93192514,37.30404022
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ms:polygon fid="pg_station.91">
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>
-121.93380447,37.30239967 -121.93192514,37.30404022
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<ms:msGeometry>
<gml:MultiPolygon srsName="EPSG:4326">
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>
-121.93192514,37.30239967 -121.93193417,37.30397591 
-121.93193649,37.30398413 -121.93193987,37.30399212 
-121.93194428,37.30399977 -121.93194967,37.30400702 
-121.93195598,37.30401378 -121.93196313,37.30401997 
-121.93197106,37.30402553 -121.93197967,37.3040304 
-121.93198887,37.30403452 -121.93200793,37.30404022 
-121.93227819,37.30402362 -121.93244372,37.30401651 
-121.93260937,37.30401171 -121.9327751,37.30400922 
-121.93380447,37.30399679 -121.93380408,37.30382777 
-121.93380369,37.30366524 -121.93380331,37.30350359 
-121.93380296,37.30335164 -121.93380258,37.30319194 
-121.93380227,37.30305845 -121.93380187,37.30289095 
-121.93380152,37.3027424 -121.93380111,37.30256592 
-121.93380073,37.30240301 -121.93368572,37.30240281 
-121.93346706,37.30240242 -121.93313702,37.30240183 
-121.93279384,37.30240122 -121.93192514,37.30239967
</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
</gml:MultiPolygon>
</ms:msGeometry>
</ms:polygon>
</gml:featureMember>
</wfs:FeatureCollection>

So I'm not sure what I can/should do about this.  Obviously I can't modify 
the geoserver response, but I don't know if there's some vendor parameter 
that will correct the issue, or if I just can't use the gml layer at all. 
Thanks again...




Christopher Schmidt <crschmidt at metacarta.com> 
08/13/2009 10:05 AM

To
Aaron_Gundel at sjwater.com
cc
users at openlayers.org
Subject
Re: [OpenLayers-Users] Question about GML/WFS compatibility and Styling






On Thu, Aug 13, 2009 at 09:44:32AM -0700, Aaron_Gundel at sjwater.com wrote:
> Sorry Christopher, I replied to you but I don't think I cc'd the list. 
> Anyway...
> 
> Yes, my html is hosted at a different origin.  Yes, I am using a proxy. 
> Yes, firebug is showing the file loading up.  The URL does contain the 
> requested data and the features are contained within the GML. 
> Unfortunately no, there's no url to this right now as it's an intranet 
> site. 
> 
> Poking around at this further, it looks to be some kind of namespace 
issue 
> with what's coming out of geoserver not being read by openlayers.  I 
know 
> that the basic geometry is valid now, I swapped out some of the elements 

> [for some I knew that worked, as per the gml example] and changed some 
> namespace attributes and got it to work.  But I can't serve this up from 

> geoserver, hence the problem.  Any idea how to work around this?

It might be best to provide a minimal GML file that works and a minimal 
GML file that doesn't work, to show the differences, and perhaps help 
other people understand how to help you. 

Best Regards,
-- 
Christopher Schmidt
MetaCarta

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090813/454a066b/attachment.html


More information about the Users mailing list