Giter Site home page Giter Site logo

burakpadr / turkeylocation4j Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 519 KB

Turkeylocation4j is a java module where you can get Turkey's city, district and neighborhood information.

Java 100.00%
turkiye-il turkiye-il-ilce turkiye-il-ilce-listesi turkiye-mahalle-listesi turkiye-sehirler turkiye-ilce-listesi

turkeylocation4j's Introduction

turkeylocation4j

Turkeylocation4j is a java module where you can get Turkey's city, district and neighborhood information.

The data used in this module is taken from the Turkish Cities project. I would like to thank Semih Arslanoğlu for allowing this data to be used.

Installation

Install with maven:

<dependency>
    <groupId>io.github.burakpadr</groupId>
    <artifactId>turkeylocation4j</artifactId>
    <version>1.0.0</version>
</dependency>

Documentation

  • City API

    • Find city from name

      import io.github.burakpadr.turkeylocation4j.City;
      
      City.fromName("İstanbul").orElseThrow(NoSuchElementException::new);   # => {name: İstanbul, latitude: 41.0082, ...}
      City.fromName("Istanbul").orElseThrow(NoSuchElementException::new);   # => {name: İstanbul, latitude: 41.0082, ...}
      City.fromName("istanbul").orElseThrow(NoSuchElementException::new);   # => {name: İstanbul, latitude: 41.0082, ...}
      City.fromName("ankara").orElseThrow(NoSuchElementException::new);   # => {name: Ankara, latitude: 39.9334, ...}
    • Find city from plate number

      import io.github.burakpadr.turkeylocation4j.City;
      
      City.fromPlateNumber(01).orElseThrow(NoSuchElementException::new); => # => {name: Adana, latitude: 35.3308, ...}
      City.fromPlateNumber(57).orElseThrow(NoSuchElementException::new); => # => {name: Sinop, latitude: 42.028, ...}
    • Find cities from region

       import io.github.burakpadr.turkeylocation4j.City;
       import io.github.burakpadr.turkeylocation4j.Region;
       
       City.fromRegion(Region.EGE); # => [{name: Afyon, latitude: 38.7595, ...}, ...]
       City.fromRegion(Region.KARADENIZ); # => [{name: Amasya, latitude: 40.6565, ...}, ...]
    • Find cities that have sea access

      import io.github.burakpadr.turkeylocation4j.City;
      
      City.fromHasSeaAccess(true); # => [{name: Adana, latitude: 35.3308, ...}, ...]
      City.fromHasSeaAccess(false); # => [{name: Adıyaman, latitude: 37.7636, ...}, ...]
    • Find all cities

      import io.github.burakpadr.turkeylocation4j.City;
      
      City.fromNoFilter(); # => [{name: Adana, latitude: 35.3308, ...}, ...]
  • District API

    • Find districts by city name
     import  io.github.burakpadr.turkeylocation4j.District;
    
     District.fromCityName("istanbul"); # => [{name: Adalar}, {name: Arnavutköy}, ...]
  • Neighborhood API

    • Find neighborhoods by city name and district name
    import  io.github.burakpadr.turkeylocation4j.Neighborhood;
    
    Neighborhood.fromCityNameAndDistrictName("istanbul", "beşiktaş"); # => [{name: Abbasağa Mah, postCode: 34022}, ...]

turkeylocation4j's People

Contributors

burakpadr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.