org.apache.spark.SerializableWritable Scala Examples

The following examples show how to use org.apache.spark.SerializableWritable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Example 1
Source File: OsmShape.scala    From magellan   with Apache License 2.0 5 votes vote down vote up
package magellan.io

import org.apache.spark.SerializableWritable
import java.io.{DataInput, DataOutput, ByteArrayOutputStream}
import org.apache.hadoop.io.{Writable, Text, FloatWritable, MapWritable, ArrayWritable}
import magellan.{Shape, Point}
import collection.JavaConversions._

case class OsmKey(val shapeType: String, val id: String) extends Serializable { }

abstract class OsmShape(val id: String, val tags: Map[String, String]) extends Serializable { }

case class OsmNode(
    override val id: String,
    val lat: Double,
    val lon: Double,
    override val tags: Map[String, String])
  extends OsmShape(id, tags) {
  
  def point: Point = Point(lon, lat)
}

case class OsmWay(
    override val id: String,
    val nodeIds: Seq[String],
    override val tags: Map[String, String])
  extends OsmShape(id, tags) { }

case class OsmRelation(
    override val id: String,
    val wayIds: Seq[String],
    override val tags: Map[String, String])
  extends OsmShape(id, tags) { }