java.lang.Object
org.openstreetmap.josm.data.imagery.vectortile.mapbox.Geometry

public class Geometry extends Object
A class to generate geometry for a vector tile
Since:
17862
  • Field Details

  • Constructor Details

  • Method Details

    • initializePoints

      private void initializePoints(GeometryTypes geometryType, List<CommandInteger> commands)
      Initialize point geometry
      Parameters:
      geometryType - The geometry type (used for logging)
      commands - The commands to use to create the geometry
    • initializeWayGeometry

      private void initializeWayGeometry(GeometryTypes geometryType, List<CommandInteger> commands)
      Initialize way geometry
      Parameters:
      geometryType - The geometry type
      commands - The commands to use to create the geometry
    • calculateSurveyorsArea

      static double calculateSurveyorsArea(int[] xArray, int[] yArray)
      This is also known as the "shoelace formula".
      Parameters:
      xArray - The array of x coordinates
      yArray - The array of y coordinates
      Returns:
      The area of the object
      Throws:
      IllegalArgumentException - if the array lengths are not equal
    • getShapes

      Get the shapes to draw this geometry with
      Returns:
      A collection of shapes