Class ParcelState
java.lang.Object
fr.ign.artiscales.pm.parcelFunction.ParcelState
Methods to get information about parcel about their geometry, position in the geographic environment, etc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcountParcelNeighborhood(org.locationtech.jts.geom.Geometry parcelGeom, org.geotools.data.simple.SimpleFeatureCollection parcels)static DoublegetCloseEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)Get the evaluation of a cell generated by MUP-City and close to the input parcelstatic doubleGet the default width for road segment (7.5 by default).static DoublegetEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, File outMup)Get the evaluation of a cell generated by MUP-City and contained in a input parcelstatic DoublegetEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)Get the evaluation of a cell generated by MUP-City and contained in a input parcelstatic doublegetParcelFrontSideWidth(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, List<org.locationtech.jts.geom.LineString> ext)Determine the width of the parcel on road.static List<org.locationtech.jts.geom.Geometry>getRoadPolygon(org.geotools.data.simple.SimpleFeatureCollection roads)Get a list of the surrounding buffered road segments.static StringGet the name of the field containing attribute which indicates the width of road segments (LARGEUR by default) .static booleanisAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea)This algorithm looks if a parcel is overlapped by a building and returns true if they are.static booleanisAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask)This method looks if a parcel is overlapped by a building and returns true if they are.static booleanisAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask, double uncountedBuildingArea)This algorithm looks if a parcel is overlapped by a building and returns true if they are.static booleanisAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.locationtech.jts.geom.Geometry parcelGeom, double bufferBati, double uncountedBuildingArea)This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.static booleanisAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel)This method looks if a parcel is overlapped by a building and returns true if they are.static booleanisAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea)This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.static booleanisArt3AllowsIsolatedParcel(String insee, File predicateFile)Return false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be done.static booleanisArt3AllowsIsolatedParcel(org.opengis.feature.simple.SimpleFeature feat, File predicateFile)Return false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be donestatic booleanisParcelHasRoadAccess(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext)Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways.static booleanisParcelHasRoadAccess(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext, org.locationtech.jts.geom.Geometry disabledBuffer)Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways.static StringparcelInGenericZone(File zoningFile, org.opengis.feature.simple.SimpleFeature parcelIn)Return a single Zone Generic Name that a parcels intersect.static StringparcelInTypo(File communityFile, org.opengis.feature.simple.SimpleFeature parcelIn, String typoAttribute)return a single typology that a parcels intersect if the parcel intersects multiple, we select the one that covers the most areastatic voidsetDefaultWidthRoad(double defaultWidthRoad)Set the default width for road segmentstatic voidsetWidthFieldAttribute(String widthFieldAttribute)Set the name of the field containing attribute which indicates the width of road segments.
-
Constructor Details
-
ParcelState
public ParcelState()
-
-
Method Details
-
countParcelNeighborhood
public static int countParcelNeighborhood(org.locationtech.jts.geom.Geometry parcelGeom, org.geotools.data.simple.SimpleFeatureCollection parcels) -
getRoadPolygon
public static List<org.locationtech.jts.geom.Geometry> getRoadPolygon(org.geotools.data.simple.SimpleFeatureCollection roads)Get a list of the surrounding buffered road segments.The buffer length is calculated with an attribute field. The default name of the field is LARGEUR and can be set with the
setWidthFieldAttribute(String)method. If no field is found, a default value of 7.5 meters is used (this default value can be set with thesetDefaultWidthRoad(double)method).- Parameters:
roads- collection of road- Returns:
- The list of the surrounding buffered road segments.
-
getParcelFrontSideWidth
public static double getParcelFrontSideWidth(org.locationtech.jts.geom.Polygon p, org.geotools.data.simple.SimpleFeatureCollection roads, List<org.locationtech.jts.geom.LineString> ext)Determine the width of the parcel on road. We first rely on the absance of parcel. If none found, we rely on the road features.- Parameters:
p- inputPolygonroads- Road collection (can be null)ext- lines of the outside block- Returns:
- width of the parcel on road
-
isParcelHasRoadAccess
public static boolean isParcelHasRoadAccess(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext)Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways. This could be a road Geopackage or aGeometryrepresenting the exterior of a parcel plan.- Parameters:
poly- input polygonroads- input road Geopacakge (can be null)ext- External polygon- Returns:
- true is the polygon has a road access
-
isParcelHasRoadAccess
public static boolean isParcelHasRoadAccess(org.locationtech.jts.geom.Polygon poly, org.geotools.data.simple.SimpleFeatureCollection roads, org.locationtech.jts.geom.MultiLineString ext, org.locationtech.jts.geom.Geometry disabledBuffer)Indicate if the given polygon has a proximity to the road, which can be represented by multiple ways. This could be a road Geopacakge or aGeometryrepresenting the exterior of a parcel plan. Some emptyGeometrycan represent an exclusion zone which won't be taken as a road space when empty of parcels- Parameters:
poly- input polygonroads- input road Geopacakge (can be null)ext- External polygondisabledBuffer- AGeometrythat cannot be considered as absence of road. Can be null- Returns:
- true is the polygon has a road access
-
isArt3AllowsIsolatedParcel
public static boolean isArt3AllowsIsolatedParcel(org.opengis.feature.simple.SimpleFeature feat, File predicateFile) throws IOExceptionReturn false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be done- Parameters:
feat- The parcel (which has to be French)predicateFile- The table containing urban rules. If null or not set, will return false- Returns:
- false by default
- Throws:
IOException- reading .csv file
-
isArt3AllowsIsolatedParcel
public static boolean isArt3AllowsIsolatedParcel(String insee, File predicateFile) throws IOExceptionReturn false if the parcel mandatory needs a contact with the road to be urbanized. return true otherwise TODO haven't done it for the zones because I only found communities that set the same rule regardless of the zone, but that could be done.- Parameters:
insee- The community number of the concerned citypredicateFile- The table containing urban rules. If null or not set, will return false- Returns:
- false by default
- Throws:
IOException- reading predicate
-
isAlreadyBuilt
public static boolean isAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel)This method looks if a parcel is overlapped by a building and returns true if they are.- Parameters:
buildingSFC- building collectionparcel- input parcel- Returns:
- True if a building is really intersecting the parcel
-
isAlreadyBuilt
public static boolean isAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask) throws IOExceptionThis method looks if a parcel is overlapped by a building and returns true if they are.- Parameters:
buildingFile- building collectionparcel- input parcelmask- polygon with mask which will select every overlapping features- Returns:
- True if a building is really intersecting the parcel
- Throws:
IOException- reading building file
-
isAlreadyBuilt
public static boolean isAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, org.locationtech.jts.geom.Geometry mask, double uncountedBuildingArea) throws IOExceptionThis algorithm looks if a parcel is overlapped by a building and returns true if they are. Overload of theisAlreadyBuilt(SimpleFeatureCollection, SimpleFeature, double, double)to select only a selection of buildings- Parameters:
buildingFile- geo file containing buildingparcel- parcel featuremask- geographical bounding representing our zone. Features outside this zone won't be considered. Can be null.uncountedBuildingArea- threshold under where a building is not considered- Returns:
- True if a building is really intersecting the parcel
- Throws:
IOException- reading building file
-
isAlreadyBuilt
public static boolean isAlreadyBuilt(File buildingFile, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea) throws IOExceptionThis algorithm looks if a parcel is overlapped by a building and returns true if they are.- Parameters:
buildingFile- geo file containing buildingparcel- parcel featurebufferBati- apply a buffer on every building (mostly negative buffers)uncountedBuildingArea- threshold under where a building is not considered- Returns:
- True if a building is really intersecting the parcel
- Throws:
IOException- reading building file
-
isAlreadyBuilt
public static boolean isAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.opengis.feature.simple.SimpleFeature parcel, double bufferBati, double uncountedBuildingArea)This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.- Parameters:
buildingSFC- building collectionparcel- parcel featurebufferBati- apply a buffer on every building (mostly negative buffers)uncountedBuildingArea- threshold under where a building is not considered- Returns:
- True if a building is really intersecting the parcel
-
isAlreadyBuilt
public static boolean isAlreadyBuilt(org.geotools.data.simple.SimpleFeatureCollection buildingSFC, org.locationtech.jts.geom.Geometry parcelGeom, double bufferBati, double uncountedBuildingArea)This algorithm looks if a parcel is overlapped by a building+a buffer (in most of the cases, buffer is negative to delete small parts of buildings that can slightly overla a parcel) and returns true if they are.- Parameters:
buildingSFC- building collectionparcelGeom- parcel geometrybufferBati- apply a buffer on every building (mostly negative buffers)uncountedBuildingArea- threshold under where a building is not considered- Returns:
- True if a building is really intersecting the parcel
-
getEvalInParcel
public static Double getEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, File outMup) throws IOExceptionGet the evaluation of a cell generated by MUP-City and contained in a input parcel- Parameters:
parcel- InputSimpleFeatureparceloutMup- Shapefile to the vectorized MUP-City output- Returns:
- The best evaluation of the intersected MUP-City's cells
- Throws:
IOException- reading MUP-City's output
-
getEvalInParcel
public static Double getEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)Get the evaluation of a cell generated by MUP-City and contained in a input parcel- Parameters:
parcel- InputSimpleFeatureparcelmupSFC-SimpleFeatureCollectionof MUP-City's outputs- Returns:
- The best evaluation of the intersected MUP-City's cells
-
getCloseEvalInParcel
public static Double getCloseEvalInParcel(org.opengis.feature.simple.SimpleFeature parcel, org.geotools.data.simple.SimpleFeatureCollection mupSFC)Get the evaluation of a cell generated by MUP-City and close to the input parcel- Parameters:
parcel- InputSimpleFeatureparcelmupSFC-SimpleFeatureCollectionof MUP-City's outputs- Returns:
- The best evaluation of the MUP-City's cells near the parcel every 5 meters. Return 0 if the cells are 100 meters far from the parcels.
-
parcelInGenericZone
public static String parcelInGenericZone(File zoningFile, org.opengis.feature.simple.SimpleFeature parcelIn) throws IOExceptionReturn a single Zone Generic Name that a parcels intersect. If the parcel intersects multiple, we select the one that covers the most area- Parameters:
parcelIn- input parcelzoningFile- geo file containing zoning file- Returns:
- Zone Generic Name that a parcels intersect
- Throws:
IOException- reading zoning file
-
parcelInTypo
public static String parcelInTypo(File communityFile, org.opengis.feature.simple.SimpleFeature parcelIn, String typoAttribute) throws IOExceptionreturn a single typology that a parcels intersect if the parcel intersects multiple, we select the one that covers the most area- Parameters:
parcelIn- input parcelcommunityFile- geo file containing the communitiestypoAttribute- the field name of the typo- Returns:
- the number of most intersected community type
- Throws:
IOException- reading community file
-
getWidthFieldAttribute
Get the name of the field containing attribute which indicates the width of road segments (LARGEUR by default) .- Returns:
- the name of the field
-
setWidthFieldAttribute
Set the name of the field containing attribute which indicates the width of road segments.- Parameters:
widthFieldAttribute- new name of the field
-
getDefaultWidthRoad
public static double getDefaultWidthRoad()Get the default width for road segment (7.5 by default).- Returns:
- Width in meters
-
setDefaultWidthRoad
public static void setDefaultWidthRoad(double defaultWidthRoad)Set the default width for road segment- Parameters:
defaultWidthRoad- new width in meters
-