[Geoserver-users] Creating Geoserver Layer from custom WFS

Hi, I was trying to do something, but I don't know if it's possible, so I
wanted to ask first to not waste more time.

I was trying to create a GS layer from a WSF GetCapabilities Doc, which I've
created in a PHP service. I created the GetCapabilities and GetFeatures
documents. I've tried to read the GetFeatures gml from OpenLayers and it
worked fine, drawing all the points in the map, but I don't know if I can
create a WSF data store by this way, I got more than 100 errors trying, but
I don't know if I am doing something wrong or it's not possible.

Thank you so much! I hope you can help me...

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Creating-Geoserver-Layer-from-custom-WFS-tp5076277.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Thu, Sep 5, 2013 at 6:12 PM, beldar15 <beldar15@anonymised.com> wrote:

Hi, I was trying to do something, but I don't know if it's possible, so I
wanted to ask first to not waste more time.

I was trying to create a GS layer from a WSF GetCapabilities Doc, which
I've
created in a PHP service. I created the GetCapabilities and GetFeatures
documents. I've tried to read the GetFeatures gml from OpenLayers and it
worked fine, drawing all the points in the map, but I don't know if I can
create a WSF data store by this way, I got more than 100 errors trying, but
I don't know if I am doing something wrong or it's not possible.

GeoServer needs a compliant WFS server to cascade. At the very minimum you
have to add support for the DescribeFeatureType call as well.
Not sure however how much more work it will be to make it compliant enough
so that GeoServer can cascade it

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

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

I created a Workspace, the a POSTGIS store and I created a layer. Everything
worked well and fine, until that point. Then, I've used that GetCapabilities
document, but I changed the GetFeature Path on it (the online resource). But
it don't worked. So, it is possible? It can be done? or I'm wasting my time?

here's an example of what I've done:

Thank you very much!

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Creating-Geoserver-Layer-from-custom-WFS-tp5076277p5076288.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Ok, I created the three archives, GetCapabilities, DescribeFeatureType and
GetFeatures. I pointed in the GetCapabilities to their respective class. But
no, it doesn't work. I keeps thowing me the same error. I don't know if this
could be possible, I edited every single path that may be wrong or non
existant, but it doesn't work.. Any other ideas? Please! I don't know what
may be wrong... :frowning:

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Creating-Geoserver-Layer-from-custom-WFS-tp5076277p5076325.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Thu, Sep 5, 2013 at 9:20 PM, beldar15 <beldar15@anonymised.com> wrote:

Ok, I created the three archives, GetCapabilities, DescribeFeatureType and
GetFeatures. I pointed in the GetCapabilities to their respective class.
But
no, it doesn't work. I keeps thowing me the same error. I don't know if
this
could be possible, I edited every single path that may be wrong or non
existant, but it doesn't work.. Any other ideas? Please! I don't know what
may be wrong... :frowning:

No idea, you're giving us nothing to go on.
First, take a schema validator and check if the documents you're generating
are schema valid.
Second, once they are, share the GeoServer logs generated when trying to
connect to your WFS server (enable the "geotools developer" logging profile
before doing so) and that might give us some pointers

Generally speaking, writing a valid WFS server is no picnic, it's an
endevour
taking several days of work, even in the simplest case where you just serve
a fixed set of hard-coded feature types.

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

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

Many thanks for keep on this with me! Well I've validated the documents and
they are properly formed. I am creating the Vector Data Store. I select the
workspace, I put as GetCapabilities document the path to the respective
script and I save it. That works. Then I am in the Create Layer window, and
there is my data store listed. When I press 'Publish' it throws me the very
big error list:

erro_log_gs.txt
<http://osgeo-org.1560.x6.nabble.com/file/n5076332/erro_log_gs.txt&gt;

if you need anything else, please don't hesitate in asking me! Thanks
again...

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Creating-Geoserver-Layer-from-custom-WFS-tp5076277p5076332.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I don't know what else to do, I verified the entire code, also every path
that's on it. And everything is fine, but I don't know how to use this, to
create a layer. This is the GetCapabilities documente that I created, if
someone please, could check it out and tell me if there is something wrong,
I'll apreciate it for the rest of my life!

Workspace Name: GTR_TEST
Data Store Name: gtr_vehiculos

GetCapabilities.xml
<http://osgeo-org.1560.x6.nabble.com/file/n5076508/GetCapabilities.xml&gt;

