Package com.esri.sde.sdk.client

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


        String where = "INT32_COL < 5";
        String[] cols = { "SHAPE" };
        final SeFilter[] spatFilters;
        try {
            SeExtent extent = new SeExtent(179, -1, 180, 0);
            SeLayer layer = session.getLayer(typeName);
            SeShape filterShape = new SeShape(layer.getCoordRef());
            filterShape.generateRectangle(extent);

            SeShapeFilter bboxFilter = new SeShapeFilter(typeName, layer.getSpatialColumn(),
                    filterShape, SeFilter.METHOD_ENVP, true);
            spatFilters = new SeFilter[] { bboxFilter };
        } catch (SeException eek) {
            throw new ArcSdeException(eek);
        }
View Full Code Here


            @Override
            public Void execute(ISession session, SeConnection connection) throws SeException,
                    IOException {

                SeLayer layer = new SeLayer(connection);
                SeTable table = null;

                /*
                 * Create a qualified table name with current user's name and the name of the table
                 * to be created, "EXAMPLE".
                 */
                String tableName = (connection.getUser() + ".EXAMPLE");
                table = new SeTable(connection, tableName);
                layer.setTableName("EXAMPLE");

                try {
                    table.delete();
                } catch (Exception e) {
                    LOGGER.warning(e.getMessage());
                }

                /*
                 * Create the table using the DBMS default configuration keyword. Valid keywords are
                 * defined in the dbtune table.
                 */
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine("\n--> Creating a table using DBMS Default Keyword");
                }
                table.create(colDefs, testData.getConfigKeyword());
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine(" - Done.");
                }
                /*
                 * Define the attributes of the spatial column
                 */
                layer.setSpatialColumnName("SHAPE");

                /*
                 * Set the type of shapes that can be inserted into the layer. Shape type can be
                 * just one or many. NOTE: Layers that contain more than one shape type can only be
                 * accessed through the C and Java APIs and Arc Explorer Java 3.x. They cannot be
                 * seen from ArcGIS desktop applications.
                 */
                layer.setShapeTypes(SeLayer.SE_NIL_TYPE_MASK | SeLayer.SE_POINT_TYPE_MASK
                        | SeLayer.SE_LINE_TYPE_MASK | SeLayer.SE_SIMPLE_LINE_TYPE_MASK
                        | SeLayer.SE_AREA_TYPE_MASK | SeLayer.SE_MULTIPART_TYPE_MASK);
                layer.setGridSizes(1100.0, 0.0, 0.0);
                layer.setDescription("Layer Example");

                SeExtent ext = new SeExtent(0.0, 0.0, 10000.0, 10000.0);
                layer.setExtent(ext);

                /*
                 * Define the layer's Coordinate Reference
                 */
                SeCoordinateReference coordref = TestData.getGenericCoordRef();
                layer.setCoordRef(coordref);

                /*
                 * Spatially enable the new table...
                 */
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine("\n--> Adding spatial column \"SHAPE\"...");
                }
                layer.setCreationKeyword(testData.getConfigKeyword());
                layer.create(3, 4);
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine(" - Done.");
                }
                return null;
            }
View Full Code Here

        Command<Void> createCommand = new Command<Void>() {
            @SuppressWarnings("deprecation")
            @Override
            public Void execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                final SeLayer layer = new SeLayer(connection);
                /*
                 * Create a qualified table name with current user's name and the name of the table
                 * to be created, "EXAMPLE".
                 */
                final String tableName = (connection.getUser() + ".NOTENDSWITHGEOM");
                final SeTable table = new SeTable(connection, tableName);
                try {
                    layer.setTableName("NOTENDSWITHGEOM");

                    try {
                        table.delete();
                    } catch (Exception e) {
                        // intentionally blank
                    }

                    /*
                     * Create the table using the DBMS default configuration keyword. Valid keywords
                     * are defined in the dbtune table.
                     */
                    if (LOGGER.isLoggable(Level.FINE)) {
                        System.out.println("\n--> Creating a table using DBMS Default Keyword");
                    }
                    SeColumnDefinition[] tmpCols = new SeColumnDefinition[] { new SeColumnDefinition(
                            "tmp", SeColumnDefinition.TYPE_STRING, 5, 0, true) };
                    table.create(tmpCols, testData.getConfigKeyword());
                    if (LOGGER.isLoggable(Level.FINE)) {
                        System.out.println(" - Done.");
                    }
                    SeColumnDefinition[] colDefs = new SeColumnDefinition[7];

                    /*
                     * Define the columns and their attributes for the table to be created. NOTE:
                     * The valid range/values of size and scale parameters vary from one database to
                     * another.
                     */
                    boolean isNullable = true;
                    colDefs[0] = new SeColumnDefinition("INT32_COL",
                            SeColumnDefinition.TYPE_INTEGER, 10, 0, isNullable);
                    colDefs[1] = new SeColumnDefinition("INT16_COL",
                            SeColumnDefinition.TYPE_SMALLINT, 4, 0, isNullable);
                    colDefs[2] = new SeColumnDefinition("FLOAT32_COL",
                            SeColumnDefinition.TYPE_FLOAT, 5, 2, isNullable);
                    colDefs[3] = new SeColumnDefinition("FLOAT64_COL",
                            SeColumnDefinition.TYPE_DOUBLE, 15, 4, isNullable);
                    colDefs[4] = new SeColumnDefinition("STRING_COL",
                            SeColumnDefinition.TYPE_STRING, 25, 0, isNullable);
                    colDefs[5] = new SeColumnDefinition("DATE_COL", SeColumnDefinition.TYPE_DATE,
                            1, 0, isNullable);
                    colDefs[6] = new SeColumnDefinition("INT64_COL",
                            SeColumnDefinition.TYPE_INTEGER, 10, 0, isNullable);

                    table.addColumn(colDefs[0]);
                    table.addColumn(colDefs[1]);
                    table.addColumn(colDefs[2]);
                    table.addColumn(colDefs[3]);
                    table.dropColumn(tmpCols[0].getName());

                    /*
                     * Define the attributes of the spatial column
                     */
                    layer.setSpatialColumnName("SHAPE");

                    /*
                     * Set the type of shapes that can be inserted into the layer. Shape type can be
                     * just one or many. NOTE: Layers that contain more than one shape type can only
                     * be accessed through the C and Java APIs and Arc Explorer Java 3.x. They
                     * cannot be seen from ArcGIS desktop applications.
                     */
                    layer.setShapeTypes(SeLayer.SE_NIL_TYPE_MASK | SeLayer.SE_POINT_TYPE_MASK
                            | SeLayer.SE_LINE_TYPE_MASK | SeLayer.SE_SIMPLE_LINE_TYPE_MASK
                            | SeLayer.SE_AREA_TYPE_MASK | SeLayer.SE_MULTIPART_TYPE_MASK);
                    layer.setGridSizes(1100.0, 0.0, 0.0);
                    layer.setDescription("Layer Example");

                    SeExtent ext = new SeExtent(0.0, 0.0, 10000.0, 10000.0);
                    layer.setExtent(ext);

                    /*
                     * Define the layer's Coordinate Reference
                     */
                    SeCoordinateReference coordref = new SeCoordinateReference();
                    coordref.setXY(0D, 0D, 100D);
                    layer.setCoordRef(coordref);

                    /*
                     * Spatially enable the new table...
                     */
                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.fine("\n--> Adding spatial column \"SHAPE\"...");
                    }
                    layer.setCreationKeyword(testData.getConfigKeyword());

                    layer.create(3, 4);
                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.fine(" - Done.");
                    }

                    table.addColumn(colDefs[4]);
                    table.addColumn(colDefs[5]);
                    table.addColumn(colDefs[6]);
                    // } catch (SeException e) {
                    // LOGGER.throwing(this.getClass().getName(),
                    // "testCreateNonStandardSchema", e);
                    // throw e;
                } finally {
                    try {
                        table.delete();
                    } catch (Exception e) {
                        // intentionally blank
                    }

                    try {
                        layer.delete();
                    } catch (Exception e) {
                        // intentionally blank
                    }
                }
                return null;
