Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion on how to use spatial ECQL predicates #30

Closed
annakrystalli opened this issue Nov 26, 2021 · 24 comments
Closed

Confusion on how to use spatial ECQL predicates #30

annakrystalli opened this issue Nov 26, 2021 · 24 comments
Assignees

Comments

@annakrystalli
Copy link
Collaborator

I've been trying to include more detailed demos of using spatial ECQL predicates, following the following geoserver documentation: https://docs.geoserver.org/latest/en/user/filter/ecql_reference.html#ecql-expr

However I am hitting a lot of problems with getting filters to work and am also getting confusing results when they do work. I've isolated a couple of examples below to illustrate some of my confusion:

library(EMODnetWFS)
wfs_gs <- emodnet_init_wfs_client(service = "geology_seabed_substrate_maps")
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> Loading IANA mime types...
#> No encoding supplied: defaulting to UTF-8.
#> ✓ WFS client created succesfully
#> ℹ Service: 'https://drive.emodnet-geology.eu/geoserver/gtk/wfs'
#> ℹ Version: '2.0.0'

# start with a reference geometry. NOte call returns EWKT geometry MULTISURFACE
# which is not part of OCG standard
ref_sf <- emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter ="id=10848", reduce_layers = TRUE) 
ref_sf
#> Simple feature collection with 1 feature and 30 fields
#> Geometry type: MULTISURFACE
#> Dimension:     XY
#> Bounding box:  xmin: 3183730 ymin: 2544099 xmax: 3184146 ymax: 2546943
#> CRS:           +init=epsg:3034
#>                      gml_id    id objectid  code country data_holder
#> 1 seabed_substrate_1m.10848 10848    10848 FR001  France        SHOM
#>       contact   scale original_scale original_grain_size
#> 1 bps@shom.fr 1000000              0                SHOM
#>                                                                                                           references
#> 1 Garlan T. et Marches E. (2010) - DCSMM, Carte de nature des fonds de la sous-région Manche-Mer du Nord à 1/500 000
#>                                                                            comments
#> 1 Based on a compilation of maps from differents institutions between 1970 and 2010
#>   reclassification method sample_number original_substrate relation folk_16cl
#> 1                2      4             0                103        4         6
#>              folk_16cl_txt folk_7cl folk_7cl_txt folk_5cl folk_5cl_txt
#> 1 6. No data at this level        2      2. Sand        2     2. Sand 
#>   surface_feature conf_rs conf_s conf_d conf_tot shape_length   shape_area
#> 1                      NA     NA     NA       NA   0.05998287 8.306917e-05
#>                             geom
#> 1 MULTISURFACE (POLYGON ((318...

# create reference map
ref_map <- ref_sf %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>% # mapview doesn't seem to work with 
    # EWKT so MULTIURFACE needs casting to a geometry collection
mapview::mapview(zcol = "folk_7cl_txt", burst = TRUE)

ref_map

image

#extract geometry as WKT
ref_geom_multisurface <- ref_sf %>% 
  sf::st_geometry() %>% sf::st_as_text()
ref_geom_multisurface
#> [1] "MULTISURFACE (POLYGON ((3184146 2544100, 3184141 2544099, 3184108 2544110, 3184055 2544148, 3184014 2544192, 3183974 2544250, 3183940 2544317, 3183914 2544387, 3183899 2544453, 3183890 2544510, 3183864 2544808, 3183730 2546928, 3183967 2546943, 3184058 2545528, 3184057 2545520, 3184054 2545456, 3184060 2545400, 3184057 2545336, 3184054 2545271, 3184058 2545205, 3184058 2545118, 3184090 2545026, 3184103 2544826, 3184102 2544806, 3184107 2544751, 3184098 2544557, 3184103 2544360, 3184103 2544317, 3184139 2544137, 3184146 2544100)))"

# Use WKT to construct DWITHIN query - FAILS with EWKT geometry MULTISURFACE event though that's the geometry type the data is returned as.
emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter = paste0("DWITHIN(geom,", ref_geom_multisurface, ", 0.5, kilometers)"),
                       reduce_layers = TRUE ) 
#> Warning: Download of layer 'seabed_substrate_1m' failed: Error: Cannot open "/private/var/folders/8p/87cqdx2s34vfvcgh04l6z72w0000gn/T/Rtmpmzke5V/file1e416b4c119.gml"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
#> NULL



# Transform to GEOMETRYCOLLECTION. 
ref_geom_colllection <- ref_sf %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>% 
  sf::st_geometry() %>% sf::st_as_text()

# Use WKT to construct DWITHIN query - 
geom_colllection_res <- emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter = paste0("DWITHIN(geom,", ref_geom_colllection, ", 0.5, kilometers)"),
                       reduce_layers = TRUE ) 
# WORKS
geom_colllection_res
#> Simple feature collection with 16 features and 30 fields
#> Geometry type: MULTISURFACE
#> Dimension:     XY
#> Bounding box:  xmin: 2333204 ymin: 2842851 xmax: 2751690 ymax: 3525843
#> CRS:           +init=epsg:3034
#> First 10 features:
#>                       gml_id    id objectid   code country data_holder
#> 1  seabed_substrate_1m.17209 17209    17209 IE-016 Ireland         GSI
#> 2  seabed_substrate_1m.17210 17210    17210 IE-016 Ireland         GSI
#> 3  seabed_substrate_1m.17231 17231    17231 IE-016 Ireland         GSI
#> 4  seabed_substrate_1m.17232 17232    17232 IE-016 Ireland         GSI
#> 5  seabed_substrate_1m.17225 17225    17225 IE-016 Ireland         GSI
#> 6  seabed_substrate_1m.17226 17226    17226 IE-016 Ireland         GSI
#> 7  seabed_substrate_1m.17227 17227    17227 IE-016 Ireland         GSI
#> 8  seabed_substrate_1m.17229 17229    17229 IE-016 Ireland         GSI
#> 9  seabed_substrate_1m.17230 17230    17230 IE-016 Ireland         GSI
#> 10 seabed_substrate_1m.17233 17233    17233 IE-016 Ireland         GSI
#>                  contact   scale original_scale original_grain_size references
#> 1  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 2  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 3  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 4  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 5  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 6  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 7  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 8  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 9  charise.mckeon@gsi.ie 1000000              0                Folk           
#> 10 charise.mckeon@gsi.ie 1000000              0                Folk           
#>                                                                comments
#> 1  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 2  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 3  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 4  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 5  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 6  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 7  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 8  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 9  Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#> 10 Generalized from 250k scale to 1 M by GTK June 2016/EMODnet Geology.
#>    reclassification method sample_number original_substrate relation folk_16cl
#> 1                 2      2             0                           0         6
#> 2                 2      2             0                           0         6
#> 3                 2      2             0                           0         6
#> 4                 2      2             0                           0         6
#> 5                 2      2             0                           0         6
#> 6                 2      2             0                           0         6
#> 7                 2      2             0                           0         6
#> 8                 2      2             0                           0         6
#> 9                 2      2             0                           0         6
#> 10                2      2             0                           0         6
#>               folk_16cl_txt folk_7cl                folk_7cl_txt folk_5cl
#> 1  6. No data at this level        3 3. Coarse-grained sediment         3
#> 2  6. No data at this level        3 3. Coarse-grained sediment         3
#> 3  6. No data at this level        4           4. Mixed sediment        4
#> 4  6. No data at this level        4           4. Mixed sediment        4
#> 5  6. No data at this level        4           4. Mixed sediment        4
#> 6  6. No data at this level        4           4. Mixed sediment        4
#> 7  6. No data at this level        4           4. Mixed sediment        4
#> 8  6. No data at this level        4           4. Mixed sediment        4
#> 9  6. No data at this level        4           4. Mixed sediment        4
#> 10 6. No data at this level        4           4. Mixed sediment        4
#>                   folk_5cl_txt surface_feature conf_rs conf_s conf_d conf_tot
#> 1  3. Coarse-grained sediment                       NA     NA     NA       NA
#> 2  3. Coarse-grained sediment                       NA     NA     NA       NA
#> 3            4. Mixed sediment                      NA     NA     NA       NA
#> 4            4. Mixed sediment                      NA     NA     NA       NA
#> 5            4. Mixed sediment                      NA     NA     NA       NA
#> 6            4. Mixed sediment                      NA     NA     NA       NA
#> 7            4. Mixed sediment                      NA     NA     NA       NA
#> 8            4. Mixed sediment                      NA     NA     NA       NA
#> 9            4. Mixed sediment                      NA     NA     NA       NA
#> 10           4. Mixed sediment                      NA     NA     NA       NA
#>    shape_length   shape_area                           geom
#> 1    0.01020992 5.222959e-06 MULTISURFACE (POLYGON ((252...
#> 2    1.99591150 1.361911e-01 MULTISURFACE (POLYGON ((252...
#> 3    8.59975782 2.658686e-01 MULTISURFACE (POLYGON ((256...
#> 4    0.14909377 8.219173e-04 MULTISURFACE (POLYGON ((254...
#> 5    0.12131420 9.190709e-04 MULTISURFACE (POLYGON ((251...
#> 6    0.06035866 2.032417e-04 MULTISURFACE (POLYGON ((251...
#> 7    0.21341242 2.291320e-03 MULTISURFACE (POLYGON ((251...
#> 8    0.18912688 1.402354e-03 MULTISURFACE (POLYGON ((253...
#> 9    0.46555359 7.035125e-03 MULTISURFACE (POLYGON ((252...
#> 10   0.19845728 1.973919e-03 MULTISURFACE (POLYGON ((255...

