for me, if I run this cell, it gave me both errors:
In : pygeos.union_all(arr) /home/joris/miniconda3/envs/geo/lib/python3.9/site-packages/pygeos/set_operations.py:388: RuntimeWarning: invalid value encountered in unary_union result = lib.unary_union(collections, **kwargs) Out: <pygeos.Geometry POLYGON ((-0.961 0.109, -0.622 0.661, 0.16 0.98, 0.782 0.31...>
c:\Users\aniwax\Documents\GitHub\ibrus_new_design\ibrus-env\lib\site-packages\pygeos\set_operations.py:388: RuntimeWarning: divide by zero encountered in unary_union result = lib.unary_union(collections, **kwargs) c:\Users\aniwax\Documents\GitHub\ibrus_new_design\ibrus-env\lib\site-packages\pygeos\set_operations.py:388: RuntimeWarning: invalid value encountered in unary_union result = lib.unary_union(collections, **kwargs) <pygeos.Geometry POLYGON ((-0.961 0.109, -0.622 0.661, 0.16 0.98, 0.782 0.31...>
PS C:\Users\aniwax\Downloads> pypy3 -m pip install '.\pygeos-0.10 (1).tar.gz' WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617> distutils: C:\Users\aniwax\pypy3.7\include\UNKNOWN sysconfig: C:\Users\aniwax\pypy3.7\include WARNING: Additional context: user = False home = None root = None prefix = None Processing c:\users\aniwax\downloads\pygeos-0.10 (1).tar.gz Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: numpy>=1.13 in c:\users\aniwax\pypy3.7\site-packages (from pygeos==0.10) (1.20.2) Building wheels for collected packages: pygeos Building wheel for pygeos (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\aniwax\pypy3.7\pypy3.exe' 'C:\Users\aniwax\pypy3.7\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\aniwax\AppData\Local\Temp\tmp2561_abp' cwd: C:\Users\aniwax\AppData\Local\Temp\pip-req-build-r9lnxq0h Complete output (48 lines): Could not find geos-config executable. Either append the path to geos-config to PATH or manually provide the include_dirs, library_dirs, libraries and other link args for compiling against a GEOS version >=3.5. running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\pygeos copying pygeos\constructive.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\coordinates.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\creation.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\decorators.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\enum.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\geometry.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\io.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\linear.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\measurement.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\predicates.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\set_operations.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\strtree.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\_version.py -> build\lib.win-amd64-3.7\pygeos copying pygeos\__init__.py -> build\lib.win-amd64-3.7\pygeos running egg_info writing pygeos.egg-info\PKG-INFO writing dependency_links to pygeos.egg-info\dependency_links.txt writing requirements to pygeos.egg-info\requires.txt writing top-level names to pygeos.egg-info\top_level.txt reading manifest file 'pygeos.egg-info\SOURCES.txt' adding license file 'LICENSE' writing manifest file 'pygeos.egg-info\SOURCES.txt' copying pygeos\_geometry.c -> build\lib.win-amd64-3.7\pygeos copying pygeos\_geometry.pyx -> build\lib.win-amd64-3.7\pygeos copying pygeos\_geos.c -> build\lib.win-amd64-3.7\pygeos copying pygeos\_geos.pxd -> build\lib.win-amd64-3.7\pygeos copying pygeos\_geos.pyx -> build\lib.win-amd64-3.7\pygeos copying pygeos\_pygeos_api.pxd -> build\lib.win-amd64-3.7\pygeos UPDATING build\lib.win-amd64-3.7\pygeos/_version.py set build\lib.win-amd64-3.7\pygeos/_version.py to '0.10' running build_ext building 'pygeos.lib' extension creating build\temp.win-amd64-3.7 creating build\temp.win-amd64-3.7\Release creating build\temp.win-amd64-3.7\Release\src C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\aniwax\pypy3.7\include -IC:\Users\aniwax\AppData\Local\Temp\pip-build-env-hqf0nndx\overlay\site-packages\numpy\core\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\sh
@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, in this case, let's say my transformation matrix is 2x2, how should I write the
functionargument to pass in
pygeos, what's the thought behind making
pygeosnot so much object oriented, not like Shapely. What's the benefit of more functional design?
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.