@@ -60,20 +60,24 @@ st_as_sf.data.frame = function(x, ..., agr = NA_agr_, coords, wkt,
6060 do.call(c , apply(cc , 1 , fn ))
6161 } else { # points:
6262 structure(points_rcpp(cc , dim ),
63- n_empty = 0L , precision = 0 , crs = NA_crs_ ,
64- bbox = structure(
65- c(xmin = min(cc [,1 ], na.rm = TRUE ),
66- ymin = min(cc [,2 ], na.rm = TRUE ),
67- xmax = max(cc [,1 ], na.rm = TRUE ),
68- ymax = max(cc [,2 ], na.rm = TRUE )), class = " bbox" ),
69- class = c(" sfc_POINT" , " sfc" ), names = NULL )
63+ n_empty = 0L , precision = 0 , crs = NA_crs_ ,
64+ bbox = structure(
65+ c(xmin = min(cc [,1 ], na.rm = TRUE ),
66+ ymin = min(cc [,2 ], na.rm = TRUE ),
67+ xmax = max(cc [,1 ], na.rm = TRUE ),
68+ ymax = max(cc [,2 ], na.rm = TRUE )), class = " bbox" ),
69+ class = c(" sfc_POINT" , " sfc" ), names = NULL )
7070 }
7171
7272 if (remove ) {
7373 if (is.character(coords ))
7474 coords = match(coords , names(x ))
7575 x = x [- coords ]
7676 }
77+ if (grepl(" Z" , dim ))
78+ attr(x [[sf_column_name ]], " z_range" ) = compute_z_range(x [[sf_column_name ]])
79+ if (grepl(" M" , dim ))
80+ attr(x [[sf_column_name ]], " m_range" ) = compute_m_range(x [[sf_column_name ]])
7781
7882 }
7983 st_sf(x , ... , agr = agr , sf_column_name = sf_column_name )
0 commit comments