It should be possible to create a ISO 6709 conform string representation of a GPS Point. It should be possible to define a patterns string like in the Java DateTimeFormatter.ofPattern(String, Locale)
final LocationFormatter formatter = LocationFormatter.ofPattern(...);
abstract class LocationFormatter {
abstract String format(Latitude lat, Longitude lon, Length ele);
}
Patterns
General
| Symbol |
Meaning |
| ' |
escape for text |
| '' |
single quote |
| [ |
optional section start |
| ] |
optional section end |
| + |
forces adding '+' sign for positive values |
Latitude
| Symbol |
Meaning |
| D |
degree part of latitude |
| M |
minute part of latitude |
| S |
second part of latitude |
| X |
hemisphere (N or S) |
Examples
DD°MM''SS.SSS"X
+DD°MM''SS.SSS"
+DD.D
+D.DDD
D.DD
+DDMM.M
+DDMMSS.SSS
Longitude
| Symbol |
Meaning |
| d |
degree part of longitude |
| m |
minute part of longitude |
| s |
second part of longitude |
| x |
east longitude or west longitude (E or W) |
Examples
dd°mm''ss.sss"x
+dd°mm''ss.sss"
+dd.d
+d.ddd
d.dd
+ddmm.m
+ddmmss.sss
Elevation
| Symbol |
Meaning |
| E |
elevation in meters |
| ' |
escape for text |
| '' |
single quote |
Examples
It should be possible to create a ISO 6709 conform string representation of a GPS
Point. It should be possible to define a patterns string like in the Java DateTimeFormatter.ofPattern(String, Locale)Patterns
General
Latitude
Examples
DD°MM''SS.SSS"X+DD°MM''SS.SSS"+DD.D+D.DDDD.DD+DDMM.M+DDMMSS.SSSLongitude
Examples
dd°mm''ss.sss"x+dd°mm''ss.sss"+dd.d+d.dddd.dd+ddmm.m+ddmmss.sssElevation
Examples
E.EE'm'E'm'[ E.EE'm']