Package nwsWeatherApi
Class Point
java.lang.Object
nwsWeatherApi.Point
Wraps the PointGeoJson schema of the NWS API.
- Author:
- cobalt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the compass angle from the point towards the city returned bycity().city()Returns the nearest city.county()Returns the county code for the point.doubleReturns the Point's distance from the city returned bycity()in meters.fireZone()Returns the fire weather zone code for the point.Returns theGridpointForecastfor the point.intgridX()Returns the X coordinate of the Point's grid within the WFO.intgridY()Returns the Y coordinate of the Point's grid within the WFO.doublelatitude()Returns the Point's latitude.doubleReturns the Point's longitude.office()Returns the WFO responsible for the point.radar()Returns the callsign of the radar station responsible for the point.timezone()Returns a String representation of the Point's timezone.zone()Returns the zone code for the point.Returns theZoneForecastfor the point.
-
Constructor Details
-
Point
public Point(double latitude, double longitude) Creates a Point object with the given latitude and longitude. Coordinates must be in the NWS's jurisdiction.- Parameters:
latitude-longitude-
-
Point
public Point(com.github.cliftonlabs.json_simple.JsonObject obj) Creates a point object using a valid NWS API JSON of the PointGeoJson schema.- Parameters:
obj-
-
-
Method Details
-
office
Returns the WFO responsible for the point.- Returns:
-
gridX
public int gridX()Returns the X coordinate of the Point's grid within the WFO.- Returns:
-
gridY
public int gridY()Returns the Y coordinate of the Point's grid within the WFO.- Returns:
-
bearingFromCity
public int bearingFromCity()Returns the compass angle from the point towards the city returned bycity().- Returns:
-
zone
Returns the zone code for the point.- Returns:
-
fireZone
Returns the fire weather zone code for the point.- Returns:
-
county
Returns the county code for the point.- Returns:
-
radar
Returns the callsign of the radar station responsible for the point.- Returns:
-
city
Returns the nearest city. Direction and distance from the point can be found usingbearingFromCity()anddistanceFromCity().- Returns:
-
timezone
Returns a String representation of the Point's timezone.- Returns:
-
distanceFromCity
public double distanceFromCity()Returns the Point's distance from the city returned bycity()in meters.- Returns:
-
latitude
public double latitude()Returns the Point's latitude.- Returns:
-
longitude
public double longitude()Returns the Point's longitude.- Returns:
-
zoneForecast
Returns theZoneForecastfor the point.- Returns:
-
gridpointForecast
Returns theGridpointForecastfor the point.- Returns:
-