use of org.geosdi.geoplatform.gui.responce.AreaInfo in project geo-platform by geosdi.
the class AreaInfoProvider method get.
@Override
public AreaInfo get() {
AreaInfo areaInfo = new AreaInfo();
areaInfo.setBBox(new BBox());
return areaInfo;
}
use of org.geosdi.geoplatform.gui.responce.AreaInfo in project geo-platform by geosdi.
the class AreaSearchRequestFilter method processGetRecordsRequest.
/**
* @param theRequest
* @param theFilterType
* @param theFilterPredicates
* @throws IllegalParameterFault
*/
@Override
protected void processGetRecordsRequest(CatalogGetRecordsRequest theRequest, FilterType theFilterType, List<JAXBElement<?>> theFilterPredicates) throws IllegalParameterFault {
logger.debug("#####################Called {}#processGetRecordsRequest", this);
AreaInfo areaInfo = theRequest.getCatalogFinder().getAreaInfo();
if (areaInfo != null && areaInfo.isActive()) {
AreaSearchType areaSearchType = areaInfo.getAreaSearchType();
BBox bbox = areaInfo.getBBox();
logger.debug("############################ Search Type: {}.\n", areaSearchType);
logger.debug("############################ Bbox : {}.\n", bbox);
List<JAXBElement<?>> areaPredicate = this.createFilterAreaPredicate(areaSearchType, bbox);
logger.trace("\n############################ Time filter: \"{}\"\n.", areaPredicate);
theFilterPredicates.addAll(areaPredicate);
}
}
use of org.geosdi.geoplatform.gui.responce.AreaInfo in project geo-platform by geosdi.
the class AreaSearchRequestCQL method processGetRecordsRequest.
/**
* @param request
* @throws IllegalParameterFault
*/
@Override
protected void processGetRecordsRequest(@Nonnull(when = NEVER) CatalogGetRecordsRequest request) throws IllegalParameterFault {
checkArgument(request != null, "The Parameter request must not be null.");
logger.debug("##########################Called {}#processGetRecordsRequest\n", this);
AreaInfo areaInfo = request.getCatalogFinder().getAreaInfo();
if (areaInfo != null && areaInfo.isActive()) {
AreaSearchType areaSearchType = areaInfo.getAreaSearchType();
BBox bbox = areaInfo.getBBox();
logger.debug("###################### Search Type: {}\n", areaSearchType);
logger.debug("###################### BBOX : {}\n", bbox);
String areaConstraint = this.createCQLAreaPredicate(areaSearchType, bbox);
logger.trace("###################### Area CQL constraint: \"{}\"\n", areaConstraint);
super.addCQLConstraint(request, areaConstraint);
}
}
use of org.geosdi.geoplatform.gui.responce.AreaInfo in project geo-platform by geosdi.
the class CatalogGetRecordsTest method testGetRecordsOurCountAreaItaly.
@Test
public void testGetRecordsOurCountAreaItaly() throws Exception {
GPCatalogConnectorStore internalServer = newConnector().withServerUrl(new URL("http://catalog.geosdi.org:80/geonetwork/srv/eng/csw")).build();
CatalogFinderBean catalogFinder = new CatalogFinderBean();
AreaInfo areaInfo = new AreaInfo();
areaInfo.setActive(true);
BBox bBoxItaly = new BBox(6.624, 36.6492, 18.5144, 47.0946);
areaInfo.setBBox(bBoxItaly);
areaInfo.setAreaSearchType(OVERLAP);
catalogFinder.setAreaInfo(areaInfo);
CatalogGetRecordsRequest<GetRecordsResponseType> request = internalServer.createGetRecordsRequest();
request.setTypeName(RECORD_V202);
request.setOutputSchema(CSW_V202);
request.setElementSetName(ElementSetType.BRIEF.value());
request.setResultType(ResultType.HITS.value());
request.setConstraintLanguage(FILTER);
request.setConstraintLanguageVersion(V110);
request.setCatalogFinder(catalogFinder);
logger.info("###########################RESPONSE : \n{}\n", request.getResponseAsString());
}
use of org.geosdi.geoplatform.gui.responce.AreaInfo in project geo-platform by geosdi.
the class CSWCatalogRecordTest method testGetRecordsOurCountAreaItaly.
@Test
public void testGetRecordsOurCountAreaItaly() throws Exception {
int tot = cswService.getRecordsCount(catalogFinder);
// assertEquals(595, tot);
AreaInfo areaInfo = catalogFinder.getAreaInfo();
areaInfo.setActive(true);
BBox bBoxItaly = new BBox(6.624, 36.6492, 18.5144, 47.0946);
areaInfo.setBBox(bBoxItaly);
areaInfo.setAreaSearchType(AreaInfo.AreaSearchType.ENCLOSES);
int countEncloses = cswService.getRecordsCount(catalogFinder);
// assertEquals(24, countEncloses);
areaInfo.setAreaSearchType(AreaInfo.AreaSearchType.IS);
int countIs = cswService.getRecordsCount(catalogFinder);
// assertEquals(0, countIs);
areaInfo.setAreaSearchType(AreaInfo.AreaSearchType.OUTSIDE);
int countOutside = cswService.getRecordsCount(catalogFinder);
// assertEquals(39, countOutside);
areaInfo.setAreaSearchType(AreaInfo.AreaSearchType.OVERLAP);
int countOverlap = cswService.getRecordsCount(catalogFinder);
// assertEquals(543, countOverlap);
logger.info("################ TOT: {}\nENCLOSES: {}\nIS: {}\nOUTSIDE {}\nOVERLAP {}", tot, countEncloses, countIs, countOutside, countOverlap);
}
Aggregations