本文整理了Java中org.geotools.util.Range.intersect
方法的一些代码示例,展示了Range.intersect
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.intersect
方法的具体详情如下:
包路径:org.geotools.util.Range
类名称:Range
方法名:intersect
[英]Returns the intersection between this range and the provided range.
[中]返回此范围和提供的范围之间的交集。
代码示例来源:origin: geotools/geotools
public MultiRange<T> intersect(MultiRange<T> other) {
List<Range<T>> intersections = new ArrayList<>();
for (Range<T> r1 : ranges) {
for (Range<T> r2 : other.ranges) {
if (r1.intersects(r2)) {
intersections.add((Range<T>) r1.intersect(r2));
}
}
}
return new MultiRange<>(intersections);
}
代码示例来源:origin: org.geotools/gt-css
@Override
public Object visit(ScaleRange scaleRange) {
if (insideOr) {
throw new IllegalStateException(
"Cannot translate to SLD when a scale range is used inside a OR in the selector");
}
if (range == null) {
range = scaleRange.range;
} else {
range.intersect(scaleRange.range);
}
return null;
}
}
代码示例来源:origin: org.geotools/gt-css
public static Selector combineAnd(List<ScaleRange> selectors, Object ctx) {
if (selectors.size() == 1) {
return selectors.get(0);
}
Range<?> range = selectors.get(0).range;
for (ScaleRange selector : selectors) {
range = range.intersect(selector.range);
if (range.isEmpty()) {
return REJECT;
}
}
return new ScaleRange((Range<Double>) range);
}
内容来源于网络,如有侵权,请联系作者删除!