Examples of IGeometry


Examples of com.iver.cit.gvsig.fmap.core.IGeometry

    private void compareDataSource(SpatialDataSource sds) throws DriverException {
        for (int i = 0; i < sds.getRowCount(); i++) {
            Value v = sds.getFieldValue(i, sds.getSpatialFieldIndex());
            if (!(v instanceof NullValue)) {
                IGeometry g = (IGeometry) v;
                assertTrue(g.getBounds2D().equals(sds.getGeometryBounds(i)));
            } else {
                assertTrue(sds.getGeometryBounds(i) == null);
            }
        }
    }
View Full Code Here

Examples of com.iver.cit.gvsig.fmap.core.IGeometry

        d.start();

        int gfi = d.getSpatialFieldIndex();

        IGeometry myGeometry = (IGeometry) d.getFieldValue(0, gfi);
        PathIterator myPathI = myGeometry.getGeneralPathXIterator();
        double[] mySegment = new double[6];
        int resSegment = myPathI.currentSegment(mySegment);
        assertTrue(resSegment == PathIterator.SEG_MOVETO);
        assertTrue(mySegment[0] == 2433.98567845422);
        assertTrue(mySegment[1] == 177.104836185899);
View Full Code Here

Examples of com.iver.cit.gvsig.fmap.core.IGeometry

public abstract class AbstractGeometryValue extends AbstractValue implements IGeometry {

    @Override
    public Value equals(Value value) throws IncompatibleTypesException {
        if (value instanceof IGeometry) {
            IGeometry g = (IGeometry) value;
            double[] garray = new double[6];
            double[] tarray = new double[6];
            PathIterator gpi = g.getGeneralPathXIterator();
            PathIterator tpi = this.getGeneralPathXIterator();
            while (!gpi.isDone()) {
                if (tpi.isDone()){
                    return ValueFactory.FALSE;
                }
View Full Code Here

Examples of com.iver.cit.gvsig.fmap.core.IGeometry

        } else {
            getBounds().set((int)rowIndex, null);
            deletedRows.add(new Integer((int)rowIndex));

            if (v instanceof NullValue) return;
            IGeometry g = (IGeometry) v;

            index.remove(g.getBounds2D(), new Integer((int) rowIndex));
        }
    }
View Full Code Here

Examples of com.iver.cit.gvsig.fmap.core.IGeometry

     * @throws DriverException
     */
    public void setFieldValue(long rowIndex, Value oldGeometry, Value newGeometry) throws DriverException {

        if (!(oldGeometry instanceof NullValue)) {
            IGeometry g = (IGeometry) oldGeometry;
            if (isIndexed()) {
                index.remove(g.getBounds2D(), new Integer((int) rowIndex));
            }
        }

        if (!(newGeometry instanceof NullValue)) {
            IGeometry g = (IGeometry) newGeometry;
            recalculateExtent = true;
           
            if (isIndexed()) {
                index.add(g.getBounds2D(), new Integer((int) rowIndex));
            }
        }

        getBounds().set((int) rowIndex, null);
    }
View Full Code Here

Examples of com.iver.cit.gvsig.fmap.core.IGeometry

            /*
             * The index cannot hold null geometries
             */
            return;
        } else {
            IGeometry g = (IGeometry) v;
           
            getBounds().add(g.getBounds2D());
           
            updateFullExtent(g);
           
            if (isIndexed()) {
                index.add(g.getBounds2D(), new Integer(rowCountBeforeInsertion));
            }
        }
    }
View Full Code Here

Examples of nodebox.graphics.IGeometry

    private void paintPoints(Graphics2D g) {
        if (showPoints && IGeometry.class.isAssignableFrom(valuesClass)) {
            // TODO Create a dynamic iterator that combines all output values into one flat sequence.
            LinkedList<nodebox.graphics.Point> points = new LinkedList<nodebox.graphics.Point>();
            for (Object o : outputValues) {
                IGeometry geo = (IGeometry) o;
                points.addAll(geo.getPoints());
            }
            PointVisualizer.drawPoints(g, points);
        }
    }
View Full Code Here

Examples of nodebox.graphics.IGeometry

        g.setColor(Color.BLUE);
        int index = 0;

        if (IGeometry.class.isAssignableFrom(valuesClass)) {
            for (Object o : outputValues) {
                IGeometry geo = (IGeometry) o;
                for (nodebox.graphics.Point pt : geo.getPoints())
                    paintPointNumber(g, pt, index++);
            }
        } else if (nodebox.graphics.Point.class.isAssignableFrom(valuesClass)) {
            for (Object o : outputValues)
                paintPointNumber(g, (nodebox.graphics.Point) o, index++);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.