本文整理了Java中com.vividsolutions.jts.geom.Point.getFactory()
方法的一些代码示例,展示了Point.getFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.getFactory()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Point
类名称:Point
方法名:getFactory
暂无
代码示例来源:origin: com.vividsolutions/jts
/**
* Gets the boundary of this geometry.
* Zero-dimensional geometries have no boundary by definition,
* so an empty GeometryCollection is returned.
*
* @return an empty GeometryCollection
* @see Geometry#getBoundary
*/
public Geometry getBoundary() {
return getFactory().createGeometryCollection(null);
}
代码示例来源:origin: com.vividsolutions/jts
/**
* Constructs a <code>Point</code> with the given coordinate.
*
*@param coordinate the coordinate on which to base this <code>Point</code>
* , or <code>null</code> to create the empty geometry.
*@param precisionModel the specification of the grid of allowable points
* for this <code>Point</code>
*@param SRID the ID of the Spatial Reference System used by this
* <code>Point</code>
* @deprecated Use GeometryFactory instead
*/
public Point(Coordinate coordinate, PrecisionModel precisionModel, int SRID) {
super(new GeometryFactory(precisionModel, SRID));
init(getFactory().getCoordinateSequenceFactory().create(
coordinate != null ? new Coordinate[]{coordinate} : new Coordinate[]{}));
}
代码示例来源:origin: com.vividsolutions/jts
private void init(CoordinateSequence coordinates)
{
if (coordinates == null) {
coordinates = getFactory().getCoordinateSequenceFactory().create(new Coordinate[]{});
}
Assert.isTrue(coordinates.size() <= 1);
this.coordinates = coordinates;
}
代码示例来源:origin: org.geotools/gt-render
public GeometryFactory getFactory() {
return point.getFactory();
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Gets the boundary of this geometry.
* Zero-dimensional geometries have no boundary by definition,
* so an empty GeometryCollection is returned.
*
* @return an empty GeometryCollection
* @see Geometry#getBoundary
*/
public Geometry getBoundary() {
return getFactory().createGeometryCollection(null);
}
代码示例来源:origin: net.disy.legato/legato-tools
@Override
public Point getSnapPoint(double resolution, Point newCoordinate) {
try {
Thread.sleep(200);
}
catch (InterruptedException ignored) {
// Nothing to do
}
final Coordinate coordinate = new Coordinate(
Math.round(newCoordinate.getX()),
Math.round(newCoordinate.getY()));
return newCoordinate.getFactory().createPoint(coordinate);
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
protected static Geometry transformPoint(CoordinateTransform ct,
Point point) {
return point.getFactory().createPoint(transformCoordinates(ct, point.getCoordinates())[0]);
}
代码示例来源:origin: org.teiid/teiid-engine
protected static Geometry transformPoint(CoordinateTransform ct,
Point point) {
return point.getFactory().createPoint(transformCoordinates(ct, point.getCoordinates())[0]);
}
代码示例来源:origin: teiid/teiid
protected static Geometry transformPoint(CoordinateTransform ct,
Point point) {
return point.getFactory().createPoint(transformCoordinates(ct, point.getCoordinates())[0]);
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Constructs a <code>Point</code> with the given coordinate.
*
*@param coordinate the coordinate on which to base this <code>Point</code>
* , or <code>null</code> to create the empty geometry.
*@param precisionModel the specification of the grid of allowable points
* for this <code>Point</code>
*@param SRID the ID of the Spatial Reference System used by this
* <code>Point</code>
* @deprecated Use GeometryFactory instead
*/
public Point(Coordinate coordinate, PrecisionModel precisionModel, int SRID) {
super(new GeometryFactory(precisionModel, SRID));
init(getFactory().getCoordinateSequenceFactory().create(
coordinate != null ? new Coordinate[]{coordinate} : new Coordinate[]{}));
}
代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig
private Geometry createLine(Point centroid, double radian, double radius) {
Coordinate[] coordinates = new Coordinate[2];
coordinates[0] = centroid.getCoordinate();
coordinates[1] = createPoint(coordinates[0], radian, radius);
return centroid.getFactory().createLineString(coordinates);
}
}
代码示例来源:origin: com.vividsolutions/jts-core
private void init(CoordinateSequence coordinates)
{
if (coordinates == null) {
coordinates = getFactory().getCoordinateSequenceFactory().create(new Coordinate[]{});
}
Assert.isTrue(coordinates.size() <= 1);
this.coordinates = coordinates;
}
代码示例来源:origin: org.orbisgis/h2gis
private Point makePointValid(Point point) {
CoordinateSequence sequence = point.getCoordinateSequence();
GeometryFactory factory = point.getFactory();
CoordinateSequenceFactory csFactory = factory.getCoordinateSequenceFactory();
if (sequence.size() == 0) {
return point;
} else if (Double.isNaN(sequence.getOrdinate(0, 0)) || Double.isNaN(sequence.getOrdinate(0, 1))) {
return factory.createPoint(csFactory.create(0, sequence.getDimension()));
} else if (sequence.size() == 1) {
return point;
} else {
throw new RuntimeException("JTS cannot create a point from a CoordinateSequence containing several points");
}
}
代码示例来源:origin: org.orbisgis/h2gis-functions
private Point makePointValid(Point point) {
CoordinateSequence sequence = point.getCoordinateSequence();
GeometryFactory factory = point.getFactory();
CoordinateSequenceFactory csFactory = factory.getCoordinateSequenceFactory();
if (sequence.size() == 0) {
return point;
} else if (Double.isNaN(sequence.getOrdinate(0, 0)) || Double.isNaN(sequence.getOrdinate(0, 1))) {
return factory.createPoint(csFactory.create(0, sequence.getDimension()));
} else if (sequence.size() == 1) {
return point;
} else {
throw new RuntimeException("JTS cannot create a point from a CoordinateSequence containing several points");
}
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
public void setGeometry(Geometry geometry) {
Point point = (Point) geometry;
final Point2D.Double sceneCoords = new Point2D.Double(point.getX(), point.getY());
Point2D.Double modelCoords = new Point2D.Double();
Coordinate coordinate;
try {
sceneTransformProvider.getSceneToModelTransform().transform(sceneCoords, modelCoords);
coordinate = new Coordinate(modelCoords.getX(), modelCoords.getY());
} catch (TransformException e) {
coordinate = new Coordinate(Double.NaN, Double.NaN);
}
this.geometry = new Point(new CoordinateArraySequence(new Coordinate[]{coordinate}), point.getFactory());
}
代码示例来源:origin: net.disy.wps/wps-api
@ProcessMethod
@OutputParameter(
//
id = "setHeightForPoint",
//
title = "Set Height for Point",
//
description = "Output 3D-Point")
public Point setHeightForPoint(
@InputParameter(title = "input point", id = "transformPoint", description = "Description of the input point") Point input,
@InputParameter(title = "input height", id = "transformHeight", description = "Description of the input height") Double height)
throws InvalidParameterValueException {
if (height < 0) {
throw new InvalidParameterValueException("height", height.toString());
}
Coordinate coordinate = input.getCoordinate();
coordinate.setCoordinate(new Coordinate(coordinate.x, coordinate.y, height));
Point createPoint = input.getFactory().createPoint(coordinate);
return createPoint;
}
}
代码示例来源:origin: net.disy.wps/wps-api
@ProcessMethod
@OutputParameter(
//
id = "bboxPoint",
//
title = "Point to calculate BBox",
//
description = "Point to calculate BBox")
public Geometry bboxPolygon(@InputParameter(
//
id = "echo",
//
title = "input point in JS form",
//
description = "Description of the input point in JS form") Point input) {
//create a 1000x1000 bounding box around the point
Coordinate[] coordinates = new Coordinate[] {
new Coordinate(input.getX() - 500, input.getY() - 500, 0),
new Coordinate(input.getX() + 500, input.getY() + 500, 0)
};
CoordinateSequence coordinateSequence = new CoordinateArraySequence(coordinates);
LineString boxLineString = new LineString(coordinateSequence, input.getFactory());
return boxLineString.getEnvelope();
}
代码示例来源:origin: org.n52.svalbard/svalbard-xmlbeans
private void encodeMultiPointDomain(DiscreteCoverageType dct, PointValueLists pointValues)
throws EncodingException {
MultiPointDomainDocument mpdd = MultiPointDomainDocument.Factory.newInstance();
DomainSetType mpdst = mpdd.addNewMultiPointDomain();
GeometryFactory factory = pointValues.getPoints().get(0).getFactory();
MultiPoint multiPoint = factory.createMultiPoint(pointValues.getPoints().toArray(new Point[0]));
EncodingContext ec =
EncodingContext.of(XmlBeansEncodingFlags.GMLID, JavaHelper.generateID(multiPoint.toString()))
.with(XmlBeansEncodingFlags.PROPERTY_TYPE, true);
XmlObject encodedGeometry = encodeGML(multiPoint, ec);
mpdst.addNewAbstractGeometry().set(encodedGeometry);
substitute(mpdst.getAbstractGeometry(), encodedGeometry);
dct.setDomainSet(mpdst);
}
代码示例来源:origin: org.n52.shetland/shetland
for (PointValuePair pointValuePair : pointValuePairs) {
if (factory == null && pointValuePair.getPoint() != null) {
factory = pointValuePair.getPoint().getFactory();
代码示例来源:origin: org.n52.sensorweb.sos/inspire-api
for (PointValuePair pointValuePair : pointValuePairs) {
if (factory == null && pointValuePair.getPoint() != null) {
factory = pointValuePair.getPoint().getFactory();
内容来源于网络,如有侵权,请联系作者删除!