Skip to main content

Using CQL to Filter WFS Features in ArcGIS Pro

How to show the data you want in a WFS - ArcPro

Written by Sam
Updated over a week ago

1. Introduction to CQL and WFS 0:00

generated-image-at-00:00:00

  • Purpose: Demonstrate how to use CQL to filter WFS features in ArcGIS/ArcPro.

  • Common Issue: When adding WFS data, it may not show the most recent records if there are too many (e.g., over 3,000 records).

2. Key Concepts to Understand 0:36

  • Record Limit: Default limit is 3,000 records; this can be changed.

  • Paging: Instead of fetching all records at once, you can request them in smaller batches (e.g., 10 calls of 1,000 records).

  • SQL Filter: Allows you to request specific records based on data fields.

  • Sort By Parameter: You can sort the data based on specific fields.

3. Creating a New Connection 1:40

generated-image-at-00:01:40

  • Create a new connection to your data to apply filters effectively.

  • Best Practice: Ensure all fields have the same name for similar data types to avoid issues with filters.

4. Adding Custom Request Parameters 2:03

generated-image-at-00:02:03

  • Add the URL for your data connection.

  • Remove existing parameters and add a new parameter: CQL_filter.

5. Filtering Data 2:40

generated-image-at-00:02:40

  • Example: Filter for Miconia plants using taxon='MicCal'.

  • Check the viewer to confirm that only Miconia plants are displayed.

6. Adding Additional Filters 3:32

generated-image-at-00:03:32

  • Add an AND condition to filter by State Fiscal Year: state_fiscal_year='2026'.

  • Alternatively, filter by date: date>'2026-01-01'.

7. Sorting Data 5:09

generated-image-at-00:05:09

  • Add a sort by parameter to sort data by the 'added' field.

  • Ensure sorting is set to descending to show the most recent data.

8. Verifying Filter and Sort Effects 6:15

generated-image-at-00:06:15

  • Check that the sorting and filtering are applied correctly across all layers.

9. Setting Limits on Features 7:11

generated-image-at-00:07:11

  • When adding data to the map, set the limit for maximum features (e.g., change from 3,000 to 5,000).

10. Final Verification 8:25

generated-image-at-00:08:25

  • Open the attribute table to confirm that the data is filtered and sorted correctly, showing the latest 5,000 records.

11. Conclusion 8:50

  • Summary of how to effectively use SQL filters to retrieve the right data from WFS in ArcGIS.

Link to Loom

Did this answer your question?