当前位置: 首页>>代码示例>>Java>>正文


Java SearchByLocationRequest.QUERY_TOUCHES属性代码示例

本文整理汇总了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;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:30,代码来源:CriterionUtil.java

示例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;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:47,代码来源:DtoSearchConverterServiceImpl.java


注:本文中的org.geomajas.command.dto.SearchByLocationRequest.QUERY_TOUCHES属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。