Class ParcelGetter

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

public class ParcelGetter extends Object
Methods to get parcels from collections regarding specific criterion
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Get a new community field name that later forms the zipcode.
    static String
    Get the department code field name that later forms the zipcode.
    static org.geotools.data.simple.SimpleFeatureCollection
    getParcelByCommunityCode​(org.geotools.data.simple.SimpleFeatureCollection parcelIn, String val)
    Get parcels out of a parcel collection with the zip code of them parcels.
    static org.geotools.data.simple.SimpleFeatureCollection
    getParcelByFrenchZoningType​(String zone, org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile)
    Get a set of parcel depending to their zoning type.
    static org.geotools.data.simple.SimpleFeatureCollection
    getParcelByTypo​(String typo, org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile)
    Get parcels by their typology.
    static File
    getParcelByZip​(File parcelIn, List<String> vals, File fileOut)
    Write parcels out of a parcel collection corresponding to a list of zipcodes in a new geo file.
    static org.geotools.data.simple.SimpleFeatureCollection
    getParcelByZip​(org.geotools.data.simple.SimpleFeatureCollection parcelIn, String val)
    Get parcels out of a parcel collection with the zip code of them parcels.
    static org.geotools.data.simple.SimpleFeatureCollection
    getParcelByZip​(org.geotools.data.simple.SimpleFeatureCollection parcelIn, String val, String firstFieldName, String secondFieldName)
    Get parcels out of a parcel collection with the zip code of them parcels. zipcode is not directly contained in a field of the collection but is composed of two fields (usually a state-like code and a community code).
    static org.geotools.data.simple.SimpleFeatureCollection
    getParcelByZip​(org.geotools.data.simple.SimpleFeatureCollection parcelIn, List<String> vals)
    Get parcels out of a parcel collection corresponding to a list of zipcodes Zipcodes are not directly contained in a field of the collection but is composed of two fields.
    static String
    Get the field that sets a typology.
    static void
    setCodeComFieldName​(String codeComFieldName)
    Set a new community field name that later forms the zipcode.
    static void
    setCodeDepFieldName​(String codeDepFieldName)
    Set a new department code field name that later forms the zipcode.
    static void
    setTypologyFieldName​(String typologyFieldName)
    Set the field that sets a typology.

    Methods inherited from class java.lang.Object

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

    • ParcelGetter

      public ParcelGetter()
  • Method Details

    • getParcelByFrenchZoningType

      public static org.geotools.data.simple.SimpleFeatureCollection getParcelByFrenchZoningType(String zone, org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile) throws IOException
      Get a set of parcel depending to their zoning type.
      Parameters:
      zone - zone to select parcels from
      parcels - input parcels
      zoningFile - Shapefile containing the french zoning
      Returns:
      a SimpleFeatureCollection of parcels that more of the half are contained into the zone
      Throws:
      IOException - reading zoning file
    • getParcelByTypo

      public static org.geotools.data.simple.SimpleFeatureCollection getParcelByTypo(String typo, org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile) throws IOException
      Get parcels by their typology. Default typology field name is "typo" and can be changed using method setTypologyFieldName(String).
      Parameters:
      typo - Name of the searched typology
      parcels - Collection of parcels
      zoningFile - Geopackage of the communities with a filed describing their typology
      Returns:
      parcels which are included in the communities of a given typology
      Throws:
      IOException - Reading zoning file
    • getParcelByZip

      public static File getParcelByZip(File parcelIn, List<String> vals, File fileOut) throws IOException
      Write parcels out of a parcel collection corresponding to a list of zipcodes in a new geo file. Zipcodes are not directly contained in a field of the collection but is composed of two fields. Their values are set by default but it's possible to change them with the methods setCodeComFieldName(String) and setCodeDepFieldName(String)
      Parameters:
      parcelIn - input parcel collection
      vals - a list of zipcode values
      fileOut - file to export selected parcels
      Returns:
      a simple feature collection of parcels having the values contained in vals.
      Throws:
      IOException - writing file
    • getParcelByZip

      public static org.geotools.data.simple.SimpleFeatureCollection getParcelByZip(org.geotools.data.simple.SimpleFeatureCollection parcelIn, List<String> vals)
      Get parcels out of a parcel collection corresponding to a list of zipcodes Zipcodes are not directly contained in a field of the collection but is composed of two fields. Their values are set by default but it's possible to change them with the methods setCodeComFieldName(String) and setCodeDepFieldName(String)
      Parameters:
      parcelIn - input parcel collection
      vals - a list of zipcode values
      Returns:
      a simple feature collection of parcels having the values contained in vals.
    • getParcelByZip

      public static org.geotools.data.simple.SimpleFeatureCollection getParcelByZip(org.geotools.data.simple.SimpleFeatureCollection parcelIn, String val)
      Get parcels out of a parcel collection with the zip code of them parcels. Zipcodes are not directly contained in a field of the collection but is composed of two fields. Their values are set by default but it's possible to change them with the methods setCodeComFieldName(String) and setCodeDepFieldName(String)
      Parameters:
      parcelIn - Input parcel collection
      val - Value of the zipcode. Can contain comma separated values
      Returns:
      A simple feature collection of parcels having the val value. * @throws IOException
    • getParcelByZip

      public static org.geotools.data.simple.SimpleFeatureCollection getParcelByZip(org.geotools.data.simple.SimpleFeatureCollection parcelIn, String val, String firstFieldName, String secondFieldName)
      Get parcels out of a parcel collection with the zip code of them parcels. zipcode is not directly contained in a field of the collection but is composed of two fields (usually a state-like code and a community code). todo why are we working on geometries like that ??
      Parameters:
      parcelIn - Input parcel collection
      val - Value of the zipcode
      firstFieldName - First part of the field name which compose zipcode field name
      secondFieldName - Second part of the field name which compose zipcode field name
      Returns:
      a simple feature collection of parcels having the val value.
    • getParcelByCommunityCode

      public static org.geotools.data.simple.SimpleFeatureCollection getParcelByCommunityCode(org.geotools.data.simple.SimpleFeatureCollection parcelIn, String val)
      Get parcels out of a parcel collection with the zip code of them parcels.
      Parameters:
      parcelIn - Input SimpleFeatureCollection of parcel
      val - City number value
      Returns:
      a simple feature collection of parcels having the val value.
    • getCodeDepFieldName

      public static String getCodeDepFieldName()
      Get the department code field name that later forms the zipcode.
      Returns:
      department code field name (CODE_DEP by default)
    • setCodeDepFieldName

      public static void setCodeDepFieldName(String codeDepFieldName)
      Set a new department code field name that later forms the zipcode.
      Parameters:
      codeDepFieldName - new department code field name.
    • getCodeComFieldName

      public static String getCodeComFieldName()
      Get a new community field name that later forms the zipcode.
      Returns:
      current community code field name (CODE_COM by default).
    • setCodeComFieldName

      public static void setCodeComFieldName(String codeComFieldName)
      Set a new community field name that later forms the zipcode.
      Parameters:
      codeComFieldName - new community code field name.
    • getTypologyFieldName

      public static String getTypologyFieldName()
      Get the field that sets a typology.
      Returns:
      topology field name (typo by default).
    • setTypologyFieldName

      public static void setTypologyFieldName(String typologyFieldName)
      Set the field that sets a typology.
      Parameters:
      typologyFieldName - new typology field name