String industrialZoneBlockLength = r.getString(12);
String residentialZoneBlockLength = r.getString(13);
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();
StudyRegion studyRegion = new StudyRegion();
studyRegion.setId(id);
studyRegion.setName(name);
studyRegion.setDescription(description);
studyRegion.setCurrentRegion(currentRegion);
studyRegion.setMapZoomLevel(mapZoomLevel);
studyRegion.setDefaultZoneType(defaultZoneType);
studyRegion.setUtcOffset(utcOffset);
studyRegion.setMinimumSoakInterval(minimumSoakInterval);
studyRegion.setCommercialZoneBlockLength(commercialZoneBlockLength);
studyRegion.setIndustrialZoneBlockLength(industrialZoneBlockLength);
studyRegion.setResidentialZoneBlockLength(residentialZoneBlockLength);
studyRegion.setGpsTaggingTolerance(gpsTaggingTolerance);
// now convert the geometry to an ArrayList<Vertex> and
// set in the roadDetails
ArrayList<Vertex> vertices = Utils.geometryToVertexArrayList(geometry);
studyRegion.setVertices(vertices);
// convert the centroid point into a Vertex
Vertex centroid = new Vertex();
centroid.setLat(centroidJTS.getY());
centroid.setLng(centroidJTS.getX());
studyRegion.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());
studyRegion.setMapCenter(mapCenterVertex);