本文整理汇总了Java中org.geomajas.command.dto.SearchByLocationRequest.QUERY_TOUCHES属性的典型用法代码示例。如果您正苦于以下问题:Java SearchByLocationRequest.QUERY_TOUCHES属性的具体用法?Java SearchByLocationRequest.QUERY_TOUCHES怎么用?Java SearchByLocationRequest.QUERY_TOUCHES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.geomajas.command.dto.SearchByLocationRequest
的用法示例。
在下文中一共展示了SearchByLocationRequest.QUERY_TOUCHES属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: geometryCriterionToFilters
private static Map<String, String> geometryCriterionToFilters(GeometryCriterion criterion, MapModel mapModel) {
Map<String, String> filters = new LinkedHashMap<String, String>();
org.geomajas.gwt.client.spatial.geometry.Geometry mapGeom = GeometryConverter.toGwt(criterion.getGeometry());
String wktGeom = mapGeom.toWkt();
String method;
switch (criterion.getOperator()) {
case SearchByLocationRequest.QUERY_INTERSECTS:
method = "INTERSECTS";
break;
case SearchByLocationRequest.QUERY_CONTAINS:
method = "CONTAINS";
break;
case SearchByLocationRequest.QUERY_TOUCHES:
method = "TOUCHES";
break;
case SearchByLocationRequest.QUERY_WITHIN:
method = "WITHIN";
break;
default:
return null;
}
for (String serverLayerId : criterion.getServerLayerIds()) {
VectorLayer vl = findVectorLayer(mapModel, serverLayerId);
if (vl != null) {
String geomAttName = vl.getLayerInfo().getFeatureInfo().getGeometryType().getName();
filters.put(serverLayerId, method + "(" + geomAttName + ", " + wktGeom + ")");
}
}
return filters;
}
示例2: dtoGeometryCriterionToFilters
private Map<VectorLayer, Filter> dtoGeometryCriterionToFilters(GeometryCriterion criterion, Crs mapCrs)
throws GeomajasException {
if (mapCrs == null) {
throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "mapCrs");
}
Map<VectorLayer, Filter> filters = new LinkedHashMap<VectorLayer, Filter>();
Filter f;
Geometry mapGeom = converter.toInternal(criterion.getGeometry());
for (String serverLayerId : criterion.getServerLayerIds()) {
VectorLayer vl = configurationService.getVectorLayer(serverLayerId);
if (vl == null) {
throw new GeomajasException(ExceptionCode.LAYER_NOT_FOUND, serverLayerId);
}
// Transform geometry to layer CRS:
Geometry layerGeometry = geoService.transform(mapGeom, mapCrs, vectorLayerService.getCrs(vl));
switch (criterion.getOperator()) {
case SearchByLocationRequest.QUERY_INTERSECTS:
f = filterService.createIntersectsFilter(layerGeometry, vl.getFeatureModel()
.getGeometryAttributeName());
break;
case SearchByLocationRequest.QUERY_CONTAINS:
f = filterService.createContainsFilter(layerGeometry, vl.getFeatureModel()
.getGeometryAttributeName());
break;
case SearchByLocationRequest.QUERY_TOUCHES:
f = filterService.createTouchesFilter(layerGeometry, vl.getFeatureModel()
.getGeometryAttributeName());
break;
case SearchByLocationRequest.QUERY_WITHIN:
f = filterService
.createWithinFilter(layerGeometry, vl.getFeatureModel().getGeometryAttributeName());
break;
default:
throw new GeomajasException(ExceptionCode.ATTRIBUTE_UNKNOWN, "QueryType");
}
filters.put(vl, f);
}
return filters;
}