Class AreaOfInterest


  • public final class AreaOfInterest
    extends java.lang.Object
    Represents an area on the map which is of particular interest for some reason. It consists of polygon geojson and a method for displaying the area the geometry intersects with.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AreaOfInterest.AoiDisplay
      Represents the ways that the area of interest (aoi) can be rendered on the map.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String area
      A Geojson geometry (can be string or GeoJson) that indicates the area of interest.
      AreaOfInterest.AoiDisplay display
      The way that the Area of Interest will be represented on the map.
      java.lang.Boolean renderAsSvg
      If true the Area of Interest will be rendered as SVG (if display == RENDER).
      java.lang.String style
      A string representing the style.
    • Constructor Summary

      Constructors 
      Constructor Description
      AreaOfInterest()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.geotools.data.simple.SimpleFeatureCollection areaToFeatureCollection​(MapAttribute.MapAttributeValues mapAttributes)
      Return the area polygon as the only feature in the feature collection.
      AreaOfInterest copy()
      Make a copy of this Area of Interest.
      org.locationtech.jts.geom.Geometry getArea()
      Get the area polygon.
      void postConstruct()
      Tests that the area is valid geojson, the style ref is valid or null and the display is non-null.
      void setPolygon​(org.locationtech.jts.geom.Geometry polygon)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • area

        public java.lang.String area
        A Geojson geometry (can be string or GeoJson) that indicates the area of interest.

        The geojson must be a polygon representing the area of interest.

      • display

        public AreaOfInterest.AoiDisplay display
        The way that the Area of Interest will be represented on the map. By default it will be drawn as a polygon with a solid border and a translucent interior. The style can be controlled by the style parameter.
      • style

        public java.lang.String style
        A string representing the style. The StyleParserPlugins are used to load the style. Because of this the styleRef can be JSON, SLD, URL, file path, etc...
      • renderAsSvg

        public java.lang.Boolean renderAsSvg
        If true the Area of Interest will be rendered as SVG (if display == RENDER).

        (will default to Configuration.defaultStyle).

    • Constructor Detail

      • AreaOfInterest

        public AreaOfInterest()
    • Method Detail

      • postConstruct

        public void postConstruct()
        Tests that the area is valid geojson, the style ref is valid or null and the display is non-null.
      • getArea

        public org.locationtech.jts.geom.Geometry getArea()
        Get the area polygon. It will parse the polygon string representation in the polygon field.
      • areaToFeatureCollection

        public org.geotools.data.simple.SimpleFeatureCollection areaToFeatureCollection​(@Nonnull
                                                                                        MapAttribute.MapAttributeValues mapAttributes)
        Return the area polygon as the only feature in the feature collection.
        Parameters:
        mapAttributes - the attributes that this aoi is part of.
      • setPolygon

        public void setPolygon​(org.locationtech.jts.geom.Geometry polygon)
      • copy

        public AreaOfInterest copy()
        Make a copy of this Area of Interest.