Skip to content

Commit

Permalink
#185 GMLEnvelope
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Feb 14, 2022
1 parent e3f0f41 commit 7f349c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/GMLEnvelope.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ GMLEnvelope <- R6Class("GMLEnvelope",
if(!is.null(srsName)) self$setAttr("srsName", srsName)
self$setAttr("srsDimension", as.character(dim(bbox)[1]))
}
},

#decode
decode = function(xml){
super$decode(xml)
#backward compatibility in case of GML < 3
children <- xmlChildren(xml)
if(length(children) == 2 && names(children)[[1]]=="pos"){
self$lowerCorner <- t(as.matrix(as.numeric(unlist(strsplit(xmlValue(children[[1]]), " ")))))
self$upperCorner <- t(as.matrix(as.numeric(unlist(strsplit(xmlValue(children[[2]]), " ")))))
}
}
)
)

0 comments on commit 7f349c8

Please sign in to comment.