Package org.geotools.geometry

Examples of org.geotools.geometry.DirectPosition2D


        }
    }
   
    @Test
    public void getInfoOutsideCoverageReturnsEmptyResult() throws Exception {
        DirectPosition2D pos = new DirectPosition2D(
                WORLD.getCoordinateReferenceSystem(),
                WORLD.getMaxX() + 1,
                WORLD.getMaxY() + 1);
       
        InfoToolResult info = helper.getInfo(pos);
View Full Code Here


        helper.setMapContent(mapContent);
        helper.setLayer(layer);
       
        ReferencedEnvelope bounds = layer.getBounds();
        DirectPosition2D pos = new DirectPosition2D(
                bounds.getCoordinateReferenceSystem(),
                bounds.getMinX() - 1,
                bounds.getMinY() - 1);
       
        InfoToolResult info = helper.getInfo(pos);
View Full Code Here

            mapContent.dispose();
        }
    }

    private void assertGetInfo(SimpleFeature feature) throws Exception {
        DirectPosition2D pos = TestDataUtils.getPosInFeature(feature);
        InfoToolResult info = helper.getInfo(pos);
        assertFalse(info.getNumFeatures() < 1);

        // Allow that there might be more than one feature in
        // the result
View Full Code Here

     * @return An error message.
     *
     * @since 2.5
     */
    protected String formatEvaluateError(final Point2D point, final boolean outside) {
        return formatEvaluateError((DirectPosition) new DirectPosition2D(point), outside);
    }
View Full Code Here

     * @param  point The coordinate point to format.
     * @param  locale The locale for formatting numbers.
     * @return The coordinate point as a string, without '(' or ')' characters.
     */
    static String toString(final Point2D point, final Locale locale) {
        return toString((DirectPosition) new DirectPosition2D(point), locale);
    }
View Full Code Here

        helper.setLayer(layer);
    }

    @Test
    public void getInfo() throws Exception {
        DirectPosition2D pos = new DirectPosition2D(WORLD.getCoordinateReferenceSystem());
        int[] values = new int[coverage.getNumSampleDimensions()];
       
        for (int i = 0; i < NUM_TEST_POINTS; i++) {
            pos.x = WORLD.getMinX() + WORLD.getWidth() * rand.nextDouble();
            pos.y = WORLD.getMinY() + WORLD.getHeight() * rand.nextDouble();
 
View Full Code Here

        }
    }
   
    @Test
    public void getInfoOutsideCoverageReturnsEmptyResult() throws Exception {
        DirectPosition2D pos = new DirectPosition2D(
                WORLD.getCoordinateReferenceSystem(),
                WORLD.getMaxX() + 1,
                WORLD.getMaxY() + 1);
       
        InfoToolResult info = helper.getInfo(pos);
View Full Code Here

        } finally {
            iter.close();
        }
       
       
        DirectPosition2D queryPos = TestDataUtils.getPosInFeature(feature);
        Point2D p2d = mapPane.getWorldToScreenTransform().transform(queryPos, null);
       
        Point windowOrigin = mapPaneFixture.component().getLocationOnScreen();
        Point screenQueryPos = new Point(
                windowOrigin.x + (int) p2d.getX(),
View Full Code Here

        double finalRes = calculateResolution(mosaic);
        double percentual = Math.abs(initialRes - finalRes) / initialRes;
        Assert.assertTrue(percentual < TOLERANCE);

        // Check that on the center of the image there are nodata
        DirectPosition point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(),
                actual.getCenterX(), actual.getCenterY());
        double nodata = CoverageUtilities.getBackgroundValues(coverage1)[0];
        double result = ((int[]) mosaic.evaluate(point))[0];
        Assert.assertEquals(nodata, result, TOLERANCE);

        // Check that on the Upper Left border pixel there is valid data
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), actual.getMinX()
                + finalRes, actual.getMinY() + finalRes);
        result = ((int[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Ensure the Layout is already present after the mosaic
View Full Code Here

        double finalRes = calculateResolution(mosaic);
        double percentual = Math.abs(initialRes - finalRes) / initialRes;
        Assert.assertTrue(percentual < TOLERANCE);

        // Check that on the center of the image there are nodata
        DirectPosition point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(),
                actual.getCenterX(), actual.getCenterY());
        double result = ((int[]) mosaic.evaluate(point))[0];
        Assert.assertEquals(nodata, result, TOLERANCE);

        // Check that on the Upper Left border pixel there is valid data
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), actual.getMinX()
                + finalRes, actual.getMinY() + finalRes);
        result = ((int[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Coverage and RenderedImage disposal
View Full Code Here

TOP

Related Classes of org.geotools.geometry.DirectPosition2D

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.