Tag: 空间空间

条件SpatialRestrictions.IsWithinDistance NHibernate.Spatial

有没有人实现这一点,或知道是否会很难实现这个/有任何指针? public static SpatialRelationCriterion IsWithinDistance(string propertyName, object anotherGeometry, double distance) { // TODO: Implement throw new NotImplementedException(); } 从NHibernate.Spatial.Criterion.SpatialRestrictions 我可以在hql中使用“where NHSP.Distance(PROPERTY,:point)”。 但是想要将这个查询与我现有的Criteria查询结合起来。 目前我正在创build一个粗糙的多边形,并使用 criteria.Add(SpatialRestrictions.Intersects("PROPERTY", myPolygon)); 编辑有一个通过重载SpatialRelationCriterion构造函数,添加新的SpatialRelation.Distance的原型工作 public static SpatialRelationCriterion IsWithinDistance(string propertyName, object anotherGeometry, double distance) { return new SpatialRelationCriterion(propertyName, SpatialRelation.Distance, anotherGeometry, distance); } 向SpatialRelationCriterion添加了一个新字段 private readonly double? distance; public SpatialRelationCriterion(string propertyName, SpatialRelation relation, object anotherGeometry, […]