MapGeometry.h header

#include <ew/app/MapGeometry.h>

Namespace ew::app

Functions

ew::core::MapPoint ew::app::regionCentroid(const ew::core::MapRegion &region)

The representative interior point of region used to anchor its label: the area-weighted polygon centroid, falling back to the vertex average for degenerate (zero-area) polygons. Returns the origin for an empty region.

bool ew::app::regionContains(const ew::core::MapRegion &region, double x, double y)

Whether the point (x, y), in normalized map coordinates, lies inside region's polygon. Uses the even-odd ray-casting rule; a region with fewer than three vertices contains nothing. Points exactly on an edge may fall on either side, which is acceptable for interactive hit-testing.