Router handling stipple generation endpoints
Methods
# inner assignPointsToGrid(stipples, w, h, minLng, maxLng, minLat, maxLat) → {Array.<Array.<Stipple>>}
Assigns points to a uniform grid based on closest distance
Parameters:
Name | Type | Description |
---|---|---|
stipples |
Array.<StipplesRow>
|
Array of raw stipple points from database |
w |
number
|
Width of the output grid |
h |
number
|
Height of the output grid |
minLng |
number
|
Minimum longitude of the bounding box |
maxLng |
number
|
Maximum longitude of the bounding box |
minLat |
number
|
Minimum latitude of the bounding box |
maxLat |
number
|
Maximum latitude of the bounding box |
2D array of stipples assigned to grid cells
Array.<Array.<Stipple>>
# async inner getStiplesForDataset(dataset, params, res)
Fetches and processes stipple data for a specific dataset
Parameters:
Name | Type | Description |
---|---|---|
dataset |
DatasetType
|
Type of dataset to query (air_pollution, temperature, or earth_relief) |
params |
ValidatedParams
|
Validated query parameters |
res |
Response
|
Express response object |
# inner validateQueryParams(params) → {ValidationResult}
Validates and parses query parameters for stipple generation
Parameters:
Name | Type | Description |
---|---|---|
params |
Partial.<QueryParams>
|
Raw query parameters from the request |
Validation result with either parsed parameters or error message