Skip to content

Transform fails on empty sf #1075

Closed
Closed
@krlmlr

Description

@krlmlr
library(sf)
#> Linking to GEOS 3.6.2, GDAL 2.2.3, PROJ 4.9.3

st_sf(x = integer(), geom = st_sfc(crs = 3857)) %>%
  sf::st_transform(4326)
#> Error in CPL_transform(x, crs$proj4string): CPL_transform: zero length geometry list

Created on 2019-06-11 by the reprex package (v0.3.0)

Related: #228. The origin of the error might be here:

aa45bda#diff-f2365be569cb22a0677b4f0c79d12a7bR246

Is there a reason why this corner case isn't supported? I'd expect an empty sf with the new CRS applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions