Examples of CensusLookupResponse


Examples of org.geo.spatialsearch.census.rest.CensusLookupResponse

  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;
  }
View Full Code Here

Examples of org.geo.spatialsearch.census.rest.CensusLookupResponse

            @QueryParam(value = "longitude") double longitude,
            @DefaultValue("xml") @QueryParam(value = "format") String format,
            @QueryParam(value = "callback") String callback) {
        CensusGeographyEnum geographyType = CensusGeographyEnum
                .getGeographyTypeWithKey(geography);
        CensusLookupResponse apiResponse = new CensusLookupResponse();
        Exception exception = null;
        try {
            apiResponse = censusService.findByCoordinates(geographyType,
                    longitude, latitude);
        } catch (Exception ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.