• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CoordinateSequenceFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vividsolutions.jts.geom.CoordinateSequenceFilter的典型用法代码示例。如果您正苦于以下问题:Java CoordinateSequenceFilter类的具体用法?Java CoordinateSequenceFilter怎么用?Java CoordinateSequenceFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CoordinateSequenceFilter类属于com.vividsolutions.jts.geom包,在下文中一共展示了CoordinateSequenceFilter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: mouseDragged

import com.vividsolutions.jts.geom.CoordinateSequenceFilter; //导入依赖的package包/类
public void mouseDragged(final Point initPosition, final Point imagePosition, int button,Object graphContext) {
    if (selectedGeometry == null | !this.edit | this.move | this.add | this.delete) {
        return;
    }
    if (!selectedGeometry.contains(gf.createPoint(new Coordinate(initPosition.x, initPosition.y)))) {
        selectedGeometry = null;
        return;
    }
    if (type.equals(GeometryImage.POLYGON) || type.equals(GeometryImage.LINESTRING)) {
        selectedGeometry.apply(new CoordinateSequenceFilter() {

            public void filter(CoordinateSequence seq, int i) {
                if (i == seq.size() - 1) {
                    if (seq.getCoordinate(i) == seq.getCoordinate(0)) {
                        return;
                    }
                }
                seq.getCoordinate(i).x += imagePosition.x - initPosition.x;
                seq.getCoordinate(i).y += imagePosition.y - initPosition.y;
            }

            public boolean isDone() {
                return false;
            }

            public boolean isGeometryChanged() {
                return true;
            }
        });
    }

}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:33,代码来源:EditGeometryVectorLayer.java


示例2: apply

import com.vividsolutions.jts.geom.CoordinateSequenceFilter; //导入依赖的package包/类
@Override
public void apply(final CoordinateSequenceFilter filter) {
	final CoordinateSequence points = getCoordinateSequence();
	filter.filter(points, 0);
	if (filter.isDone()) {
		return;
	}
	filter.filter(points, 1);
	if (filter.isGeometryChanged()) {
		geometryChanged();
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:13,代码来源:DynamicLineString.java


示例3: triangle

import com.vividsolutions.jts.geom.CoordinateSequenceFilter; //导入依赖的package包/类
@operator (
		value = { "set_z" },
		category = { IOperatorCategory.SPATIAL, IOperatorCategory.THREED },
		concept = {})
@doc (
		value = "Sets the z ordinate of each point of a geometry to the value provided, in order, by the right argument",
		examples = { @example ("shape <- triangle(3) set_z [5,10,14];") },
		see = {})
public static IShape set_z(final IScope scope, final IShape geom, final IContainer<?, Double> coords) {
	if (geom == null) { return null; }
	final Geometry g = geom.getInnerGeometry();
	if (g == null) { return geom; }
	if (coords == null || coords.isEmpty(scope)) { return null; }
	if (coords.length(scope) > g.getNumPoints()) { throw GamaRuntimeException
			.warning("Trying to modify a point outside the bounds of the geometry", scope); }
	final Double[] zs = coords.listValue(scope, Types.FLOAT, false).toArray(new Double[0]);
	g.apply(new CoordinateSequenceFilter() {

		@Override
		public void filter(final CoordinateSequence seq, final int i) {
			if (i <= zs.length - 1) {
				seq.getCoordinate(i).z = zs[i];
			}
		}

		@Override
		public boolean isDone() {
			return false;
		}

		@Override
		public boolean isGeometryChanged() {
			return true;
		}
	});

	return geom;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:39,代码来源:Spatial.java


示例4: gatherElevationPointCloud

import com.vividsolutions.jts.geom.CoordinateSequenceFilter; //导入依赖的package包/类
List<PointDistance> gatherElevationPointCloud(Geometry geom) {
    final List<PointDistance> results = new ArrayList<PointDistance>();
    geom.apply(new CoordinateSequenceFilter() {
        
        @Override
        public boolean isGeometryChanged() {
            return false;
        }
        
        @Override
        public boolean isDone() {
            return false;
        }
        
        @Override
        public void filter(CoordinateSequence seq, int i) {
            // we do all the collecting when called for the first ordinate
            if(i > 0) {
                return;
            }
            // collects only points with a Z
            if(hasElevations(seq)) {
                Coordinate[] coords = seq.toCoordinateArray();
                for (int j = 0; j < coords.length; j++) {
                    Coordinate c = coords[j];
                    // avoid adding the last element of a ring to avoid un-balancing the 
                    // weights (the fist/last coordinate would be counted twice)
                    if((j < coords.length - 1 || !c.equals(coords[0])) && !Double.isNaN(c.z)) {
                        results.add(new PointDistance(c));
                    }
                }
            }
        }

    });
    
    if(results.size() == 0) {
        return null;
    } else {
        return results;
    }
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:43,代码来源:ClipProcess.java


示例5: length

import com.vividsolutions.jts.geom.CoordinateSequenceFilter; //导入依赖的package包/类
@operator (
		value = { "set_z" },
		category = { IOperatorCategory.SPATIAL, IOperatorCategory.THREED },
		concept = { IConcept.GEOMETRY, IConcept.SPATIAL_COMPUTATION, IConcept.POINT, IConcept.THREED })
@doc (
		value = "Sets the z ordinate of the n-th point of a geometry to the value provided by the third argument",
		masterDoc = true,
		examples = { @example ("loop i from: 0 to: length(shape.points) - 1{"
				+ "set shape <-  set_z (shape, i, 3.0);" + "}") },
		see = {})
public static IShape set_z(final IScope scope, final IShape geom, final Integer index, final Double z) {
	if (geom == null) { return null; }
	final Geometry g = geom.getInnerGeometry();
	if (g == null) { return geom; }
	if (index < 0 || index > g.getNumPoints() - 1) { throw GamaRuntimeException
			.warning("Trying to modify a point outside the bounds of the geometry", scope); }
	g.apply(new CoordinateSequenceFilter() {

		boolean done = false;

		@Override
		public void filter(final CoordinateSequence seq, final int i) {
			if (i == index) {
				seq.getCoordinate(i).z = z;
				done = true;
			}
		}

		@Override
		public boolean isDone() {
			return done;
		}

		@Override
		public boolean isGeometryChanged() {
			return done;
		}
	});

	return geom;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:42,代码来源:Spatial.java


示例6: apply

import com.vividsolutions.jts.geom.CoordinateSequenceFilter; //导入依赖的package包/类
@Override
public void apply(CoordinateSequenceFilter filter) {
	// Do nothing. This circle is not expected to be a complete geometry.		
}
 
开发者ID:DataSystemsLab,项目名称:GeoSpark,代码行数:5,代码来源:Circle.java



注:本文中的com.vividsolutions.jts.geom.CoordinateSequenceFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LineComment类代码示例发布时间:2022-05-22
下一篇:
Java WordTag类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap