Latest 0.9.2
Homepage https://github.com/caloon/NominatimKit
License MIT
Platforms ios 9.3
Authors

CI Status
Version
License
Platform

A Swift wrapper for reverse geocoding of OpenStreetMap data

I accidentally realised that it’s not possible to decode an address to a CLLocation (latitude / longitude) and the other way round. So I built NominatimSwift. It uses OpenStreetMap’s free Nominatim API gather location data for a specific latitude or a free text query (i.e. addresses or landmarks).

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Nominatim is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'Nominatim'

Usage

Search for Addresses

Nominatim.getLocation(fromAddress: "Stephansplatz, 1010 Vienna, Austria", completion: {(error, location) -> Void in
      print("Geolocation of the Royal Palace of Stockholm:")
      print("lat = " + (location?.latitude)! + "   lon = " + (location?.longitude)!)
    })

Search for Landmarks

Nominatim.getLocation(fromAddress: "The Royal Palace of Stockholm", completion: {(error, location) -> Void in
      print("Geolocation of the Royal Palace of Stockholm:")
      print("lat = " + (location?.latitude)! + "   lon = " + (location?.longitude)!)
    })

Search with Latitude and Longitude

Nominatim.getLocation(fromLatitude: "55.6867243", longitude: "12.5700724", completion: {(error, location) -> Void in
      print("City for geolocation 55.6867243/12.5700724:")
      print(location?.city)
    })

Contribution

Contributions are encouraged and possible by opening issues and pull requests.

If you like my content, please consider supporting what I do: https://www.buymeacoffee.com/caloon

Meta

Josef Moser – @josef_moser

Distributed under the MIT license: Copyright (c) 2016 Josef Moser
https://github.com/caloon

License

Nominatim is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Nominatim",
    "version": "0.9.2",
    "summary": "A Swift wrapper for (reverse) geocoding of OpenStreetMap data",
    "description": "Use NominatimKit to access OpenStreetMaps and the free Nominatim API to gather location data for a specific latitude, address or landmark.",
    "homepage": "https://github.com/caloon/NominatimKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "caloon": "[email protected]"
    },
    "source": {
        "git": "https://github.com/caloon/NominatimKit.git",
        "tag": "0.9.2"
    },
    "social_media_url": "https://twitter.com/josef_moser",
    "platforms": {
        "ios": "9.3"
    },
    "source_files": "Pods/Classes/Nominatim.swift"
}

Pin It on Pinterest

Share This