Uploaded image for project: 'GeoServer'
  1. GEOS-7885

Geometric functions seem to work in pixels rather then coordinates

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.12.2
    • Component/s: None
    • Labels:
      None

      Description

      Context: having a polygon dataset, I wanted to show smaller polygons (<1m2) different
      from the rest of the polygons (actually I want them to show these as an icon instead of a polygon).

      I thought to use the 'area' function which according to
      the function reference documentation would give:

      "The area of the specified geometry. Works in a Cartesian plane, the
      result will be in the same unit of measure as the geometry coordinates
      (which also means the results won’t make any sense for geographic data)"

      But what I observe here is that it returns the size in pixels, while
      data is in meters. Having a style where polygons <10m2 should be rendered as points, ALL polygons will finally be rendered with the point -style when you zoom out enough..

      Another test: when you create a label for the polygons containing the result of the 'area'-function you see the 'area' change with every zoom level change...

      Though I can imagine that the area in pixels is helpfull too (like when you want to hide polygons which are smaller then a certain value), in my case I want to use the real (static) geometric area.

      By the way I think all Geometric functions work on the rendering polygons rather then on the geometric polygons?

      In the mailing list thread (https://sourceforge.net/p/geoserver/mailman/message/35522965/) Andrea already mentiones that calculating the area in the labeling phase will be more difficult then calculating it (just before) rendering the geo.

      Thanks for looking into this.

      Attached a sld rule with the used function (and an example to use it in a label, though that has been used solely for testing)

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                aaime Andrea Aime
                Reporter:
                rduivenvoorde Richard Duivenvoorde
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: