docs: public static Point get(Geometry geometry) {
          // Get polygon from geometry
          Polygon polygon;
          if (geometry instanceof LineString) {
              // Validity of LineString is checked outside of this scope
              polygon = geometry.getFactory().createPolygon(geometry.getCoordinates());
          } else if (geometry instanceof MultiPolygon) {
              // For MultiPolygon the widest Polygon is taken
              Geometry widestGeometry = geometry.getGeometryN(0);
              for (int i = 1; i < geometry.getNumGeometries(); i++) {
                  if (geometry.getGeometryN(i).getEnvelopeInternal().getWidth() >
                          widestGeometry.getEnvelopeInternal().getWidth()) {
                      widestGeometry = geometry.getGeometryN(i);
                  }
              }
              polygon = (Polygon) widestGeometry;
          } else if (geometry instanceof Polygon) {
              polygon = (Polygon) geometry;
          } else {
              LOGGER.warning("Failed to get label for geometry: " + geometry);
              return geometry.getCentroid();
          }
  
          // As original geometry is used in other places clone it before re-projecting
          polygon = (Polygon) polygon.clone();
  
          // Re-project coordinates. This is needed to get proper visual results for polygons
          // distorted my Mercator projection
          polygon.apply(new CoordinateFilter() {
              @Override
              public void filter(Coordinate c) {
                  c.x = longitudeToX(c.x);
                  c.y = latitudeToY(c.y);
              }
          });
          polygon.geometryChanged();
  
          Envelope envelope = polygon.getEnvelopeInternal();
  
          double width = envelope.getWidth();
          double height = envelope.getHeight();
          double cellSize = Math.min(width, height);
          double h = cellSize / 2;
  
          // A priority queue of cells in order of their "potential" (max distance to polygon)
          PriorityQueue<Cell> cellQueue = new PriorityQueue<>(1, new MaxComparator());
  
          // Cover polygon with initial cells
          for (double x = envelope.getMinX(); x < envelope.getMaxX(); x += cellSize) {
              for (double y = envelope.getMinY(); y < envelope.getMaxY(); y += cellSize) {
                  cellQueue.add(new Cell(x + h, y + h, h, polygon));
              }
          }
  
          // Take centroid as the first best guess
          Cell bestCell = getCentroidCell(polygon);
  
          // Special case for rectangular polygons
          Cell bboxCell = new Cell(envelope.centre().x, envelope.centre().y, 0, polygon);
          if (bboxCell.d > bestCell.d) bestCell = bboxCell;
  
          while (!cellQueue.isEmpty()) {
              // Pick the most promising cell from the queue
              Cell cell = cellQueue.remove();
  
              // Update the best cell if we found a better one
              if (cell.d > bestCell.d)
                  bestCell = cell;
  
              // Do not drill down further if there's no chance of a better solution
              if (cell.max - bestCell.d <= PRECISION) continue;
  
              // Split the cell into four cells
              h = cell.h / 2;
              cellQueue.add(new Cell(cell.x - h, cell.y - h, h, polygon));
              cellQueue.add(new Cell(cell.x + h, cell.y - h, h, polygon));
              cellQueue.add(new Cell(cell.x - h, cell.y + h, h, polygon));
              cellQueue.add(new Cell(cell.x + h, cell.y + h, h, polygon));
          }
  
          // Return the best found point projected back to geodesic coordinates
          return geometry.getFactory().createPoint(new Coordinate(toLongitude(bestCell.x), toLatitude(bestCell.y)));
      }