0.0
The project is in a healthy, maintained state
Description of GeoMasterJp.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

WIP

This gem is WIP!

GeoMasterJp

Short description and motivation.

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem 'geo_master_jp'

And then execute:

$ bundle

Or install it yourself as:

$ gem install geo_master_jp

Initialize

Create Config File

rails g geo_master_jp:install

Create Migration Files

rails g geo_master_jp:install_migration

Import Area Data

rails g geo_master_jp:install_area_data

Import Railway Data

rails g geo_master_jp:install_railway_data

*Area data is required as a prerequisite.

Usage

Use Area Data Examples

prefectures = GeoMasterJp::Prefecture.all

tokyo = prefectures.find_by(code: '13')
cities = tokyo.cities

shinjuku = cities.find_by(code: '13104')
towns = shinjuku.towns

Use Area Data API

Add the following line to your config/routes.rb:

GeoMasterJp.set_routes(self)

Then you can use the following API:

  • /geo_master_jp/api/prefectures
  • /geo_master_jp/api/cities?prefecture_code=13
  • /geo_master_jp/api/towns?city_code=13104
  • /geo_master_jp/api/railway_companies
  • /geo_master_jp/api/lines?prefecture_code=13
  • /geo_master_jp/api/lines?railway_company_code=002
  • /geo_master_jp/api/stations?line_code=11302
  • /geo_master_jp/api/stations?line_code=11302&prefecture_code=13
  • /geo_master_jp/api/same_stations?same_stations=1130225

Contributing

Contribution directions go here.

License

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