More

WFS request with CQL_Filter projection


I have a layer in Geoserver called bln_blocks. The layer is inEPSG:3857.

I am doing the follwoing WFS request with a CQL Filter:

var geoserverURL = geoserverURL + '/ows?'; var service = 'service=WFS&'; var version = 'version=1.1.0&'; var request = 'request=GetFeature&'; var typeName = 'typeName=' + layerName; var special = "&outputFormat=text/javascript&format_options=callback:getJson"; var filter = '&CQL_FILTER=WITHIN%28geom%2C+POLYGON%28%281489248.8973085624165833+6895049.90960700158029795%2C1489248.8973085624165833+6895577.80283359717577696%2C1489945.19086309685371816+6895577.80283359717577696%2C1489945.19086309685371816+6895049.90960700158029795%2C1489248.8973085624165833+6895049.90960700158029795%29%29%29'; var urlWFS = geoserverURL + service + version + request + typeName + filter +special;

The polygon in my CQL_Filter is also inEPSG:3857. Is it possible that I specify my polygon inEPSG:4326?


As far as I know this is not supported. Ask from geoserver-users mailing list first and make a feature request to Geoserver jira because it feels like a useful addition. Meanwhile you can use the standard OGC filter instead

  the_geom  -74.817265,40.5296504

UsingFILTERin HTTP GET requests is a bit tricky and ugly. You must URL-encode everything after the&FILTER=and you must probably also add some namespace definitions but by studying the following example it should be doable.

http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.0.0&typeName=topp:states&outputFormat=GML2&FILTER=%3CFilter%20xmlns=%22http://www.opengis.net/ogc%22%20xmlns:gml=%22http://www.opengis.net/gml%22%3E%3CIntersects%3E%3CPropertyName%3Ethe_geom%3C/PropertyName%3E%3Cgml:Point%20srsName=%22EPSG:4326%22%3E%3Cgml:coordinates%3E-74.817265,40.5296504%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E

Openlayers 3 - WFS not updating on map pan

I was using a CQL Filter to return my points based on a certain type. I then added a BBOX to the filter to limit the results only to the current extent of the map. This was all working correctly. The only issue is if I pan the map it does not reload the WFS call. So if I zoom into a point the wfs filters correctly, if I then pan to an area where I know there is a point there will be nothing there unless I change the zoom level. This will update the WFS.

In my ServerVector loader parameter I call a function updateWFSURL(extent). I use this to build the WFS url based on the filter criteria to be passed to the CQL_FILTER. I currently have no loading strategy, I tried using createTile and bbox but neither gave me the proper result.

Here is the code I am using to add the BBOX to my CQL_FILTER. More filters are added after and this filter is appended to the WFS url.

The workaround I found was to capture the map moveend event and call the updateWFSURL(extent) from there. This will update properly on a pan but causes the updateWFSURL to be called twice on zoom since it gets fired from the WFS loader and moveend event.

The solution I am looking for is to either have my WFS update properly on the pan or how to determine the difference between a pan/zoom so I can not call the function in moveend if it was a zoom.

Added more code below. Removed the geoserver url and layer name I am using and stripped out some of CQL Filter that was just filtering on an ID. This wfs is not updating the map on pan without my work around.


OpenLayers WFS request on mouseclick to GeoServer doesn't load features into vector layer

I would appreciate advice on getting an OpenLayers WFS request to GeoServer working in OL3.2 or later, triggered by a mouse singleclick.

By way of background, I have had this working fine for a year at http://maps.nls.uk/geo/find/ using OL 3.1. However, Firefox version 43.0 records the mouse click event at the top left corner of the map canvas, not on the real pixel location clicked on - earlier versions of Firefox, Chrome and IE record the correct pixel location on the canvas. From my basic tests, later versions of OL after 3.1 record the correct pixel location using Firefox 43.0, so I would like to upgrade to a newer version of OL.

My original code in OL3.1 is as follows:

I have tried adapting this following the example at http://openlayers.org/en/v3.6.0/examples/vector-wfs.html and OL 3.6 with the code below:

However I try things, it fails to retrieve features from GeoServer into vectorSource and I would appreciate any pointers or suggestions.


WFS request with CQL_Filter projection - Geographic Information Systems

Open Geospatial Consortium

Publication Date: 2016-06-10

Please refer to the errata for this document,
which may include some normative corrections.

Additional Formats (informative):

Previous Version (informative): html

Internal reference number of this OGC ® document: 12-176r7

Category: OGC ® Implementation Standard

Editors: Doug Nebert , Uwe Voges , Panagiotis Vretanos , Lorenzo Bigagli , Bruce Westcott

OGC® Catalogue Services 3.0 Specification - HTTP Protocol Binding

The OGC Catalog Service 3.0 SWG would like to dedicate this work to the memory of Douglas D. Nebert. Doug was the convener and chair of the group who coordinated the editing of this specification. He was a long time advocate for developing a catalogue standard within OGC and indeed was a strong, vocal and passionate supporter of the OGC and its ideals. He will be remembered and missed.
You can read more about Doug on our website.

Copyright notice

Copyright © 2016 Open Geospatial Consortium
To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.

This document is an OGC Member approved international standard. This document is available on a royalty free, non-discriminatory basis. Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.

Document type: OGC Standard
Document subtype: Part of Implementation Standard
Document stage: Approved as official OGC standard
Document language: English

Permission is hereby granted by the Open Geospatial Consortium, ("Licensor"), free of charge and subject to the terms set forth below, to any person obtaining a copy of this Intellectual Property and any associated documentation, to deal in the Intellectual Property without restriction (except as set forth below), including without limitation the rights to implement, use, copy, modify, merge, publish, distribute, and/or sublicense copies of the Intellectual Property, and to permit persons to whom the Intellectual Property is furnished to do so, provided that all copyright notices on the intellectual property are retained intact and that each person to whom the Intellectual Property is furnished agrees to the terms of this Agreement.

