https://github.com/marlonlom/latlng2dms
Some utilities for converting latitude/longitudes to degrees/minutes/seconds format
https://github.com/marlonlom/latlng2dms
coordinates dms geography java
Last synced: over 1 year ago
JSON representation
Some utilities for converting latitude/longitudes to degrees/minutes/seconds format
- Host: GitHub
- URL: https://github.com/marlonlom/latlng2dms
- Owner: marlonlom
- License: apache-2.0
- Created: 2017-03-28T20:52:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-29T17:58:21.000Z (over 9 years ago)
- Last Synced: 2024-04-16T12:52:05.050Z (about 2 years ago)
- Topics: coordinates, dms, geography, java
- Language: Java
- Size: 156 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# latlng2dms - Latitude/Longitude to DMS representation
[](https://github.com/marlonlom/latlng2dms/issues)

[](https://github.com/marlonlom/latlng2dms)
[](https://travis-ci.org/marlonlom/latlng2dms)
[ ](https://bintray.com/marlonlom/latlng2dms/latlng2dms/_latestVersion)
Some utilities for converting latitude/longitudes to degrees/minutes/seconds format
## Examples:
- 40°26′46″ N, 79°58′56″ W
- 2°20'24" N, 5°20'24" W
## Usage:
### Import as a dependency:
Gradle:
```
compile 'com.github.marlonlom:latlng2dms:$latestVersion'
```
Maven:
```xml
com.github.marlonlom
latlng2dms
$latestVersion
```
### Use it in your code:
With coordinates:
```java
final Double[] coordinates = {151.209900d, -33.865143d};
final String converted = LatsLngs.with(coordinates).toDms();
/* Will return 33°51'54" S, 151°12'35" E */
```
Or with single longitude/latitude value:
```java
final Double value = -34.206841d;
final String converted = LatsLngs.with(value).asLatitude().toDms();
/* Will return 34°12'24 S */
```
## Spread the word
If you like this library, please tell others about it :thumbsup::thumbsup:
- []()Follow me on **Twitter**: [**@Marlonlom**](https://twitter.com/marlonlom)
- Contact me on **LinkedIn**: [**Marlonlom**](https://co.linkedin.com/in/marlonlom)
### License
```
Copyright 2017 marlonlom
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```