Fix printing circles#49
Conversation
|
ping @gberaudo or @ger-benjamin :) Sorry I can't ask for reviews |
Co-authored-by: Stéphane Brunner <stephane.brunner@camptocamp.com>
|
hello, any updates? :) |
ger-benjamin
left a comment
There was a problem hiding this comment.
Sorry, I don't really have time for that currently :-/
It looks fine to me, but is it fine to NOT do anymore (was line 171):
feature = this.featureCircleAsPolygon(feature as Feature<Circle>);
And after that, still doing ?:
const origGeojsonFeature = this.geojsonFormat.writeFeatureObject(feature);
Also featureCircleAsPolygon is now unused, I think e can remove it (but it's protected, that means, that's a breaking change to remove it)
|
@ger-benjamin Fixed what you've mentioned and added a test for what was happening on geogirafe. Let me know if anything is missing or unclear |
|
|
||
| const featureGeometry = feature.getGeometry(); | ||
| if (featureGeometry.getType() === "Circle") { | ||
| feature.setGeometry(fromCircle(featureGeometry as Circle, Constants.CIRCLE_TO_POLYGON_SIDES)); |
There was a problem hiding this comment.
It would be surprising for a user to have its features modified after calling this library. That is why it is necessary to clone the feature.
|
@maltaesousa , thanks for your contribution. I will do the changes and merge. |
This PR fixes an issue where a Circle was converted to a FeatureCollection and not printed at all.
You can reproduce the bug here:
These modifications allow to keep the original style of the circle and just convert the geometry