Skip to contents

Deliberately NOT sf::st_read() on a GeoJSON string: that goes through GDAL and then s2, which rejects a ring carrying a duplicate vertex — something a coordinate-rounded coastline produces routinely, and something a planar cell intersection does not care about at all. Reading the arrays directly also means the fixture's geometry is exactly the numbers a TypeScript twin parses, with no library in between to normalise them differently.

Usage

geojson_sfc(x)

Arguments

x

a parsed GeoJSON geometry (jsonlite::fromJSON(simplifyVector = FALSE)), of type Polygon or MultiPolygon

Value

an sfc in EPSG:4326