Package fr.ign.artiscales.pm.division
Class StraightSkeletonDivision
java.lang.Object
fr.ign.artiscales.pm.division.Division
fr.ign.artiscales.pm.division.StraightSkeletonDivision
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 -
Constructor Summary
ConstructorsConstructorDescriptionStraightSkeletonDivision(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 precisionStraightSkeletonDivision(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 TypeMethodDescriptionstatic 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 collectionstatic booleanstatic booleanstatic org.geotools.data.simple.SimpleFeatureCollectionrunTopologicalStraightSkeletonParcelDecomposition(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.SimpleFeatureCollectionrunTopologicalStraightSkeletonParcelDecomposition(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 parcelsstatic org.geotools.data.simple.SimpleFeatureCollectionrunTopologicalStraightSkeletonParcelDecomposition(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 parcelsstatic voidsetGeneratePeripheralRoad(boolean generatePeripheralRoad)static voidsetSAVEINTERMEDIATERESULT(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)
-
Field Details
-
FOLDER_OUT_DEBUG
-
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.EdgeExceptionConstructor decomposing initial polygon with straight skeleton process until beta-stripes with normal precision and without peripheral road.- Parameters:
p- initial polygon to divideroads- road features. Must have mandatory attributes with values.roadNameAttribute- Mandatory attribute setting the name of a streetroadImportanceAttribute- Mandatory attribute setting the importance of a streetmaxDepth- 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 algorithmname- name of the created zone- Throws:
fr.ign.artiscales.pm.division.StraightSkeletonException- if straight skeleton has problems to be generatedfr.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.EdgeExceptionConstructor decomposing initial polygon with straight skeleton process until beta-stripes with normal precision- Parameters:
p- initial polygon to divideroads- road features. Must have mandatory attributes with values.roadNameAttribute- Mandatory attribute setting the name of a streetroadImportanceAttribute- Mandatory attribute setting the importance of a streetmaxDepth- 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 algorithmgeneratePeripheralRoad- if true, a peripheral road is created around the initial polygonwidthRoad- width of the created peripheral roadname- name of the created zone- Throws:
fr.ign.artiscales.pm.division.StraightSkeletonException- if straight skeleton has problems to be generatedfr.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.EdgeExceptionConstructor decomposing initial polygon with straight skeleton process until beta-stripes.- Parameters:
p- initial polygon to divideroads- road features. Must have mandatory attributes with values.roadNameAttribute- Mandatory attribute setting the name of a streetroadImportanceAttribute- Mandatory attribute setting the importance of a streetmaxDepth- 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 algorithmgeneratePeripheralRoad- if true, a peripheral road is created around the initial polygonwidthRoad- width of the created peripheral roadname- name of the created zonenumberOfDigits- which precision are made the topological simplifications.- Throws:
fr.ign.artiscales.pm.division.StraightSkeletonException- if straight skeleton has problems to be generatedfr.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 shaperoadWidth- 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
-