Class Geometry
java.lang.Object
org.openstreetmap.josm.data.imagery.vectortile.mapbox.Geometry
A class to generate geometry for a vector tile
- Since:
- 17862
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static doublecalculateSurveyorsArea(int[] xArray, int[] yArray) This is also known as the "shoelace formula".Get the shapes to draw this geometry withprivate voidinitializePoints(GeometryTypes geometryType, List<CommandInteger> commands) Initialize point geometryprivate voidinitializeWayGeometry(GeometryTypes geometryType, List<CommandInteger> commands) Initialize way geometry
-
Field Details
-
shapes
-
-
Constructor Details
-
Geometry
- Parameters:
geometryType- The type of geometrycommands- The commands used to create the geometry- Throws:
IllegalArgumentException- if arguments are not understood or if the shoelace formula returns 0 for a polygon ring.
-
-
Method Details
-
initializePoints
Initialize point geometry- Parameters:
geometryType- The geometry type (used for logging)commands- The commands to use to create the geometry
-
initializeWayGeometry
Initialize way geometry- Parameters:
geometryType- The geometry typecommands- The commands to use to create the geometry
-
calculateSurveyorsArea
This is also known as the "shoelace formula".- Parameters:
xArray- The array of x coordinatesyArray- 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
-