Code Monkey home page Code Monkey logo

gominatim's Introduction

Gominatim - Go library to access nominatim geocoding services

Latest Release GoDoc Build Status Coverage Status Go ReportCard

Geocoding? WTF?

If you want to determine the coordinates of a certain location by only having its name, you can do this via a geocoding service. If you want to do this in Go, you probably want to use gominatim to do it.

License

LGPLv3

Features

The plan is to cover everything this site documents: Nominatim Wiki

  • Search
  • Reverse Geocoding

Contributions

…Are welcome :)

If you want to add anything, do it and submit a pull-request. Please add Tests for your additions!

Usage of the Openstreetmaps-Nominatim Server

Please refer to the Nominatim Wiki if you plan to use the nominatim service of openstreetmaps. If you plan to generate high loads with geoqueries, it would be nice if you did it on your own infrastructure, not on their server.

Examples

package main

import (
	"fmt"
	"github.com/muesli/gominatim"
)

func main() {
	gominatim.SetServer("https://nominatim.openstreetmap.org/")

	//Get by a Querystring
	qry := gominatim.SearchQuery{
		Q: "Hamburg",
	}
	resp, _ := qry.Get() // Returns []gominatim.SearchResult
	fmt.Printf("Found location: %s (%s, %s)\n", resp[0].DisplayName, resp[0].Lat, resp[0].Lon)

	//Get by City
	qry = gominatim.SearchQuery{
		City: "Berlin",
	}
	resp, _ = qry.Get()
	fmt.Printf("Found location: %s (%s, %s)\n", resp[0].DisplayName, resp[0].Lat, resp[0].Lon)

	//Reverse Geocoding
	rqry := gominatim.ReverseQuery{
		Lat: "52.5170365",
		Lon: "13.3888599",
	}
	rresp, _ := rqry.Get()
	fmt.Printf("Found %s\n", rresp.DisplayName)
}

gominatim's People

Contributors

grindhold avatar muesli avatar rubiojr avatar alaminopu avatar xiconet avatar

Stargazers

Matthias Rupp avatar the Artist Adamo avatar  avatar Thibault NORMAND avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.