If you modify the Intellectual Property, all copies of the modified Intellectual Property must include, in addition to the above copyright notice, a notice that the Intellectual Property includes modifications that have not been approved or adopted by LICENSOR.

THIS LICENSE IS A COPYRIGHT LICENSE ONLY, AND DOES NOT CONVEY ANY RIGHTS UNDER ANY PATENTS THAT MAY BE IN FORCE ANYWHERE IN THE WORLD.

THE INTELLECTUAL PROPERTY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE INTELLECTUAL PROPERTY WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE INTELLECTUAL PROPERTY WILL BE UNINTERRUPTED OR ERROR FREE. ANY USE OF THE INTELLECTUAL PROPERTY SHALL BE MADE ENTIRELY AT THE USER’S OWN RISK. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY CONTRIBUTOR OF INTELLECTUAL PROPERTY RIGHTS TO THE INTELLECTUAL PROPERTY BE LIABLE FOR ANY CLAIM, OR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM ANY ALLEGED INFRINGEMENT OR ANY LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR UNDER ANY OTHER LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH THE IMPLEMENTATION, USE, COMMERCIALIZATION OR PERFORMANCE OF THIS INTELLECTUAL PROPERTY.

This license is effective until terminated. You may terminate it at any time by destroying the Intellectual Property together with all copies in any form. The license will also terminate if you fail to comply with any term or condition of this Agreement. Except as provided in the following sentence, no such termination of this license shall require the termination of any third party end-user sublicense to the Intellectual Property which is in force as of the date of notice of such termination. In addition, should the Intellectual Property, or the operation of the Intellectual Property, infringe, or in LICENSOR’s sole opinion be likely to infringe, any patent, copyright, trademark or other right of a third party, you agree that LICENSOR, in its sole discretion, may terminate this license without any compensation or liability to you, your licensees or any other party. You agree upon termination of any kind to destroy or cause to be destroyed the Intellectual Property together with all copies in any form, whether held by you or by any third party.

Except as contained in this notice, the name of LICENSOR or of any other holder of a copyright in all or part of the Intellectual Property shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Intellectual Property without prior written authorization of LICENSOR or such copyright holder. LICENSOR is and shall at all times be the sole entity that may authorize you or any third party to use certification marks, trademarks or other special designations to indicate compliance with any LICENSOR standards or specifications. This Agreement is governed by the laws of the Commonwealth of Massachusetts. The application to this Agreement of the United Nations Convention on Contracts for the International Sale of Goods is hereby expressly excluded. In the event any provision of this Agreement shall be deemed unenforceable, void or invalid, such provision shall be modified so as to make it valid and enforceable, and as so modified the entire Agreement shall remain in full force and effect. No decision, action or inaction by LICENSOR shall be construed to be a waiver of any rights or remedies available to it.

This document specifies the HTTP profile of the CSW General Model part (see OGC 12-168r6). The General Model specifies the abstract interfaces between clients and catalogue services. This standard specifies the mapping of the Catalogue abstract model interface into the HTTP protocol binding.

In this HTTP protocol binding, operation requests and responses are sent between clients and servers using the HTTP GET and/or HTTP POST methods. Two equivalent request encodings are defined in this standard. The first using keyword-value pairs (KVP) which is suitable for use with the HTTP GET method. The second using XML which is suitable for use with the HTTP POST method.

This standard defines operations that allow a client to get a service description document for the catalogue (i.e. GetCapabilities) operations that allow a client to, at runtime, interrogate the service about the kinds of data available (i.e. GetDomain) operations that allow a client to retrieve records from the catalogue (i.e. GetRecordById and GetRecords) operations that allow a client to add, modify and remove records from the catalogue service (i.e. Transaction, Harvest, UnHarvest).

The following are keywords to be used by search engines and document catalogues.

ogcdoc, OGC document,asynchronous, ATOM, catalogue, CQL, client, CSW, csw:Record, distributed, Dublin Core, federated, filter, GetCapabilities, GetDomain, GetRecords, GetRecordById, Harvest, http, https, KVP, metadata, periodic, record, request, resource, response, search, server, schema, spatial, temporal, Transaction, UnHarvest, XML, XML-Schema

This document is part of the Catalogue Services Implementation Standard. Unlike previous versions of this standard, Catalogue 3.0 is now divided into two parts: A general model and the specification of the HTTP protocol binding, building on the general model (see OGC 12-168r6).

This document, through its implementation profiles, references several external standards and specifications as dependencies. These documents are listed in Clause 3, Normative references.

Annex A refers to OGC document 14-014r3 – HTTP Protocol Binding – Abstract Test Suite. This Abstract Conformance Test Suite is normative to this standard and shall be implemented when the catalogue services HTTP protocol binding is implemented. Annex C is also normative. All other annexes are informative.

Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. The Open Geospatial Consortium shall not be held responsible for identifying any or all such patent rights.

Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the standard set forth in this document, and to provide supporting documentation.

iv. Document terms and definitions

This document uses the specification terms defined in Subclause 5.3 of OGC 06-121r9, which is based on the ISO/IEC Directives, Part 2. Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this specification.

iv. Submitting organizations

The organizations that submitted the Catalogue Services document to the Open Geospatial Consortium are listed in Clause iv of the general model (OGC 12-168).

All questions regarding this submission should be directed to the editor or the submitters.


Watch the video: WebGis. GeoServer. WFS. Publish shp file (October 2021).