-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid placement #3847
Grid placement #3847
Conversation
ad2522c
to
1adebaa
Compare
Codecov Report
@@ Coverage Diff @@
## master #3847 +/- ##
==========================================
+ Coverage 68.48% 68.56% +0.07%
==========================================
Files 441 442 +1
Lines 23037 23150 +113
==========================================
+ Hits 15777 15872 +95
- Misses 7260 7278 +18
Continue to review full report at Codecov.
|
great concept 💯 |
As I wrote recently, I'm interested in this feature very much, but without package deployment on OSMF servers, osm-carto is not able to use this in practice. Do you plan to port it to v3.0.x branch or maybe release v3.1.0 any time soon? |
@kocio-pl - Yes, I do plan to make a port to v3.0.x, but haven't had time yet. |
Grid placement
Introduces new placements
grid
andalternating-grid
for labeling polygons with density controlled bygrid-cell-width
andgrid-cell-height
parameters.Every single placement of the grid is individual subject of collision resolution. In order not to waste best placements inside a polygon, the grid is iterated from polygon's interior in a spiral, to occupy best places first.
Here are some use cases:
Text in regular grid
Text in alternating grid
Shields in a grid
Grid reduced by negative offset to the polygon
Finding single placement inside a polygon
Since grid can iterate many possible placements, it can be helpful as a single placement finder thanks to
repeat-distance
parameter.The interior placement is occupied by another label but grid placement can generate possible placements around:
repeat-distance
set to a large value will leave only the first grid placement visible:Insert area to the collision detector
cc @kocio-pl