# However returns very strange results!
ref_map + geom_colllection_res %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>%
mapview::mapview(zcol = "folk_7cl_txt", burst = TRUE)

image

I also tried to test out predicate TOUCHES. Seems to fail with some geometry types:

# try to use TOUCHES predicate with GEOMETRYCOLLECTION - FAILS!
emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter = paste0("TOUCHES(geom,", ref_geom_colllection,")"),
                       reduce_layers = TRUE ) 
#> Warning: Download of layer 'seabed_substrate_1m' failed: Error: Cannot open "/private/var/folders/8p/87cqdx2s34vfvcgh04l6z72w0000gn/T/Rtmpmzke5V/file1e413fb143f5.gml"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
#> NULL


# Transform to single POLYGON and try again
ref_geom <- ref_sf %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>% 
    sf::st_collection_extract(type = "POLYGON") %>% 
  sf::st_geometry() %>% sf::st_as_text()


# WORKS - although no features match the predicate. I guess polygons boundary do
# not share a single point?
emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter = paste0("TOUCHES(geom,", ref_geom,")"),
                       reduce_layers = TRUE ) 
#> Simple feature collection with 0 features and 30 fields
#> Bounding box:  xmin: NA ymin: NA xmax: NA ymax: NA
#> CRS:           +init=epsg:3034
#>  [1] gml_id              id                  objectid           
#>  [4] code                country             data_holder        
#>  [7] contact             scale               original_scale     
#> [10] original_grain_size references          comments           
#> [13] reclassification    method              sample_number      
#> [16] original_substrate  relation            folk_16cl          
#> [19] folk_16cl_txt       folk_7cl            folk_7cl_txt       
#> [22] folk_5cl            folk_5cl_txt        surface_feature    
#> [25] conf_rs             conf_s              conf_d             
#> [28] conf_tot            shape_length        shape_area         
#> [31] geom               
#> <0 rows> (or 0-length row.names)

Created on 2021-11-26 by the reprex package (v2.0.1)

