private MultiPolygon multiPolygon(final XMLEventReader reader, final StartElement start, final EdmPrimitiveTypeKind type, final SRID srid) throws XMLStreamException { final List<Polygon> polygons = new ArrayList<Polygon>(); boolean foundEndProperty = false; while (reader.hasNext() && !foundEndProperty) { final XMLEvent event = reader.nextEvent(); if (event.isStartElement() && event.asStartElement().getName().equals(Constants.QNAME_POLYGON)) { polygons.add(polygon(reader, event.asStartElement(), type, null)); } if (event.isEndElement() && start.getName().equals(event.asEndElement().getName())) { foundEndProperty = true; } } return new MultiPolygon(GeoUtils.getDimension(type), srid, polygons); }
protected String toString(final MultiPolygon multiPolygon, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException { if (dimension != multiPolygon.getDimension()) { throw new EdmPrimitiveTypeException("The value '" + multiPolygon + "' is not valid."); } final StringBuilder result = toStringBuilder(multiPolygon.getSrid()). append(reference.getSimpleName()). append('('); for (final Iterator<Polygon> itor = multiPolygon.iterator(); itor.hasNext();) { result.append('('). append(polygon(itor.next(), isNullable, maxLength, precision, scale, isUnicode)). append(')'); if (itor.hasNext()) { result.append(','); } } return result.append(")'").toString(); }
for (final Iterator<Polygon> itor = ((MultiPolygon) item).iterator(); itor.hasNext();) { result.append('('). append(polygon(itor.next(), isNullable, maxLength, precision, scale, isUnicode)).
for (final Iterator<Polygon> itor = ((MultiPolygon) item).iterator(); itor.hasNext();) { result.append('('). append(polygon(itor.next(), isNullable, maxLength, precision, scale, isUnicode)).
private MultiPolygon multiPolygon(final Iterator<JsonNode> itor, final EdmPrimitiveTypeKind type, final SRID srid) { final MultiPolygon multiPolygon; if (itor.hasNext()) { final List<Polygon> polygons = new ArrayList<Polygon>(); while (itor.hasNext()) { final Iterator<JsonNode> mpItor = itor.next().elements(); polygons.add(polygon(mpItor, type, srid)); } multiPolygon = new MultiPolygon(GeoUtils.getDimension(type), srid, polygons); } else { multiPolygon = new MultiPolygon(GeoUtils.getDimension(type), srid, Collections.<Polygon> emptyList()); } return multiPolygon; }
protected String toString(final MultiPolygon multiPolygon, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException { if (dimension != multiPolygon.getDimension()) { throw new EdmPrimitiveTypeException("The value '" + multiPolygon + "' is not valid."); } final StringBuilder result = toStringBuilder(multiPolygon.getSrid()). append(reference.getSimpleName()). append('('); for (final Iterator<Polygon> itor = multiPolygon.iterator(); itor.hasNext();) { result.append('('). append(polygon(itor.next(), isNullable, maxLength, precision, scale, isUnicode)). append(')'); if (itor.hasNext()) { result.append(','); } } return result.append(")'").toString(); }
private MultiPolygon multiPolygon(final XMLEventReader reader, final StartElement start, final EdmPrimitiveTypeKind type, final SRID srid) throws XMLStreamException { final List<Polygon> polygons = new ArrayList<Polygon>(); boolean foundEndProperty = false; while (reader.hasNext() && !foundEndProperty) { final XMLEvent event = reader.nextEvent(); if (event.isStartElement() && event.asStartElement().getName().equals(Constants.QNAME_POLYGON)) { polygons.add(polygon(reader, event.asStartElement(), type, null)); } if (event.isEndElement() && start.getName().equals(event.asEndElement().getName())) { foundEndProperty = true; } } return new MultiPolygon(GeoUtils.getDimension(type), srid, polygons); }
private MultiPolygon multiPolygon(final Iterator<JsonNode> itor, final EdmPrimitiveTypeKind type, final SRID srid) { final MultiPolygon multiPolygon; if (itor.hasNext()) { final List<Polygon> polygons = new ArrayList<Polygon>(); while (itor.hasNext()) { final Iterator<JsonNode> mpItor = itor.next().elements(); polygons.add(polygon(mpItor, type, srid)); } multiPolygon = new MultiPolygon(GeoUtils.getDimension(type), srid, polygons); } else { multiPolygon = new MultiPolygon(GeoUtils.getDimension(type), srid, Collections.<Polygon> emptyList()); } return multiPolygon; }
protected MultiPolygon stringToMultiPolygon(final String value, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException { final Matcher matcher = getMatcher(PATTERN, value); final List<Polygon> polygons = new ArrayList<Polygon>(); for (String coo : matcher.group(4).contains(")),((") ? matcher.group(4).split("\\)\\),\\(\\(") : new String[] { matcher.group(4) }) { String polygon = coo; if (polygon.startsWith("((")) { polygon = polygon.substring(1); } if (polygon.endsWith("))")) { polygon = polygon.substring(0, polygon.length() - 1); } if (polygon.charAt(0) != '(') { polygon = "(" + polygon; } if (!polygon.endsWith(")")) { polygon += ")"; } polygons.add(newPolygon(null, polygon, isNullable, maxLength, precision, scale, isUnicode)); } return new MultiPolygon(dimension, SRID.valueOf(matcher.group(2)), polygons); }
protected MultiPolygon stringToMultiPolygon(final String value, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException { final Matcher matcher = getMatcher(PATTERN, value); final List<Polygon> polygons = new ArrayList<Polygon>(); for (String coo : matcher.group(4).contains(")),((") ? matcher.group(4).split("\\)\\),\\(\\(") : new String[] { matcher.group(4) }) { String polygon = coo; if (polygon.startsWith("((")) { polygon = polygon.substring(1); } if (polygon.endsWith("))")) { polygon = polygon.substring(0, polygon.length() - 1); } if (polygon.charAt(0) != '(') { polygon = "(" + polygon; } if (!polygon.endsWith(")")) { polygon += ")"; } polygons.add(newPolygon(null, polygon, isNullable, maxLength, precision, scale, isUnicode)); } return new MultiPolygon(dimension, SRID.valueOf(matcher.group(2)), polygons); }
item = new MultiPolygon(dimension, SRID.valueOf(matcher.group(2)), polygons); break;
item = new MultiPolygon(dimension, SRID.valueOf(matcher.group(2)), polygons); break;
polygons.add(readGeoPolygon(name, dimension, element)); return new MultiPolygon(dimension, null, polygons); } else if (geoDataType.equals(GeospatialCollection.class)) { List<Geospatial> elements = new ArrayList<Geospatial>();
polygons.add(readGeoPolygon(name, dimension, element, null)); return new MultiPolygon(dimension, srid, polygons); } else if (geoDataType.equals(GeospatialCollection.class)) { List<Geospatial> elements = new ArrayList<Geospatial>();
polygons.add(convertPolygon(polygon)); org.apache.olingo.commons.api.edm.geo.MultiPolygon result = new org.apache.olingo.commons.api.edm.geo.MultiPolygon(dimension, srid, polygons); return result; } else if (geometry instanceof GeometryCollection) {
polygons.add(convertPolygon(polygon)); org.apache.olingo.commons.api.edm.geo.MultiPolygon result = new org.apache.olingo.commons.api.edm.geo.MultiPolygon(dimension, srid, polygons); return result; } else if (geometry instanceof GeometryCollection) {