-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added GEOS_DLL for PreparedPolygon #1221
Conversation
Without this, the ``PreparedPolygon`` class is incompletely included in the shared library in C++ interfaces. I suspect because LTO is stripping out some of the functions. With this included, all the ``PreparedPolygon`` methods are exported to shared library. Only necessary on windows (I think).
Seems odd to have to do this for |
I don't use the other PreparedXXX classes, probably one would need to do the same for all of them. In my code I generate a prepared polygon via something like: which is why I need that object to be properly exported. Otherwise I get difficult to debug linking errors and I can't statically link GEOS (which would eliminate the HOURS of debugging I have been spending on this particular issue). Is there a better method for what I did? Open to recommendations. |
I think I sort of see it now. I am supposed to make an instance of this factory: https://libgeos.org/doxygen/classgeos_1_1geom_1_1prep_1_1PreparedGeometryFactory.html and then use that factory to prepare an instance? |
Ok, I see now I should have used a preparation factory. The docs could be more clear on this point... |
To future readers, how I sorted this out: https://github.com/usnistgov/teqpflsh/blob/3c3513c8782f023b6e7e798faa57af2b9697b95d/include/teqpflsh/flasher.hpp#L68 |
Yep. Good you got that figured out. Any suggestions for improving the docs? |
I would recommend:
Are there docs for preparation and operations like |
Actually the recommended way to optimize predicates now is to use Docs: https://libgeos.org/doxygen/classgeos_1_1operation_1_1relateng_1_1RelateNG.html |
Nice! Are there benchmarking results somewhere comparing with the PreparedPolygon methods for |
See https://github.com/libgeos/geos/blob/main/benchmarks/geom/TopologyPredicatePerfTest.cpp Running
gives
|
Thanks for those profiling results. I eventually figured out how to run that EXE on my machine and saw similar results. It validated my choice to use the My $0.02 if that if the performance is so much better for the |
Guess we'll have to work on improving RelateNG. There's no reason it can't be as fast as PreparedGeometry. |
Just to be clear - what test results are making you say "so much better"? That particular test case is very artificial - real-world polygons are likely to be better. Do you have data to test against? Is your use case Points in Polygons? |
For instance here:
the |
Without this, the
PreparedPolygon
class is incompletely included in the shared library in C++ interfaces. I suspect because LTO is stripping out some of the functions. With this included, all thePreparedPolygon
methods are exported to shared library. Only necessary on windows (I think).My experience was that I needed this change to call these methods when I dynamically linked GEOS.