Package org.geo.spatialsearch.census.model

Examples of org.geo.spatialsearch.census.model.State2010


    public CensusService censusService;

    @Test
    public void testStateById() {
        Long id = 1L;
        State2010 state = (State2010) censusService.findById(
                CensusGeographyEnum.STATE2010, id);
        assertNotNull(state);
        assertEquals(state.getGeoid(), "36");
    }
View Full Code Here


        coordinate.y = 40.7557761697;
        List<State2010> states = censusService
                .findByCoordinates(CensusGeographyEnum.STATE2010, coordinate.x,
                        coordinate.y).getCensusLookupBaseResponse().getStates();
        Assert.assertFalse(states.isEmpty());
        State2010 state2010 = states.get(0);
        assertEquals(state2010.getName().trim(), "New York");
    }
View Full Code Here

  @Transactional(readOnly = true)
  private void findStateByPoint(CensusLookupResponse apiResponse, Point point) {
    final Criteria stateCriteria = state2010DAO.createCriteria();
    stateCriteria.add(SpatialRestrictions.contains("geometry", point));
    State2010 state = state2010DAO.findByCriteria(stateCriteria);
    if (state != null) {
      state.setEnvelope(new Envelope(state.getGeometry()
          .getEnvelopeInternal()));
      apiResponse.getCensusLookupBaseResponse().getStates().add(state);
    }
    ValidationUtil.isEmptyResult(apiResponse, apiResponse
        .getCensusLookupBaseResponse().getStates(),
View Full Code Here

TOP

Related Classes of org.geo.spatialsearch.census.model.State2010

Copyright © 2018 www.massapicom. 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.