Menu

Tree [d59431] master /
 History

HTTPS access


File Date Author Commit
 example 2014-08-09 grindhold grindhold [6de9a3] updated example
 .gitignore 2014-08-08 Christian Muehlhaeuser Christian Muehlhaeuser [37cd7b] * Updated .gitignore to contain example.
 .travis.yml 2014-08-09 grindhold grindhold [8debbe] added travisfile
 README.md 2014-08-09 grindhold grindhold [d59431] ya readme update
 nominatim.go 2014-08-09 grindhold grindhold [42f4d1] implemented reverse search, added better error ...
 nominatim_reverse.go 2014-08-09 grindhold grindhold [002421] return error when server has not been set
 nominatim_reverse_test.go 2014-08-09 grindhold grindhold [cbf619] new example in readme, go fmt everything
 nominatim_search.go 2014-08-09 grindhold grindhold [002421] return error when server has not been set
 nominatim_search_test.go 2014-08-09 grindhold grindhold [cbf619] new example in readme, go fmt everything

Read Me

Gominatim - Go library to access nominatim geocoding services

Buildstatus

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 (Please also refer to this
wikipage 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)

  • Search
  • Reverese Geocoding

Contributions–

…Are welcome :)

If you want to add anyting, do it and submit a pullrequest.
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/grindhold/gominatim"
)

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

    //Get by a Querystring
    qry := new(gominatim.SearchQuery)
    qry.Q = "Hamburg"
    resp, _ := qry.Get() // Returns []gominatim.Result
    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 := new(gominatim.ReverseQuery)
    rqry.Lat = "52.5170365"
    rqry.Lon = "13.3888599"
    rresp, _ := rqry.Get()
    fmt.Printf("Found %s\n", rresp.DisplayName)
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.