public CensusLookupResponse findByCoordinates(
CensusGeographyEnum geographyType, double longitude, double latitude) {
// WGS84 hard coded for now
Point point = GeometryUtil.getPoint(longitude, latitude, 4326);
CensusLookupResponse apiResponse = new CensusLookupResponse();
CensusLookupBaseResponse censusLookupBaseResponse = new CensusLookupBaseResponse();
apiResponse.setCensusLookupBaseResponse(censusLookupBaseResponse);
List<String> messages = apiResponse.getMessageList();
ValidationUtil.isValidCensusGeographyType(apiResponse, geographyType);
if (messages.isEmpty()) {
switch (geographyType) {
case STATE2010:
findStateByPoint(apiResponse, point);
break;
case COUNTY2010:
findCountyByPoint(apiResponse, point);
break;
case BLOCK2010:
findBlockByPoint(apiResponse, point);
break;
case ALL:
findAllByPoint(apiResponse, point);
break;
}
apiResponse.setStatus(Status.OK.getReasonPhrase());
}
return apiResponse;
}