我正在使用 GOOGLE S2 库来创建地理围栏。
我已经使用纬度和经度创建矩形作为java中的坐标,但我无法创建 polygon 使用纬度和经度坐标。
请你帮我解决一下。
这是java中矩形地理围栏的代码:
Double lo_latDegrees = 51.6934844;
Double lo_lngDegrees = -63.568821;
//12.960045, 77.640189
Double hi_latDegrees = 51.844379;
Double hi_lngDegrees = -63.169301;
System.out.println("creating a rectangle");
S2LatLngRect s2latlongRect = new
S2LatLngRect(S2LatLng.fromDegrees(lo_latDegrees, lo_lngDegrees),
S2LatLng.fromDegrees(hi_latDegrees, hi_lngDegrees));
对于多边形,我尝试过类似的东西:
private static final String RECTANGLE1 = "10:11, 11:11, 12:11,
12:10, 11:10, 10:10;";
S2Polygon region = Utilities.makePolygon(RECTANGLE1);
System.out.println("creating region");
帮助我。
提前致谢!!!!!