We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4153b4 commit dcee86cCopy full SHA for dcee86c
1 file changed
src/main/java/mil/nga/sf/GeometryEnvelope.java
@@ -464,14 +464,34 @@ public boolean isPoint() {
464
&& Double.compare(minY, maxY) == 0;
465
}
466
467
+ /**
468
+ * Get the envelope mid x
469
+ *
470
+ * @return mid x
471
+ * @since 2.0.7
472
+ */
473
+ public double getMidX() {
474
+ return (minX + maxX) / 2.0;
475
+ }
476
+
477
478
+ * Get the envelope mid y
479
480
+ * @return mid y
481
482
483
+ public double getMidY() {
484
+ return (minY + maxY) / 2.0;
485
486
487
/**
488
* Get the envelope centroid point
489
*
490
* @return centroid point
491
* @since 2.0.5
492
*/
493
public Point getCentroid() {
- return new Point((minX + maxX) / 2.0, (minY + maxY) / 2.0);
494
+ return new Point(getMidX(), getMidY());
495
496
497
0 commit comments