So it's really not clear from the ECQL literal docs docs what types of geometries should work for different predicates. The docs relating to a geometry expression state: All standard geometry types are supported: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION.
So I'm finding it hard to understand why TOUCHES doesn't work with a GEOMETRYCOLLECTION (when it does for DWITHIN yet POLYGON works for TOUCHES

It's taken a lot of time digging and I'm still left in a lot of confusion as to how to implement spatial filtering in particular and digging through docs on these topics online felt like a massive rabbit hole.

Given how much effort it took and how much confusion it generated in me, it might be safe to assume that users will have similar issues. I feel it would be good for firstly myself to understand better and inverst in more detailed documentation so that are users can successfully make use of filtering.

So my questions are:

  • Do we know someone that has a solid overview of these topics that could at least point to the correct documentation or even better, explain a few thing?
  • Perhaps we should better understand the stack behind the service which I imagine also affects the filtering capabilities available?

For now, the only example I've got to work correctly is the BBOX predicate so it is the only one I've included as an example in the filtering vignette so far (#29 ).

I've also been going back to basics and trying to collate useful information to help me understand what's going on here: https://annakrystalli.me/spatial-notes/ (in this repo: https://github.com/annakrystalli/spatial-notes)

But any ideas on how we can get a better understanding on these topics would be greatly appreciated @salvafern

@annakrystalli
Copy link
Collaborator Author

annakrystalli commented Feb 18, 2022

Test cql filtering on physics which is not using geoserver

@annakrystalli
Copy link
Collaborator Author

So the hunch was correct!!

library(magrittr)

wfs_gs <- EMODnetWFS::emodnet_init_wfs_client(service = "geology_seabed_substrate_maps")
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> Loading IANA mime types...
#> No encoding supplied: defaulting to UTF-8.
#> ✓ WFS client created succesfully
#> ℹ Service: 'https://drive.emodnet-geology.eu/geoserver/gtk/wfs'
#> ℹ Version: '2.0.0'

ref_sf <- EMODnetWFS::emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter ="id=10848", reduce_layers = TRUE) 


# create reference map
ref_map <- ref_sf %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>% # mapview doesn't seem to work with 
    # EWKT so MULTIURFACE needs casting to a geometry collection
mapview::mapview(zcol = "folk_7cl_txt", burst = TRUE)
#> Warning: multiple methods tables found for 'direction'
#> Warning: multiple methods tables found for 'gridDistance'
#> Warning: multiple methods tables found for 'crop'
#> Warning: multiple methods tables found for 'extend'

image

Transform to GEOMETRYCOLLECTION.

ref_geom_colllection <- ref_sf %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>% 
  sf::st_geometry() %>% sf::st_as_text()

Use WKT to construct DWITHIN query -

geom_colllection_res <- EMODnetWFS::emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter = paste0("DWITHIN(geom,", ref_geom_colllection, ", 0.5, kilometers)"),
                       reduce_layers = TRUE ) 


#  returns very strange results!
ref_map + geom_colllection_res %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>%
mapview::mapview(zcol = "folk_7cl_txt", burst = TRUE)

image

ref_geom_colllection
#> [1] "GEOMETRYCOLLECTION (POLYGON ((3184146 2544100, 3184141 2544099, 3184108 2544110, 3184055 2544148, 3184014 2544192, 3183974 2544250, 3183940 2544317, 3183914 2544387, 3183899 2544453, 3183890 2544510, 3183864 2544808, 3183730 2546928, 3183967 2546943, 3184058 2545528, 3184057 2545520, 3184054 2545456, 3184060 2545400, 3184057 2545336, 3184054 2545271, 3184058 2545205, 3184058 2545118, 3184090 2545026, 3184103 2544826, 3184102 2544806, 3184107 2544751, 3184098 2544557, 3184103 2544360, 3184103 2544317, 3184139 2544137, 3184146 2544100)))"

Take the first point of geom_colllection_res. Keep coordinates as returned by original request.

wkt <- wellknown::geojson2wkt(list(Point = c(3184146, 2544100)))

# SAME RESULT
EMODnetWFS::emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter = paste0("DWITHIN(geom,", wkt, ", 0.5, kilometers)"),
                       reduce_layers = TRUE )  %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>%
mapview::mapview(zcol = "folk_7cl_txt", burst = TRUE)

image

swap the coordinates

wkt <- wellknown::geojson2wkt(list(Point = c(2544100, 3184146)))

# WORKS CORRECTLY!! Although the distance now feels off
EMODnetWFS::emodnet_get_layers(wfs = wfs_gs, layers = "seabed_substrate_1m",
                       cql_filter = paste0("DWITHIN(geom,", wkt, ", 0.5, kilometers)"),
                       reduce_layers = TRUE )  %>% 
    sf::st_cast(to = "GEOMETRYCOLLECTION") %>%
mapview::mapview(zcol = "folk_7cl_txt", burst = TRUE)

image

Created on 2022-03-01 by the reprex package (v2.0.1)

@annakrystalli
Copy link
Collaborator Author

The result of BEYOND filter

image

@annakrystalli
Copy link
Collaborator Author

Question in email

We’ve spend the last couple of days working on the EMODnetWFS package, myself in particular on figuring out why the spatial cql filtering wasn't correctly. There’s complete details in this issue: #30 but the conclusion was that at least in the first service I tested, using a WKT geom (extracted from an sf object created from a response form the server itself) in spatial filters, the coordinates seem to be interpreted as y x in the request and flipping them returns the correct result.

