@brendan-ward Thanks for the tip! I understand that pygeos won't be much faster with pypy. But I wanted to improve the other part of my python code. So I still want to try it out. If I want to use conda forge, it looks like I need to reinstall pypy and every other packages with conda forge? Or is there a way to just install packages using conda forge to my pypy environment?
I still think having a wheel built for pypy would be very appreciated :)
btw, I also opened an issue on the repo, in case other people have similar problems. Maybe we can move the discussion there pygeos/pygeos#358
Now, related to
I am really crying out loud for a pip wheel file of pygeos
You are certainly welcome to look into what it would take to build pygeos wheels for pypy (I don't think any of the maintainers has experience with this)
polygon
to another polygon
, in this case, let's say my transformation matrix is 2x2, how should I write the function
argument to pass in apply
?
np.matmul(x, transformation_matrix)
pygeos
, what's the thought behind making pygeos
not so much object oriented, not like Shapely. What's the benefit of more functional design?
shapely.ops.split(geom, splitter)
?
shapely.ops.split
does not split a Polygon using a LineString. I am not aware of any implementation of this. It is not even supported in JTS/GEOS (https://locationtech.github.io/jts/jts-faq.html#E3).
Currently JTS does not contain a Split Polygon By Line operation. Thus the only way to do this is to construct a "splitting" polygon which contains the linestring and surrounds one side of the target polygon without touching it. Then the overlay operations intersection and difference can be used to extract the two sides of the target polygon. Constructing the splitting polygon is obviously easier when the linestring is a straight line; and simplest if it is horizontal or vertical.
The same applies to Python ecosystem.
Thanks for the answer! @martinfleis But this what is said on shapely website:
shapely.ops.split(geom, splitter)Splits a geometry by another geometry and returns a collection of geometries. This function is the theoretical opposite of the union of the split geometry parts. If the splitter does not split the geometry, a collection with a single geometry equal to the input geometry is returned.
The function supports:
Splitting a (Multi)LineString by a (Multi)Point or (Multi)LineString or (Multi)Polygon boundary
Splitting a (Multi)Polygon by a LineString
It may be convenient to snap the splitter with low tolerance to the geometry. For example in the case of splitting a line by a point, the point must be exactly on the line, for the line to be correctly split. When splitting a line by a polygon, the boundary of the polygon is used for the operation. When splitting a line by another line, a ValueError is raised if the two overlap at some segment.
shapely.ops.split
does not split a Polygon using a LineString. I am not aware of any implementation of this. It is not even supported in JTS/GEOS (https://locationtech.github.io/jts/jts-faq.html#E3).Currently JTS does not contain a Split Polygon By Line operation. Thus the only way to do this is to construct a "splitting" polygon which contains the linestring and surrounds one side of the target polygon without touching it. Then the overlay operations intersection and difference can be used to extract the two sides of the target polygon. Constructing the splitting polygon is obviously easier when the linestring is a straight line; and simplest if it is horizontal or vertical.
The same applies to Python ecosystem.
Another point, according to this answer, just constructing a polygon and use difference
or intersect
should be way faster than using split
. However, in my benchmark, I see split
function is actually way faster then difference
split
in pygeos?
Apply for funding to adapt or maintain existing software used by researchers.
You must be a UK resident based at an organisation eligible for UKRI funding. We particularly encourage applications from research software engineers and early career researchers.
Your project must be within the remit of EPSRC.
You can use the funding for:
conda install --channel conda-forge geopandas
. However, the latest version I am able to get from conda forge
is version 0.6.1. Is there a way to force anaconda to install later geopandas versions (>=0.7.0) or is that not possible?