Class MarkParcelAttributeFromPosition

java.lang.Object
fr.ign.artiscales.pm.parcelFunction.MarkParcelAttributeFromPosition

public class MarkParcelAttributeFromPosition extends Object
Static methods to mark parcel collections relatively to many other geographic elements, parcel attributes or geometries or other sets of parcels. Doesn't change the input SimpleFeatureCollection structure but add a marking field. This field's name is SPLIT by default and can be changed.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    countMarkedParcels​(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)
    Count how many parcels of a set are marked.
    static String
    Get the name of the field containing the parcel's mark
    static org.geotools.data.simple.SimpleFeatureCollection
    getNotMarkedParcels​(org.geotools.data.simple.SimpleFeatureCollection in)
    Return a SimpleFeatureCollection containing only the not marked parcels on their markFieldName field.
    static org.geotools.data.simple.SimpleFeatureCollection
    getOnlyMarkedParcels​(org.geotools.data.simple.SimpleFeatureCollection in)
    Return a SimpleFeatureCollection containing only the marked parcels on their markFieldName field.
    static int
    isAlreadyMarked​(org.opengis.feature.simple.SimpleFeature feat)
    look if a parcel has the markFieldName field and if it is positive or negative.
    static boolean
    isNoParcelMarked​(org.geotools.data.simple.SimpleFeatureCollection sfcIn)
    return true if the SimpleFeatureCollection has no parcels where the markFieldName value equals 1.
    static boolean
    Marking parcels is made before (false) or after (true) the simulation process.
    static org.geotools.data.simple.SimpleFeatureCollection
    markAllParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels)
    Mark every SimpleFeature form a SimpleFeatureCollection on a new markFieldName field with a 1 (true).
    static org.geotools.data.simple.SimpleFeatureCollection
    markAlreadyMarkedParcels​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection parcelsMarked)
    Mark parcels that have already been marked on another simple collection feature.
    static org.geotools.data.simple.SimpleFeatureCollection
    markBuiltParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile)
    Mark the built parcels.
    static org.geotools.data.simple.SimpleFeatureCollection
    markBuiltParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection building)
    Mark the built parcels.
    static org.opengis.feature.simple.SimpleFeature
    markParcel​(org.opengis.feature.simple.SimpleFeature parcel)
    Mark a parcel's feat with value 1, either if they contain a markField attribute or not.
    static org.opengis.feature.simple.SimpleFeature
    markParcel​(org.opengis.feature.simple.SimpleFeature parcel, int value)
    Mark a parcel's feat, either if they contain a markField attribute or not.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectFrenchConstructibleZoningType​(org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile)
    Mark parcels that intersects that are usually constructible for French regulation
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectFrenchConstructibleZoningType​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection zoning)
    Mark parcels that intersects that are usually constructible for French regulation
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectGenericZoningType​(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile)
    Mark parcels that intersects a certain type of generic zone.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectGenericZoningType​(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)
    Mark parcels that intersects a certain type of generic zone.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectPolygonIntersection​(org.geotools.data.simple.SimpleFeatureCollection parcels, File polygonIntersectionFile)
    Mark parcels that intersects a given collection of polygons.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectPolygonIntersection​(org.geotools.data.simple.SimpleFeatureCollection parcels, List<org.locationtech.jts.geom.Geometry> geoms)
    Mark parcels that intersects a given collection of polygons.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectPreciseZoningType​(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, File zoningFile)
    Mark parcels that intersects a certain type of Generic zoning.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectPreciseZoningType​(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)
    Mark parcels that intersects a certain type of Generic zoning.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelIntersectZoningWithoutPreciseZonings​(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, List<String> preciseZone, File zoningFile)
    Mark parcels that intersects a certain type of a generic zone but not mark them if they are from a given list of precise zone.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelOfCommunityNumber​(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)
    Mark parcels if its community number equals a given value
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelOfCommunityType​(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)
    Mark parcels if its community type equals a given value
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelsConnectedToRoad​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile)
    Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelsConnectedToRoad​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone)
    Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelsConnectedToRoad​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)
    Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelsInf​(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)
    Mark the parcels that size are superior or equal to a given threshold.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelsNotConnectedToRoad​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone)
    Mark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelsNotConnectedToRoad​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)
    Mark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelsSup​(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)
    Mark the parcels that size are inferior to a given threshold.
    static org.geotools.data.simple.SimpleFeatureCollection
    markParcelWithAttribute​(org.geotools.data.simple.SimpleFeatureCollection parcels, String fieldName, String attribute)
    Mark parcels if one of its attribute equals a given value
    static org.geotools.data.simple.SimpleFeatureCollection
    markRandomParcels​(org.geotools.data.simple.SimpleFeatureCollection parcels, int nbParcelToMark, boolean markExistingMarks)
    Mark a given number of parcel for the simulation.
    static org.geotools.data.simple.SimpleFeatureCollection
    markRandomParcels​(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile, double minSize, int nbParcelToMark, boolean markExistingMarks)
    Mark a given number of parcel for the simulation.
    static org.geotools.data.simple.SimpleFeatureCollection
    markSFCWithAttributeField​(org.geotools.data.simple.SimpleFeatureCollection parcels, String attributeFieldName, String attributeFieldValue)
    Mark parcels that meet a certain pattern in an attribute
    static org.geotools.data.simple.SimpleFeatureCollection
    markSimulatedParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels)
    Mark a parcel if it has been simulated.
    static org.geotools.data.simple.SimpleFeatureCollection
    markUnBuiltParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile)
    Mark the unbuilt parcels.
    static org.geotools.data.simple.SimpleFeatureCollection
    markUnBuiltParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection buildingSFC)
    Mark the unbuilt parcels.
    static org.geotools.data.simple.SimpleFeatureCollection
    markWorkflowSimulatedParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels, WorkflowType workflowName)
    Mark a parcel if it has been simulated with a specific workflow.
    static org.geotools.data.simple.SimpleFeatureCollection
    resetMarkingField​(org.geotools.data.simple.SimpleFeatureCollection parcels)
    Affect a null value to every mark field of a parcel collection.
    static void
    setMarkFieldName​(String markFieldName)
    Set the name of the field containing the parcel's mark
    static void
    setPostMark​(boolean postMark)
    Specify that the marking is made before (false) or after (true) the simulation process.
    static void
    signalIfNoParcelMarked​(org.geotools.data.simple.SimpleFeatureCollection sfcIn, String methodName)
    Write on the console if a set of parcels haven't been marked at all.
    static org.geotools.data.simple.SimpleFeatureCollection
    unionTouchingMarkedGeometries​(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)
    Merge SimpleFeatures that are marked and touches each other and keep the attribute of the largest feature

    Methods inherited from class java.lang.Object

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

    • MarkParcelAttributeFromPosition

      public MarkParcelAttributeFromPosition()
  • Method Details

    • markParcelsConnectedToRoad

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile) throws IOException
      Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      block - SimpleFeatureCollection containing the morphological block. Can be generated with the CityGeneration.createUrbanBlock(SimpleFeatureCollection) method.
      roadFile - Geopackage containing the road segments
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading roadFile
    • markParcelsConnectedToRoad

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone) throws IOException
      Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      block - SimpleFeatureCollection containing the morphological block. Can be generated with the CityGeneration.createUrbanBlock(SimpleFeatureCollection) method.
      roadFile - Geo file containing the road segments
      exclusionZone - Zone to be excluded for not counting an empty parcel as a road
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading roadFile
    • markParcelsConnectedToRoad

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)
      Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      block - SimpleFeatureCollection containing the morphological block. Can be generated with the CityGeneration.createUrbanBlock(SimpleFeatureCollection) method.
      road - road segments
      exclusionZone - Zone to be excluded for not counting an empty parcel as a road
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelsNotConnectedToRoad

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelsNotConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone) throws IOException
      Mark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      block - SimpleFeatureCollection containing the morphological block. Can be generated with the CityGeneration.createUrbanBlock(SimpleFeatureCollection) method.
      roadFile - road File
      exclusionZone - Zone to be excluded for not counting an empty parcel as a road
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException
    • markParcelsNotConnectedToRoad

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelsNotConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)
      Mark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      block - SimpleFeatureCollection containing the morphological block. Can be generated with the CityGeneration.createUrbanBlock(SimpleFeatureCollection) method.
      road - road segments
      exclusionZone - Zone to be excluded for not counting an empty parcel as a road
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelsInf

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelsInf(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)
      Mark the parcels that size are superior or equal to a given threshold.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      size - Area threshold
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelsSup

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelsSup(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)
      Mark the parcels that size are inferior to a given threshold.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      size - Area threshold
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markRandomParcels

      public static org.geotools.data.simple.SimpleFeatureCollection markRandomParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, int nbParcelToMark, boolean markExistingMarks) throws IOException
      Mark a given number of parcel for the simulation. The selection is random but parcels must be bigger than a certain area threshold.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      nbParcelToMark - number of parcel wanted
      markExistingMarks - if true, randomly marked parcels will only be pe-existing parcels. If false, random follows a new selection
      Returns:
      SimpleFeatureCollection of the input parcels with random marked parcels on the markFieldName field.
      Throws:
      IOException - reading zoningFile
    • markRandomParcels

      public static org.geotools.data.simple.SimpleFeatureCollection markRandomParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile, double minSize, int nbParcelToMark, boolean markExistingMarks) throws IOException
      Mark a given number of parcel for the simulation. The selection is random but parcels can be bigger than a certain area threshold and can be contained is a given zoning type.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      minSize - Minimal size of parcels to be selected (optional)
      genericZone - Type of the zoning plan to take into consideration
      zoningFile - Geopackage containing the zoning plan
      nbParcelToMark - Number of parcel wanted
      markExistingMarks - if true, randomly marked parcels will only be pe-existing parcels. If false, random follows a new selection
      Returns:
      SimpleFeatureCollection of the input parcels with random marked parcels on the markFieldName field.
      Throws:
      IOException - reading zoningFile
    • markUnBuiltParcel

      public static org.geotools.data.simple.SimpleFeatureCollection markUnBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile) throws IOException
      Mark the unbuilt parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      buildingFile - Geo file containing building features
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading building file
    • markUnBuiltParcel

      public static org.geotools.data.simple.SimpleFeatureCollection markUnBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection buildingSFC)
      Mark the unbuilt parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      buildingSFC - building features
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markBuiltParcel

      public static org.geotools.data.simple.SimpleFeatureCollection markBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile) throws IOException
      Mark the built parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      buildingFile - Geo file representing the buildings
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading building file
    • markBuiltParcel

      public static org.geotools.data.simple.SimpleFeatureCollection markBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection building)
      Mark the built parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      building - collection of buildings
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelIntersectPolygonIntersection

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPolygonIntersection(org.geotools.data.simple.SimpleFeatureCollection parcels, List<org.locationtech.jts.geom.Geometry> geoms)
      Mark parcels that intersects a given collection of polygons. The default field name containing the mark is "SPLIT" but it can be changed with the setMarkFieldName(String) method. Less optimized method that takes a Geometry as an input
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      geoms - a List of Geometry which can intersect parcels
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelIntersectPolygonIntersection

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPolygonIntersection(org.geotools.data.simple.SimpleFeatureCollection parcels, File polygonIntersectionFile) throws IOException
      Mark parcels that intersects a given collection of polygons. The default field name containing the mark is "SPLIT" but it can be changed with the setMarkFieldName(String) method.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      polygonIntersectionFile - A Geopackage containing the collection of polygons
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading polygonIntersectionFile
    • markSFCWithAttributeField

      public static org.geotools.data.simple.SimpleFeatureCollection markSFCWithAttributeField(org.geotools.data.simple.SimpleFeatureCollection parcels, String attributeFieldName, String attributeFieldValue)
      Mark parcels that meet a certain pattern in an attribute
      Parameters:
      parcels - Input SimpleFeatureCollection
      attributeFieldName - Name of the attribute field
      attributeFieldValue - Value of the attribute field to mark
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field
    • markParcelIntersectGenericZoningType

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectGenericZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile) throws IOException
      Mark parcels that intersects a certain type of generic zone.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      genericZone - The big kind of the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be tolerate
      zoningFile - A Geopackage containing the zoning plan
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading zoningFile
    • markParcelIntersectGenericZoningType

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectGenericZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)
      Mark parcels that intersects a certain type of generic zone.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      genericZone - The big kind of the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be tolerate
      zoningSFC - Collection of the zoning plan
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelIntersectZoningWithoutPreciseZonings

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectZoningWithoutPreciseZonings(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, List<String> preciseZone, File zoningFile) throws IOException
      Mark parcels that intersects a certain type of a generic zone but not mark them if they are from a given list of precise zone.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      genericZone - The big kind of the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be tolerate
      preciseZone - List of precise zone to not take into account
      zoningFile - A Geopackage containing the zoning plan
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading zoningFile
    • markParcelIntersectPreciseZoningType

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPreciseZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, File zoningFile) throws IOException
      Mark parcels that intersects a certain type of Generic zoning.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      genericZone - The generic type the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be tolerate
      preciseZone - The precise zoning type. Can be anything.
      zoningFile - A geo file containing the zoning plan.
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading zoningFile
    • markParcelIntersectPreciseZoningType

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPreciseZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)
      Mark parcels that intersects a certain type of Generic zoning.
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      genericZone - The generic type the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be tolerate
      preciseZone - The precise zoning type. Can be anything.
      zoningSFC - Collection of zoning. An interesection trim with parcels is made.
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelIntersectFrenchConstructibleZoningType

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectFrenchConstructibleZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile) throws IOException
      Mark parcels that intersects that are usually constructible for French regulation
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      zoningFile - A geo file containing the zoning plan
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
      Throws:
      IOException - reading zoningFile
    • markParcelIntersectFrenchConstructibleZoningType

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectFrenchConstructibleZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection zoning)
      Mark parcels that intersects that are usually constructible for French regulation
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      zoning - A collection containing the zoning plan
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markParcelOfCommunityType

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelOfCommunityType(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)
      Mark parcels if its community type equals a given value
      Parameters:
      parcels - parcel feature
      attribute - value for the community type to be marked
      Returns:
      the collection with marked parcels
    • markParcelOfCommunityNumber

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelOfCommunityNumber(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)
      Mark parcels if its community number equals a given value
      Parameters:
      parcels - parcel feature
      attribute - value for the community number to be marked
      Returns:
      the collection with marked parcels
    • markParcelWithAttribute

      public static org.geotools.data.simple.SimpleFeatureCollection markParcelWithAttribute(org.geotools.data.simple.SimpleFeatureCollection parcels, String fieldName, String attribute)
      Mark parcels if one of its attribute equals a given value
      Parameters:
      parcels - parcel feature
      fieldName - name of the field
      attribute - value for the given field to be marked
      Returns:
      the collection with marked parcels
    • getMarkFieldName

      public static String getMarkFieldName()
      Get the name of the field containing the parcel's mark
      Returns:
      the field name
    • setMarkFieldName

      public static void setMarkFieldName(String markFieldName)
      Set the name of the field containing the parcel's mark
      Parameters:
      markFieldName - the field name
    • markAlreadyMarkedParcels

      public static org.geotools.data.simple.SimpleFeatureCollection markAlreadyMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection parcelsMarked)
      Mark parcels that have already been marked on another simple collection feature. They may not have the same attribute, so we rely on geometries
      Parameters:
      parcels - Parcel collection to copy the marks on. Could have a markFieldName or not.
      parcelsMarked - Parcel collection that has a markFieldName field
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markSimulatedParcel

      public static org.geotools.data.simple.SimpleFeatureCollection markSimulatedParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)
      Mark a parcel if it has been simulated. This is done using the section field name and the method GeneralFields.isParcelHasSimulatedFields(SimpleFeature).
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markWorkflowSimulatedParcel

      public static org.geotools.data.simple.SimpleFeatureCollection markWorkflowSimulatedParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, WorkflowType workflowName)
      Mark a parcel if it has been simulated with a specific workflow. This is done using the section field name and the method GeneralFields.isParcelHasSimulatedFields(SimpleFeature).
      Parameters:
      parcels - Input parcel SimpleFeatureCollection
      workflowName - can either be
      • densification
      • consolidation
      • zone
      Returns:
      SimpleFeatureCollection of the input parcels with marked parcels on the markFieldName field.
    • markAllParcel

      public static org.geotools.data.simple.SimpleFeatureCollection markAllParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)
      Mark every SimpleFeature form a SimpleFeatureCollection on a new markFieldName field with a 1 (true). Untested if the collection already contains the markFieldName field.
      Parameters:
      parcels - input SimpleFeatureCollection
      Returns:
      input SimpleFeatureCollection with a new markFieldName field with only 1 (true) in it.
    • isAlreadyMarked

      public static int isAlreadyMarked(org.opengis.feature.simple.SimpleFeature feat)
      look if a parcel has the markFieldName field and if it is positive or negative. Also look if a parcel has already been simulated. The default method for the kind of nomenclature is used. If already simulated and not in postMark mode, we won't re-simulate it.
      Parameters:
      feat - input SimpleFeature
      Returns:
      • If no mark field or the field is unset, return -1
      • If mark field is set to 0, return 0
      • If mark field is set to 1, return 1
    • signalIfNoParcelMarked

      public static void signalIfNoParcelMarked(org.geotools.data.simple.SimpleFeatureCollection sfcIn, String methodName)
      Write on the console if a set of parcels haven't been marked at all. Making that function a lil earlier could have saved me a lot of time
      Parameters:
      sfcIn - Input SimpleFeatureCollection
      methodName - Name of the method to wave this name if no parcels have been marked
    • isNoParcelMarked

      public static boolean isNoParcelMarked(org.geotools.data.simple.SimpleFeatureCollection sfcIn)
      return true if the SimpleFeatureCollection has no parcels where the markFieldName value equals 1.
      Parameters:
      sfcIn - input collection
      Returns:
      true is no parcels are marked, false otherwise
    • getOnlyMarkedParcels

      public static org.geotools.data.simple.SimpleFeatureCollection getOnlyMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection in)
      Return a SimpleFeatureCollection containing only the marked parcels on their markFieldName field.
      Parameters:
      in - input SimpleFeatureCollection with marking attribute
      Returns:
      SimpleFeatureCollection with only marked parcels and same schema as input
    • getNotMarkedParcels

      public static org.geotools.data.simple.SimpleFeatureCollection getNotMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection in)
      Return a SimpleFeatureCollection containing only the not marked parcels on their markFieldName field.
      Parameters:
      in - input SimpleFeatureCollection with marking attribute
      Returns:
      SimpleFeatureCollection with only marked parcels and same schema as input
    • resetMarkingField

      public static org.geotools.data.simple.SimpleFeatureCollection resetMarkingField(org.geotools.data.simple.SimpleFeatureCollection parcels)
      Affect a null value to every mark field of a parcel collection.
      Parameters:
      parcels - input parcel collection to remove mark.
      Returns:
      collection with null values in the marking field.
    • unionTouchingMarkedGeometries

      public static org.geotools.data.simple.SimpleFeatureCollection unionTouchingMarkedGeometries(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)
      Merge SimpleFeatures that are marked and touches each other and keep the attribute of the largest feature
      Parameters:
      parcelCollection - input parcel collection to mark
      Returns:
      The collection with the same schema and its touching parcels merged
    • isPostMark

      public static boolean isPostMark()
      Marking parcels is made before (false) or after (true) the simulation process. It won't allow or will the marking of the already simulated parcels
      Returns:
      value
    • setPostMark

      public static void setPostMark(boolean postMark)
      Specify that the marking is made before (false) or after (true) the simulation process. It won't allow or will the marking of the already simulated parcels
      Parameters:
      postMark - new value
    • countMarkedParcels

      public static long countMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)
      Count how many parcels of a set are marked.
      Parameters:
      parcelCollection - input parcel collection to count
      Returns:
      number of marked parcels
    • markParcel

      public static org.opengis.feature.simple.SimpleFeature markParcel(org.opengis.feature.simple.SimpleFeature parcel)
      Mark a parcel's feat with value 1, either if they contain a markField attribute or not.
      Parameters:
      parcel - input parcel to mark.
      Returns:
      the parcel marked (possibly with an extra attribute)
    • markParcel

      public static org.opengis.feature.simple.SimpleFeature markParcel(org.opengis.feature.simple.SimpleFeature parcel, int value)
      Mark a parcel's feat, either if they contain a markField attribute or not.
      Parameters:
      parcel - input parcel to mark.
      value - whether 0 (won't be simulated) or 1 (will be simulated)
      Returns:
      the parcel marked (possibly with an extra attribute)