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


Java CoordinateSequenceFactory类代码示例

本文整理汇总了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;未经允许,请勿转载。