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()); } }
private void handleGeometryTypes(SRID srid, String type, BaseColumn c) { //TODO: geometry arrays if (!TypeFacility.RUNTIME_NAMES.GEOMETRY.equals(c.getDatatype().getName())) { return; } if (type.startsWith(EDM_GEOMETRY)) { if (type.length() > EDM_GEOMETRY.length()) { c.setProperty(BaseColumn.SPATIAL_TYPE, type.substring(EDM_GEOMETRY.length()).toUpperCase()); } else { c.setProperty(BaseColumn.SPATIAL_TYPE, "GEOMETRY"); //$NON-NLS-1$ } } else if (type.startsWith(EDM_GEOGRAPHY)) { c.setProperty(BaseColumn.SPATIAL_SRID, "4326"); //$NON-NLS-1$ if (type.length() > EDM_GEOGRAPHY.length()) { c.setProperty(BaseColumn.SPATIAL_TYPE, type.substring(EDM_GEOGRAPHY.length()).toUpperCase()); } else { c.setProperty(BaseColumn.SPATIAL_TYPE, "GEOMETRY"); //$NON-NLS-1$ } } if (srid != null && srid.isNotDefault()) { String value = srid.toString(); if (!value.equalsIgnoreCase("VARIABLE")) { //$NON-NLS-1$ c.setProperty(BaseColumn.SPATIAL_SRID, value); } } }
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());
if (value.getSrid() != null && value.getSrid().isNotDefault()) { srid(jgen, value.getSrid());
if (value.getSrid() != null && value.getSrid().isNotDefault()) { srid(jgen, value.getSrid());
if (geoValue.getSrid() != null && geoValue.getSrid().isNotDefault() && (parentSrid == null || !parentSrid.equals(geoValue.getSrid()))) { srid(json, geoValue.getSrid());
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); }