こんにちは、私はこのチュートリアルhttp://googledevelopers.blogspot.com/2014/12/building-scalable-geofencing-api-on.htmlに従っています。これが私の問題です。
ポイントとして JTS(Java Topology Suite) STR ツリーに追加した経度と緯度の座標のリストがあります。
ここで、円の形をしたエリアを STR ツリーに送信して、円に収まるすべてのポイントを見つけたいと思います。
Coordinate center = new Coordinate(entity.getLongitude(), entity.getLatitude());
GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(center);
gsf.setNumPoints(20);
**gsf.setSize(320.0);**
Polygon poly = gsf.createCircle();
Coordinate[] coordinates = poly.getCoordinates();
//Create polygon from the coordinates.
GeometryFactory fact = new GeometryFactory();
LinearRing linear_ring = new GeometryFactory().createLinearRing(coordinates);
Polygon polygon = new Polygon(linear_ring, null, fact);
List<STRLeaf> items = strTree.query(polygon.getEnvelopeInternal());
ただし、検索の結果は、経度と緯度のポイントのツリー内のすべてのデータを返します。円のサイズを 320 未満にすると、STR ツリーの検索結果が得られません。誰もがこれを経験したことがありますか? 理想的には、7 マイル以内の円内のすべてのポイントを見つける円を作成したいと思います。
御時間ありがとうございます