Package com.iver.cit.gvsig.fmap.core

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


        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

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

        } 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

     * @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

            /*
             * 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

TOP

Related Classes of com.iver.cit.gvsig.fmap.core.IGeometry

Copyright © 2018 www.massapicom. 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.