Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align GeographyType values with shapely.GeometryType #90

Open
wants to merge 1 commit into
base: doc-api-tweaks-fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/geography.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@ void init_geography(py::module &m) {
pygeography_types.value(
"LINESTRING", GeographyType::LineString, "Single line geography type (1).");
pygeography_types.value(
"POLYGON", GeographyType::Polygon, "Single polygon geography type (2).");
"POLYGON", GeographyType::Polygon, "Single polygon geography type (3).");
pygeography_types.value(
"MULTIPOINT", GeographyType::MultiPoint, "Multiple point geography type (3).");
"MULTIPOINT", GeographyType::MultiPoint, "Multiple point geography type (4).");
pygeography_types.value(
"MULTILINESTRING", GeographyType::MultiLineString, "Multiple line geography type (4).");
"MULTILINESTRING", GeographyType::MultiLineString, "Multiple line geography type (5).");
pygeography_types.value(
"MULTIPOLYGON", GeographyType::MultiPolygon, "Multiple polygon geography type (5).");
"MULTIPOLYGON", GeographyType::MultiPolygon, "Multiple polygon geography type (6).");
pygeography_types.value(
"GEOMETRYCOLLECTION", GeographyType::GeometryCollection, "Collection geography type (6).");
"GEOMETRYCOLLECTION", GeographyType::GeometryCollection, "Collection geography type (7).");

// Geography classes

Expand Down
2 changes: 1 addition & 1 deletion src/geography.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum class GeographyType : std::int8_t {
None = -1,
Point,
LineString,
Polygon,
Polygon = 3,
MultiPoint,
MultiLineString,
MultiPolygon,
Expand Down
10 changes: 5 additions & 5 deletions tests/test_geography.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ def test_geography_type() -> None:
assert spherely.GeographyType.NONE.value == -1
assert spherely.GeographyType.POINT.value == 0
assert spherely.GeographyType.LINESTRING.value == 1
assert spherely.GeographyType.POLYGON.value == 2
assert spherely.GeographyType.MULTIPOINT.value == 3
assert spherely.GeographyType.MULTILINESTRING.value == 4
assert spherely.GeographyType.MULTIPOLYGON.value == 5
assert spherely.GeographyType.GEOMETRYCOLLECTION.value == 6
assert spherely.GeographyType.POLYGON.value == 3
assert spherely.GeographyType.MULTIPOINT.value == 4
assert spherely.GeographyType.MULTILINESTRING.value == 5
assert spherely.GeographyType.MULTIPOLYGON.value == 6
assert spherely.GeographyType.GEOMETRYCOLLECTION.value == 7


def test_is_geography() -> None:
Expand Down