Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save Atlas to ProtobufAtlas similar to TextAtlas #99

Merged
merged 39 commits into from
Mar 29, 2018
Merged

Save Atlas to ProtobufAtlas similar to TextAtlas #99

merged 39 commits into from
Mar 29, 2018

Conversation

lucaspcram
Copy link
Contributor

@lucaspcram lucaspcram commented Mar 21, 2018

Since I changed the build flow of the Atlas project to accommodate protobuf, I think it may be a good idea to create a protobuf (or some other name) branch on the repo. I don't want to break peoples' Eclipse workflow on the dev branch until we are further along with this update. In the interest of this objective, we should probably close this PR and I'll reopen it on the protobuf branch once that is created.
EDIT: After discussion with Matthieu, we have decided to not create a protobuf branch on the repo. Instead, I will push to a protobuf branch on my fork, then submit PRs against dev for review. We can discuss, I'll make changes in my fork, then resubmit or restart the PR. When the feature is complete, we will consolidate and pull the changes into dev.

Other than that, I was hoping we could have an initial discussion about the proposed changes, and make sure I am moving in the right direction before I really start cranking out more code.

Copy link
Contributor

@MikeGost MikeGost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've officially become our Proto expert! Really nice and clean code. Some minor suggestions inline.

return protoTags;
}

private ProtoLocation convertLocationToProtoLocation(final Location location)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the Converter and TwoWayConverter interfaces, it might be a good pattern to follow here as well. Create a proto conversion package that has all the converters (with convert and backwardConvert), then use them here in the builder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! James actually mentioned the exact same thing.

final ProtoTag.Builder tagBuilder = ProtoTag.newBuilder();

// TODO what happens if entry.getValue() returns null?
// this could happen if someone inserted a null entry at that key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say in the case of a null key or value, throw away the entry and log a warning.

}
return result;
}
// TODO do something smarter here?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, I would add the error to the re-thrown exception so it doesn't get lost. Possibly the tagsList as well.

throw new CoreException("Unable to parse proto tags.", error);

{
protoAtlasContainer = ProtoAtlasContainer.parseFrom(resource.readBytesAndClose());
}
// TODO do something smarter here?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only add the caught exception to the CoreException argument list so the stack trace isn't lost.

throw new CoreException("Error parsing the protobuf", exception);

protoLineBuilder.setId(line.getIdentifier());

final List<ProtoLocation> protoLocations = StreamSupport
.stream(line.getRawGeometry().spliterator(), false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative way (not sure if it's cleaner) would be line.asPolyLine().stream().map(...).collect(...);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this. For some reason I couldn't get that to work initially so went with the StreamSupport solution. I was probably just spelling something wrong.

final long numberOfRelations = 0;
final AtlasSize atlasSize = new AtlasSize(numberOfEdges, numberOfNodes, numberOfAreas,
numberOfLines, numberOfPoints, numberOfRelations);
final AtlasMetaData atlasMetaData = new AtlasMetaData(atlasSize, true, "unknown",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should have any kind of tag to specify this atlas was built from Proto?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at that class and see if there's something I can add.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I just mean add an entry into the Metadata tags saying source=proto and proto_version=xx (not sure if you can read that dynamically, but assuming yes).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok yeah can do. Did you have some fancy method in mind or should I just write code that greps build.gradle?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought there might be an easier way! If there's not, I wouldn't worry about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll mark it as TODO and if some simple way presents itself I'll be sure to implement it.

resource.writeAndClose(protoAtlas.toByteArray());
}

private List<ProtoTag> buildProtoTagListFromTagMap(final Map<String, String> tags)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this function can also go in the Converter package?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converter back and forth between List and Map<String,String>? That sounds like it would work.

});
}

private Map<String, String> parseTags(final List<ProtoTag> tagsList)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this class can go in the Converter package?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Collaborator

@matthieun matthieun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good looking code and protos! I have a few questions/requests regarding the gradle/eclipse integration.

```

4. Back in Eclipse, right click the Atlas project in Package Explorer and click "Refresh"
1. NOTE: You should now see a "gen" folder appear in the package explorer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you do right click > Gradle > Refresh and the build.gradle defines gen as a source folder, it should be picked up by Eclipse automatically. There should not be a need to go in the "cofigure build path" menu. Have you tried that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem I had with that is for some reason it just goes ahead and deletes the generated code folder, and I can't figure out why. It may have something to do with the source set config. I am currently playing around with that on a new branch on my local machine.

build.gradle Outdated
{
java
{
srcDir file('gen/main/java')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about calling that folder src/generated/java? It would fall nicely with the other src/main/java, src/test/java and src/integrationTest/java...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See note regarding ECLIPSE_README above

build.gradle Outdated
generatedFilesBaseDir = 'gen/'

protoc {
artifact = 'com.google.protobuf:protoc:2.6.1'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to use the version from dependencies.gradle here for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently investigating the proper syntax for this.

@@ -9,5 +9,6 @@
<suppress checks="MultipleStringLiterals" files="src/test/*" />
<suppress checks="MultipleStringLiterals" files="src/integrationTest/*" />
<suppress checks="InnerAssignment" files="src/test/*" />
<suppress checks="InnerAssignment" files="src/integrationTest/*" />
<suppress checks="InnerAssignment" files="src/integrationTest/*" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like indentation is not aligned here!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that's because suppressions.xml is indented with tabs. I have Eclipse set to expand tabs to spaces, which I forgot to disable while editing that file. I'll go ahead and fix that. Perhaps it would be better to change suppressions.xml to be indented with spaces? I could update that as well if you think it's a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change the indentation to spaces.

@@ -56,5 +57,6 @@ project.ext.packages = [
core: "com.fasterxml.jackson.core:jackson-core:${versions.jackson_core}",
databind: "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
],
protobuf_java: "com.google.protobuf:protobuf-java:2.6.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here use ${versions.protobuf_java}

}
catch (final InvalidProtocolBufferException exception)
{
throw new CoreException("Error deserializing the ProtoAtlasContainer", exception);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would pass the name of the resource as well!

throw new CoreException("Error deserializing the ProtoAtlasContainer from {}", resource.getName(), exception);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome I'll add that in.

recompileProto.dependsOn(deleteGeneratedProto)
recompileProto.dependsOn(generateProto)

compileJava.dependsOn(generateProto)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you figure out what gradle tasks Eclipse's gradle plugin calls? Once we know that we could just add someTask.dependeOn(recompileProto)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into it. Some cursory googling I did the other day turned up nothing. I may have to dive deep into documentation.


if (entry.getKey() == null)
{
logger.warn("buildProtoTagListFromTagMap found null key");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is possible, but adding more context to those logs might help...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely possible. I'll change that in the next couple of commits.

@matthieun matthieun changed the title Initial Protobuf PR - need a public protobuf branch Do Not Merge: Save Atlas to ProtobufAtlas similar to TextAtlas Mar 22, 2018
Copy link
Contributor

@jwpgage jwpgage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice @lucaspcram! Easy to follow and well commented. Couple comments about potential places to reuse code.

final Map<String, String> tags = protoTagListConverter.convert(protoLine.getTagsList());
builder.addLine(identifier, geometry, tags);
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseAreas and parseLines seem to be identical apart from different parameters. Would it be worth consolidating these two and passing a generic proto object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something Mike and I discussed in our 1on1. We decided for now to have them separate purely so that the design follows the API in a logically consistent way, in spite of the code reuse. Later on if it seems to be an issue we can pretty easily refactor it away.

protoAtlasBuilder.addLines(protoLineBuilder.build());
}
protoAtlasBuilder.setNumberOfLines(numberOfLines);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

final Latitude latitude = Latitude.dm7(protoLocation.getLatitude());
return new Location(latitude, longitude);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are perfect for the utilities.conversion package, nice!

.map(protoLocationConverter::convert).collect(Collectors.toList());
final PolyLine geometry = new PolyLine(shapePoints);
final Map<String, String> tags = protoTagListConverter.convert(protoArea.getTagsList());
builder.addLine(identifier, geometry, tags);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be addArea?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just a heads up: The PolyLine class stores all points. Since areas are closed lines, the first and last point is identical. The Polygon class expects the last point to not be the first point, that is implicit. So when creating the Polygon, make sure the last point is not equal to the first point, otherwise it will get duplicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Some classic cut and paste shenanigans right there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My unit test is actually failing due to this exact reason. The Atlas that gets written to the file has an Area with a Polygon, which repeats the start and end node. The Atlas that is read back in has a Linestring without the repeated point.

numberOfAreas++;
protoAtlasBuilder.addAreas(protoAreaBuilder.build());
}
protoAtlasBuilder.setNumberOfLines(numberOfAreas);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setNumberOfLines --> setNumberOfAreas

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unbelievable. This is embarrassing.

*
* @author lcram
*/
public class ProtoLocationConverter implements TwoWayConverter<ProtoLocation, Location>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice-To-Have: Corresponding unit test for each converter. You're doing this in your Builder Test, but if someone needs to change this, would be good to have a unit test for each. If you feel this is too much, feel free to disregard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a good idea. Shouldn't be too hard. It'll be in a future commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Would it be better to move this class to org.openstreetmap.atlas.geography.converters?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - see my original comment about a new package for these! I'd suggest org.openstreetmap.atlas.geography.converters.proto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On it.

Copy link
Contributor

@jklamer jklamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

parsePoints(builder, protoAtlasContainer.getPointsList());
parseLines(builder, protoAtlasContainer.getLinesList());
parseAreas(builder, protoAtlasContainer.getAreasList());

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there no relations being added to the new packed Atlas or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting there. It's still in development :)

*
* @author lcram
*/
public class ProtoTagListConverter implements TwoWayConverter<List<ProtoTag>, Map<String, String>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dig all the converters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I doubled the number of converters we have hahaha

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See org.openstreetmap.atlas.geography.converters and org.openstreetmap.atlas.geography.converters.jts for some converter love :)

@lucaspcram
Copy link
Contributor Author

It builds locally I swear.

@lucaspcram
Copy link
Contributor Author

Thanks for the feedback guys!

@jwpgage These are good points. It might be a good idea to set up an email filter for my PRs, that way your inbox doesn't get spammed.

@MikeGost

  1. Currently working on this. It turns out the Google gradle-protobuf plugin hardcodes your generated source set to be 'main/java', so it's not possible to have a 'src/generated/java' folder like @matthieun wanted. See this discussion on the gradle-protobuf plugin issue page.

  2. Awesome sounds good! I think the process was really productive. If we can deal with the increased email traffic, I think it would be cool to have more interactive PRs like this on the repo. It really encourages testing and sanity checking.

3. Once you are done adjusting the .proto files, open a command line and run
```
$ cd /path/to/local/Atlas/repo
$ ./gradlew clean build -x test -x integrationTest
Copy link
Contributor

@MikeGost MikeGost Mar 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update these instructions with the latest gradle task?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to be removing this file and updating the regular README!

build.gradle Outdated

task deleteGeneratedProto {
// the Google gradle-protobuf plugin automatically registers this task
// to be run as a pre-requisite to 'clean'. Since Eclipse's "Refresh Gradle Project"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential rabbit hole: have you tried this on IntelliJ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. And it's something I know needs to be done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option is to create a github issue for it and address it after this is merged.

.map(protoLocationConverter::convert).collect(Collectors.toList());
final Polygon geometry = new Polygon(shapePoints);
final Map<String, String> tags = protoTagListConverter.convert(protoArea.getTagsList());
// TODO see Mike's PR note about duplicate points, since start and end are the same for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this TODO be removed?


private void parseAreas(final PackedAtlasBuilder builder, final List<ProtoArea> areas)
{
final ProtoLocationConverter protoLocationConverter = new ProtoLocationConverter();
Copy link
Contributor

@MikeGost MikeGost Mar 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can rely on static converters instead of initializing them for each parsing function. This should trim the code a little to avoid initializing a new converter each time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change that!

});
}

private void parseLines(final PackedAtlasBuilder builder, final List<ProtoLine> lines)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to combine parseLines and parseAreas? The only difference is creating a PolyLine vs. a Polygon, which can be handled with a boolean flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to take a look at some of these things today. Please don't merge yet!!

});
}

private void parsePoints(final PackedAtlasBuilder builder, final List<ProtoPoint> points)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment on combining parseNodes and parsePoints

