Class ParcelCollection
java.lang.Object
fr.ign.artiscales.pm.parcelFunction.ParcelCollection
Methods to operate routine procedures on collections of parcels
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.geotools.feature.DefaultFeatureCollectionaddAllParcels(org.geotools.data.simple.SimpleFeatureCollection parcelIn, org.geotools.data.simple.SimpleFeatureCollection parcelAdd)Deprecated.static org.geotools.data.simple.SimpleFeatureCollectiongetParcelWithoutSplitField(org.geotools.data.simple.SimpleFeatureCollection parcels)Return the same parcel collection without it SPLIT field (if this field has a new name, it will be adapted).static org.geotools.data.simple.SimpleFeatureCollectionmergeTooSmallParcels(org.geotools.data.simple.SimpleFeatureCollection parcelsUnsorted, double minimalParcelSize)This algorithm merges parcels when they are under an area threshold.static org.geotools.data.simple.SimpleFeatureCollectionmergeTooSmallParcels(org.geotools.data.simple.SimpleFeatureCollection parcelsUnsorted, double minimalParcelSize, boolean bufferGeom)This algorithm merges parcels when they are under an area threshold.static voidsortDifferentParcel(File parcelRefFile, File parcelToCompareFile, File parcelOutFolder)Method that compares two set of parcel plans and sort the reference parcel plan with the ones that changed and the ones that doesn't.static voidsortDifferentParcel(File parcelRefFile, File parcelToCompareFile, File parcelOutFolder, double maxParcelSimulatedSize, double minParcelSimulatedSize, boolean overwrite)Method that compares two set of parcel plans and sort the reference parcel plan with the ones that changed and the ones that doesn't.static org.apache.commons.lang3.tuple.Pair<org.geotools.data.simple.SimpleFeatureCollection,org.geotools.data.simple.SimpleFeatureCollection>sortParcelsBySize(org.geotools.data.simple.SimpleFeatureCollection parcelIn, double size)Sort a parcel collection by the feature's sizes in two collections : the ones that are less a threshold and the ones that are above that threshold
-
Constructor Details
-
ParcelCollection
public ParcelCollection()
-
-
Method Details
-
getParcelWithoutSplitField
public static org.geotools.data.simple.SimpleFeatureCollection getParcelWithoutSplitField(org.geotools.data.simple.SimpleFeatureCollection parcels)Return the same parcel collection without it SPLIT field (if this field has a new name, it will be adapted).- Parameters:
parcels- parcel collection- Returns:
- same parcel collection without the field attribute.
-
sortDifferentParcel
public static void sortDifferentParcel(File parcelRefFile, File parcelToCompareFile, File parcelOutFolder) throws IOExceptionMethod that compares two set of parcel plans and sort the reference parcel plan with the ones that changed and the ones that doesn't. We compare the parcels area of the reference parcel to the ones that are intersected. If they are similar with a 3% error rate, we conclude that they are the same.This method creates four geographic files (shapefile or geopackages, regarding the projects default format) in the parcelOutFolder:
- same contains the reference parcels that have not evolved
- notSame contains the reference parcels that have evolved
- simulation contains the notSame parcels with a reduction buffer, used for a precise intersection with other parcel in Parcel Manager scenarios. The large parcels that are selected for a zone simulation (see below) aren't present.
- zone contains special zones to be simulated. They consist in a small evolved parts of large parcels that mostly haven't evolved. If we don't proceed to its calculation, the large parcel won't be urbanized. Can also be ignored
- realParcel contains only the compared parcels that have evolved
- Parameters:
parcelRefFile- The reference parcel planparcelToCompareFile- The parcel plan to compareparcelOutFolder- Folder where are stored the result geopackages- Throws:
IOException- read and write files
-
sortDifferentParcel
public static void sortDifferentParcel(File parcelRefFile, File parcelToCompareFile, File parcelOutFolder, double maxParcelSimulatedSize, double minParcelSimulatedSize, boolean overwrite) throws IOExceptionMethod that compares two set of parcel plans and sort the reference parcel plan with the ones that changed and the ones that doesn't. We compare the parcels area of the reference parcel to the ones that are intersected. If they are similar with a 3% error rate, we conclude that they are the same.This method creates four geographic files (shapefile or geopackages, regarding the projects default format) in the parcelOutFolder:
- same contains the reference parcels that have not evolved
- notSame contains the reference parcels that have evolved
- realParcel contains the compared parcels that have evolved to its current 'real' state
- simulation contains reference parcels that evolved and aren't a zone. We apply a reduction buffer for a precise intersection with other parcel in Parcel Manager scenarios.
- Parameters:
parcelRefFile- The reference parcel planparcelToCompareFile- The parcel plan to compareparcelOutFolder- Folder where are stored the result geopackagesminParcelSimulatedSize- The minimal size of parcels of the usual urban fabric profile. If the algorithm is used outside the simulation, default value of 100 square meters is used.maxParcelSimulatedSize- The maximal size of parcel simulated (used for selection)overwrite- do we overwrite the- Throws:
IOException- read and write files
-
mergeTooSmallParcels
public static org.geotools.data.simple.SimpleFeatureCollection mergeTooSmallParcels(org.geotools.data.simple.SimpleFeatureCollection parcelsUnsorted, double minimalParcelSize)This algorithm merges parcels when they are under an area threshold. It seek the surrounding parcel that share the largest side with the small parcel and merge their geometries. Parcel must touch at least. If no surrounding parcels are found touching (or intersecting) the small parcel, the parcel is deleted and left as a public space. Attributes from the large parcel are kept.- Parameters:
parcelsUnsorted-SimpleFeatureCollectionto check every parcelsminimalParcelSize- Threshold which parcels are under to be merged- Returns:
- The input
SimpleFeatureCollectionwith small parcels merged or removed
-
mergeTooSmallParcels
public static org.geotools.data.simple.SimpleFeatureCollection mergeTooSmallParcels(org.geotools.data.simple.SimpleFeatureCollection parcelsUnsorted, double minimalParcelSize, boolean bufferGeom)This algorithm merges parcels when they are under an area threshold. It seek the surrounding parcel that share the largest side with the small parcel and merge their geometries. Parcel must touch at least. If no surrounding parcels are found touching (or intersecting) the small parcel, the parcel is deleted and left as a public space. Attributes from the large parcel are kept.- Parameters:
parcelsUnsorted-SimpleFeatureCollectionto check every parcelsminimalParcelSize- Threshold which parcels are under to be mergedbufferGeom- when we merge two geometries, do we buffer them with 1m and -1m ? Yes for geometries that could have a geometry precision reduction and can suffer from irregular edges. Angles and topology with other parcels could then be more or less blurry.- Returns:
- The input
SimpleFeatureCollectionwith small parcels merged or removed
-
addAllParcels
public static org.geotools.feature.DefaultFeatureCollection addAllParcels(org.geotools.data.simple.SimpleFeatureCollection parcelIn, org.geotools.data.simple.SimpleFeatureCollection parcelAdd)Deprecated.Add a given collection of parcels to another collection of parcel, for which the schema is kept.- Parameters:
parcelIn- Parcels that receive the other parcelsparcelAdd- Parcel to add- Returns:
- parcelIn
SimpleFeatureCollectionwith added parcels
-
sortParcelsBySize
public static org.apache.commons.lang3.tuple.Pair<org.geotools.data.simple.SimpleFeatureCollection,org.geotools.data.simple.SimpleFeatureCollection> sortParcelsBySize(org.geotools.data.simple.SimpleFeatureCollection parcelIn, double size)Sort a parcel collection by the feature's sizes in two collections : the ones that are less a threshold and the ones that are above that threshold- Parameters:
parcelIn- input parcel collectionsize- area of the threshold to sort the parcels- Returns:
- a pair with parcel smaller than the threshold at left and higher than threshold at right
-