README.md

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Exshape](#exshape)
  - [Usage](#usage)
    - [Installation](#installation)
    - [From a zip archive](#from-a-zip-archive)
    - [Shapes from a SHP byte stream](#shapes-from-a-shp-byte-stream)
    - [Attributes from a DBF byte stream](#attributes-from-a-dbf-byte-stream)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Exshape
Parse ESRI Shapefiles
[![Build Status](https://travis-ci.org/rozap/exshape.svg?branch=master)](https://travis-ci.org/rozap/exshape)



## Usage
### Installation
Add

```elixir
{:exshape, "~> 2.1.2"}
```

to `mix.exs` deps

### From a zip archive
```elixir
[
  {"rivers", rivers_proj, river_shapes},
  {"lakes", lakes_proj, lake_shapes}
] = Exshape.from_zip("path/to/archive.zip")

Stream.each(river_shapes, &IO.inspect/1) |> Stream.run
Stream.each(lake_shapes, &IO.inspect/1) |> Stream.run
```

### Shapes from a SHP byte stream
```elixir
File.stream!("rivers.shp", [], 2048)
|> Exshape.Shp.read
|> Stream.each(&IO.inspect/1)
|> Stream.run
```

### Attributes from a DBF byte stream
```elixir
File.stream!("rivers.dbf", [], 2048)
|> Exshape.Dbf.read
|> Stream.each(&IO.inspect/1)
|> Stream.run
```