Examples of createLineString()


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

                new Coordinate(20, 20),});
        line[1] = factory.createLineString(new Coordinate[]{new Coordinate(15, 15),
                new Coordinate(25, 25),});
        assertTrue(line[0].overlaps(line[1])); // just checking :)
        // second test: does this validation test for self-overlaps? (it shouldn't)
        line[2] = factory.createLineString(new Coordinate[]{new Coordinate(50, 50),
                new Coordinate(60, 50), new Coordinate(55, 50),});
        // third test: an intersecting line; is valid? 
        line[3] = factory.createLineString(new Coordinate[]{new Coordinate(10, 20),
                new Coordinate(20, 10),});
View Full Code Here

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

        assertTrue(line[0].overlaps(line[1])); // just checking :)
        // second test: does this validation test for self-overlaps? (it shouldn't)
        line[2] = factory.createLineString(new Coordinate[]{new Coordinate(50, 50),
                new Coordinate(60, 50), new Coordinate(55, 50),});
        // third test: an intersecting line; is valid? 
        line[3] = factory.createLineString(new Coordinate[]{new Coordinate(10, 20),
                new Coordinate(20, 10),});

        String[] attrValues = new String[4];
        attrValues[0] = "value0"; //$NON-NLS-1$
        attrValues[1] = "value1"; //$NON-NLS-1$
View Full Code Here

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

        handler.setEditBlackboard(new EditBlackboard(500,500, map.getViewportModel().worldToScreenTransform(),
                map.getLayersInternal().get(0).layerToMapTransform()));
       
        FeatureStore<SimpleFeatureType, SimpleFeature> resource = map.getLayersInternal().get(0).getResource(FeatureStore.class, null);
        GeometryFactory factory=new GeometryFactory();
        LineString line1=factory.createLineString(new Coordinate[]{
                map.getViewportModel().pixelToWorld(10,10), map.getViewportModel().pixelToWorld(10,20)
        });
        LineString line2=factory.createLineString(new Coordinate[]{
                map.getViewportModel().pixelToWorld(20,10), map.getViewportModel().pixelToWorld(20,20)
        });
View Full Code Here

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

        FeatureStore<SimpleFeatureType, SimpleFeature> resource = map.getLayersInternal().get(0).getResource(FeatureStore.class, null);
        GeometryFactory factory=new GeometryFactory();
        LineString line1=factory.createLineString(new Coordinate[]{
                map.getViewportModel().pixelToWorld(10,10), map.getViewportModel().pixelToWorld(10,20)
        });
        LineString line2=factory.createLineString(new Coordinate[]{
                map.getViewportModel().pixelToWorld(20,10), map.getViewportModel().pixelToWorld(20,20)
        });
       
        MultiLineString multiline = factory.createMultiLineString(new LineString[]{line1, line2});
       
View Full Code Here

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

            source.modifyFeatures(feature.getFeatureType().getDescriptor("name"), "feature"+i, filterFac.id(FeatureUtils.stringToId(filterFac, feature.getID())))//$NON-NLS-1$//$NON-NLS-2$
            Geometry geom;
            if( i==0 ){
                geom=geomFac.createPoint(new Coordinate(0,10));
            }else if( i==1 ){
                geom=geomFac.createLineString(new Coordinate[]{
                        new Coordinate( 10,10), new Coordinate(10,20)
                });
            }else{
                geom=geomFac.createLinearRing(
                        new Coordinate[]{
View Full Code Here

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

    private TestHandler handler;

    @Before
    public void setUp() throws Exception {
        GeometryFactory fac=new GeometryFactory();
        LineString line = fac.createLineString(new Coordinate[]{
           new Coordinate(0,10),new Coordinate(10,10), new Coordinate(20,10)
        });
        Polygon poly = fac.createPolygon(fac.createLinearRing(new Coordinate[]{
                new Coordinate(20,20),new Coordinate(40,20), new Coordinate(40,40),
                new Coordinate(20,40), new Coordinate(20,20)
View Full Code Here

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

        List<LineString> segmentList = new GeometryList<LineString>();
       
        Coordinate[] ringCoords = ring.getCoordinates();
        for( int i = 0; i < ringCoords.length - 1; i++ ) {
           
            LineString segment = gf.createLineString(new Coordinate[]{ringCoords[i], ringCoords[i+1]});
            segmentList.add(segment);
        }
        return segmentList;
    }
View Full Code Here

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

  }

  @Override
  public String toString() {
    GeometryFactory fact = new GeometryFactory();
    LineString line = fact.createLineString(getCoordinates());
    return line.toString();
  }

  public int size() {
View Full Code Here

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

        continue;

      Coordinate[] part = new Coordinate[2];
      part[0] = coords[i];
      part[1] = coords[i + 1];
      LineString segment = gf.createLineString(part);

      if (subjectLine.intersects(segment)) {

        // get the intersection coordinate
        Coordinate intersectionCoord = subjectLine.intersection(segment).getCoordinate();
View Full Code Here

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

    @Before
    public void setUp() throws Exception {
        sourceType=DataUtilities.createType("source", "*geom:LineString,geom2:Point,nAme:String"); //$NON-NLS-1$ //$NON-NLS-2$
        sourceFeatures = new SimpleFeature[1];
        GeometryFactory fac=new GeometryFactory();
        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"};
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.