Package com.vividsolutions.jts.geom

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


        return new OneTimeTestSetup(new SVGMapProducerTest());
    }
   
    public void testHeterogeneousGeometry() throws Exception {
        GeometryFactory gf = new GeometryFactory();
        Point point = gf.createPoint(new Coordinate(10, 10));
        LineString line = gf.createLineString(new Coordinate[] {
                new Coordinate(50, 50), new Coordinate(100, 100) });
        Polygon polygon = gf.createPolygon(gf
                .createLinearRing(new Coordinate[] { new Coordinate(0, 0),
                        new Coordinate(0, 200), new Coordinate(200, 200),
View Full Code Here


        GeometryFactory gf = new GeometryFactory();
        SimpleFeatureType featureType = DataUtilities.createType("testType",
                "string:String,int:Integer,double:Double,geom:Point");

        SimpleFeature f = SimpleFeatureBuilder.build(featureType, new Object[] {
                    "three", new Integer(3), new Double(3.3), gf.createPoint(new Coordinate(3, 3))
                }, "fid.3");

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        template.process(f, new OutputStreamWriter(output));
        template.process(f, new OutputStreamWriter(System.out));
View Full Code Here

                "string:String,int:Integer,double:Double,geom:Point");

        features = new DefaultFeatureCollection(null, null) {};
        features.add(
            SimpleFeatureBuilder.build(featureType, new Object[] {
                "one", new Integer(1), new Double(1.1), gf.createPoint(new Coordinate(1, 1))
            }, "fid.1")
        );
        features.add(
            SimpleFeatureBuilder.build(featureType, new Object[] {
                "two", new Integer(2), new Double(2.2), gf.createPoint(new Coordinate(2, 2))
View Full Code Here

                "one", new Integer(1), new Double(1.1), gf.createPoint(new Coordinate(1, 1))
            }, "fid.1")
        );
        features.add(
            SimpleFeatureBuilder.build(featureType, new Object[] {
                "two", new Integer(2), new Double(2.2), gf.createPoint(new Coordinate(2, 2))
            }, "fid.2")
        );
        features.add(
            SimpleFeatureBuilder.build(featureType, new Object[] {
                "three", new Integer(3), new Double(3.3), gf.createPoint(new Coordinate(3, 3))
View Full Code Here

                "two", new Integer(2), new Double(2.2), gf.createPoint(new Coordinate(2, 2))
            }, "fid.2")
        );
        features.add(
            SimpleFeatureBuilder.build(featureType, new Object[] {
                "three", new Integer(3), new Double(3.3), gf.createPoint(new Coordinate(3, 3))
            }, "fid.3")
        );
        cfg = new Configuration();
        cfg.setClassForTemplateLoading(getClass(), "");
        cfg.setObjectWrapper(new FeatureWrapper());
View Full Code Here

            polygonBuffer.append(coord.x).append(" ");
            polygonBuffer.append(coord.y).append(" ");
        }
        String targetPolygonCoords = polygonBuffer.toString().trim();
        Point targetPoint = (Point) JTS.transform(
                factory.createPoint(new Coordinate(42.58, 31.29)), transform);
        String targetPointCoord = targetPoint.getCoordinate().x + " "
                + targetPoint.getCoordinate().y;

        Document doc = getAsDOM("wfs?request=GetFeature&typename=ex:geomContainer&srsname=urn:x-ogc:def:crs:EPSG::4326");
        LOGGER
View Full Code Here

        builder.add("label", String.class);
        builder.setName("funnyLabels");
        SimpleFeatureType type = builder.buildFeatureType();
       
        GeometryFactory gf = new GeometryFactory();
        SimpleFeature f1 = SimpleFeatureBuilder.build(type, new Object[]{gf.createPoint(new Coordinate(5, 8)), "A label with \"quotes\""}, null);
        SimpleFeature f2 = SimpleFeatureBuilder.build(type, new Object[]{gf.createPoint(new Coordinate(5, 4)), "A long label\nwith newlines"}, null);
       
        MemoryDataStore data = new MemoryDataStore();
        data.addFeature(f1);
        data.addFeature(f2);
View Full Code Here

        builder.setName("funnyLabels");
        SimpleFeatureType type = builder.buildFeatureType();
       
        GeometryFactory gf = new GeometryFactory();
        SimpleFeature f1 = SimpleFeatureBuilder.build(type, new Object[]{gf.createPoint(new Coordinate(5, 8)), "A label with \"quotes\""}, null);
        SimpleFeature f2 = SimpleFeatureBuilder.build(type, new Object[]{gf.createPoint(new Coordinate(5, 4)), "A long label\nwith newlines"}, null);
       
        MemoryDataStore data = new MemoryDataStore();
        data.addFeature(f1);
        data.addFeature(f2);
        FeatureSource<SimpleFeatureType, SimpleFeature> fs = data.getFeatureSource("funnyLabels");
View Full Code Here

    public static Point getPoint(double longitude, double latitude, int srid) {
        GeometryFactory geometryFactory = new GeometryFactory();
        Coordinate coordinate = new Coordinate();
        coordinate.x = longitude;
        coordinate.y = latitude;
        Point point = geometryFactory.createPoint(coordinate);
        point.setSRID(srid);
        return point;
    }
}
View Full Code Here

        // Simple points like "-104.53, 34.74, -63.53, 10.23"
        String[] strs = geometries.split(",");
        for (int i = 0; i < strs.length / 2; i++) {
          double x = Double.parseDouble(strs[2 * i]);
          double y = Double.parseDouble(strs[2 * i + 1]);
          geo = geoFactory.createPoint(new Coordinate(x, y));
          geometriesList.add(geo);
        }
      }
    } else {
      JSONObject obj = new JSONObject(geometries);
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.