gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

skeletonize's result is different when changing the world shape #3247

Closed litingzhen closed 1 year ago

litingzhen commented 2 years ago

Describe the bug 1.8.1, with the same geometry, use skeletonize to this geometry,but the result is different when changing the world shape.

To Reproduce Steps to reproduce the behavior:

         shape_file myshp<- shape_file("xxxx"); 
     geometry shape<-envelope(myshp)+500;
         create geoshape from:myshp;
     list<geometry> skeletons <- list(skeletonize(last(geoshape )));
     write length(skeletons);

Expected behavior when I change the shape (500-->1000 ),the skeletonize result should be same.

Desktop (please complete the following information):

litingzhen commented 2 years ago

the shape_file is freespace.zip

ptaillandier commented 2 years ago

Hi,

I can't test the script because some files with the shapefile are missing (.shx, .dbf and .prj files)

Cheers,

Patrick

Le dim. 14 nov. 2021 à 20:31, litingzhen @.***> a écrit :

the shape_file is freespace.zip https://github.com/gama-platform/gama/files/7533814/freespace.zip

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gama-platform/gama/issues/3247#issuecomment-968291694, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALPWHPXWH2FU6QPR3H5ZS3UL6247ANCNFSM5H6CGI6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

litingzhen commented 2 years ago

Sorry, all in this zip. freespace_allinone.zip e

ptaillandier commented 2 years ago

Hi,

I tested with GAMA 1.8.2 and we have the same issue... but I am not sure that it is possible to fix this issue as the skeletonization depends on the triangulation: the differences are due to rounding problems in the floats (slight difference in the coordinates). There is not much we can do about it.

Note that if we define a not null value for the tolerances of triangulation and of clipping, the results are similar in all cases: skeletons <- (skeletonize(last(geoshape ),0.1,0.1));

Cheers,

Patrick

Le lun. 15 nov. 2021 à 14:15, litingzhen @.***> a écrit :

Sorry, all in this zip. freespace_allinone.zip https://github.com/gama-platform/gama/files/7536568/freespace_allinone.zip e

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gama-platform/gama/issues/3247#issuecomment-968600692, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALPWHMYKR6X3LOMQPOZ273UMCXSBANCNFSM5H6CGI6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

AlexisDrogoul commented 1 year ago

I think that there is nothing we can do automatically here. The arguments to skeletonize are largely enough to cover this error. I'm closing the issue then, but feel free to open a new one in https://github.com/gama-platform/gama2/issues