本文整理汇总了Java中com.esri.core.geometry.ogc.OGCGeometry.symDifference方法的典型用法代码示例。如果您正苦于以下问题:Java OGCGeometry.symDifference方法的具体用法?Java OGCGeometry.symDifference怎么用?Java OGCGeometry.symDifference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.core.geometry.ogc.OGCGeometry
的用法示例。
在下文中一共展示了OGCGeometry.symDifference方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(BytesWritable geometryref1, BytesWritable geometryref2)
{
if (geometryref1 == null || geometryref2 == null ||
geometryref1.getLength() == 0 || geometryref2.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
if (!GeometryUtils.compareSpatialReferences(geometryref1, geometryref2)) {
LogUtils.Log_SRIDMismatch(LOG, geometryref1, geometryref2);
return null;
}
OGCGeometry ogcGeom1 = GeometryUtils.geometryFromEsriShape(geometryref1);
OGCGeometry ogcGeom2 = GeometryUtils.geometryFromEsriShape(geometryref2);
if (ogcGeom1 == null || ogcGeom2 == null){
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
try {
OGCGeometry diffGeometry = ogcGeom1.symDifference(ogcGeom2);
return GeometryUtils.geometryToEsriShapeBytesWritable(diffGeometry);
} catch (Exception e) {
LogUtils.Log_InternalError(LOG, "ST_SymmetricDiff: " + e);
return null;
}
}
示例2: testPointSymDif
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
@Test
public void testPointSymDif() {
OGCGeometry g1 = OGCGeometry.fromText("POINT(1 2)");
OGCGeometry g2 = OGCGeometry.fromText("POINT(3 4)");
OGCGeometry gg = g1.symDifference(g2);
assertTrue(gg.equals(OGCGeometry.fromText("MULTIPOINT(1 2, 3 4)")));
OGCGeometry g3 = OGCGeometry.fromText("POINT(1 2)");
OGCGeometry gg1 = g1.symDifference(g3);
assertTrue(gg1 == null || gg1.isEmpty());
}