OGC API Features (WFS 3.0)

With the ThinkGeo 14 release back in May, our Desktop and Mobile components now have support for OGC API Features - formerly known as WFS 3.0.

The OGC API Features service is an open specification defined by the Open Geospatial Consortium (OGC) and has seen widespread support from various government, commercial, and open source organizations.

OGC API Features specifies the fundamental API building blocks for interacting with features. The spatial data community uses the term ‘feature’ for things in the real world that are of interest.

In this post, we’ll dig into an example using a public sample OGC Feature API service with features from the National Geographic Institute of Spain.

Tip

To see the OGC API functionality in action, just clone the HowDoI samples, run the solution and then click on the ‘OGC API Feature Server’ under the ‘Map Online Data’ section of the samples.

While the sample below is using ThinkGeo Desktop for WPF, there is also support for ThinkGeo Mobile for MAUI which will be discussed more below.

Sample Overview

A sample OGC Feature API service with features from the National Geographic Institute of Spain - rendered  in the Desktop 'HowDoI' samples.

In the ‘OGC API Feature Server’ sample, we use a public service from the National Geographic Institute of Spain that serves a dataset of named points. The sample uses a simple red PointStyle and TextStyle for styling the points and labels.

While the styling in this sample is very simple, there are endless other styling options that are discussed more thoroughly in this older blog post on Styling Your Maps.

Code Walkthrough

The code below shows how to create a new OgcApiFeatureLayer pointed at the sample https://api-features.ign.es point dataset, and reproject the features from the 4326 srid served by the service into the 3857 projection that the basemap is rendered in:

  
    OgcApiFeatureLayer ignLayer = new OgcApiFeatureLayer("https://api-features.ign.es", "namedplace")
    {
        FeatureSource =
        {
            ProjectionConverter = new ProjectionConverter(4326, 3857)
        }
    };
  

Next, you’ll need a little code to set the styling for the point and text labels:

  
    // Create a new text style and set various settings to make it look good.
    var ignNamedPlacesTextStyle = new TextStyle("etiqueta", new GeoFont("Arial", 14), GeoBrushes.DarkRed)
    {
        MaskType = MaskType.RoundedCorners,
        OverlappingRule = LabelOverlappingRule.NoOverlapping,
        Mask = new AreaStyle(GeoBrushes.WhiteSmoke),
        SuppressPartialLabels = true,
        YOffsetInPixel = -12
    };

    ignLayer.ZoomLevelSet.ZoomLevel13.DefaultPointStyle = PointStyle.CreateSimplePointStyle(PointSymbolType.Circle, GeoColors.DarkRed, 10);
    ignLayer.ZoomLevelSet.ZoomLevel13.DefaultTextStyle = ignNamedPlacesTextStyle;
    ignLayer.ZoomLevelSet.ZoomLevel13.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
  

Finally, add our ignLayer to a new OgcApiFeaturesOverlay and set the DrawingBulkCount property to progressively render larger datasets.

  
    // Finally, add our new OgcApi layer to an overlay and set the DrawingBulkCount property to progressively render larger datasets.
    var overlay = new OgcApiFeaturesOverlay()
    {
        FeatureLayer = ignLayer,
        DrawingBulkCount = 100
    };
   

Summary

We hope today’s post has been helpful. If you have any questions or if you have a topic you would like to learn more about, please email sales@thinkgeo.com or schedule a meeting to talk in person.

About ThinkGeo

We are a GIS software company founded in 2004 and located in Frisco, TX. Our clients are in more than 40 industries including agriculture, energy, transportation, government, engineering, IT, and defense. We pride ourselves on our excellent service and transparency. ThinkGeo offers a variety of products and services to meet almost any GIS application need. We can even help you develop your next project - anywhere from a few hours of consulting to outsourcing an entire project. To learn more, email us at sales@thinkgeo.com, or call us direct at 1-214-449-0330.

Next
Next

Device Geolocation in MAUI