final RelationBean bean = parseRelationBean(protoRelation);
final Map<String, String> tags = protoTagListConverter
.convert(protoRelation.getTagsList());
// TODO should identifier and OSMIdentifier be the same?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They shouldn't be the same, one is the Atlas identifier, and one is the OSM identifier. Atlas identifier is padded with the country-slicing and way-sectioning digits. We should make a design decision on which one is passed in. This is somewhat tricky - since atlas identifier must be unique per type of entity (a Relation and an Edge can have the same atlas identifier, but no two Relations can have the same atlas identifier). So if this is a true representation of an Atlas, they should pass in the Atlas Identifier and we can leverage our existing factories to figure out the OSM Identifier based on the atlas identifier (remove the 6 digit padding). Let me know if that made sense!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I see. I guess my question is, what should I be passing in for that second parameter? Will I need to have some additional code right here in this function to calculate the correct OSM id? Is there a reason the other builder 'add' methods for Node, Edge, Point, Line, etc. do not have an OSM id parameter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out ReverseIdentifierFactory - it can return the OSM identifier given an Atlas identifier. There is currently an issue for the other "add" methods to be consistent with this one. Sent you a pointer offline.

final ItemType type = ItemType.forEntity(member.getEntity());
beanBuilder.setMemberType(ProtoRelation.ProtoItemType.valueOf(type.getValue()));

// TODO there may be a problem here if there are more relations in this atlas than
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doubt we will have 2 billion relations in an atlas. I would be more concerned with number of edges (due to way-sectioning and bi-directionality)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. This would be a problem as well, since the ProtoAtlasContainer, when deserialized into an object, stores each of the feature types in an ArrayList - this is built into protobuf. So in memory you have a List of Nodes, Points, Lines, Edges, etc. I would imagine you would never have 2 billion features in one of those categories in a single atlas.

Copy link
Contributor

@MikeGost MikeGost Mar 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hope not, but theoretically this could happen! This is worth noting and identifying as a limitation of the current proto implementation.

*
* @author lcram
*/
public class PackedToProtoAtlasSubCommand implements FlexibleSubCommand
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clean! Nicely done.

Copy link
Contributor

@MikeGost MikeGost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! Couple of nits, addressing TODOs, and minor code duplication removal possibilities.

@lucaspcram
Copy link
Contributor Author

Hey @MikeGost ! Thanks, I'll be taking care of those in a coming commit. There are actually still some lingering gradle issues, and at this point I'm uncertain as to the right solution. Definitely will need to work with @matthieun to get this resolved.

Copy link
Contributor

@MikeGost MikeGost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! Just added a bunch of nits.

*/
public class ProtoAtlasBuilder
{
private final ProtoLocationConverter protoLocationConverter = new ProtoLocationConverter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit: Why not make all the converters private static final variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha. I had this initially, but it looked more verbose with the all-caps and the fact that the style checker prepends ProtoAtlasBuilder. to the front of every variable reference. I can change it back to static though if that is preferred.

{
private final ProtoLocationConverter protoLocationConverter = new ProtoLocationConverter();
private final ProtoTagListConverter protoTagListConverter = new ProtoTagListConverter();
private final ReverseIdentifierFactory reverseIDFactory = new ReverseIdentifierFactory();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: To avoid abbreviations: reverseIdentifierFactory

final ItemType type = ItemType.forEntity(member.getEntity());
beanBuilder.setMemberType(ProtoRelation.ProtoItemType.valueOf(type.getValue()));
protoRelationBuilder.addBeans(beanBuilder.build());

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: extra line

@matthieun
Copy link
Collaborator

I will leave the honor to @MikeGost to merge that massive (in terms of commits) PR :)

@matthieun matthieun changed the title Do Not Merge: Save Atlas to ProtobufAtlas similar to TextAtlas Save Atlas to ProtobufAtlas similar to TextAtlas Mar 29, 2018
@MikeGost MikeGost merged commit 03fa090 into osmlab:dev Mar 29, 2018
@lucaspcram lucaspcram deleted the protobuf branch March 30, 2018 16:05
@matthieun matthieun added this to the 5.0.11 milestone Apr 11, 2018
gitclonefun pushed a commit to gitclonefun/atlas that referenced this pull request Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants