File: coordinates_geom.h

package info (click to toggle)
tilemaker 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 78,284 kB
  • sloc: cpp: 28,715; ansic: 4,052; makefile: 180; ruby: 77; sh: 6
file content (35 lines) | stat: -rw-r--r-- 1,027 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef _COORDINATES_GEOM_H
#define _COORDINATES_GEOM_H

#include "coordinates.h"
#include "geom.h"

void insertIntermediateTiles(Linestring const &points, uint baseZoom, std::unordered_set<TileCoordinates> &tileSet);
void insertIntermediateTiles(Ring const &points, uint baseZoom, std::unordered_set<TileCoordinates> &tileSet);

// ------------------------------------------------------
// Helper class for dealing with spherical Mercator tiles
class TileBbox { 

public:
	double minLon, maxLon, minLat, maxLat, minLatp, maxLatp;
	double xmargin, ymargin, xscale, yscale;
	TileCoordinates index;
	uint zoom;
	bool hires;
	bool endZoom;
	Box clippingBox;

	TileBbox(TileCoordinates i, uint z, bool h, bool e);

	std::pair<int,int> scaleLatpLon(double latp, double lon) const;
	std::vector<Point> scaleRing(Ring const &src) const;
	MultiPolygon scaleGeometry(MultiPolygon const &src) const;
	std::pair<double, double> floorLatpLon(double latp, double lon) const;

	Box getTileBox() const;
	Box getExtendBox() const;
};


#endif