Code Monkey home page Code Monkey logo

conrex's Introduction

Conrex

Conrex logo

Example output visualization

The National Association of Independent Schools developed an Elixir implementation of the Paul Bourke's Conrec algorithm to calculate the drive-time to a particular location. The Conrex hex package is now available to developers here on GitHub.

Most map-based apps calculate the distance from a central point outward. That’s helpful if you want to see how long it will take you to fly somewhere else, but not so helpful if you want to calculate how long it will take customers to drive through traffic to get to your location.

Conrex uses a convergent isochrone to calculate real traffic and topographic conditions. An implementation of Paul Bourke's CONREC algorithm in Elixir, Conrex is now available to the open source community.

NAIS developed Conrex for its Market View app. Market View helps schools find children are within a reasonable driving distance of the school. It can also be used to map bus routes, commute times, or to determine a new location for a business.

Installation

Conrex can be installed by adding conrex to your list of dependencies in mix.exs:

def deps do
  [
    {:conrex, "~> 1.0.0"}
  ]
end

Usage

The main algorithm outlined by Bourke can be invoked with Conrex.conrec:

iex> Conrex.conrec(values, x_coords, y_coords, contour_levels)

where values is a 2D list of samples (heights, travel times, etc), x_coords and y_coords are lists of X and Y coordinates for the sample grid, and contour_levels is a list of values at which a contour should be calculated. Conrex.conrec outputs a list of line segments to match the classic algorithm.

If the X and Y values are GPS coordinates, you can use Conrex.contour_polygons to generate GeoJSON polygons for each contour level:

iex> Conrex.contour_polygons(values, x_coords, y_coords, contour_levels, reference_point)

The additional parameter, reference_point, is a point known to be within the contour polygon, but outside any polygon holes. When converting the line segments to GeoJSON %Geo.Polygon{}s, Conrex will discard exterior polygon rings, and correct the coordinate winding for the main ring and the polygon holes to conform to the GeoJSON spec.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Some of the tests will write output and sample data to a contour.js file, which can be used to visualize the test data and result. The visualization can be seen by viewing priv/static/index.html in a web browser.

Credits

Zack Michener & Stephanie Wilkinson

License

MIT

conrex's People

Contributors

protestcontest avatar stephaniewilkinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

conrex's Issues

Add metadata to `mix.exs`

https://hex.pm/docs/publish

:name
The name of the package in case you want to publish the package with a different name than the application name. By default this is set to the same as the name of your OTP application (having the same value as project.app), written in snake_case (lowercase with underscores as word separator).

:organization
The organization the package belongs to. The package will be published to the organization repository, defaults to the global "hexpm" repository.

:licenses
A list of licenses the project is licensed under. This attribute is required. It is recommended to use SPDX License identifier.

:links
A map where the key is a link name and the value is the link URL. Optional but highly recommended.

:files
A list of files and directories to include in the package. Defaults to standard project directories, so you usually don't need to set this property.

:build_tools
List of build tools that can build the package. It's very rare that you need to set this, as Hex tries to automatically detect the build tools based on the files in the package. If a rebar or rebar.config file is present Hex will mark it as able to build with rebar. This detection can be overridden by setting this field.

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.