Package com.vividsolutions.jts.geom

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


    // 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);
      p2 = (Point) GeoToolsUtils.reproject(p2, layerCrs, mapCrs);
View Full Code Here


    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);
      p2 = (Point) GeoToolsUtils.reproject(p2, layerCrs, mapCrs);
      p3 = (Point) GeoToolsUtils.reproject(p3, layerCrs, mapCrs);
View Full Code Here

      // to be over the line as it was produced by intersecting both lines
      // so we're using little buffer to determine if the point lies over the
      // segment
      Geometry lineSegment = gf.createLineString(segment);
      lineSegment = lineSegment.buffer(DELTA_DISTANCE, 2);
      Point point = gf.createPoint(pointInLine);
      Geometry intersection = lineSegment.intersection(point);
      if (point.equals(intersection)) {
        return segment[0];
      }
    }
View Full Code Here

    public void testPoint() throws Exception {
        Drawing d = Drawing.create();
        Display display = Display.getCurrent();
        GeometryFactory factory = new GeometryFactory();

        Point point = factory.createPoint(new Coordinate(7, 7));

        StyleBuilder builder = new StyleBuilder();
        Mark mark = builder.createMark(StyleBuilder.MARK_SQUARE);
        mark.setStroke(builder.createStroke(Color.BLUE));
        mark.setFill(builder.createFill(Color.BLUE));
View Full Code Here

        GeometryFactory fac = new GeometryFactory();
        type = DataUtilities.createType("type", "geom:Point,name:String,id:int");

        features = new ArrayList<SimpleFeature>(2);

        feature1 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name1", 1}, "ID1");
        feature2 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name2", 2}, "ID2");
        feature3 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name3", 3}, "ID3");
        feature4 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name4", 4}, "ID4");

        features.add(feature1);
View Full Code Here

        type = DataUtilities.createType("type", "geom:Point,name:String,id:int");

        features = new ArrayList<SimpleFeature>(2);

        feature1 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name1", 1}, "ID1");
        feature2 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name2", 2}, "ID2");
        feature3 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name3", 3}, "ID3");
        feature4 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name4", 4}, "ID4");

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

        features = new ArrayList<SimpleFeature>(2);

        feature1 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name1", 1}, "ID1");
        feature2 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name2", 2}, "ID2");
        feature3 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name3", 3}, "ID3");
        feature4 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name4", 4}, "ID4");

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

        features = new ArrayList<SimpleFeature>(2);

        feature1 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name1", 1}, "ID1");
        feature2 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name2", 2}, "ID2");
        feature3 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name3", 3}, "ID3");
        feature4 = SimpleFeatureBuilder.build(type, new Object[]{fac.createPoint(new Coordinate(10, 10)), "name4", 4}, "ID4");

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

      throws Exception
  {
    // create a factory using default values (e.g. floating precision)
    GeometryFactory fact = new GeometryFactory();

    Point p1 = fact.createPoint(new Coordinate(0,0));
    System.out.println(p1);

    Point p2 = fact.createPoint(new Coordinate(1,1));
    System.out.println(p2);
View Full Code Here

    GeometryFactory fact = new GeometryFactory();

    Point p1 = fact.createPoint(new Coordinate(0,0));
    System.out.println(p1);

    Point p2 = fact.createPoint(new Coordinate(1,1));
    System.out.println(p2);

    MultiPoint mpt = fact.createMultiPoint(new Coordinate[] { new Coordinate(0,0), new Coordinate(1,1) } );
    System.out.println(mpt);
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.