$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: mariano.consoni_at_[hidden]
Date: 2008-06-04 15:37:09
Author: mconsoni
Date: 2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
New Revision: 46138
URL: http://svn.boost.org/trac/boost/changeset/46138
Log:
- Initial Geometry Library integration.
 -> we add the current code
 -> the quadtree code was modificated to adapt to the new point and box classes.
 -> simple_test was adapted to the new style (the other tests are pending)
Added:
   sandbox/SOC/2008/spacial_indexing/geometry/
   sandbox/SOC/2008/spacial_indexing/geometry/doc/
   sandbox/SOC/2008/spacial_indexing/geometry/doc/geometry/
   sandbox/SOC/2008/spacial_indexing/geometry/doc/geometry/images/
   sandbox/SOC/2008/spacial_indexing/geometry/doc/geometry/images/polygon_example.svg   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/blank.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/caution.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/draft.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/home.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/important.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/next.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/next_disabled.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/note.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/prev.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/prev_disabled.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/tip.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/toc-blank.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/toc-minus.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/toc-plus.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/up.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/up_disabled.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/doc/images/warning.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/
   sandbox/SOC/2008/spacial_indexing/geometry/example/1_point_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/2_point_ll_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/3_linestring_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/4_polygon_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/5_distance_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/6_transformation_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/7_custom_point_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/Jamroot   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/distance_example.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/doxygen_examples.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/doxygen_examples.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/geom.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/geometry_examples.sln   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/linestring_example.png   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/linestring_example.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/other_point_example.cpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/other_point_example.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/point_example.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/point_ll_example.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/polygon_example.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/example/transformation_example.vcproj   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_area.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_correct.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_envelope.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_foreach.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_geometry.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_labelinfo.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_length.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_simplify.hpp   (contents, props changed)
   sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_within.hpp   (contents, props changed)
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/geometry/images/polygon_example.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/caution.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/draft.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/home.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/important.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/next.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/next_disabled.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/note.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/prev.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/prev_disabled.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/tip.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/toc-blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/toc-minus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/toc-plus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/up.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/up_disabled.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/doc/images/warning.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/1_point_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/1_point_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,63 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#include <geometry/geometry.hpp>
+#include <geometry/distance.hpp>
+#include <geometry/streamwkt.hpp>
+
+#include <iostream>
+#include <iterator>
+#include <vector>
+#include <algorithm>
+
+
+int main()
+{
+	geometry::point_xy<double> world(1, 2);
+	std::cout << "Hello " << world << std::endl;
+
+	// There are some constructors. Default constructor does NOTHING.
+	// Other constructors can put zero or infinity
+	geometry::point_xy<double> p1(geometry::init_zero);
+	geometry::point_xy<double> p2(geometry::init_min_infinite);
+
+	geometry::point_xy<char> pch(geometry::init_min_infinite);
+
+	// Points may be "double", "float", "int", "char", etc. etc.
+	geometry::point_xy<float> p3(3, 2);
+	geometry::point_xy<char> p4(100, 108);
+
+	// Define two points...
+	geometry::point_xy<double> a(1, 2);
+	geometry::point_xy<double> b(5, 6);
+
+	// The distance between them can be calculated
+	std::cout << "distance " << a << " to " << b << " is " << geometry::distance(a,b) << std::endl;
+
+	// Points can be compared to each other
+	std::cout << a << (a == b ? " == " : " <> ") << b << std::endl;
+	std::cout << a << (a < b ? " < " : " >= ") << b << std::endl;
+
+	// Because of comparison, containers with points are sortable
+	std::vector<geometry::point_xy<double> > v;
+	v.push_back(b);
+	v.push_back(a);
+
+	std::copy(v.begin(), v.end(), std::ostream_iterator<geometry::point_xy<double> >(std::cout, " "));
+	std::cout << std::endl;
+
+	std::sort(v.begin(), v.end());
+
+	std::copy(v.begin(), v.end(), std::ostream_iterator<geometry::point_xy<double> >(std::cout, " "));
+	std::cout << std::endl;
+
+	// Points can be derived or have own implementations, shown in "other_point_example".
+	// Otherwise continue with "linestring_example"
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/2_point_ll_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/2_point_ll_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,62 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. paris, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#include <geometry/geometry.hpp>
+#include <geometry/streamwkt.hpp>
+#include <geometry/distance.hpp>
+#include <geometry/latlong.hpp>
+
+#include <iostream>
+#include <iterator>
+#include <vector>
+#include <algorithm>
+
+
+int main()
+{
+	// Declare a latlong point, using degrees and doubles
+	geometry::point_ll<geometry::degree, double> paris;
+
+	// Assign coordinates to the latlong point, using the methods lat and lon
+	// Paris 48° 52' 0" N, 2° 19' 59" E
+	paris.lat(geometry::dms<geometry::north>(48, 52, 0));
+	paris.lon(geometry::dms<geometry::east>(2, 19, 59));
+
+	std::cout << "Paris: " << paris << std::endl;
+
+	// Convert a latlong point to radians
+	geometry::point_ll<geometry::radian, double> ra = paris.convert<geometry::radian>();
+
+	std::cout << "Paris in radians: " << ra << std::endl;
+
+	// Constructor using explicit latitude/longitude
+	// Lima 12° 2' 36" S, 77° 1' 42" W
+	geometry::point_ll<geometry::degree, double> lima(
+			geometry::latitude<>(geometry::dms<geometry::south>(12, 2, 36)),
+			geometry::longitude<>(geometry::dms<geometry::west>(77, 1, 42)));
+
+	std::cout << "Lima: " << lima << std::endl;
+
+
+	// Calculate the distance using the default strategy, and Vincenty, Andoyer
+	std::cout << "Distance Paris-Lima "
+		<< 0.001 * geometry::distance(paris, lima)
+		<< " km" << std::endl;
+
+	std::cout << "Distance Paris-Lima, Vincenty "
+		<< 0.001 * geometry::distance(paris, lima,
+				geometry::strategy::distance::vincenty<geometry::point_ll<geometry::degree> >())
+		<< " km" << std::endl;
+
+	std::cout << "Distance Paris-Lima, Andoyer "
+		<< 0.001 * geometry::distance(paris, lima,
+				geometry::strategy::distance::andoyer<geometry::point_ll<geometry::degree> >())
+		<< " km" << std::endl;
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/3_linestring_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/3_linestring_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,196 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <vector>
+#include <deque>
+#include <iterator>
+#include <algorithm> // for reverse, unique
+
+#include <geometry/geometry.hpp>
+#include <geometry/envelope.hpp>
+#include <geometry/segment.hpp>
+
+#include <geometry/distance.hpp>
+#include <geometry/length.hpp>
+#include <geometry/centroid.hpp>
+#include <geometry/intersection.hpp>
+#include <geometry/simplify.hpp>
+
+#include <geometry/foreach.hpp>
+
+#include <geometry/streamwkt.hpp>
+
+
+
+class derived_linestring : public geometry::linestring<geometry::point_xy<float>, std::deque, std::allocator>
+{
+	public :
+		typedef geometry::box<point_type> box_type;
+		inline void rebox() { geometry::envelope(*this, m_box); }
+		inline box_type box() const { return m_box; }
+	private :
+		box_type m_box;
+
+};
+
+struct own_linestring : public std::vector<geometry::point_xy<double> >
+{
+	typedef geometry::point_xy<double> point_type; // required for, at least, the simplify_linestring algorithm
+};
+
+
+
+template<typename P>
+std::ostream & operator<<(std::ostream &s, const geometry::box<P> &b)
+{
+	s << b.min() << " - " << b.max();
+	return s;
+}
+
+
+template<typename P>
+inline void translate_function(P& p)
+{
+		p.x(p.x() + 100.0);
+}
+
+
+template<typename P>
+struct scale_functor
+{
+	inline void operator()(P& p)
+	{
+		p.x(p.x() * 1000.0);
+		p.y(p.y() * 1000.0);
+	}
+};
+
+
+
+int main(void)
+{
+	// Define a linestring, which is a vector of points, and add some points
+	geometry::linestring<geometry::point_xy<double> > ls;
+	ls.push_back(geometry::point_xy<double>(1.1, 1.1));
+
+	geometry::point_xy<double> lp(2.5, 2.1);
+	ls.push_back(lp);
+
+	// Lines can be streamed as Well Known Text (OGC WKT)
+	std::cout << ls << std::endl;
+
+	// The bounding box of lines can be calculated and streamd useing the method above
+	geometry::box<geometry::point_xy<double> > b;
+	geometry::envelope(ls, b);
+	std::cout << b << std::endl;
+
+	// The length of the line can be calulated
+	std::cout << "length: " << geometry::length(ls) << std::endl;
+
+	// All things from vector can be called, because a linestring is a vector
+	std::cout << "number of points: " << ls.size() << std::endl;
+
+	// The distance from a point to a linestring can be calculated
+	geometry::point_xy<double> p(1.9, 1.2);
+	std::cout << "distance of " << p << " to line: " << geometry::distance(p, ls) << std::endl;
+
+	// A linestring is a vector. However, some algorithms consider "segments",
+	// which are the line pieces between two points of a linestring.
+	// Here we go to the "primary versions"
+	//geometry::distance_result d = geometry::impl::distance::point_to_segment(
+	//	p, geometry::const_segment<geometry::point_xy<double> >(ls.front(), ls.back()));
+	//std::cout << sqrt(geometry::square_distance_point_to_segment(p, geometry::const_segment<geometry::point_xy<double> >(ls.front(), ls.back()))) << std::endl;
+
+	// Add some points more, let's do it using a classic array. See documentation for picture
+	typedef geometry::point_xy<double> P;
+	const double c[][2] = { {3.1, 3.1}, {4.9, 1.1}, {3.1, 1.9} };
+	const int n = sizeof(c) / sizeof(c[0]);
+	for (int i = 0; i < n; i++)
+	{
+		ls.push_back(P(c[i][0], c[i][1]));
+	}
+	std::cout << "original: " << ls << std::endl;
+
+	// All algorithms from std can be used: a linestring is a vector
+	std::reverse(ls.begin(), ls.end());
+	std::cout << "reversed: " << ls << std::endl;
+	std::reverse(ls.begin(), ls.end());
+
+	// The other way, using a vector instead of a linestring, is also possible
+	std::vector<P> pv(ls.begin(), ls.end());
+	// However, you can NOT call length then, because length is defined for linestring<P>
+	// All methods are templatized in two ways, so it is still possible to get the length
+	// but with another name. This is like "find" and "find_if"
+	std::cout << "length: " << geometry::length(pv.begin(), pv.end()) << std::endl;
+
+	// If there are double points in the line, you can use unique to remove them
+	// So we add the last point, print, make a unique copy and print
+	ls.push_back(ls.back());
+	std::cout << "extra point: " << ls << std::endl;
+
+	{
+		geometry::linestring<P> ls_copy;
+		std::unique_copy(ls.begin(), ls.end(), std::back_inserter(ls_copy));
+		ls = ls_copy;
+		std::cout << "uniquecopy: " << ls << std::endl;
+	}
+
+	// Lines can be simplified using e.g. Douglas Peucker
+	geometry::linestring<P> ls_simplified;
+	geometry::simplify(ls, ls_simplified, 0.5);
+	std::cout << "simplified: " << ls_simplified << std::endl;
+
+	// Declare and fill a derived linestring
+	derived_linestring dl;
+	for (geometry::linestring<P>::const_iterator it = ls.begin(); it != ls.end(); it++)
+	{
+		dl.push_back(geometry::point_xy<float>(it->x(), it->y()));
+	}
+	// In this case it has its own box
+	dl.rebox();
+	std::cout << dl.box() << std::endl;
+
+	derived_linestring dls;
+	// Simplify also works for derived classes
+	geometry::simplify(dl, dls, 0.5);
+
+	own_linestring ol;
+	for (geometry::linestring<P>::const_iterator it = ls.begin(); it != ls.end(); it++)
+	{
+		ol.push_back(geometry::point_xy<double>(it->x(), it->y()));
+	}
+	own_linestring ols;
+
+	// A call to simplify does NOT work for own classes...
+	//   geometry::simplify(ol, ols, 0.5); // does NOT work
+	// ... so call simplify_linestring here
+	//geometry::impl::simplify::do_linestring(ol, ols, 0.5);
+
+
+	// for_each:
+	// 1) Lines can be visited with std::for_each
+	// 2) geometry::for_each_point is also defined for all geometries
+	// 3) geometry::for_each_segment is defined for all geometries to all segments
+	// 4) geometry::loop is defined for geometries to visit segments 
+	//    with state apart, and to be able to break out (not shown here)
+	{
+		geometry::linestring<geometry::point_xy<double> > lscopy = ls;
+		std::for_each(ls.begin(), ls.end(), translate_function<P>);
+		geometry::for_each_point(ls, scale_functor<P>());
+		std::cout << ls << std::endl;
+		ls = lscopy;
+		std::cout << ls << std::endl;
+	}
+
+	// Finally, lines can be clipped using a clipping box. Clipped lines are added to the output iterator
+	geometry::box<P> cb(P(1.5, 1.5), P(4.5, 2.5));
+	std::ostream_iterator<geometry::linestring<geometry::point_xy<double> > > out(std::cout, "\n");
+	geometry::intersection(cb, ls, out);
+
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/4_polygon_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/4_polygon_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,144 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <vector>
+#include <list>
+#include <deque>
+#include <algorithm> // for reverse, unique
+#include <iterator>
+
+#include <iostream>
+
+#include <geometry/geometry.hpp>
+#include <geometry/envelope.hpp>
+#include <geometry/area.hpp>
+#include <geometry/foreach.hpp>
+#include <geometry/centroid.hpp>
+//#include <geometry/labelinfo.hpp>
+#include <geometry/streamwkt.hpp>
+#include <geometry/correct.hpp>
+#include <geometry/within.hpp>
+
+#include <geometry/simplify.hpp>
+
+
+
+std::string boolstr(bool v)
+{
+	return v ? "true" : "false";
+}
+
+int main(void)
+{
+	// Make a shortcut for a point
+	typedef geometry::point_xy<float> P;
+
+	// Define a polygon and fill the outer ring.
+	// In most cases you will read it from a file or database
+
+	geometry::polygon<P, std::vector, std::list> poly;
+	{
+		const double coor[][2] = {
+			{2.0, 1.3}, {2.4, 1.7}, {2.8, 1.8}, {3.4, 1.2}, {3.7, 1.6},
+			{3.4, 2.0}, {4.1, 3.0}, {5.3, 2.6}, {5.4, 1.2}, {4.9, 0.8}, {2.9, 0.7},
+			{2.0, 1.3} // closing point is opening point
+			};
+		const int n = sizeof(coor) / sizeof(coor[0]);
+		poly.outer().reserve(n);
+		for (int i = 0; i < n; i++)
+		{
+			poly.outer().push_back(P(coor[i][0], coor[i][1]));
+		}
+	}
+
+	// Polygons should be closed, and directed clockwise. If you're not sure if that is the case,
+	// call the correct algorithm
+	//geometry::correct(poly);
+
+	// Polygons can be streamed as Well Known Text (OGC WKT)
+	std::cout << poly << std::endl;
+
+	// As with lines, bounding box of polygons can be calculated
+	geometry::box<geometry::point_xy<float> > b;
+	geometry::envelope(poly, b);
+	std::cout << b.min() << "-" << b.max() << std::endl;
+
+
+	// The area of the polygon can be calulated
+	std::cout << "area: " << geometry::area(poly) << std::endl;
+
+	// And the centroid, which is the center of gravity
+	P centroid;
+	geometry::centroid(poly, centroid);
+	std::cout << "centroid: " << centroid << std::endl;
+
+	// Actually in most cases you don't want the centroid, which is only defined for polygons.
+	// You want a nice labelpoint instead. Call labelpoint in those cases, which is defined
+	// for all geometries
+	/* not yet in preview, syntax might change
+	std::cout << "labelpoints: ";
+	geometry::label_info<0>(poly, , std::ostream_iterator<P>(std::cout, " "));
+	std::cout << std::endl;
+	*/
+
+	// The number of points have to called per ring separately
+	std::cout << "number of points in outer ring: " << poly.outer().size() << std::endl;
+
+	// Polygons can have one or more inner rings, also called holes, donuts, islands, interior rings.
+	// Let's add one
+	{
+		poly.inners().resize(1);
+		geometry::linear_ring<P>& inner = poly.inners().back();
+
+		const double coor[][2] = { {4.0, 2.0}, {4.2, 1.4}, {4.8, 1.9}, {4.4, 2.2}, {4.0, 2.0} };
+		int n = sizeof(coor) / sizeof(coor[0]);
+
+		inner.reserve(n);
+		for (int i = 0; i < n; i++)
+		{
+			inner.push_back(P(coor[i][0], coor[i][1]));
+		}
+	}
+
+	geometry::correct(poly);
+
+	std::cout << "with inner ring:" << poly << std::endl;
+	// The area of the polygon is changed of course
+	std::cout << "new area of polygon: " << geometry::area(poly) << std::endl;
+	geometry::centroid(poly, centroid);
+	std::cout << "new centroid: " << centroid << std::endl;
+
+	// You can test whether points are within a polygon
+	std::cout << "point in polygon:"
+		<< " p1: "  << boolstr(geometry::within(P(3.0, 2.0), poly))
+		<< " p2: "  << boolstr(geometry::within(P(3.7, 2.0), poly))
+		<< " p3: "  << boolstr(geometry::within(P(4.4, 2.0), poly))
+		<< std::endl;
+
+	// You can call for_each or for_each_segment on polygons to, this will visit all points / segments
+	// in outer ring and inner rings
+	//geometry::for_each(poly, f);
+
+	// As with linestrings and points, you can derive from polygon to add, for example,
+	// fill color and stroke color. Or SRID (spatial reference ID). Or Z-value. Or a property map.
+	// We don't show this here.
+
+	// You can clip the polygon using a bounding box
+
+	// If you really want:
+	//   You don't have to use a vector, you can define a polygon with a deque or list
+	//   You can specify the container for the points and for the inner rings independantly
+
+	geometry::polygon<P, std::vector, std::list> poly2;
+	poly2.outer().push_back(P(2.8, 1.9));
+	poly2.outer().push_back(P(2.9, 2.4));
+	poly2.outer().push_back(P(3.3, 2.2));
+	poly2.outer().push_back(P(3.2, 1.8));
+	poly2.outer().push_back(P(2.8, 1.9));
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/5_distance_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/5_distance_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,150 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+/***
+ This sample demonstrates the use of latlong-points, xy-points, calculate distances between
+ latlong points using different formulas,
+ calculate distance between points using pythagoras
+ ***/
+
+
+#include <geometry/geometry.hpp>
+#include <geometry/latlong.hpp>
+#include <geometry/distance.hpp>
+#include <geometry/streamwkt.hpp>
+#include <geometry/length.hpp>
+
+#ifdef use_projection
+#include <projection/rd.hpp>
+#endif
+
+#include <iostream>
+#include <iterator>
+#include <vector>
+#include <algorithm>
+
+
+
+
+int main()
+{
+	using namespace geometry;
+
+	// ------------------------------------------------------------------------------------------
+	// Construction and conversion
+	// ------------------------------------------------------------------------------------------
+	typedef point_ll<degree, double> lola;
+
+	lola a;
+	// Amsterdam 52°22'23"N 4°53'32"E
+	a.lat(dms<north>(52, 22, 23));
+	a.lon(dms<east>(4, 53, 32));
+
+	// Rotterdam 51°55'51"N 4°28'45"E
+	lola r(latitude<>(dms<north>(51, 55, 51)),
+		longitude<>(dms<east>(4, 28, 45)));
+
+	// The hague: 52° 4' 48" N, 4° 18' 0" E
+	lola h(longitude<>(dms<east>(4, 18, 0)),
+		latitude<>(dms<north>(52, 4, 48)));
+
+	// Define same in Dutch coordinate-system (in meters)
+	typedef point_xy<double> XY;
+#ifdef use_projection
+	projection::rd<point_xy<double>, point_ll<radian, double> > proj;
+	XY a_rd = proj.project(a.convert<radian>());
+	XY r_rd = proj.project(r.convert<radian>());
+#else
+	XY a_rd(121267, 487245);
+	XY r_rd(92526.2, 438324);
+	XY h_rd(80454.2, 455086);
+#endif
+
+	typedef point_ll<radian, double> lolar;
+	lolar a_rad = a.convert<radian>(), r_rad = r.convert<radian>();
+
+	// ------------------------------------------------------------------------------------------
+	// Distances
+	// ------------------------------------------------------------------------------------------
+
+	std::cout << "Distance Amsterdam-Rotterdam: " << std::endl;
+	std::cout << "haversine:              " << 0.001 * distance(a, r) << " km" << std::endl;
+	std::cout << "haversine rad:          " << 0.001 * distance(a_rad, r_rad) << " km" << std::endl;
+	std::cout << "haversine other radius: " << distance(a, r, strategy::distance::haversine<lola>(6371.0) ) << " km" << std::endl;
+	std::cout << "andoyer:                " << 0.001 * distance(a, r, strategy::distance::andoyer<lola>() ) << " km" << std::endl;
+	std::cout << "vincenty:               " << 0.001 * distance(a, r, strategy::distance::vincenty<lola>() ) << " km" << std::endl;
+	std::cout << "vincenty rad:           " << 0.001 * distance(a_rad, r_rad, strategy::distance::vincenty<lolar>() ) << " km" << std::endl;
+	std::cout << "RD, pythagoras:         " << 0.001 * distance(a_rd, r_rd) << " km" << std::endl;
+
+	std::cout << std::endl;
+	std::cout << "Distance Amsterdam-Den Haag: " << std::endl;
+	std::cout << "haversine:              " << 0.001 * distance(a, h) << " km" << std::endl;
+
+	// ------------------------------------------------------------------------------------------
+	// Distances to segments
+	// ------------------------------------------------------------------------------------------
+	std::cout << std::endl << "The Hague - line Amsterdam,Rotterdam" << std::endl;
+
+	const_segment<XY> ar_xy(a_rd, r_rd);
+
+	// Using distance algorithm - not implemented for segments
+	// std::cout << distance(h_rd, ar_xy) << std::endl;
+
+	// Using default strategy for point_xy
+	strategy_traits<XY>::point_segment_distance calcxy;
+
+	distance_result dr = calcxy(h_rd, ar_xy);
+	std::cout << "in RD: " << 0.001 * dr << std::endl;
+
+	// Using default strategy for point_ll
+	strategy_traits<lola>::point_segment_distance calcll;
+	dr = calcll(h, const_segment<lola>(a, r));
+	std::cout << "in LL: " << 0.001 * dr << std::endl;
+
+	std::cout << std::endl << "Rotterdam - line Amsterdam,the Hague" << std::endl;
+	dr = calcxy(r_rd, const_segment<XY>(a_rd, h_rd));
+	std::cout << "in RD: " << 0.001 * dr << std::endl;	
+	dr = calcll(r, const_segment<lola>(a, h));
+	std::cout << "in LL: " << 0.001 * dr << std::endl;
+	std::cout << std::endl;
+
+
+	// ------------------------------------------------------------------------------------------
+	// Compilation
+	// ------------------------------------------------------------------------------------------
+	// Next line does not compile because Vincenty cannot work on xy-points
+	//std::cout << "vincenty on xy:         " << 0.001 * distance(a_rd, r_rd, formulae::distance::vincenty<>() ) << " km" << std::endl;
+
+	// Next line does not compile because you cannot (yet) assign degree to radian directly
+	//lolar a_rad2 = a;
+
+	// Next line does not compile because you cannot assign latlong to xy
+	// XY axy = a;
+
+
+	// ------------------------------------------------------------------------------------------
+	// Length
+	// ------------------------------------------------------------------------------------------
+	// Length calculations use distances internally. The lines below take automatically the default
+	// formulae for distance. However, you can also specify a formula explicitly.
+	typedef linestring<lola> lll;
+	typedef linestring<XY> lxy;
+
+	lll line1;
+	line1.push_back(a);
+	line1.push_back(r);
+	std::cout << "length: " << length(line1) << std::endl;
+	std::cout << "length using Vincenty: " << length(line1, strategy::distance::vincenty<lola>()) << std::endl;
+
+	lxy line2;
+	line2.push_back(a_rd);
+	line2.push_back(r_rd);
+	std::cout << "length: " << length(line2) << std::endl;
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/6_transformation_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/6_transformation_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,176 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <geometry/geometry.hpp>
+#include <geometry/streamwkt.hpp>
+#include <geometry/fromwkt.hpp>
+#include <geometry/foreach.hpp>
+
+#include <geometry/assign.hpp>
+
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+
+
+
+// get_value, and specialization, get a value of a point
+template <typename P, size_t I, size_t N>
+struct get_value
+{
+	static const typename P::coordinate_type get(P& p, size_t i)
+	{
+		if (i == I)
+		{
+			return p.template get<I>();
+		}
+		return get_value<P, I+1, N>::get(p, i);
+	}
+};
+
+template <typename P, size_t N>
+struct get_value<P, N, N>
+{
+	static const typename P::coordinate_type get(P& p, size_t i)
+	{
+		return 0;
+	}
+};
+
+
+
+void transform1(geometry::point_xy<double>& p, boost::numeric::ublas::matrix<double>& m)
+{
+	// First method, not so effective but clear
+	// Copy the point to vector, do matrix calculation, copy back.
+	boost::numeric::ublas::vector<double> vec1(3);
+	vec1[0] = p.x();
+	vec1[1] = p.y();
+	vec1[2] = 1.0;
+	boost::numeric::ublas::vector<double> vec2(boost::numeric::ublas::prod(m, vec1));
+	p.x(vec2[0]);
+	p.y(vec2[1]);
+}
+
+
+void transform2(geometry::point_xy<double>& p, boost::numeric::ublas::matrix<double>& m)
+{
+	// Second method.
+	// More effective, using the matrix directly
+	p.x(p.x() * m(0,0) + p.y() * m(0,1) + m(0,2));
+	p.y(p.x() * m(1,0) + p.y() * m(1,1) + m(1,2));
+}
+
+
+template<typename P, typename M>
+class transform3
+{
+
+	public :
+		transform3(const M& m)
+			: _matrix(m)
+		{}
+
+		inline void operator()(P& p) const
+		{
+			// Transform the point, using any method. 
+			// Here the more neutral "value" methods are used.
+			// (value cannot be used in loops, the "assign" method is used).
+			const size_t n = P::coordinate_count;
+			BOOST_ASSERT(n + 1 == _matrix.size1());
+			BOOST_ASSERT(n + 1 == _matrix.size2());
+
+			for (size_t i = 0; i < n; i++)
+			{
+				typename P::coordinate_type s = _matrix(i, n);
+				for (size_t j = 0; j < n; j++)
+				{
+					//s += p.ivalue(j) * _matrix(i, j);
+					s += get_value<P, 0, n>::get(p, j) * _matrix(i, j);
+				}
+				//p.ivalue(i, s);
+				geometry::assign_coordinate(p, i, s);
+			}
+		}
+
+	private :
+		M _matrix;
+};
+
+
+void transform4(geometry::point_xy<double>& p, boost::numeric::ublas::matrix<double>& m)
+{
+	// There might be another method, defining an ublas "vector_expression<E2>" using
+	// the point. This is not worked out here.
+}
+
+
+int main()
+{
+	geometry::point_xy<double> p(1, 1);
+
+
+	// First matrix: translation over (5,5) in (x,y) direction
+	boost::numeric::ublas::matrix<double> t1(3,3);
+	t1(0,0) = 1;   t1(0,1) = 0;   t1(0,2) = 5;
+	t1(1,0) = 0;   t1(1,1) = 1;   t1(1,2) = 5;
+	t1(2,0) = 0;   t1(2,1) = 0;   t1(2,2) = 1;
+
+
+	// Second matrix: scaling over x*10, y*10 in (x,y) direction
+	boost::numeric::ublas::matrix<double> s(3, 3);
+	s(0,0) = 10;   s(0,1) = 0;   s(0,2) = 0;
+	s(1,0) = 0;    s(1,1) = 10;  s(1,2) = 0;
+	s(2,0) = 0;    s(2,1) = 0;   s(2,2) = 1;
+
+
+	// Third matrix: translation over (-20,-15) in (x,y) direction
+	boost::numeric::ublas::matrix<double> t2(3, 3);
+	t2(0,0) = 1;   t2(0,1) = 0;   t2(0,2) = -20;
+	t2(1,0) = 0;   t2(1,1) = 1;   t2(1,2) = -15;
+	t2(2,0) = 0;   t2(2,1) = 0;   t2(2,2) = 1;
+
+	// Of course we could rotate as well.
+
+	// Transform the point, using the three matrices one by one
+	transform1(p, t1);
+	transform1(p, s);
+	transform1(p, t2);
+	std::cout << "after 3 transformations: " << p << std::endl;
+
+	// Combination matrix
+	boost::numeric::ublas::matrix<double> c(3,3);
+	c = boost::numeric::ublas::prod(s, t1);
+	c = boost::numeric::ublas::prod(t2, c);
+
+	// Transform with combined matrix
+	p.x(1);
+	p.y(1);
+	transform1(p, c);
+	std::cout << "combined: " << p << std::endl;
+
+	// Idem, using method 2
+	p.x(1);
+	p.y(1);
+	transform2(p, c);
+	std::cout << "method 2: " << p << std::endl;
+
+	// Transform a point with a transformation functor
+	p.x(1);
+	p.y(1);
+	transform3<geometry::point_xy<double>, boost::numeric::ublas::matrix<double> > trans3(c);
+	geometry::for_each_point(p, trans3);
+	std::cout << "method 3: " << p << std::endl;
+
+	// Transform a polygon
+	geometry::polygon<geometry::point_xy<double>, std::deque> poly;
+	geometry::from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+	geometry::for_each_point(poly, trans3);
+	std::cout << "transformed polygon " << poly << std::endl;
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/7_custom_point_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/7_custom_point_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,72 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#include <iostream>
+#include <boost/tuple/tuple.hpp>
+#include <geometry/distance.hpp>
+#include <geometry/aswkt.hpp>
+
+
+struct my_3d_point: boost::tuple<float, float, float>
+{
+	typedef float coordinate_type;
+	enum { coordinate_count = 3 };
+
+	my_3d_point(float x, float y, float z)
+	{
+		get<0>() = x;
+		get<1>() = y;
+		get<2>() = z;
+	}
+
+	// Because the geometry::point concept shares the "get" methods with boost::tuple,
+	// no more methods are needed.
+};
+
+
+namespace geometry {
+
+template <>
+struct strategy_traits<my_3d_point, my_3d_point>
+{
+	typedef strategy::distance::pythagoras<my_3d_point, my_3d_point> point_distance;
+	typedef strategy::not_implemented point_segment_distance;
+	typedef strategy::not_implemented area;
+	typedef strategy::not_implemented within;
+	typedef strategy::not_implemented centroid;
+	typedef strategy::not_implemented envelope;
+};
+
+template <>
+struct wkt_traits<my_3d_point>
+{
+	typedef impl::wkt::stream_point<my_3d_point> stream_type;
+};
+
+} // namespace geometry
+
+template <typename CH, typename TR>
+inline std::basic_ostream<CH,TR>& operator<<(std::basic_ostream<CH,TR> &os, const my_3d_point &p)
+{
+	os << geometry::as_wkt<my_3d_point>(p);
+	return os;
+}
+
+
+int main()
+{
+	// Define 2 instances of our custom 3D point
+	my_3d_point p1(11, -22, 33);
+	my_3d_point p2(-111, 222, -333);
+
+	// The distance between them can be calculated the same way as for the
+	// point_xy provided with the library
+	std::cout << "distance " << p1 << " to " << p2 << " is " << geometry::distance(p1,p2) << std::endl;
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/Jamroot
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/Jamroot	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,17 @@
+# Geometry Library
+#
+# Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+# Use, modification and distribution is subject to the Boost Software License,
+# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+
+project : requirements <include>../.. ;
+
+exe 1_point_example : 1_point_example.cpp ;
+exe 2_point_ll_example : 2_point_ll_example.cpp ;
+exe 3_linestring_example : 3_linestring_example.cpp ;
+exe 4_polygon_example : 4_polygon_example.cpp ;
+exe 5_distance_example : 5_distance_example.cpp ;
+exe 6_transformation_example : 6_transformation_example.cpp ;
+exe 7_custom_point_example : 7_custom_point_example.cpp ;
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/distance_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/distance_example.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="distance_example"
+	ProjectGUID="{1D50082A-6BE8-493D-80F5-45CBB46CC593}"
+	RootNamespace="distance_example"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\distance_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\distance_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\5_distance_example.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\astext.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+			<Filter
+				Name="strategies"
+				>
+				<File
+					RelativePath="..\strategies\return_types.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategies_point_ll.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategies_point_xy.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategy_traits.hpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/doxygen_examples.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/doxygen_examples.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,459 @@
+#include <geometry/area.hpp>
+#include <geometry/aswkt.hpp>
+#include <geometry/centroid.hpp>
+#include <geometry/correct.hpp>
+#include <geometry/distance.hpp>
+#include <geometry/envelope.hpp>
+#include <geometry/fromwkt.hpp>
+#include <geometry/intersection_segment.hpp>
+#include <geometry/intersection_linestring.hpp>
+#include <geometry/latlong.hpp>
+#include <geometry/length.hpp>
+#include <geometry/strategies/strategies_point_ll.hpp>
+#include <geometry/streamwkt.hpp>
+#include <geometry/simplify.hpp>
+#include <geometry/within.hpp>
+
+#include <iostream>
+
+// All functions below are referred to in the source of the Geometry Library.
+// Don't rename them.
+
+void example_area_polygon()
+{
+	geometry::polygon<geometry::point_xy<double> > poly;
+	geometry::from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+	std::cout << "Polygon area is "
+		<< geometry::area(poly)
+		<< " square units" << std::endl;
+
+	geometry::polygon<geometry::point_ll<geometry::degree, float> > poly_ll;
+	geometry::from_wkt("POLYGON((4 51,4 52,5 52,5 51,4 51))", poly_ll);
+	std::cout << "Polygon area is "
+		<< geometry::area(poly_ll)/(1000*1000)
+		<< " square kilometers " << std::endl;
+}
+
+void example_as_wkt_point()
+{
+	typedef geometry::point_xy<double> P;
+	P p(5.12, 6.34);
+	// Points can be streamed like this:
+	std::cout << geometry::as_wkt<P>(p) << std::endl;
+
+	// or, including streamwkt, like this:
+	std::cout << p << std::endl;
+}
+
+void example_centroid_polygon()
+{
+	geometry::polygon<geometry::point_xy<double> > poly;
+	geometry::from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+	geometry::point_xy<float> center;
+	geometry::centroid(poly, center);
+	std::cout << "Centroid: " << center.x() << "," << center.y() << std::endl;
+}
+
+
+void example_distance_point_point()
+{
+	geometry::point_xy<double> p1(1, 1);
+	geometry::point_xy<double> p2(2, 3);
+	std::cout << "Distance p1-p2 is " 
+		<< geometry::distance(p1, p2) 
+		<< " units" << std::endl;
+
+	// Read 2 Dutch cities from WKT texts (in decimal degrees)
+	geometry::point_ll<geometry::degree, double> a, r;
+	geometry::from_wkt("POINT(4.89222 52.3731)", a);
+	geometry::from_wkt("POINT(4.47917 51.9308)", r);
+
+	std::cout << "Distance Amsterdam-Rotterdam is "
+		<< geometry::distance(a, r) / 1000.0 
+		<< " kilometers " << std::endl;
+}
+
+void example_distance_point_point_strategy()
+{
+	typedef geometry::point_ll<geometry::degree, double> LL;
+	LL a, r;
+	geometry::from_wkt("POINT(4.89222 52.3731)", a);
+	geometry::from_wkt("POINT(4.47917 51.9308)", r);
+
+	std::cout << "Distance Amsterdam-Rotterdam is "
+		<< geometry::distance(a, r,
+				geometry::strategy::distance::vincenty<LL>() )
+				 / 1000.0
+		<< " kilometers " << std::endl;
+}
+
+void example_from_wkt_point()
+{
+	geometry::point_xy<int> point;
+	geometry::from_wkt("Point(1 2)", point);
+	std::cout << point.x() << "," << point.y() << std::endl;
+}
+
+void example_from_wkt_output_iterator()
+{
+	std::vector<geometry::point_xy<int> > v;
+	geometry::from_wkt<geometry::point_xy<int> >("linestring(1 1,2 2,3 3,4 4)", std::back_inserter(v));
+	std::cout << "vector has " << v.size() << " coordinates" << std::endl;
+}
+
+void example_from_wkt_linestring()
+{
+	geometry::linestring<geometry::point_xy<double> > line;
+	geometry::from_wkt("linestring(1 1,2 2,3 3,4 4)", line);
+	std::cout << "linestring has " << line.size() << " coordinates" << std::endl;
+}
+
+void example_from_wkt_polygon()
+{
+	geometry::polygon<geometry::point_xy<double> > poly;
+	geometry::from_wkt("POLYGON((0 0,0 1,1 1,1 0,0 0))", poly);
+	std::cout << "Polygon has " << poly.outer().size() << " coordinates in outer ring" << std::endl;
+}
+
+void example_point_ll_convert()
+{
+	geometry::point_ll<geometry::degree, double> deg(geometry::latitude<>(33.0), geometry::longitude<>(-118.0));
+	geometry::point_ll<geometry::radian, double> rad = deg.convert<geometry::radian>();
+
+	std::cout << "point in radians: " << rad << std::endl;
+}
+
+void example_intersection_linestring1()
+{
+	typedef geometry::point_xy<double> P;
+	geometry::linestring<P> line;
+	geometry::from_wkt("linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", line);
+	geometry::box<P> cb(P(1.5, 1.5), P(4.5, 2.5));
+	std::cout << "Clipped linestring(s) " << std::endl;
+	geometry::intersection(cb, line,
+			std::ostream_iterator<geometry::linestring<P> >(std::cout, "\n"));
+}
+
+void example_intersection_segment1()
+{
+	typedef geometry::point_xy<double> P;
+	P a(0, 2);
+	P b(4, 2);
+	P c(3, 0);
+	P d(3, 4);
+	geometry::segment<P> s1(a, b);
+	geometry::segment<P> s2(c, d);
+
+	std::cout << "Intersection point(s): ";
+	geometry::intersection_result r = geometry::intersection_segment<P>(s1, s2, 
+		std::ostream_iterator<P>(std::cout, "\n"));
+	std::cout << "Intersection result: " << r.is_type << std::endl;
+}
+
+void example_simplify_linestring1()
+{
+	geometry::linestring<geometry::point_xy<double> > line, simplified;
+	geometry::from_wkt("linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", line);
+	geometry::simplify(line, simplified, 0.5);
+	std::cout
+		<< "  original line: " << line << std::endl
+		<< "simplified line: " << simplified << std::endl;
+}
+
+void example_simplify_linestring2()
+{
+	typedef geometry::point_xy<double> P;
+	typedef std::ostream_iterator<P> OUT;
+	typedef geometry::strategy::distance::xy_point_segment<P> DS;
+	typedef geometry::linestring<P> L;
+	L line;
+	geometry::from_wkt("linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", line);
+	geometry::strategy::simplify::douglas_peucker<L, OUT, DS> simplification;
+	geometry::simplify(line.begin(), line.end(), OUT(std::cout, "\n"), 0.5, simplification, DS());
+}
+
+void example_simplify_linestring3()
+{
+	typedef geometry::point_xy<double> P;
+	typedef std::ostream_iterator<P> OUT;
+	typedef geometry::strategy::distance::xy_point_segment<P> DS;
+	std::vector<P> line;
+	geometry::from_wkt<P>("linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", std::back_inserter(line));
+	geometry::strategy::simplify::douglas_peucker<std::vector<P>, OUT, DS> simplification;
+	geometry::simplify(line.begin(), line.end(), OUT(std::cout, "\n"), 0.5, simplification, DS());
+}
+
+
+void example_within()
+{
+	geometry::polygon<geometry::point_xy<double> > poly;
+	geometry::from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+	geometry::point_xy<float> point(3, 3);
+	std::cout << "Point is "
+		<< (geometry::within(point, poly) ? "IN" : "NOT in")
+		<< " polygon"
+		<< std::endl;
+}
+
+/*
+void example_within_strategy()
+{
+	// TO BE UPDATED/FINISHED
+	typedef geometry::point_xy<double> P;
+	typedef geometry::polygon<P> POLY;
+	P p;
+	std::cout << within(p, poly, strategy::within::cross_count<P>) << std::endl;
+}
+*/
+
+void example_length_linestring()
+{
+	using namespace geometry;
+	linestring<point_xy<double> > line;
+	from_wkt("linestring(0 0,1 1,4 8,3 2)", line);
+	std::cout << "linestring length is "
+		<< length(line)
+		<< " units" << std::endl;
+
+	// Linestring in latlong, filled with 
+	// explicit degree-minute-second values
+	typedef point_ll<degree, float> LL;
+	linestring<LL> line_ll;
+	line_ll.push_back(LL(
+		latitude<float>(dms<north, float>(52, 22, 23)), 
+		longitude<float>(dms<east, float>(4, 53, 32))));
+	line_ll.push_back(LL(
+		latitude<float>(dms<north, float>(51, 55, 51)), 
+		longitude<float>(dms<east, float>(4, 28, 45))));
+	line_ll.push_back(LL(
+		latitude<float>(dms<north, float>(52, 4, 48)), 
+		longitude<float>(dms<east, float>(4, 18, 0))));
+	std::cout << "linestring length is "
+		<< length(line_ll) / 1000
+		<< " kilometers " << std::endl;
+}
+
+void example_length_linestring_iterators1()
+{
+	geometry::linestring<geometry::point_xy<double> > line;
+	geometry::from_wkt("linestring(0 0,1 1,4 8,3 2)", line);
+	std::cout << "linestring length is "
+		<< geometry::length(line.begin(), line.end())
+		<< " units" << std::endl;
+}
+
+void example_length_linestring_iterators2()
+{
+	std::vector<geometry::point_xy<double> > line;
+	geometry::from_wkt<geometry::point_xy<double> >("linestring(0 0,1 1,4 8,3 2)", std::back_inserter(line));
+	std::cout << "linestring length is "
+		<< geometry::length(line.begin(), line.end())
+		<< " units" << std::endl;
+}
+
+void example_length_linestring_iterators3()
+{
+	using namespace geometry;
+	typedef point_ll<degree, float> LL;
+	std::deque<LL> line;
+	geometry::from_wkt<LL>("linestring(0 51,1 51,2 52)", std::back_inserter(line));
+	std::cout << "linestring length is "
+		<< 0.001 * geometry::length(line.begin(), line.end(), geometry::strategy::distance::vincenty<LL>())
+		<< " kilometers" << std::endl;
+}
+
+
+void example_length_linestring_strategy()
+{
+	using namespace geometry;
+	typedef point_ll<degree, float> LL;
+	linestring<LL> line_ll;
+	line_ll.push_back(LL(latitude<float>(dms<north, float>(52, 22, 23)), longitude<float>(dms<east, float>(4, 53, 32))));
+	line_ll.push_back(LL(latitude<float>(dms<north, float>(51, 55, 51)), longitude<float>(dms<east, float>(4, 28, 45))));
+	line_ll.push_back(LL(latitude<float>(dms<north, float>(52, 4, 48)), longitude<float>(dms<east, float>(4, 18, 0))));
+	std::cout << "linestring length is "
+		<< length(line_ll, strategy::distance::vincenty<LL, LL>() )/(1000)
+		<< " kilometers " << std::endl;
+}
+
+
+void example_envelope_linestring()
+{
+	geometry::linestring<geometry::point_xy<double> > line;
+	geometry::from_wkt("linestring(0 0,1 1,4 8,3 2)", line);
+	geometry::box<geometry::point_xy<double> > box;
+	geometry::envelope(line, box);
+
+	std::cout << "box is " << box.min() << "-" << box.max() << std::endl;
+}
+
+void example_envelope_polygon()
+{
+	using namespace geometry;
+	typedef point_ll<degree, double>  LL;
+
+	// Wrangel island, 180 meridian crossing island above Siberia.
+	polygon<LL> wrangel;
+	wrangel.outer().push_back(LL(latitude<>(dms<north>(70, 47, 7)), longitude<>(dms<west>(178, 47, 9))));
+	wrangel.outer().push_back(LL(latitude<>(dms<north>(71, 14, 0)), longitude<>(dms<east>(177, 28, 33))));
+	wrangel.outer().push_back(LL(latitude<>(dms<north>(71, 34, 24)), longitude<>(dms<east>(179, 44, 37))));
+	// Close it
+	wrangel.outer().push_back(wrangel.outer().front());
+
+	geometry::box<LL> box;
+	geometry::envelope(wrangel, box);
+
+	dms<cd_lat> minlat(box.min().lat());
+	dms<cd_lon> minlon(box.min().lon());
+
+	dms<cd_lat> maxlat(box.max().lat());
+	dms<cd_lon> maxlon(box.max().lon());
+
+	std::cout << wrangel << std::endl;
+	std::cout << "min: " << minlat.get_dms() << " , " << minlon.get_dms() << std::endl;
+	std::cout << "max: " << maxlat.get_dms() << " , " << maxlon.get_dms() << std::endl;
+}
+
+
+void example_dms()
+{
+	// Construction with degree/minute/seconds
+	geometry::dms<geometry::east> d1(4, 53, 32.5);
+
+	// Explicit conversion to double. 
+	std::cout << d1.as_value() << std::endl;
+
+	// Conversion to string, with optional strings
+	std::cout << d1.get_dms(" deg ", " min ", " sec") << std::endl;
+
+	// Combination with latitude/longitude and cardinal directions
+	{
+		using namespace geometry;
+		point_ll<degree> canberra(
+			latitude<>(dms<south>(35, 18, 27)), 
+			longitude<>(dms<east>(149, 7, 27.9)));
+		std::cout << canberra << std::endl;
+	}
+}
+
+void example_point_ll_construct()
+{
+	using namespace geometry;
+	typedef point_ll<degree> ll;
+
+	// Constructions in both orders possible
+	ll juneau(
+		latitude<>(dms<north>(58, 21, 5)), 
+		longitude<>(dms<west>(134, 30, 42)));
+	ll wladiwostok(
+		longitude<>(dms<east>(131, 54)),
+		latitude<>(dms<north>(43, 8))
+		);
+}
+
+namespace example_loop1
+{
+	// Class functor
+	template <typename S>
+	struct perimeter
+	{
+		struct summation
+		{
+			double sum;
+			summation() : sum(0) {}
+		};
+
+		bool operator()(const S& segment, summation& s) const
+		{
+			std::cout << "from " << segment.first << " to " << segment.second << std::endl;
+			s.sum += geometry::distance(segment.first, segment.second);
+			return true;
+		}
+	};
+
+	void example()
+	{
+		typedef geometry::point_xy<double> P;
+		typedef geometry::const_segment<P> S;
+		geometry::polygon<P> poly;
+		geometry::from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+		perimeter<S>::summation peri;
+		geometry::loop(poly.outer(), perimeter<S>(), peri);
+		std::cout << "Perimeter: " << peri.sum << std::endl;
+	}
+} //:\\
+
+
+namespace example_loop2
+{
+	struct summation
+	{
+		double sum;
+		summation() : sum(0) {}
+	};
+
+	// Function functor
+	template <typename S>
+	bool perimeter(const S& segment, summation& s) 
+	{
+		std::cout << "from " << segment.first << " to " << segment.second << std::endl;
+		s.sum += geometry::distance(segment.first, segment.second);
+		return true;
+	}
+
+	void example()
+	{
+		typedef geometry::point_ll<geometry::degree, double> P;
+		typedef geometry::const_segment<P> S;
+		geometry::polygon<P> poly;
+		geometry::from_wkt("POLYGON((-178.786 70.7853,177.476 71.2333,179.744 71.5733,-178.786 70.7853))", poly);
+		summation peri;
+		geometry::loop(poly.outer(), perimeter<S>, peri);
+		std::cout << "Perimeter: " << peri.sum/1000.0 << " km" << std::endl;
+	}
+} //:\\
+
+
+int main(void)
+{
+	example_area_polygon();
+
+	example_centroid_polygon();
+
+	example_distance_point_point();
+	example_distance_point_point_strategy();
+
+	example_from_wkt_point();
+	example_from_wkt_output_iterator();
+	example_from_wkt_linestring();
+	example_from_wkt_polygon();
+
+	example_as_wkt_point();
+
+	example_intersection_linestring1();
+	example_intersection_segment1();
+
+	example_simplify_linestring1();
+	example_simplify_linestring2();
+	example_simplify_linestring3();
+
+	example_length_linestring();
+	example_length_linestring_iterators1();
+	example_length_linestring_iterators2();
+	example_length_linestring_iterators3();
+	example_length_linestring_strategy();
+
+	example_envelope_linestring();
+	example_envelope_polygon();
+
+	example_within();
+
+	example_point_ll_convert();
+	example_point_ll_construct();
+	example_dms();
+
+	example_loop1::example();
+	example_loop2::example();
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/doxygen_examples.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/doxygen_examples.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="doxygen_examples"
+	ProjectGUID="{861F130D-2849-4B50-B240-049DBD9D3F18}"
+	RootNamespace="doxygen_examples"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\doxygen_examples"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="cd ../doc
doxygen
"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\doxygen_examples"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="cd ../doc
doxygen
"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\doxygen_examples.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Doxygen Files"
+			>
+			<File
+				RelativePath="..\doc\doxygen_examples.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\doc\doxygen_mainpage.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\doc\doxygen_pages.hpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			>
+			<File
+				RelativePath="..\area.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\aswkt.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\box.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\centroid.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\circle.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\correct.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\envelope.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\foreach.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\fromwkt.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\grow.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_linestring.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_polygon.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_segment.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\labelinfo.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\latlong.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\length.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\loop.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\overlaps.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\point_on_line.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\segment.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\simplify.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\streamwkt.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\within.hpp"
+				>
+			</File>
+			<Filter
+				Name="util"
+				>
+				<File
+					RelativePath="..\util\builder.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\util\math.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\util\promotion_traits.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\util\reserve.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\util\return_types.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\util\side.hpp"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="strategies"
+				>
+				<File
+					RelativePath="..\strategies\strategies_point_ll.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategies_point_xy.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategy_traits.hpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/geom.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/geom.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="geom"
+	ProjectGUID="{618D4B05-A06E-443B-87C0-94964CEA7164}"
+	RootNamespace="geom"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../.."
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../.."
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\geom.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\lb2.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\area.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\astext.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\box.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\centroid.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\circle.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\envelope.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\grow.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_linestring.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_polygon.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_segment.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\length.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\normalize.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\overlaps.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\point_on_line.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\segment.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\within.hpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/geometry_examples.sln
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/geometry_examples.sln	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,61 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_example", "point_example.vcproj", "{E7BFC111-F0E5-420F-869C-1FC3212270B5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "linestring_example", "linestring_example.vcproj", "{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "polygon_example", "polygon_example.vcproj", "{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distance_example", "distance_example.vcproj", "{1D50082A-6BE8-493D-80F5-45CBB46CC593}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_examples", "doxygen_examples.vcproj", "{861F130D-2849-4B50-B240-049DBD9D3F18}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_ll_example", "point_ll_example.vcproj", "{EE76F202-C916-4432-9629-E043098742E0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transformation_example", "transformation_example.vcproj", "{34346EC5-1EE8-49D5-AF24-D915B4D7D144}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_point_example", "custom_point_example.vcproj", "{B368C99D-8464-493C-A05B-904F53909046}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{E7BFC111-F0E5-420F-869C-1FC3212270B5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E7BFC111-F0E5-420F-869C-1FC3212270B5}.Debug|Win32.Build.0 = Debug|Win32
+		{E7BFC111-F0E5-420F-869C-1FC3212270B5}.Release|Win32.ActiveCfg = Release|Win32
+		{E7BFC111-F0E5-420F-869C-1FC3212270B5}.Release|Win32.Build.0 = Release|Win32
+		{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}.Debug|Win32.Build.0 = Debug|Win32
+		{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}.Release|Win32.ActiveCfg = Release|Win32
+		{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}.Release|Win32.Build.0 = Release|Win32
+		{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}.Debug|Win32.Build.0 = Debug|Win32
+		{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}.Release|Win32.ActiveCfg = Release|Win32
+		{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}.Release|Win32.Build.0 = Release|Win32
+		{1D50082A-6BE8-493D-80F5-45CBB46CC593}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1D50082A-6BE8-493D-80F5-45CBB46CC593}.Debug|Win32.Build.0 = Debug|Win32
+		{1D50082A-6BE8-493D-80F5-45CBB46CC593}.Release|Win32.ActiveCfg = Release|Win32
+		{1D50082A-6BE8-493D-80F5-45CBB46CC593}.Release|Win32.Build.0 = Release|Win32
+		{861F130D-2849-4B50-B240-049DBD9D3F18}.Debug|Win32.ActiveCfg = Debug|Win32
+		{861F130D-2849-4B50-B240-049DBD9D3F18}.Debug|Win32.Build.0 = Debug|Win32
+		{861F130D-2849-4B50-B240-049DBD9D3F18}.Release|Win32.ActiveCfg = Release|Win32
+		{861F130D-2849-4B50-B240-049DBD9D3F18}.Release|Win32.Build.0 = Release|Win32
+		{EE76F202-C916-4432-9629-E043098742E0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EE76F202-C916-4432-9629-E043098742E0}.Debug|Win32.Build.0 = Debug|Win32
+		{EE76F202-C916-4432-9629-E043098742E0}.Release|Win32.ActiveCfg = Release|Win32
+		{EE76F202-C916-4432-9629-E043098742E0}.Release|Win32.Build.0 = Release|Win32
+		{34346EC5-1EE8-49D5-AF24-D915B4D7D144}.Debug|Win32.ActiveCfg = Debug|Win32
+		{34346EC5-1EE8-49D5-AF24-D915B4D7D144}.Debug|Win32.Build.0 = Debug|Win32
+		{34346EC5-1EE8-49D5-AF24-D915B4D7D144}.Release|Win32.ActiveCfg = Release|Win32
+		{34346EC5-1EE8-49D5-AF24-D915B4D7D144}.Release|Win32.Build.0 = Release|Win32
+		{B368C99D-8464-493C-A05B-904F53909046}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B368C99D-8464-493C-A05B-904F53909046}.Debug|Win32.Build.0 = Debug|Win32
+		{B368C99D-8464-493C-A05B-904F53909046}.Release|Win32.ActiveCfg = Release|Win32
+		{B368C99D-8464-493C-A05B-904F53909046}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/linestring_example.png
==============================================================================
Binary file. No diff available.
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/linestring_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/linestring_example.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="linestring_example"
+	ProjectGUID="{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}"
+	RootNamespace="linestring_example"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\linestring_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\linestring_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\3_linestring_example.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\astext.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\foreach.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_linestring.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_segment.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\length.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\simplify.hpp"
+				>
+			</File>
+			<Filter
+				Name="strategies"
+				>
+				<File
+					RelativePath="..\strategies\strategies_point_ll.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategies_point_xy.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategy_traits.hpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/other_point_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/other_point_example.cpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,86 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#include <geometry/geometry.hpp>
+#include <geometry/distance.hpp>
+#include <geometry/streamwkt.hpp>
+
+#include <iostream>
+#include <vector>
+#include <algorithm>
+
+
+
+// Derived class
+class GP : public geometry::point_xy<float>
+{
+	public :
+		GP()
+			: geometry::point_xy<float>()
+		{}
+
+		GP(const float& x, const float& y)
+			: geometry::point_xy<float>(x,y)
+			, _spatial_reference_id(0)
+		{}
+		GP(const float& x, const float& y, int id)
+			: geometry::point_xy<float>(x,y)
+			, _spatial_reference_id(id)
+		{}
+	private :
+		int _spatial_reference_id;
+};
+
+// Own class
+class point_with_value
+{
+	private :
+		double m_x, m_y, m_value;
+	public :
+		typedef double coordinate_type;
+		point_with_value(const double& anx, const double& any, double v)
+			: m_x(anx)
+			, m_y(any)
+			, m_value(v)
+		{}
+		inline const double x() const { return m_x; }
+		inline const double y() const { return m_y; }
+};
+
+
+
+int main()
+{
+/*
+REWRITE
+lola a(5.9, 52.4); // Amsterdam 52° 23' N  4° 55' E
+	lola b(13.3, 52.45); // Berlin (West) 52° 27' N 13° 18' E
+
+	std::cout << "distance " << a << " to " << b << " is " << geometry::distance(a,b) / 1000.0 << " km" << std::endl;
+
+	// You can use your own points, derived from geometry::point
+	GP dp1(1,1);
+	GP dp2(2,2);
+
+	std::cout << "distance derived: " << geometry::distance(dp1, dp2) << std::endl;
+
+	// Or use your own point NOT derived from points
+	point_with_value op1(1,2,3);
+	point_with_value op2(4,5,6);
+
+	std::cout << "distance own: " << geometry::distance(op1, op2) << std::endl;
+
+	// You can also calculate the distance between "mixed" points
+	std::cout << "distance mixed: " << geometry::distance(dp1, op2) << std::endl;
+
+	geometry::point_xy<double> c(1,1);
+	std::cout << "distance " << a << " to " << b << " is " << geometry::distance(a,c) << std::endl;
+	*/
+
+	return 0;
+}
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/other_point_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/other_point_example.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="other_point_example"
+	ProjectGUID="{976DA842-61A4-4623-9807-52F336198EB5}"
+	RootNamespace="other_point_example"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\other_point_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\other_point_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\other_point_example.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\astext.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/point_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/point_example.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="point_example"
+	ProjectGUID="{E7BFC111-F0E5-420F-869C-1FC3212270B5}"
+	RootNamespace="point_example"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\point_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\point_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\1_point_example.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\astext.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/point_ll_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/point_ll_example.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="point_ll_example"
+	ProjectGUID="{EE76F202-C916-4432-9629-E043098742E0}"
+	RootNamespace="point_ll_example"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\point_ll_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\point_ll_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\2_point_ll_example.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\astext.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\latlong.hpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/polygon_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/polygon_example.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="polygon_example"
+	ProjectGUID="{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}"
+	RootNamespace="polygon_example"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\polygon_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\polygon_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\4_polygon_example.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\area.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\aswkt.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\box.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\centroid.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\circle.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\correct.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\envelope.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\foreach.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\grow.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\intersection_polygon.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\labelinfo.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\simplify.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\streamwkt.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\within.hpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/example/transformation_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/example/transformation_example.vcproj	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="transformation_example"
+	ProjectGUID="{34346EC5-1EE8-49D5-AF24-D915B4D7D144}"
+	RootNamespace="transformation_example"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\transformation_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\transformation_example"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;../..;../../../../contrib"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="0"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="kernel32.lib $(NoInherit)"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\6_transformation_example.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\astext.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\distance.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\geometry.hpp"
+				>
+			</File>
+			<Filter
+				Name="strategies"
+				>
+				<File
+					RelativePath="..\strategies\return_types.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategies_point_ll.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategies_point_xy.hpp"
+					>
+				</File>
+				<File
+					RelativePath="..\strategies\strategy_traits.hpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_area.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_area.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,55 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_AREA_HPP
+#define _GEOMETRY_MULTI_AREA_HPP
+
+#include <vector>
+
+#include <geometry/area.hpp>
+
+namespace geometry
+{
+	namespace impl
+	{
+		namespace area
+		{
+
+			template<typename MY, typename S>
+			inline double area_multi_polygon(const MY& my, const S& strategy)
+			{
+				double a = 0.0;
+				for (typename MY::const_iterator i = my.begin(); i != my.end(); i++)
+				{
+					a += impl::area::area_polygon(*i, strategy);
+				}
+				return a;
+			}
+		}
+	}
+
+
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A, typename S>
+	inline double area(const multi_polygon<Y, V, A>& m, const S& strategy)
+	{
+		return impl::area::area_multi_polygon(m, strategy);
+	}
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A>
+	inline double area(const multi_polygon<Y, V, A>& m)
+	{
+		return impl::area::area_multi_polygon(m, strategy_traits<typename Y::point_type>::area());
+	}
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_AREA_HPP
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_correct.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_correct.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,38 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_CORRECT_HPP
+#define _GEOMETRY_MULTI_CORRECT_HPP
+
+#include <vector>
+
+#include <geometry/correct.hpp>
+
+namespace geometry
+{
+
+	namespace impl
+	{
+		namespace correct
+		{
+			// correct a multi-polygon
+			template <typename O>
+			inline void correct_multi_polygon(O& o)
+			{
+				for (typename O::iterator it = o.begin(); it != o.end(); it++)
+				{
+					correct_polygon(*it);
+				}
+			}
+		}
+	}
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_CORRECT_HPP
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_envelope.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_envelope.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,61 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_ENVELOPE_HPP
+#define _GEOMETRY_MULTI_ENVELOPE_HPP
+
+#include <vector>
+
+#include <geometry/envelope.hpp>
+
+namespace geometry
+{
+	namespace impl
+	{
+		namespace envelope
+		{
+
+
+			// version for multi_polygon: outer linear_ring
+			template<typename B, typename O, typename S>
+			inline void envelope_multi_polygon(const O& mp, B& mbr, const S& strategy)
+			{
+				for (typename O::const_iterator i = mp.begin(); i != mp.end(); i++)
+				{
+					B b;
+					typename S::state_type state;
+					envelope_container(i->outer(), mbr, strategy, state);
+					state.envelope(mbr);
+				}
+			}
+
+		} // namespace envelope
+	} // namespace impl
+
+
+
+
+	template<typename L,
+			template<typename,typename> class V, template<typename> class A>
+	inline void envelope(const multi_linestring<L, V, A>& v)
+	{
+		//return envelope_container<typename L::point_type>(v);
+	}
+
+	template<typename PB, typename Y,
+			template<typename,typename> class V, template<typename> class A>
+	inline void envelope(const multi_polygon<Y, V, A>& v, box<PB>& b)
+	{
+		impl::envelope::envelope_multi_polygon(v, b, strategy_traits<PB, typename Y::point_type>::envelope());
+	}
+
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_ENVELOPE_HPP
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_foreach.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_foreach.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,218 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_FOREACH_HPP
+#define _GEOMETRY_MULTI_FOREACH_HPP
+
+#include <vector>
+
+#include <geometry/foreach.hpp>
+
+namespace geometry
+{
+
+	template<typename MP, typename F>
+	inline F for_each_point_multi_point(MP& mp, F f)
+	{
+		return (for_each_point_container(mp, f));
+	}
+
+	template<typename ML, typename F>
+	inline F for_each_point_multi_linestring(ML& ml, F f)
+	{
+		for (typename ML::iterator it = ml.begin(); it != ml.end(); it++)
+		{
+			f = for_each_point_linestring(*it, f);
+		}
+		return (f);
+	}
+
+	template<typename MY, typename F>
+	inline F for_each_point_multi_polygon(MY& mp, F f)
+	{
+		for (typename MY::iterator it = mp.begin(); it != mp.end(); it++)
+		{
+			f = for_each_point_polygon(*it, f);
+		}
+		return (f);
+	}
+
+
+
+
+	template<typename MP, typename F>
+	inline F for_each_point_multi_point(const MP& mp, F f)
+	{
+		return (for_each_point_container(mp, f));
+	}
+
+
+	template<typename ML, typename F>
+	inline F for_each_point_multi_linestring(const ML& ml, F f)
+	{
+		for (typename ML::const_iterator it = ml.begin(); it != ml.end(); it++)
+		{
+			f = for_each_point_linestring(*it, f);
+		}
+		return (f);
+	}
+
+	template<typename MY, typename F>
+	inline F for_each_point_multi_polygon(const MY& mp, F f)
+	{
+		for (typename MY::const_iterator it = mp.begin(); it != mp.end(); it++)
+		{
+			f = for_each_point_polygon(*it, f);
+		}
+		return (f);
+	}
+
+
+
+	template<typename ML, typename F>
+	inline F for_each_segment_multi_linestring(ML& ml, F f)
+	{
+		for (typename ML::iterator it = ml.begin(); it != ml.end(); it++)
+		{
+			f = for_each_segment_linestring(*it, f);
+		}
+		return (f);
+	}
+
+	template<typename MY, typename F>
+	inline F for_each_segment_multi_polygon(MY& mp, F f)
+	{
+		for (typename MY::iterator it = mp.begin(); it != mp.end(); it++)
+		{
+			f = for_each_segment_polygon(*it, f);
+		}
+		return (f);
+	}
+
+
+
+
+
+
+	template<typename ML, typename F>
+	inline F for_each_segment_multi_linestring(const ML& ml, F f)
+	{
+		for (typename ML::const_iterator it = ml.begin(); it != ml.end(); it++)
+		{
+			f = for_each_segment_linestring(*it, f);
+		}
+		return (f);
+	}
+
+	template<typename MY, typename F>
+	inline F for_each_segment_multi_polygon(const MY& mp, F f)
+	{
+		for (typename MY::const_iterator it = mp.begin(); it != mp.end(); it++)
+		{
+			f = for_each_segment_polygon(*it, f);
+		}
+		return (f);
+	}
+
+
+
+
+
+
+	template<typename P,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_point(multi_point<P, V, A>& mp, F f)
+	{
+		return (for_each_point_multi_point(mp, f));
+	}
+
+	template<typename L,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_point(multi_linestring<L, V, A>& ml, F f)
+	{
+		return (for_each_point_multi_linestring(ml, f));
+	}
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_point(multi_polygon<Y, V, A>& mp, F f)
+	{
+		return (for_each_point_multi_polygon(mp, f));
+	}
+
+
+
+
+	template<typename P,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_point(const multi_point<P, V, A>& mp, F f)
+	{
+		return (for_each_point_multi_point(mp, f));
+	}
+
+	template<typename L,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_point(const multi_linestring<L, V, A>& ml, F f)
+	{
+		return (for_each_point_multi_linestring(ml, f));
+	}
+
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_point(const multi_polygon<Y, V, A>& mp, F f)
+	{
+		return (for_each_point_multi_polygon(mp, f));
+	}
+
+
+
+
+	template<typename L,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_segment(multi_linestring<L, V, A>& ml, F f)
+	{
+		return (for_each_segment_multi_linestring(ml, f));
+	}
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_segment(multi_polygon<Y, V, A>& mp, F f)
+	{
+		return (for_each_segment_multi_polygon(mp, f));
+	}
+
+
+
+
+	template<typename L,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_segment(const multi_linestring<L, V, A>& ml, F f)
+	{
+		return (for_each_segment_multi_linestring(ml, f));
+	}
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A,
+			typename F>
+	inline F for_each_segment(const multi_polygon<Y, V, A>& mp, F f)
+	{
+		return (for_each_segment_multi_polygon(mp, f));
+	}
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_FOREACH_HPP
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_geometry.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_geometry.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,55 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_GEOMETRY_HPP
+#define _GEOMETRY_MULTI_GEOMETRY_HPP
+
+#include <vector>
+
+#include <geometry/geometry.hpp>
+
+
+
+namespace geometry
+{
+
+	// Class: multi_point
+	// Purpose: groups points belonging to each other, e.g. a constellation
+	template<typename P,
+			template<typename,typename> class V = std::vector,
+			template<typename> class A = std::allocator>
+	class multi_point : public V<P, A<P> >, public geometry_traits<P>
+	{
+	};
+
+	// Class: multi_line
+	// Purpose: groups lines belonging to each other, e.g. a broken highway
+	template<typename L,
+			template<typename,typename> class V = std::vector,
+			template<typename> class A = std::allocator>
+	class multi_linestring : public V<L, A<L> >, public geometry_traits<typename L::point_type>
+	{
+		public:
+			typedef L linestring_type;
+	};
+
+	// Class: multi_polygon
+	// Purpose: groups polygons belonging to each other, e.g. Hawaii
+	template<typename Y,
+			template<typename,typename> class V = std::vector,
+			template<typename> class A = std::allocator>
+	class multi_polygon : public V<Y, A<Y> >, public geometry_traits<typename Y::point_type>
+	{
+		public:
+			typedef Y polygon_type;
+	};
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_GEOMETRY_HPP
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_labelinfo.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_labelinfo.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,24 @@
+	template<typename MY, typename MP>
+	inline void label_info_multi_polygon(const MY& my, label_option option, MP& mp)
+	{
+		// Just take one.
+		// Alternative: take the largest one.
+		// Actually the client should label_option all its polygons,
+		// so this algorithm is probably not called often.
+		mp.resize(0);
+		if (my.size() > 0)
+		{
+			label_info_polygon<MP>(my.front(), option, mp);
+		}
+	}
+
+
+
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A,
+			typename MP>
+	inline void label_info(const multi_polygon<Y, V, A>& m, label_option option, MP& mp)
+	{
+		label_info_multi_polygon<typename Y::point_type>(m, option, mp);
+	}
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_length.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_length.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,35 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_LENGTH_HPP
+#define _GEOMETRY_MULTI_LENGTH_HPP
+
+#include <vector>
+
+#include <geometry/length.hpp>
+
+namespace geometry
+{
+
+
+	// Length of a multi-linestring
+	template<typename ML>
+	inline double length_multi_linestring(const ML& ml)
+	{
+		double sum = 0;
+		for (typename ML::const_iterator i = ml.begin(); i != ml.end(); i++)
+		{
+			sum  += length_linestring(*i);
+		}
+		return sum;
+	}
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_LENGTH_HPP
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_simplify.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_simplify.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,66 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_SIMPLIFY_HPP
+#define _GEOMETRY_MULTI_SIMPLIFY_HPP
+
+#include <vector>
+
+#include <geometry/simplify.hpp>
+
+namespace geometry
+{
+
+
+			template<typename ML>
+			inline void simplify_multi_linestring(const ML& ml_in, ML& ml_out, double max_distance)
+			{
+				ml_out.resize(ml_in.size());
+				typename ML::const_iterator it_in = ml_in.begin();
+				typename ML::iterator it_out = ml_out.begin();
+				for (; it_in != ml_in.end(); it_in++, it_out++)
+				{
+					simplify_linestring(*it_in, *it_out, max_distance);
+				}
+			}
+
+
+			template<typename MY>
+			inline void simplify_multi_polygon(const MY& mp_in, MY& mp_out, double max_distance)
+			{
+				mp_out.resize(mp_in.size());
+				typename MY::const_iterator it_in = mp_in.begin();
+				typename MY::iterator it_out = mp_out.begin();
+				for (; it_in != mp_in.end(); it_in++, it_out++)
+				{
+					simplify_polygon(*it_in, *it_out, max_distance);
+				}
+			}
+
+
+
+	template<typename L,
+			template<typename,typename> class V, template<typename> class A>
+	inline void simplify(const multi_linestring<L, V, A>& ml_in,
+		multi_linestring<L, V, A>& ml_out, double max_distance)
+	{
+		simplify_multi_linestring(ml_in, ml_out, max_distance);
+	}
+
+	template<typename Y,
+			template<typename,typename> class V, template<typename> class A>
+	inline void simplify(const multi_polygon<Y, V, A>& mp_in,
+				multi_polygon<Y, V, A>& mp_out, double max_distance)
+	{
+		simplify_multi_polygon(mp_in, mp_out, max_distance);
+	}
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_SIMPLIFY_HPP
Added: sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_within.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/spacial_indexing/geometry/multi/multi_within.hpp	2008-06-04 15:37:07 EDT (Wed, 04 Jun 2008)
@@ -0,0 +1,88 @@
+// Geometry Library
+//
+// Copyright Barend Gehrels, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef _GEOMETRY_MULTI_WITHIN_HPP
+#define _GEOMETRY_MULTI_WITHIN_HPP
+
+#include <vector>
+
+#include <geometry/within.hpp>
+
+namespace geometry
+{
+	namespace impl
+	{
+		namespace within
+		{
+
+
+			template<typename P, typename O, typename S>
+			inline bool point_in_multi_polygon(const P& p, const O& m, const S& strategy)
+			{
+				for (typename O::const_iterator i = m.begin(); i != m.end(); i++)
+				{
+					// Point within a multi-polygon: true if within one of the polygons
+					if (point_in_polygon(p, *i, strategy))
+					{
+						return true;
+					}
+				}
+				return false;
+			}
+
+
+			template<typename O, typename C>
+			inline bool multi_polygon_in_circle(const O& m, const C& c)
+			{
+				for (typename O::const_iterator i = m.begin(); i != m.end(); i++)
+				{
+					if (! polygon_in_circle(*i, c))
+					{
+						return false;
+					}
+				}
+				return true;
+			}
+
+
+
+		} // namespace within
+	} // namespace impl
+
+
+	template<typename C, typename T,
+			typename Y,
+			template<typename,typename> class V,
+			template<typename> class A>
+	inline bool within(const multi_polygon<Y, V, A> m, const circle<C, T>& c)
+	{
+		return impl::within::multi_polygon_in_circle(m, c);
+	}
+
+
+
+
+	template<typename P, typename Y,
+			template<typename,typename> class V, template<typename> class A>
+	inline bool within(const P& p, const multi_polygon<Y, V, A>& m)
+	{
+		return impl::within::point_in_multi_polygon(p, m,
+					strategy_traits<P, typename Y::point_type>::within());
+	}
+
+	template<typename P, typename Y,
+			template<typename,typename> class V, template<typename> class A, typename S>
+	inline bool within(const P& p, const multi_polygon<Y, V, A>& m, const S& strategy)
+	{
+		return impl::within::point_in_multi_polygon(p, m, strategy);
+	}
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_MULTI_WITHIN_HPP