moovida / dart_jts

An effort to port some of the Java Topology Suite to dart
Other
26 stars 19 forks source link

polygon intersection? #20

Closed Duanyinyin504 closed 10 months ago

Duanyinyin504 commented 1 year ago

Thank you for providing this library. I need to calculate the intersection length of polylines and polygons, but it shows "Not implemented yet". How can I implement it? I am looking forward to your reply.

moovida commented 1 year ago

Hi @Duanyinyin504 , that sounds strange to me. I use geometry intersections all the time. I think only GeometryCollections are not supported yet. Can you show me your usecase with an example?

Duanyinyin504 commented 12 months ago

@moovida Thanks for your reply, here is my example.‘feature.getGeometry()’ is a rectangle,the 'intersection' function cannot be used,Unable to calculate intersection. DO2BYF7KZ~9F8FE S3BW}TL

moovida commented 12 months ago

Hi @Duanyinyin504 , I just checked and confirm that intersection is not implemented yet. That is quite a pity, I thought it was. To implement intersection you will have to port the related portions from the JTS java project to this one.

Here is the code: https://github.com/locationtech/jts/

You will have to find the Geometry class and migrate the java code to here: https://github.com/moovida/dart_jts/blob/master/lib/src/com/hydrologis/dart_jts/geom/geometry.dart#L1201

Duanyinyin504 commented 12 months ago

@moovida,Yes, thank you for pointing it out. Now my project is too busy and I can't port this project for the time being. It's a pity.