String gpsTaggingTolerance = r.getString(14);
// convert a linestring to a JTS geometry
WKTReader reader = new WKTReader();
Geometry geometry = reader.read(lineString);
Point centroidJTS = geometry.getCentroid();
fetched = new StudyRegion();
fetched.setId(id);
fetched.setName(name);
fetched.setDescription(description);
fetched.setCurrentRegion(currentRegion);
fetched.setMapZoomLevel(mapZoomLevel);
fetched.setDefaultZoneType(defaultZoneType);
fetched.setUtcOffset(utcOffset);
fetched.setMinimumSoakInterval(minimumSoakInterval);
fetched.setCommercialZoneBlockLength(commercialZoneBlockLength);
fetched.setIndustrialZoneBlockLength(industrialZoneBlockLength);
fetched.setResidentialZoneBlockLength(residentialZoneBlockLength);
fetched.setGpsTaggingTolerance(gpsTaggingTolerance);
// now convert the geometry to an ArrayList<Vertex> and
// set in the roadDetails
ArrayList<Vertex> vertices = Utils.geometryToVertexArrayList(geometry);
fetched.setVertices(vertices);
// convert the centroid point into a Vertex
Vertex centroid = new Vertex();
centroid.setLat(centroidJTS.getY());
centroid.setLng(centroidJTS.getX());
fetched.setCentroid(centroid);
// and get the map meta data too
Geometry mapCenterGeom = reader.read(mapCenterWKT);
Point mapCenterJTS = mapCenterGeom.getCentroid();
Vertex mapCenterVertex = new Vertex();
mapCenterVertex.setLat(mapCenterJTS.getY());
mapCenterVertex.setLng(mapCenterJTS.getX());
fetched.setMapCenter(mapCenterVertex);
}
} catch (SQLException e) {
logger.error(e.getMessage());
throw e;