S.O.S.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Creating-Geoserver-Layer-from-custom-WFS-tp5076277p5076508.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi all i have a doubt, i need to establish a wms cascading , but i have a trouble, my internet conection is behind a web proxy, thta have username, password,url and port, and i need that geoserver understand that, and use the other wms service using the proxy, in what file i have to put and what i have to put where incase that i uase geoserver 2.3.2 in windows, please i need that hand, thanks to all.

--

Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

Hi list,

I've tried the following filter in the Demo request page and it works (even though some elements do not have namespace prefix):

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature
     service="WFS"
     version="2.0.0"
     xmlns:wfs="http://www.opengis.net/wfs/2.0&quot;
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
     xmlns:gml="http://www.opengis.net/gml/3.2&quot;
     xmlns:fes="http://www.opengis.net/fes/2.0&quot;
     xsi:schemaLocation="
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;&gt;
     <wfs:Query typeNames="ns1:db_entries">
         <fes:Filter>
                 <Not>
                     <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                         <gml:Polygon srsName='urn:x-ogc:def:crs:EPSG:4326'>
                             <gml:exterior>
                                 <gml:LinearRing>
                                     <gml:posList>54.6 8.3 54.7 8.4 54.7 8.5 54.6 8.3</gml:posList>
                                 </gml:LinearRing>
                             </gml:exterior>
                         </gml:Polygon>
                     </Disjoint>
                 </Not>
         </fes:Filter>
      </wfs:Query>
</wfs:GetFeature>

But when I copy the portion:
                 <Not>
                     <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                         <gml:Polygon srsName='urn:x-ogc:def:crs:EPSG:4326'>
                             <gml:exterior>
                                 <gml:LinearRing>
                                     <gml:posList>54.6 8.3 54.7 8.4 54.7 8.5 54.6 8.3</gml:posList>
                                 </gml:LinearRing>
                             </gml:exterior>
                         </gml:Polygon>
                     </Disjoint>
                 </Not>
and use it (after encoded) in a request URL after &FILTER=, it does not work, and I receive the error message:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Index: 0, Size: 0

I've done the same thing in URLs with other filter 2.0 elements like PropertyIsLike and PropertyIsEqualTo and they work for me. Could someone give me a hint? Thanks!

On Tue, Sep 10, 2013 at 1:50 PM, Nhan Vo <nhanvo@anonymised.com> wrote:

I've done the same thing in URLs with other filter 2.0 elements like
PropertyIsLike and PropertyIsEqualTo and they work for me. Could someone
give me a hint? Thanks!

Making a guess here, did you remember to add &version=2.0 in your request
URL?

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 Andrea,

Thanks for the reply! Yes I've added &version=2.0.0, and as I said it works for other elements like PropertyIsLike and PropertyIsEqualTo, but for this spatial filter it does not work.

Here's the stack trace from geoserver log:

2013-09-10 14:36:26,428 ERROR [geoserver.ows] -
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
     at java.util.ArrayList.RangeCheck(ArrayList.java:547)
     at java.util.ArrayList.get(ArrayList.java:322)
     at org.geotools.xml.EMFUtils.set(EMFUtils.java:333)
     at org.geoserver.wfs.kvp.GetFeatureKvpRequestReader.querySet(GetFeatureKvpRequestReader.java:474)
     at org.geoserver.wfs.kvp.GetFeatureKvpRequestReader.read(GetFeatureKvpRequestReader.java:209)
     at org.geoserver.wfs.kvp.v2_0.GetFeatureKvpRequestReader.read(GetFeatureKvpRequestReader.java:39)
     at org.geoserver.ows.Dispatcher.parseRequestKVP(Dispatcher.java:1412)
     at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:622)
     at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:263)
     at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
     at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)
     at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
     at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
     at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
     at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
     at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
     at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
     at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
     at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:82)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
     at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
     at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
     at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
     at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
     at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:134)
     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
     at java.lang.Thread.run(Thread.java:662)

On 9/10/2013 2:33 PM, Andrea Aime wrote:

On Tue, Sep 10, 2013 at 1:50 PM, Nhan Vo <nhanvo@anonymised.com <mailto:nhanvo@anonymised.com>> wrote:

    I've done the same thing in URLs with other filter 2.0 elements like
    PropertyIsLike and PropertyIsEqualTo and they work for me. Could
    someone
    give me a hint? Thanks!

Making a guess here, did you remember to add &version=2.0 in your request URL?

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

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

--

*Thanh-Trong-Nhan Vo*

smile consult GmbH
Vahrenwalder Straße 4
D-30165 Hannover

