Opened 7 years ago

Closed 7 years ago

#346 closed defect (fixed)

How to check the coastline polygon is ordered correctly

Reported by: sexton Owned by: hudson
Priority: normal Milestone:
Component: Functionality and features Version:
Severity: normal Keywords:
Cc:

Description

Setting up ANUGA tsunami models, eg: a coastline polygon is defined that consists of coastline dataset stitched to the outer domain.

We need to ensure that the ordering of points is correct. The attached file shows an example of where points are out of order and the resultant polygon is not ordered propetly, and we are seeing crossovers in the polygon.

We need a check for this to ensure it's correct.

Attachments (1)

initial_conditions.csv (469.1 KB) - added by sexton 7 years ago.
Mandurah coastline + stitched to polygon

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by sexton

Mandurah coastline + stitched to polygon

comment:1 Changed 7 years ago by sexton

  • Owner changed from ole to Nariman

comment:2 Changed 7 years ago by hudson

  • Owner changed from Nariman to hudson
  • Status changed from new to assigned

NOTE: This is the same bug as #257. We need a fast algorithm to convert complex polygons to concave ones, or raise an exception on complex polygons with an algorithm such as this:

http://www.lems.brown.edu/~wq/projects/cs252.html

I've already implemeted a brute-force check that has found some pathological data in the unit tests.

comment:3 Changed 7 years ago by hudson

This is an intractable problem, in my opinion. I have looked into a couple of different "healing" algorithms, and there is no guarantee that a usable mesh will be produced each time that reflects what the user wanted. As this is is a scientific application, I don't think there is a place for rough heirstics. How do we decide what the threshold is to say that a polygon is "broken"?

I think the best solution is to output a warning for the user to fix the polygon file using their tools.

Comments?

comment:4 Changed 7 years ago by hudson

  • Resolution set to fixed
  • Status changed from assigned to closed

Rev 7690 - exception is raised on a pathological poly. An O(n log n) algorithm is used.

Also, one of the files used for the unit tests, mainland_only.csv, had a bad poly, and this has been fixed by hand.

Note: See TracTickets for help on using tickets.