Skip to content

How to instantiate a mil.nga.sf.geojson.MultiPolygon;MultiPolygon #4

Answered by bosborn
jorgerabello3 asked this question in Q&A
Discussion options

You must be logged in to vote

mil.nga.sf.geojson.MultiPolygon multiPolygon = new mil.nga.sf.geojson.MultiPolygon();

or if you want to populate it with a core simple features MultiPolygon, something like...

mil.nga.sf.MultiPolygon multi = new mil.nga.sf.MultiPolygon();
mil.nga.sf.Polygon polygon = new mil.nga.sf.Polygon();
mil.nga.sf.LineString lineString = new mil.nga.sf.LineString();
lineString.addPoint(new Point(-122.358, 47.653));
lineString.addPoint(new Point(-122.348, 47.649));
lineString.addPoint(new Point(-122.348, 47.658));
lineString.addPoint(new Point(-122.358, 47.658));
lineString.addPoint(new Point(-122.358, 47.653));
polygon.addRing(lineString);
multi.addPolygon(polygon);
// Add additional polygons
mil.ng…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jorgerabello3
Comment options

Answer selected by jorgerabello3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants