Project

jp_station

0.0
No commit activity in last 3 years
No release in over 3 years
Get the stations near the place in Japan.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
>= 0
 Project Readme

JpStation

JpStation helps you to get the near station data from latitude and longitude using api. ( http://map.simpleapi.net/ ) The response data is only in Japanese.

Installation

Add this line to your application's Gemfile:

gem 'jp_station'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jp_station

Usage

You can get stations near the latitude and the longitude you set.

lat, lng = ["34.673150", "135.501005"]
response = JpStation::Simpleapi.stations(lat, lng)

The response is Hash object.

response[:count] # => 8
response[:stations].length # => 8
response[:stations].first[:name] # => "心斎橋駅"

The response data is like this.

{:count=>8,
 :stations=>
  [{:name=>"心斎橋駅",
    :furigana=>"しんさいばしえき",
    :line=>"大阪市営御堂筋線ほか",
    :city=>"大阪市中央区",
    :prefecture=>"大阪府",
    :direction=>"北西",
    :directionReverse=>"南東",
    :distance=>"150",
    :distanceM=>"150m",
    :distanceKm=>"0.2km",
    :traveltime=>"徒歩2分以上"},

Station API Services

This gem use the api service.

About api services (Japanese) : http://map.simpleapi.net/

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/takp/jp_station. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

License

The gem is available as open source under the terms of the MIT License.