Package fr.ign.artiscales.pm.analysis
Class SingleParcelStat
java.lang.Object
fr.ign.artiscales.pm.analysis.SingleParcelStat
This class calculates basic statistics for every marked parcels. If no mark parcels are found, stats are calucated for every parcels.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublediffAreaAverage(org.geotools.data.simple.SimpleFeatureCollection parcelSFC, File parcelToCompareFile)Calculate the difference between the average area of two Geopackages.static intdiffNumberOfParcel(org.geotools.data.simple.SimpleFeatureCollection parcelSFC, File parcelToCompareFile)Calculate the difference of number of parcels between two geo files.static doublehausdorffDistance(org.geotools.data.simple.SimpleFeatureCollection parcelSFC, File parcelToCompareFile)Calculation Hausdorff Similarity average for a set of parcels.static doublehausdorffSimilarityAverage(org.geotools.data.simple.SimpleFeatureCollection parcelIn, org.geotools.data.simple.SimpleFeatureCollection parcelToCompare)Calculation Hausdorff Similarity average for a set of parcels.static voidwriteStatSingleParcel(File parcelFile, File roadFile, File parcelStatCsv, boolean markAll)Write every regular statistics for a parcel planstatic voidwriteStatSingleParcel(File parcelFile, File roadFile, File parcelToCompare, File parcelStatCsv, boolean markAll)Write every regular statistics for a parcel planstatic voidwriteStatSingleParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File roadFile, File parcelStatCsv)Calculate statistics (area, perimeter, widthContactWithRoad, numberOfNeighborhood and AspectRatio) for every single parcels.static voidwriteStatSingleParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection roads, File parcelStatCsv)Calculate statistics (area, perimeter, widthContactWithRoad, numberOfNeighborhood and AspectRatio) for every single parcels.static voidwriteStatSingleParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection roads, org.geotools.data.simple.SimpleFeatureCollection parcelToCompare, File parcelStatCsv)Calculate statistics (area, perimeter, widthContactWithRoad, numberOfNeighborhood, Hausdorf Distances and AspectRatio) for every single parcels.
-
Constructor Details
-
SingleParcelStat
public SingleParcelStat()
-
-
Method Details
-
writeStatSingleParcel
public static void writeStatSingleParcel(File parcelFile, File roadFile, File parcelStatCsv, boolean markAll) throws IOExceptionWrite every regular statistics for a parcel plan- Parameters:
parcelFile- geofile conaining the planroadFile- Road filesparcelStatCsv- output statistic .csv filemarkAll- do we mark every parcels ? Only marked parcels will have their stat made.- Throws:
IOException- reading and writing file
-
writeStatSingleParcel
public static void writeStatSingleParcel(File parcelFile, File roadFile, File parcelToCompare, File parcelStatCsv, boolean markAll) throws IOExceptionWrite every regular statistics for a parcel plan- Parameters:
parcelFile- geofile conaining the planparcelToCompare- Optional parcel plan to compare shapesroadFile- Road filesparcelStatCsv- output statistic .csv filemarkAll- do we mark every parcels ? Only marked parcels will have their stat made.- Throws:
IOException- reading and writing file
-
writeStatSingleParcel
public static void writeStatSingleParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File roadFile, File parcelStatCsv) throws IOExceptionCalculate statistics (area, perimeter, widthContactWithRoad, numberOfNeighborhood and AspectRatio) for every single parcels.- Parameters:
parcels- collection of parcelsroadFile- road feature collection to calculate contact with road. Could be optional (but it's not yet)parcelStatCsv- output tab file to write- Throws:
IOException- writing stats
-
writeStatSingleParcel
public static void writeStatSingleParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection roads, File parcelStatCsv) throws IOExceptionCalculate statistics (area, perimeter, widthContactWithRoad, numberOfNeighborhood and AspectRatio) for every single parcels.- Parameters:
parcels- collection of parcelsroads- road feature collection to calculate contact with road. Could be optional (but it's not yet)parcelStatCsv- output tab file to write- Throws:
IOException- writing stats
-
writeStatSingleParcel
public static void writeStatSingleParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection roads, org.geotools.data.simple.SimpleFeatureCollection parcelToCompare, File parcelStatCsv) throws IOExceptionCalculate statistics (area, perimeter, widthContactWithRoad, numberOfNeighborhood, Hausdorf Distances and AspectRatio) for every single parcels.- Parameters:
parcels- collection of parcelsroads- road feature collection to calculate contact with road. Could be optional (but it's not yet)parcelToCompare- parcel plan before their simulation.parcelStatCsv- output tab file to write- Throws:
IOException- writing stats
-
hausdorffDistance
public static double hausdorffDistance(org.geotools.data.simple.SimpleFeatureCollection parcelSFC, File parcelToCompareFile) throws IOExceptionCalculation Hausdorff Similarity average for a set of parcels. Candidate must have been reduced before methode call- Parameters:
parcelSFC- The reference geo fileparcelToCompareFile- The geo file to compare- Returns:
- Hausdorff Similarity average
- Throws:
IOException- reading files
-
diffNumberOfParcel
public static int diffNumberOfParcel(org.geotools.data.simple.SimpleFeatureCollection parcelSFC, File parcelToCompareFile) throws IOExceptionCalculate the difference of number of parcels between two geo files.- Parameters:
parcelSFC- The reference feature collectionparcelToCompareFile- The geo file to compare- Returns:
- the difference of average (absolute value)
- Throws:
IOException- reading files
-
diffAreaAverage
public static double diffAreaAverage(org.geotools.data.simple.SimpleFeatureCollection parcelSFC, File parcelToCompareFile) throws IOExceptionCalculate the difference between the average area of two Geopackages. Find a better indicator to compare distribution.- Parameters:
parcelSFC- The reference GeopackageparcelToCompareFile- The Geopackage to compare- Returns:
- the difference of average (absolute value)
- Throws:
IOException- reading files
-
hausdorffSimilarityAverage
public static double hausdorffSimilarityAverage(org.geotools.data.simple.SimpleFeatureCollection parcelIn, org.geotools.data.simple.SimpleFeatureCollection parcelToCompare)Calculation Hausdorff Similarity average for a set of parcels. Candidate must have been reduced before methode call- Parameters:
parcelIn- reference parcel setparcelToCompare- parcels to compare shapes- Returns:
- Mean of Hausdorff distances
-