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

Java CoordinateSequenceFactory类代码示例

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

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



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

示例1: toCoordinateSequence

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
private CoordinateSequence toCoordinateSequence(OsmEntityProvider resolver)
        throws EntityNotFoundException {
    CoordinateSequenceFactory csf = factory.getCoordinateSequenceFactory();

    int len = this.getLength();
    CoordinateSequence points = csf.create(len, 2);

    int n = 0;
    for (int i = 0; i < this.segments.size(); i++) {
        WaySegment segment = this.segments.get(i);
        OsmWay way = segment.getWay();
        for (int k = 0; k < way.getNumberOfNodes(); k++) {
            if (k > 0 || i == 0) {
                OsmNode node = resolver.getNode(segment.getNodeId(k));
                points.setOrdinate(n, 0, node.getLongitude());
                points.setOrdinate(n, 1, node.getLatitude());
                n++;
            }
        }
    }

    return points;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:24,代码来源:ChainOfWays.java


示例2: reverseRing

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
/**
 * Does what it says, reverses the order of the Coordinates in the ring.
 * <p>
 * This is different then lr.reverses() in that a copy is produced using a
 * new coordinate sequence.
 * </p>
 *
 * @param lr The ring to reverse.
 * @return A new ring with the reversed Coordinates.
 */
public static final LinearRing reverseRing(LinearRing lr) {
    GeometryFactory gf = lr.getFactory();
    CoordinateSequenceFactory csf = gf.getCoordinateSequenceFactory();

    CoordinateSequence csOrig = lr.getCoordinateSequence();
    int numPoints = csOrig.size();
    int dimensions = csOrig.getDimension();
    CoordinateSequence csNew = csf.create(numPoints, dimensions);

    for (int i = 0; i < numPoints; i++) {
        for (int j = 0; j < dimensions; j++) {
            csNew.setOrdinate(numPoints - 1 - i, j, csOrig.getOrdinate(i, j));
        }
    }

    return gf.createLinearRing(csNew);
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:28,代码来源:GML321ToSurfaceConvertor.java


示例3: buildRectangle

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
public static IShape buildRectangle(final double width, final double height, final ILocation location) {
	final Coordinate[] points = new Coordinate[5];
	final double x = location == null ? 0 : location.getX();
	final double y = location == null ? 0 : location.getY();
	final double z = location == null ? 0 : location.getZ();
	points[4] = new GamaPoint(x - width / 2.0, y + height / 2.0, z);
	points[3] = new GamaPoint(x + width / 2.0, y + height / 2.0, z);
	points[2] = new GamaPoint(x + width / 2.0, y - height / 2.0, z);
	points[1] = new GamaPoint(x - width / 2.0, y - height / 2.0, z);
	points[0] = new GamaPoint(x - width / 2.0, y + height / 2.0, z);
	final CoordinateSequenceFactory fact = GamaGeometryFactory.COORDINATES_FACTORY;
	final CoordinateSequence cs = fact.create(points);
	final LinearRing geom = GeometryUtils.GEOMETRY_FACTORY.createLinearRing(cs);
	final Polygon p = GeometryUtils.GEOMETRY_FACTORY.createPolygon(geom, null);
	return new GamaShape(p);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:17,代码来源:GamaGeometryType.java


示例4: init

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
protected void init( SimpleMonetDBFeatureSource featureSource, SimpleFeatureType featureType, Hints hints ) {        
    // init base fields
    this.featureSource = featureSource;
    this.dataStore = featureSource.getDataStore();
    this.featureType = featureType;
    this.tx = featureSource.getTransaction();
    this.hints = hints;
    
    //grab a geometry factory... check for a special hint
    geometryFactory = (GeometryFactory) hints.get(Hints.JTS_GEOMETRY_FACTORY);
    if (geometryFactory == null) {
        // look for a coordinate sequence factory
        CoordinateSequenceFactory csFactory = 
            (CoordinateSequenceFactory) hints.get(Hints.JTS_COORDINATE_SEQUENCE_FACTORY);
        
        if (csFactory != null) {
            geometryFactory = new GeometryFactory(csFactory);
        }
    }
    
    if (geometryFactory == null) {
        geometryFactory = JTSFactoryFinder.getGeometryFactory(null);
    }
  
    
    builder = new SimpleFeatureBuilder(featureType);
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb-simple,代码行数:28,代码来源:SimpleMonetDBFeatureReader.java


示例5: getCSFactory

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
@Override
CoordinateSequenceFactory getCSFactory() {
  return new PackedCoordinateSequenceFactory();
}
 
开发者ID:Semantive,项目名称:jts,代码行数:5,代码来源:PackedCoordinateSequenceTest.java


示例6: getCSFactory

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
@Override
CoordinateSequenceFactory getCSFactory() {
  return CoordinateArraySequenceFactory.instance();
}
 
开发者ID:Semantive,项目名称:jts,代码行数:5,代码来源:CoordinateArraySequenceTest.java


示例7: ExtendedGeometryFactory

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
/**
 * <p>Constructor for ExtendedGeometryFactory.</p>
 *
 * @param coordinateSequenceFactory a {@link com.vividsolutions.jts.geom.CoordinateSequenceFactory} object.
 */
public ExtendedGeometryFactory(CoordinateSequenceFactory coordinateSequenceFactory) {
	super(coordinateSequenceFactory);
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:9,代码来源:ExtendedGeometryFactory.java


示例8: getCSFactory

import com.vividsolutions.jts.geom.CoordinateSequenceFactory; //导入依赖的package包/类
abstract CoordinateSequenceFactory getCSFactory(); 
开发者ID:Semantive,项目名称:jts,代码行数:2,代码来源:CoordinateSequenceTestBase.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java CompileTask类代码示例发布时间:2022-05-22
下一篇:
Java AsyncHttpClientConfig类代码示例发布时间: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