Class PMStep

java.lang.Object
fr.ign.artiscales.pm.scenario.PMStep

public class PMStep extends Object
Object representing each step of a Parcel Manager scenario. This object is automatically set by the PMScenario object.
See Also:
scenarioCreation.md
  • Constructor Details

    • PMStep

      public PMStep(String workflow, String parcelProcess, String genericZone, String preciseZone, String communityNumber, String communityType, String urbanFabricType, String selection, boolean peripheralRoad, boolean keepExistingRoad, boolean adaptUrbanFabric)
  • Method Details

    • getOUTFOLDER

      public static File getOUTFOLDER()
    • setOUTFOLDER

      public static void setOUTFOLDER(File OUTFOLDER)
    • 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 scenario
      zoningFile - geofiles containing zoning plan for the whole scenario
      buildingFile - geofiles containing buildings for the whole scenario
      roadFile - geofiles containing roads for the whole scenario
      predicateFile - 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 null
      outFolder - folder where every result are written.
      profileFolder - folder containing parameter rules
    • setParcel

      public static void setParcel(File parcelFile)
      Put a parcel plan different from the on originally set
      Parameters:
      parcelFile - new geo file containing parcel plan
    • getPOLYGONINTERSECTION

      public static File getPOLYGONINTERSECTION()
      Get the intersection polygon geographic file.
      Returns:
      POLYGONINTERSECTION
    • setPOLYGONINTERSECTION

      public static void setPOLYGONINTERSECTION(File pOLYGONINTERSECTION)
      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

      public static File getPROFILEFOLDER()
    • isPeripheralRoad

      public boolean isPeripheralRoad()
      Are we generating peripheral road around zones to be reshaped in the StraightSkeletonDivision process ?
      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 the StraightSkeletonDivision process ?
    • isAdaptAreaOfUrbanFabric

      public boolean isAdaptAreaOfUrbanFabric()
    • setAdaptAreaOfUrbanFabric

      public void setAdaptAreaOfUrbanFabric(boolean newAdaptAreaOfUrbanFabric)
    • getUrbanFabricType

      public String getUrbanFabricType()
      Returns:
      the name of the urbanFabricType used by this current step.
    • execute

      public File execute() throws IOException
      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 IOException
      Select 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 the ParcelGetter class. Then it marks the interesting parcels that either cross a given polygon collection, intersects a zoning type, or any other variable defined in the selection field. It returns every parcels selected. Split field name in "SPLIT" by default and can be changed with the method MarkParcelAttributeFromPosition.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

      public List<org.locationtech.jts.geom.Geometry> getBoundsOfZone() throws IOException
      Generate the bound of the parcels that are simulated by the current PMStep. Uses the marked parcels by the getSimulationParcels(SimpleFeatureCollection) method.
      Returns:
      A list of the geometries of the simulated parcels
      Throws:
      IOException - reading geo files
    • getZoneStudied

      public String getZoneStudied()
      Get a string describing the studied zone
      Returns:
      the description
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLastOutput

      public File 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 for ZoneDivision workflow 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 for ZoneDivision workflow 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

      public File makeFileName()
      creates a name for a geo file to be written
      Returns:
      every parameter is parsed into the returned string