Tel:

0511/543617-46

Fax:

0511/543617-66

Mail:

nhanvo@anonymised.com <mailto:nhanvo@anonymised.com>

Internet:

http://www.smileconsult.de/&gt;

Geschäftsführer: Frank Sellerhoff .Peter Milbradt .Christoph Lippert
USt-IdNr.: DE208857046 .Amtsgericht Hannover HRB 58707

Grafik1.gif

Nhan,

GeoServer is by default permissive when it comes to namespaces.

Please paste the entire request GET URL into an email so we can see it. Or the query part (after "?") at least if you do not want to disclose the host.

Also, note that the schemaLocation in your request is wrong: the WFS 2 namespace should be followed by the WFS 2.0 schema URL, not GML 3.2:

xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;

Like this (stolen from a WFS 2.0 response):

xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd&quot;

Kind regards,
Ben.

On 10/09/13 19:50, Nhan Vo wrote:

Hi list,

I've tried the following filter in the Demo request page and it works
(even though some elements do not have namespace prefix):

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature
      service="WFS"
      version="2.0.0"
      xmlns:wfs="http://www.opengis.net/wfs/2.0&quot;
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns:gml="http://www.opengis.net/gml/3.2&quot;
      xmlns:fes="http://www.opengis.net/fes/2.0&quot;
      xsi:schemaLocation="
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;&gt;
      <wfs:Query typeNames="ns1:db_entries">
          <fes:Filter>
                  <Not>
                      <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                          <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                              <gml:exterior>
                                  <gml:LinearRing>
                                      <gml:posList>54.6 8.3 54.7 8.4 54.7
8.5 54.6 8.3</gml:posList>
                                  </gml:LinearRing>
                              </gml:exterior>
                          </gml:Polygon>
                      </Disjoint>
                  </Not>
          </fes:Filter>
       </wfs:Query>
</wfs:GetFeature>

But when I copy the portion:
                  <Not>
                      <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                          <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                              <gml:exterior>
                                  <gml:LinearRing>
                                      <gml:posList>54.6 8.3 54.7 8.4 54.7
8.5 54.6 8.3</gml:posList>
                                  </gml:LinearRing>
                              </gml:exterior>
                          </gml:Polygon>
                      </Disjoint>
                  </Not>
and use it (after encoded) in a request URL after &FILTER=, it does not
work, and I receive the error message:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Index: 0, Size: 0

I've done the same thing in URLs with other filter 2.0 elements like
PropertyIsLike and PropertyIsEqualTo and they work for me. Could someone
give me a hint? Thanks!

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Hi Ben,

Thank you for clarification. Here is the query part of the GET request:

The query that does not work:
?VERSION=2.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=ns1:db_entries&FILTER=<Not><Disjoint><ValueReference>ns1:geometry</ValueReference><gml:Polygon srsName='urn:x-ogc:def:crs:EPSG:4326'><gml:exterior><gml:LinearRing><gml:posList>54.6 8.3 54.7 8.4 54.7 8.5 54.6 8.3</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></Disjoint></Not>

This one works:
?VERSION=2.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=ns1:db_entries&FILTER=<PropertyIsEqualTo matchCase='false'><ValueReference>ns1:name</ValueReference><Literal>SkAllnask</Literal></PropertyIsEqualTo>

The part after &FILTER= is encoded when sent to the server.

In the sample requests (e.g. getFeatureBetween URL), it seems that the part after &FILTER= is wrapped between <Filter xmlns='http://www.opengis.net/ogc’> and </Filter>. I've also tried that but without luck.

It is a nice feature that GeoServer lets one choose between permissive and strict modes :slight_smile:

Cheers,
Nhan

On 9/11/2013 4:56 AM, Ben Caradoc-Davies wrote:

Nhan,

GeoServer is by default permissive when it comes to namespaces.

Please paste the entire request GET URL into an email so we can see it. Or the query part (after "?") at least if you do not want to disclose the host.

Also, note that the schemaLocation in your request is wrong: the WFS 2 namespace should be followed by the WFS 2.0 schema URL, not GML 3.2:

xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;

Like this (stolen from a WFS 2.0 response):

xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd&quot;

Kind regards,
Ben.

On 10/09/13 19:50, Nhan Vo wrote:

Hi list,

