private PlaceInfo createPlaceInfo(final GeoServiceItem item) {
        final GeoServiceGeocodingResult result = item.getResult();
        final FeatureCollection featureCollection = result.getGeometry();
        final List<Feature> features = featureCollection.getFeatures();
        final Feature locationFeature = features.get(0);
        final Point locationPoint = (Point) locationFeature.getGeometry();
        final LngLatAlt location = locationPoint.getCoordinates();
        if (features.size() > 2) {
            final Feature viewportFeature = features.get(2);
            if (viewportFeature == null) {
                logger.info("Features size > 2 but viewport null for: "
                        + item.getPlaceName());
            } else {
                final Polygon viewportPolygon = (Polygon) viewportFeature
                        .getGeometry();
                final List<List<LngLatAlt>> viewportRings = viewportPolygon
                        .getCoordinates();
                final List<LngLatAlt> viewportOutline = viewportRings.get(0);
                final LngLatAlt southwest = viewportOutline.get(0);
                final LngLatAlt northeast = viewportOutline.get(2);
                return new PlaceInfo(item.getPlaceName(), location, southwest,
                        northeast);
            }
        }
        return new PlaceInfo(item.getPlaceName(), location.getLatitude(),
                location.getLongitude());
    }
private PlaceInfo createPlaceInfo ( final GeoServiceItem item ) { final GeoServiceGeocodingResult result = item . getResult ( ) ; final FeatureCollection featureCollection = result . getGeometry ( ) ; final List < Feature > features = featureCollection . getFeatures ( ) ; final Feature locationFeature = features . get ( 0 ) ; final Point locationPoint = ( Point ) locationFeature . getGeometry ( ) ; final LngLatAlt location = locationPoint . getCoordinates ( ) ; if ( features . size ( ) > 2 ) { final Feature viewportFeature = features . get ( 2 ) ; if ( viewportFeature == null ) { logger . info ( "Features size > 2 but viewport null for: " + item . getPlaceName ( ) ) ; } else { final Polygon viewportPolygon = ( Polygon ) viewportFeature . getGeometry ( ) ; final List < List < LngLatAlt > > viewportRings = viewportPolygon . getCoordinates ( ) ; final List < LngLatAlt > viewportOutline = viewportRings . get ( 0 ) ; final LngLatAlt southwest = viewportOutline . get ( 0 ) ; final LngLatAlt northeast = viewportOutline . get ( 2 ) ; return new PlaceInfo ( item . getPlaceName ( ) , location , southwest , northeast ) ; } } return new PlaceInfo ( item . getPlaceName ( ) , location . getLatitude ( ) , location . getLongitude ( ) ) ; }
@param item the geoservice item containing the data
@return the new place information