mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-12 14:01:47 +00:00
117 lines
7.8 KiB
HTML
117 lines
7.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
<title>Boost.Geometry (aka GGL, Generic Geometry Library)</title>
|
||
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
||
<link href="tabs.css" rel="stylesheet" type="text/css">
|
||
</head>
|
||
|
||
<table cellpadding="2" width="100%">
|
||
<tbody>
|
||
<tr>
|
||
<td valign="top">
|
||
<img alt="Boost.Geometry" src="images/ggl-logo-big.png" height="80" width="200">
|
||
|
||
</td>
|
||
<td valign="top" align="right">
|
||
<a href="http://www.boost.org">
|
||
<img alt="Boost C++ Libraries" src="images/accepted_by_boost.png" height="80" width="230" border="0">
|
||
</a>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<!-- Generated by Doxygen 1.5.9 -->
|
||
<div class="navigation" id="top">
|
||
<div class="tabs">
|
||
<ul>
|
||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
|
||
<li><a href="modules.html"><span>Modules</span></a></li>
|
||
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
||
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||
<li><a href="files.html"><span>Files</span></a></li>
|
||
<li><a href="examples.html"><span>Examples</span></a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="contents">
|
||
<h1><a class="anchor" name="compiling">Compiling </a></h1><h2><a class="anchor" name="compiling_intro">
|
||
Compiling Boost.Geometry</a></h2>
|
||
Boost.Geometry is a Header Only library. So just including the headerfiles is enough to use the algorithms. Nothing has to be linked.<p>
|
||
Boost.Geometry is only dependant on (header only) Boost libraries. Download the Boost Library Collection from www.boost.org, adapt the include path to include Boost.<h2><a class="anchor" name="platforms">
|
||
Platforms</a></h2>
|
||
The library currently compiles successfully on the following platforms:<ul>
|
||
<li>MS Visual Studio 2008 (Express Edition)</li><li>MS Visual Studio 2005 (Express Edition)</li><li>gcc version 3.4</li><li>gcc version 4 (tested are 4.1, 4.2, 4.4)</li></ul>
|
||
<p>
|
||
For Visual Studio, the examples contains some project files (for 2005). However, because the library is header only, it will be no problem to integrate it in your own project files.<p>
|
||
The test and example folders contain also Jam-files for bjam / boost-build<p>
|
||
For gcc, the flag -Wno-long-long can be used (surpressing warnings originating from Boost)<h2><a class="anchor" name="convenient_includes">
|
||
Convenient includes</a></h2>
|
||
This section concentrates on how to include GGL.<p>
|
||
The most convenient headerfile including all algorithms and strategies is geometry.hpp:<ul>
|
||
<li>#include <boost/geometry/geometry.hpp> It is recommended to include this file. Alternatively, it is possible to include GGL headerfiles separately. However, this is inconvenient as files might be renamed or moved occasionaly.</li></ul>
|
||
<p>
|
||
An often used headerfile is <a class="el" href="geometries_8hpp.html">geometries.hpp</a>:<ul>
|
||
<li>#include <<a class="el" href="geometries_8hpp.html">boost/geometry/geometries/geometries.hpp</a>> This includes all default geometries: point, linestring, polygon, linear_ring, box. It is not included in the "geometry.hpp" headerfile because users are allowed to use their own geometries. However, for library users who want to use the provided geometries it is most useful.</li></ul>
|
||
<p>
|
||
For users using only Cartesian points, with floating point coordinates (double), in 2D or 3D, you can use instead:<ul>
|
||
<li>#include <<a class="el" href="cartesian2d_8hpp.html">boost/geometry/geometries/cartesian2d.hpp</a>> This includes all 2D Cartesian geometries: point_2d, linestring_2d, etc. Using this headerfile the library seems to be a non-template library, so it is convenient for users that are not so into the template world.</li></ul>
|
||
<p>
|
||
For users using multi-geometries:<ul>
|
||
<li>#include <boost/geometry/multi/multi.hpp></li></ul>
|
||
<h2><a class="anchor" name="advanced_includes">
|
||
Advanced includes</a></h2>
|
||
This section is for users who have their own geometries and want to use algorithms from the Boost.Geometry.<p>
|
||
If you want to use your own points it makes sense to use the registration macro's:<ul>
|
||
<li>#include <<a class="el" href="register_2point_8hpp.html">boost/geometry/geometries/register/point.hpp</a>> macro's for point registration</li><li>#include <<a class="el" href="register_2box_8hpp.html">boost/geometry/geometries/register/box.hpp</a>> macro's for box registration</li></ul>
|
||
<p>
|
||
If you are using standard containers containing points and want to handle them as a linestring<ul>
|
||
<li>#include <<a class="el" href="std__as__linestring_8hpp.html">boost/geometry/geometries/adapted/std_as_linestring.hpp</a>> allows you to use things like <code>std::vector<point_2d></code> and put them as parameters into algorithms.</li></ul>
|
||
<p>
|
||
If you are using <a class="el" href="namespaceboost.html">boost</a> tuples and want to handle them as Cartesian points<ul>
|
||
<li>#include <<a class="el" href="tuple__cartesian_8hpp.html">boost/geometry/geometries/adapted/tuple_cartesian.hpp</a>></li></ul>
|
||
<h2><a class="anchor" name="extension_includes">
|
||
Extensions</a></h2>
|
||
The GGL is currently (since 0.5) split into the kernel and several extensions. As this split is relatively new, there are not yet umbrella-include files, but most things below will do:<p>
|
||
If you want to use the <b>geographic</b> coordinate system:<ul>
|
||
<li>the tag is already included in the kernel</li><li>#include <boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp> for Andoyer distance calculations</li><li>#include <boost/geometry/extensions/gis/geographic/strategies/vincenty.hpp> for Vincenty distance calculations</li></ul>
|
||
<p>
|
||
If you want to use the <b>projections:</b> <ul>
|
||
<li>#include <boost/geometry/extensions/gis/projections/parameters.hpp></li><li>#include <boost/geometry/extensions/gis/projections/projection.hpp></li><li>#include <boost/geometry/extensions/gis/projections/factory.hpp></li></ul>
|
||
<p>
|
||
If you want to use the <b>circle</b> (n-sphere)<ul>
|
||
<li>#include <boost/geometry/extensions/nsphere/...> <em>Several headerfiles, there is not yet a common include</em></li></ul>
|
||
<h2><a class="anchor" name="performance">
|
||
Performance</a></h2>
|
||
The enumeration below is not exhaustive but can contain hints to improve the performance<ul>
|
||
<li>For Microsoft, set the define _SECURE_SCL=0</li><li>For Microsoft, set the define _HAS_ITERATOR_DEBUGGING=0</li><li>our measurements indicate that MSVC 2005 generates faster code than MSVC 2008</li><li>Using StlPort results in significant faster code than Microsoft's standard library</li><li>Of course turn on compiler optimizations, compile in release mode</li></ul>
|
||
<h2><a class="anchor" name="intellisense">
|
||
Intellisense issues</a></h2>
|
||
Microsoft Visual Studio (Express) 2005 and 2008 can hang typing in a bracket or angle bracket. This is not directly related to GGL, but caused by heavy templated libraries such as Boost and GGL. If this is inconvenient, intellisense can easily be turned off:<p>
|
||
<em>(...) disabling Intellisense in VC++. There is a file called feacp.dll in <VS8INSTALL>/VC/vcpackages folder. Renaming this file will disable Intellisense feature.</em><p>
|
||
Source: <a href="http://blogs.msdn.com/yash/archive/2007/09/19/intellisense-issues-in-visual-c-2005.aspx">http://blogs.msdn.com/yash/archive/2007/09/19/intellisense-issues-in-visual-c-2005.aspx</a> </div>
|
||
<hr size="1">
|
||
<table width="100%">
|
||
<tbody>
|
||
<tr>
|
||
<td align="left"><small>
|
||
<p>December 1, 2009</p>
|
||
</small></td>
|
||
<td align="right">
|
||
<small>Copyright <20> 1995-2009 Barend Gehrels, Geodan, Amsterdam<br>
|
||
Copyright <20> 2008-2009 Bruno Lalande, Paris<br>
|
||
Copyright <20> 2009 Mateusz Loskot, Cadcorp, London<br>
|
||
</small>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<address style="text-align: right;"><small>
|
||
Documentation is generated by <a href="http://www.doxygen.org/index.html">Doxygen</a>
|
||
</small></address>
|
||
</body>
|
||
</html>
|