View Full Code Here

    }

    private void testInsertGeometries(Geometry[] original, TestData testData) throws Exception {
        testData.truncateTempTable();
        ISession session = testData.getConnectionPool().getSession();
        SeLayer layer = testData.getTempLayer(session);

        Geometry[] fetched = new Geometry[original.length];
        try {
            testData.insertData(original, layer, session);
            final SeSqlConstruct sqlCons = new SeSqlConstruct(layer.getName());

            SeQuery query = session.createAndExecuteQuery(new String[] { "SHAPE" }, sqlCons);

            SdeRow row;
            SeShape shape;
View Full Code Here

             * be created, "EXAMPLE".
             */
            final String tableName = getTempTableName(session);

            final SeTable tempTable = session.createSeTable(tableName);
            final SeLayer tempTableLayer = session.issue(new Command<SeLayer>() {
                @Override
                public SeLayer execute(ISession session, SeConnection connection)
                        throws SeException, IOException {
                    SeLayer tempTableLayer = new SeLayer(connection);
                    tempTableLayer.setTableName(tableName);
                    return tempTableLayer;
                }
            });

            tempTableColumns = createBaseTable(session, tempTable, tempTableLayer, configKeyword);
View Full Code Here

    public void insertTestData() throws Exception {
        truncateTempTable();
        ISessionPool connPool = getConnectionPool();
        ISession session = connPool.getSession();
        try {
            SeLayer tempTableLayer = getTempLayer(session);
            insertData(tempTableLayer, session, tempTableColumns);
        } finally {
            session.dispose();
        }
    }
View Full Code Here

        final Command<SeLayer> createLayerCmd = new Command<SeLayer>() {

            @Override
            public SeLayer execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeLayer layer;
                try {
                    table.delete();
                } catch (SeException e) {
                    // no-op, table didn't existed
                }

                SeColumnDefinition[] colDefs = new SeColumnDefinition[2];

                colDefs[0] = new SeColumnDefinition("ID", SeColumnDefinition.TYPE_INT32, 10, 0,
                        false);
                colDefs[1] = new SeColumnDefinition("NAME", SeColumnDefinition.TYPE_STRING, 255, 0,
                        false);

                layer = new SeLayer(connection);
                layer.setTableName(MASTER);
                table.create(colDefs, td.getConfigKeyword());

                layer.setSpatialColumnName("SHAPE");
                layer.setShapeTypes(SeLayer.SE_POINT_TYPE_MASK);
                layer.setGridSizes(1100.0, 0.0, 0.0);
                layer.setDescription("Geotools sde pluing join support testing master table");
                SeCoordinateReference coordref = new SeCoordinateReference();
                coordref.setCoordSysByDescription(testCrs.toWKT());

                layer.setCreationKeyword(td.getConfigKeyword());
                layer.create(3, 4);
                return layer;
            }
        };

        SeLayer layer = session.issue(createLayerCmd);

        insertMasterData(session, layer);
        LOGGER.info("successfully created master table " + MASTER);
    }
View Full Code Here

            if (shapeColumn == null) {
                return null;
            }
            final String layerName = table.getQualifiedName();

            SeLayer layer = new SeLayer(connection, layerName, shapeColumn);

            return layer;
        }
View Full Code Here

TOP

Related Classes of com.esri.sde.sdk.client.SeLayer

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.