Examples of SeShape


Examples of com.esri.sde.sdk.client.SeShape

        final byte[][] strings = new byte[2][];
        strings[0] = new byte[] { 0x00, 0x48, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F };
        strings[1] = new byte[] { 0x00, 0x57, 0x00, 0x6F, 0x00, 0x72, 0x00, 0x6C, 0x00, 0x64 };

        final SeCoordinateReference coordref = layer.getCoordRef();
        final SeShape shapes[] = new SeShape[2];
        for (int i = 0; i < shapes.length; i++) {
            Geometry geom = geoms[i];
            SeShape shape;
            if (geom == null) {
                shape = null;
            } else {
                ArcSDEGeometryBuilder builder = ArcSDEGeometryBuilder.builderFor(geom.getClass());
                shape = builder.constructShape(geom, coordref);
            }
            shapes[i] = shape;
        }
        /*
         * Define the names of the columns that data is to be inserted into.
         */
        final String[] columns = new String[colDefs.length];

        // Column one will be the row_id
        for (int j = 1; j < colDefs.length; j++) {
            columns[j - 1] = colDefs[j].getName(); // INT32 column
        }
        columns[colDefs.length - 1] = "SHAPE"; // Shape column

        Command<Void> insertDataCmd = new Command<Void>() {
            @Override
            public Void execute(ISession session, SeConnection connection) throws SeException,
                    IOException {

                SeInsert insert = new SeInsert(connection);
                insert.intoTable(layer.getName(), columns);
                insert.setWriteMode(true);

                try {
                    for (int i = 0; i < shapes.length; i++) {
                        SeRow row = insert.getRowToSet();
                        row.setClob(0, new ByteArrayInputStream(strings[i]));

                        SeShape seShape = shapes[i];
                        row.setShape(tempTableColumns.length - 1, seShape);

                        insert.execute();
                    }
                } finally {
View Full Code Here

Examples of com.esri.sde.sdk.client.SeShape

                    insert = new SeInsert(connection);
                    insert.intoTable(layer.getName(), columns);
                    insert.setWriteMode(true);

                    SeRow row = insert.getRowToSet();
                    SeShape shape = new SeShape(coordref);
                    SDEPoint[] points = { new SDEPoint(i, i) };
                    shape.generatePoint(1, points);

                    row.setInteger(0, Integer.valueOf(i));
                    row.setString(1, "name" + i);
                    row.setShape(2, shape);
                    insert.execute();
View Full Code Here

Examples of com.esri.sde.sdk.client.SeShape

            seExtent = new SeExtent(seExtent.getMinX(), seExtent.getMinY() - 100,
                    seExtent.getMaxX(), seExtent.getMaxY() + 100);
        }

        try {
            SeShape extent = new SeShape(this.sdeLayer.getCoordRef());
            extent.generateRectangle(seExtent);

            Geometry layerEnv = gb.construct(extent, new GeometryFactory());
            geom = geom.intersection(layerEnv); // does the work

            // Now make an SeShape
            SeShape filterShape;

            // this is a bit hacky, but I don't yet know this code well enough
            // to do it right. Basically if the geometry collection is
            // completely
            // outside of the area of the layer then an intersection will return
            // a geometryCollection (two seperate geometries not intersecting
            // will
            // be a collection of two). Passing this into GeometryBuilder causes
            // an exception. So what I did was just look to see if it is a gc
            // and if so then just make a null seshape, as it shouldn't match
            // any features in arcsde. -ch
            if (geom.getClass() == GeometryCollection.class) {
                filterShape = new SeShape(this.sdeLayer.getCoordRef());
            } else {
                gb = ArcSDEGeometryBuilder.builderFor(geom.getClass());
                filterShape = gb.constructShape(geom, this.sdeLayer.getCoordRef());
            }
            // Add the filter to our list
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.