Open elocke opened 4 years ago
I don't think so, because https://shapely.readthedocs.io/en/latest/manual.html#polylabel exists already. The only reason to use the Rust version is performance, since the Shapely Polylabel is a pure Python implementation.
Wow, prompt reply! Thanks!
The only reason to use the Rust version is performance, since the Shapely Polylabel is a pure Python implementation.
This would be why I'm currently searching for a low-level implementation.
Ah, gotcha. One thing you could do (before I build a wheel, which will be post-Christmas), is use the existing Python implementation at https://github.com/urschrei/polylabel-rs/blob/master/ffi.py.
cd
into the repocargo build --release
from ffi import label_position
line, and call label_position(polygon, tolerance)
on each one.It's not the most robust solution, especially if you need to run on a server, but for locally processing your geometries it should do just fine. Let me know if you need a wheel, but it'll most likely be the weekend before I get to it.
Oh nice, I'll give it a shot at this problem I'm currently experiencing. Shouldn't be too hard to add to my Dockerfile. I would absolutely appreciate a wheel at some point in the future. Thanks again for the fast (and detailed) response!
No prob – doing it in Docker might be annoying, so ping me if you need a wheel.
Yeah, I can't have this in my production containers (security) so at some point it will be required, perhaps after the holiday. This is my first time working with Rust, and it's making want to dig in more.
I've run some tests using the ffi module directly and it is a great improvement over the Shapely methods. A wheel would definitely be the next step. Any idea of when you could do that? Thanks!
Just an update: I ended up hacking up a solution to bake a wheel locally for my container. I used your simplification python package as an example. I'll shoot ya an email to see where you want to go from here. Thanks!
@elocke You might find https://github.com/MoonVision/polylabel-pyo3 helpful. It supports exterior
only for now.
@ahirner This is great!
Hello,
Are you planning on creating a python wheel to utilize this binary? I have a use and was looking at the steps of creating one when I saw that you are making python packages for many of your rust implementations.
Thanks!