I don’t know if this is common practice, whether it is a setting of the databases or geoserver and how widespread it is across servers. I know you mentioned it’s a trial and error path in your previous response and I’ve written a script to try every service and figure out whether x,y or y,x coordinates return the correct results but I’m having to handle a lot of exceptions and this seems like an unnecessarily laborious way to figure this out.

Do you have any advice on how I might be able to get access to this information in a more authoritative manner? Also, if we're having such issues, it is likely that other developers trying to build on the web services might have similar problems. I was therefore wondering wether a more formal logging of the tech stack and configuration for each would make the services much easier for developers to build on therefore increasing their impact?

Any advice would be greatly appreciated.

@annakrystalli
Copy link
Collaborator Author

@LennertSchepers 's

If it can be of any help: depending on the WFS version, the axis ordering can be different. So WFS 1.0.0 vs WFS 1.1.0. I think this explains it quite well: https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html

I’ve done some detailed google searches in the past so it’s really not so easy. I remember that years ago the community was looking for a successor of WFS, the ‘OGC API – Features’, to have a more standardised version compared to WFS. I think specifications are out (https://ogcapi.ogc.org/features/) but I haven’t seen it in practice - but note that I haven’t opened a GIS system (other than R :p) in 2 years so my knowledge might be a bit outdated.

@annakrystalli
Copy link
Collaborator Author

What is the best way to find out which versions each server supports?

/wfs?request=getcapabilities

image

@LennertSchepers
Copy link
Member

What is the best way to find out which versions each server supports?

/wfs?request=getcapabilities

image

yes, correct

@annakrystalli
Copy link
Collaborator Author

Thanks @LennertSchepers ! Sorry if I caused confusion, I was just pasting responses from an email thread for our records here.

@maelle I was thinking that our users don't really need to know about different WFS versions. What we could do as the simplest solution is fix the version the package uses to communicate with the servers (I believe the current default version is available on all servers), remove the version argument and build our backend around a predictable response.

@LennertSchepers one question I had is whether service administrators are able to override the standard version behaviour and whether these configurations are accessible through the service?

@LennertSchepers
Copy link
Member

@annakrystalli could you give an example of what you mean?

@annakrystalli
Copy link
Collaborator Author

annakrystalli commented Sep 1, 2022

Hey @LennertSchepers

So, what we want to do is for an R user to be able to supply an sf object as the geom to any spatial filter. Currently, at least with WFS version 2.0.1, the coordinates in the geom are flipped compared to the server, so any spatial filters which use a WKT representation of an R sf object return incorrect results of what the user expects (hence this issue). However according to your note in the email thread, this behaviour could differ if different WFS versions are used.

My initial idea was to build a small package that could translate an sf object to a correct WKT representation for any given version and be able to correctly plug it in to a spatial cql_filter. On the other hand, a simpler solution described in my comment above, would be to fix the version the package uses to communicate with the server, making the expectation of the server more predictable and simple to deal with within the package.

Does this make sense?

@annakrystalli
Copy link
Collaborator Author

@LennertSchepers so my question above was whether server administrators could override the default axis ordering of a version through configs and if so, whether those are available as metadata through request to the server.

@LennertSchepers
Copy link
Member

I'm not sure about this - but I would assume not, as this seems to be specified in the WFS standard. From this page it seems that the axis ordering can only be doubtful for WFS 1.0.0.

Just wondering about it, do you know if the problem is situated at

  • the axis ordering of the layer hosted on the WFS, or
  • the axis ordering of the geometry that you provide to filter on (the provided wkt string)? It's mentioned here that (E)CQL provides no mechanism for specifying the projection of a geometry and always assumes that it is in the same projection as the data being queried. The default projection is mentioned in

@maelle
Copy link
Collaborator

maelle commented Sep 26, 2022

@LennertSchepers is your comment incomplete? The last sentence has no end. 😸 (thanks for all the information in any case!)

@maelle
Copy link
Collaborator

maelle commented Oct 14, 2022

I wonder how to get the supported versions for the marine litter service. The others all seem to support the same versions?

get_version <- function(service_url) {
    if (service_url == "https://www.ifremer.fr/services/wfs/emodnet_chemistry2") {
        return(NA_character_)
    }
    httr2::request(service_url) |>
        httr2::req_url_query(request = "getCapabilities") |>
        httr2::req_perform() |>
        httr2::resp_body_xml() |>
        xml2::xml_find_first("//ows:OperationsMetadata") |>
        xml2::xml_find_first("//ows:Operation[@name='GetCapabilities']") |>
        xml2::xml_find_first("//ows:Parameter[@name='AcceptVersions']") |>
        xml2::xml_find_first("ows:AllowedValues") |>
        xml2::xml_find_all("ows:Value") |>
        purrr::map_chr(xml2::xml_text)
}

services <- EMODnetWFS::emodnet_wfs()

tibble::tibble(
    service = services$service_name,
    versions = purrr::map(services$service_url, get_version)
) |>
    knitr::kable()
service versions
bathymetry 1.0.0, 1.1.0, 2.0.0
biology 1.0.0, 1.1.0, 2.0.0
biology_occurrence_data 1.0.0, 1.1.0, 2.0.0
chemistry_cdi_data_discovery_and_access_service 1.0.0, 1.1.0, 2.0.0
chemistry_cdi_distribution_observations_per_category_and_region 1.0.0, 1.1.0, 2.0.0
chemistry_contaminants 1.0.0, 1.1.0, 2.0.0
chemistry_marine_litter NA
geology_coastal_behavior 1.0.0, 1.1.0, 2.0.0
geology_events_and_probabilities 1.0.0, 1.1.0, 2.0.0
geology_marine_minerals 1.0.0, 1.1.0, 2.0.0
geology_sea_floor_bedrock 1.0.0, 1.1.0, 2.0.0
geology_seabed_substrate_maps 1.0.0, 1.1.0, 2.0.0
geology_submerged_landscapes 1.0.0, 1.1.0, 2.0.0
human_activities 1.0.0, 1.1.0, 2.0.0
physics 1.0.0, 1.1.0, 2.0.0
seabed_habitats_general_datasets_and_products 1.0.0, 1.1.0, 2.0.0
seabed_habitats_individual_habitat_map_and_model_datasets 1.0.0, 1.1.0, 2.0.0

Created on 2022-10-14 with reprex v2.0.2

@maelle
Copy link
Collaborator

maelle commented Oct 14, 2022

Related #126

@maelle
Copy link
Collaborator

maelle commented Jan 13, 2023

I can't find my notes but I remember @annakrystalli and I discussed it'd be easier to call all services with one single version as it'd mean the coordinates would be in a known order. 🤔

If that is correct then

@annakrystalli
Copy link
Collaborator Author

I think the best option would be to fix the latest version 2.0.0 (which is also currently the default) which I believe all servers can use.

@maelle
Copy link
Collaborator

maelle commented Jan 20, 2023

So instead of surfacing service_version we'd set it to 2.0.0? That's what you mean by fix, making constant, as opposed to repairing, correct? Thank you!

@salvafern
Copy link
Collaborator

I'm a bit hesitant but if it makes the development easier go ahead :) we can always reconsider later upon request.

I guess the only issue could be if someone wants to integrate EMODnetWFS with some older system that use a WFS version lower than 2.0.0.

But this type of user will probably go directly to ows4R rather than using the EMODnetWFS client.

@maelle
Copy link
Collaborator

maelle commented Feb 2, 2023

However fixing the version is probably only part of the fix? I'm still confused (:sweat_smile:) as to whether we need to flip coordinates somewhere for something.

@maelle
Copy link
Collaborator

maelle commented Feb 2, 2023

i.e. what Anna meant by "build our backend around a predictable response.".

@salvafern
Copy link
Collaborator

In principle if we have been always using 2.0.0 and the axis order defined by the EPGS definition it shouldn't raise much issues? e.g see the order of coordinates for each version: https://docs.geoserver.org/2.22.x/en/user/services/wfs/axis_order.html

WFS 1.0.0: Provides geographic coordinates in east/north and may not be trusted to respect the EPSG definition axis order.
WFS 1.1.0: Respects the axis order defined by the EPSG definition.
WFS 2.0.0: Respects the axis order defined by the EPSG definition.

@maelle
Copy link
Collaborator

maelle commented Feb 2, 2023

so #132 would be enough?

@maelle maelle assigned salvafern and unassigned annakrystalli Apr 7, 2023
@maelle
Copy link
Collaborator

maelle commented Feb 28, 2024

Closing this as reading the issue thread, it seems to me that #132 was enough. @salvafern please re-open if not.

@maelle maelle closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants