Package fr.ign.artiscales.pm.fields
Class GeneralFields
java.lang.Object
fr.ign.artiscales.pm.fields.GeneralFields
Method containing functions to deal with parcel attributes and fields
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.geotools.data.simple.SimpleFeatureCollectionaddCommunityCode(org.geotools.data.simple.SimpleFeatureCollection parcels)Add thezoneCommunityCodefield for every parcel of aSimpleFeatureCollection.static org.geotools.data.simple.SimpleFeatureCollectionaddParcelCode(org.geotools.data.simple.SimpleFeatureCollection parcels)Add a "CODE" field for every parcels of aSimpleFeatureCollection.static StringgetGenericZoneEnglishName(String genericZone)Trivial method to get the genericZone list of a typegetGenericZoneUsualNames(String genericZone)Trivial method to get the genericZone list of a typegetGenericZoningTypes(org.geotools.data.simple.SimpleFeatureCollection zonings)Get a list of all thezoneGenericNameFieldvalues of the given collection.static StringGet what is the type of parcel used in the simulationstatic org.geotools.data.simple.SimpleFeatureCollectiongetParcelWithSimulatedFields(org.geotools.data.simple.SimpleFeatureCollection sfc)This method returns the parcels of a given collection that have been simulated.getPreciseZoningTypes(org.geotools.data.simple.SimpleFeatureCollection zonings)Get a list of all thezonePreciseNameFieldvalues of the given collection.static org.geotools.feature.simple.SimpleFeatureBuilderGet a simple feature builder for the corresponding zoning regarding to the wantedparcelFieldType.static StringGet the name of the field for community numberstatic StringGet the name of the field representing the generic name of zoning features (TYPEZONE by default)static StringGet the name of the field representing the precise name of zoning features (LIBELLE by default)static booleanisParcelHasSimulatedFields(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 booleanisParcelLikeFrenchHasSimulatedFields(org.opengis.feature.simple.SimpleFeature feature)This method allows to determine if a parcel has been simulated.static StringmakeParcelCode(org.opengis.feature.simple.SimpleFeature feat)Construct a parcel code for aSimpleFeatureregarding theparcelFieldTypestatic voidsetParcelFieldType(String fieldType)Set what is the type of parcel used in the simulationstatic voidsetZoneCommunityCode(String zoneCommunityCode)Set the name of the field for community numberstatic voidsetZoneGenericNameField(String zoneNameField)Set the name of the field representing the generic name of zoning featuresstatic voidsetZonePreciseNameField(String zonePreciseNameField)Set the name of the field representing the precise name of zoning featuresstatic org.geotools.data.simple.SimpleFeatureCollectiontransformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)Change aSimpleFeatureCollectionof any kind to follow the minimum schema for Parcel Manager (see methodParcelSchema.getSFBMinParcel().static org.geotools.data.simple.SimpleFeatureCollectiontransformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, boolean hasMark)Change aSimpleFeatureCollectionof any kind to follow the minimum schema for Parcel Manager (see methodParcelSchema.getSFBMinParcel().static org.geotools.data.simple.SimpleFeatureCollectiontransformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection sfc, org.geotools.data.simple.SimpleFeatureCollection sfcWithInfo)Change aSimpleFeatureCollectionof any kind to follow the minimum schema for Parcel Manager (see methodParcelSchema.getSFBMinParcel()with the help of an extraSimpleFeatureCollection.
-
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- ParcelSimpleFeatureCollectionto sort- Returns:
- The parcel
SimpleFeatureCollectionwith only the simulated parcels
-
getPreciseZoningTypes
public static List<String> getPreciseZoningTypes(org.geotools.data.simple.SimpleFeatureCollection zonings)Get a list of all thezonePreciseNameFieldvalues of the given collection. The city code field name is LIBELLE by default and can be changed with the methodsetZonePreciseNameField(String).- Parameters:
zonings- InputSimpleFeatureCollectionof 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 thezoneGenericNameFieldvalues of the given collection. The city code field name is TYPEZONE by default and can be changed with the methodsetZoneGenericNameField(String).- Parameters:
zonings- InputSimpleFeatureCollectionof 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 aSimpleFeatureCollection. Only french solution implemented yet.- Parameters:
parcels-SimpleFeatureCollectionof parcels.- Returns:
- The collection with the "CODE" field added.
-
makeParcelCode
Construct a parcel code for aSimpleFeatureregarding theparcelFieldType- Parameters:
feat- input parcel- Returns:
- the parcel code
-
addCommunityCode
public static org.geotools.data.simple.SimpleFeatureCollection addCommunityCode(org.geotools.data.simple.SimpleFeatureCollection parcels)Add thezoneCommunityCodefield for every parcel of aSimpleFeatureCollection. Only french solution implemented yet.- Parameters:
parcels-SimpleFeatureCollectionof parcels.- Returns:
- The collection with the "CODE" field added.
-
getGenericZoneUsualNames
Trivial method to get the genericZone list of a type- Parameters:
genericZone- the given generic zone- Returns:
- the given list( as final)
-
getGenericZoneEnglishName
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-SimpleFeatureinput 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-SimpleFeatureinput 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 wantedparcelFieldType.- Returns:
- a zoning SFB
-
getZoneGenericNameField
Get the name of the field representing the generic name of zoning features (TYPEZONE by default)- Returns:
- the field name
-
setZoneGenericNameField
Set the name of the field representing the generic name of zoning features- Parameters:
zoneNameField- the new field name
-
getZonePreciseNameField
Get the name of the field representing the precise name of zoning features (LIBELLE by default)- Returns:
- the field name
-
setZonePreciseNameField
Set the name of the field representing the precise name of zoning features- Parameters:
zonePreciseNameField- the new field name
-
getParcelFieldType
Get what is the type of parcel used in the simulation- Returns:
- type of parcel
-
setParcelFieldType
Set what is the type of parcel used in the simulation- Parameters:
fieldType- new type of parcel
-
getZoneCommunityCode
Get the name of the field for community number- Returns:
- field name
-
setZoneCommunityCode
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 aSimpleFeatureCollectionof any kind to follow the minimum schema for Parcel Manager (see methodParcelSchema.getSFBMinParcel()with the help of an extraSimpleFeatureCollection.- Parameters:
sfc- inputSimpleFeatureCollectionto transform.sfcWithInfo-SimpleFeatureCollectioncontaining the interesting attribute informations.- Returns:
- A
SimpleFeatureCollectionwith attributes following the minimal schema
-
transformSFCToMinParcel
public static org.geotools.data.simple.SimpleFeatureCollection transformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)Change aSimpleFeatureCollectionof any kind to follow the minimum schema for Parcel Manager (see methodParcelSchema.getSFBMinParcel().- Parameters:
parcels- inputSimpleFeatureCollection- Returns:
- A
SimpleFeatureCollectionwith attributes following the minimal schema
-
transformSFCToMinParcel
public static org.geotools.data.simple.SimpleFeatureCollection transformSFCToMinParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, boolean hasMark)Change aSimpleFeatureCollectionof any kind to follow the minimum schema for Parcel Manager (see methodParcelSchema.getSFBMinParcel(). Could be the version with the mark field or not.- Parameters:
parcels- inputSimpleFeatureCollectionhasMark- If theMarkParcelAttributeFromPosition.getMarkFieldName()should be kept or not.- Returns:
- A
SimpleFeatureCollectionwith attributes following the minimal schema
-