本文整理汇总了Java中com.esri.core.geometry.ogc.OGCGeometry.setSpatialReference方法的典型用法代码示例。如果您正苦于以下问题:Java OGCGeometry.setSpatialReference方法的具体用法?Java OGCGeometry.setSpatialReference怎么用?Java OGCGeometry.setSpatialReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.core.geometry.ogc.OGCGeometry
的用法示例。
在下文中一共展示了OGCGeometry.setSpatialReference方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(Text wkwrap) throws UDFArgumentException {
String wkt = wkwrap.toString();
try {
OGCGeometry ogcObj = OGCGeometry.fromText(wkt);
ogcObj.setSpatialReference(null);
if (ogcObj.geometryType().equals("MultiLineString")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_MULTILINESTRING, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LogUtils.Log_InvalidText(LOG, wkt);
return null;
}
}
示例2: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(Text wkwrap) throws UDFArgumentException {
String wkt = wkwrap.toString();
try {
OGCGeometry ogcObj = OGCGeometry.fromText(wkt);
ogcObj.setSpatialReference(null);
if (ogcObj.geometryType().equals("MultiPoint")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_MULTIPOINT, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LogUtils.Log_InvalidText(LOG, wkt);
return null;
}
}
示例3: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(BytesWritable wkb, int wkid) throws UDFArgumentException {
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
byte [] byteArr = wkb.getBytes();
ByteBuffer byteBuf = ByteBuffer.allocate(byteArr.length);
byteBuf.put(byteArr);
OGCGeometry ogcObj = OGCGeometry.fromBinary(byteBuf);
ogcObj.setSpatialReference(spatialReference);
String gType = ogcObj.geometryType();
if (gType.equals("MultiLineString") || gType.equals("LineString")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_MULTILINESTRING, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LOG.error(e.getMessage());
return null;
}
}
示例4: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(Text wkwrap, int wkid) throws UDFArgumentException {
String wkt = wkwrap.toString();
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
OGCGeometry ogcObj = OGCGeometry.fromText(wkt);
ogcObj.setSpatialReference(spatialReference);
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} catch (Exception e) { // IllegalArgumentException, GeometryException
LogUtils.Log_InvalidText(LOG, wkt);
return null;
}
}
示例5: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(Text wkwrap) throws UDFArgumentException {
String wkt = wkwrap.toString();
try {
OGCGeometry ogcObj = OGCGeometry.fromText(wkt);
ogcObj.setSpatialReference(null);
if (ogcObj.geometryType().equals("Point")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_POINT, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LogUtils.Log_InvalidText(LOG, wkt);
return null;
}
}
示例6: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(Text wkwrap) throws UDFArgumentException {
String wkt = wkwrap.toString();
try {
OGCGeometry ogcObj = OGCGeometry.fromText(wkt);
ogcObj.setSpatialReference(null);
if (ogcObj.geometryType().equals("MultiPolygon")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_MULTIPOLYGON, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LogUtils.Log_InvalidText(LOG, wkt);
return null;
}
}
示例7: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(BytesWritable wkb, int wkid) throws UDFArgumentException {
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
byte [] byteArr = wkb.getBytes();
ByteBuffer byteBuf = ByteBuffer.allocate(byteArr.length);
byteBuf.put(byteArr);
OGCGeometry ogcObj = OGCGeometry.fromBinary(byteBuf);
ogcObj.setSpatialReference(spatialReference);
if (ogcObj.geometryType().equals("LineString")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LOG.error(e.getMessage());
return null;
}
}
示例8: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(Text wkwrap) throws UDFArgumentException {
String wkt = wkwrap.toString();
try {
OGCGeometry ogcObj = OGCGeometry.fromText(wkt);
ogcObj.setSpatialReference(null);
if (ogcObj.geometryType().equals("LineString")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LogUtils.Log_InvalidText(LOG, wkt);
return null;
}
}
示例9: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(BytesWritable wkb, int wkid) throws UDFArgumentException {
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
byte [] byteArr = wkb.getBytes();
ByteBuffer byteBuf = ByteBuffer.allocate(byteArr.length);
byteBuf.put(byteArr);
OGCGeometry ogcObj = OGCGeometry.fromBinary(byteBuf);
ogcObj.setSpatialReference(spatialReference);
String gType = ogcObj.geometryType();
if (gType.equals("MultiPolygon") || gType.equals("Polygon")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_MULTIPOLYGON, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LOG.error(e.getMessage());
return null;
}
}
示例10: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(BytesWritable wkb, int wkid) throws UDFArgumentException {
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
byte [] byteArr = wkb.getBytes();
ByteBuffer byteBuf = ByteBuffer.allocate(byteArr.length);
byteBuf.put(byteArr);
OGCGeometry ogcObj = OGCGeometry.fromBinary(byteBuf);
ogcObj.setSpatialReference(spatialReference);
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} catch (Exception e) { // IllegalArgumentException, GeometryException
LOG.error(e.getMessage());
return null;
}
}
示例11: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(Text wkwrap) throws UDFArgumentException {
String wkt = wkwrap.toString();
try {
OGCGeometry ogcObj = OGCGeometry.fromText(wkt);
ogcObj.setSpatialReference(null);
if (ogcObj.geometryType().equals("Polygon")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_POLYGON, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LogUtils.Log_InvalidText(LOG, wkt);
return null;
}
}
示例12: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(BytesWritable wkb, int wkid) throws UDFArgumentException {
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
byte [] byteArr = wkb.getBytes();
ByteBuffer byteBuf = ByteBuffer.allocate(byteArr.length);
byteBuf.put(byteArr);
OGCGeometry ogcObj = OGCGeometry.fromBinary(byteBuf);
ogcObj.setSpatialReference(spatialReference);
if (ogcObj.geometryType().equals("Polygon")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_POLYGON, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LOG.error(e.getMessage());
return null;
}
}
示例13: evaluate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public BytesWritable evaluate(BytesWritable wkb, int wkid) throws UDFArgumentException {
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
byte [] byteArr = wkb.getBytes();
ByteBuffer byteBuf = ByteBuffer.allocate(byteArr.length);
byteBuf.put(byteArr);
OGCGeometry ogcObj = OGCGeometry.fromBinary(byteBuf);
ogcObj.setSpatialReference(spatialReference);
if (ogcObj.geometryType().equals("Point")) {
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} else {
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_POINT, GeometryUtils.OGCType.UNKNOWN);
return null;
}
} catch (Exception e) { // IllegalArgumentException, GeometryException
LOG.error(e.getMessage());
return null;
}
}
示例14: testIsectTria3
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
@Test
public void testIsectTria3() {
String wkt = "polygon((1 0, 3 0, 1 2, 1 0))";
String wk2 = "polygon((2 2, 2 1, 3 1, 2 2))";
OGCGeometry g0 = OGCGeometry.fromText(wkt);
OGCGeometry g1 = OGCGeometry.fromText(wk2);
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();
}
示例15: iterate
import com.esri.core.geometry.ogc.OGCGeometry; //导入方法依赖的package包/类
public boolean iterate(BytesWritable geomref) throws HiveException {
if (geomref == null) {
LogUtils.Log_ArgumentsNull(LOG);
return false;
}
if (firstWKID == -2) {
firstWKID = GeometryUtils.getWKID(geomref);
if (firstWKID != GeometryUtils.WKID_UNKNOWN) {
spatialRef = SpatialReference.create(firstWKID);
}
} else if (firstWKID != GeometryUtils.getWKID(geomref)) {
LogUtils.Log_SRIDMismatch(LOG, geomref, firstWKID);
return false;
}
try {
OGCGeometry rowGeom = GeometryUtils.geometryFromEsriShape(geomref);
rowGeom.setSpatialReference(spatialRef);
if (isectGeom == null)
isectGeom = rowGeom;
else
isectGeom = isectGeom.intersection(rowGeom);
return true;
} catch (Exception e) {
LogUtils.Log_InternalError(LOG, "ST_Aggr_Intersection: " + e);
return false;
}
}