30 lines
873 B
C#
30 lines
873 B
C#
|
namespace OsmXmlToRegionConverter;
|
||
|
|
||
|
public class TmpWay
|
||
|
{
|
||
|
public ulong id { get; }
|
||
|
public ulong[] wayNodeIds { get; }
|
||
|
public HashSet<Tag> tags { get; }
|
||
|
|
||
|
public TmpWay(ulong id, ulong[] wayNodeIds, HashSet<Tag> tags)
|
||
|
{
|
||
|
this.id = id;
|
||
|
this.wayNodeIds = wayNodeIds;
|
||
|
this.tags = tags;
|
||
|
}
|
||
|
|
||
|
public static TmpWay FromBytes(byte[] bytes)
|
||
|
{
|
||
|
using (MemoryStream m = new MemoryStream(bytes)) {
|
||
|
using (BinaryReader r = new BinaryReader(m))
|
||
|
{
|
||
|
int wayNodeIdsLength = r.ReadInt32();
|
||
|
ulong id = r.ReadUInt64();
|
||
|
ulong[] wayNodeIds = new ulong[wayNodeIdsLength];
|
||
|
for (int i = 0; i < wayNodeIds.Length; i++)
|
||
|
wayNodeIds[i] = r.ReadUInt64();
|
||
|
return new TmpWay(id, wayNodeIds);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|