本文整理汇总了Java中com.esri.core.geometry.SpatialReference.equals方法的典型用法代码示例。如果您正苦于以下问题:Java SpatialReference.equals方法的具体用法?Java SpatialReference.equals怎么用?Java SpatialReference.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.core.geometry.SpatialReference
的用法示例。
在下文中一共展示了SpatialReference.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GetDistAsString
import com.esri.core.geometry.SpatialReference; //导入方法依赖的package包/类
private String GetDistAsString(Graphic g, SpatialReference inputSr, String units)
{
com.esri.core.geometry.Geometry geo = g.getGeometry();
com.esri.core.geometry.Geometry curGeo;
if(!inputSr.equals(srBuffer))
{
curGeo = GeometryEngine.project(geo, inputSr, srBuffer);
}
else
{
curGeo=geo;
}
double tmpDist = GeometryEngine.distance(inGeometry, curGeo, srBuffer);
UnitConverter uc = new UnitConverter();
int inUnitWkid = uc.findWkid(srBuffer.getUnit().getName());
String cn = uc.findConnonicalName(units);
int outUnitWkid = uc.findWkid(cn);
double dist;
if(inUnitWkid!=outUnitWkid)
{
dist = uc.Convert(tmpDist, inUnitWkid, outUnitWkid);
}
else
{
dist=tmpDist;
}
DecimalFormat df = new DecimalFormat("#.00");
return df.format(dist);
}
示例2: GetDistAsString
import com.esri.core.geometry.SpatialReference; //导入方法依赖的package包/类
private String GetDistAsString(Map<String, Object> objGeo, SpatialReference inputSr, String units) throws JsonParseException, IOException
{
Geometry geo = generateGeoFromMap(objGeo);
com.esri.core.geometry.Geometry curGeo;
if(!inputSr.equals(srBuffer))
{
curGeo = GeometryEngine.project(geo, inputSr, srBuffer);
}
else
{
curGeo=geo;
}
double tmpDist = GeometryEngine.distance(inGeometry, curGeo, srBuffer);
UnitConverter uc = new UnitConverter();
int inUnitWkid = uc.findWkid(srBuffer.getUnit().getName());
String cn = uc.findConnonicalName(units);
int outUnitWkid = uc.findWkid(cn);
double dist;
if(inUnitWkid!=outUnitWkid)
{
dist = uc.Convert(tmpDist, inUnitWkid, outUnitWkid);
}
else
{
dist=tmpDist;
}
DecimalFormat df = new DecimalFormat("#.00");
return df.format(dist);
}