Closed robo-w closed 2 years ago
Thanks for the comments. Sure the documentation must be improved. Feel free to contribute. About reusing the CoordinateOperation object checks this class https://github.com/orbisgis/h2gis/blob/master/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_Transform.java
1 - Would be nice to give an example of CoordinateOperation re-use in chapter 4 of the wiki. 2 - Cache implementation as in ST_Transform could be done in CoordinateOperationFactory, but I think it is fine to let the user implement it the way he wants.
A conversion of coordinates following the example in https://github.com/orbisgis/cts/wiki/4.-Apply-a-coordinate-transformation leads to a memory leak of
org.cts.IdentifiableComponent#registry
.If multiple coordinate conversions with the same source and target CRS are generated, the
org.cts.op.CoordinateOperation
is generated again, although the matching operations already exist. This leads to a growing HashMap.Options for a fix:
CoordinateOperation
objects must be re-used from one to another run of the conversionExample: Convert multiple coordinates from British National Grid (EPSG:27700) to GPS (EPSG:4326). After each run with the code from the example, following operations are added:![image](https://user-images.githubusercontent.com/18316389/62289188-5a837180-b45e-11e9-877a-b6957279d6c9.png)
Especially the operations like "degree to radian" would be nice if they are re-used, if they have the same parameters.