Package com.esri.sde.sdk.client

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


     * @throws DataSourceException
     *             if the WKT can't be parsed to an opengis CRS using the CRSFactory
     */
    private static CoordinateReferenceSystem parseCRS(SeLayer sdeLayer) throws DataSourceException {
        CoordinateReferenceSystem crs = null;
        SeCoordinateReference seCRS = sdeLayer.getCoordRef();
        String WKT = seCRS.getProjectionDescription();
        LOGGER.finer("About to parse CRS for layer " + sdeLayer.getName() + ": " + WKT);

        try {
            LOGGER.fine(sdeLayer.getName() + " has CRS envelope: " + seCRS.getXYEnvelope());
        } catch (SeException e1) {
            // intentionally blank
        }

        if ("UNKNOWN".equalsIgnoreCase(WKT)) {
View Full Code Here


        layer.setGridSizes(1100.0, 0.0, 0.0);
        layer.setDescription("Created with GeoTools");

        // Define the layer's Coordinate Reference
        CoordinateReferenceSystem crs = geometryAtt.getCoordinateReferenceSystem();
        SeCoordinateReference coordref = getGenericCoordRef();
        String WKT = null;

        if (crs == null) {
            LOGGER.warning("Creating feature type " + qualifiedName
                    + ": the geometry attribute does not supply a coordinate reference system");
        } else {
            LOGGER.info("Creating the SeCoordRef object for CRS " + crs);
            WKT = crs.toWKT();
            coordref.setCoordSysByDescription(WKT);
        }

        SeExtent validCoordRange = null;

        if ((WKT != null) && (WKT.indexOf("GEOGCS") != -1)) {
            validCoordRange = new SeExtent(-180, -90, 180, 90);
        } else {
            validCoordRange = coordref.getXYEnvelope();
        }

        layer.setExtent(validCoordRange);

        LOGGER.info("Applying CRS " + coordref.getCoordSysDescription());
        layer.setCoordRef(coordref);
        LOGGER.info("CRS applyed to the new layer.");

        // /////////////////////////
        // this param is used by ArcSDE for database initialization purposes
View Full Code Here

     * @return
     * @throws SeException
     */
    private static SeCoordinateReference getGenericCoordRef() throws SeException {
        // create a sde CRS with a huge value range and 5 digits of presission
        SeCoordinateReference seCRS = new SeCoordinateReference();
        int shift = 600000;
        SeExtent validRange = new SeExtent(-shift, -shift, shift, shift);
        seCRS.setXYByEnvelope(validRange);
        LOGGER.info("CRS: " + seCRS.getXYEnvelope());

        return seCRS;
    }
View Full Code Here

     * @throws IOException
     */
    private void updateRow(final SimpleFeature modifiedFeature) throws IOException {

        final SeLayer layer = getLayer();
        final SeCoordinateReference seCoordRef = layer == null ? null : layer.getCoordRef();

        final SeUpdate updateStream = (SeUpdate) createStream(SeUpdate.class);
        // updateStream.setWriteMode(true);

        final LinkedHashMap<Integer, String> mutableColumns = getUpdatableColumnNames();
View Full Code Here

     */
    private Number insertSeRow(final SimpleFeature newFeature) throws IOException {

        // final SeTable table = getTable();
        final SeLayer layer = getLayer();
        final SeCoordinateReference seCoordRef = layer == null ? null : layer.getCoordRef();

        // this returns only the mutable attributes
        final LinkedHashMap<Integer, String> insertColumns = getInsertableColumnNames();

        final Command<Number> insertCmd = new Command<Number>() {
View Full Code Here

                layer.setDescription("Layer Example");

                /*
                 * Define the layer's Coordinate Reference
                 */
                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

            geoms = tmp;
        } else {
            geoms = g;
        }

        final SeCoordinateReference coordref = layer.getCoordRef();
        final SeShape shapes[] = new SeShape[8];
        for (int i = 0; i < shapes.length; i++) {
            Geometry geom = geoms[i];
            SeShape shape;
            if (geom == null) {
View Full Code Here

     * large coordinates such as UTM (values greater than 500,000.00)
     * </p>
     */
    public static SeCoordinateReference getGenericCoordRef() throws SeException {

        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

                    layer.setDescription("GeoTools test table");

                    /*
                     * Define the layer's Coordinate Reference
                     */
                    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

                layer.setExtent(ext);

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

                /*
                 * Spatially enable the new table...
                 */
 
View Full Code Here

TOP

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

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.