Class StraightSkeletonDivision

java.lang.Object
fr.ign.artiscales.pm.division.Division
fr.ign.artiscales.pm.division.StraightSkeletonDivision

public class StraightSkeletonDivision extends Division
Re-implementation of block decomposition into parcels from :

Vanegas, C. A., Kelly, T., Weber, B., Halatsch, J., Aliaga, D. G., Müller, P., May 2012. Procedural generation of parcels in urban modeling. Comp. Graph. Forum 31 (2pt3).

Decomposition method by using straight skeleton

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static File
     
    static File
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    StraightSkeletonDivision​(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, boolean generatePeripheralRoad, double widthRoad, String name)
    Constructor decomposing initial polygon with straight skeleton process until beta-stripes with normal precision
    StraightSkeletonDivision​(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, int numberOfDigits, boolean generatePeripheralRoad, double widthRoad, String name)
    Constructor decomposing initial polygon with straight skeleton process until beta-stripes.
    StraightSkeletonDivision​(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, String name)
    Constructor decomposing initial polygon with straight skeleton process until beta-stripes with normal precision and without peripheral road.
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<org.locationtech.jts.geom.MultiLineString>
    dividePeripheralRoadInParts​(org.locationtech.jts.geom.LinearRing lr)
    Divide a peripheral road into multiple parts.
    org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Polygon,​org.geotools.data.simple.SimpleFeatureCollection>
    generatePeripheralRoad​(org.locationtech.jts.geom.Polygon p, double roadWidth)
    Creates a road around the parcel. reduce the parcel polygon and add the newly created road to the road collection
    static boolean
     
    static boolean
     
    static org.geotools.data.simple.SimpleFeatureCollection
    runTopologicalStraightSkeletonParcelDecomposition​(org.geotools.data.simple.SimpleFeatureCollection sfcParcelIn, File roadFile, String NAME_ATT_ROAD, String NAME_ATT_IMPORTANCE, double maxDepth, double maxDistanceForNearestRoad, double minimalArea, double minWidth, double maxWidth, double omega, org.apache.commons.math3.random.RandomGenerator rng, double streetWidth, String name)
     
    static org.geotools.data.simple.SimpleFeatureCollection
    runTopologicalStraightSkeletonParcelDecomposition​(org.geotools.data.simple.SimpleFeatureCollection sfcParcelIn, org.geotools.data.simple.SimpleFeatureCollection roads, String NAME_ATT_ROAD, String NAME_ATT_IMPORTANCE, double maxDepth, double maxDistanceForNearestRoad, double minimalArea, double minWidth, double maxWidth, double omega, org.apache.commons.math3.random.RandomGenerator rng, double streetWidth, String name)
    Run Straight Skeleton on marked parcels
    static org.geotools.data.simple.SimpleFeatureCollection
    runTopologicalStraightSkeletonParcelDecomposition​(org.opengis.feature.simple.SimpleFeature feat, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, double minimalArea, double minWidth, double maxWidth, double omega, org.apache.commons.math3.random.RandomGenerator rng, double widthRoad, String name)
    Class to run an automatic Straight Skeleton application on a set of parcels
    static void
    setGeneratePeripheralRoad​(boolean generatePeripheralRoad)
     
    static void
    setSAVEINTERMEDIATERESULT​(boolean SAVEINTERMEDIATERES)
     
    org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Polygon,​org.locationtech.jts.geom.Polygon>
    splitPolygon​(org.locationtech.jts.geom.Polygon poly, org.locationtech.jts.geom.Coordinate origin, org.locationtech.jts.geom.Coordinate projection)
     
    org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Polygon,​org.locationtech.jts.geom.Polygon>
    splitPolygon​(org.locationtech.jts.geom.Polygon poly, org.locationtech.jts.geom.LineString line)
     

    Methods inherited from class fr.ign.artiscales.pm.division.Division

    isDEBUG, setDEBUG

    Methods inherited from class java.lang.Object

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

    • FOLDER_OUT_DEBUG

      public static File FOLDER_OUT_DEBUG
    • FOLDER_PARTICULAR_DEBUG

      public static File FOLDER_PARTICULAR_DEBUG
  • Constructor Details

    • StraightSkeletonDivision

      public StraightSkeletonDivision(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, String name) throws fr.ign.artiscales.pm.division.StraightSkeletonException, fr.ign.artiscales.pm.division.EdgeException
      Constructor decomposing initial polygon with straight skeleton process until beta-stripes with normal precision and without peripheral road.
      Parameters:
      p - initial polygon to divide
      roads - road features. Must have mandatory attributes with values.
      roadNameAttribute - Mandatory attribute setting the name of a street
      roadImportanceAttribute - Mandatory attribute setting the importance of a street
      maxDepth - Maximal distance from the frontage of a parcel to its back boundary. If equals to 0, this algorithm will create a regular straight skeleton division. If different than 0, will create an offset division.
      maxDistanceForNearestRoad - Distance from which the road will be considered as close enough to be considered by the algorithm
      name - name of the created zone
      Throws:
      fr.ign.artiscales.pm.division.StraightSkeletonException - if straight skeleton has problems to be generated
      fr.ign.artiscales.pm.division.EdgeException - if edges have problems (mainly due to precision and not normal order)
    • StraightSkeletonDivision

      public StraightSkeletonDivision(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, boolean generatePeripheralRoad, double widthRoad, String name) throws fr.ign.artiscales.pm.division.StraightSkeletonException, fr.ign.artiscales.pm.division.EdgeException
      Constructor decomposing initial polygon with straight skeleton process until beta-stripes with normal precision
      Parameters:
      p - initial polygon to divide
      roads - road features. Must have mandatory attributes with values.
      roadNameAttribute - Mandatory attribute setting the name of a street
      roadImportanceAttribute - Mandatory attribute setting the importance of a street
      maxDepth - Maximal distance from the frontage of a parcel to its back boundary. If equals to 0, this algorithm will create a regular straight skeleton division. If different than 0, will create an offset division.
      maxDistanceForNearestRoad - Distance from which the road will be considered as close enough to be considered by the algorithm
      generatePeripheralRoad - if true, a peripheral road is created around the initial polygon
      widthRoad - width of the created peripheral road
      name - name of the created zone
      Throws:
      fr.ign.artiscales.pm.division.StraightSkeletonException - if straight skeleton has problems to be generated
      fr.ign.artiscales.pm.division.EdgeException - if edges have problems (mainly due to precision and not normal order)
    • StraightSkeletonDivision

      public StraightSkeletonDivision(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, int numberOfDigits, boolean generatePeripheralRoad, double widthRoad, String name) throws fr.ign.artiscales.pm.division.StraightSkeletonException, fr.ign.artiscales.pm.division.EdgeException
      Constructor decomposing initial polygon with straight skeleton process until beta-stripes.
      Parameters:
      p - initial polygon to divide
      roads - road features. Must have mandatory attributes with values.
      roadNameAttribute - Mandatory attribute setting the name of a street
      roadImportanceAttribute - Mandatory attribute setting the importance of a street
      maxDepth - Maximal distance from the frontage of a parcel to its back boundary. If equals to 0, this algorithm will create a regular straight skeleton division. If different than 0, will create an offset division.
      maxDistanceForNearestRoad - Distance from which the road will be considered as close enough to be considered by the algorithm
      generatePeripheralRoad - if true, a peripheral road is created around the initial polygon
      widthRoad - width of the created peripheral road
      name - name of the created zone
      numberOfDigits - which precision are made the topological simplifications.
      Throws:
      fr.ign.artiscales.pm.division.StraightSkeletonException - if straight skeleton has problems to be generated
      fr.ign.artiscales.pm.division.EdgeException - if edges have problems (mainly due to precision and not normal order)
  • Method Details

    • runTopologicalStraightSkeletonParcelDecomposition

      public static org.geotools.data.simple.SimpleFeatureCollection runTopologicalStraightSkeletonParcelDecomposition(org.geotools.data.simple.SimpleFeatureCollection sfcParcelIn, File roadFile, String NAME_ATT_ROAD, String NAME_ATT_IMPORTANCE, double maxDepth, double maxDistanceForNearestRoad, double minimalArea, double minWidth, double maxWidth, double omega, org.apache.commons.math3.random.RandomGenerator rng, double streetWidth, String name) throws IOException
      Throws:
      IOException
    • runTopologicalStraightSkeletonParcelDecomposition

      public static org.geotools.data.simple.SimpleFeatureCollection runTopologicalStraightSkeletonParcelDecomposition(org.geotools.data.simple.SimpleFeatureCollection sfcParcelIn, org.geotools.data.simple.SimpleFeatureCollection roads, String NAME_ATT_ROAD, String NAME_ATT_IMPORTANCE, double maxDepth, double maxDistanceForNearestRoad, double minimalArea, double minWidth, double maxWidth, double omega, org.apache.commons.math3.random.RandomGenerator rng, double streetWidth, String name)
      Run Straight Skeleton on marked parcels
    • dividePeripheralRoadInParts

      public static List<org.locationtech.jts.geom.MultiLineString> dividePeripheralRoadInParts(org.locationtech.jts.geom.LinearRing lr)
      Divide a peripheral road into multiple parts. Will create a new segment if the road angle is too important (less than 2/3 pi) and have a certain length.
      Parameters:
      lr - peripheral road
      Returns:
      list of road segments
    • runTopologicalStraightSkeletonParcelDecomposition

      public static org.geotools.data.simple.SimpleFeatureCollection runTopologicalStraightSkeletonParcelDecomposition(org.opengis.feature.simple.SimpleFeature feat, org.geotools.data.simple.SimpleFeatureCollection roads, String roadNameAttribute, String roadImportanceAttribute, double maxDepth, double maxDistanceForNearestRoad, double minimalArea, double minWidth, double maxWidth, double omega, org.apache.commons.math3.random.RandomGenerator rng, double widthRoad, String name)
      Class to run an automatic Straight Skeleton application on a set of parcels
    • isSAVEINTERMEDIATERESULT

      public static boolean isSAVEINTERMEDIATERESULT()
    • setSAVEINTERMEDIATERESULT

      public static void setSAVEINTERMEDIATERESULT(boolean SAVEINTERMEDIATERES)
    • isGeneratePeripheralRoad

      public static boolean isGeneratePeripheralRoad()
    • setGeneratePeripheralRoad

      public static void setGeneratePeripheralRoad(boolean generatePeripheralRoad)
    • splitPolygon

      public org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Polygon,​org.locationtech.jts.geom.Polygon> splitPolygon(org.locationtech.jts.geom.Polygon poly, org.locationtech.jts.geom.Coordinate origin, org.locationtech.jts.geom.Coordinate projection)
    • splitPolygon

      public org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Polygon,​org.locationtech.jts.geom.Polygon> splitPolygon(org.locationtech.jts.geom.Polygon poly, org.locationtech.jts.geom.LineString line)
    • generatePeripheralRoad

      public org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Polygon,​org.geotools.data.simple.SimpleFeatureCollection> generatePeripheralRoad(org.locationtech.jts.geom.Polygon p, double roadWidth)
      Creates a road around the parcel. reduce the parcel polygon and add the newly created road to the road collection
      Parameters:
      p - initial polygon shape
      roadWidth - width of the road to create
      Returns:
      A pair with the new input polygon to its right and the new road feature collection ti its left TODO remove peripheral road when they touch existing road