GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — osm2pgsql/src/geom-box.cpp at master · osm2pgsql-dev/osm2pgsql

Expand file tree

/

geom-box.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
105 lines (89 loc) · 2.03 KB
/

geom-box.cpp

Copy path

File metadata and controls

105 lines (89 loc) · 2.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/**
* SPDX-License-Identifier: GPL-2.0-or-later
*
* This file is part of osm2pgsql (https://osm2pgsql.org/).
*
* Copyright (C) 2006-2026 by the osm2pgsql developer community.
* For a full list of authors see the git log.
*/
#include "geom-box.hpp"
#include <algorithm>
#include <variant>
namespace geom {
box_t &box_t::extend(point_t const &point) noexcept
{
m_min_x = std::min(point.x(), m_min_x);
m_min_y = std::min(point.y(), m_min_y);
m_max_x = std::max(point.x(), m_max_x);
m_max_y = std::max(point.y(), m_max_y);
return *this;
}
void box_t::extend(point_list_t const &list) noexcept
{
for (auto const &point : list) {
extend(point);
}
}
void box_t::extend(box_t const &box) noexcept
{
m_min_x = std::min(box.min_x(), m_min_x);
m_min_y = std::min(box.min_y(), m_min_y);
m_max_x = std::max(box.max_x(), m_max_x);
m_max_y = std::max(box.max_y(), m_max_y);
}
box_t envelope(geom::nullgeom_t const & /*geom*/) { return box_t{}; }
box_t envelope(geom::point_t const &geom)
{
box_t box;
box.extend(geom);
return box;
}
box_t envelope(geom::linestring_t const &geom)
{
box_t box;
box.extend(geom);
return box;
}
box_t envelope(geom::polygon_t const &geom)
{
box_t box;
box.extend(geom.outer());
return box;
}
box_t envelope(geom::multipoint_t const &geom)
{
box_t box;
for (auto const &point : geom) {
box.extend(point);
}
return box;
}
box_t envelope(geom::multilinestring_t const &geom)
{
box_t box;
for (auto const &line : geom) {
box.extend(line);
}
return box;
}
box_t envelope(geom::multipolygon_t const &geom)
{
box_t box;
for (auto const &polygon : geom) {
box.extend(polygon.outer());
}
return box;
}
box_t envelope(geom::collection_t const &geom)
{
box_t box;
for (auto const &sgeom : geom) {
box.extend(envelope(sgeom));
}
return box;
}
box_t envelope(geometry_t const &geom)
{
return geom.visit([](auto const &g) { return envelope(g); });
}
} // namespace geom
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.