GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - rmnblm/GraphHopperGeocoder: πŸ” The GraphHopper Geocoding API wrapped in an easy-to-use Swift framework.

BranchesTags
Open more actions menu

Latest commit

 

History

51 Commits
51 Commits

Folders and files

NameName
Last commit message
Last commit date
GraphHopperGeocoder.playground
GraphHopperGeocoder.playground
 
 
GraphHopperGeocoder.xcodeproj
GraphHopperGeocoder.xcodeproj
 
 
GraphHopperGeocoder
GraphHopperGeocoder
 
 
GraphHopperGeocoderTests
GraphHopperGeocoderTests
 
 
images
images
 
 
.gitignore
.gitignore
 
 
GraphHopperGeocoder.podspec
GraphHopperGeocoder.podspec
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

GraphHopperGeocoder

πŸ” The GraphHopper Geocoding API wrapped in an easy-to-use Swift framework.

The Geocoding API is part of the GraphHopper Directions API. Geocoding is the process of finding an address for your geo location or a coordinate for an address. With our API you have a fast and solid way to geocode.

Installation

Use CocoaPods to install the framework. Add this to your Podfile:

pod 'GraphHopperGeocoder'

Then run the following command:

$ pod install

In order to use the framework, you'll also need a GraphHopper Access Token. You can either set your access token in the Info.plist (Key is GraphHopperAccessToken) or pass it as an argument to the initializer of the Geocoder class.

Example

Basics

Setup the Geocoder class

import CoreLocation
import GraphHopperGeocoder

// use this
let geocoder = Geocoder(accessToken: "YOUR ACCESS TOKEN")
// or if you have set your access token in the Info.plist
let geocoder = Geocoder()

Forward geocoding options

Configure the forward geocoding options

let options = ForwardGeocodeOptions(query: "HSR Rapperswil")
options.limit = 3

Reverse geocoding options

Configure the reverse geocoding options

let coordinate = CLLocationCoordinate2D(latitude: 47.222943, longitude: 8.817238649765951)
let options = ReverseGeocodeOptions(coordinate: coordinate)

Geocode request

Make the async request by calling the calculate(_:completionHandler) method and passing the options.

let task = geocoder.geocode(options, completionHandler: { (placemarks, error) in
    placemarks?.forEach({ placemark in
        print(placemark.name)
        print("\(placemark.coordinate.latitude), \(placemark.coordinate.longitude)")
        print(placemark.street)
        print(placemark.postalCode)
        print(placemark.city)
        print(placemark.state)
        print(placemark.country)
    })
})

More Information

For more information, consider reading the official documentation to learn more about the options and the result.

License

This project is released under the MIT license.

About

​The GraphHopper Geocoder Swift Framework is crafted with ❀️ by @rmnblm and @iphilgood during the Bachelor thesis at HSR University of Applied Sciences in Rapperswil.

About

πŸ” The GraphHopper Geocoding API wrapped in an easy-to-use Swift framework.

www.graphhopper.com

Topics

geocodinggraphhopperopenstreetmapswift

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

2 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.