@Test
  public void testGeomFromPolygonShape() throws UDFArgumentException {
    Polygon polygon = createPolygon();
    byte[] esriShape = GeometryEngine.geometryToEsriShape(polygon);
    assertNotNull("The shape must not be null!", esriShape);

    BytesWritable shapeAsWritable = new BytesWritable(esriShape);
    assertNotNull("The shape writable must not be null!", shapeAsWritable);

    final int wkid = 4326;
    ST_GeomFromShape fromShape = new ST_GeomFromShape();
    BytesWritable geometryAsWritable = fromShape.evaluate(shapeAsWritable, wkid);
    assertNotNull("The geometry writable must not be null!", geometryAsWritable);

    OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geometryAsWritable);
    assertNotNull("The OGC geometry must not be null!", ogcGeometry);

    Geometry esriGeometry = ogcGeometry.getEsriGeometry();
    assertNotNull("The Esri geometry must not be null!", esriGeometry);
    assertTrue("The geometries are different!",
        GeometryEngine.equals(polygon, esriGeometry, SpatialReference.create(wkid)));
  }
Validates the geometry writable.

@param point
           the represented point location.
@param wkid
           the represented spatial reference ID.
@param geometryAsWritable
           the geometry represented as {@link BytesWritable}.
ql/src/test/org/apache/hadoop/hive/ql/udf/esri/TestStGeomFromShape.java