Repository navigation
Conversation
| geometry = JTSUtils.repairInvalidPolygon(geometry); | ||
| if (!geometry.isValid()) { | ||
| LOGGER.warning("load(), invalid geometry even after attempt to fix " + way.getId()); | ||
| return null; |
There was a problem hiding this comment.
@menion If the repaired geometry is still not valid, why return null and not throw an exception like above?
There was a problem hiding this comment.
You are correct. I've modified the change so it mimics the geometry==null style. Thanks.
| } else { | ||
| ret = tileAsGeometry.intersection(geometry); | ||
| } | ||
| ret = tileBBJTS.intersection(geometry); |
There was a problem hiding this comment.
@menion The rendering problem seems to be caused here:
-
Declare
retlike before and the rendering seems to work correctly. -
Also, why remove the repair section if geometry is not valid?
if (!geometry.isValid()) {
// this should stop the problem of non-noded intersections that trigger an error when
// clipping
LOGGER.warning("invalid geometry prior to tile clipping, trying to repair " + way.getId());
geometry = JTSUtils.repairInvalidPolygon(geometry);
if (!geometry.isValid()) {
LOGGER.warning("invalid geometry even after attempt to fix " + way.getId());
}
}
ret = tileAsGeometry.intersection(geometry);|
@menion As a general note, please avoid changing the formatting of the code, new lines, etc. |
|
PR needs more testing, just as the second one. I'm closing it for now and will reopen once all is properly tested and verified on my side. Thanks. And "general note" > I'm trying, really 😊. I'm usually reverting many changes made automatically. Will be more careful next time. This old Java 😱 code simply needs some major automatic refactoring ... |
|
Probably the most needed improvement in map writer is the reduction of RAM usage. So we can use in more maps the fast |
|
Fully agree. I just miss a few things to look at it more ...
|
I prefer not to introduce a new language into the project. 🙂 It will make maintenance difficult and fewer developers will understand and contribute to the code. |
|
I expected you will write it. For me (and I believe that for many other Java/Kotlin devs), it works the opposite. Writing in Java is pure pain these days, and I try to avoid it at all costs. This is anyway too offtopic. I'll try to look at two problematic PR next week and give you more info. |
|
I merged it via 4bb9457 with the above restore of previous code for same rendering. Thanks again for the contribution! 👍 |


Based on my attempt to speed up map generation, here are two improvements. It has a significant effect when generating over "RAM" tile cache. When using HDD, this does not have significant effect, as cliping itself consume most of time.
Again, this is used in our production generator for a few months and no negative effect detected. In the case of RAM generation, we reduced time by approx 30%!
Major changes:
Geometryrepresentation of a tile is now calculated once and reused for all ways within that tile, speed up and reducing redundant calculations.clipToTilemethod now accepts a pre-calculated tileGeometryinstead of aTileCoordinateand enlargement factor, simplifying the call site.clipToTileif the geometry is already fully contained within the tile's envelope, avoiding unnecessary intersection calculations.StringBuilderfor preferred languages: Improved string concatenation performance when constructing the preferred languages string.