OK,已经解决了,在Datasetvector.query里设置空间查询参数SpatialQueryMode就行了
GeoPoint search_point = new GeoPoint(longitude, latitude); DatasetVector xian_vec=this._workspace.Datasources["四川省_县"].Datasets["四川省_县"] as DatasetVector; QueryParameter query_param = new QueryParameter(); query_param.SpatialQueryMode=SpatialQueryMode.Within; query_param.SpatialQueryObject=search_point; Recordset search_result=xian_vec.Query(query_param); if (search_result.RecordCount > 0 && this._mapControl.Map.Layers.Count>0) { this._mapControl.Map.Layers["四川省_县@四川省_县#1"].Selection.FromRecordset(search_result); } query_param.Dispose(); search_result.Dispose();
非常感谢