Package edu.cnu.mdi.mapping.loader
Class GeoJsonCountryLoader.CountryFeature
java.lang.Object
edu.cnu.mdi.mapping.loader.GeoJsonCountryLoader.CountryFeature
- Enclosing class:
GeoJsonCountryLoader
Immutable representation of a single country feature consisting of an
administrative name, an ISO-3166-1 alpha-3 code, and one or more polygon
rings expressed as lists of geographic points in radians.
A country may have multiple polygon rings because:
- The GeoJSON geometry type is
MultiPolygon(e.g. France with its overseas territories). - A
Polygonhas interior holes (the outer ring plus one or more inner rings are all stored).
The list returned by getPolygons() is unmodifiable. Each
inner ring list is modifiable but callers should treat them as
read-only.
-
Constructor Summary
ConstructorsConstructorDescriptionCountryFeature(String adminName, String isoA3, List<List<Point2D.Double>> polygons) Constructs a new country feature. -
Method Summary
-
Constructor Details
-
CountryFeature
Constructs a new country feature. The supplied polygon list is defensively copied and wrapped in an unmodifiable view.- Parameters:
adminName- administrative name (e.g. "United States of America"); must not benullisoA3- ISO 3166-1 alpha-3 code (e.g. "USA"); must not benullpolygons- polygon rings in radians (longitude, latitude order); must not benull
-
-
Method Details
-
getAdminName
Returns the administrative (display) name of the country.- Returns:
- country name; never
null
-
getIsoA3
Returns the ISO 3166-1 alpha-3 country code.- Returns:
- three-letter ISO code; never
null
-
getPolygons
Returns the unmodifiable list of polygon rings. Each ring is a list ofPoint2D.Doubleinstances withx = λ(longitude, radians) andy = φ(latitude, radians).A ring with fewer than 3 points is degenerate and renderers may safely skip it.
- Returns:
- unmodifiable list of polygon rings
-
toString
-