Package org.opengis.geometry

Examples of org.opengis.geometry.Envelope


            /* Open the file with Image */
            WorldImageReader reader = new WorldImageReader(url);
            Operations operations = new Operations(null);
            GridCoverage2D coverage = (GridCoverage2D) reader.read(null);
            Envelope env = coverage.getEnvelope();

            //coverage = GridCoverageExamples.getExample(0);

            //   List vectors = generateMappedPositions(env,15, 0.58, DefaultEngineeringCRS.CARTESIAN_2D);
            List vectors = generateMappedPositions(env, 15, 0.158,
                    env.getCoordinateReferenceSystem());

            //  System.out.println(env.getCoordinateReferenceSystem().getCoordinateystem().getClass());
            //  WarpGridBuilder gridBuilder = new TPSGridBuilder(vectors, 0.01,0.01, env, coverage.getGridGeometry().getGridToCRS().inverse());

            // System.out.println(DefaultEngineeringCRS.CARTESIAN_2D.getCoordinateystem().getClass().isAssignableFrom(DefaultCartesianCS.class));           
View Full Code Here


     *
     */
    public void testIDWWarpGridBuilder() {
        try {
              // Envelope 20*20 km 00
              Envelope env = new Envelope2D(crs, -50, -50, 400000, 200000);
             
              // Generates 15 MappedPositions of approximately 2 m differences
              List<MappedPosition> mp = generateMappedPositions(env, 6, 2, crs);

              WarpGridBuilder builder = new IDWGridBuilder(mp, 5000, 5000, env);
View Full Code Here

     */
    public void testTPSWarpGridBuilder() {
        try {
          
         
            Envelope env = new Envelope2D(crs, 0, 0, 2000, 3000 );

            // Generates 15 MappedPositions of approximately 2 m differences
            List<MappedPosition> mp = generateMappedPositions(env, 10, 1, crs);

            GeneralMatrix M = new GeneralMatrix(3, 3);
View Full Code Here

        }
    }
    public void testRSGridBuilder() {
        try {
          
            Envelope env = new Envelope2D(crs, 0, 0, 1000, 1000);

            // Generates 15 MappedPositions of approximately 2 m differences
            List<MappedPosition> mp = generateMappedPositions(env, 15, 1, crs);

            GeneralMatrix M = new GeneralMatrix(3, 3);
View Full Code Here

    GridCoverage2DReader reader = format.getReader(file);
    // exampleGridCoverageUsing start
    GridCoverage2D coverage = reader.read(null);
   
    CoordinateReferenceSystem crs = coverage.getCoordinateReferenceSystem2D();
    Envelope env = coverage.getEnvelope();
    RenderedImage image = coverage.getRenderedImage();
    // exampleGridCoverageUsing end
}
View Full Code Here

     * @see org.geotools.geometry.GeneralEnvelope#normalize
     *
     * @since 2.2
     */
    public static Envelope getEnvelope(final CoordinateReferenceSystem crs) {
        Envelope envelope = null;
        GeneralEnvelope merged = null;
        if (crs != null) {
            final Extent domainOfValidity = crs.getDomainOfValidity();
            if (domainOfValidity != null) {
                for (final GeographicExtent extent : domainOfValidity.getGeographicElements()) {
                    if (Boolean.FALSE.equals(extent.getInclusion())) {
                        continue;
                    }
                    if (extent instanceof BoundingPolygon) {
                        for (final Geometry geometry : ((BoundingPolygon) extent).getPolygons()) {
                            final Envelope candidate = geometry.getEnvelope();
                            if (candidate != null) {
                                final CoordinateReferenceSystem sourceCRS =
                                        candidate.getCoordinateReferenceSystem();
                                if (sourceCRS == null || equalsIgnoreMetadata(sourceCRS, crs)) {
                                    if (envelope == null) {
                                        envelope = candidate;
                                    } else {
                                        if (merged == null) {
View Full Code Here

        final StringWriter out = new StringWriter();
        out.write(Classes.getShortClassName(this));
        out.write("[\"");
        out.write(String.valueOf(getName()));
        out.write('"');
        final Envelope envelope = getEnvelope();
        if (envelope != null) {
            out.write(", ");
            out.write(envelope.toString());
        }
        if (crs != null) {
            out.write(", ");
            out.write(Classes.getShortClassName(crs));
            out.write("[\"");
View Full Code Here

         */
        public Renderable(final int xAxis, final int yAxis) {
            super(null, AbstractCoverage.this);
            this.xAxis = xAxis;
            this.yAxis = yAxis;
            final Envelope envelope = getEnvelope();
            bounds = new Rectangle2D.Double(envelope.getMinimum(xAxis), envelope.getMinimum(yAxis),
                                            envelope.getSpan   (xAxis), envelope.getSpan   (yAxis));
        }
View Full Code Here

    public Envelope getEnvelope() {
        if (envelope != null) {
            return envelope.clone();
        } else {
            final CoordinateReferenceSystem crs = getCoordinateReferenceSystem();
            Envelope candidate = CRS.getEnvelope(crs);
            if (candidate == null) {
                final GeneralEnvelope copy = new GeneralEnvelope(crs);
                copy.setToNull();
                candidate = copy;
            }
View Full Code Here

     * Returns the grid coverage.
     */
    public GridCoverage2D getGridCoverage2D() {
        if (coverage == null) {
            final BufferedImage image = getBufferedImage();
            final Envelope envelope = getEnvelope();
            final GridSampleDimension[] bands;
            if (variables.isEmpty()) {
                bands = null;
            } else {
                bands = new GridSampleDimension[variables.size()];
View Full Code Here

TOP

Related Classes of org.opengis.geometry.Envelope

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.