/**
   * Write streetlight objects in dsf file.
   *
   * @param osmPolygon osm road polygon
   */
  public void writeStreetLightToDsf(OsmPolygon osmPolygon) {
    // init d'un entier pour modulo densité street lights
    Integer densityIndex = 0;
    if (XplaneOptionsHelper.getOptions().getLightsDensity() == 0) {
      densityIndex = 10;
    } else {
      if (XplaneOptionsHelper.getOptions().getLightsDensity() == 1) {
        densityIndex = 5;
      } else {
        if (XplaneOptionsHelper.getOptions().getLightsDensity() == 2) densityIndex = 3;
      }
    }
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < osmPolygon.getPolygon().getVertices().size(); i++) {
      if ((i % densityIndex) == 0) {
        Point2D lightLoc = osmPolygon.getPolygon().getVertex(i);
        lightLoc.x = lightLoc.x + 0.0001;
        lightLoc.y = lightLoc.y + 0.0001;
        if (GeomUtils.compareCoordinates(lightLoc, currentTile)) {
          Random randomGenerator = new Random();
          int orientation = randomGenerator.nextInt(360);
          sb.append(
              "OBJECT "
                  + dsfObjectsProvider.getRandomStreetLightObject()
                  + " "
                  + (lightLoc.y)
                  + " "
                  + (lightLoc.x)
                  + " "
                  + orientation);
          sb.append(System.getProperty("line.separator"));
          // stats
          StatsHelper.addStreetLight(stats);
        }
      }
    }

    writer.write(sb.toString());
  }