Hi Emmanuel, On Tue, Feb 22, 2011 at 3:33 AM, Emmanuel Lambert <[email protected]> wrote: > Hi > > An update on my message from earlier this morning : > > since Shapely is not showing the details of the TopologicalError > message, I decided to write a small C++ program to run the difference > operation in GEOS directly. > > See new attachment attached (I include the C++ code, the Python script > and the WKT files). > > I now get this message : > > TopologyException: found non-noded intersection between LINESTRING > (1.96875 -1.225, 1.89 -1.225) and LINESTRING (1.96875 -1.225, 1.89 > -1.225) at 1.96875 -1.225 > > I have 2 questions : > > 1) How can I manipulate the two polygons so that I can run the > difference operation ?
This I do not know. I do believe that this issue should be reported in the GEOS tracker. > 2) Why are the details of the TopologicalError message not shown in > Python? Is this a point where shapely can be improved, or is there a > technical restriction? The GEOS C++ exceptions are isolated from Python by the GEOS C API, which catches them and writes them to error and notice handlers that are set when shapely.geos is imported and the GEOS initGEOS function is called. Shapely's default handlers send the error and notice messages to /dev/null. It may be possible to write different handlers that push the messages onto a stack, then we could whenever we get an error condition in (for example) shapely.topology.BinaryTopologicalOp.__call__() we could pop the corresponding error message off the stack. Yes, some room for improvement here, I think. It may only be worth it if the GEOS C++ exceptions are consistent and reliable and high quality. Cheers, -- Sean _______________________________________________ Community mailing list [email protected] http://lists.gispython.org/mailman/listinfo/community
