record GeometryType()

in baremaps-core/src/main/java/org/apache/baremaps/vectortile/expression/Expressions.java [383:411]


  record GeometryType(Expression expression) implements Expression<String> {

    @Override
    public String name() {
      return "geometry-type";
    }

    @Override
    public String evaluate(DataRow row) {
      Object property = row.get("geom");
      if (property instanceof Point) {
        return "Point";
      } else if (property instanceof LineString) {
        return "LineString";
      } else if (property instanceof Polygon) {
        return "Polygon";
      } else if (property instanceof MultiPoint) {
        return "MultiPoint";
      } else if (property instanceof MultiLineString) {
        return "MultiLineString";
      } else if (property instanceof MultiPolygon) {
        return "MultiPolygon";
      } else if (property instanceof GeometryCollection) {
        return "GeometryCollection";
      } else {
        return "Unknown";
      }
    }
  }