dlpx-core:Lat_Long Coordinates
The Lat_Long Coordinates algorithm is an instance of the Regex Decompose Algorithm Framework.
This algorithm recognizes and masks only the EPSG:4326 coordinate system (WGS84) containing latitude and longitude.
Lat_Long Coordinates algorithm should only be used for string or numeric data types and does not support spatial or geometric column data-types.
The algorithm can mask latitude & longitude individually and also a combination of latitude and longitude in that order separated by delimiters-comma or space
. The supported formats are:
Name | Format | Explanation | valid ranges | Valid examples that the algorithm can mask |
---|---|---|---|---|
DD - | DD.DDDDDDD°<dir> | DD: Degrees | [-90, +90] for latitude |
|
DDDDDD: Decimal | [0000-99999999] | |||
DMM-Degrees, Decimal Minutes | DD°MM.MMMM'<dir> | DD: Degrees | [-90, +90] for latitude |
|
MM: Minutes | [0, 59] | |||
MMMM': Decimal minutes | [000-9999] | |||
DMS-Degrees Minutes Seconds | DD°MM' SS.SS"<dir> | DD: Degrees | [-90, +90] for latitude |
|
MM': Minutes | [0, 59] | |||
SS: Seconds | [0, 59] | |||
SS”: Decimal Seconds | [0, 99] |
<dir> can be one of the four directions - N, S, E & W
The algorithm will preserve the degrees (DD), the prefix direction (+/-), the direction character suffix (N, E, W, S) at the end, and any non-digits (symbols – .
,°
,′
,'
,"
,“
). It masks the decimal parts to valid decimals, minutes, and seconds (0-59) to valid minutes and seconds (0-59) respectively.
Valid input masking examples:
+41.939390
→+41.684362
41°24'12.2"N
→41°16'35.8"N
41°24'12"N 2°10'26"E
→41°16'35"N 2°50'05"E
41 24.2028, 2 10.4418
→41 16.3542, 2 50.5383
32°00′05″N 173°41′53″W
→32°15′07″N 173°30′02″W
+41.939390
→+41.684362
Fallback action and non-conforming inputs:
The above coordinate formats of latitude and longitude are one of the most widely adopted coordinate systems. There are several other coordinate formats and spatial systems which can be found online. When the current algorithm is used to mask such coordinates, they are treated as non-conforming inputs as they do not match any of the regex patterns defined in the algorithm. For all such data, a fallback action masks or redacts all the digits of the input value to “0” keeping the format, directions, degrees, minutes, seconds symbols, and any other characters intact. As a result, non-conformant events are not produced for this algorithm.
Non-conforming input masking examples:
41°65'35.8"N
→00°00'00.0"N
189.98212343°W
→000.00000000°W
ABCxyz391
→ABCxyz000
To keep the algorithm regexes reasonably simple and readable (which also impacts performance), the outermost values of the allowed latitude and longitude ranges are also masked or redacted to 0.
90°00′00.0″N
→00°00′00.0″N
180°00′00.00″W
→000°00′00.00″W
-90°00′00.0″
→-00°00′00.0″