Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into io-wkb
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Nov 14, 2024
2 parents 3dbcdf7 + b7aa0fa commit a423de4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/creation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ std::unique_ptr<Geography> multipoint(const std::vector<V> &pts) {

template <class V>
std::unique_ptr<Geography> linestring(const std::vector<V> &pts) {
if (pts.size() == 1) {
if (pts.size() == 0) {
// empty linestring
std::vector<std::unique_ptr<S2Polyline>> empty;
return make_geography<s2geog::PolylineGeography>(std::move(empty));
} else if (pts.size() == 1) {
throw py::value_error("linestring is not valid: it must have at least 2 vertices");
}

Expand Down

0 comments on commit a423de4

Please sign in to comment.