Class GeocoordNormalization
- java.lang.Object
-
- org.opensextant.extractors.xcoord.GeocoordNormalization
-
public final class GeocoordNormalization extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description GeocoordNormalization()
-
Method Summary
Modifier and Type Method Description static boolean
evaluateSpecificity(DMSOrdinate lat, DMSOrdinate lon)
Hueuristic for what style of fields are allowed in valid DD or DM/DMS coordinates.static boolean
filter_out(GeocoordMatch m)
Not all pattens might have filters.static void
normalize_coordinate(GeocoordMatch m, java.util.Map<java.lang.String,TextEntity> groups)
The match object is normalized, setting the coord_text and other data from parsing "text" and knowing which pattern family was matched.static void
set_precision(GeocoordMatch m)
set the precision on a match based on the situation (match + pattern).
-
-
-
Method Detail
-
normalize_coordinate
public static void normalize_coordinate(GeocoordMatch m, java.util.Map<java.lang.String,TextEntity> groups) throws NormalizationException
The match object is normalized, setting the coord_text and other data from parsing "text" and knowing which pattern family was matched.- Parameters:
m
- matchgroups
- fields- Throws:
NormalizationException
- if entity or match is not parseable
-
filter_out
public static boolean filter_out(GeocoordMatch m)
Not all pattens might have filters. This "filter_out" implies you should evaluate the MatchFilter.stop() method on any implementation.- Parameters:
m
- the match- Returns:
- true if match is invalid and should be marked as filtered out
-
evaluateSpecificity
public static boolean evaluateSpecificity(DMSOrdinate lat, DMSOrdinate lon)
Hueuristic for what style of fields are allowed in valid DD or DM/DMS coordinates. This evaluates if a lat/lon pair have disparate field specificity. A lat with Deg:Min should not be paired with a lon with Deg:Min:Sec:Subsec for example.- Parameters:
lat
- latitudelon
- longitude- Returns:
- true if specifity of lat and lon are reasonable.
-
set_precision
public static void set_precision(GeocoordMatch m)
set the precision on a match based on the situation (match + pattern).- Parameters:
m
- match
-
-