Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPoint()


        sourceResource=CatalogTests.createGeoResource(sourceFeatures, true);
        sourceMap=MapTests.createNonDynamicMapAndRenderer(sourceResource, new Dimension(100,100));

        targetType=DataUtilities.createType("target", "*targetGeom:Point,name:String"); //$NON-NLS-1$ //$NON-NLS-2$
        SimpleFeature[] targetFeatures = new SimpleFeature[1];
        Object[] values2 = new Object[]{fac.createPoint(new Coordinate(10,10)), "targetName"};
    targetFeatures[0]=SimpleFeatureBuilder.build(targetType, values2, "id3"); //$NON-NLS-1$
        targetResource=CatalogTests.createGeoResource(targetFeatures, true);
        targetMap=MapTests.createNonDynamicMapAndRenderer(targetResource, new Dimension(100,100));

    }
View Full Code Here


        Object[] atts = new Object[]{fac.createLineString(new Coordinate[]{
                new Coordinate(0,0),
                new Coordinate(10,10),
                new Coordinate(20,20),
        }),
                fac.createPoint(new Coordinate(10,10)), "sourceName"};
        sourceFeatures[0]=SimpleFeatureBuilder.build(sourceType,atts, "id"); //$NON-NLS-1$
        sourceResource=MapTests.createGeoResource(sourceFeatures, true);
        sourceMap=MapTests.createNonDynamicMapAndRenderer(sourceResource, new Dimension(100,100));

        targetType=DataUtilities.createType("target", "*targetGeom:Point,name:String"); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

        sourceResource=MapTests.createGeoResource(sourceFeatures, true);
        sourceMap=MapTests.createNonDynamicMapAndRenderer(sourceResource, new Dimension(100,100));

        targetType=DataUtilities.createType("target", "*targetGeom:Point,name:String"); //$NON-NLS-1$ //$NON-NLS-2$
        SimpleFeature[] targetFeatures = new SimpleFeature[1];
        atts = new Object[]{fac.createPoint(new Coordinate(10,10)), "targetName"};
    targetFeatures[0]=SimpleFeatureBuilder.build(targetType, atts, "id"); //$NON-NLS-1$
        targetResource=MapTests.createGeoResource(targetFeatures, true);
        targetMap=MapTests.createNonDynamicMapAndRenderer(targetResource, new Dimension(100,100));

    }
View Full Code Here

        DefaultFeatureCollection collection = new DefaultFeatureCollection();
        collection.clear();
        GeometryFactory fac=new GeometryFactory();

        Object[] atts = new Object[]{
                fac.createPoint(new Coordinate(0,0)),
                "name1" //$NON-NLS-1$
        };
        SimpleFeatureType schema = fs.getSchema();
        collection.add(SimpleFeatureBuilder.build(schema, atts, "id"));
View Full Code Here

        };
        SimpleFeatureType schema = fs.getSchema();
        collection.add(SimpleFeatureBuilder.build(schema, atts, "id"));

        atts = new Object[]{
                fac.createPoint(new Coordinate(45,45)),
                "name2" //$NON-NLS-1$
        };
        collection.add(SimpleFeatureBuilder.build(schema, atts, "id"));

        fs.removeFeatures(Filter.INCLUDE);
View Full Code Here

        ArrayList<SimpleFeature> features = new ArrayList<SimpleFeature>(2);

        final String name1 = "name1"; //$NON-NLS-1$
        final String name2 = "name2"; //$NON-NLS-1$
        SimpleFeature feature1 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), name1,
                1}, "ID1"); //$NON-NLS-1$

        SimpleFeature feature2 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), name2,
                2}, "ID2"); //$NON-NLS-1$
View Full Code Here

        final String name1 = "name1"; //$NON-NLS-1$
        final String name2 = "name2"; //$NON-NLS-1$
        SimpleFeature feature1 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), name1,
                1}, "ID1"); //$NON-NLS-1$

        SimpleFeature feature2 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), name2,
                2}, "ID2"); //$NON-NLS-1$

        features.add(feature1);
        features.add(feature2);
View Full Code Here

        assertEquals(feature1, features.get(0));
        assertEquals(feature2, features.get(1));
       

        SimpleFeature feature11 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), name2,
                11}, "ID11"); //$NON-NLS-1$
       
        features.add( feature11 );

        Collections.sort(features, new FIDComparator(SWT.UP));
View Full Code Here

        assertEquals(feature11, features.get(1));

        features.clear();

        features.add( feature1 );
        SimpleFeature featureStrange = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), name2,
                11}, "Blarg2"); //$NON-NLS-1$
        features.add(featureStrange);
        Collections.sort(features, new FIDComparator(SWT.DOWN));
        assertEquals(featureStrange, features.get(0));
        assertEquals(feature1, features.get(1));
View Full Code Here

    // possible inconsistencies between what the user
    // drawn and the projected result
    GeometryFactory gf = new GeometryFactory();
    CoordinateReferenceSystem layerCrs = LayerUtil.getCrs(editLayer);
    CoordinateReferenceSystem mapCrs = editLayer.getMap().getViewportModel().getCRS();
    Point p1 = gf.createPoint(currentShape.getCoord(0));
    Point p2 = gf.createPoint(currentShape.getCoord(1));
    Point p3 = gf.createPoint(currentShape.getCoord(2));

    try {
      p1 = (Point) GeoToolsUtils.reproject(p1, layerCrs, mapCrs);
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.