From 553c524766b3945faac16606bb672e641ca5a8b9 Mon Sep 17 00:00:00 2001 From: eblondel Date: Wed, 28 Feb 2024 22:52:23 +0100 Subject: [PATCH] consolidated patch for #125 --- R/WFSFeatureTypeElement.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/WFSFeatureTypeElement.R b/R/WFSFeatureTypeElement.R index 60b17b4..e688005 100644 --- a/R/WFSFeatureTypeElement.R +++ b/R/WFSFeatureTypeElement.R @@ -46,9 +46,10 @@ WFSFeatureTypeElement <- R6Class("WFSFeatureTypeElement", if(is.null(type)){ stop(sprintf("Unknown data type for type '%s' while parsing FeatureType description!", type)) } - - if(attr(regexpr("gml", type), "match.length") > 0){ - elementType <- unlist(strsplit(unlist(strsplit(type, paste0("gml",":")))[2], "PropertyType"))[1] + gml_xmlns = namespaces[regexpr("gml", namespaces$uri)>0,] #may include app-schema GML secondary namespace + if(any(startsWith(type, gml_xmlns$id))){ + gml_xmlns = gml_xmlns[startsWith(type, gml_xmlns$id),] + elementType <- unlist(strsplit(unlist(strsplit(type, paste0(gml_xmlns$id,":")))[2], "PropertyType"))[1] geometry <- TRUE }else{ baseType <- tolower(type)