Examples of MultiPolygon


Examples of com.vividsolutions.jts.geom.MultiPolygon

     * Test method for 'org.locationtech.udig.tools.edit.commands.AddGeomCommand.run(IProgressMonitor)'
     */
    @Test
    public void testRun() throws Exception {
        GeometryFactory factory = new GeometryFactory();
        MultiPolygon mp=factory.createMultiPolygon(new Polygon[]{createPolygon(factory, 0), createPolygon(factory, 10)});
       
        SimpleFeatureType schema = handler.getEditLayer().getSchema();
        SimpleFeature feature = SimpleFeatureBuilder.build(schema, new Object[]{mp, "test"}, "test"); //$NON-NLS-1$ //$NON-NLS-2$
        SelectFeatureCommand command=new SelectFeatureCommand(handler, feature, null);
       
View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSplitMultiPolygon() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil
          .read("MULTIPOLYGON(((0 0, 3 0, 3 3, 0 3, 0 2, 2 2, 2 1, 0 1, 0 0)), ((4 0, 6 0, 6 3, 4 3, 4 0)))");
    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(1 5, 1 -1, 5 -1, 5 4)");

    Geometry partA = SplitTestUtil.read("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))");
    Geometry partB = SplitTestUtil.read("POLYGON((1 0, 3 0, 3 3, 1 3, 1 2, 2 2, 2 1, 1 1, 1 0))");
View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSzenario_A_inputChanged_1() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON (((0 0, 5 0, 5 10, 0 10, 0 8, 3 8, 3 6, 0 6, 0 0)))"); //$NON-NLS-1$
    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(6 1, 3 6, 3 8, 6 9)"); //$NON-NLS-1$

    assertTrue(splitee.isValid());

    Geometry partA = SplitTestUtil.read("POLYGON ((5 2.6666666666666665, 3 6, 0 6, 0 0, 5 0, 5 2.6666666666666665))"); // A //$NON-NLS-1$
    Geometry partB = SplitTestUtil.read("POLYGON ((5 8.666666666666666, 3 8, 3 6, 5 2.6666666666666665, 5 8.666666666666666))"); //$NON-NLS-1$
    Geometry partC = SplitTestUtil.read("POLYGON ((3 8, 0 8, 0 10, 5 10, 5 8.666666666666666, 3 8))"); //$NON-NLS-1$
    // wrong polygon
View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSzenario_A_inputChanged_2() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON (((0 6, 3 6, 3 8, 0 8, 0 6)))"); //$NON-NLS-1$
    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(6 1, 3 6, 3 8, 6 9)"); // same //$NON-NLS-1$
    // split
    // line

    assertTrue(splitee.isValid());

    List<Geometry> expectedParts = new ArrayList<Geometry>();

    SplitTestUtil.testSplitStrategy(splitee, splitter, expectedParts);

View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSzenario_002_withValidData_1() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON(((1 1, 1 8, 10 8, 10 1, 1 1),(2 3, 8 3, 8 6, 2 6, 2 3)))"); //$NON-NLS-1$

    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(5 5, 5 2, 2 2, 2 3)"); //$NON-NLS-1$

    assertTrue(splitee.isValid());

    Geometry partA = SplitTestUtil.read("POLYGON ((1 1, 1 8, 10 8, 10 1, 1 1), (5 3, 8 3, 8 6, 2 6, 2 3, 2 2, 5 2, 5 3))"); //$NON-NLS-1$

    Geometry partB = SplitTestUtil.read("POLYGON ((2 3, 2 2, 5 2, 5 3, 2 3))"); //$NON-NLS-1$

View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSzenario_002_withValidData_2() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON (((2 3, 8 3, 8 6, 2 6, 2 3)))"); //$NON-NLS-1$

    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(5 5, 5 2, 2 2, 2 3)"); //$NON-NLS-1$

    assertTrue(splitee.isValid());

    // there isn't any split

    List<Geometry> expectedParts = new ArrayList<Geometry>();

View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSzenario_003() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON(((1 1, 1 8, 10 8, 10 1, 1 1),(2 3, 8 3, 8 6, 2 6, 2 3)))"); //$NON-NLS-1$

    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(2 3, 2 2, 5 2, 5 5)"); //$NON-NLS-1$

    assertTrue(splitee.isValid());

    Geometry partA = SplitTestUtil.read("POLYGON ((1 1, 1 8, 10 8, 10 1, 1 1), (5 3, 8 3, 8 6, 2 6, 2 3, 2 2, 5 2, 5 3))"); //$NON-NLS-1$

    Geometry partB = SplitTestUtil.read("POLYGON ((2 3, 2 2, 5 2, 5 3, 2 3))"); //$NON-NLS-1$

View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSzenario_003_withValidData_1() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON(((1 1, 1 8, 10 8, 10 1, 1 1),(2 3, 8 3, 8 6, 2 6, 2 3)))"); //$NON-NLS-1$

    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(2 3, 2 2, 5 2, 5 5)"); //$NON-NLS-1$

    assertTrue(splitee.isValid());

    Geometry partA = SplitTestUtil.read("POLYGON ((1 1, 1 8, 10 8, 10 1, 1 1), (5 3, 8 3, 8 6, 2 6, 2 3, 2 2, 5 2, 5 3))"); //$NON-NLS-1$

    Geometry partB = SplitTestUtil.read("POLYGON ((2 3, 2 2, 5 2, 5 3, 2 3))"); //$NON-NLS-1$

View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

   *
   * @throws Exception
   */
  @Test
  public void testSzenario_003_withValidData_2() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON (((2 3, 8 3, 8 6, 2 6, 2 3)))"); //$NON-NLS-1$

    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(2 3, 2 2, 5 2, 5 5)"); //$NON-NLS-1$
    assertTrue(splitee.isValid());

    List<Geometry> expectedParts = new ArrayList<Geometry>();

    SplitTestUtil.testSplitStrategy(splitee, splitter, expectedParts);
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon

    @Override
    protected GeometryCollection buildFromParts(GeometryFactory gf, List<?> parts) {

      Polygon[] polygons = parts.toArray(new Polygon[parts.size()]);
      MultiPolygon result = gf.createMultiPolygon(polygons);
      return result;
    }
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.