GithubHelp home page GithubHelp logo

logicexception / php-german-administrative-area-keys Goto Github PK

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

provides data objects for german administrative area keys AGS (Amtlicher Gemeindeschlüssel) and ARS (Amtlicher Regionalschlüssel).

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%
ags ars regionalschluessel gemeindeschluessel

php-german-administrative-area-keys's Introduction

german administrative area keys

This package contains types and classes for german area keys AGS (Amtlicher Gemeindeschlüssel) and ARS (Amtlicher Regionalschlüssel).

You can download the latest record of all german administrative areas from:

https://www.destatis.de/DE/Themen/Laender-Regionen/Regionales/Gemeindeverzeichnis/_inhalt.html

How to use

AGS

Provides a class which represents an Amtlichen Gemeindeschlüssel data object. You can create a new object by passing each part of an AGS via constructor or parse an AGS String via static fromString method.

// pass each part of AGS as constructor parameter
$ags = new AGS("14", "7", "30", "070");

// pass full AGS string via parseString method
$ags = AGS::fromString("14730070");

ARS

Provides a class which represents an Amtlichen Regionalschlüssel data object. Similar to the AGS class you can pass each part of an ARS via constructor parameter or parse an ARS String via static fromString method.

// pass each part of ARS as constructor parameter
$ars = new ARS("14", "7", "30", "0070", "070");

// pass full ARS string via parseString method
$ars = ARS::fromString("147300070070");

Technically an ARS is an AGS with a little more information (Verbandsschlüssel). So it is possible to extract an AGS from an ARS. Conversely, you cannot create an ARS from an AGS because the lack of information (Verbandsschlüssel).

$ars = new ARS("14", "7", "30", "0070", "070");
$ags = ars->toAGS();
    
echo (string)$ags;
// prints: "14730070"

php-german-administrative-area-keys's People

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.