[Geoserver-users] Points of LinearRing do not form a closed linestring

Hello,

I'm trying to send a GetFeature (post) request using a Filter. But I keep
getting the above error and I have no clue about the cause of the issue
(because it's closed). If I create a LinearRing using JTS and the same
coordinates the Geometry is created without any errors.

The request I try to send:

<wfs:GetFeature service="WFS" version="1.1.0"
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.1.0/wfs.xsd&quot;&gt;
  <wfs:Query typeName="feature:ViewRWZI" xmlns:feature="JAGIS">
    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
      <ogc:And>
        <ogc:BBOX>
          <ogc:PropertyName>GeoNode</ogc:PropertyName>
          <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#31370&quot;&gt;
            <gml:lowerCorner>-284279.94433594 -12078.599121097</gml:lowerCorner>
            <gml:upperCorner>592280.94433594 424076.8491211</gml:upperCorner>
          </gml:Envelope>
        </ogc:BBOX>
        <ogc:Within>
          <ogc:PropertyName>GeoNode</ogc:PropertyName>
          <gml:Polygon xmlns:gml="http://www.opengis.net/gml&quot;
srsName="http://www.opengis.net/gml/srs/epsg.xml#31370&quot;&gt;
            <gml:exterior>
              <gml:LinearRing>
                <gml:coordinates>139400 203697 139400 229770 159022 229770 159022
203697 139400 203697</gml:coordinates>
              </gml:LinearRing>
            </gml:exterior>
          </gml:Polygon>
        </ogc:Within>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

Kind regards,
Roel

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Points-of-LinearRing-do-not-form-a-closed-linestring-tp5011496.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

GML coordinates tend to include commas
<gml:coordinates>0,0 100,0 100,100 0,100 0,0</gml:coordinates>

In addition, you are using WFS 1.1.0 which defaults to GML3 which considers coordinates as deprecated. Is is not strictly forbidden, I believe, but it would be better not to mix GML2 and GML3 dialects. Thus, use gml:posList.

-Jukka Rahkonen-

Roel De Nijs wrote:

Hello,

I'm trying to send a GetFeature (post) request using a Filter. But I keep
getting the above error and I have no clue about the cause of the issue
(because it's closed). If I create a LinearRing using JTS and the same
coordinates the Geometry is created without any errors.

The request I try to send:

<wfs:GetFeature service="WFS" version="1.1.0"
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.1.0/wfs.xsd&quot;&gt;
  <wfs:Query typeName="feature:ViewRWZI"
xmlns:feature="JAGIS">
    <ogc:Filter
xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
      <ogc:And>
        <ogc:BBOX>

  <ogc:PropertyName>GeoNode</ogc:PropertyName>

  <gml:Envelope
srsName="http://www.opengis.net/gml/srs/epsg.xml#31370&quot;&gt;

  <gml:lowerCorner>-284279.94433594 -
12078.599121097</gml:lowerCorner>

  <gml:upperCorner>592280.94433594
424076.8491211</gml:upperCorner>

  </gml:Envelope>
        </ogc:BBOX>
        <ogc:Within>

  <ogc:PropertyName>GeoNode</ogc:PropertyName>

  <gml:Polygon xmlns:gml="http://www.opengis.net/gml&quot;
srsName="http://www.opengis.net/gml/srs/epsg.xml#31370&quot;&gt;

  <gml:exterior>

    <gml:LinearRing>

      <gml:coordinates>139400 203697
139400 229770 159022 229770 159022
203697 139400 203697</gml:coordinates>

    </gml:LinearRing>

  </gml:exterior>

  </gml:Polygon>
        </ogc:Within>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

Kind regards,
Roel

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Points-
of-LinearRing-do-not-form-a-closed-linestring-tp5011496.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics Download AppDynamics Lite
for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On Fri, Oct 26, 2012 at 12:58 PM, Roel De Nijs <roel.denijs@anonymised.com> wrote:

Hello,

I'm trying to send a GetFeature (post) request using a Filter. But I keep
getting the above error and I have no clue about the cause of the issue
(because it's closed). If I create a LinearRing using JTS and the same
coordinates the Geometry is created without any errors.

Mind, the error could also be coming from data reading, some databases do
not complain if you have rings in polygons that are not closed, but JTS surely
does

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi Jukka,

Thanks for your swift reply!

The GML dialects were mixed up simply due to my ignorance. I started with a WFS 1.0.0 request (which was sent by OpenLayers), but because I didn't manage to get it working I switched to WFS 1.1.0 and give that one a try.

When I use WFS 1.1.0 together with gml:posList the request is executed successfully. But when I switch back to WFS 1.0.0 and use gml:coordinates with commas I get a NullPointerException when parsing the Polygon.

Error:
java.lang.RuntimeException: Parsing failed for Polygon: java.lang.NullPointerException
Parsing failed for Polygon: java.lang.NullPointerException
Null

Request:
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" outputFormat="GML2" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
        <wfs:Query typeName="feature:ViewRWZI" xmlns:feature="JAGIS">
                <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
                        <ogc:And>
                                <ogc:BBOX>
                                        <ogc:PropertyName>GeoNode</ogc:PropertyName>
                                        <gml:Box xmlns:gml="http://www.opengis.net/gml&quot; srsName="EPSG:31370">
                                                <gml:coordinates decimal="." cs="," ts=" ">-284279.94433594,-12078.599121097 592280.94433594,424076.8491211</gml:coordinates>
                                        </gml:Box>
                                </ogc:BBOX>
                                <ogc:Within>
                                        <ogc:PropertyName>GeoNode</ogc:PropertyName>
                                        <gml:Polygon xmlns:gml="http://www.opengis.net/gml&quot; srsName="EPSG:31370">
                                                <gml:exterior>
                                                        <gml:LinearRing>
                                                                <gml:coordinates decimal="." cs="," ts=" ">139400.25104111,203697.60407176 139400.25104111,229770.11674822 159022.6686784,229770.11674822 159022.6686784,203697.60407176 139400.25104111,203697.60407176</gml:coordinates>
                                                        </gml:LinearRing>
                                                </gml:exterior>
                                        </gml:Polygon>
                                </ogc:Within>
                        </ogc:And>
                </ogc:Filter>
        </wfs:Query>
</wfs:GetFeature>

Any ideas?

Kind regards,
Roel

-----Oorspronkelijk bericht-----
Van: Rahkonen Jukka [mailto:Jukka.Rahkonen@anonymised.com]
Verzonden: vrijdag 26 oktober 2012 13:39
Aan: 'geoserver-users@lists.sourceforge.net'
Onderwerp: Re: [Geoserver-users] Points of LinearRing do not form a closed linestring

Hi,

GML coordinates tend to include commas
<gml:coordinates>0,0 100,0 100,100 0,100 0,0</gml:coordinates>

In addition, you are using WFS 1.1.0 which defaults to GML3 which considers coordinates as deprecated. Is is not strictly forbidden, I believe, but it would be better not to mix GML2 and GML3 dialects. Thus, use gml:posList.

-Jukka Rahkonen-

Roel De Nijs wrote:

Hello,

I'm trying to send a GetFeature (post) request using a Filter. But I keep
getting the above error and I have no clue about the cause of the issue
(because it's closed). If I create a LinearRing using JTS and the same
coordinates the Geometry is created without any errors.

The request I try to send:

<wfs:GetFeature service="WFS" version="1.1.0"
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.1.0/wfs.xsd&quot;&gt;
      <wfs:Query typeName="feature:ViewRWZI"
xmlns:feature="JAGIS">
              <ogc:Filter
xmlns:ogc="http://www.opengis.net/ogc&quot;&gt;
                      <ogc:And>
                              <ogc:BBOX>

      <ogc:PropertyName>GeoNode</ogc:PropertyName>

      <gml:Envelope
srsName="http://www.opengis.net/gml/srs/epsg.xml#31370&quot;&gt;

      <gml:lowerCorner>-284279.94433594 -
12078.599121097</gml:lowerCorner>

      <gml:upperCorner>592280.94433594
424076.8491211</gml:upperCorner>

      </gml:Envelope>
                              </ogc:BBOX>
                              <ogc:Within>

      <ogc:PropertyName>GeoNode</ogc:PropertyName>

      <gml:Polygon xmlns:gml="http://www.opengis.net/gml&quot;
srsName="http://www.opengis.net/gml/srs/epsg.xml#31370&quot;&gt;

      <gml:exterior>

              <gml:LinearRing>

                      <gml:coordinates>139400 203697
139400 229770 159022 229770 159022
203697 139400 203697</gml:coordinates>

              </gml:LinearRing>

      </gml:exterior>

      </gml:Polygon>
                              </ogc:Within>
                      </ogc:And>
              </ogc:Filter>
      </wfs:Query>
</wfs:GetFeature>

Kind regards,
Roel

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Points-
of-LinearRing-do-not-form-a-closed-linestring-tp5011496.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics Download AppDynamics Lite
for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

________________________________

Volg Aquafin op Facebook<https://www.facebook.com/AquafinNV&gt; | Twitter<https://twitter.com/aquafinnv&gt; | YouTube<http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee&gt; | LinkedIN<http://www.linkedin.com/company/aquafin/products&gt;

Disclaimer: zie www.aquafin.be<http://www.aquafin.be> P Denk aan het milieu. Druk deze mail niet onnodig af.