You can use the polygon, just give it points with the same latitude and longitude, but with different marks:
ArrayList<Position> pathPositions = new ArrayList<Position>(); pathPositions.add(Position.fromDegrees(28, -106, 3e4)); pathPositions.add(Position.fromDegrees(28, -106, 3e0)); pathPositions.add(Position.fromDegrees(35, -107, 9e0)); pathPositions.add(Position.fromDegrees(35, -107, 9e4)); pathPositions.add(Position.fromDegrees(28, -106, 3e4)); Polygon pgon = new Polygon(pathPositions);
source share