initial commit

This commit is contained in:
Nico Melone
2023-08-24 17:49:47 -05:00
parent 23b7279c0f
commit 72d3f2c348
5422 changed files with 890638 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import pytest
import shapely
from shapely.affinity import translate
from shapely.geometry import GeometryCollection, LineString, MultiPoint, Point
@pytest.mark.parametrize(
"geom",
[
Point(1, 2),
MultiPoint([(1, 2), (3, 4)]),
LineString([(1, 2), (3, 4)]),
Point(0, 0).buffer(1.0),
GeometryCollection([Point(1, 2), LineString([(1, 2), (3, 4)])]),
],
ids=[
"Point",
"MultiPoint",
"LineString",
"Polygon",
"GeometryCollection",
],
)
def test_hash(geom):
h1 = hash(geom)
assert h1 == hash(shapely.from_wkb(geom.wkb))
assert h1 != hash(translate(geom, 1.0, 2.0))