Package chunmap.model.algorithm

Source Code of chunmap.model.algorithm.LineAlgorithmTest

/**
* Copyright (c) 2009-2011, chunquedong(YangJiandong)
*
* This file is part of ChunMap project
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
*
* History:
*     2010-05-05  Jed Young  Creation
*/
package chunmap.model.algorithm;

import junit.framework.Assert;

import org.junit.Test;

import chunmap.model.geom.Geometry;
import chunmap.model.geom.LineString;
import chunmap.model.geom.WktReader;

public class LineAlgorithmTest {
  WktReader reader=new WktReader();
  @Test
  public void testHasIntersection() {
    Geometry g=reader.read("LINESTRING(92.28571428571429 100.21428571428572,93.71428571428571 100.21428571428572,93.71428571428571 101.64285714285715,92.28571428571429 101.64285714285715,92.28571428571429 100.21428571428572)");
    Geometry g2=reader.read("LINESTRING(0.0 100.0,100.0 101.0)");
    LineString ls=(LineString)g;
    LineString ls2=(LineString)g2;
    Assert.assertTrue(LineAlgorithm.hasIntersection(ls.getPoints(), ls2.getPoints()));
  }

}
TOP

Related Classes of chunmap.model.algorithm.LineAlgorithmTest

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.