Examples of geometryType()


Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

    g0.setSpatialReference(null);
    g1.setSpatialReference(null);
    OGCGeometry rslt = g0.intersection(g1);
    assertTrue(rslt != null);
    assertTrue(rslt.dimension() == 1);
    assertTrue(rslt.geometryType().equals("LineString"));
    String s = rslt.asText();
  }

  @Test
  public void testIsectTria3() {
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

    g0.setSpatialReference(SpatialReference.create(4326));
    g1.setSpatialReference(SpatialReference.create(4326));
    OGCGeometry rslt = g0.intersection(g1);
    assertTrue(rslt != null);
    assertTrue(rslt.dimension() == 0);
    assertTrue(rslt.geometryType().equals("Point"));
    assertTrue(rslt.esriSR.getID() == 4326);
    String s = rslt.asText();
  }

  @Test
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

  @Test
  public void testMultiPointSinglePoint() {
    String wkt = "multipoint((1 0))";
    OGCGeometry g0 = OGCGeometry.fromText(wkt);
    assertTrue(g0.dimension() == 0);
    String gt = g0.geometryType();
    assertTrue(gt.equals("MultiPoint"));
    OGCMultiPoint mp = (OGCMultiPoint)g0;
    assertTrue(mp.numGeometries() == 1);
    OGCGeometry p = mp.geometryN(0);
    String s = p.asText();
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

  public void testMultiPolygonArea() {
    //MultiPolygon Area #36
    String wkt = "MULTIPOLYGON (((1001200 2432900, 1001420 2432691, 1001250 2432388, 1001498 2432325, 1001100 2432100, 1001500 2431900, 1002044 2431764, 1002059 2432120, 1002182 2432003, 1002400 2432300, 1002650 2432150, 1002610 2432323, 1002772 2432434, 1002410 2432821, 1002700 2433000, 1001824 2432866, 1001600 2433150, 1001200 2432900)), ((1000393 2433983, 1000914 2434018, 1000933 2433817, 1000568 2433834, 1000580 2433584, 1000700 2433750, 1000800 2433650, 1000700 2433450, 1000600 2433550, 1000200 2433350, 1000100 2433900, 1000393 2433983)), ((1001200 2432900, 1000878 2432891, 1000900 2433300, 1001659 2433509, 1001600 2433150, 1001200 2432900)), ((1002450 2431650, 1002300 2431650, 1002300 2431900, 1002500 2432100, 1002600 2431800, 1002450 2431800, 1002450 2431650)), ((999750 2433550, 999850 2433600, 999900 2433350, 999780 2433433, 999750 2433550)), ((1002950 2432050, 1003005 2431932, 1002850 2432250, 1002928 2432210, 1002950 2432050)), ((1002600 2431750, 1002642 2431882, 1002750 2431900, 1002750 2431750, 1002600 2431750)), ((1002950 2431750, 1003050 2431650, 1002968 2431609, 1002950 2431750)))";
    {
      OGCGeometry ogcg = OGCGeometry.fromText(wkt);
      assertTrue(ogcg.geometryType().equals("MultiPolygon"));
      OGCMultiPolygon mp = (OGCMultiPolygon)ogcg;
      double a = mp.area();
      assertTrue(Math.abs(mp.area() - 2037634.5) < a*1e-14);
    }

 
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

      assertTrue(Math.abs(mp.area() - 2037634.5) < a*1e-14);
    }

    {
      OGCGeometry ogcg = OGCGeometry.fromText(wkt);
      assertTrue(ogcg.geometryType().equals("MultiPolygon"));
      Geometry g = ogcg.getEsriGeometry();
      double a = g.calculateArea2D();
      assertTrue(Math.abs(a - 2037634.5) < a*1e-14);
    }
  }
 
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

  @Test
  public void testPolylineSimplifyIssueGithub52() throws JsonParseException, IOException {
    String json = "{\"paths\":[[[2,0],[4,3],[5,1],[3.25,1.875],[1,3]]],\"spatialReference\":{\"wkid\":4326}}";
    {
      OGCGeometry g = OGCGeometry.fromJson(json);
      assertTrue(g.geometryType().equals("LineString"));
      OGCGeometry simpleG = g.makeSimple();//make ogc simple
      assertTrue(simpleG.geometryType().equals("MultiLineString"));     
      assertTrue(simpleG.isSimpleRelaxed());//geodatabase simple
      assertTrue(simpleG.isSimple());//ogc simple
      OGCMultiLineString mls =(OGCMultiLineString)simpleG;
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

    String json = "{\"paths\":[[[2,0],[4,3],[5,1],[3.25,1.875],[1,3]]],\"spatialReference\":{\"wkid\":4326}}";
    {
      OGCGeometry g = OGCGeometry.fromJson(json);
      assertTrue(g.geometryType().equals("LineString"));
      OGCGeometry simpleG = g.makeSimple();//make ogc simple
      assertTrue(simpleG.geometryType().equals("MultiLineString"));     
      assertTrue(simpleG.isSimpleRelaxed());//geodatabase simple
      assertTrue(simpleG.isSimple());//ogc simple
      OGCMultiLineString mls =(OGCMultiLineString)simpleG;
      assertTrue(mls.numGeometries() == 4);
      OGCGeometry baseGeom = OGCGeometry.fromJson("{\"paths\":[[[2,0],[3.25,1.875]],[[3.25,1.875],[4,3],[5,1]],[[5,1],[3.25,1.875]],[[3.25,1.875],[1,3]]],\"spatialReference\":{\"wkid\":4326}}");
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

  }

  @Test
  public void testPoint() {
    OGCGeometry g = OGCGeometry.fromText("POINT(1 2)");
    assertTrue(g.geometryType().equals("Point"));
    OGCPoint p = (OGCPoint) g;
    assertTrue(p.X() == 1);
    assertTrue(p.Y() == 2);
    assertTrue(g.equals(OGCGeometry.fromText("POINT(1 2)")));
    assertTrue(!g.equals(OGCGeometry.fromText("POINT(1 3)")));
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

    assertTrue(p.X() == 1);
    assertTrue(p.Y() == 2);
    assertTrue(g.equals(OGCGeometry.fromText("POINT(1 2)")));
    assertTrue(!g.equals(OGCGeometry.fromText("POINT(1 3)")));
    OGCGeometry buf = g.buffer(10);
    assertTrue(buf.geometryType().equals("Polygon"));
    OGCPolygon poly = (OGCPolygon) buf.envelope();
    double a = poly.area();
    assertTrue(Math.abs(a - 400) < 1e-1);
  }
View Full Code Here

Examples of com.esri.core.geometry.ogc.OGCGeometry.geometryType()

  @Test
  public void testPolygon() {
    OGCGeometry g = OGCGeometry
        .fromText("POLYGON((-10 -10, 10 -10, 10 10, -10 10, -10 -10), (-5 -5, -5 5, 5 5, 5 -5, -5 -5))");
    assertTrue(g.geometryType().equals("Polygon"));
    OGCPolygon p = (OGCPolygon) g;
    assertTrue(p.numInteriorRing() == 1);
    OGCLineString ls = p.exteriorRing();
    // assertTrue(ls.pointN(1).equals(OGCGeometry.fromText("POINT(10 -10)")));
    boolean b = ls
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.