Skip to content
Back to formatted view

Raw Message

Message-ID: <CANVKczM0jEXUtihNmBbJfKK1OO6M2XJ--p8GOO+WedQqr1hNtA@mail.gmail.com>
Date: 2022-04-15T16:11:33Z
From: Barry Rowlingson
Subject: Inconsistent null geometry handling in sf and terra

The `sf` package returns the extent of a null geometry as "NA", wheras
terra's `vect` returns an object with an extent of (-180,180, -90,+90).
`sf` also prints a warning.

This came from a gis stack Q:
https://gis.stackexchange.com/questions/428925/sfst-read-and-terravect-reading-in-different-extents-from-the-same-shape/428983?noredirect=1#comment699839_428983
which has link to sample data and code.

There's a few questions remaining which might be worth discussing here
before deciding if any package needs an issue/bugfix:

1. what does the SF standard say about the extent of a Null geometric
feature?
2. what does the SF standard say about the extent of a collection of
features, if one of them is Null? The `sf` package returns the extent of
the non-null features, but there's maybe an argument for saying "if I don't
know the extent of feature 23, I don't know the extent of any data frame
with feature 23 in it" (by analogy with NA+1+2+3 => NA)
3. should warnings be printed when null geometries occur (terra::vect
doesn't do this, st_read does).


Barry

	[[alternative HTML version deleted]]