Class ParcelState

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

public class ParcelState extends Object
Methods to get information about parcel about their geometry, position in the geographic environment, etc.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    countParcelNeighborhood​(org.locationtech.jts.geom.Geometry parcelGeom, org.geotools.data.simple.SimpleFeatureCollection parcels)
     
    static Double
    getCloseEvalInParcel​(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)
    Get the evaluation of a cell generated by MUP-City and close to the input parcel
    static double
    Get the default width for road segment (7.5 by default).
    static Double
    getEvalInParcel​(org.opengis.feature.simple.SimpleFeature parcel, File outMup)
    Get the evaluation of a cell generated by MUP-City and contained in a input parcel
    static Double
    getEvalInParcel​(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)
    Get the evaluation of a cell generated by MUP-City and contained in a input parcel
    static double
    getParcelFrontSideWidth​(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, List<org.locationtech.jts.geom.LineString> ext)
    Determine the width of the parcel on road.
    static List<org.locationtech.jts.geom.Geometry>
    getRoadPolygon​(org.geotools.data.simple.SimpleFeatureCollection roads)
    Get a list of the surrounding buffered road segments.
    static String
    Get the name of the field containing attribute which indicates the width of road segments (LARGEUR by default) .
    static boolean
    isAlreadyBuilt​(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea)
    This algorithm looks if a parcel is overlapped by a building and returns true if they are.
    static boolean
    isAlreadyBuilt​(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask)
    This method looks if a parcel is overlapped by a building and returns true if they are.
    static boolean
    isAlreadyBuilt​(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask, double uncountedBuildingArea)
    This algorithm looks if a parcel is overlapped by a building and returns true if they are.
    static boolean
    isAlreadyBuilt​(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.locationtech.jts.geom.Geometry parcelGeom, double bufferBati, double uncountedBuildingArea)
    This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.
    static boolean
    isAlreadyBuilt​(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel)
    This method looks if a parcel is overlapped by a building and returns true if they are.
    static boolean
    isAlreadyBuilt​(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea)
    This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.
    static boolean
    isArt3AllowsIsolatedParcel​(String insee, File predicateFile)
    Return false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be done.
    static boolean
    isArt3AllowsIsolatedParcel​(org.opengis.feature.simple.SimpleFeature feat, File predicateFile)
    Return false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be done
    static boolean
    isParcelHasRoadAccess​(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext)
    Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways.
    static boolean
    isParcelHasRoadAccess​(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext, org.locationtech.jts.geom.Geometry disabledBuffer)
    Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways.
    static String
    parcelInGenericZone​(File zoningFile, org.opengis.feature.simple.SimpleFeature parcelIn)
    Return a single Zone Generic Name that a parcels intersect.
    static String
    parcelInTypo​(File communityFile, org.opengis.feature.simple.SimpleFeature parcelIn, String typoAttribute)
    return a single typology that a parcels intersect if the parcel intersects multiple, we select the one that covers the most area
    static void
    setDefaultWidthRoad​(double defaultWidthRoad)
    Set the default width for road segment
    static void
    setWidthFieldAttribute​(String widthFieldAttribute)
    Set the name of the field containing attribute which indicates the width of road segments.

    Methods inherited from class java.lang.Object

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

    • ParcelState

      public ParcelState()
  • Method Details

    • countParcelNeighborhood

      public static int countParcelNeighborhood(org.locationtech.jts.geom.Geometry parcelGeom, org.geotools.data.simple.SimpleFeatureCollection parcels)
    • getRoadPolygon

      public static List<org.locationtech.jts.geom.Geometry> getRoadPolygon(org.geotools.data.simple.SimpleFeatureCollection roads)
      Get a list of the surrounding buffered road segments.

      The buffer length is calculated with an attribute field. The default name of the field is LARGEUR and can be set with the setWidthFieldAttribute(String) method. If no field is found, a default value of 7.5 meters is used (this default value can be set with the setDefaultWidthRoad(double) method).

      Parameters:
      roads - collection of road
      Returns:
      The list of the surrounding buffered road segments.
    • getParcelFrontSideWidth

      public static double getParcelFrontSideWidth(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, List<org.locationtech.jts.geom.LineString> ext)
      Determine the width of the parcel on road. We first rely on the absance of parcel. If none found, we rely on the road features.
      Parameters:
      p - input Polygon
      roads - Road collection (can be null)
      ext - lines of the outside block
      Returns:
      width of the parcel on road
    • isParcelHasRoadAccess

      public static boolean isParcelHasRoadAccess(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext)
      Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways. This could be a road Geopackage or a Geometry representing the exterior of a parcel plan.
      Parameters:
      poly - input polygon
      roads - input road Geopacakge (can be null)
      ext - External polygon
      Returns:
      true is the polygon has a road access
    • isParcelHasRoadAccess

      public static boolean isParcelHasRoadAccess(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext, org.locationtech.jts.geom.Geometry disabledBuffer)
      Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways. This could be a road Geopacakge or a Geometry representing the exterior of a parcel plan. Some empty Geometry can represent an exclusion zone which won't be taken as a road space when empty of parcels
      Parameters:
      poly - input polygon
      roads - input road Geopacakge (can be null)
      ext - External polygon
      disabledBuffer - A Geometry that cannot be considered as absence of road. Can be null
      Returns:
      true is the polygon has a road access
    • isArt3AllowsIsolatedParcel

      public static boolean isArt3AllowsIsolatedParcel(org.opengis.feature.simple.SimpleFeature feat, File predicateFile) throws IOException
      Return false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be done
      Parameters:
      feat - The parcel (which has to be French)
      predicateFile - The table containing urban rules. If null or not set, will return false
      Returns:
      false by default
      Throws:
      IOException - reading .csv file
    • isArt3AllowsIsolatedParcel

      public static boolean isArt3AllowsIsolatedParcel(String insee, File predicateFile) throws IOException
      Return false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be done.
      Parameters:
      insee - The community number of the concerned city
      predicateFile - The table containing urban rules. If null or not set, will return false
      Returns:
      false by default
      Throws:
      IOException - reading predicate
    • isAlreadyBuilt

      public static boolean isAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel)
      This method looks if a parcel is overlapped by a building and returns true if they are.
      Parameters:
      buildingSFC - building collection
      parcel - input parcel
      Returns:
      True if a building is really intersecting the parcel
    • isAlreadyBuilt

      public static boolean isAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask) throws IOException
      This method looks if a parcel is overlapped by a building and returns true if they are.
      Parameters:
      buildingFile - building collection
      parcel - input parcel
      mask - polygon with mask which will select every overlapping features
      Returns:
      True if a building is really intersecting the parcel
      Throws:
      IOException - reading building file
    • isAlreadyBuilt

      public static boolean isAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask, double uncountedBuildingArea) throws IOException
      This algorithm looks if a parcel is overlapped by a building and returns true if they are. Overload of the isAlreadyBuilt(SimpleFeatureCollection, SimpleFeature, double, double) to select only a selection of buildings
      Parameters:
      buildingFile - geo file containing building
      parcel - parcel feature
      mask - geographical bounding representing our zone. Features outside this zone won't be considered. Can be null.
      uncountedBuildingArea - threshold under where a building is not considered
      Returns:
      True if a building is really intersecting the parcel
      Throws:
      IOException - reading building file
    • isAlreadyBuilt

      public static boolean isAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea) throws IOException
      This algorithm looks if a parcel is overlapped by a building and returns true if they are.
      Parameters:
      buildingFile - geo file containing building
      parcel - parcel feature
      bufferBati - apply a buffer on every building (mostly negative buffers)
      uncountedBuildingArea - threshold under where a building is not considered
      Returns:
      True if a building is really intersecting the parcel
      Throws:
      IOException - reading building file
    • isAlreadyBuilt

      public static boolean isAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea)
      This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.
      Parameters:
      buildingSFC - building collection
      parcel - parcel feature
      bufferBati - apply a buffer on every building (mostly negative buffers)
      uncountedBuildingArea - threshold under where a building is not considered
      Returns:
      True if a building is really intersecting the parcel
    • isAlreadyBuilt

      public static boolean isAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.locationtech.jts.geom.Geometry parcelGeom, double bufferBati, double uncountedBuildingArea)
      This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.
      Parameters:
      buildingSFC - building collection
      parcelGeom - parcel geometry
      bufferBati - apply a buffer on every building (mostly negative buffers)
      uncountedBuildingArea - threshold under where a building is not considered
      Returns:
      True if a building is really intersecting the parcel
    • getEvalInParcel

      public static Double getEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, File outMup) throws IOException
      Get the evaluation of a cell generated by MUP-City and contained in a input parcel
      Parameters:
      parcel - Input SimpleFeature parcel
      outMup - Shapefile to the vectorized MUP-City output
      Returns:
      The best evaluation of the intersected MUP-City's cells
      Throws:
      IOException - reading MUP-City's output
    • getEvalInParcel

      public static Double getEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)
      Get the evaluation of a cell generated by MUP-City and contained in a input parcel
      Parameters:
      parcel - Input SimpleFeature parcel
      mupSFC - SimpleFeatureCollection of MUP-City's outputs
      Returns:
      The best evaluation of the intersected MUP-City's cells
    • getCloseEvalInParcel

      public static Double getCloseEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)
      Get the evaluation of a cell generated by MUP-City and close to the input parcel
      Parameters:
      parcel - Input SimpleFeature parcel
      mupSFC - SimpleFeatureCollection of MUP-City's outputs
      Returns:
      The best evaluation of the MUP-City's cells near the parcel every 5 meters. Return 0 if the cells are 100 meters far from the parcels.
    • parcelInGenericZone

      public static String parcelInGenericZone(File zoningFile, org.opengis.feature.simple.SimpleFeature parcelIn) throws IOException
      Return a single Zone Generic Name that a parcels intersect. If the parcel intersects multiple, we select the one that covers the most area
      Parameters:
      parcelIn - input parcel
      zoningFile - geo file containing zoning file
      Returns:
      Zone Generic Name that a parcels intersect
      Throws:
      IOException - reading zoning file
    • parcelInTypo

      public static String parcelInTypo(File communityFile, org.opengis.feature.simple.SimpleFeature parcelIn, String typoAttribute) throws IOException
      return a single typology that a parcels intersect if the parcel intersects multiple, we select the one that covers the most area
      Parameters:
      parcelIn - input parcel
      communityFile - geo file containing the communities
      typoAttribute - the field name of the typo
      Returns:
      the number of most intersected community type
      Throws:
      IOException - reading community file
    • getWidthFieldAttribute

      public static String getWidthFieldAttribute()
      Get the name of the field containing attribute which indicates the width of road segments (LARGEUR by default) .
      Returns:
      the name of the field
    • setWidthFieldAttribute

      public static void setWidthFieldAttribute(String widthFieldAttribute)
      Set the name of the field containing attribute which indicates the width of road segments.
      Parameters:
      widthFieldAttribute - new name of the field
    • getDefaultWidthRoad

      public static double getDefaultWidthRoad()
      Get the default width for road segment (7.5 by default).
      Returns:
      Width in meters
    • setDefaultWidthRoad

      public static void setDefaultWidthRoad(double defaultWidthRoad)
      Set the default width for road segment
      Parameters:
      defaultWidthRoad - new width in meters