pygeos.get_dimensions(pygeos.Geometry("LINESTRING EMPTY"))
> 1
I am trying to filter out LINESTRING EMPTY, maybe I should use another method to check "emptiness"
mask = array([<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry MULTIPOINT (-7.23e+06 4.88e+06, -6.7e+06 4.96e+06)>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry POINT (-6.7e+06 4.96e+06)>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>,
<pygeos.Geometry LINESTRING EMPTY>], dtype=object)
pygeos.get_dimensions(mask)
> array([[1, 1, 1, 1, 1, 0, 1, 1, 1],
[1, 1, 1, 1, 1, 0, 1, 1, 1]], dtype=int32)
mask[(pygeos.get_num_coordinates(crosses_mask) == 2) & (pygeos.get_type_id(crosses_mask) == pygeos.GeometryType.LINESTRING)]
Based on pygeos.get_dimensions
Strange, I was expecting -1 here:
I am trying to filter out LINESTRING EMPTY, maybe I should use another method to check "emptiness"
Edit:
Looks like this would do it, but it is quite verbose, to filter out all empty LINESTRINGS