Class ServiceAreaFacility


  • public final class ServiceAreaFacility
    extends Object
    Represents service area facility. A facility represents a location from which service areas need to be calculated. For example, a fire station can be set as a facility to find which areas it can serve within a 10 minute service area. A hospital can be set as the facility to find what proportion of the population is within a 2 mile driving distance. Facilities are part of ServiceAreaParameters which is used as an input to ServiceAreaTask.solveServiceAreaAsync(ServiceAreaParameters).
    Since:
    100.1.0
    • Constructor Detail

      • ServiceAreaFacility

        public ServiceAreaFacility​(Point point)
        Creates an instance of service area facility.
        Parameters:
        point - location of the service area facility
        Throws:
        IllegalArgumentException - if point is null
        Since:
        100.1.0
    • Method Detail

      • getName

        public String getName()
        Gets the name that was set for this facility.
        Returns:
        the facility's name, default value is an empty string
        Since:
        100.1.0
      • setName

        public void setName​(String name)
        Sets the name for this facility.
        Parameters:
        name - the facility's name, null is treated as an empty string
        Since:
        100.1.0
      • setCurbApproach

        public void setCurbApproach​(CurbApproach curbApproach)
        Sets the direction from which a vehicle may arrive at or depart from the facility. For example, a school bus must approach and depart a school from its door side so that students entering/exiting the bus will not have to cross the street.
        Parameters:
        curbApproach - the facility's curb approach
        Throws:
        IllegalArgumentException - if curbApproach is null
        Since:
        100.1.0
      • getNetworkLocation

        public NetworkLocation getNetworkLocation()
        Gets the facility's location in the underlying transportation network.
        Returns:
        the facility's network location, returns null by default
        Since:
        100.1.0
      • setNetworkLocation

        public void setNetworkLocation​(NetworkLocation networkLocation)
        Sets the facility's location in the underlying transportation network.
        Parameters:
        networkLocation - the facility's network location, it can be null
        Since:
        100.1.0
      • getImpedanceCutoffs

        public List<Double> getImpedanceCutoffs()
        Gets the list of impedance cutoffs.

        Cutoffs specify the quantity of the impedance to apply. They constrain the extent of the service area to be calculated. For example, if you apply cutoffs of 5, 10, and 15 when the impedance is set to Time, the service area will include those streets than can be reached within 5, 10, and 15 minutes. The value specified in the impedance cutoffs property overrides the default cutoffs analysis setting. If no value for the impedance cutoffs property is specified, service areas are generated for the facility based on the default cutoffs setting.

        Returns:
        a modifiable list of impedance cutoffs
        Since:
        100.1.0
        See Also:
        ServiceAreaTaskInfo.getDefaultImpedanceCutoffs(), ServiceAreaParameters.getDefaultImpedanceCutoffs()
      • getDistanceToNetworkLocation

        public double getDistanceToNetworkLocation()
        Gets the distance to the network location in meters.
        Returns:
        the facility's distance to the network location in meters, returns NaN by default
        Since:
        100.1.0
      • getGeometry

        public Point getGeometry()
        Gets the location the facility should be placed on the map.
        Returns:
        the facility's geometry
        Since:
        100.1.0
      • getAddedCost

        public double getAddedCost​(String attributeName)
        Gets the added cost that was set for a given cost attribute for this facility.

        All supported attributes can be obtained from ServiceAreaTaskInfo.getCostAttributes().

        Parameters:
        attributeName - the name of the cost attribute, it can be empty, null is treated as an empty string
        Returns:
        the added cost, returns 0 if it was not set
        Since:
        100.1.0
      • setAddedCost

        public void setAddedCost​(String attributeName,
                                 double addedCost)
        Sets the added cost for a given cost attribute for this facility.

        Passing null or empty name of attribute will create an attribute with 0.0 value. All supported attributes can be obtained from ServiceAreaTaskInfo.getCostAttributes().

        Parameters:
        attributeName - the name of the cost attribute, it can be empty, null is treated as an empty string
        addedCost - added cost
        Since:
        100.1.0