Java 类com.vividsolutions.jts.geom.Puntal 实例源码

项目:Earth    文件:PreparedGeometryFactory.java   
/**
 * 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);
}
项目:gama    文件:AWTDisplayGraphics.java   
@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;
    }
}
项目:jts    文件:PreparedGeometryFactory.java   
/**
 * 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);
}
项目:snap-desktop    文件:SimpleFeatureShapeFigure.java   
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;
    }
}
项目:Earth    文件:PointGeometryUnion.java   
public static Geometry union(Puntal pointGeom, Geometry otherGeom) {
    PointGeometryUnion unioner = new PointGeometryUnion(pointGeom, otherGeom);
    return unioner.union();
}
项目:Earth    文件:PointGeometryUnion.java   
public PointGeometryUnion(Puntal pointGeom, Geometry otherGeom) {
    this.pointGeom = (Geometry) pointGeom;
    this.otherGeom = otherGeom;
    this.geomFact = otherGeom.getFactory();
}
项目:Earth    文件:PreparedPoint.java   
public PreparedPoint(Puntal point) {
    super((Geometry) point);
}
项目:jts    文件:PreparedPoint.java   
public PreparedPoint(Puntal point) {
    super((Geometry) point);
}
项目:jeql    文件:GeomFunction.java   
public static boolean isPuntal(Geometry geom) { return geom instanceof Puntal; }