I've tried the following filter in the Demo request page and it works
(even though some elements do not have namespace prefix):

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature
      service="WFS"
      version="2.0.0"
      xmlns:wfs="http://www.opengis.net/wfs/2.0&quot;
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns:gml="http://www.opengis.net/gml/3.2&quot;
      xmlns:fes="http://www.opengis.net/fes/2.0&quot;
      xsi:schemaLocation="
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;&gt;
      <wfs:Query typeNames="ns1:db_entries">
          <fes:Filter>
                  <Not>
                      <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                          <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                              <gml:exterior>
                                  <gml:LinearRing>
                                      <gml:posList>54.6 8.3 54.7 8.4 54.7
8.5 54.6 8.3</gml:posList>
                                  </gml:LinearRing>
                              </gml:exterior>
                          </gml:Polygon>
                      </Disjoint>
                  </Not>
          </fes:Filter>
       </wfs:Query>
</wfs:GetFeature>

But when I copy the portion:
                  <Not>
                      <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                          <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                              <gml:exterior>
                                  <gml:LinearRing>
                                      <gml:posList>54.6 8.3 54.7 8.4 54.7
8.5 54.6 8.3</gml:posList>
                                  </gml:LinearRing>
                              </gml:exterior>
                          </gml:Polygon>
                      </Disjoint>
                  </Not>
and use it (after encoded) in a request URL after &FILTER=, it does not
work, and I receive the error message:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Index: 0, Size: 0

I've done the same thing in URLs with other filter 2.0 elements like
PropertyIsLike and PropertyIsEqualTo and they work for me. Could someone
give me a hint? Thanks!

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

How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Nhan,

because WFS 2.0 no longer depends on any version of GML, when GeoServer is parsing your request it cannot deduce what version of GML or filter you are using. One solution that works is to specify the namespaces; I added an fes:Filter element as a place where I could put the xmlns attributes. A strictly conformant WFS 2.0 implementation *requires* these. GeoServer is permissive, but it cannot guess in this case (we have gotten soft and spoiled by the hard link between WFS 1.1.0 and GML 3.1.1). The separation of concerns in WFS 2.0 is better, but it means users have to be a bit more pedantic.

For example, I was able to pick out the second feature <sf:bugsites gml:id="bugsites.2"> ("Beetle site") in the sample sf:bugsites data shipped with GeoServer with:

http://localhost:8080/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typenames=sf:bugsites&filter=<fes:Filter%20xmlns:fes='http://www.opengis.net/fes/2.0'%20xmlns:gml='http://www.opengis.net/gml/3.2'><fes:Not><fes:Disjoint><fes:ValueReference>sf:the_geom</fes:ValueReference><gml:Polygon%20srsName='http://www.opengis.net/def/crs/EPSG/0/26713'><gml:exterior><gml:LinearRing><gml:posList>590431.0%204915204.0%20590430.0%204915205.0%20590429.0%204915204.0%20590430.0%204915203.0%20590431.0%204915204.0</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></fes:Disjoint></fes:Not></fes:Filter>

The decoded filter part is:

filter=<fes:Filter xmlns:fes='http://www.opengis.net/fes/2.0’ xmlns:gml='http://www.opengis.net/gml/3.2’><fes:Not><fes:Disjoint><fes:ValueReference>sf:the_geom</fes:ValueReference><gml:Polygon srsName='http://www.opengis.net/def/crs/EPSG/0/26713’><gml:exterior><gml:LinearRing><gml:posList>590431.0 4915204.0 590430.0 4915205.0 590429.0 4915204.0 590430.0 4915203.0 590431.0 4915204.0</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></fes:Disjoint></fes:Not></fes:Filter>

Note the two xmlns attributes on fes:Filter to ensure the namespace prefixes are unambiguous.

We should update the user manual to include this example.

Kind regards,
Ben.

On 11/09/13 15:44, Nhan Vo wrote:

Hi Ben,

Thank you for clarification. Here is the query part of the GET request:

The query that does not work:
?VERSION=2.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=ns1:db_entries&FILTER=<Not><Disjoint><ValueReference>ns1:geometry</ValueReference><gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'><gml:exterior><gml:LinearRing><gml:posList>54.6
8.3 54.7 8.4 54.7 8.5 54.6
8.3</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></Disjoint></Not>

This one works:
?VERSION=2.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=ns1:db_entries&FILTER=<PropertyIsEqualTo
matchCase='false'><ValueReference>ns1:name</ValueReference><Literal>SkAllnask</Literal></PropertyIsEqualTo>

The part after &FILTER= is encoded when sent to the server.

