Description
Passes the product based on its latitude and longitude. The product must have two metadata attributes "latitude" and "longitude"All points are expressed in latitude and longitude in a format of DDD.MM.SSA, where DDD is degrees (0 - 90 for latitude and 0 - 180 for longitude), MM is minutes (0 - 59), SS is seconds (0 - 59), and A is N for North, S for South, E for East, and W for West.
Configuration Variables
latitudesThe latitudes of the polygon points.longitudes
The longitudes of the polygon points.centerLatitude
The latitude of center of the polygon.centerLongitude
The longitude of center of the polygon.region
The region indicator of either 'inside' or 'outside' the polygon.Product
- Product is null if there are no sources, no latitude or longitude attribute on the source, or if location of the source is not within the user specified polygon.
If the location of the source is within the user specified polygon then the product is passed to the sinks without change.
How it works
The region is ultimately represented by the Java Polygon class. In order to form the polygon and use it to determine if a point is within the world region it represents, the user must specify three inputs. The first is a series of latitude and longitude pairs that form the boundary of the polygon. The second is the latitude and longitude of the approximate center of the polygon. Since the Polygon class is composed of X/Y pairs, the latitude amd longitude pairs must be converted to X and Y coordinates with respect to the center of the polygon. Furthermore these calculations are as accurate as the closeness of the center to the boundary of the polygon. As an example, the user might want a polygon that encompasses New England (a relatively small section of the world) or the desire might be for all of the world except for that area (a relatively large section of the world). Thus in order for the conversion to be accurate the user must always specify the center of the smaller region of the world represented by the boundary of the polygon. The third input is an inside or outside of the polygon indicator. If the user wanted the region of the world that was specified by the other two inputs, then the indicator should be set to inside. If the user really wanted all the world except for the specified region, then the indicator should be set to outside.The user specified polygon point latitudes and longitudes are converted to X and Y coordinates with respect to the user specified polygon center latitude and longitude. The source's latitude and longitude is also converted to X and Y coordinates with respect to the same polygon center. The Polygon class 'contains' method is called to see if the source is within the polygon. The source is passed along if:
- Source is within the polygon and the user specified inside as the region indicator.
- Source is not within the polygon and the user specified outside as the region indicator.
Otherwise null is passed along.
Revised: 9 February 1999