Skip to content

Commit

Permalink
Issue 104: Include shoreline geometry in output shapefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
gwlucastrig committed Dec 24, 2023
1 parent 44a31d8 commit 478e77c
Show file tree
Hide file tree
Showing 11 changed files with 700 additions and 521 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/org/tinfour/contour/Contour.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ public int size() {
*/
public void complete() {
if (closedLoop && n > 6) {
// ensure that there is a "closure" vertex included in the contour.
// If there existing endpoints are numerically close, they are adjusted
// slightly to ensure exact matches. Otherwise, an additional
// vertex is added to the contour.
double x0 = xy[0];
double y0 = xy[1];
double x1 = xy[n - 2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ private void organizeNestedRegions() {
double[] xy = rI.getXY();
for (int j = i + 1; j < nRegion; j++) {
ContourRegion rJ = regionList.get(j);
if (rJ.contourRegionType == ContourRegionType.Primary) {
if (rJ.contourRegionType == ContourRegionType.Perimeter) {
// regions that include perimeter contours are never
// enclosed by other regions.
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private boolean checkRegionAreas(List<ContourRegion>regions){
double adjustedSum = 0;
for(ContourRegion r: regions){
ContourRegionType rt = r.getContourRegionType();
if(rt == ContourRegionType.Primary){
if(rt == ContourRegionType.Perimeter){
aSum+=r.getArea();
}
adjustedSum+=r.getAdjustedArea();
Expand Down Expand Up @@ -140,7 +140,7 @@ private boolean checkRegionAreas(List<ContourRegion>regions){
private boolean checkContourTraversal(List<ContourRegion> regions) {
for (ContourRegion r : regions) {
ContourRegionType rt = r.getContourRegionType();
if (rt != ContourRegionType.Primary) {
if (rt != ContourRegionType.Perimeter) {
continue;
}
for(ContourRegionMember member: r.memberList){
Expand Down
Loading

0 comments on commit 478e77c

Please sign in to comment.