use of com.vividsolutions.jts.io.geojson.GeoJsonReader in project geoprism-registry by terraframe.
the class AbstractFhirResourceProcessor method getGeometry.
protected Geometry getGeometry(Location location, ServerGeoObjectType type) {
Extension extension = location.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/location-boundary-geojson");
if (extension != null) {
Attachment value = (Attachment) extension.getValue();
if (value.hasData()) {
Decoder decoder = Base64.getDecoder();
byte[] binary = decoder.decode(value.getDataElement().getValueAsString());
String geojson = new String(binary);
GeoJsonReader reader = new GeoJsonReader();
try {
return reader.read(geojson);
} catch (ParseException e) {
e.printStackTrace();
}
}
}
return null;
}
Aggregations