Class GeocoordNormalization


  • public final class GeocoordNormalization
    extends java.lang.Object
    • 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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeocoordNormalization

        public GeocoordNormalization()
    • 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 - match
        groups - 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 - latitude
        lon - 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