I have found this open-source project by looking for a vectorized geospatial python library. I am impressed about how the library can handle geospatial processing with full vectorization. However, I could not figure out how to create geometries with different number of points in a vectorized way. A very simple example.
I can create two polygons in one call, if the polygons have the same number of points.
pygeos.polygons(
[
[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]],
[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]]
]
)
However, if I put two polygons with different number of points, it will not work.
pygeos.polygons(
[
[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]],
[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]
]
)
I will get a type error:
TypeError: One of the arguments is of incorrect type. Please provide only Geometry objects.
Is this a design choice? Or does it have to do with the limitations of ufunc in numpy? Or maybe I have not found the correct usage of this library. In that case I apologise for not being able to find the relevant information in the documentation.
I have found this open-source project by looking for a vectorized geospatial python library. I am impressed about how the library can handle geospatial processing with full vectorization. However, I could not figure out how to create geometries with different number of points in a vectorized way. A very simple example.
I can create two polygons in one call, if the polygons have the same number of points.
However, if I put two polygons with different number of points, it will not work.
I will get a type error:
TypeError: One of the arguments is of incorrect type. Please provide only Geometry objects.Is this a design choice? Or does it have to do with the limitations of
ufuncinnumpy? Or maybe I have not found the correct usage of this library. In that case I apologise for not being able to find the relevant information in the documentation.