im7mortal / Utm
Licence: gpl-3.0
Bidirectional UTM-WGS84 converter for golang 🌍 🌐
Stars: ✭ 36
Programming Languages
go
31211 projects - #10 most used programming language
Labels
Projects that are alternatives of or similar to Utm
Places
🌐 Turn any <input> into an address autocomplete
Stars: ✭ 5,322 (+14683.33%)
Mutual labels: geolocation
Geo From Ip
Get geolocation 🌐 information about an IP 📲
Stars: ✭ 24 (-33.33%)
Mutual labels: geolocation
Nanogenmo 2015
Around the World in X Wikipedia Articles
Stars: ✭ 20 (-44.44%)
Mutual labels: geolocation
React Native Geolocation
Geolocation APIs for React Native
Stars: ✭ 640 (+1677.78%)
Mutual labels: geolocation
Ionic 3 Google Maps Google Places Geolocation
This repository is part of an ionic tutorial about Maps! In this tutorial we merged Google maps, Geolocation and Google Places. This ionic tutorial includes a working example you can reuse for your needs!
Stars: ✭ 32 (-11.11%)
Mutual labels: geolocation
Geomate
GeoMate is a friend in need for all things geolocation. IP to geo lookup, automatic redirects (based on country, continent, language, etc), site switcher... You name it.
Stars: ✭ 19 (-47.22%)
Mutual labels: geolocation
Snoop
Snoop — инструмент разведки на основе открытых данных (OSINT world)
Stars: ✭ 886 (+2361.11%)
Mutual labels: geolocation
Leaflet Geosearch
(Leaflet) GeoSearch / GeoCode provider
Stars: ✭ 666 (+1750%)
Mutual labels: geolocation
Flutter Geolocator
Android and iOS Geolocation plugin for Flutter
Stars: ✭ 759 (+2008.33%)
Mutual labels: geolocation
Locator Tool
Tool to add {{Location}} or {{Object location}} to images on Wikimedia Commons
Stars: ✭ 11 (-69.44%)
Mutual labels: geolocation
Leku
🌍 Map location picker component for Android. Based on Google Maps. An alternative to Google Place Picker.
Stars: ✭ 612 (+1600%)
Mutual labels: geolocation
Unifiednlp
Alternative network location provider for Android, with plugin interface to easily integrate third-party location providers.
Stars: ✭ 596 (+1555.56%)
Mutual labels: geolocation
React Native Geolocation Service
React native geolocation service for iOS and android
Stars: ✭ 934 (+2494.44%)
Mutual labels: geolocation
Vue World Map
A Vue JS component for displaying dynamic data on a world map.
Stars: ✭ 33 (-8.33%)
Mutual labels: geolocation
Craft Coordinates
A twig filter for Craft CMS that gets the latitude and longitude from an address
Stars: ✭ 27 (-25%)
Mutual labels: geolocation
UTM
Bidirectional UTM-WGS84 converter for golang. It use logic from UTM python version by Tobias Bieniek
Usage
go get github.com/im7mortal/UTM
Convert a latitude, longitude into an UTM coordinate
easting, northing, zoneNumber, zoneLetter, err := UTM.FromLatLon(40.71435, -74.00597, false)
Convert an UTM coordinate into a latitude, longitude.
latitude, longitude, err := UTM.ToLatLon(377486, 6296562, 30, "V")
Since the zone letter is not strictly needed for the conversion you may also
the northern
parameter instead, which is a named parameter and can be set
to either true
or false
. In this case you should define fields clearly(!).
You can't set ZoneLetter or northern both.
latitude, longitude, err := UTM.ToLatLon(377486, 6296562, 30, "", false)
The UTM coordinate system is explained on this Wikipedia page
Speed
Benchmark | Amount of iterations | Average speed |
---|---|---|
ToLatLon | 10000000 | 123 ns/op |
ToLatLonWithNorthern | 10000000 | 121 ns/op |
FromLatLon | 20000000 | 80.6 ns/op |
go test -bench=.
Full example
package main
import (
"github.com/im7mortal/UTM"
"fmt"
)
func main() {
easting, northing, zoneNumber, zoneLetter, err := UTM.FromLatLon(40.71435, -74.00597, false)
if err != nil {
panic(err.Error())
}
fmt.Println(
fmt.Sprintf(
"Easting: %d; Northing: %d; ZoneNumber: %d; ZoneLetter: %s;",
easting,
northing,
zoneNumber,
zoneLetter,
))
easting, northing, zoneNumber, zoneLetter, err = UTM.FromLatLon(40.71435, -74.00597, true)
if err != nil {
panic(err.Error())
}
fmt.Println(
fmt.Sprintf(
"Easting: %d; Northing: %d; ZoneNumber: %d; ZoneLetter: %s;",
easting,
northing,
zoneNumber,
zoneLetter,
))
latitude, longitude, err := UTM.ToLatLon(377486, 6296562, 30, "", true)
fmt.Println(fmt.Sprintf("Latitude: %.5f; Longitude: %.5f;", latitude, longitude))
latitude, longitude, err = UTM.ToLatLon(377486, 6296562, 30, "V")
fmt.Println(fmt.Sprintf("Latitude: %.5f; Longitude: %.5f;", latitude, longitude))
}
Authors
- Petr Lozhkin [email protected]
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].