core library
Pure-Dart core of nepal_administrative_map: regions, names, numbers, geometry and map data.
Has no Flutter dependency, so it also works in CLI tools, servers and plain Dart tests.
Classes
- Bounds
- An axis-aligned rectangle in planar coordinates.
- Devanagari
- Text helpers for matching Devanagari input.
- LatLng
- A geographic point in degrees (WGS84).
- LocalizedName
- A name in both English and Nepali (Devanagari).
- MapDataSource
- Where the map's TopoJSON comes from.
-
MapShape<
T> - The outline of one region or protected area.
- Nepal
- Entry point to Nepal's administrative regions.
- NepalMapData
- Decoded boundaries for every level, ready to draw and hit-test.
- NepalMapStrings
- The few UI strings the package shows itself.
- NepalNumberFormat
-
Formats numbers in English or Nepali without depending on
intl. - Region
- A province, district or local level.
- WebMercator
- Spherical Web Mercator, normalised so the world is the unit square.
Enums
- AdminLevel
- A level of Nepal's administrative hierarchy.
- District
- Nepal's 77 districts.
- LocalLevel
- Nepal's 753 local levels (gaunpalika and nagarpalika).
- LocalLevelType
- Kind of local level.
- MapLanguage
- The language the map shows names, labels and numbers in.
- NumberGrouping
- How digits are grouped with commas.
- ProtectedArea
- Protected areas that lie outside every local level.
- ProtectedAreaType
- Kind of protected area.
- Province
- Nepal's 7 provinces.
Constants
- earthRadiusMeters → const double
- Earth's radius used for areas, in metres (WGS84 equatorial).
Functions
-
geodesicArea(
List< Float64List> rings) → double -
Area of a polygon on the sphere, in square metres, for rings given as
interleaved
[lng, lat, …]degrees. The outer ring minus its holes. -
polygonArea(
List< Float64List> rings) → double - Area of a polygon: the outer ring minus its holes.
-
polygonContains(
List< Float64List> rings, double x, double y) → bool - Whether (x, y) lies inside the polygon, using the even-odd rule so holes are excluded. Points exactly on an edge may go either way.
-
polylabel(
List< Float64List> rings, {double? precision}) → ({double distance, double x, double y}) - The pole of inaccessibility: the point inside a polygon farthest from its edges. A better label position than the centroid, which can fall outside a curved or hollow shape.
-
ringCentroid(
Float64List ring) → ({double x, double y}) - Area-weighted centroid of a ring. Falls back to the first point for a degenerate (zero-area) ring.
-
ringSignedArea(
Float64List ring) → double -
Signed area of a ring (shoelace formula). The sign depends on winding
order and on whether y grows up or down; use
.abs()for the size.