Skip to content

Commit deabaa3

Browse files
committed
fix #385
1 parent d277c1d commit deabaa3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

inst/actions/geometa_create_iso_19115.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,9 @@ function(action, entity, config){
438438
#bounding polygons from data (if any features & 'addfeatures' option is enabled)
439439
if(!is.null(features) && addfeatures){
440440
bp <- ISOBoundingPolygon$new()
441+
geom_field = colnames(features)[sapply(colnames(features), function(x){is(features[[x]],"sfc")})][1]
441442
for(i in 1:nrow(features)){
442-
geom <- GMLAbstractGeometry$fromSimpleFeatureGeometry(features[i,]$geometry[[1]])
443+
geom <- GMLAbstractGeometry$fromSimpleFeatureGeometry(features[i,][geom_field][[1]])
443444
geom$attrs["gml:id"] <- paste0("fid.",as.character(features[i,][featureid])[1])
444445
bp$polygon <- c(bp$polygon, geom)
445446
}

0 commit comments

Comments
 (0)