private void writeSrsName(final XMLStreamWriter writer, final Geospatial value) throws XMLStreamException { if (value.getSrid() != null && value.getSrid().isNotDefault()) { writer.writeAttribute(Constants.PREFIX_GML, Constants.NS_GML, Constants.ATTR_SRSNAME, Constants.SRS_URLPREFIX + value.getSrid().toString()); } }
private void writeSrsName(final XMLStreamWriter writer, final Geospatial value) throws XMLStreamException { if (value.getSrid() != null && value.getSrid().isNotDefault()) { writer.writeAttribute(Constants.PREFIX_GML, Constants.NS_GML, Constants.ATTR_SRSNAME, Constants.SRS_URLPREFIX + value.getSrid().toString()); } }
public static AbstractGeospatialType convert(Geospatial geospatial, Class<?> expectedType, String srid) { Geometry result = convertToJTS(geospatial); if (geospatial.getSrid() != null && geospatial.getSrid().isNotDefault()) { srid = geospatial.getSrid().toString(); } if (srid != null) { try { result.setSRID(Integer.valueOf(geospatial.getSrid().toString())); } catch (NumberFormatException e) { } } if (expectedType == GeographyType.class) { //assume normalization and valid srid? return GeometryUtils.getGeographyType(result); } return GeometryUtils.getGeometryType(result); }
public static AbstractGeospatialType convert(Geospatial geospatial, Class<?> expectedType, String srid) { Geometry result = convertToJTS(geospatial); if (geospatial.getSrid() != null && geospatial.getSrid().isNotDefault()) { srid = geospatial.getSrid().toString(); } if (srid != null) { try { result.setSRID(Integer.valueOf(geospatial.getSrid().toString())); } catch (NumberFormatException e) { } } if (expectedType == GeographyType.class) { //assume normalization and valid srid? return GeometryUtils.getGeographyType(result); } return GeometryUtils.getGeometryType(result); }
for (final Geospatial element : (GeospatialCollection) geoValue) { writeGeoValue(name, EdmPrimitiveTypeFactory.getInstance(element.getEdmPrimitiveTypeKind()), element, isNullable, json, geoValue.getSrid()); if (geoValue.getSrid() != null && geoValue.getSrid().isNotDefault() && (parentSrid == null || !parentSrid.equals(geoValue.getSrid()))) { srid(json, geoValue.getSrid());
throw new EdmPrimitiveTypeException("The value type " + geoValue.getClass() + " is not supported."); if (geoValue.getSrid() != null && geoValue.getSrid().isNotDefault()) { throw new SerializerException("Non-standard SRID not supported!", SerializerException.MessageKeys.WRONG_PROPERTY_VALUE, name, geoValue.toString());