Package fr.ign.artiscales.pm.scenario
Class PMStep
java.lang.Object
fr.ign.artiscales.pm.scenario.PMStep
Object representing each step of a Parcel Manager scenario. This object is automatically set by the PMScenario object.
- See Also:
- scenarioCreation.md
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()Execute the current PM Step.static voidEmpty the cache of zones that have already been simulatedList<org.locationtech.jts.geom.Geometry>Generate the bound of the parcels that are simulated by the current PMStep.The last generated parcel plan file.static Filestatic FileGet the intersection polygon geographic file.static Fileorg.geotools.data.simple.SimpleFeatureCollectiongetSimulationParcels(org.geotools.data.simple.SimpleFeatureCollection parcelIn)Select and mark the parcels that must be simulated within a collection of parcels.Get a string describing the studied zonebooleanstatic booleanQuestion if the flag division process allows the creation of porch or flag parcels isolated from the kown road network.booleanIt is possible forZoneDivisionworkflow to either work on the integrality of the concerned zone or to keep the parts where parcel doesn't exist and left it as a public space (road in most cases).booleanAre we generating peripheral road around zones to be reshaped in theStraightSkeletonDivisionprocess ?creates a name for a geo file to be writtenvoidsetAdaptAreaOfUrbanFabric(boolean newAdaptAreaOfUrbanFabric)static voidsetAllowIsolatedParcel(boolean allowIsolatedParcel)Set if the flag division process allows the creation of porch or flag parcels isolated from the kown road network.static voidsetFiles(File parcelFile, File zoningFile, File buildingFile, File roadFile, File predicateFile, File polygonIntersection, File zone, File outFolder, File profileFolder)Set the path of the different files for a PMStep to be executed.voidsetKeepExistingRoad(boolean keepExistingRoad)It is possible forZoneDivisionworkflow to either work on the integrality of the concerned zone or to keep the parts where parcel doesn't exist and left it as a public space (road in most cases).static voidsetOUTFOLDER(File OUTFOLDER)static voidPut a parcel plan different from the on originally setvoidsetPeripheralRoad(boolean newPeripheralRoad)static voidsetPOLYGONINTERSECTION(File pOLYGONINTERSECTION)Set the intersection polygon geographic file.toString()
-
Constructor Details
-
PMStep
-
-
Method Details
-
getOUTFOLDER
-
setOUTFOLDER
-
setFiles
public static void setFiles(File parcelFile, File zoningFile, File buildingFile, File roadFile, File predicateFile, File polygonIntersection, File zone, File outFolder, File profileFolder)Set the path of the different files for a PMStep to be executed. The method is used by PMScenario in a static way because it has no reasons to change within a PM simulation, except for the parcel file that must be updated after each PMStep to make the new PMStep simulation on an already simulated parcel plan.- Parameters:
parcelFile- geofiles containing parcel plan for the whole scenariozoningFile- geofiles containing zoning plan for the whole scenariobuildingFile- geofiles containing buildings for the whole scenarioroadFile- geofiles containing roads for the whole scenariopredicateFile- particular urban rules which could be applied on specific processes. Can be null.polygonIntersection- polygons used for parcel selection. Can be null.zone- specific zones to simulate the reshaping as a whole. Can ben nulloutFolder- folder where every result are written.profileFolder- folder containing parameter rules
-
setParcel
Put a parcel plan different from the on originally set- Parameters:
parcelFile- new geo file containing parcel plan
-
getPOLYGONINTERSECTION
Get the intersection polygon geographic file.- Returns:
- POLYGONINTERSECTION
-
setPOLYGONINTERSECTION
Set the intersection polygon geographic file.- Parameters:
pOLYGONINTERSECTION- new geo file containing intersection
-
isAllowIsolatedParcel
public static boolean isAllowIsolatedParcel()Question if the flag division process allows the creation of porch or flag parcels isolated from the kown road network.- Returns:
- Is the simulation of new parcels isolated from the road allowed ?
-
setAllowIsolatedParcel
public static void setAllowIsolatedParcel(boolean allowIsolatedParcel)Set if the flag division process allows the creation of porch or flag parcels isolated from the kown road network.- Parameters:
allowIsolatedParcel- Can we simulate new parcels isolated from the road ?
-
flushCachePlacesSimulates
public static void flushCachePlacesSimulates()Empty the cache of zones that have already been simulated -
getPROFILEFOLDER
-
isPeripheralRoad
public boolean isPeripheralRoad()Are we generating peripheral road around zones to be reshaped in theStraightSkeletonDivisionprocess ?- Returns:
- true if we do the generation
-
setPeripheralRoad
public void setPeripheralRoad(boolean newPeripheralRoad)- Parameters:
newPeripheralRoad- Do we need to generate peripheral road around zones to be reshaped in theStraightSkeletonDivisionprocess ?
-
isAdaptAreaOfUrbanFabric
public boolean isAdaptAreaOfUrbanFabric() -
setAdaptAreaOfUrbanFabric
public void setAdaptAreaOfUrbanFabric(boolean newAdaptAreaOfUrbanFabric) -
getUrbanFabricType
- Returns:
- the name of the urbanFabricType used by this current step.
-
execute
Execute the current PM Step.- Returns:
- The geo file containing the whole parcels of the given collection, where the simulated parcel have replaced the former parcels.
- Throws:
IOException- tons of reading and writing
-
getSimulationParcels
public org.geotools.data.simple.SimpleFeatureCollection getSimulationParcels(org.geotools.data.simple.SimpleFeatureCollection parcelIn) throws IOExceptionSelect and mark the parcels that must be simulated within a collection of parcels. It first selects the parcel of the zone studied, whether by a city code or by a zone type. The fields can be set with the setters of theParcelGetterclass. Then it marks the interesting parcels that either cross a given polygon collection, intersects a zoning type, or any other variable defined in theselectionfield. It returns every parcels selected. Split field name in "SPLIT" by default and can be changed with the methodMarkParcelAttributeFromPosition.setMarkFieldName(String). If none of this information are set, the algorithm selects all parcels and mark nothing.- Parameters:
parcelIn- total input parcel- Returns:
- The parcel collection with a mark for the interesting parcels to simulate.
- Throws:
IOException- reading a lot of files
-
getBoundsOfZone
Generate the bound of the parcels that are simulated by the current PMStep. Uses the marked parcels by thegetSimulationParcels(SimpleFeatureCollection)method.- Returns:
- A list of the geometries of the simulated parcels
- Throws:
IOException- reading geo files
-
getZoneStudied
Get a string describing the studied zone- Returns:
- the description
-
toString
-
getLastOutput
The last generated parcel plan file. Could be useful for programs to get it directly- Returns:
- lastOutput
-
isKeepExistingRoad
public boolean isKeepExistingRoad()It is possible forZoneDivisionworkflow to either work on the integrality of the concerned zone or to keep the parts where parcel doesn't exist and left it as a public space (road in most cases).- Returns:
- Are we keeping already existing road on ZoneDivision processes?
-
setKeepExistingRoad
public void setKeepExistingRoad(boolean keepExistingRoad)It is possible forZoneDivisionworkflow to either work on the integrality of the concerned zone or to keep the parts where parcel doesn't exist and left it as a public space (road in most cases).- Parameters:
keepExistingRoad- Do we need to keep already existing road on ZoneDivision processes?
-
makeFileName
creates a name for a geo file to be written- Returns:
- every parameter is parsed into the returned string
-