SpatialOperate.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. package com.onemap.sanya.utils;
  2. import com.fasterxml.jackson.databind.ObjectMapper;
  3. import com.onemap.common.core.annotation.Excel;
  4. import com.onemap.sanya.domain.spatial.CustomXY;
  5. import java.io.IOException;
  6. import java.lang.reflect.Field;
  7. import java.text.ParseException;
  8. import java.util.ArrayList;
  9. import java.util.Arrays;
  10. import java.util.List;
  11. import java.util.stream.Collectors;
  12. import com.onemap.sanya.domain.spatial.FldInfo;
  13. import com.onemap.sanya.domain.spatial.SuperMapFreature;
  14. import com.onemap.sanya.domain.spatial.SuperMapGeo;
  15. import org.geotools.geojson.GeoJSON;
  16. import org.geotools.geometry.jts.JTS;
  17. import org.geotools.util.factory.Hints;
  18. import org.locationtech.jts.geom.*;
  19. import org.locationtech.jts.geom.Polygon;
  20. import org.locationtech.jts.geom.GeometryFactory;
  21. import org.locationtech.jts.io.WKTReader;
  22. import org.locationtech.jts.io.WKTWriter;
  23. import org.geotools.referencing.CRS;
  24. import org.opengis.referencing.crs.CRSAuthorityFactory;
  25. import org.opengis.referencing.crs.CRSFactory;
  26. import org.opengis.referencing.crs.CoordinateReferenceSystem;
  27. import org.opengis.referencing.operation.MathTransform;
  28. public class SpatialOperate {
  29. static Hints hints = new Hints();
  30. // static GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(hints);
  31. static PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
  32. // 定义一个坐标参考系统,这里使用EPSG:4326,即WGS84
  33. static final int srid = 4490;
  34. // WGS84 坐标系(EPSG:4326)
  35. private static final String WGS84 = "EPSG:4490";
  36. // 根据你的地理位置选择合适的 UTM Zone
  37. private static final String UTM_ZONE = "EPSG:32650"; //
  38. static String srid4326 = "GEOGCS[\"WGS 84\",\n" +
  39. " DATUM[\"WGS_1984\",\n" +
  40. " SPHEROID[\"WGS 84\",6378137,298.257223563,\n" +
  41. " AUTHORITY[\"EPSG\",\"7030\"]],\n" +
  42. " AUTHORITY[\"EPSG\",\"6326\"]],\n" +
  43. " PRIMEM[\"Greenwich\",0,\n" +
  44. " AUTHORITY[\"EPSG\",\"8901\"]],\n" +
  45. " UNIT[\"degree\",0.0174532925199433,\n" +
  46. " AUTHORITY[\"EPSG\",\"9122\"]],\n" +
  47. " AUTHORITY[\"EPSG\",\"4326\"]]";
  48. static String srid3857 = "PROJCS[\"WGS 84 / Pseudo-Mercator\",\n" +
  49. " GEOGCS[\"WGS 84\",\n" +
  50. " DATUM[\"WGS_1984\",\n" +
  51. " SPHEROID[\"WGS 84\",6378137,298.257223563,\n" +
  52. " AUTHORITY[\"EPSG\",\"7030\"]],\n" +
  53. " AUTHORITY[\"EPSG\",\"6326\"]],\n" +
  54. " PRIMEM[\"Greenwich\",0,\n" +
  55. " AUTHORITY[\"EPSG\",\"8901\"]],\n" +
  56. " UNIT[\"degree\",0.0174532925199433,\n" +
  57. " AUTHORITY[\"EPSG\",\"9122\"]],\n" +
  58. " AUTHORITY[\"EPSG\",\"4326\"]],\n" +
  59. " PROJECTION[\"Mercator_1SP\"],\n" +
  60. " PARAMETER[\"central_meridian\",0],\n" +
  61. " PARAMETER[\"scale_factor\",1],\n" +
  62. " PARAMETER[\"false_easting\",0],\n" +
  63. " PARAMETER[\"false_northing\",0],\n" +
  64. " UNIT[\"metre\",1,\n" +
  65. " AUTHORITY[\"EPSG\",\"9001\"]],\n" +
  66. " AXIS[\"Easting\",EAST],\n" +
  67. " AXIS[\"Northing\",NORTH],\n" +
  68. " EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],\n" +
  69. " AUTHORITY[\"EPSG\",\"3857\"]]";
  70. static String srid4490 = "GEOGCS[\"China Geodetic Coordinate System 2000\",\n" +
  71. " DATUM[\"China_2000\",\n" +
  72. " SPHEROID[\"CGCS2000\",6378137,298.257222101,\n" +
  73. " AUTHORITY[\"EPSG\",\"1024\"]],\n" +
  74. " AUTHORITY[\"EPSG\",\"1043\"]],\n" +
  75. " PRIMEM[\"Greenwich\",0,\n" +
  76. " AUTHORITY[\"EPSG\",\"8901\"]],\n" +
  77. " UNIT[\"degree\",0.0174532925199433,\n" +
  78. " AUTHORITY[\"EPSG\",\"9122\"]],\n" +
  79. " AUTHORITY[\"EPSG\",\"4490\"]]";
  80. static String srid4546 = "PROJCS[\"CGCS2000 / 3-degree Gauss-Kruger CM 111E\",\n" +
  81. " GEOGCS[\"China Geodetic Coordinate System 2000\",\n" +
  82. " DATUM[\"China_2000\",\n" +
  83. " SPHEROID[\"CGCS2000\",6378137,298.257222101,\n" +
  84. " AUTHORITY[\"EPSG\",\"1024\"]],\n" +
  85. " AUTHORITY[\"EPSG\",\"1043\"]],\n" +
  86. " PRIMEM[\"Greenwich\",0,\n" +
  87. " AUTHORITY[\"EPSG\",\"8901\"]],\n" +
  88. " UNIT[\"degree\",0.0174532925199433,\n" +
  89. " AUTHORITY[\"EPSG\",\"9122\"]],\n" +
  90. " AUTHORITY[\"EPSG\",\"4490\"]],\n" +
  91. " PROJECTION[\"Transverse_Mercator\"],\n" +
  92. " PARAMETER[\"latitude_of_origin\",0],\n" +
  93. " PARAMETER[\"central_meridian\",111],\n" +
  94. " PARAMETER[\"scale_factor\",1],\n" +
  95. " PARAMETER[\"false_easting\",500000],\n" +
  96. " PARAMETER[\"false_northing\",0],\n" +
  97. " UNIT[\"metre\",1,\n" +
  98. " AUTHORITY[\"EPSG\",\"9001\"]],\n" +
  99. " AUTHORITY[\"EPSG\",\"4546\"]]";
  100. // 创建GeometryFactory
  101. static GeometryFactory geometryFactory = new GeometryFactory(precisionModel, srid);
  102. public static Polygon createPolygonByXYArray(List<CustomXY> coors) {
  103. Polygon pPolygon = null;
  104. if (coors == null || coors.size() == 0)
  105. return pPolygon;
  106. Coordinate[] coordinates = new Coordinate[]{new Coordinate(1, 2), new Coordinate(1, 2), new Coordinate(1, 2)};
  107. pPolygon = geometryFactory.createPolygon();
  108. return pPolygon;
  109. }
  110. public static String geometry2Wkt(Geometry geometry) {
  111. String wkt = "SRID=" + srid + ";";
  112. WKTWriter wktWriter = new WKTWriter();
  113. wkt += wktWriter.write(geometry);
  114. return wkt;
  115. }
  116. public static String geometry2GeoJson(Geometry geometry) throws IOException {
  117. String wkt = "";
  118. GeoJSON.write(geometry, wkt);
  119. return wkt;
  120. }
  121. public static Point createPoint(Double x, Double y) {
  122. Point point = null;
  123. if(x == null && y == null) {
  124. return point;
  125. }
  126. point=geometryFactory.createPoint(new Coordinate(x, y));
  127. point.setSRID(srid);
  128. return point;
  129. }
  130. /**
  131. * 根据坐标点创建
  132. *
  133. * @param points
  134. * @return
  135. */
  136. public static Polygon createPolygon(List<Coordinate> points) {
  137. Polygon polygon = null;
  138. if (points == null)
  139. return polygon;
  140. Coordinate[] coordinates = points.toArray(new Coordinate[points.size()]);
  141. LinearRing ring = geometryFactory.createLinearRing(coordinates);
  142. polygon = geometryFactory.createPolygon(ring);
  143. polygon.setSRID(srid);
  144. return polygon;
  145. }
  146. /**
  147. * 为输入的 Geometry 计算 24 米缓冲区,并保持原始坐标系
  148. * @param inputGeometry 输入的几何图形(支持点、线、面等)
  149. * @param bufferMeters 缓冲(米)
  150. * @return
  151. * @throws Exception
  152. */
  153. public static Geometry bufferByMeters(Geometry inputGeometry,Double bufferMeters) throws Exception {
  154. CoordinateReferenceSystem sourceCRS = CRS.parseWKT(srid4490);
  155. // 投影转换
  156. CoordinateReferenceSystem utmCRS = CRS.parseWKT(srid4546);
  157. // 转换到 UTM 坐标系进行缓冲区计算
  158. MathTransform toUTM = CRS.findMathTransform(sourceCRS, utmCRS, true);
  159. Geometry geometryInUTM = JTS.transform(inputGeometry, toUTM);
  160. // 计算 缓冲区
  161. Geometry bufferedGeometryUTM = geometryInUTM.buffer(bufferMeters);
  162. // 转回原始坐标系
  163. MathTransform toSource = CRS.findMathTransform(utmCRS, sourceCRS, true);
  164. return JTS.transform(bufferedGeometryUTM, toSource);
  165. }
  166. /**
  167. * 经纬度转墨卡托 便于面积转换
  168. *
  169. * @param geom
  170. * @return
  171. */
  172. // public static Geometry lonlat2WebMactor(Geometry geom) {
  173. // try {
  174. // //这里是以OGC WKT形式定义的是World Mercator投影,网页地图一般使用该投影
  175. // CRSAuthorityFactory factory=CRS.getAuthorityFactory(true);
  176. // Integer wkid=geom.getSRID();
  177. // CoordinateReferenceSystem sourceTarget = factory.createCoordinateReferenceSystem("EPSG:"+4490);
  178. //
  179. //// MathTransform transform1 = CRS.findMathTransform(DefaultGeographicCRS.WGS84, sourceTarget);
  180. //// Geometry geometry1= JTS.transform(geom, transform1);
  181. // // 投影转换
  182. // CoordinateReferenceSystem crsTarget=factory.createCoordinateReferenceSystem("EPSG:"+4546);
  183. //// CoordinateReferenceSystem crsTarget = CRS.parseWKT(srid4546);
  184. //
  185. // MathTransform transform2 = CRS.findMathTransform(sourceTarget, crsTarget, false);
  186. // return JTS.transform(geom, transform2);
  187. // } catch (Exception e) {
  188. // e.printStackTrace();
  189. // return null;
  190. // }
  191. // }
  192. /**
  193. * 经纬度转墨卡托 便于面积转换
  194. *
  195. * @param geom
  196. * @return
  197. */
  198. public static Geometry lonlat2WebMactor(Geometry geom) {
  199. try {
  200. //这里是以OGC WKT形式定义的是World Mercator投影,网页地图一般使用该投影
  201. CoordinateReferenceSystem sourceTarget = CRS.parseWKT(srid4490);
  202. // MathTransform transform1 = CRS.findMathTransform(DefaultGeographicCRS.WGS84, sourceTarget);
  203. // Geometry geometry1= JTS.transform(geom, transform1);
  204. // 投影转换
  205. CoordinateReferenceSystem crsTarget = CRS.parseWKT(srid4546);
  206. MathTransform transform2 = CRS.findMathTransform(sourceTarget, crsTarget, false);
  207. return JTS.transform(geom, transform2);
  208. } catch (Exception e) {
  209. e.printStackTrace();
  210. return null;
  211. }
  212. }
  213. /**
  214. * 获取面积(平方米)
  215. *
  216. * @param geometry
  217. * @return
  218. */
  219. public static Double getGeometryArea(Geometry geometry) {
  220. if (geometry == null)
  221. return 0.00;
  222. Geometry geometry1 = lonlat2WebMactor(geometry);
  223. if (geometry1 == null)
  224. return 0.00;
  225. return geometry1.getArea();
  226. }
  227. /**
  228. * 根据wkt 生成多边形
  229. *
  230. * @param wkt
  231. * @return
  232. * @throws ParseException
  233. */
  234. public static Geometry createPolygonByWkt(String wkt) throws ParseException, org.locationtech.jts.io.ParseException {
  235. Geometry geometry=null;
  236. WKTReader reader = new WKTReader();
  237. Integer index = wkt.indexOf(";");
  238. if (index > -1)
  239. wkt = wkt.substring(index + 1);
  240. geometry=reader.read(wkt);
  241. return geometry;
  242. }
  243. /**
  244. * 根据wkt 生成多边形
  245. *
  246. * @param wkt
  247. * @return
  248. * @throws ParseException
  249. */
  250. public static Geometry createGeometryByWkt(String wkt) throws ParseException, org.locationtech.jts.io.ParseException {
  251. WKTReader reader = new WKTReader();
  252. Integer index = wkt.indexOf(";");
  253. if (index > -1)
  254. wkt = wkt.substring(index + 1);
  255. Geometry geometry = reader.read(wkt);
  256. geometry.setSRID(srid);
  257. return geometry;
  258. }
  259. public static Double getIntersectsArea(Geometry polygon1, Geometry other) {
  260. Double result=0.0;
  261. Geometry intersetGeom =null;
  262. Boolean isInster= polygon1.intersects(other);
  263. if(isInster)
  264. {
  265. try {
  266. intersetGeom = polygon1.intersection(other);
  267. }
  268. catch (Exception er){
  269. result=0.0;
  270. }
  271. }
  272. if (intersetGeom == null) {
  273. result=0.0;
  274. }
  275. else {
  276. Geometry pPolgon = lonlat2WebMactor(intersetGeom);
  277. if (pPolgon != null)
  278. result = pPolgon.getArea() / 666.66;
  279. }
  280. return result;
  281. }
  282. /**
  283. * 计算多个面交集
  284. *
  285. * @param polygons
  286. * @return
  287. */
  288. public static Double getIntersectByGeometrys(List<Geometry> polygons) {
  289. Geometry intersetGeom = null;
  290. if (polygons.size() >= 2) {
  291. for (int i = 1; i < polygons.size(); i++) {
  292. // 第一次用前两个比较
  293. if (i == 1) {
  294. intersetGeom = polygons.get(0).intersection(polygons.get(i));
  295. }
  296. // 后续用上次的结果比较
  297. else if (i == polygons.size() - 1) {
  298. intersetGeom = intersetGeom.intersection(polygons.get(i));
  299. }
  300. // 检查交集是否为空,如果为空则提前结束循环
  301. if (intersetGeom.isEmpty()) {
  302. return 0.00;
  303. }
  304. }
  305. }
  306. if (!intersetGeom.isEmpty()) {
  307. return lonlat2WebMactor(intersetGeom).getArea()/666.66;
  308. } else {
  309. return 0.00;
  310. }
  311. }
  312. public static SuperMapFreature Feature2Supermap(Object obj, Geometry geom ) throws org.locationtech.jts.io.ParseException, IllegalAccessException {
  313. SuperMapFreature res = new SuperMapFreature();
  314. Geometry geometry = geom;
  315. WKTReader reader = new WKTReader();
  316. Field[] fields = obj.getClass().getDeclaredFields();
  317. String[] fieldNames = new String[fields.length];
  318. String[] fieldValues = new String[fields.length];
  319. Integer smId = 0;
  320. for (int i = 0; i < fields.length; i++) {
  321. String fldName = fields[i].getName().toUpperCase();
  322. // if(fldName.equals("SMGEOMETRY"))
  323. // continue;
  324. fields[i].setAccessible(true);
  325. fieldNames[i] = fldName;
  326. String s = "null";
  327. if ("SMGEOMETRY".equals(fldName)) {
  328. fieldValues[i] = "";
  329. } else {
  330. fieldValues[i] = fields[i].get(obj) == null ? s : fields[i].get(obj).toString();
  331. }
  332. if (fields[i].getName().toUpperCase().equals("SMID"))
  333. smId = Integer.parseInt(fields[i].get(obj).toString());
  334. }
  335. int innerCout = 0;
  336. LinearRing outRing = null;
  337. Integer[] parts = new Integer[1];
  338. Integer[] partTop = new Integer[1];
  339. Integer partIndex = 0;
  340. List<Coordinate> allPoints = new ArrayList<>();
  341. int outPointCount = 0;
  342. LinearRing curInnerRing = null;
  343. Polygon polygon = null;
  344. if (geom.getGeometryType() == Geometry.TYPENAME_MULTIPOLYGON)
  345. polygon = (Polygon) geom.getGeometryN(0);
  346. else if (geom.getGeometryType() == Geometry.TYPENAME_POLYGON) {
  347. polygon = (Polygon) geom;
  348. }
  349. innerCout = polygon.getNumInteriorRing();
  350. outRing = polygon.getExteriorRing();
  351. parts = new Integer[innerCout + 1];
  352. partTop = new Integer[innerCout+1];
  353. outPointCount = outRing.getNumPoints();
  354. parts[0] = outPointCount - 1;
  355. partTop[0] = 1;
  356. partIndex = outPointCount - 1;
  357. for (Integer i = 1; i < innerCout; i++) {
  358. curInnerRing = polygon.getInteriorRingN(i - 1);
  359. partIndex += curInnerRing.getNumPoints();
  360. parts[i] = partIndex;
  361. partTop[i] = -1;
  362. Coordinate[] ddd= curInnerRing.getCoordinates();
  363. List<Coordinate> dddfs= Arrays.stream(ddd).collect(Collectors.toList());
  364. allPoints.addAll(dddfs);
  365. }
  366. allPoints.addAll(Arrays.stream(outRing.getCoordinates()).collect(Collectors.toList()));
  367. SuperMapGeo superMapGeo = new SuperMapGeo();
  368. superMapGeo.setCenter(new Coordinate(geom.getCentroid().getX(), geom.getCentroid().getY()));
  369. superMapGeo.setId(smId);
  370. superMapGeo.setParts(parts);
  371. superMapGeo.setPoints(allPoints);
  372. superMapGeo.setType("REGION");
  373. superMapGeo.setPartTopo(partTop);
  374. res.setFieldNames(fieldNames);
  375. res.setFieldValues(fieldValues);
  376. res.setGeometry(superMapGeo);
  377. res.setID(smId);
  378. return res;
  379. }
  380. /**
  381. * 根据类生成字段列表
  382. *
  383. * @param object
  384. * @return
  385. */
  386. public static List<FldInfo> getFieldAnnotation(Object object) {
  387. Field[] fields = object.getClass().getDeclaredFields();
  388. List<FldInfo> fldInfos = new ArrayList<>();
  389. for (Field field : fields) {
  390. // 是否引用ApiModelProperty注解
  391. String name = field.getName();
  392. String typeName = field.getType().getName();
  393. boolean bool = field.isAnnotationPresent(Excel.class);
  394. String cnName = "";
  395. if (bool) {
  396. cnName = field.getAnnotation(Excel.class).name();
  397. // fldInfos.add(new FldInfo(value);
  398. System.out.print(cnName);
  399. }
  400. if (cnName == null || cnName.isEmpty())
  401. cnName = name;
  402. fldInfos.add(new FldInfo(name.toUpperCase(), cnName.toUpperCase(), typeName.toUpperCase()));
  403. }
  404. return fldInfos;
  405. }
  406. /**
  407. * 根据类生成字段列表
  408. *
  409. * @param object
  410. * @return
  411. */
  412. public static List<FldInfo> getFieldAnnotationJZDJ(Object object) {
  413. Field[] fields = object.getClass().getDeclaredFields();
  414. List<FldInfo> fldInfos = new ArrayList<>();
  415. for (Field field : fields) {
  416. // 是否引用ApiModelProperty注解
  417. String name = field.getName();
  418. String typeName = field.getType().getName();
  419. boolean bool = field.isAnnotationPresent(Excel.class);
  420. String cnName = "";
  421. if (bool) {
  422. cnName = field.getAnnotation(Excel.class).name();
  423. // fldInfos.add(new FldInfo(value);
  424. System.out.print(cnName);
  425. }
  426. if (cnName == null || cnName.isEmpty())
  427. cnName = name;
  428. fldInfos.add(new FldInfo(name, cnName, typeName));
  429. }
  430. return fldInfos;
  431. }
  432. //
  433. // private GeometryFactory geometryFactory = new GeometryFactory();
  434. // /**
  435. // * 根据wkt生成点
  436. // *
  437. // * @param wkt
  438. // * @return
  439. // * @throws ParseException
  440. // */
  441. // public Point creatPoint(String wkt) throws ParseException {
  442. // WKTReader wktReader = new WKTReader();
  443. // Point point = null;
  444. // if (wkt != null)
  445. // point = (Point) wktReader.read(wkt);
  446. // return point;
  447. // }
  448. //
  449. // /**
  450. // * 根据wkt生成线
  451. // *
  452. // * @param wkt
  453. // * @return
  454. // * @throws ParseException
  455. // */
  456. // public LineString creatPolyline(String wkt) throws ParseException {
  457. // WKTReader wktReader = new WKTReader();
  458. // LineString polyline = null;
  459. // if (wkt != null)
  460. // polyline = (LineString) wktReader.read(wkt);
  461. // return polyline;
  462. // }
  463. //
  464. // /**
  465. // * wkt生产面
  466. // *
  467. // * @param wkt
  468. // * @return
  469. // * @throws ParseException
  470. // */
  471. // public Polygon creatPolygon(String wkt) throws ParseException {
  472. // WKTReader wktReader = new WKTReader();
  473. // Polygon polygon = null;
  474. // if (wkt != null)
  475. // polygon = (Polygon) wktReader.read(wkt);
  476. // return polygon;
  477. // }
  478. //
  479. // /**
  480. // * 获取面积
  481. // * @param wkt
  482. // * @return
  483. // * @throws ParseException
  484. // */
  485. // public Double getArea(String wkt) throws ParseException {
  486. // WKTReader wktReader = new WKTReader();
  487. // Polygon polygon = null;
  488. // if (wkt != null)
  489. // polygon = (Polygon) wktReader.read(wkt);
  490. // return polygon.getArea();
  491. // }
  492. //
  493. //
  494. // /**
  495. // * 根据坐标创建点
  496. // * @param x
  497. // * @param y
  498. // * @return
  499. // */
  500. // public Geometry createPointXY(Double x,Double y)
  501. // {
  502. // Geometry geometry=null;
  503. // Coordinate coord = new Coordinate(x,y);
  504. // Point point = geometryFactory.createPoint( coord );
  505. // return point;
  506. // }
  507. //
  508. // /**
  509. // * 获取2个实体的的相交面积
  510. // * @param one
  511. // * @param other
  512. // * @return
  513. // */
  514. // public Double getInsertion(Geometry one,Geometry other)
  515. // {
  516. // if(one==null||other==null)
  517. // return 0.00;
  518. // Geometry geometry= one.intersection(other);
  519. // if(geometry==null)
  520. // return 0.00;
  521. // return geometry.getArea();
  522. // }
  523. }