Examples of LRSMeasureProcess


Examples of org.geotools.process.vector.LRSMeasureProcess

    }

    @Test
    public void testBadParamFromLrs() throws Exception {
        SimpleFeatureSource source = featureSource.getFeatureSource("lrssimple");
        LRSMeasureProcess process = new LRSMeasureProcess();
        SimpleFeatureCollection origional = source.getFeatures();
        Point point = geometryFactory.createPoint(new Coordinate(1.0, 0.0));

        try {
            FeatureCollection result = process.execute(origional, "from_lrs_bad", "to_lrs", point,
                    null);
            Assert.fail("Expected error from bad from_lrs name");
        } catch (ProcessException e) {
            // Successful
        }
View Full Code Here

Examples of org.geotools.process.vector.LRSMeasureProcess

    }

    @Test
    public void testBadParamToLrs() throws Exception {
        SimpleFeatureSource source = featureSource.getFeatureSource("lrssimple");
        LRSMeasureProcess process = new LRSMeasureProcess();
        SimpleFeatureCollection origional = source.getFeatures();
        Point point = geometryFactory.createPoint(new Coordinate(1.0, 0.0));

        try {
            FeatureCollection result = process.execute(origional, "from_lrs", "to_lrs_bad", point,
                    null);
            Assert.fail("Expected error from bad to_lrs name");
        } catch (ProcessException e) {
            // Successful
        }
View Full Code Here

Examples of org.geotools.process.vector.LRSMeasureProcess

    }

    @Test
    public void testnullParamFromLrs() throws Exception {
        SimpleFeatureSource source = featureSource.getFeatureSource("lrssimple");
        LRSMeasureProcess process = new LRSMeasureProcess();
        SimpleFeatureCollection origional = source.getFeatures();
        Point point = geometryFactory.createPoint(new Coordinate(1.0, 0.0));

        try {
            FeatureCollection result = process.execute(origional, null, "to_lrs", point, null);
            Assert.fail("Expected error from bad from_lrs name");
        } catch (ProcessException e) {
            // Successful
        }
    }
View Full Code Here

Examples of org.geotools.process.vector.LRSMeasureProcess

    }

    @Test
    public void testNullParamToLrs() throws Exception {
        SimpleFeatureSource source = featureSource.getFeatureSource("lrssimple");
        LRSMeasureProcess process = new LRSMeasureProcess();
        SimpleFeatureCollection origional = source.getFeatures();
        Point point = geometryFactory.createPoint(new Coordinate(1.0, 0.0));

        try {
            FeatureCollection result = process.execute(origional, "from_lrs", null, point, null);
            Assert.fail("Expected error from bad to_lrs name");
        } catch (ProcessException e) {
            // Successful
        }
    }
View Full Code Here

Examples of org.geotools.process.vector.LRSMeasureProcess

    }

    @Test
    public void testBadPoint() throws Exception {
        SimpleFeatureSource source = featureSource.getFeatureSource("lrssimple");
        LRSMeasureProcess process = new LRSMeasureProcess();
        SimpleFeatureCollection origional = source.getFeatures();

        try {
            FeatureCollection result = process.execute(origional, "from_lrs", "to_lrs_bad", null,
                    null);
            Assert.fail("Expected error from bad measure value");
        } catch (ProcessException e) {
            // Successful
        }
View Full Code Here

Examples of org.geotools.process.vector.LRSMeasureProcess

        }
    }

    @Test
    public void testNoFeaturesGiven() throws Exception {
        LRSMeasureProcess process = new LRSMeasureProcess();
        FeatureCollection origional = FeatureCollections.newCollection();
        Point point = geometryFactory.createPoint(new Coordinate(1.0, 0.0));

        FeatureCollection result = process.execute(origional, "from_lrs", "to_lrs", point, null);
        Assert.assertEquals(0, result.size());
    }
View Full Code Here

Examples of org.geotools.process.vector.LRSMeasureProcess

    }

    @Test
    public void testGoodMeasure() throws Exception {
        SimpleFeatureSource source = featureSource.getFeatureSource("lrssimple");
        LRSMeasureProcess process = new LRSMeasureProcess();
        SimpleFeatureCollection origional = source.getFeatures();
        Point point = geometryFactory.createPoint(new Coordinate(1.0, 0.0));

        FeatureCollection result = process.execute(origional, "from_lrs", "to_lrs", point, null);
        Assert.assertEquals(1, result.size());
        Feature feature = result.features().next();
        Assert.assertNotNull(feature.getProperty("lrs_measure"));
        Assert.assertNotNull(feature.getProperty("lrs_measure").getValue());
        Double measure = (Double) feature.getProperty("lrs_measure").getValue();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.