コード例 #1
0
  @Override
  public com.vividsolutions.jts.geom.LinearRing buildGeometry(
      GeometryFactory geometryFactory,
      LinearRing gmlGeometry,
      GMLBasePointParser firstParser,
      CoordinateBaseParser secondParser)
      throws ParserException {

    return gmlGeometry.isSetPosOrPointPropertyOrPointRep()
        ? buildLineString(geometryFactory, gmlGeometry, firstParser, secondParser)
        : buildGeometry(geometryFactory, gmlGeometry, secondParser);
  }
コード例 #2
0
  @Override
  public com.vividsolutions.jts.geom.LinearRing buildLineString(
      GeometryFactory geometryFactory,
      LinearRing gmlGeometry,
      GMLBasePointParser firstParser,
      CoordinateBaseParser secondParser)
      throws ParserException {

    List<Coordinate> coordinates = new ArrayList<Coordinate>();

    for (JAXBElement<?> element : gmlGeometry.getPosOrPointPropertyOrPointRep()) {

      coordinates.add(
          this.internalDirectPosHandler
              .buildGeometry(geometryFactory, element.getValue())
              .getCoordinate());
    }

    return geometryFactory.createLinearRing(
        coordinates.toArray(new Coordinate[coordinates.size()]));
  }