Skip to content

Commit

Permalink
update due to PR
Browse files Browse the repository at this point in the history
  • Loading branch information
utas-raymondng committed Jun 4, 2024
1 parent d8f7081 commit 50f2603
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ public class GeometryUtils {

protected static ObjectMapper objectMapper = new ObjectMapper();

protected static boolean areCollinear(Coordinate p1, Coordinate p2, Coordinate p3) {
// Use the area of the triangle method to check collinearity
double area = p1.x * (p2.y - p3.y) +
p2.x * (p3.y - p1.y) +
p3.x * (p1.y - p2.y);
return area == 0;
}
/**
*
* @param polygons - Assume to be EPSG:4326, as GeoJson always use this encoding.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static List<List<BigDecimal>> createStacBBox(List<List<Geometry>> listOfP
for (Geometry polygon : polygons) {
// Add polygon one by one to expand the overall bounding box area, this is requirement
// of STAC to have an overall bounding box of all smaller area as the first bbox in the list.
if (polygon != null) {
if (polygon != null && polygon.getEnvelopeInternal() != null) {
overallBoundingBox.expandToInclude(polygon.getEnvelopeInternal());
hasBoundingBoxUpdate.set(true);
}
Expand All @@ -80,7 +80,7 @@ public static List<List<BigDecimal>> createStacBBox(List<List<Geometry>> listOfP
final Envelope individualEnvelope = new Envelope();

for (Geometry p : polygons) {
if (p != null) {
if (p != null && p.getEnvelopeInternal() != null) {
individualEnvelope.expandToInclude(p.getEnvelopeInternal());
}
}
Expand Down

0 comments on commit 50f2603

Please sign in to comment.