Skip to content

ISO 6709 string representation for GPS coordinate #70

@jenetics

Description

@jenetics

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

  • E.EE'm'
  • E'm'
  • [ E.EE'm']

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions