Skip to content
Snippets Groups Projects
Commit 18bcee24 authored by lazarog98's avatar lazarog98
Browse files

Resolve "Create a roadnetwork proto for roadnetwork data"

parent 2bef51ec
Branches
No related tags found
1 merge request!4Resolve "Create a roadnetwork proto for roadnetwork data"
Showing
with 6018 additions and 1 deletion
...@@ -8,3 +8,29 @@ ...@@ -8,3 +8,29 @@
**/.idea/ **/.idea/
**ubyte* **ubyte*
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
Footer
{
"java.configuration.updateBuildConfiguration": "interactive"
}
\ No newline at end of file
...@@ -9,3 +9,19 @@ Legend: ...@@ -9,3 +9,19 @@ Legend:
* blue oval - data generated by us * blue oval - data generated by us
* rectangle - a service * rectangle - a service
* green outline - microservice * green outline - microservice
## Development
##### To generate classes from proto definition, one has to execute from the root directory
First install the protobuf compiler with :
```sh
sudo apt install protobuf-compiler
```
If you want to build the protos from source schema, you should use the command :
```sh
protoc -I=./mapbuilder/src/main/java/map/builder/protos/ --java_out=./ ./mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
```
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>map.builder</groupId>
<artifactId>mapbuilder</artifactId>
<version>1.4</version>
<name>mapbuilder</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.21.12</version>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
package map.builder;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
/**
* <pre>
* A location is geographical point. The coordinate system used is WGS 84
* </pre>
*
* Protobuf type {@code protos.Location}
*/
public final class Location extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:protos.Location)
LocationOrBuilder {
private static final long serialVersionUID = 0L;
// Use Location.newBuilder() to construct.
private Location(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private Location() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Location();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Location(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 13: {
lat_ = input.readFloat();
break;
}
case 21: {
lon_ = input.readFloat();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Location_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Location_fieldAccessorTable
.ensureFieldAccessorsInitialized(
map.builder.protos.Location.class, map.builder.protos.Location.Builder.class);
}
public static final int LAT_FIELD_NUMBER = 1;
private float lat_;
/**
* <pre>
* lat corresponds to the latitude of the point
* </pre>
*
* <code>float lat = 1;</code>
* @return The lat.
*/
@java.lang.Override
public float getLat() {
return lat_;
}
public static final int LON_FIELD_NUMBER = 2;
private float lon_;
/**
* <pre>
* lon corresponds to the longitude of the point
* </pre>
*
* <code>float lon = 2;</code>
* @return The lon.
*/
@java.lang.Override
public float getLon() {
return lon_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (lat_ != 0F) {
output.writeFloat(1, lat_);
}
if (lon_ != 0F) {
output.writeFloat(2, lon_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (lat_ != 0F) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(1, lat_);
}
if (lon_ != 0F) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(2, lon_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof map.builder.protos.Location)) {
return super.equals(obj);
}
map.builder.protos.Location other = (map.builder.protos.Location) obj;
if (java.lang.Float.floatToIntBits(getLat())
!= java.lang.Float.floatToIntBits(
other.getLat())) return false;
if (java.lang.Float.floatToIntBits(getLon())
!= java.lang.Float.floatToIntBits(
other.getLon())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + LAT_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getLat());
hash = (37 * hash) + LON_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getLon());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static map.builder.protos.Location parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static map.builder.protos.Location parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static map.builder.protos.Location parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static map.builder.protos.Location parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static map.builder.protos.Location parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static map.builder.protos.Location parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static map.builder.protos.Location parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static map.builder.protos.Location parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static map.builder.protos.Location parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static map.builder.protos.Location parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static map.builder.protos.Location parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static map.builder.protos.Location parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(map.builder.protos.Location prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* A location is geographical point. The coordinate system used is WGS 84
* </pre>
*
* Protobuf type {@code protos.Location}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:protos.Location)
map.builder.protos.LocationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Location_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Location_fieldAccessorTable
.ensureFieldAccessorsInitialized(
map.builder.protos.Location.class, map.builder.protos.Location.Builder.class);
}
// Construct using map.builder.protos.Location.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
lat_ = 0F;
lon_ = 0F;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Location_descriptor;
}
@java.lang.Override
public map.builder.protos.Location getDefaultInstanceForType() {
return map.builder.protos.Location.getDefaultInstance();
}
@java.lang.Override
public map.builder.protos.Location build() {
map.builder.protos.Location result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public map.builder.protos.Location buildPartial() {
map.builder.protos.Location result = new map.builder.protos.Location(this);
result.lat_ = lat_;
result.lon_ = lon_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof map.builder.protos.Location) {
return mergeFrom((map.builder.protos.Location)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(map.builder.protos.Location other) {
if (other == map.builder.protos.Location.getDefaultInstance()) return this;
if (other.getLat() != 0F) {
setLat(other.getLat());
}
if (other.getLon() != 0F) {
setLon(other.getLon());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
map.builder.protos.Location parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (map.builder.protos.Location) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private float lat_ ;
/**
* <pre>
* lat corresponds to the latitude of the point
* </pre>
*
* <code>float lat = 1;</code>
* @return The lat.
*/
@java.lang.Override
public float getLat() {
return lat_;
}
/**
* <pre>
* lat corresponds to the latitude of the point
* </pre>
*
* <code>float lat = 1;</code>
* @param value The lat to set.
* @return This builder for chaining.
*/
public Builder setLat(float value) {
lat_ = value;
onChanged();
return this;
}
/**
* <pre>
* lat corresponds to the latitude of the point
* </pre>
*
* <code>float lat = 1;</code>
* @return This builder for chaining.
*/
public Builder clearLat() {
lat_ = 0F;
onChanged();
return this;
}
private float lon_ ;
/**
* <pre>
* lon corresponds to the longitude of the point
* </pre>
*
* <code>float lon = 2;</code>
* @return The lon.
*/
@java.lang.Override
public float getLon() {
return lon_;
}
/**
* <pre>
* lon corresponds to the longitude of the point
* </pre>
*
* <code>float lon = 2;</code>
* @param value The lon to set.
* @return This builder for chaining.
*/
public Builder setLon(float value) {
lon_ = value;
onChanged();
return this;
}
/**
* <pre>
* lon corresponds to the longitude of the point
* </pre>
*
* <code>float lon = 2;</code>
* @return This builder for chaining.
*/
public Builder clearLon() {
lon_ = 0F;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:protos.Location)
}
// @@protoc_insertion_point(class_scope:protos.Location)
private static final map.builder.protos.Location DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new map.builder.protos.Location();
}
public static map.builder.protos.Location getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Location>
PARSER = new com.google.protobuf.AbstractParser<Location>() {
@java.lang.Override
public Location parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Location(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Location> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Location> getParserForType() {
return PARSER;
}
@java.lang.Override
public map.builder.protos.Location getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
public interface LocationOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos.Location)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* lat corresponds to the latitude of the point
* </pre>
*
* <code>float lat = 1;</code>
* @return The lat.
*/
float getLat();
/**
* <pre>
* lon corresponds to the longitude of the point
* </pre>
*
* <code>float lon = 2;</code>
* @return The lon.
*/
float getLon();
}
This diff is collapsed.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
public interface NodeOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos.Node)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Internally used ids of our segments
* </pre>
*
* <code>uint32 id = 1;</code>
* @return The id.
*/
int getId();
/**
* <pre>
* Vendor IDs of OSM data, used for referencing the original data
* </pre>
*
* <code>string osm_id = 2;</code>
* @return The osmId.
*/
java.lang.String getOsmId();
/**
* <pre>
* Vendor IDs of OSM data, used for referencing the original data
* </pre>
*
* <code>string osm_id = 2;</code>
* @return The bytes for osmId.
*/
com.google.protobuf.ByteString
getOsmIdBytes();
/**
* <pre>
* Coordinaes of the intersection
* </pre>
*
* <code>.protos.Location position = 3;</code>
* @return Whether the position field is set.
*/
boolean hasPosition();
/**
* <pre>
* Coordinaes of the intersection
* </pre>
*
* <code>.protos.Location position = 3;</code>
* @return The position.
*/
map.builder.protos.Location getPosition();
/**
* <pre>
* Coordinaes of the intersection
* </pre>
*
* <code>.protos.Location position = 3;</code>
*/
map.builder.protos.LocationOrBuilder getPositionOrBuilder();
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
/**
* <pre>
* A restricted turn from one segment to another, which are adjacent to each other
* </pre>
*
* Protobuf type {@code protos.Restriction}
*/
public final class Restriction extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:protos.Restriction)
RestrictionOrBuilder {
private static final long serialVersionUID = 0L;
// Use Restriction.newBuilder() to construct.
private Restriction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private Restriction() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Restriction();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Restriction(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
fromId_ = input.readUInt32();
break;
}
case 16: {
toId_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Restriction_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Restriction_fieldAccessorTable
.ensureFieldAccessorsInitialized(
map.builder.protos.Restriction.class, map.builder.protos.Restriction.Builder.class);
}
public static final int FROM_ID_FIELD_NUMBER = 1;
private int fromId_;
/**
* <pre>
* from_id is the id of the segment from which the turn originates
* </pre>
*
* <code>uint32 from_id = 1;</code>
* @return The fromId.
*/
@java.lang.Override
public int getFromId() {
return fromId_;
}
public static final int TO_ID_FIELD_NUMBER = 2;
private int toId_;
/**
* <pre>
* to_id is the id of the segment in which the turn ends
* </pre>
*
* <code>uint32 to_id = 2;</code>
* @return The toId.
*/
@java.lang.Override
public int getToId() {
return toId_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (fromId_ != 0) {
output.writeUInt32(1, fromId_);
}
if (toId_ != 0) {
output.writeUInt32(2, toId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (fromId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, fromId_);
}
if (toId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, toId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof map.builder.protos.Restriction)) {
return super.equals(obj);
}
map.builder.protos.Restriction other = (map.builder.protos.Restriction) obj;
if (getFromId()
!= other.getFromId()) return false;
if (getToId()
!= other.getToId()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + FROM_ID_FIELD_NUMBER;
hash = (53 * hash) + getFromId();
hash = (37 * hash) + TO_ID_FIELD_NUMBER;
hash = (53 * hash) + getToId();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static map.builder.protos.Restriction parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static map.builder.protos.Restriction parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static map.builder.protos.Restriction parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static map.builder.protos.Restriction parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static map.builder.protos.Restriction parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static map.builder.protos.Restriction parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static map.builder.protos.Restriction parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static map.builder.protos.Restriction parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static map.builder.protos.Restriction parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static map.builder.protos.Restriction parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static map.builder.protos.Restriction parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static map.builder.protos.Restriction parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(map.builder.protos.Restriction prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* A restricted turn from one segment to another, which are adjacent to each other
* </pre>
*
* Protobuf type {@code protos.Restriction}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:protos.Restriction)
map.builder.protos.RestrictionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Restriction_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Restriction_fieldAccessorTable
.ensureFieldAccessorsInitialized(
map.builder.protos.Restriction.class, map.builder.protos.Restriction.Builder.class);
}
// Construct using map.builder.protos.Restriction.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
fromId_ = 0;
toId_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return map.builder.protos.RoadNetworkProto.internal_static_protos_Restriction_descriptor;
}
@java.lang.Override
public map.builder.protos.Restriction getDefaultInstanceForType() {
return map.builder.protos.Restriction.getDefaultInstance();
}
@java.lang.Override
public map.builder.protos.Restriction build() {
map.builder.protos.Restriction result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public map.builder.protos.Restriction buildPartial() {
map.builder.protos.Restriction result = new map.builder.protos.Restriction(this);
result.fromId_ = fromId_;
result.toId_ = toId_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof map.builder.protos.Restriction) {
return mergeFrom((map.builder.protos.Restriction)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(map.builder.protos.Restriction other) {
if (other == map.builder.protos.Restriction.getDefaultInstance()) return this;
if (other.getFromId() != 0) {
setFromId(other.getFromId());
}
if (other.getToId() != 0) {
setToId(other.getToId());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
map.builder.protos.Restriction parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (map.builder.protos.Restriction) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int fromId_ ;
/**
* <pre>
* from_id is the id of the segment from which the turn originates
* </pre>
*
* <code>uint32 from_id = 1;</code>
* @return The fromId.
*/
@java.lang.Override
public int getFromId() {
return fromId_;
}
/**
* <pre>
* from_id is the id of the segment from which the turn originates
* </pre>
*
* <code>uint32 from_id = 1;</code>
* @param value The fromId to set.
* @return This builder for chaining.
*/
public Builder setFromId(int value) {
fromId_ = value;
onChanged();
return this;
}
/**
* <pre>
* from_id is the id of the segment from which the turn originates
* </pre>
*
* <code>uint32 from_id = 1;</code>
* @return This builder for chaining.
*/
public Builder clearFromId() {
fromId_ = 0;
onChanged();
return this;
}
private int toId_ ;
/**
* <pre>
* to_id is the id of the segment in which the turn ends
* </pre>
*
* <code>uint32 to_id = 2;</code>
* @return The toId.
*/
@java.lang.Override
public int getToId() {
return toId_;
}
/**
* <pre>
* to_id is the id of the segment in which the turn ends
* </pre>
*
* <code>uint32 to_id = 2;</code>
* @param value The toId to set.
* @return This builder for chaining.
*/
public Builder setToId(int value) {
toId_ = value;
onChanged();
return this;
}
/**
* <pre>
* to_id is the id of the segment in which the turn ends
* </pre>
*
* <code>uint32 to_id = 2;</code>
* @return This builder for chaining.
*/
public Builder clearToId() {
toId_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:protos.Restriction)
}
// @@protoc_insertion_point(class_scope:protos.Restriction)
private static final map.builder.protos.Restriction DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new map.builder.protos.Restriction();
}
public static map.builder.protos.Restriction getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Restriction>
PARSER = new com.google.protobuf.AbstractParser<Restriction>() {
@java.lang.Override
public Restriction parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Restriction(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Restriction> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Restriction> getParserForType() {
return PARSER;
}
@java.lang.Override
public map.builder.protos.Restriction getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
public interface RestrictionOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos.Restriction)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* from_id is the id of the segment from which the turn originates
* </pre>
*
* <code>uint32 from_id = 1;</code>
* @return The fromId.
*/
int getFromId();
/**
* <pre>
* to_id is the id of the segment in which the turn ends
* </pre>
*
* <code>uint32 to_id = 2;</code>
* @return The toId.
*/
int getToId();
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
/**
* <pre>
* RoadCategory groups road segments into several classes
* </pre>
*
* Protobuf enum {@code protos.RoadCategory}
*/
public enum RoadCategory
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <pre>
* a special value to indicate that the field is not set
* </pre>
*
* <code>ROAD_CATEGORY_INVALID = 0;</code>
*/
ROAD_CATEGORY_INVALID(0),
/**
* <pre>
* represents motorway and trunks, according to the specification of OSM's data
* </pre>
*
* <code>ROAD_CATEGORY_HIGHWAY = 1;</code>
*/
ROAD_CATEGORY_HIGHWAY(1),
/**
* <pre>
* often link larger towns
* </pre>
*
* <code>ROAD_CATEGORY_MAIN = 2;</code>
*/
ROAD_CATEGORY_MAIN(2),
/**
* <pre>
* represents a road within a city or connecting small towns
* </pre>
*
* <code>ROAD_CATEGORY_LOCAL = 3;</code>
*/
ROAD_CATEGORY_LOCAL(3),
/**
* <pre>
* represents a vehicular access to small streets connecting roads with apartments, buildings
* </pre>
*
* <code>ROAD_CATEGORY_RESIDENTIAL = 4;</code>
*/
ROAD_CATEGORY_RESIDENTIAL(4),
UNRECOGNIZED(-1),
;
/**
* <pre>
* a special value to indicate that the field is not set
* </pre>
*
* <code>ROAD_CATEGORY_INVALID = 0;</code>
*/
public static final int ROAD_CATEGORY_INVALID_VALUE = 0;
/**
* <pre>
* represents motorway and trunks, according to the specification of OSM's data
* </pre>
*
* <code>ROAD_CATEGORY_HIGHWAY = 1;</code>
*/
public static final int ROAD_CATEGORY_HIGHWAY_VALUE = 1;
/**
* <pre>
* often link larger towns
* </pre>
*
* <code>ROAD_CATEGORY_MAIN = 2;</code>
*/
public static final int ROAD_CATEGORY_MAIN_VALUE = 2;
/**
* <pre>
* represents a road within a city or connecting small towns
* </pre>
*
* <code>ROAD_CATEGORY_LOCAL = 3;</code>
*/
public static final int ROAD_CATEGORY_LOCAL_VALUE = 3;
/**
* <pre>
* represents a vehicular access to small streets connecting roads with apartments, buildings
* </pre>
*
* <code>ROAD_CATEGORY_RESIDENTIAL = 4;</code>
*/
public static final int ROAD_CATEGORY_RESIDENTIAL_VALUE = 4;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static RoadCategory valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static RoadCategory forNumber(int value) {
switch (value) {
case 0: return ROAD_CATEGORY_INVALID;
case 1: return ROAD_CATEGORY_HIGHWAY;
case 2: return ROAD_CATEGORY_MAIN;
case 3: return ROAD_CATEGORY_LOCAL;
case 4: return ROAD_CATEGORY_RESIDENTIAL;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<RoadCategory>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
RoadCategory> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<RoadCategory>() {
public RoadCategory findValueByNumber(int number) {
return RoadCategory.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return map.builder.protos.RoadNetworkProto.getDescriptor().getEnumTypes().get(0);
}
private static final RoadCategory[] VALUES = values();
public static RoadCategory valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private RoadCategory(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:protos.RoadCategory)
}
This diff is collapsed.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
public interface RoadNetworkOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos.RoadNetwork)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Nodes are corresponding to intersections
* </pre>
*
* <code>repeated .protos.Node nodes = 1;</code>
*/
java.util.List<map.builder.protos.Node>
getNodesList();
/**
* <pre>
* Nodes are corresponding to intersections
* </pre>
*
* <code>repeated .protos.Node nodes = 1;</code>
*/
map.builder.protos.Node getNodes(int index);
/**
* <pre>
* Nodes are corresponding to intersections
* </pre>
*
* <code>repeated .protos.Node nodes = 1;</code>
*/
int getNodesCount();
/**
* <pre>
* Nodes are corresponding to intersections
* </pre>
*
* <code>repeated .protos.Node nodes = 1;</code>
*/
java.util.List<? extends map.builder.protos.NodeOrBuilder>
getNodesOrBuilderList();
/**
* <pre>
* Nodes are corresponding to intersections
* </pre>
*
* <code>repeated .protos.Node nodes = 1;</code>
*/
map.builder.protos.NodeOrBuilder getNodesOrBuilder(
int index);
/**
* <pre>
* Segments correspond to edges in our graph
* </pre>
*
* <code>repeated .protos.Segment segments = 2;</code>
*/
java.util.List<map.builder.protos.Segment>
getSegmentsList();
/**
* <pre>
* Segments correspond to edges in our graph
* </pre>
*
* <code>repeated .protos.Segment segments = 2;</code>
*/
map.builder.protos.Segment getSegments(int index);
/**
* <pre>
* Segments correspond to edges in our graph
* </pre>
*
* <code>repeated .protos.Segment segments = 2;</code>
*/
int getSegmentsCount();
/**
* <pre>
* Segments correspond to edges in our graph
* </pre>
*
* <code>repeated .protos.Segment segments = 2;</code>
*/
java.util.List<? extends map.builder.protos.SegmentOrBuilder>
getSegmentsOrBuilderList();
/**
* <pre>
* Segments correspond to edges in our graph
* </pre>
*
* <code>repeated .protos.Segment segments = 2;</code>
*/
map.builder.protos.SegmentOrBuilder getSegmentsOrBuilder(
int index);
/**
* <pre>
* Turn restrictitons correspond to turn restrictions
* </pre>
*
* <code>repeated .protos.Restriction turn_restrictions = 3;</code>
*/
java.util.List<map.builder.protos.Restriction>
getTurnRestrictionsList();
/**
* <pre>
* Turn restrictitons correspond to turn restrictions
* </pre>
*
* <code>repeated .protos.Restriction turn_restrictions = 3;</code>
*/
map.builder.protos.Restriction getTurnRestrictions(int index);
/**
* <pre>
* Turn restrictitons correspond to turn restrictions
* </pre>
*
* <code>repeated .protos.Restriction turn_restrictions = 3;</code>
*/
int getTurnRestrictionsCount();
/**
* <pre>
* Turn restrictitons correspond to turn restrictions
* </pre>
*
* <code>repeated .protos.Restriction turn_restrictions = 3;</code>
*/
java.util.List<? extends map.builder.protos.RestrictionOrBuilder>
getTurnRestrictionsOrBuilderList();
/**
* <pre>
* Turn restrictitons correspond to turn restrictions
* </pre>
*
* <code>repeated .protos.Restriction turn_restrictions = 3;</code>
*/
map.builder.protos.RestrictionOrBuilder getTurnRestrictionsOrBuilder(
int index);
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
public final class RoadNetworkProto {
private RoadNetworkProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_RoadNetwork_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_protos_RoadNetwork_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_Node_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_protos_Node_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_Segment_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_protos_Segment_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_Restriction_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_protos_Restriction_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_Location_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_protos_Location_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\nDmapbuilder/src/main/java/map/builder/p" +
"rotos/schema/roadnetwork.proto\022\006protos\"}" +
"\n\013RoadNetwork\022\033\n\005nodes\030\001 \003(\0132\014.protos.No" +
"de\022!\n\010segments\030\002 \003(\0132\017.protos.Segment\022.\n" +
"\021turn_restrictions\030\003 \003(\0132\023.protos.Restri" +
"ction\"F\n\004Node\022\n\n\002id\030\001 \001(\r\022\016\n\006osm_id\030\002 \001(" +
"\t\022\"\n\010position\030\003 \001(\0132\020.protos.Location\"\247\001" +
"\n\007Segment\022\n\n\002id\030\001 \001(\r\022\016\n\006osm_id\030\002 \001(\t\022\"\n" +
"\010geometry\030\003 \001(\0132\020.protos.Location\022\016\n\006len" +
"gth\030\004 \001(\001\022\022\n\nstart_node\030\005 \001(\r\022\020\n\010end_nod" +
"e\030\006 \001(\r\022&\n\010category\030\007 \001(\0162\024.protos.RoadC" +
"ategory\"-\n\013Restriction\022\017\n\007from_id\030\001 \001(\r\022" +
"\r\n\005to_id\030\002 \001(\r\"$\n\010Location\022\013\n\003lat\030\001 \001(\002\022" +
"\013\n\003lon\030\002 \001(\002*\224\001\n\014RoadCategory\022\031\n\025ROAD_CA" +
"TEGORY_INVALID\020\000\022\031\n\025ROAD_CATEGORY_HIGHWA" +
"Y\020\001\022\026\n\022ROAD_CATEGORY_MAIN\020\002\022\027\n\023ROAD_CATE" +
"GORY_LOCAL\020\003\022\035\n\031ROAD_CATEGORY_RESIDENTIA" +
"L\020\004B(\n\022map.builder.protosB\020RoadNetworkPr" +
"otoP\001b\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_protos_RoadNetwork_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_protos_RoadNetwork_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_protos_RoadNetwork_descriptor,
new java.lang.String[] { "Nodes", "Segments", "TurnRestrictions", });
internal_static_protos_Node_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_protos_Node_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_protos_Node_descriptor,
new java.lang.String[] { "Id", "OsmId", "Position", });
internal_static_protos_Segment_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_protos_Segment_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_protos_Segment_descriptor,
new java.lang.String[] { "Id", "OsmId", "Geometry", "Length", "StartNode", "EndNode", "Category", });
internal_static_protos_Restriction_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_protos_Restriction_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_protos_Restriction_descriptor,
new java.lang.String[] { "FromId", "ToId", });
internal_static_protos_Location_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_protos_Location_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_protos_Location_descriptor,
new java.lang.String[] { "Lat", "Lon", });
}
// @@protoc_insertion_point(outer_class_scope)
}
This diff is collapsed.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto
package map.builder.protos;
public interface SegmentOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos.Segment)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* id is the internal id used in our system of a segment
* </pre>
*
* <code>uint32 id = 1;</code>
* @return The id.
*/
int getId();
/**
* <pre>
* osm_id is the id of the segment, in the original OSM data, if it exists as a separate segment there
* </pre>
*
* <code>string osm_id = 2;</code>
* @return The osmId.
*/
java.lang.String getOsmId();
/**
* <pre>
* osm_id is the id of the segment, in the original OSM data, if it exists as a separate segment there
* </pre>
*
* <code>string osm_id = 2;</code>
* @return The bytes for osmId.
*/
com.google.protobuf.ByteString
getOsmIdBytes();
/**
* <pre>
* geometry represents the linestring representing the segment
* </pre>
*
* <code>.protos.Location geometry = 3;</code>
* @return Whether the geometry field is set.
*/
boolean hasGeometry();
/**
* <pre>
* geometry represents the linestring representing the segment
* </pre>
*
* <code>.protos.Location geometry = 3;</code>
* @return The geometry.
*/
map.builder.protos.Location getGeometry();
/**
* <pre>
* geometry represents the linestring representing the segment
* </pre>
*
* <code>.protos.Location geometry = 3;</code>
*/
map.builder.protos.LocationOrBuilder getGeometryOrBuilder();
/**
* <pre>
* length of the segment in meters
* </pre>
*
* <code>double length = 4;</code>
* @return The length.
*/
double getLength();
/**
* <pre>
* start_node is the start endpoint of the segment
* </pre>
*
* <code>uint32 start_node = 5;</code>
* @return The startNode.
*/
int getStartNode();
/**
* <pre>
* end_node is the end endpoint of the segment
* </pre>
*
* <code>uint32 end_node = 6;</code>
* @return The endNode.
*/
int getEndNode();
/**
* <pre>
* category of the road according to OSM main road types
* </pre>
*
* <code>.protos.RoadCategory category = 7;</code>
* @return The enum numeric value on the wire for category.
*/
int getCategoryValue();
/**
* <pre>
* category of the road according to OSM main road types
* </pre>
*
* <code>.protos.RoadCategory category = 7;</code>
* @return The category.
*/
map.builder.protos.RoadCategory getCategory();
}
syntax = "proto3";
package protos;
option java_multiple_files = true;
option java_package = "map.builder.protos";
option java_outer_classname = "RoadNetworkProto";
//Roadnetwork represents our whole roadnetwork
message RoadNetwork {
// Nodes are corresponding to intersections
repeated Node nodes = 1;
// Segments correspond to edges in our graph
repeated Segment segments = 2;
// Turn restrictitons correspond to turn restrictions
repeated Restriction turn_restrictions = 3;
}
// Nodes represent usually intersections in our network.
message Node {
// Internally used ids of our segments
uint32 id = 1;
// Vendor IDs of OSM data, used for referencing the original data
string osm_id = 2;
// Coordinaes of the intersection
Location position = 3;
}
// Segment represents a directed edge in our network, which connects two nodes
message Segment {
// id is the internal id used in our system of a segment
uint32 id = 1;
// osm_id is the id of the segment, in the original OSM data, if it exists as a separate segment there
string osm_id = 2;
// geometry represents the linestring representing the segment
Location geometry = 3;
// length of the segment in meters
double length = 4;
// start_node is the start endpoint of the segment
uint32 start_node = 5;
// end_node is the end endpoint of the segment
uint32 end_node = 6;
// category of the road according to OSM main road types
RoadCategory category = 7;
}
// RoadCategory groups road segments into several classes
enum RoadCategory {
// a special value to indicate that the field is not set
ROAD_CATEGORY_INVALID = 0;
// represents motorway and trunks, according to the specification of OSM's data
ROAD_CATEGORY_HIGHWAY = 1;
// often link larger towns
ROAD_CATEGORY_MAIN = 2;
// represents a road within a city or connecting small towns
ROAD_CATEGORY_LOCAL = 3;
// represents a vehicular access to small streets connecting roads with apartments, buildings
ROAD_CATEGORY_RESIDENTIAL=4;
}
// A restricted turn from one segment to another, which are adjacent to each other
message Restriction {
// from_id is the id of the segment from which the turn originates
uint32 from_id = 1;
// to_id is the id of the segment in which the turn ends
uint32 to_id = 2;
}
// A location is geographical point. The coordinate system used is WGS 84
message Location {
// lat corresponds to the latitude of the point
float lat = 1;
// lon corresponds to the longitude of the point
float lon = 2;
}
\ No newline at end of file
package map.builder;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment