public String getPOIs ( String id , double lon , double lat , double distanceInMeters , List < Param > optionalParams ) throws Exception { DescribeService describeService = getDescribeServiceByID ( id ) ; double [ ] bbox = Calculator . boundingCoordinates ( lon , lat , distanceInMeters ) ; POIProxyEvent beforeEvent = new POIProxyEvent ( POIProxyEventEnum . BeforeBrowseLonLat , describeService , new Extent ( bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] ) , null , null , null , lon , lat , distanceInMeters , null , null , null ) ; notifyListenersBeforeRequest ( beforeEvent ) ; String geoJSON = getCacheData ( beforeEvent ) ; boolean fromCache = true ; if ( geoJSON == null ) { fromCache = false ; geoJSON = getResponseAsGeoJSON ( id , optionalParams , describeService , bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] , lon , lat , beforeEvent ) ; } POIProxyEvent afterEvent = new POIProxyEvent ( POIProxyEventEnum . AfterBrowseLonLat , describeService , new Extent ( bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] ) , null , null , null , lon , lat , distanceInMeters , null , geoJSON , null ) ; if ( ! fromCache ) { storeData ( afterEvent ) ; } notifyListenersBeforeRequest ( afterEvent ) ; return geoJSON ; }
This method is used to get the pois from a service and return a GeoJSON document with the data retrieved given a longitude latitude and a radius in meters .