本文整理汇总了Java中com.vividsolutions.jts.geom.Lineal类的典型用法代码示例。如果您正苦于以下问题:Java Lineal类的具体用法?Java Lineal怎么用?Java Lineal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Lineal类属于com.vividsolutions.jts.geom包,在下文中一共展示了Lineal类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
/**
* Creates a new {@link PreparedGeometry} appropriate for the argument {@link Geometry}.
*
* @param geom the geometry to prepare
* @return the prepared geometry
*/
public PreparedGeometry create(Geometry geom) {
if (geom instanceof Polygonal) {
return new PreparedPolygon((Polygonal) geom);
}
if (geom instanceof Lineal) {
return new PreparedLineString((Lineal) geom);
}
if (geom instanceof Puntal) {
return new PreparedPoint((Puntal) geom);
}
/**
* Default representation.
*/
return new BasicPreparedGeometry(geom);
}
开发者ID:gegy1000,项目名称:Earth,代码行数:23,代码来源:PreparedGeometryFactory.java
示例2: findCenterPoint
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
private LatLon findCenterPoint()
{
try
{
Geometry geom = JTSConst.toGeometry(this);
if(!geom.isValid()) return null;
if(geom instanceof Polygonal)
{
return JTSConst.toLatLon(geom.getInteriorPoint());
}
else if(geom instanceof Lineal)
{
LengthIndexedLine lil = new LengthIndexedLine(geom);
return JTSConst.toLatLon(lil.extractPoint(geom.getLength() / 2.0));
}
}
catch (Exception e)
{
// unable to create proper geometry...
return null;
}
return null;
}
开发者ID:westnordost,项目名称:StreetComplete,代码行数:25,代码来源:ElementGeometry.java
示例3: LinearIterator
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
/**
* Creates an iterator starting at
* a specified component and vertex in a linear {@link Geometry}
*
* @param linearGeom the linear geometry to iterate over
* @param componentIndex the component to start at
* @param vertexIndex the vertex to start at
* @throws IllegalArgumentException if linearGeom is not lineal
*/
public LinearIterator(Geometry linearGeom, int componentIndex, int vertexIndex) {
if (!(linearGeom instanceof Lineal)) {
throw new IllegalArgumentException("Lineal geometry is required");
}
this.linearGeom = linearGeom;
this.numLines = linearGeom.getNumGeometries();
this.componentIndex = componentIndex;
this.vertexIndex = vertexIndex;
this.loadCurrentLine();
}
开发者ID:gegy1000,项目名称:Earth,代码行数:20,代码来源:LinearIterator.java
示例4: drawShape
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
@Override
public Rectangle2D drawShape(final Geometry geometry, final ShapeDrawingAttributes attributes) {
if (geometry == null) { return null; }
if (geometry instanceof GeometryCollection) {
final Rectangle2D result = new Rectangle2D.Double();
GeometryUtils.applyToInnerGeometries(geometry, (g) -> result.add(drawShape(g, attributes)));
return result;
}
final boolean isLine = geometry instanceof Lineal || geometry instanceof Puntal;
GamaColor border = isLine ? attributes.getColor() : attributes.getBorder();
if (border == null && attributes.isEmpty()) {
border = attributes.getColor();
}
if (highlight) {
attributes.setColor(GamaColor.getInt(data.getHighlightColor().getRGB()));
if (border != null)
border = attributes.getColor();
}
final Shape s = sw.toShape(geometry);
try {
final Rectangle2D r = s.getBounds2D();
currentRenderer.setColor(attributes.getColor());
if (!isLine && !attributes.isEmpty()) {
currentRenderer.fill(s);
}
if (isLine || border != null || attributes.isEmpty()) {
if (border != null) {
currentRenderer.setColor(border);
}
currentRenderer.draw(s);
}
return r;
} catch (final Exception e) {
e.printStackTrace();
return null;
}
}
开发者ID:gama-platform,项目名称:gama,代码行数:39,代码来源:AWTDisplayGraphics.java
示例5: create
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
/**
* Creates a new {@link PreparedGeometry} appropriate for the argument {@link Geometry}.
*
* @param geom the geometry to prepare
* @return the prepared geometry
*/
public PreparedGeometry create(Geometry geom) {
if (geom instanceof Polygonal)
return new PreparedPolygon((Polygonal) geom);
if (geom instanceof Lineal)
return new PreparedLineString((Lineal) geom);
if (geom instanceof Puntal)
return new PreparedPoint((Puntal) geom);
/**
* Default representation.
*/
return new BasicPreparedGeometry(geom);
}
开发者ID:Semantive,项目名称:jts,代码行数:20,代码来源:PreparedGeometryFactory.java
示例6: getRank
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
static Rank getRank(Geometry geometry) {
if (geometry instanceof Puntal) {
return Rank.POINT;
} else if (geometry instanceof Lineal) {
return Rank.LINE;
} else if (geometry instanceof Polygonal) {
return Rank.AREA;
} else {
return Rank.NOT_SPECIFIED;
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:12,代码来源:SimpleFeatureShapeFigure.java
示例7: PreparedLineString
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
public PreparedLineString(Lineal line) {
super((Geometry) line);
}
开发者ID:gegy1000,项目名称:Earth,代码行数:4,代码来源:PreparedLineString.java
示例8: isLineal
import com.vividsolutions.jts.geom.Lineal; //导入依赖的package包/类
public static boolean isLineal(Geometry geom) { return geom instanceof Lineal; }
开发者ID:dr-jts,项目名称:jeql,代码行数:2,代码来源:GeomFunction.java
注:本文中的com.vividsolutions.jts.geom.Lineal类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论