Class GeneralFields

java.lang.Object
fr.ign.artiscales.pm.fields.GeneralFields

public class GeneralFields extends Object
Method containing functions to deal with parcel attributes and fields
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.geotools.data.simple.SimpleFeatureCollection
    addCommunityCode​(org.geotools.data.simple.SimpleFeatureCollection parcels)
    Add the zoneCommunityCode field for every parcel of a SimpleFeatureCollection.
    static org.geotools.data.simple.SimpleFeatureCollection
    addParcelCode​(org.geotools.data.simple.SimpleFeatureCollection parcels)
    Add a "CODE" field for every parcels of a SimpleFeatureCollection.
    static String
    Trivial method to get the genericZone list of a type
    static List<String>
    Trivial method to get the genericZone list of a type
    static List<String>
    getGenericZoningTypes​(org.geotools.data.simple.SimpleFeatureCollection zonings)
    Get a list of all the zoneGenericNameField values of the given collection.
    static String
    Get what is the type of parcel used in the simulation
    static org.geotools.data.simple.SimpleFeatureCollection
    getParcelWithSimulatedFields​(org.geotools.data.simple.SimpleFeatureCollection sfc)
    This method returns the parcels of a given collection that have been simulated.
    static List<String>
    getPreciseZoningTypes​(org.geotools.data.simple.SimpleFeatureCollection zonings)
    Get a list of all the zonePreciseNameField values of the given collection.
    static org.geotools.feature.simple.SimpleFeatureBuilder
    Get a simple feature builder for the corresponding zoning regarding to the wanted parcelFieldType.
    static String
    Get the name of the field for community number
    static String
    Get the name of the field representing the generic name of zoning features (TYPEZONE by default)
    static String
    Get the name of the field representing the precise name of zoning features (LIBELLE by default)
    static boolean
    isParcelHasSimulatedFields​(org.opengis.feature.simple.SimpleFeature feature)
    This method allows to determine if a parcel has been simulated regarding to different parcel types of nomenclature.
    static boolean
    isParcelLikeFrenchHasSimulatedFields​(org.opengis.feature.simple.SimpleFeature feature)
    This method allows to determine if a parcel has been simulated.
    static String
    makeParcelCode​(org.opengis.feature.simple.SimpleFeature feat)
    Construct a parcel code for a SimpleFeature regarding the parcelFieldType
    static void
    setParcelFieldType​(String fieldType)
    Set what is the type of parcel used in the simulation
    static void
    setZoneCommunityCode​(String zoneCommunityCode)
    Set the name of the field for community number
    static void
    setZoneGenericNameField​(String zoneNameField)
    Set the name of the field representing the generic name of zoning features
    static void
    setZonePreciseNameField​(String zonePreciseNameField)
    Set the name of the field representing the precise name of zoning features
    static org.geotools.data.simple.SimpleFeatureCollection
    transformSFCToMinParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels)
    Change a SimpleFeatureCollection of any kind to follow the minimum schema for Parcel Manager (see method ParcelSchema.getSFBMinParcel().
    static org.geotools.data.simple.SimpleFeatureCollection
    transformSFCToMinParcel​(org.geotools.data.simple.SimpleFeatureCollection parcels, boolean hasMark)
    Change a SimpleFeatureCollection of any kind to follow the minimum schema for Parcel Manager (see method ParcelSchema.getSFBMinParcel().
    static org.geotools.data.simple.SimpleFeatureCollection
    transformSFCToMinParcel​(org.geotools.data.simple.SimpleFeatureCollection sfc, org.geotools.data.simple.SimpleFeatureCollection sfcWithInfo)
    Change a SimpleFeatureCollection of any kind to follow the minimum schema for Parcel Manager (see method ParcelSchema.getSFBMinParcel() with the help of an extra SimpleFeatureCollection.

    Methods inherited from class java.lang.Object

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

    • GeneralFields

      public GeneralFields()
  • Method Details

    • getParcelWithSimulatedFields

      public static org.geotools.data.simple.SimpleFeatureCollection getParcelWithSimulatedFields(org.geotools.data.simple.SimpleFeatureCollection sfc)
      This method returns the parcels of a given collection that have been simulated. The type of fields must be precise and that can change the specific rule. In the case of French Parcels, it selects the parcels if the length of the filed value for the SECTION information is upper than 2 (French Parcel have a two letters section, and Parcel Manager creates longer section names) Other methods can be set to determine if a parcel has been simulated.
      Parameters:
      sfc - Parcel SimpleFeatureCollection to sort
      Returns:
      The parcel SimpleFeatureCollection with only the simulated parcels
    • getPreciseZoningTypes

      public static List<String> getPreciseZoningTypes(org.geotools.data.simple.SimpleFeatureCollection zonings)
      Get a list of all the zonePreciseNameField values of the given collection. The city code field name is LIBELLE by default and can be changed with the method setZonePreciseNameField(String).
      Parameters:
      zonings - Input SimpleFeatureCollection of zoning plan
      Returns:
      The list of every city code numbers from the input parcels.
    • getGenericZoningTypes

      public static List<String> getGenericZoningTypes(org.geotools.data.simple.SimpleFeatureCollection zonings)
      Get a list of all the zoneGenericNameField values of the given collection. The city code field name is TYPEZONE by default and can be changed with the method setZoneGenericNameField(String).
      Parameters:
      zonings - Input SimpleFeatureCollection of zoning plan
      Returns:
      The list of every city code numbers from the input parcels.
    • addParcelCode

      public static org.geotools.data.simple.SimpleFeatureCollection addParcelCode(org.geotools.data.simple.SimpleFeatureCollection parcels)
      Add a "CODE" field for every parcels of a SimpleFeatureCollection. Only french solution implemented yet.
      Parameters:
      parcels - SimpleFeatureCollection of parcels.
      Returns:
      The collection with the "CODE" field added.
    • makeParcelCode

      public static String makeParcelCode(org.opengis.feature.simple.SimpleFeature feat)
      Construct a parcel code for a SimpleFeature regarding the parcelFieldType
      Parameters:
      feat - input parcel
      Returns:
      the parcel code
    • addCommunityCode

      public static org.geotools.data.simple.SimpleFeatureCollection addCommunityCode(org.geotools.data.simple.SimpleFeatureCollection parcels)
      Add the zoneCommunityCode field for every parcel of a SimpleFeatureCollection. Only french solution implemented yet.
      Parameters:
      parcels - SimpleFeatureCollection of parcels.
      Returns:
      The collection with the "CODE" field added.
    • getGenericZoneUsualNames

      public static List<String> getGenericZoneUsualNames(String genericZone)
      Trivial method to get the genericZone list of a type
      Parameters:
      genericZone - the given generic zone
      Returns:
      the given list( as final)
    • getGenericZoneEnglishName

      public static String getGenericZoneEnglishName(String genericZone)
      Trivial method to get the genericZone list of a type
      Parameters:
      genericZone - the given generic zone
      Returns:
      the given list( as final)
    • isParcelHasSimulatedFields

      public static boolean isParcelHasSimulatedFields(org.opengis.feature.simple.SimpleFeature feature)
      This method allows to determine if a parcel has been simulated regarding to different parcel types of nomenclature. For now, only the French verification but other methods can be set to determine if a parcel has been simulated.
      Parameters:
      feature - SimpleFeature input parcel
      Returns:
      True if the parcel section looks like it has been simulated.
    • isParcelLikeFrenchHasSimulatedFields

      public static boolean isParcelLikeFrenchHasSimulatedFields(org.opengis.feature.simple.SimpleFeature feature)
      This method allows to determine if a parcel has been simulated. It looks if the length of filed value for the SECTION information is upper than 2 (French Parcel have a two letters section, and Parcel Manager creates longer section names). Other methods can be set to determine if a parcel has been simulated.
      Parameters:
      feature - SimpleFeature input parcel
      Returns:
      True if the parcel section looks like it has been simulated.
    • getSFBZoning

      public static org.geotools.feature.simple.SimpleFeatureBuilder getSFBZoning()
      Get a simple feature builder for the corresponding zoning regarding to the wanted parcelFieldType.
      Returns:
      a zoning SFB
    • getZoneGenericNameField

      public static String getZoneGenericNameField()
      Get the name of the field representing the generic name of zoning features (TYPEZONE by default)
      Returns:
      the field name
    • setZoneGenericNameField

      public static void setZoneGenericNameField(String zoneNameField)
      Set the name of the field representing the generic name of zoning features
      Parameters:
      zoneNameField - the new field name
    • getZonePreciseNameField

      public static String getZonePreciseNameField()
      Get the name of the field representing the precise name of zoning features (LIBELLE by default)
      Returns:
      the field name
    • setZonePreciseNameField

      public static void setZonePreciseNameField(String zonePreciseNameField)
      Set the name of the field representing the precise name of zoning features
      Parameters:
      zonePreciseNameField - the new field name
    • getParcelFieldType

      public static String getParcelFieldType()
      Get what is the type of parcel used in the simulation
      Returns:
      type of parcel
    • setParcelFieldType

      public static void setParcelFieldType(String fieldType)
      Set what is the type of parcel used in the simulation
      Parameters:
      fieldType - new type of parcel
    • getZoneCommunityCode

      public static String getZoneCommunityCode()
      Get the name of the field for community number
      Returns:
      field name
    • setZoneCommunityCode

      public static void setZoneCommunityCode(String zoneCommunityCode)
      Set the name of the field for community number
      Parameters:
      zoneCommunityCode - field name
    • transformSFCToMinParcel

      public static org.geotools.data.simple.SimpleFeatureCollection transformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection sfc, org.geotools.data.simple.SimpleFeatureCollection sfcWithInfo)
      Change a SimpleFeatureCollection of any kind to follow the minimum schema for Parcel Manager (see method ParcelSchema.getSFBMinParcel() with the help of an extra SimpleFeatureCollection.
      Parameters:
      sfc - input SimpleFeatureCollection to transform.
      sfcWithInfo - SimpleFeatureCollection containing the interesting attribute informations.
      Returns:
      A SimpleFeatureCollection with attributes following the minimal schema
    • transformSFCToMinParcel

      public static org.geotools.data.simple.SimpleFeatureCollection transformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)
      Change a SimpleFeatureCollection of any kind to follow the minimum schema for Parcel Manager (see method ParcelSchema.getSFBMinParcel().
      Parameters:
      parcels - input SimpleFeatureCollection
      Returns:
      A SimpleFeatureCollection with attributes following the minimal schema
    • transformSFCToMinParcel

      public static org.geotools.data.simple.SimpleFeatureCollection transformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, boolean hasMark)
      Change a SimpleFeatureCollection of any kind to follow the minimum schema for Parcel Manager (see method ParcelSchema.getSFBMinParcel(). Could be the version with the mark field or not.
      Parameters:
      parcels - input SimpleFeatureCollection
      hasMark - If the MarkParcelAttributeFromPosition.getMarkFieldName() should be kept or not.
      Returns:
      A SimpleFeatureCollection with attributes following the minimal schema