In the sample requests (e.g. getFeatureBetween URL), it seems that the
part after &FILTER= is wrapped between <Filter
xmlns='http://www.opengis.net/ogc’> and </Filter>. I've also tried that
but without luck.

It is a nice feature that GeoServer lets one choose between permissive
and strict modes :slight_smile:

Cheers,
Nhan

On 9/11/2013 4:56 AM, Ben Caradoc-Davies wrote:

Nhan,

GeoServer is by default permissive when it comes to namespaces.

Please paste the entire request GET URL into an email so we can see
it. Or the query part (after "?") at least if you do not want to
disclose the host.

Also, note that the schemaLocation in your request is wrong: the WFS 2
namespace should be followed by the WFS 2.0 schema URL, not GML 3.2:

xsi:schemaLocation="http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;

Like this (stolen from a WFS 2.0 response):

xsi:schemaLocation="http://www.opengis.net/gml/3.2
http://schemas.opengis.net/gml/3.2.1/gml.xsd
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0/wfs.xsd&quot;

Kind regards,
Ben.

On 10/09/13 19:50, Nhan Vo wrote:

Hi list,

I've tried the following filter in the Demo request page and it works
(even though some elements do not have namespace prefix):

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature
       service="WFS"
       version="2.0.0"
       xmlns:wfs="http://www.opengis.net/wfs/2.0&quot;
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
       xmlns:gml="http://www.opengis.net/gml/3.2&quot;
       xmlns:fes="http://www.opengis.net/fes/2.0&quot;
       xsi:schemaLocation="
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;&gt;
       <wfs:Query typeNames="ns1:db_entries">
           <fes:Filter>
                   <Not>
                       <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                           <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                               <gml:exterior>
                                   <gml:LinearRing>
                                       <gml:posList>54.6 8.3 54.7 8.4
54.7
8.5 54.6 8.3</gml:posList>
                                   </gml:LinearRing>
                               </gml:exterior>
                           </gml:Polygon>
                       </Disjoint>
                   </Not>
           </fes:Filter>
        </wfs:Query>
</wfs:GetFeature>

But when I copy the portion:
                   <Not>
                       <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                           <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                               <gml:exterior>
                                   <gml:LinearRing>
                                       <gml:posList>54.6 8.3 54.7 8.4
54.7
8.5 54.6 8.3</gml:posList>
                                   </gml:LinearRing>
                               </gml:exterior>
                           </gml:Polygon>
                       </Disjoint>
                   </Not>
and use it (after encoded) in a request URL after &FILTER=, it does not
work, and I receive the error message:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Index: 0, Size: 0

I've done the same thing in URLs with other filter 2.0 elements like
PropertyIsLike and PropertyIsEqualTo and they work for me. Could someone
give me a hint? Thanks!

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

How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Hi Ben,

After I wrap the filter in the Filter tags with namespaces everything works as expected. Thanks for the detailed explanation! Including your example together with some explanation in the documentation would be helpful for others.

Cheers,
Nhan

On 9/11/2013 11:20 AM, Ben Caradoc-Davies wrote:

Nhan,

because WFS 2.0 no longer depends on any version of GML, when GeoServer is parsing your request it cannot deduce what version of GML or filter you are using. One solution that works is to specify the namespaces; I added an fes:Filter element as a place where I could put the xmlns attributes. A strictly conformant WFS 2.0 implementation *requires* these. GeoServer is permissive, but it cannot guess in this case (we have gotten soft and spoiled by the hard link between WFS 1.1.0 and GML 3.1.1). The separation of concerns in WFS 2.0 is better, but it means users have to be a bit more pedantic.

For example, I was able to pick out the second feature <sf:bugsites gml:id="bugsites.2"> ("Beetle site") in the sample sf:bugsites data shipped with GeoServer with:

http://localhost:8080/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typenames=sf:bugsites&filter=<fes:Filter%20xmlns:fes='http://www.opengis.net/fes/2.0'%20xmlns:gml='http://www.opengis.net/gml/3.2'><fes:Not><fes:Disjoint><fes:ValueReference>sf:the_geom</fes:ValueReference><gml:Polygon%20srsName='http://www.opengis.net/def/crs/EPSG/0/26713'><gml:exterior><gml:LinearRing><gml:posList>590431.0%204915204.0%20590430.0%204915205.0%20590429.0%204915204.0%20590430.0%204915203.0%20590431.0%204915204.0</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></fes:Disjoint></fes:Not></fes:Filter>

The decoded filter part is:

