Package com.esri.sde.sdk.client

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


            actualCount = getTempTableCount(session, typeName, where, null, null);
            assertEquals(expCount, actualCount);

            // add a bounding box filter and verify both spatial and non spatial
            // constraints affects the COUNT statistics
            SeExtent extent = new SeExtent(-180, -90, -170, -80);

            SeLayer layer = session.getLayer(typeName);
            SeShape filterShape = new SeShape(layer.getCoordRef());
            filterShape.generateRectangle(extent);
View Full Code Here


            String typeName = testData.getTempTableName();
            String where = null;
            int expCount = 4;
            int actualCount;

            SeExtent extent = new SeExtent(-180, -90, -170, -80);

            SeLayer layer = session.getLayer(typeName);
            SeShape filterShape = new SeShape(layer.getCoordRef());
            filterShape.generateRectangle(extent);
View Full Code Here

        final SeQueryInfo seQueryInfo = new SeQueryInfo();
        seQueryInfo.setColumns(cols);
        seQueryInfo.setConstruct(sqlCons);

        SeExtent extent = session.issue(new Command<SeExtent>() {
            @Override
            public SeExtent execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeQuery spatialQuery = new SeQuery(connection);
                // spatialQuery.setSpatialConstraints(SeQuery.SE_OPTIMIZE,
                // false, filters);
                SeExtent extent = spatialQuery.calculateLayerExtent(seQueryInfo);
                return extent;
            }
        });

        double minX = Math.round(extent.getMinX());
        double minY = Math.round(extent.getMinY());
        double maxX = Math.round(extent.getMaxX());
        double maxY = Math.round(extent.getMaxY());
        assertEquals(0D, minX, 1E-9);
        assertEquals(0D, minY, 1E-9);
        assertEquals(0D, maxX, 1E-9);
        assertEquals(0D, maxY, 1E-9);
    }
View Full Code Here

        // String where = null;
        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);
        }
        SeSqlConstruct sqlCons = new SeSqlConstruct(typeName);
        // sqlCons.setWhere(where);

        final SeQueryInfo seQueryInfo = new SeQueryInfo();
        seQueryInfo.setColumns(cols);
        seQueryInfo.setConstruct(sqlCons);

        SeExtent extent = session.issue(new Command<SeExtent>() {

            @Override
            public SeExtent execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeQuery spatialQuery = new SeQuery(connection);
                spatialQuery.setSpatialConstraints(SeQuery.SE_SPATIAL_FIRST, false, spatFilters);

                SeExtent extent = spatialQuery.calculateLayerExtent(seQueryInfo);
                return extent;
            }
        });

        // just checking the extent were returned, which is something as I get
View Full Code Here

        // try {
        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);
        }
        SeSqlConstruct sqlCons = new SeSqlConstruct(typeName);
        sqlCons.setWhere(where);

        final SeQueryInfo seQueryInfo = new SeQueryInfo();
        seQueryInfo.setColumns(cols);
        seQueryInfo.setConstruct(sqlCons);

        SeExtent extent = session.issue(new Command<SeExtent>() {
            @Override
            public SeExtent execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeQuery spatialQuery = new SeQuery(connection);
                spatialQuery.setSpatialConstraints(SeQuery.SE_OPTIMIZE, false, spatFilters);

                SeExtent extent = spatialQuery.calculateLayerExtent(seQueryInfo);
                return extent;
            }
        });

        assertNotNull(extent);
        double minX = Math.round(extent.getMinX());
        double minY = Math.round(extent.getMinY());
        double maxX = Math.round(extent.getMaxX());
        double maxY = Math.round(extent.getMaxY());
        assertEquals(-170D, minX, 1E-9);
        assertEquals(-80D, minY, 1E-9);
        assertEquals(170D, maxX, 1E-9);
        assertEquals(80D, maxY, 1E-9);
View Full Code Here

                        | 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
                 */
 
View Full Code Here

                            | 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
                     */
 
View Full Code Here

                SeCoordinateReference coordref = getGenericCoordRef();

                // SeExtent ext = new SeExtent(-1000000.0, -1000000.0,
                // 1000000.0,
                // 1000000.0);
                SeExtent ext = coordref.getXYEnvelope();
                layer.setExtent(ext);
                layer.setCoordRef(coordref);

                layer.setCreationKeyword(configKeyword);
View Full Code Here

        SeCoordinateReference seCRS = new SeCoordinateReference();
        final String wgs84WKT = DefaultGeographicCRS.WGS84.toWKT();
        seCRS.setCoordSysByDescription(wgs84WKT);
        // seCRS.setPrecision(1000);
        seCRS.setXYByEnvelope(new SeExtent(-180, -90, 180, 90));
        return seCRS;
    }
View Full Code Here

        Geometry geom = (Geometry) geomLiteralExpr.getValue();

        // To prevent errors in ArcSDE, we first trim the user's Filter
        // geometry to the extents of our layer.
        ArcSDEGeometryBuilder gb = ArcSDEGeometryBuilder.builderFor(Polygon.class);
        SeExtent seExtent = this.sdeLayer.getExtent();

        // If a layer just has one point in it (or one very horizontal or
        // vertical line) then we may have
        // a layer extent that's a point or line. We need to correct this.
        if (seExtent.getMaxX() == seExtent.getMinX()) {
            seExtent = new SeExtent(seExtent.getMinX() - 100, seExtent.getMinY(),
                    seExtent.getMaxX() + 100, seExtent.getMaxY());
        }
        if (seExtent.getMaxY() == seExtent.getMinY()) {
            seExtent = new SeExtent(seExtent.getMinX(), seExtent.getMinY() - 100,
                    seExtent.getMaxX(), seExtent.getMaxY() + 100);
        }

        try {
            SeShape extent = new SeShape(this.sdeLayer.getCoordRef());
            extent.generateRectangle(seExtent);
View Full Code Here

TOP

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

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.