Class MarkParcelAttributeFromPosition
java.lang.Object
fr.ign.artiscales.pm.parcelFunction.MarkParcelAttributeFromPosition
Static methods to mark parcel collections relatively to many other geographic elements, parcel attributes or geometries or other sets of parcels. Doesn't change the input
SimpleFeatureCollection structure but add a marking field. This field's name is SPLIT by default and can be changed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longcountMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)Count how many parcels of a set are marked.static StringGet the name of the field containing the parcel's markstatic org.geotools.data.simple.SimpleFeatureCollectiongetNotMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection in)Return aSimpleFeatureCollectioncontaining only the not marked parcels on their markFieldName field.static org.geotools.data.simple.SimpleFeatureCollectiongetOnlyMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection in)Return aSimpleFeatureCollectioncontaining only the marked parcels on their markFieldName field.static intisAlreadyMarked(org.opengis.feature.simple.SimpleFeature feat)look if a parcel has themarkFieldNamefield and if it is positive or negative.static booleanisNoParcelMarked(org.geotools.data.simple.SimpleFeatureCollection sfcIn)return true if theSimpleFeatureCollectionhas no parcels where themarkFieldNamevalue equals 1.static booleanMarking parcels is made before (false) or after (true) the simulation process.static org.geotools.data.simple.SimpleFeatureCollectionmarkAllParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)Mark everySimpleFeatureform aSimpleFeatureCollectionon a newmarkFieldNamefield with a 1 (true).static org.geotools.data.simple.SimpleFeatureCollectionmarkAlreadyMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection parcelsMarked)Mark parcels that have already been marked on another simple collection feature.static org.geotools.data.simple.SimpleFeatureCollectionmarkBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile)Mark the built parcels.static org.geotools.data.simple.SimpleFeatureCollectionmarkBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection building)Mark the built parcels.static org.opengis.feature.simple.SimpleFeaturemarkParcel(org.opengis.feature.simple.SimpleFeature parcel)Mark a parcel's feat with value 1, either if they contain a markField attribute or not.static org.opengis.feature.simple.SimpleFeaturemarkParcel(org.opengis.feature.simple.SimpleFeature parcel, int value)Mark a parcel's feat, either if they contain a markField attribute or not.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectFrenchConstructibleZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile)Mark parcels that intersects that are usually constructible for French regulationstatic org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectFrenchConstructibleZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection zoning)Mark parcels that intersects that are usually constructible for French regulationstatic org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectGenericZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile)Mark parcels that intersects a certain type of generic zone.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectGenericZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)Mark parcels that intersects a certain type of generic zone.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectPolygonIntersection(org.geotools.data.simple.SimpleFeatureCollection parcels, File polygonIntersectionFile)Mark parcels that intersects a given collection of polygons.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectPolygonIntersection(org.geotools.data.simple.SimpleFeatureCollection parcels, List<org.locationtech.jts.geom.Geometry> geoms)Mark parcels that intersects a given collection of polygons.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectPreciseZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, File zoningFile)Mark parcels that intersects a certain type of Generic zoning.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectPreciseZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)Mark parcels that intersects a certain type of Generic zoning.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelIntersectZoningWithoutPreciseZonings(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, List<String> preciseZone, File zoningFile)Mark parcels that intersects a certain type of a generic zone but not mark them if they are from a given list of precise zone.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelOfCommunityNumber(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)Mark parcels if its community number equals a given valuestatic org.geotools.data.simple.SimpleFeatureCollectionmarkParcelOfCommunityType(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)Mark parcels if its community type equals a given valuestatic org.geotools.data.simple.SimpleFeatureCollectionmarkParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile)Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone)Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelsInf(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)Mark the parcels that size are superior or equal to a given threshold.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelsNotConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone)Mark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelsNotConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)Mark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelsSup(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)Mark the parcels that size are inferior to a given threshold.static org.geotools.data.simple.SimpleFeatureCollectionmarkParcelWithAttribute(org.geotools.data.simple.SimpleFeatureCollection parcels, String fieldName, String attribute)Mark parcels if one of its attribute equals a given valuestatic org.geotools.data.simple.SimpleFeatureCollectionmarkRandomParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, int nbParcelToMark, boolean markExistingMarks)Mark a given number of parcel for the simulation.static org.geotools.data.simple.SimpleFeatureCollectionmarkRandomParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile, double minSize, int nbParcelToMark, boolean markExistingMarks)Mark a given number of parcel for the simulation.static org.geotools.data.simple.SimpleFeatureCollectionmarkSFCWithAttributeField(org.geotools.data.simple.SimpleFeatureCollection parcels, String attributeFieldName, String attributeFieldValue)Mark parcels that meet a certain pattern in an attributestatic org.geotools.data.simple.SimpleFeatureCollectionmarkSimulatedParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)Mark a parcel if it has been simulated.static org.geotools.data.simple.SimpleFeatureCollectionmarkUnBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile)Mark the unbuilt parcels.static org.geotools.data.simple.SimpleFeatureCollectionmarkUnBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection buildingSFC)Mark the unbuilt parcels.static org.geotools.data.simple.SimpleFeatureCollectionmarkWorkflowSimulatedParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, WorkflowType workflowName)Mark a parcel if it has been simulated with a specific workflow.static org.geotools.data.simple.SimpleFeatureCollectionresetMarkingField(org.geotools.data.simple.SimpleFeatureCollection parcels)Affect a null value to every mark field of a parcel collection.static voidsetMarkFieldName(String markFieldName)Set the name of the field containing the parcel's markstatic voidsetPostMark(boolean postMark)Specify that the marking is made before (false) or after (true) the simulation process.static voidsignalIfNoParcelMarked(org.geotools.data.simple.SimpleFeatureCollection sfcIn, String methodName)Write on the console if a set of parcels haven't been marked at all.static org.geotools.data.simple.SimpleFeatureCollectionunionTouchingMarkedGeometries(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)Merge SimpleFeatures that are marked and touches each other and keep the attribute of the largest feature
-
Constructor Details
-
MarkParcelAttributeFromPosition
public MarkParcelAttributeFromPosition()
-
-
Method Details
-
markParcelsConnectedToRoad
public static org.geotools.data.simple.SimpleFeatureCollection markParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile) throws IOExceptionMark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)- Parameters:
parcels- Input parcelSimpleFeatureCollectionblock-SimpleFeatureCollectioncontaining the morphological block. Can be generated with theCityGeneration.createUrbanBlock(SimpleFeatureCollection)method.roadFile- Geopackage containing the road segments- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading roadFile
-
markParcelsConnectedToRoad
public static org.geotools.data.simple.SimpleFeatureCollection markParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone) throws IOExceptionMark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)- Parameters:
parcels- Input parcelSimpleFeatureCollectionblock-SimpleFeatureCollectioncontaining the morphological block. Can be generated with theCityGeneration.createUrbanBlock(SimpleFeatureCollection)method.roadFile- Geo file containing the road segmentsexclusionZone- Zone to be excluded for not counting an empty parcel as a road- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading roadFile
-
markParcelsConnectedToRoad
public static org.geotools.data.simple.SimpleFeatureCollection markParcelsConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)Mark the parcels that have a connection to the road network, represented either by the void of parcels or road lines (optional)- Parameters:
parcels- Input parcelSimpleFeatureCollectionblock-SimpleFeatureCollectioncontaining the morphological block. Can be generated with theCityGeneration.createUrbanBlock(SimpleFeatureCollection)method.road- road segmentsexclusionZone- Zone to be excluded for not counting an empty parcel as a road- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelsNotConnectedToRoad
public static org.geotools.data.simple.SimpleFeatureCollection markParcelsNotConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, File roadFile, org.locationtech.jts.geom.Geometry exclusionZone) throws IOExceptionMark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).- Parameters:
parcels- Input parcelSimpleFeatureCollectionblock-SimpleFeatureCollectioncontaining the morphological block. Can be generated with theCityGeneration.createUrbanBlock(SimpleFeatureCollection)method.roadFile- road FileexclusionZone- Zone to be excluded for not counting an empty parcel as a road- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException
-
markParcelsNotConnectedToRoad
public static org.geotools.data.simple.SimpleFeatureCollection markParcelsNotConnectedToRoad(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection block, org.geotools.data.simple.SimpleFeatureCollection road, org.locationtech.jts.geom.Geometry exclusionZone)Mark the parcels that have no connection to the road network, represented either by the void of parcels or road lines (optional).- Parameters:
parcels- Input parcelSimpleFeatureCollectionblock-SimpleFeatureCollectioncontaining the morphological block. Can be generated with theCityGeneration.createUrbanBlock(SimpleFeatureCollection)method.road- road segmentsexclusionZone- Zone to be excluded for not counting an empty parcel as a road- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelsInf
public static org.geotools.data.simple.SimpleFeatureCollection markParcelsInf(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)Mark the parcels that size are superior or equal to a given threshold.- Parameters:
parcels- Input parcelSimpleFeatureCollectionsize- Area threshold- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelsSup
public static org.geotools.data.simple.SimpleFeatureCollection markParcelsSup(org.geotools.data.simple.SimpleFeatureCollection parcels, double size)Mark the parcels that size are inferior to a given threshold.- Parameters:
parcels- Input parcelSimpleFeatureCollectionsize- Area threshold- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markRandomParcels
public static org.geotools.data.simple.SimpleFeatureCollection markRandomParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, int nbParcelToMark, boolean markExistingMarks) throws IOExceptionMark a given number of parcel for the simulation. The selection is random but parcels must be bigger than a certain area threshold.- Parameters:
parcels- Input parcelSimpleFeatureCollectionnbParcelToMark- number of parcel wantedmarkExistingMarks- if true, randomly marked parcels will only be pe-existing parcels. If false, random follows a new selection- Returns:
SimpleFeatureCollectionof the input parcels with random marked parcels on themarkFieldNamefield.- Throws:
IOException- reading zoningFile
-
markRandomParcels
public static org.geotools.data.simple.SimpleFeatureCollection markRandomParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile, double minSize, int nbParcelToMark, boolean markExistingMarks) throws IOExceptionMark a given number of parcel for the simulation. The selection is random but parcels can be bigger than a certain area threshold and can be contained is a given zoning type.- Parameters:
parcels- Input parcelSimpleFeatureCollectionminSize- Minimal size of parcels to be selected (optional)genericZone- Type of the zoning plan to take into considerationzoningFile- Geopackage containing the zoning plannbParcelToMark- Number of parcel wantedmarkExistingMarks- if true, randomly marked parcels will only be pe-existing parcels. If false, random follows a new selection- Returns:
SimpleFeatureCollectionof the input parcels with random marked parcels on themarkFieldNamefield.- Throws:
IOException- reading zoningFile
-
markUnBuiltParcel
public static org.geotools.data.simple.SimpleFeatureCollection markUnBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile) throws IOExceptionMark the unbuilt parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition- Parameters:
parcels- Input parcelSimpleFeatureCollectionbuildingFile- Geo file containing building features- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading building file
-
markUnBuiltParcel
public static org.geotools.data.simple.SimpleFeatureCollection markUnBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection buildingSFC)Mark the unbuilt parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition- Parameters:
parcels- Input parcelSimpleFeatureCollectionbuildingSFC- building features- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markBuiltParcel
public static org.geotools.data.simple.SimpleFeatureCollection markBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, File buildingFile) throws IOExceptionMark the built parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition- Parameters:
parcels- Input parcelSimpleFeatureCollectionbuildingFile- Geo file representing the buildings- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading building file
-
markBuiltParcel
public static org.geotools.data.simple.SimpleFeatureCollection markBuiltParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection building)Mark the built parcels. Subtract a buffer of 1 meters on the buildings to avoid blurry parcel and building definition- Parameters:
parcels- Input parcelSimpleFeatureCollectionbuilding- collection of buildings- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelIntersectPolygonIntersection
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPolygonIntersection(org.geotools.data.simple.SimpleFeatureCollection parcels, List<org.locationtech.jts.geom.Geometry> geoms)Mark parcels that intersects a given collection of polygons. The default field name containing the mark is "SPLIT" but it can be changed with thesetMarkFieldName(String)method. Less optimized method that takes a Geometry as an input- Parameters:
parcels- Input parcelSimpleFeatureCollectiongeoms- aListofGeometrywhich can intersect parcels- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelIntersectPolygonIntersection
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPolygonIntersection(org.geotools.data.simple.SimpleFeatureCollection parcels, File polygonIntersectionFile) throws IOExceptionMark parcels that intersects a given collection of polygons. The default field name containing the mark is "SPLIT" but it can be changed with thesetMarkFieldName(String)method.- Parameters:
parcels- Input parcelSimpleFeatureCollectionpolygonIntersectionFile- A Geopackage containing the collection of polygons- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading polygonIntersectionFile
-
markSFCWithAttributeField
public static org.geotools.data.simple.SimpleFeatureCollection markSFCWithAttributeField(org.geotools.data.simple.SimpleFeatureCollection parcels, String attributeFieldName, String attributeFieldValue)Mark parcels that meet a certain pattern in an attribute- Parameters:
parcels- InputSimpleFeatureCollectionattributeFieldName- Name of the attribute fieldattributeFieldValue- Value of the attribute field to mark- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield
-
markParcelIntersectGenericZoningType
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectGenericZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, File zoningFile) throws IOExceptionMark parcels that intersects a certain type of generic zone.- Parameters:
parcels- Input parcelSimpleFeatureCollectiongenericZone- The big kind of the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be toleratezoningFile- A Geopackage containing the zoning plan- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading zoningFile
-
markParcelIntersectGenericZoningType
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectGenericZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)Mark parcels that intersects a certain type of generic zone.- Parameters:
parcels- Input parcelSimpleFeatureCollectiongenericZone- The big kind of the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be toleratezoningSFC- Collection of the zoning plan- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelIntersectZoningWithoutPreciseZonings
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectZoningWithoutPreciseZonings(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, List<String> preciseZone, File zoningFile) throws IOExceptionMark parcels that intersects a certain type of a generic zone but not mark them if they are from a given list of precise zone.- Parameters:
parcels- Input parcelSimpleFeatureCollectiongenericZone- The big kind of the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be toleratepreciseZone- List of precise zone to not take into accountzoningFile- A Geopackage containing the zoning plan- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading zoningFile
-
markParcelIntersectPreciseZoningType
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPreciseZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, File zoningFile) throws IOExceptionMark parcels that intersects a certain type of Generic zoning.- Parameters:
parcels- Input parcelSimpleFeatureCollectiongenericZone- The generic type the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be toleratepreciseZone- The precise zoning type. Can be anything.zoningFile- A geo file containing the zoning plan.- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading zoningFile
-
markParcelIntersectPreciseZoningType
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectPreciseZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, String genericZone, String preciseZone, org.geotools.data.simple.SimpleFeatureCollection zoningSFC)Mark parcels that intersects a certain type of Generic zoning.- Parameters:
parcels- Input parcelSimpleFeatureCollectiongenericZone- The generic type the zoning (either not constructible (NC), urbanizable (U) or to be urbanize (TBU). Other keywords can be toleratepreciseZone- The precise zoning type. Can be anything.zoningSFC- Collection of zoning. An interesection trim with parcels is made.- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelIntersectFrenchConstructibleZoningType
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectFrenchConstructibleZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, File zoningFile) throws IOExceptionMark parcels that intersects that are usually constructible for French regulation- Parameters:
parcels- Input parcelSimpleFeatureCollectionzoningFile- A geo file containing the zoning plan- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.- Throws:
IOException- reading zoningFile
-
markParcelIntersectFrenchConstructibleZoningType
public static org.geotools.data.simple.SimpleFeatureCollection markParcelIntersectFrenchConstructibleZoningType(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection zoning)Mark parcels that intersects that are usually constructible for French regulation- Parameters:
parcels- Input parcelSimpleFeatureCollectionzoning- A collection containing the zoning plan- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markParcelOfCommunityType
public static org.geotools.data.simple.SimpleFeatureCollection markParcelOfCommunityType(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)Mark parcels if its community type equals a given value- Parameters:
parcels- parcel featureattribute- value for the community type to be marked- Returns:
- the collection with marked parcels
-
markParcelOfCommunityNumber
public static org.geotools.data.simple.SimpleFeatureCollection markParcelOfCommunityNumber(org.geotools.data.simple.SimpleFeatureCollection parcels, String attribute)Mark parcels if its community number equals a given value- Parameters:
parcels- parcel featureattribute- value for the community number to be marked- Returns:
- the collection with marked parcels
-
markParcelWithAttribute
public static org.geotools.data.simple.SimpleFeatureCollection markParcelWithAttribute(org.geotools.data.simple.SimpleFeatureCollection parcels, String fieldName, String attribute)Mark parcels if one of its attribute equals a given value- Parameters:
parcels- parcel featurefieldName- name of the fieldattribute- value for the given field to be marked- Returns:
- the collection with marked parcels
-
getMarkFieldName
Get the name of the field containing the parcel's mark- Returns:
- the field name
-
setMarkFieldName
Set the name of the field containing the parcel's mark- Parameters:
markFieldName- the field name
-
markAlreadyMarkedParcels
public static org.geotools.data.simple.SimpleFeatureCollection markAlreadyMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection parcels, org.geotools.data.simple.SimpleFeatureCollection parcelsMarked)Mark parcels that have already been marked on another simple collection feature. They may not have the same attribute, so we rely on geometries- Parameters:
parcels- Parcel collection to copy the marks on. Could have a markFieldName or not.parcelsMarked- Parcel collection that has a markFieldName field- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markSimulatedParcel
public static org.geotools.data.simple.SimpleFeatureCollection markSimulatedParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)Mark a parcel if it has been simulated. This is done using the section field name and the methodGeneralFields.isParcelHasSimulatedFields(SimpleFeature).- Parameters:
parcels- Input parcelSimpleFeatureCollection- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markWorkflowSimulatedParcel
public static org.geotools.data.simple.SimpleFeatureCollection markWorkflowSimulatedParcel(org.geotools.data.simple.SimpleFeatureCollection parcels, WorkflowType workflowName)Mark a parcel if it has been simulated with a specific workflow. This is done using the section field name and the methodGeneralFields.isParcelHasSimulatedFields(SimpleFeature).- Parameters:
parcels- Input parcelSimpleFeatureCollectionworkflowName- can either be- densification
- consolidation
- zone
- Returns:
SimpleFeatureCollectionof the input parcels with marked parcels on themarkFieldNamefield.
-
markAllParcel
public static org.geotools.data.simple.SimpleFeatureCollection markAllParcel(org.geotools.data.simple.SimpleFeatureCollection parcels)Mark everySimpleFeatureform aSimpleFeatureCollectionon a newmarkFieldNamefield with a 1 (true). Untested if the collection already contains themarkFieldNamefield.- Parameters:
parcels- inputSimpleFeatureCollection- Returns:
- input
SimpleFeatureCollectionwith a newmarkFieldNamefield with only 1 (true) in it.
-
isAlreadyMarked
public static int isAlreadyMarked(org.opengis.feature.simple.SimpleFeature feat)look if a parcel has themarkFieldNamefield and if it is positive or negative. Also look if a parcel has already been simulated. The default method for the kind of nomenclature is used. If already simulated and not inpostMarkmode, we won't re-simulate it.- Parameters:
feat- input SimpleFeature- Returns:
- If no mark field or the field is unset, return -1
- If mark field is set to 0, return 0
- If mark field is set to 1, return 1
-
signalIfNoParcelMarked
public static void signalIfNoParcelMarked(org.geotools.data.simple.SimpleFeatureCollection sfcIn, String methodName)Write on the console if a set of parcels haven't been marked at all. Making that function a lil earlier could have saved me a lot of time- Parameters:
sfcIn- InputSimpleFeatureCollectionmethodName- Name of the method to wave this name if no parcels have been marked
-
isNoParcelMarked
public static boolean isNoParcelMarked(org.geotools.data.simple.SimpleFeatureCollection sfcIn)return true if theSimpleFeatureCollectionhas no parcels where themarkFieldNamevalue equals 1.- Parameters:
sfcIn- input collection- Returns:
- true is no parcels are marked, false otherwise
-
getOnlyMarkedParcels
public static org.geotools.data.simple.SimpleFeatureCollection getOnlyMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection in)Return aSimpleFeatureCollectioncontaining only the marked parcels on their markFieldName field.- Parameters:
in- inputSimpleFeatureCollectionwith marking attribute- Returns:
SimpleFeatureCollectionwith only marked parcels and same schema as input
-
getNotMarkedParcels
public static org.geotools.data.simple.SimpleFeatureCollection getNotMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection in)Return aSimpleFeatureCollectioncontaining only the not marked parcels on their markFieldName field.- Parameters:
in- inputSimpleFeatureCollectionwith marking attribute- Returns:
SimpleFeatureCollectionwith only marked parcels and same schema as input
-
resetMarkingField
public static org.geotools.data.simple.SimpleFeatureCollection resetMarkingField(org.geotools.data.simple.SimpleFeatureCollection parcels)Affect a null value to every mark field of a parcel collection.- Parameters:
parcels- input parcel collection to remove mark.- Returns:
- collection with null values in the marking field.
-
unionTouchingMarkedGeometries
public static org.geotools.data.simple.SimpleFeatureCollection unionTouchingMarkedGeometries(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)Merge SimpleFeatures that are marked and touches each other and keep the attribute of the largest feature- Parameters:
parcelCollection- input parcel collection to mark- Returns:
- The collection with the same schema and its touching parcels merged
-
isPostMark
public static boolean isPostMark()Marking parcels is made before (false) or after (true) the simulation process. It won't allow or will the marking of the already simulated parcels- Returns:
- value
-
setPostMark
public static void setPostMark(boolean postMark)Specify that the marking is made before (false) or after (true) the simulation process. It won't allow or will the marking of the already simulated parcels- Parameters:
postMark- new value
-
countMarkedParcels
public static long countMarkedParcels(org.geotools.data.simple.SimpleFeatureCollection parcelCollection)Count how many parcels of a set are marked.- Parameters:
parcelCollection- input parcel collection to count- Returns:
- number of marked parcels
-
markParcel
public static org.opengis.feature.simple.SimpleFeature markParcel(org.opengis.feature.simple.SimpleFeature parcel)Mark a parcel's feat with value 1, either if they contain a markField attribute or not.- Parameters:
parcel- input parcel to mark.- Returns:
- the parcel marked (possibly with an extra attribute)
-
markParcel
public static org.opengis.feature.simple.SimpleFeature markParcel(org.opengis.feature.simple.SimpleFeature parcel, int value)Mark a parcel's feat, either if they contain a markField attribute or not.- Parameters:
parcel- input parcel to mark.value- whether 0 (won't be simulated) or 1 (will be simulated)- Returns:
- the parcel marked (possibly with an extra attribute)
-