Package net.lucidviews.geoalgo.limb.intersection

Examples of net.lucidviews.geoalgo.limb.intersection.SimpleIntersectionGenerator


  {
    LinearRing polygonBounds = this.geometryFactory.createLinearRing( LimbGeneratorTest.Utils.createBoxCoords( 0, 1000, 0, 1000 ) );
    Polygon polygon = this.geometryFactory.createPolygon( polygonBounds, null );
    Geometry example1 = this.geometryFactory.createLinearRing( LimbGeneratorTest.Utils.createBoxCoords( 500, 1500, 500, 1500 ) );
   
    SimpleIntersectionGenerator testObj = new SimpleIntersectionGenerator();
    System.out.println( "  -- Corner of linear ring" );
    testObj.setShape( polygonBounds );
    System.out.println( testObj.generateIntersections( example1 ) );
    System.out.println( testObj.generateIntersections( example1 ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( example1 ).getGeometryN( 0 ) );
    System.out.println( testObj.generateIntersections( example1 ).getGeometryN( 0 ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( example1 ).getGeometryN( 0 ).getGeometryN( 0 ) );
   
    assertEquals( "Intersection with linear ring does not create points.", "MultiPoint", testObj.generateIntersections( example1 ).getGeometryType() );
   
    System.out.println( "  -- Corner of Polygon" );
    testObj.setShape( polygon );
    System.out.println( testObj.generateIntersections( example1 ) );
    System.out.println( testObj.generateIntersections( example1 ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( example1 ).getGeometryN( 0 ) );
    System.out.println( testObj.generateIntersections( example1 ).getGeometryN( 0 ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( example1 ).getGeometryN( 0 ).getGeometryN( 0 ) );
   
    assertEquals( "Intersection with polygon does not create points.", "MultiPoint", testObj.generateIntersections( example1 ).getGeometryType() );
  }
View Full Code Here


  {
    LinearRing polygonBounds = this.geometryFactory.createLinearRing( LimbGeneratorTest.Utils.createBoxCoords( 0, 1000, 0, 1000 ) );
    Polygon polygon = this.geometryFactory.createPolygon( polygonBounds, null );
    Geometry example1 = this.geometryFactory.createLinearRing( LimbGeneratorTest.Utils.createBoxCoords( 1000, 2000, 1000, 2000 ) );
   
    SimpleIntersectionGenerator testObj = new SimpleIntersectionGenerator();
    System.out.println( "  -- Touch" );
    testObj.setShape( example1 );
    System.out.println( testObj.generateIntersections( polygon ) );
    System.out.println( testObj.generateIntersections( polygon ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 0 ) );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 0 ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 0 ).getGeometryN( 0 ) );
   
    assertEquals( "Touching intersection does not create points.", "Point", testObj.generateIntersections( polygon ).getGeometryType() );
  }
View Full Code Here

  {
    LinearRing polygonBounds = this.geometryFactory.createLinearRing( LimbGeneratorTest.Utils.createCoords( "0 1600, 100 500, 200 1500, 300 1000, 400 1500, 500 500, 600 1600, 0 1600" ) );
    Polygon polygon = this.geometryFactory.createPolygon( polygonBounds, null );
    Geometry example1 = this.geometryFactory.createLinearRing( LimbGeneratorTest.Utils.createBoxCoords( 0, 1000, 0, 1000 ) );
   
    SimpleIntersectionGenerator testObj = new SimpleIntersectionGenerator();
    System.out.println( "  -- Multiple intersections" );
    testObj.setShape( example1 );
    System.out.println( testObj.generateIntersections( polygon ) );
    System.out.println( testObj.generateIntersections( polygon ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 0 ).getDimension() + "D" );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 1 ).getDimension() + "D" );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 2 ).getDimension() + "D" );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 0 ) );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 0 ).getNumGeometries() );
    System.out.println( testObj.generateIntersections( polygon ).getGeometryN( 0 ).getGeometryN( 0 ) );
   
    assertEquals( "Multiple intersections does not create multiple geometries.", "GeometryCollection", testObj.generateIntersections( polygon ).getGeometryType() );
  }
View Full Code Here

TOP

Related Classes of net.lucidviews.geoalgo.limb.intersection.SimpleIntersectionGenerator

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.