~ihabunek/triglav

ref: d1b5915f3e023d04850eabf702bda7207a337302 triglav/lib/triglav/schemas/public_transport/trip.ex -rw-r--r-- 564 bytes
d1b5915fIvan Habunek Validate platform distance from route 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
defmodule Triglav.Schemas.PublicTransport.Trip do
  @moduledoc """
  Matches an OSM relation of type="route" to a ZET route and contains some
  added information.
  """
  use Ecto.Schema

  alias Triglav.Schemas.Osmosis
  alias Triglav.Schemas.Zet

  @type t :: %__MODULE__{}

  @primary_key false

  schema "public_transport_trips" do
    belongs_to :relation, Osmosis.Relation, primary_key: true
    belongs_to :route, Zet.Route, type: :binary
    field :geometry, Geo.PostGIS.Geometry
    field :exact, :boolean
    field :stop_ids, {:array, :string}
  end
end