com.vividsolutions.jts.geom.Geometry.isWithinDistance()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中com.vividsolutions.jts.geom.Geometry.isWithinDistance()方法的一些代码示例,展示了Geometry.isWithinDistance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.isWithinDistance()方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Geometry
类名称:Geometry
方法名:isWithinDistance

Geometry.isWithinDistance介绍

[英]Tests whether the distance from this Geometry to another is less than or equal to a specified value.
[中]测试此Geometry到另一个Geometry的距离是否小于或等于指定值。

代码示例

代码示例来源:origin: org.geotools/gt2-main

static public boolean isWithinDistance(Geometry arg0,Geometry arg1,double arg2)
{
   Geometry _this = arg0;
   return _this.isWithinDistance(arg1,arg2);
}

代码示例来源:origin: org.geotools/gt-main

static public boolean isWithinDistance(Geometry arg0,Geometry arg1, Double arg2)
{
   if (arg0 == null || arg1 == null || arg2 == null) return false;
   Geometry _this = arg0;
   return _this.isWithinDistance(arg1,arg2);
}

代码示例来源:origin: org.n52.epos/epos-pattern-util

/**
 * @param geom first geometry
 * @param g second geometry
 * @param distance the distance
 * @return <code>true</code> if the first geometry is beyond a given distance to the second (!withinDistance)
 */
public static boolean beyond(Geometry geom, Geometry g, double distance) {
  if  (geom == null || g == null) return false;
  return !geom.isWithinDistance(g, distance);
}

代码示例来源:origin: org.n52.epos/epos-pattern-util

/**
 * @param geom first geometry
 * @param g second geometry
 * @param distance distance
 * @return <code>true</code> if the first geometry is within a given distance of the second
 */
public static boolean distanceWithin(Geometry geom, Geometry g, double distance) {
  if  (geom == null || g == null) return false;
  return geom.isWithinDistance(g, distance);
}

代码示例来源:origin: org.geotools/gt-render

public boolean isWithinDistance(Geometry geom, double distance) {
  return geometry.isWithinDistance(geom, distance);
}

代码示例来源:origin: org.orbisgis/h2gis

/**
   * Returns true if the geometries are within the specified distance of one another.
   *
   * @param geomA Geometry A
   * @param geomB Geometry B
   * @param distance Distance
   * @return True if if the geometries are within the specified distance of one another
   */
  public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) {
    if(geomA == null||geomB == null){
      return null;
    }
    return geomA.isWithinDistance(geomB, distance);
  }
}

代码示例来源:origin: org.orbisgis/h2gis-functions

/**
   * Returns true if the geometries are within the specified distance of one another.
   *
   * @param geomA Geometry A
   * @param geomB Geometry B
   * @param distance Distance
   * @return True if if the geometries are within the specified distance of one another
   */
  public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) {
    if(geomA == null||geomB == null){
      return null;
    }
    return geomA.isWithinDistance(geomB, distance);
  }
}

代码示例来源:origin: org.geotools/gt-main

@Override
public boolean evaluateInternal(Geometry left, Geometry right) {
  if( left==null || right == null ){
    return false;
  }
  return !left.isWithinDistance(right, getDistance());
}

代码示例来源:origin: org.geotools/gt-main

@Override
  public boolean evaluateInternal(Geometry left, Geometry right) {
  return left.isWithinDistance(right, getDistance());
}

代码示例来源:origin: deegree/deegree3

@Override
public boolean isWithinDistance( Geometry geometry, Measure distance ) {
  LOG.warn( "TODO: Respect UOM in evaluation of topological predicate." );
  JTSGeometryPair jtsGeoms = JTSGeometryPair.createCompatiblePair( this, geometry );
  return jtsGeoms.first.isWithinDistance( jtsGeoms.second, distance.getValueAsDouble() );
}

代码示例来源:origin: org.geotools/gt2-main

public boolean evaluate(Object feature) {
  
  Geometry left = getLeftGeometry(feature);
  Geometry right = getRightGeometry(feature);
  
  return !left.isWithinDistance(right, getDistance());
}

代码示例来源:origin: stackoverflow.com

public boolean pointIsClose( File file, Point targetPoint,double distance) {

 boolean ret = false;
 Map connect = new HashMap();
 connect.put("url", file.toURL());
 DataStore dataStore = DataStoreFinder.getDataStore(connect);

 FeatureSource featureSource = dataStore.getFeatureSource(typeName);
 FeatureCollection collection = featureSource.getFeatures();
 FeatureIterator iterator = collection.features();


 try {
  while (iterator.hasNext()) {
   Feature feature = iterator.next();
   Geometry sourceGeometry = feature.getDefaultGeometry();
   ret= sourceGeometry.isWithinDistance(targetPoint, distance );
  }
 } finally {
  iterator.close();
 }
 return ret;
}

代码示例来源:origin: org.geotools/gt2-main

public boolean evaluate(Object feature) {
  if (feature instanceof Feature && !validate((Feature)feature))
    return false;
  
  Geometry left = getLeftGeometry(feature);
  Geometry right = getRightGeometry(feature);
  
  return left.isWithinDistance(right, getDistance());
}

相关文章