kelvins / Geocoder
Licence: mit
🌎 GoLang package that provides an easy way to use the Google Geocoding API
Stars: ✭ 23
Projects that are alternatives of or similar to Geocoder
Figma To Google Slides
Convert Figma frames into a Google Slides presentation 🍭
Stars: ✭ 385 (+1573.91%)
Mutual labels: api, google-api, google
Ng Gapi
ng-gapi a Google api module for Angular 6+
Stars: ✭ 126 (+447.83%)
Mutual labels: api, google-api, google
Gisgraphy
geocoding and geolocalisation webservices for Geonames, Openstreetmap, Openaddresses, Tiger and quattroshapes data
Stars: ✭ 275 (+1095.65%)
Mutual labels: geocoding, geocoder
Realtime object detection
Plug and Play Real-Time Object Detection App with Tensorflow and OpenCV. No Bugs No Worries. Enjoy!
Stars: ✭ 260 (+1030.43%)
Mutual labels: api, google
Flutter Ui Nice
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.
Stars: ✭ 3,092 (+13343.48%)
Mutual labels: api, google
leaflet-opencage-search
A Leaflet geocoding control that uses the OpenCage geocoding API
Stars: ✭ 18 (-21.74%)
Mutual labels: geocoding, geocoder
Geo Golang
Go library to access geocoding and reverse geocoding APIs
Stars: ✭ 394 (+1613.04%)
Mutual labels: geocoding, geocoder
Java Speech Api
The J.A.R.V.I.S. Speech API is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.
Stars: ✭ 490 (+2030.43%)
Mutual labels: api, google
NominatimGeocoderBackend
UnifiedNlp geocoder backend that uses the OSM Nominatim service
Stars: ✭ 49 (+113.04%)
Mutual labels: geocoding, geocoder
Osmunda
An offline geocode library for android, powered by SQLite, using osm data. 离线地理编码Android库,基于SQLite,使用开放街道地图数据。
Stars: ✭ 37 (+60.87%)
Mutual labels: geocoding, geocoder
Fccurrentlocationgeocoder
iOS Geocoder for forward geocode and reverse geocode user's current location using a block-based syntax. 📍🌍
Stars: ✭ 268 (+1065.22%)
Mutual labels: geocoding, geocoder
python-omgeo
OMGeocoder - A python geocoding abstraction layer
Stars: ✭ 34 (+47.83%)
Mutual labels: geocoding, geocoder
google maps
🗺 An unofficial Google Maps Platform client library for the Rust programming language.
Stars: ✭ 40 (+73.91%)
Mutual labels: geocoding, google-api
geocoder
Geocoder is a Typescript library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations
Stars: ✭ 28 (+21.74%)
Mutual labels: geocoding, geocoder
Geocoder
GoLang package that provides an easy way to use the Google Geocoding API.
See more information about the Google Geocoding API at the following link: https://developers.google.com/maps/documentation/geocoding/start
You can use go get:
go get github.com/kelvins/geocoder
Usage
Example of usage:
package main
import (
"fmt"
"github.com/kelvins/geocoder"
)
func main() {
// This example should work without need of an API Key,
// but when you will use the API in your project you need
// to set your API KEY as explained here:
// https://developers.google.com/maps/documentation/geocoding/get-api-key
// geocoder.ApiKey = "YOUR_API_KEY"
// See all Address fields in the documentation
address := geocoder.Address{
Street: "Central Park West",
Number: 115,
City: "New York",
State: "New York",
Country: "United States",
}
// Convert address to location (latitude, longitude)
location, err := geocoder.Geocoding(address)
if err != nil {
fmt.Println("Could not get the location: ", err)
} else {
fmt.Println("Latitude: ", location.Latitude)
fmt.Println("Longitude: ", location.Longitude)
}
// Set the latitude and longitude
location = geocoder.Location{
Latitude: 40.775807,
Longitude: -73.97632,
}
// Convert location (latitude, longitude) to a slice of addresses
addresses, err := geocoder.GeocodingReverse(location)
if err != nil {
fmt.Println("Could not get the addresses: ", err)
} else {
// Usually, the first address returned from the API
// is more detailed, so let's work with it
address = addresses[0]
// Print the address formatted by the geocoder package
fmt.Println(address.FormatAddress())
// Print the formatted address from the API
fmt.Println(address.FormattedAddress)
// Print the type of the address
fmt.Println(address.Types)
}
}
Results:
Latitude: 40.7758882
Longitude: -73.9764703
115, Central Park West, Manhattan, 10023, New York, New York County, New York, United States
115 Central Park West, New York, NY 10023, USA
street_address
General
Geocoder
Geocoding
Reverse Geocoding
Application Programming Interface (API)
Documentation
You can access the full documentation here:
License
This project was created under the MIT license. You can read the license here:
Feel free to contribute by commenting, suggesting, creating issues or sending pull requests. Any help is welcome.
Contributing
- Create an issue (optional)
- Fork the repo
- Make your changes
- Commit your changes (
git commit -am 'Some cool feature'
) - Push to the branch (
git push origin master
) - Create a new Pull Request
Using Goroutines
With a little more effort you can use goroutines with channels:
package main
import (
"fmt"
"time"
"github.com/kelvins/geocoder"
)
// Use the channels system to call the Geocoding function
func geocodingChannel(address geocoder.Address, locationChan chan geocoder.Location, errChan chan error) {
fmt.Println("Entering geocodingChannel function...")
defer fmt.Println("Exiting geocodingChannel function...")
defer close(locationChan)
defer close(errChan)
location, err := geocoder.Geocoding(address)
locationChan <- location
errChan <- err
}
// Use the channels system to call the GeocodingReverse function
func geocodingReverseChannel(location geocoder.Location, addressesChan chan []geocoder.Address, errChan chan error) {
fmt.Println("Entering geocodingReverseChannel function...")
defer fmt.Println("Exiting geocodingReverseChannel function...")
defer close(addressesChan)
defer close(errChan)
addresses, err := geocoder.GeocodingReverse(location)
addressesChan <- addresses
errChan <- err
}
func main() {
// See all Address fields in the documentation
address := geocoder.Address{
Street: "Central Park West",
Number: 115,
City: "New York",
State: "New York",
Country: "United States",
}
// Make the channels
locationChan := make(chan geocoder.Location)
errChan := make(chan error)
// Call the go routine
go geocodingChannel(address, locationChan, errChan)
// Do whatever you need to do
for index := 0; index < 5; index++ {
fmt.Println(index)
time.Sleep(50 * time.Millisecond)
}
// Get the results
location := <-locationChan
err := <-errChan
// Check if the results are valid
if err != nil {
fmt.Println("Could not get the location: ", err)
} else {
fmt.Println("Latitude: ", location.Latitude)
fmt.Println("Longitude: ", location.Longitude)
}
// Set the latitude and longitude
location = geocoder.Location{
Latitude: 40.775807,
Longitude: -73.97632,
}
// Make the channels
addressesChan := make(chan []geocoder.Address)
errChan = make(chan error)
// Call the go routine
go geocodingReverseChannel(location, addressesChan, errChan)
// Do whatever you need to do
for index := 0; index < 5; index++ {
fmt.Println(index)
time.Sleep(50 * time.Millisecond)
}
// Get the results
addresses := <-addressesChan
err = <-errChan
// Check if the results are valid
if err != nil {
fmt.Println("Could not get the addresses: ", err)
} else {
fmt.Println(addresses[0].FormattedAddress)
}
}
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].