filter=<fes:Filter xmlns:fes='http://www.opengis.net/fes/2.0’ xmlns:gml='http://www.opengis.net/gml/3.2’><fes:Not><fes:Disjoint><fes:ValueReference>sf:the_geom</fes:ValueReference><gml:Polygon srsName='http://www.opengis.net/def/crs/EPSG/0/26713’><gml:exterior><gml:LinearRing><gml:posList>590431.0 4915204.0 590430.0 4915205.0 590429.0 4915204.0 590430.0 4915203.0 590431.0 4915204.0</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></fes:Disjoint></fes:Not></fes:Filter>

Note the two xmlns attributes on fes:Filter to ensure the namespace prefixes are unambiguous.

We should update the user manual to include this example.

Kind regards,
Ben.

On 11/09/13 15:44, Nhan Vo wrote:

Hi Ben,

Thank you for clarification. Here is the query part of the GET request:

The query that does not work:
?VERSION=2.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=ns1:db_entries&FILTER=<Not><Disjoint><ValueReference>ns1:geometry</ValueReference><gml:Polygon

srsName='urn:x-ogc:def:crs:EPSG:4326'><gml:exterior><gml:LinearRing><gml:posList>54.6

8.3 54.7 8.4 54.7 8.5 54.6
8.3</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></Disjoint></Not>

This one works:
?VERSION=2.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAME=ns1:db_entries&FILTER=<PropertyIsEqualTo

matchCase='false'><ValueReference>ns1:name</ValueReference><Literal>SkAllnask</Literal></PropertyIsEqualTo>

The part after &FILTER= is encoded when sent to the server.

In the sample requests (e.g. getFeatureBetween URL), it seems that the
part after &FILTER= is wrapped between <Filter
xmlns='http://www.opengis.net/ogc’> and </Filter>. I've also tried that
but without luck.

It is a nice feature that GeoServer lets one choose between permissive
and strict modes :slight_smile:

Cheers,
Nhan

On 9/11/2013 4:56 AM, Ben Caradoc-Davies wrote:

Nhan,

GeoServer is by default permissive when it comes to namespaces.

Please paste the entire request GET URL into an email so we can see
it. Or the query part (after "?") at least if you do not want to
disclose the host.

Also, note that the schemaLocation in your request is wrong: the WFS 2
namespace should be followed by the WFS 2.0 schema URL, not GML 3.2:

xsi:schemaLocation="http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;

Like this (stolen from a WFS 2.0 response):

xsi:schemaLocation="http://www.opengis.net/gml/3.2
http://schemas.opengis.net/gml/3.2.1/gml.xsd
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0/wfs.xsd&quot;

Kind regards,
Ben.

On 10/09/13 19:50, Nhan Vo wrote:

Hi list,

I've tried the following filter in the Demo request page and it works
(even though some elements do not have namespace prefix):

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature
       service="WFS"
       version="2.0.0"
       xmlns:wfs="http://www.opengis.net/wfs/2.0&quot;
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
       xmlns:gml="http://www.opengis.net/gml/3.2&quot;
       xmlns:fes="http://www.opengis.net/fes/2.0&quot;
       xsi:schemaLocation="
http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;&gt;
       <wfs:Query typeNames="ns1:db_entries">
           <fes:Filter>
                   <Not>
                       <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                           <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                               <gml:exterior>
                                   <gml:LinearRing>
<gml:posList>54.6 8.3 54.7 8.4
54.7
8.5 54.6 8.3</gml:posList>
                                   </gml:LinearRing>
                               </gml:exterior>
                           </gml:Polygon>
                       </Disjoint>
                   </Not>
           </fes:Filter>
        </wfs:Query>
</wfs:GetFeature>

But when I copy the portion:
                   <Not>
                       <Disjoint>
<ValueReference>ns1:geometry</ValueReference>
                           <gml:Polygon
srsName='urn:x-ogc:def:crs:EPSG:4326'>
                               <gml:exterior>
                                   <gml:LinearRing>
<gml:posList>54.6 8.3 54.7 8.4
54.7
8.5 54.6 8.3</gml:posList>
                                   </gml:LinearRing>
                               </gml:exterior>
                           </gml:Polygon>
                       </Disjoint>
                   </Not>
and use it (after encoded) in a request URL after &FILTER=, it does not
work, and I receive the error message:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Index: 0, Size: 0

I've done the same thing in URLs with other filter 2.0 elements like
PropertyIsLike and PropertyIsEqualTo and they work for me. Could someone
give me a hint? Thanks!

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

How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

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

How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users