OpenCPN Partial API docs
|
Represents a basemap chart based on shapefile data. More...
#include <shapefile_basemap.h>
Public Member Functions | |
ShapeBaseChart (const std::string &filename, const size_t &min_scale, const wxColor &color= *wxBLACK) | |
ShapeBaseChart (const ShapeBaseChart &t) | |
void | SetColor (wxColor color) |
bool | LoadSHP () |
Loads the shapefile data into memory. | |
bool | IsUsable () |
Determines if the chart is ready to be used for rendering or spatial queries. | |
size_t | MinScale () |
void | RenderViewOnDC (ocpnDC &dc, ViewPort &vp) |
bool | CrossesLand (double &lat1, double &lon1, double &lat2, double &lon2) |
Determines if a line segment between two geographical points intersects any land mass represented in the chart. | |
void | CancelLoading () |
Cancel the chart loading operation. | |
Static Public Member Functions | |
static const std::string | ConstructPath (const std::string &dir, const std::string &quality_suffix) |
Public Attributes | |
int | _dmod |
Tile size in degrees. | |
Represents a basemap chart based on shapefile data.
This class loads, manages, and renders geographical polygon data from a shapefile for a particular resolution level. It supports tiled organization where data is divided into 1-degree cells for efficient access. It provides methods for drawing filled polygons.
Definition at line 128 of file shapefile_basemap.h.
|
inline |
Definition at line 131 of file shapefile_basemap.h.
|
inline |
Definition at line 144 of file shapefile_basemap.h.
|
inline |
Definition at line 154 of file shapefile_basemap.h.
void ShapeBaseChart::CancelLoading | ( | ) |
Cancel the chart loading operation.
Definition at line 623 of file shapefile_basemap.cpp.
|
inlinestatic |
Definition at line 189 of file shapefile_basemap.h.
bool ShapeBaseChart::CrossesLand | ( | double & | lat1, |
double & | lon1, | ||
double & | lat2, | ||
double & | lon2 | ||
) |
Determines if a line segment between two geographical points intersects any land mass represented in the chart.
lat1 | Latitude of the first point of the line segment. |
lon1 | Longitude of the first point of the line segment. |
lat2 | Latitude of the second point of the line segment. |
lon2 | Longitude of the second point of the line segment. |
Definition at line 543 of file shapefile_basemap.cpp.
|
inline |
Determines if the chart is ready to be used for rendering or spatial queries.
Definition at line 186 of file shapefile_basemap.h.
bool ShapeBaseChart::LoadSHP | ( | ) |
Loads the shapefile data into memory.
Validates the file for geographical bounds (-180 to 180 longitude, -90 to 90 latitude) and ensures it contains polygon geometry. If the shapefile is tiled (contains 'x' and 'y' attributes), it organizes features by their tile location using the LatLonKey indexing system.
Definition at line 265 of file shapefile_basemap.cpp.
|
inline |
Definition at line 187 of file shapefile_basemap.h.
Definition at line 188 of file shapefile_basemap.h.
|
inline |
Definition at line 159 of file shapefile_basemap.h.
int ShapeBaseChart::_dmod |
Tile size in degrees.
Most map charts use 1-degree tiles (default), but the crude resolution chart uses 10-degree tiles to optimize performance for global views. The tiling system divides map data into grid cells of _dmod x _dmod degrees for efficient spatial indexing and rendering.
Definition at line 167 of file shapefile_basemap.h.