exshape v2.0.11 Exshape

This module just contains a helper function for working wtih zip archives. If you have a stream of bytes that you want to parse directly, use the Shp or Dbf modules to parse.

Summary

Functions

Given a zip file path, unzip it and open streams for the underlying shape data

Types

layer()
layer() :: {layer_name, projection, Stream.t}
layer_name()
layer_name() :: String.t
projection()
projection() :: String.t

Functions

from_zip(path, opts \\ [])

Given a zip file path, unzip it and open streams for the underlying shape data.

Returns a list of all the layers, where each layer is a tuple of layer name, projection, and the stream of features

By default this unzips to /tmp/exshape_some_uuid. Make sure to clean up when you’re done consuming the stream. Pass the :working_dir option to change this destination.

By default this reads in 1024 * 512 byte chunks. Pass the :read_size option to change this.

By default this shells out to the unzip system cmd, to use the built in erlang one, pass unzip_shell: true. The default behavior is to use the system one because the erlang one tends to not support as many formats.

  [{layer_name, projection, feature_stream}] = Exshape.from_zip("single_layer.zip")