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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bb7706a
Fully integrated protobuf build flow with gradle. See ECLIPSE_README.…
lucaspcram Mar 19, 2018
1890bc8
Fixed spotless application to ignore generated source code.
lucaspcram Mar 19, 2018
a03cade
Initial, naive implementation of proto specs for Tags and Points.
lucaspcram Mar 19, 2018
4e05e34
Small updates to the README files.
lucaspcram Mar 20, 2018
18611a3
Started implementation of naive ProtoAtlasBuilder
lucaspcram Mar 20, 2018
f382466
Implemented Point and Line packing.
lucaspcram Mar 21, 2018
fd9af27
Stylistic and structural changes per PR notes.
lucaspcram Mar 22, 2018
fbdaacc
Trying to get Areas working with the serializer.
lucaspcram Mar 22, 2018
c9720fe
Fixed tab indentation to use spaces in suppressions.xml
lucaspcram Mar 22, 2018
bc15496
Trying to fix the Area serialization. Currently failing due to Polygo…
lucaspcram Mar 22, 2018
a804b72
Fixed failing tests, which were due to bad copy paste.
lucaspcram Mar 22, 2018
40437f7
Integrated a few PR style suggestions.
lucaspcram Mar 22, 2018
70abe50
Added an area count to the metadata.
lucaspcram Mar 22, 2018
1eba0c9
Last of the copy paste shenanigans that I messed up. I hope. lol
lucaspcram Mar 22, 2018
d08f1a8
Ok. If this is not the last copy-paste bug then I resign.
lucaspcram Mar 22, 2018
5aa04a8
Initial drafts of Node and Edge protos.
lucaspcram Mar 22, 2018
539337e
Added unit tests for the proto converter classes.
lucaspcram Mar 23, 2018
0bfec87
Changed packages on the converter classes per PR suggestions.
lucaspcram Mar 23, 2018
5ce39d5
Forgot to stage this file.
lucaspcram Mar 23, 2018
6359a6f
Implemented support for Nodes and Edges.
lucaspcram Mar 23, 2018
ba3b136
Almost done with relations. Small bug with the OSM identifier. See un…
lucaspcram Mar 23, 2018
6db5ee7
Fixed bug with relation packing. Relations work!
lucaspcram Mar 24, 2018
a7266a6
Lots of ProtoAtlas testing.
lucaspcram Mar 26, 2018
27aa4e2
Added some commands for converting between Packed and ProtoAtlases. T…
lucaspcram Mar 26, 2018
4cd48d0
Fixed spotless formatting issue.
lucaspcram Mar 26, 2018
4a06a5d
Wrote a quick test class to investigate the proto size discrepancies.
lucaspcram Mar 26, 2018
cd9fb95
Fixed bug where tags containing delimiter characters were not deseria…
lucaspcram Mar 26, 2018
f8db3ff
Added a ProtoAtlas file suffix to FileSuffix per Mike suggestion
lucaspcram Mar 26, 2018
307b015
Changed hardcoded protoc value in build.gradle
lucaspcram Mar 27, 2018
0e19a0b
Tweak to buildflow. Gradle project refresh still requires a rebuild, but
lucaspcram Mar 28, 2018
2678b77
Small tweak to prevent Gradle Refresh from deleting the generated code.
lucaspcram Mar 28, 2018
bc6f404
Added a task to actually clear the generated code.
lucaspcram Mar 29, 2018
fe1e9a1
Slight tweak to build.gradle to fix beforeMerged
lucaspcram Mar 29, 2018
3918bb8
Hopefully ready for merge
lucaspcram Mar 29, 2018
ee43801
Finalized fixes to gradle. Everything should work now.
lucaspcram Mar 29, 2018
eeeb127
Slight change to README
lucaspcram Mar 29, 2018
0d4e3f0
Fixed checkstyle and spotless suppressions to deal with new generated…
lucaspcram Mar 29, 2018
9657bac
Final changes before merge. Hopefully we are ready to go.
lucaspcram Mar 29, 2018
79e7450
Fixed some nits.
lucaspcram Mar 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Trying to fix the Area serialization. Currently failing due to Polygo…
…n issues.
  • Loading branch information
lucaspcram committed Mar 22, 2018
commit bc1549683355cb7ff39f3055b4f604dbf99424cf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.openstreetmap.atlas.geography.Location;
import org.openstreetmap.atlas.geography.Longitude;
import org.openstreetmap.atlas.geography.PolyLine;
import org.openstreetmap.atlas.geography.Polygon;
import org.openstreetmap.atlas.geography.atlas.Atlas;
import org.openstreetmap.atlas.geography.atlas.AtlasMetaData;
import org.openstreetmap.atlas.geography.atlas.builder.AtlasSize;
Expand Down Expand Up @@ -117,9 +118,11 @@ private void parseAreas(final PackedAtlasBuilder builder, final List<ProtoArea>
final long identifier = protoArea.getId();
final List<Location> shapePoints = protoArea.getShapePointsList().stream()
.map(protoLocationConverter::convert).collect(Collectors.toList());
final PolyLine geometry = new PolyLine(shapePoints);
final Polygon geometry = new Polygon(shapePoints);
final Map<String, String> tags = protoTagListConverter.convert(protoArea.getTagsList());
builder.addLine(identifier, geometry, tags);
// 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?

// polygons, make sure this is not happening
builder.addArea(identifier, geometry, tags);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.junit.Assert;
import org.junit.Test;
import org.openstreetmap.atlas.geography.Location;
import org.openstreetmap.atlas.geography.PolyLine;
import org.openstreetmap.atlas.geography.Polygon;
import org.openstreetmap.atlas.geography.atlas.Atlas;
import org.openstreetmap.atlas.geography.atlas.packed.PackedAtlasBuilder;
import org.openstreetmap.atlas.streaming.resource.ByteArrayResource;
Expand Down Expand Up @@ -45,18 +45,18 @@ private PackedAtlasBuilder setUpTestAtlasBuilder()

tags.put("building", "yes");
tags.put("name", "eiffel_tower");
packedAtlasBuilder.addPoint(0, Location.EIFFEL_TOWER, tags);
// packedAtlasBuilder.addPoint(0, Location.EIFFEL_TOWER, tags);

tags.clear();
tags.put("building", "yes");
tags.put("name", "colosseum");
packedAtlasBuilder.addPoint(1, Location.COLOSSEUM, tags);
// packedAtlasBuilder.addPoint(1, Location.COLOSSEUM, tags);

tags.clear();
tags.put("path", "yes");
shapePoints.add(Location.EIFFEL_TOWER);
shapePoints.add(Location.COLOSSEUM);
packedAtlasBuilder.addLine(2, new PolyLine(shapePoints), tags);
// packedAtlasBuilder.addLine(2, new PolyLine(shapePoints), tags);

tags.clear();
tags.put("triangle", "yes");
Expand All @@ -65,8 +65,8 @@ private PackedAtlasBuilder setUpTestAtlasBuilder()
shapePoints.add(Location.EIFFEL_TOWER);
shapePoints.add(Location.COLOSSEUM);
shapePoints.add(Location.STEVENS_CREEK);
// TODO this is failing, why
// packedAtlasBuilder.addArea(3, new Polygon(shapePoints), tags);
// TODO this is failing due to point duplication issue Mike mentioned
packedAtlasBuilder.addArea(3, new Polygon(shapePoints), tags);

return packedAtlasBuilder;
}
Expand Down