 I'm Adam and I work at Oracle, mainly contributing to boost geometry and I would like to basically show you a bunch of examples and show that it's easy to do geographic stuff or geometrical stuff actually in C++ with boost geometry. First I'll talk a little bit about the library and show the simple example and actually during the whole talk there will be many examples showing you how to create primitives, use various algorithms and spatial index. And then at the end I'll show you a few tools for developers simplifying debugging. So it's, boost geometry is a part of boost C++ libraries, it's mostly written in C++ 03 but has conditionally enabled features if compilers allows it and it heavily relies on metaprogramming and techniques such as tag dispatching. So it defines primitives, also implements them for users convenience and algorithms which can be used by the users and the purpose is to be OGC standard conformant. And there's also an implementation of spatial index, yeah some of the links are also on the presentation, the talk page so no need to write them. Yeah, here's the simple hello world example, yeah since it's a hello world and not a hello plane I'll need a geographical points, here you can see that yeah we need some includes. Then point type is defined, I'm using point template defined in boost geometry here and then I'm calling the distance function passing two points. One is my home city which in Poland and the other one is Brussels. And what I get is the distance, it's different than the distance displayed at the Google Maps because here we are actually using the spheroid model and Google is the sphere. These are the primitives that boost geometry supports, so basically basic primitives that are defined in the OGC standard plus the bounding box which in boost geometry is a separate primitive and here is how it looks like in the code. So basically metadata like the dimensionality of geometries and coordinate systems are defined in the point type and then this information is propagated into the more complex geometries that are using this point type. So here I'm defining point line string polygon and multipolygon in a way that a line string is a range of points, polygon contains an exterior ring and some number of interior rings also containing points and a multipolygon contains is a range of polygons. And here I create the objects, so representations of line string polygon and multipolygon, fill it with data and display some distances between line string and polygon and line string and multipolygon. This is done in Cartesian as you can see at the top right corner and this is how it looks like. Right? The distance between line string and polygon and multipolygon are the same. It's also possible to use your own implementations of primitives. Here I define my point, implementing a point primitive, register it using register macros provided by the library which works in most typical scenarios. They basically, technically speaking, adapt the my point type to one of the point concept defined by both geometry. So the first macro adapts my point to the point concept and the second macro adapts vector of points to a line string concept. So I can use vector for points as line string. And then again I'm creating a point, I'm creating a vector of points which is now created as a line string by the library. And again I'm calculating some distance. So yeah, the distance is the same. Yeah, this library has many algorithms. I grouped them here by the number of inputs and the kind of outputs. So the area length perimeter takes one geometry and returns some value, crosses relational operations and distance takes two geometries and either returns a boolean value or a distance value and centroid convex algorithms which takes one geometry and creates another geometry from it. And set operations take two geometries and perform set operations. So returning the third geometry. Yeah, very similar to the last example. The difference is that I'm calling different algorithms. So length, area and perimeter, the length, yes, certain algorithms are able to take certain types of geometries. So the length is able to take linear geometries and area and perimeter can only take aerial geometries and here, yeah, line stringing is passed to the length and polygon is passed to the area and perimeter. Also we get some results and know how many, ten minutes. The rest of the examples is very similar here. Relational operations, I'm checking the intersection of line string and line string and polygon. Actually, this is probably not, yeah, the example is not correct, sorry. Actually the result shows the result of these relational operations of the first line string and polygon or the third line string, yeah, which looks like this. So line string intersects a polygon and you can see DE9 intersection matrix representation in the second case. The next group of algorithms, so algorithms generating geometry from other geometry like centroid envelope and convex hull. So in the first case, the centroid will be a point and the envelope will be a box and convex hull is a polygon. And I'm printing the WKT representation of all of those output geometries, which looks like this. Next algorithm, a buffer. As you can see here, algorithm not only takes inputs and output geometries but also additional arguments. In this case, these are the arguments defining how the buffer should be calculated. So it will be a symmetric buffer of a line string and the output geometry will be a multi-polygon. Yes, and it's quite longer. And some set operations, that is intersection and symmetrical difference, the input geometries are polygons and the output has to be a multi-polygon. So there are two multi-polygons in the output. And it looks like this. As for the special index, it's an implementation of R tree. Actually there are three variants of R tree. The classic one with linear split, quadratic split, and the R star tree. It also supports bulk loading. It has some C++11 features like stateful arcators and move semantics and allows you to use value type of any kind. In this example, this is the most common thing that probably can be done with special index. So what I want to do is to create some containers, a container of polygons and then prepare a special index for representing these polygons. And perform some special query getting those polygons which intersect another query polygon. So here I will need point polygon and box types. And then I would like to define an R tree type. As you can see in the R tree, I'm storing a pair of box and ID of a polygon in my container. Here. And I'm storing this value here in the R tree. And the variant of the R tree which will be built is the R star tree. So here the container of polygons is created. It's a vector of polygons filled with data. Here the R tree object is created and then for each polygon I'm storing a pair containing an envelope of a polygon and an ID. As for the query, here's the query polygon filled with data. I'm returning its envelope, expanding it a little bit with written buffer function. And then performing the query, storing the result in a vector of values. Then for each value in the result, I'm printing first the WKT of a corresponding polygon and then if it intersects the original query polygon, the word intersects, otherwise not intersects. So as you can see, two polygons has to be checked and one of them intersects and another one doesn't intersect the query polygon. Yes, and for your disposals, there are also some tools which should allow you to debug the code more easily. First of them is the graphical debugging extension for Visual Studio 2015, which allows you to debug the code by seeing the graphical presentation in run time or in debug time. And the other one is our debugging helpers for QTE Creator, allowing you to easily see the contents of geometries. And we have three minutes left, so we can answer some questions if you have one. Yes, the only difference between... As you can see here, as I said, the metadata-like coordinate system is contained in a point type. It is bound with point type. Here you can see that the point will be using the geographic coordinate system and the units are degrees. And here, on the other hand, the point is using Cartesian. So in order to use spherical geometries, you only need to put either bgcs-spherical with some units, radians or degrees, a spherical equatorial, which will be probably something which you'd like more. Okay, if there are no questions, then thank you.