Skip to content

enable reading of pbfs with node location for ways #110

@sergiupantiru

Description

@sergiupantiru

Hello,

I've looked into adding lat/long support for Ways. I know that osmium can add location on ways and that some other tools can read it. This would allow you to create the WKT of the way without too much headache.

I've added the lat/lon, the same as the osmformat.proto

message Way {
   required int64 id = 1;
   // Parallel arrays.
   repeated uint32 keys = 2 [packed = true];
   repeated uint32 vals = 3 [packed = true];

   optional Info info = 4;

   repeated sint64 refs = 8 [packed = true];  // DELTA coded

+  repeated sint64 lat = 9 [packed = true]; // DELTA coded, optional
+  repeated sint64 lon = 10 [packed = true]; // DELTA coded, optional
}

In the OsmSqlEtity I've added a new schema for way.nodes

  lazy val wayNodeSchema = StructType(
    Seq(
      StructField(FIELD_ID, LongType, true),
      StructField(FIELD_LATITUDE, DoubleType, true),
      StructField(FIELD_LONGITUDE, DoubleType, true)
    ))

Before I make a PR I wanted to know your opinion if this would be acceptable.

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions