GeoTools
  1. GeoTools
  2. GEOT-2804

Make sure more labels show up in polygon maps

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.6.1
    • Component/s: render
    • Labels:
      None

      Description

      There are obvious missing label in the map.

      1. comuni2.png
        34 kB
      2. Picture 2.png
        84 kB

        Issue Links

          Activity

          Hide
          Andrea Aime added a comment -
          This is due to two issues:
          - goodness of fit: the polygon at the bottom and the polygon at top are too thin compared to the label so they don't get drawn. We should use a smaller default goodness of fit and make it programmable modifiable, which is something someone else also asked for
          - the renderer does not try to place the label in a position other than the default label point. We could have it to move the label around
          Show
          Andrea Aime added a comment - This is due to two issues: - goodness of fit: the polygon at the bottom and the polygon at top are too thin compared to the label so they don't get drawn. We should use a smaller default goodness of fit and make it programmable modifiable, which is something someone else also asked for - the renderer does not try to place the label in a position other than the default label point. We could have it to move the label around
          Hide
          Andrea Aime added a comment -
          The comuni2.png has been generated using the improved polygon labeller.

          Changes:
          - the default min goodness of fit has been reduced to 0.5
          - if the centroid falls outside an horizontal line is drawn through it and the center of the widest intersection with the polygon is used instead
          - if maxDisplacement is used and the centroid is busy with other labels a different position is searched that is no more than maxDisplacement pixels away from the original, and still inside the polygon

          The comuni2.png map has been drawn with the following extra parameters:

          {code}
                      <VendorOption name="maxDisplacement">50</VendorOption>
                      <VendorOption name="goodnessOfFit">0.2</VendorOption>
                      <VendorOption name="autoWrap">100</VendorOption>
          {code}

          Silvia, let me know if this is what you were looking for.
          Show
          Andrea Aime added a comment - The comuni2.png has been generated using the improved polygon labeller. Changes: - the default min goodness of fit has been reduced to 0.5 - if the centroid falls outside an horizontal line is drawn through it and the center of the widest intersection with the polygon is used instead - if maxDisplacement is used and the centroid is busy with other labels a different position is searched that is no more than maxDisplacement pixels away from the original, and still inside the polygon The comuni2.png map has been drawn with the following extra parameters: {code}             <VendorOption name="maxDisplacement">50</VendorOption>             <VendorOption name="goodnessOfFit">0.2</VendorOption>             <VendorOption name="autoWrap">100</VendorOption> {code} Silvia, let me know if this is what you were looking for.
          Hide
          Andrea Aime added a comment -
          (hopefully) fixed on 2.6.x and trunk
          Show
          Andrea Aime added a comment - (hopefully) fixed on 2.6.x and trunk
          Hide
          Andrea Aime added a comment -
          The position of the candidate label point still leaves quite a bit to be desired, especially in maps like this one where the polygons are anything but convex.
          GEOT-2822 lays down ideas for a better labelling algorithm (which is, not surprising, not trivial to implement)
          Show
          Andrea Aime added a comment - The position of the candidate label point still leaves quite a bit to be desired, especially in maps like this one where the polygons are anything but convex. GEOT-2822 lays down ideas for a better labelling algorithm (which is, not surprising, not trivial to implement)
          Hide
          Andrea Aime added a comment -
          Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update
          Show
          Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

            People

            • Assignee:
              Andrea Aime
              Reporter:
              Silvia Franceschi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: