NAME
    Geo::UK::Postcode::CodePointOpen - Utility object to extract OS
    Code-Point Open data for British Postcodes

SYNOPSIS
        use Geo::UK::Postcode::CodePointOpen;

        my $code_point_open = Geo::UK::Postcode::CodePointOpen->new( path => ... );

        my $metadata = $code_point_open->metadata();

        my $iterator = $code_point_open->read_iterator();
        while ( my $pc = $iterator->() ) {
            ...;
        }

        my $batch_iterator = $code_point_open->batch_iterator();
        while ( my @batch = $batch_iterator->() ) {
            ...;
        }

        # Just access data files (as Path::Tiny objects)
        my @data_files = sort $self->data_dir->children( qr/\.csv$/ );

DESCRIPTION
    Util object to read OS Code-Point Open data.

ATTRIBUTES
  path
    Set at construction to the directory containing the contents of the OS
    Code-Point Open Zip file.

  doc_dir, data_dir
    Path::Tiny objects for the documentation and CSV data directories.

  metadata
    Hashref parsed from the "Doc/metadata.txt" file. Contains postcode
    counts per area, date data generated, etc.

METHODS
  new
        my $code_point_open = Geo::UK::Postcode::CodePointOpen->new(
            path => ...,    # path to Unzipped Code-Point Open directory
        );

    Constructor.

  read_iterator
        my $iterator = $code_point_open->read_iterator(
            short_column_names => 1,    # default is false (long names)
            include_lat_long   => 1,    # default is false
            split_postcode     => 1,    # split into outcode/incode
        );

        while ( my $pc = $iterator->() ) {
            ...
        }

    Returns a coderef iterator. Call that coderef repeatedly to get a
    hashref of data for each postcode in data files.

  batch_iterator
        my $batch_iterator = $code_point_open->batch_iterator(
            batch_size         => 100,  # number per batch (default 100)
            short_column_names => 1,    # default is false (long names)
            include_lat_long   => 1,    # default is false
            split_postcode     => 1,    # split into outcode/incode
        );

        while ( my @batch = $batch_iterator->() ) {
            ...
        }

    Returns a coderef iterator. Call that coderef repeatedly to get a list
    of postcode hashrefs.

SEE ALSO
    *   Geo::UK::Postcode::Regex

AUTHOR
    Michael Jemmeson <mjemmeson@cpan.org>

COPYRIGHT
    Copyright 2014- Michael Jemmeson

LICENSE
    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

