Package com.vividsolutions.jts.algorithm

Examples of com.vividsolutions.jts.algorithm.PointLocator


    assertEquals(new Coordinate(20, 20), f.getCoordinates()[1]);
    assertEquals(new Coordinate(30, 30), f.getCoordinates()[2]);
  }

  public void testPointLocatorLinearRingLineString() throws Exception {
    PointLocator pointLocator = new PointLocator();
    Geometry gc = reader.read("GEOMETRYCOLLECTION( LINESTRING(0 0, 10 10), LINEARRING(10 10, 10 20, 20 10, 10 10))");
    assertEquals(Location.BOUNDARY, pointLocator.locate(new Coordinate(10, 10), gc));
  }
View Full Code Here


    Geometry gc = reader.read("GEOMETRYCOLLECTION( LINESTRING(0 0, 10 10), LINEARRING(10 10, 10 20, 20 10, 10 10))");
    assertEquals(Location.BOUNDARY, pointLocator.locate(new Coordinate(10, 10), gc));
  }

  public void testPointLocator() throws Exception {
    PointLocator pointLocator = new PointLocator();
    Geometry polygon = reader.read("POLYGON ((70 340, 430 50, 70 50, 70 340))");
    assertEquals(Location.EXTERIOR, pointLocator.locate(new Coordinate(420, 340), polygon));
    assertEquals(Location.BOUNDARY, pointLocator.locate(new Coordinate(350, 50), polygon));
    assertEquals(Location.BOUNDARY, pointLocator.locate(new Coordinate(410, 50), polygon));
    assertEquals(Location.INTERIOR, pointLocator.locate(new Coordinate(190, 150), polygon));
  }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.algorithm.PointLocator

Copyright © 2018 www.massapicom. 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.