public static Geometry build(List<CoordinateSequence> rings) throws GeometryException {
    ObjectIntMap<Coordinate> coordToId = Hppc.newObjectIntHashMap();
    List<Coordinate> idToCoord = new ArrayList<>();
    int id = 0;
    List<LongArrayList> idRings = new ArrayList<>(rings.size());
    for (CoordinateSequence coords : rings) {
      LongArrayList idRing = new LongArrayList(coords.size());
      idRings.add(idRing);
      for (Coordinate coord : coords.toCoordinateArray()) {
        if (!coordToId.containsKey(coord)) {
          coordToId.put(coord, id);
          idToCoord.add(coord);
          id++;
        }
        idRing.add(coordToId.get(coord));
      }
    }
    return build(idRings, lookupId -> idToCoord.get((int) lookupId), 0, MIN_CLOSE_RING_GAP);
  }
Builds a multipolygon from linestings containing the locations of nodes in edge segments.

@param rings linestrings that define the edges of inner/outer rings in the polygon
@return the multipolygon
@throws GeometryException if building the polygon fails
planetiler-core/src/main/java/com/onthegomap/planetiler/reader/osm/OsmMultipolygon.java