Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51287 - in sandbox/ggl: boost/ggl/algorithms boost/ggl/arithmetic boost/ggl/core boost/ggl/geometries boost/ggl/geometry boost/ggl/geometry/algorithms boost/ggl/geometry/arithmetic boost/ggl/geometry/core boost/ggl/geometry/core/concepts boost/ggl/geometry/geometries boost/ggl/geometry/geometries/adapted boost/ggl/geometry/geometries/register boost/ggl/geometry/io boost/ggl/geometry/io/wkt boost/ggl/geometry/projections boost/ggl/geometry/projections/impl boost/ggl/geometry/projections/proj boost/ggl/geometry/strategies boost/ggl/geometry/strategies/agnostic boost/ggl/geometry/strategies/cartesian boost/ggl/geometry/strategies/geographic boost/ggl/geometry/strategies/spherical boost/ggl/geometry/strategies/transform boost/ggl/geometry/util boost/ggl/io boost/ggl/strategies boost/ggl/util libs/ggl/example libs/ggl/example/contrib libs/ggl/test libs/ggl/test/point_concept_tests
From: barend.gehrels_at_[hidden]
Date: 2009-02-17 06:30:13


Author: barendgehrels
Date: 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
New Revision: 51287
URL: http://svn.boost.org/trac/boost/changeset/51287

Log:
Preview 4
Added:
   sandbox/ggl/boost/ggl/geometry/
   sandbox/ggl/boost/ggl/geometry/algorithms/
   sandbox/ggl/boost/ggl/geometry/algorithms/append.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/area.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/assign.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/buffer.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/centroid.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/clear.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/combine.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/convert.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/convex_hull.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/correct.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/distance.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/envelope.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/foreach.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/intersection.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/intersection_linestring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/intersection_polygon.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/intersection_segment.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/length.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/make.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/num_points.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/overlaps.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/parse.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/selected.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/simplify.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/transform.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/algorithms/within.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/arithmetic/
   sandbox/ggl/boost/ggl/geometry/arithmetic/arithmetic.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/arithmetic/dot_product.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/
   sandbox/ggl/boost/ggl/geometry/core/access.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/concepts/
   sandbox/ggl/boost/ggl/geometry/core/concepts/box_concept.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/concepts/linestring_concept.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/concepts/nsphere_concept.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/concepts/point_concept.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/concepts/polygon_concept.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/concepts/ring_concept.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/concepts/segment_concept.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/coordinate_dimension.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/coordinate_system.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/coordinate_type.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/cs.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/exterior_ring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/interior_rings.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/point_type.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/radian_access.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/radius.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/ring_type.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/tag.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/tags.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/core/topological_dimension.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/boost_array_as_linestring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/boost_array_as_ring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array_cartesian.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array_geographic.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/std_as_linestring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/std_as_ring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple_cartesian.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple_geographic.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/box.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/cartesian2d.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/cartesian3d.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/geometries.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/latlong.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/linear_ring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/linestring.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/nsphere.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/point.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/point_ll.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/point_xy.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/polygon.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/register/
   sandbox/ggl/boost/ggl/geometry/geometries/register/register_box.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/register/register_point.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometries/segment.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/geometry.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/io/
   sandbox/ggl/boost/ggl/geometry/io/wkt/
   sandbox/ggl/boost/ggl/geometry/io/wkt/aswkt.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/io/wkt/fromwkt.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/io/wkt/streamwkt.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/
   sandbox/ggl/boost/ggl/geometry/projections/epsg.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/epsg_traits.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/factory.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/
   sandbox/ggl/boost/ggl/geometry/projections/impl/aasincos.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/adjlon.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/base_dynamic.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/base_static.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/factory_entry.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/function_overloads.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_auth.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_datum_set.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_datums.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_ell_set.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_ellps.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_fwd.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_gauss.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_init.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_inv.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_mlfn.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_msfn.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_param.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_phi2.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_qsfn.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_tsfn.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_units.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/pj_zpoly1.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/proj_mdist.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/proj_util.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/impl/projects.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/parameters.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/
   sandbox/ggl/boost/ggl/geometry/projections/proj/aea.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/aeqd.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/airy.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/aitoff.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/august.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/bacon.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/bipc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/boggs.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/bonne.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/cass.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/cc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/cea.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/chamb.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/collg.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/crast.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/denoy.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/eck1.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/eck2.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/eck3.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/eck4.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/eck5.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/eqc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/eqdc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/fahey.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/fouc_s.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/gall.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/geocent.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/geos.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/gins8.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/gn_sinu.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/gnom.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/goode.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/gstmerc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/hammer.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/hatano.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/imw_p.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/krovak.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/labrd.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/laea.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/lagrng.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/larr.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/lask.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/latlong.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/lcc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/lcca.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/loxim.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/lsat.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/mbt_fps.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/mbtfpp.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/mbtfpq.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/merc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/mill.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/mod_ster.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/moll.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/nell.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/nell_h.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/nocol.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/nsper.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/nzmg.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/ob_tran.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/ocea.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/oea.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/omerc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/ortho.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/poly.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/putp2.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/putp3.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/putp4p.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/putp5.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/putp6.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/robin.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/rouss.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/rpoly.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/sconics.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/somerc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/stere.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/sterea.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/sts.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/tcc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/tcea.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/tmerc.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/tpeqd.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/urm5.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/urmfps.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/vandg.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/vandg2.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/vandg4.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/wag2.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/wag3.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/wag7.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/wink1.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/proj/wink2.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/project_transformer.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/projections/projection.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/
   sandbox/ggl/boost/ggl/geometry/strategies/agnostic/
   sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_convex_hull.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_simplify.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_within.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_area.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_centroid.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_compare.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_distance.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_envelope.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_side.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_within.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/distance_result.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/geographic/
   sandbox/ggl/boost/ggl/geometry/strategies/geographic/geo_distance.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/geographic/geo_parse.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/spherical/
   sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_area.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_distance.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_envelope.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/strategies.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/strategy_traits.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/strategy_transform.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/transform/
   sandbox/ggl/boost/ggl/geometry/strategies/transform/inverse_transformer.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/transform/map_transformer.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/strategies/transform/matrix_transformers.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/util/
   sandbox/ggl/boost/ggl/geometry/util/assign_box_corner.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/util/copy.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/util/for_each_coordinate.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/util/graticule.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/util/loop.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/util/math.hpp (contents, props changed)
   sandbox/ggl/boost/ggl/geometry/util/promotion_traits.hpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/01_point_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/01_point_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/02_point_ll_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/02_point_ll_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/03_linestring_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/03_linestring_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/04_polygon_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/04_polygon_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/05_distance_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/05_distance_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/06_transformation_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/06_transformation_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/c01_custom_point_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/c01_custom_point_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/c02_custom_box_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/c02_custom_box_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/c03_custom_linestring_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/c03_custom_linestring_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/c04_a_custom_triangle_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/c04_a_custom_triangle_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/c04_b_custom_triangle_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/c04_b_custom_triangle_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/contrib/
   sandbox/ggl/libs/ggl/example/contrib/readme.txt (contents, props changed)
   sandbox/ggl/libs/ggl/example/doxygen_2.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/doxygen_2.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/doxygen_examples.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/doxygen_examples.sln (contents, props changed)
   sandbox/ggl/libs/ggl/example/doxygen_examples.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/geometry_examples.sln (contents, props changed)
   sandbox/ggl/libs/ggl/example/p01_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/p01_projection_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/p02_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/p02_projfactory_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/p03_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/p03_projmap_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/shapelib_common.hpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/x01_shapelib_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/x01_shapelib_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/example/x02_gd_example.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/example/x02_gd_example.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/access.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/access.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/append.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/append.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/area.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/area.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/arithmetic.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/arithmetic.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/assign.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/assign.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/box.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/box.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/circle.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/circle.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/combine.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/combine.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/common.hpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/compile_test.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/compile_test.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/convert.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/convert.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/convex_hull.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/convex_hull.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/copy.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/copy.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/core.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/core.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/custom_linestring.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/custom_linestring.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/custom_tests.sln (contents, props changed)
   sandbox/ggl/libs/ggl/test/distance.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/distance.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/dot_product.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/dot_product.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/envelope.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/envelope.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/for_each_coordinate.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/for_each_coordinate.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/geometry_tests.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/geometry_tests.sln (contents, props changed)
   sandbox/ggl/libs/ggl/test/geometry_tests.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/intersection_test.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/loop.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/loop.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/make.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/make.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/parse.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/parse.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/parse_dms.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/parse_dms.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/
   sandbox/ggl/libs/ggl/test/point_concept_tests/array_point.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/function_asserting_a_point.hpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/function_requiring_a_point.hpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/point_with_incorrect_coord_count.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_coord_count.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_coord_type.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_getter.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_setter.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/well_formed_point.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_concept_tests/well_formed_point_traits.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_ll.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/point_ll.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/projection.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/projection.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/projection_epsg.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/projection_epsg.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/projections.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/projections.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/pythagoras.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/pythagoras.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/segment.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/segment.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/selected.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/selected.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/simplify.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/simplify.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/transform.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/transform.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/transformer.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/transformer.vcproj (contents, props changed)
   sandbox/ggl/libs/ggl/test/within_test.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/wkt.cpp (contents, props changed)
   sandbox/ggl/libs/ggl/test/wkt.vcproj (contents, props changed)
Removed:
   sandbox/ggl/boost/ggl/algorithms/
   sandbox/ggl/boost/ggl/arithmetic/
   sandbox/ggl/boost/ggl/core/
   sandbox/ggl/boost/ggl/geometries/
   sandbox/ggl/boost/ggl/io/
   sandbox/ggl/boost/ggl/strategies/
   sandbox/ggl/boost/ggl/util/

Added: sandbox/ggl/boost/ggl/geometry/algorithms/append.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/append.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,200 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_APPEND_HPP
+#define _GEOMETRY_APPEND_HPP
+
+#include <boost/type_traits/remove_const.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/point_type.hpp>
+#include <geometry/core/tags.hpp>
+
+
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class, optional, might be implemented to append a point
+ \details If a geometry type should not use the std "push_back" then it can specialize
+ the "use_std" traits class to false, it should then implement (a.o.) append_point
+ \ingroup traits
+ \par Geometries:
+ - linestring
+ - linear_ring
+ \par Specializations should provide:
+ - run
+ */
+ template <typename G, typename P>
+ struct append_point
+ {
+ };
+ }
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace append
+ {
+ template <typename G, typename P, bool STD>
+ struct append_point {};
+
+ template <typename G, typename P>
+ struct append_point<G, P, true>
+ {
+ static inline void run(G& geometry, const P& point, int , int )
+ {
+ typename point_type<G>::type point_to_add;
+ copy_coordinates(point, point_to_add);
+ geometry.push_back(point_to_add);
+ }
+ };
+
+ template <typename G, typename P>
+ struct append_point<G, P, false>
+ {
+ static inline void run(G& geometry, const P& point, int ring_index, int multi_index)
+ {
+ traits::append_point<G, P>::run(geometry, point, ring_index, multi_index);
+ }
+ };
+
+
+ template <typename G, typename R, bool STD>
+ struct append_range
+ {
+ typedef typename boost::range_value<R>::type P;
+
+ static inline void run(G& geometry, const R& range, int ring_index, int multi_index)
+ {
+ for (typename boost::range_const_iterator<R>::type it = boost::begin(range);
+ it != boost::end(range); it++)
+ {
+ append_point<G, P, STD>::run(geometry, *it, ring_index, multi_index);
+ }
+ }
+ };
+
+
+ template <typename P, typename PNT, bool STD>
+ struct point_to_poly
+ {
+ typedef typename ring_type<P>::type R;
+
+ static inline void run(P& polygon, const PNT& point, int ring_index, int multi_index)
+ {
+ if (ring_index == -1)
+ {
+ append_point<R, PNT, STD>::run(exterior_ring(polygon), point, -1, -1);
+ }
+ else if (ring_index < boost::size(interior_rings(polygon)))
+ {
+ append_point<R, PNT, STD>::run(interior_rings(polygon)[ring_index], point, -1, -1);
+ }
+ }
+ };
+
+ template <typename P, typename R, bool STD>
+ struct range_to_poly
+ {
+ typedef typename ring_type<P>::type RING;
+
+ static inline void run(P& polygon, const R& range, int ring_index, int multi_index)
+ {
+ if (ring_index == -1)
+ {
+ append_range<RING, R, STD>::run(exterior_ring(polygon), range, -1, -1);
+ }
+ else if (ring_index < boost::size(interior_rings(polygon)))
+ {
+ append_range<RING, R, STD>::run(interior_rings(polygon)[ring_index], range, -1, -1);
+ }
+ }
+ };
+
+
+ } // namespace append
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ // (ROP = range or point, STD = use std library)
+
+ // Default case (where ROP will be range/array/etc)
+ template <typename TAG_G, typename TAG_ROP, typename G, typename ROP, bool STD>
+ struct append
+ : impl::append::append_range<G, ROP, STD> {};
+
+ // Append a point to any geometry
+ template <typename TAG, typename G, typename P, bool STD>
+ struct append<TAG, point_tag, G, P, STD>
+ : impl::append::append_point<G, P, STD> {};
+
+ // Never possible to append anything to a point/box/n-sphere
+ template <typename TAG_ROP, typename P, typename ROP, bool STD>
+ struct append<point_tag, TAG_ROP, P, ROP, STD> {};
+
+ template <typename TAG_ROP, typename B, typename ROP, bool STD>
+ struct append<box_tag, TAG_ROP, B, ROP, STD> {};
+
+ template <typename TAG_ROP, typename N, typename ROP, bool STD>
+ struct append<nsphere_tag, TAG_ROP, N, ROP, STD> {};
+
+ template <typename P, typename TAG_R, typename R, bool STD>
+ struct append<polygon_tag, TAG_R, P, R, STD>
+ : impl::append::range_to_poly<P, R, STD> {};
+
+ template <typename P, typename PNT, bool STD>
+ struct append<polygon_tag, point_tag, P, PNT, STD>
+ : impl::append::point_to_poly<P, PNT, STD> {};
+
+ // Multi-linestring and multi-polygon might either implement traits or use standard...
+
+ } // namespace dispatch
+ #endif
+
+
+
+
+ /*!
+ \brief Appends one or more points to a linestring, linear-ring, polygon, multi
+ \ingroup access
+ \param geometry a geometry
+ \param range_or_point the point or range to add
+ \param ring_index the index of the ring in case of a polygon: exterior ring (-1, the default) or
+ interior ring index
+ \param multi_index reserved for multi polygons
+ */
+ template <typename G, typename ROP>
+ inline void append(G& geometry, const ROP& range_or_point,
+ int ring_index = -1, int multi_index = 0)
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ dispatch::append
+ <typename tag<G>::type, typename tag<ROP>::type,
+ NCG, ROP, traits::use_std<NCG>::value>
+ ::run(geometry, range_or_point, ring_index, multi_index);
+ }
+
+}
+
+
+#endif // _GEOMETRY_APPEND_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/area.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/area.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,229 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_AREA_HPP
+#define _GEOMETRY_AREA_HPP
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/ring_type.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/nsphere_concept.hpp>
+
+
+#include <geometry/strategies/strategies.hpp>
+
+#include <geometry/util/loop.hpp>
+#include <geometry/util/math.hpp>
+
+/*!
+\defgroup area area calculation
+
+\par Performance
+2776 * 1000 area calculations are done in 0.11 seconds (other libraries: 0.125 seconds, 0.125 seconds, 0.5 seconds)
+
+\par Coordinate systems and strategies
+Area calculation can be done in Cartesian and in spherical/geographic coordinate systems.
+
+\par Geometries
+The area algorithm calculates the surface area of all geometries having a surface:
+box, circle, polygon, multi_polygon. The units are the square of the units used for the points
+defining the surface. If the polygon is defined in meters, the area is in square meters.
+
+\par Example:
+Example showing area calculation of polygons built of xy-points and of latlong-points
+\dontinclude doxygen_examples.cpp
+\skip example_area_polygon()
+\line {
+\until }
+
+*/
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace area
+ {
+ template<typename B>
+ inline typename coordinate_type<B>::type area_box(const B& b)
+ {
+ // Currently only works for Cartesian boxes
+ // Todo: make strategy
+ // Todo: use concept
+ assert_dimension<B, 2>();
+ typedef typename coordinate_type<B>::type T;
+ T dx = get<max_corner, 0>(b) - get<min_corner, 0>(b);
+ T dy = get<max_corner, 1>(b) - get<min_corner, 1>(b);
+ return dx * dy;
+ }
+
+ template<typename C>
+ inline double area_circle(const C& c)
+ {
+ // Currently only works for Cartesian circles
+ // Todo: make strategy
+ // Todo: use concept
+ assert_dimension<C, 2>();
+ typename radius_type<C>::type r = get_radius<0>(c);
+ return geometry::math::pi * r * r;
+ }
+
+ // Area of a linear linear_ring, assuming a closed linear_ring
+ template<typename R, typename S>
+ inline double area_ring(const R& r, const S& strategy)
+ {
+ assert_dimension<R, 2>();
+
+ // A closed linear_ring has at least four points, if not there is no area
+ if (boost::size(r) >= 4)
+ {
+ typename S::state_type state;
+ if (loop(r, strategy, state))
+ {
+ return state.area();
+ }
+ }
+
+ return 0;
+ }
+
+ // Area of a polygon, assuing a closed clockwise polygon (with holes counter clockwise)
+ template<typename Y, typename S>
+ inline double area_polygon(const Y& poly, const S& strategy)
+ {
+ assert_dimension<Y, 2>();
+
+ typedef typename boost::range_const_iterator<typename interior_type<Y>::type>::type IT;
+
+ double a = fabs(area_ring(exterior_ring(poly), strategy));
+
+ for (IT i = boost::begin(interior_rings(poly)); i != boost::end(interior_rings(poly)); i++)
+ {
+ a -= fabs(area_ring(*i, strategy));
+ }
+ return a;
+ }
+
+
+ } // namespace area
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G>
+ struct area {};
+
+
+ template <typename G>
+ struct area<box_tag, G>
+ {
+ inline static double calculate(const G& b)
+ {
+ return impl::area::area_box(b);
+ }
+ };
+
+
+ template <typename G>
+ struct area<nsphere_tag, G>
+ {
+ inline static double calculate(const G& c)
+ {
+ return impl::area::area_circle(c);
+ }
+ };
+
+ template <typename G>
+ struct area<ring_tag, G>
+ {
+
+ inline static double calculate(const G& ring)
+ {
+ typedef typename boost::range_value<G>::type P;
+
+ return impl::area::area_ring(ring,
+ typename strategy_area<typename cs_tag<P>::type, P>::type());
+ }
+
+ template <typename S>
+ inline static double calculate(const G& ring, const S& strategy)
+ {
+ return impl::area::area_ring(ring, strategy);
+ }
+ };
+
+ // Specialization for polygons:
+ template <typename G>
+ struct area<polygon_tag, G>
+ {
+ inline static double calculate(const G& poly)
+ {
+ typedef typename point_type<G>::type P;
+
+ return impl::area::area_polygon(poly, typename strategy_area<
+ typename cs_tag<P>::type, P>::type());
+ }
+ template <typename S>
+ inline static double calculate(const G& poly, const S& strategy)
+ {
+ return impl::area::area_polygon(poly, strategy);
+ }
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Calculate area of a geometry
+ \ingroup area
+ \details The function area returns the area of a polygon, ring, box or circle,
+ using the default area-calculation strategy. Strategies are
+ provided for cartesian ans spherical points
+ The geometries should correct, polygons should be closed and orientated clockwise, holes,
+ if any, must be orientated counter clockwise
+ \param geometry a geometry
+ \return the area
+ */
+ template <typename G>
+ inline double area(const G& geometry)
+ {
+ return dispatch::area<typename tag<G>::type, G>::calculate(geometry);
+ }
+
+ /*!
+ \brief Calculate area of a geometry using a strategy
+ \ingroup area
+ \details This version of area calculation takes a strategy
+ \param geometry a geometry
+ \param strategy the strategy to calculate area. Especially for spherical areas there are
+ some approaches.
+ \return the area
+ */
+ template <typename G, typename S>
+ inline double area(const G& geometry, const S& strategy)
+ {
+ return dispatch::area<typename tag<G>::type, G>::calculate(geometry, strategy);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_AREA_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/assign.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/assign.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,366 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ASSIGN_HPP
+#define _GEOMETRY_ASSIGN_HPP
+
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/numeric/conversion/bounds.hpp>
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/core/tags.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/radius.hpp>
+#include <geometry/core/exterior_ring.hpp>
+
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/append.hpp>
+
+
+#include <geometry/util/copy.hpp>
+#include <geometry/util/for_each_coordinate.hpp>
+
+
+/*!
+\defgroup access access: get/set coordinate values, make objects, clear geometries, append point(s)
+\details There are many ways to edit geometries. It is possible to:
+- use the geometries themselves, so access point.x(). This is not done inside the library because it is agnostic
+ to geometry type. However, library users can use this as it is intuitive.
+- use the standard library, so use .push_back(point) or use inserters. This is also avoided inside the library.
+However, library users can use it if they are used to the standard library
+- use the functionality provided in this geometry library. These are the functions in this module.
+
+The library provides the following functions to edit geometries:
+- set to set one coordinate value
+- assign to set two or more coordinate values
+- make to construct and return geometries with specified coordinates.
+- append to append one or more points to a geometry
+- clear to remove all points from a geometry
+
+For getting coordinates it is similar:
+- get to get a coordinate value
+- or use the standard library
+- or use the geometries themselves
+
+*/
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace assign
+ {
+
+ template <typename C>
+ struct assign_operation
+ {
+ inline assign_operation(C value) : m_value(value) {}
+
+ template <typename P, size_t I>
+ inline void run(P& point) const
+ {
+ set<I>(point, m_value);
+ }
+
+ private :
+ C m_value;
+ };
+
+
+ /*!
+ \brief Assigns all coordinates of a specific point to a value
+ \ingroup access
+ \details
+ \param p Point
+ \param value Value which is assigned to all coordinates of point p
+ */
+ template <typename P>
+ inline void assign_value(P& p, const typename coordinate_type<P>::type& value)
+ {
+ for_each_coordinate(p, assign_operation<typename coordinate_type<P>::type>(value));
+ }
+
+
+ template <typename P, typename T, size_t I, size_t D>
+ struct assign_point
+ {
+ typedef typename coordinate_type<P>::type TP;
+
+ static inline void assign(const T values[D], P& point)
+ {
+ set<I>(point, boost::numeric_cast<TP>(values[I]));
+ assign_point<P, T, I + 1, D>::assign(values, point);
+ }
+ };
+
+ template <typename P, typename T, size_t D>
+ struct assign_point<P, T, D, D>
+ {
+ static inline void assign(const T values[D], P& point) {}
+ };
+
+
+
+ template <typename B, size_t C, size_t I, size_t D>
+ struct initialize
+ {
+ typedef typename coordinate_type<B>::type T;
+
+ static inline void init(B& box, const T& value)
+ {
+ set<C, I>(box, value);
+ initialize<B, C, I + 1, D>::init(box, value);
+ }
+ };
+
+ template <typename B, size_t C, size_t D>
+ struct initialize<B, C, D, D>
+ {
+ typedef typename coordinate_type<B>::type T;
+ static inline void init(B& box, const T& value) {}
+ };
+
+
+
+ } // namespace assign
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G>
+ struct assignment {};
+
+
+ template <typename P>
+ struct assignment<point_tag, P>
+ {
+ template <typename T>
+ static inline void assign(P& point, const T& coor1, const T& coor2)
+ {
+ assert_dimension<P, 2>();
+
+ typedef typename coordinate_type<P>::type TP;
+ set<0>(point, boost::numeric_cast<TP>(coor1));
+ set<1>(point, boost::numeric_cast<TP>(coor2));
+ }
+
+ template <typename T>
+ static inline void assign(P& point, const T& coor1, const T& coor2, const T& coor3)
+ {
+ assert_dimension<P, 3>();
+
+ typedef typename coordinate_type<P>::type TP;
+ set<0>(point, boost::numeric_cast<TP>(coor1));
+ set<1>(point, boost::numeric_cast<TP>(coor2));
+ set<2>(point, boost::numeric_cast<TP>(coor3));
+ }
+
+ static inline void assign_zero(P& point)
+ {
+ typedef typename coordinate_type<P>::type T;
+ impl::assign::assign_value(point, 0);
+ }
+
+ };
+
+ template <typename B>
+ struct assignment<box_tag, B>
+ {
+ typedef typename point_type<B>::type P;
+
+ // Here we assign 4 coordinates to a box.
+ // -> Most logical is: x1,y1,x2,y2
+ // In case the user reverses x1/x2 or y1/y2, we could reverse them (THAT IS NOT IMPLEMENTED)
+
+ // Note also comment in util/assign_box_corner ->
+ // ("Most logical is LOWER, UPPER and sub-order LEFT, RIGHT")
+ // (That is assigning 4 points from a box. So lower-left, lower-right, upper-left, upper-right)
+ template <typename T>
+ static inline void assign(B& box, const T& x1, const T& y1, const T& x2, const T& y2)
+ {
+ assert_dimension<B, 2>();
+
+ typedef typename coordinate_type<P>::type TB;
+ set<min_corner, 0>(box, boost::numeric_cast<TB>(x1));
+ set<min_corner, 1>(box, boost::numeric_cast<TB>(y1));
+ set<max_corner, 0>(box, boost::numeric_cast<TB>(x2));
+ set<max_corner, 1>(box, boost::numeric_cast<TB>(y2));
+ }
+
+
+ static inline void assign_inverse(B& box)
+ {
+ typedef typename coordinate_type<P>::type T;
+ static const size_t N = dimension<P>::value;
+ impl::assign::initialize<B, min_corner, 0, N>::init(box, boost::numeric::bounds<T>::highest());
+ impl::assign::initialize<B, max_corner, 0, N>::init(box, boost::numeric::bounds<T>::lowest());
+ }
+
+ static inline void assign_zero(B& box)
+ {
+ typedef typename coordinate_type<P>::type T;
+ static const size_t N = dimension<P>::value;
+ impl::assign::initialize<B, min_corner, 0, N>::init(box, T());
+ impl::assign::initialize<B, max_corner, 0, N>::init(box, T());
+ }
+
+ };
+
+
+ template <typename S>
+ struct assignment<nsphere_tag, S>
+ {
+ typedef typename point_type<S>::type P;
+
+ /// 2-value version for an n-sphere is valid for circle and sets the center
+ template <typename T>
+ static inline void assign(S& sphercle, const T& coor1, const T& coor2)
+ {
+ assert_dimension<S, 2>();
+
+ typedef typename coordinate_type<S>::type TS;
+
+ set<0>(sphercle, boost::numeric_cast<TS>(coor1));
+ set<1>(sphercle, boost::numeric_cast<TS>(coor2));
+ }
+
+
+ /// 3-value version for an n-sphere is sets the center of a sphere OR the center + radius of a circle
+ template <typename T>
+ static inline void assign(S& sphercle, const T& coor1, const T& coor2, const T& coor3_or_radius)
+ {
+ typedef typename coordinate_type<S>::type TS;
+ typedef typename coordinate_type<S>::type TR;
+ typedef typename radius_type<S>::type R;
+
+ set<0>(sphercle, boost::numeric_cast<TS>(coor1));
+ set<1>(sphercle, boost::numeric_cast<TS>(coor2));
+ switch(dimension<S>::value)
+ {
+ case 2 :
+ set_radius<0>(sphercle, boost::numeric_cast<R>(coor3_or_radius));
+ break;
+ case 3 :
+ set<2>(sphercle, boost::numeric_cast<TS>(coor3_or_radius));
+ break;
+ }
+ }
+
+ /// 4-value version for an n-sphere is valid for a sphere and sets the center and the radius
+ template <typename T>
+ static inline void assign(S& sphercle, const T& coor1, const T& coor2, const T& coor3, const T& radius)
+ {
+ assert_dimension<S, 3>();
+
+ typedef typename coordinate_type<S>::type TS;
+ typedef typename coordinate_type<S>::type TR;
+ typedef typename radius_type<S>::type R;
+
+ set<0>(sphercle, boost::numeric_cast<TS>(coor1));
+ set<1>(sphercle, boost::numeric_cast<TS>(coor2));
+ set<2>(sphercle, boost::numeric_cast<TS>(coor3));
+ set_radius<0>(sphercle, boost::numeric_cast<R>(radius));
+ }
+
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+
+
+
+
+
+ /*!
+ \brief assign two values to a 2D point
+ \ingroup access
+ */
+ template <typename G, typename T>
+ inline void assign(G& geometry, const T& coor1, const T& coor2)
+ {
+ dispatch::assignment<typename tag<G>::type, G>::assign(geometry, coor1, coor2);
+ }
+
+
+ /*!
+ \brief assign three values to a 3D point or the center + radius to a circle
+ \ingroup access
+ */
+ template <typename G, typename T>
+ inline void assign(G& geometry, const T& coor1, const T& coor2, const T& coor3)
+ {
+ dispatch::assignment<typename tag<G>::type, G>::assign(geometry, coor1, coor2, coor3);
+ }
+
+ /*!
+ \brief assign center + radius to a sphere
+ \ingroup access
+ */
+ template <typename G, typename T>
+ inline void assign(G& geometry, const T& coor1, const T& coor2, const T& coor3, const T& coor4)
+ {
+ dispatch::assignment<typename tag<G>::type, G>::assign(geometry, coor1, coor2, coor3, coor4);
+ }
+
+ /*!
+ \brief assign a range of points to a linestring, ring or polygon
+ \note The point-type of the range might be different from the point-type of the geometry
+ \ingroup access
+ */
+ template <typename G, typename R>
+ inline void assign(G& geometry, const R& range)
+ {
+ clear(geometry);
+ append(geometry, range, -1, 0);
+ }
+
+
+ /*!
+ \brief assign to a box inverse infinite
+ \details The assign_inverse function initialize a 2D or 3D box with large coordinates, the
+ min corner is very large, the max corner is very small. This is a convenient starting point to
+ collect the minimum bounding box of a geometry.
+ \ingroup access
+ */
+ template <typename G>
+ inline void assign_inverse(G& geometry)
+ {
+ dispatch::assignment<typename tag<G>::type, G>::assign_inverse(geometry);
+ }
+
+
+ /*!
+ \brief assign zero values to a box, point
+ \ingroup access
+ \details The assign_zero function initializes a 2D or 3D point or box with coordinates of zero
+ \tparam G the geometry type
+ */
+ template <typename G>
+ inline void assign_zero(G& geometry)
+ {
+ dispatch::assignment<typename tag<G>::type, G>::assign_zero(geometry);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_ASSIGN_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/buffer.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/buffer.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,154 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_BUFFER_HPP
+#define _GEOMETRY_BUFFER_HPP
+
+// Buffer functions
+// Was before: "grow" but then only for box
+// Now "buffer", but still only implemented for a box...
+
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/box_concept.hpp>
+
+#include <geometry/arithmetic/arithmetic.hpp>
+
+#include <geometry/util/assign_box_corner.hpp>
+#include <geometry/util/promotion_traits.hpp>
+
+
+/*!
+\defgroup buffer buffer calculation
+\par Source description:
+- OGC: Returns a geometric object that represents all Points whose distance
+ from this geometric object is less than or equal to distance. Calculations are in the spatial reference system of
+ this geometric object. Because of the limitations of linear interpolation, there will often be some relatively
+ small error in this distance, but it should be near the resolution of the coordinates used
+\see http://en.wikipedia.org/wiki/Buffer_(GIS)
+*/
+namespace geometry
+{
+
+
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace buffer
+ {
+
+ template <typename BOX_IN, typename BOX_OUT, typename T, size_t C, size_t D, size_t N>
+ struct box_loop
+ {
+ typedef typename coordinate_type<BOX_OUT>::type BT;
+
+ static inline void buffer(const BOX_IN& box_in, const T& distance, BOX_OUT& box_out)
+ {
+ set<C, D>(box_out, boost::numeric_cast<BT>(get<C, D>(box_in) + distance));
+ box_loop<BOX_IN, BOX_OUT, T, C, D + 1, N>::buffer(box_in, distance, box_out);
+ }
+ };
+
+ template <typename BOX_IN, typename BOX_OUT, typename T, size_t C, size_t N>
+ struct box_loop<BOX_IN, BOX_OUT, T, C, N, N>
+ {
+ static inline void buffer(const BOX_IN&, const T&, BOX_OUT&) {}
+ };
+
+
+ // Extends a box with the same amount in all directions
+ template<typename BOX_IN, typename BOX_OUT, typename T>
+ inline void buffer_box(const BOX_IN& box_in, const T& distance, BOX_OUT& box_out)
+ {
+ assert_dimension_equal<BOX_IN, BOX_OUT>();
+
+ static const size_t N = dimension<BOX_IN>::value;
+
+ box_loop<BOX_IN, BOX_OUT, T, min_corner, 0, N>::buffer(box_in, -distance, box_out);
+ box_loop<BOX_IN, BOX_OUT, T, max_corner, 0, N>::buffer(box_in, +distance, box_out);
+ }
+
+
+
+ } // namespace buffer
+ } // namespace impl
+ #endif
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG_IN, typename TAG_OUT, typename G_IN, typename T, typename G_OUT>
+ struct buffer {};
+
+
+ template <typename BOX_IN, typename T, typename BOX_OUT>
+ struct buffer<box_tag, box_tag, BOX_IN, T, BOX_OUT>
+ {
+ static inline void calculate(const BOX_IN& box_in, const T& distance, const T& chord_length, BOX_IN& box_out)
+ {
+ impl::buffer::buffer_box(box_in, distance, box_out);
+ }
+ };
+
+ // Many things to do. Point is easy, other geometries require self intersections
+ // For point, note that it should output as a polygon (like the rest). Buffers
+ // of a set of geometries are often lateron combined using a "dissolve" operation.
+ // Two points close to each other get a combined kidney shaped buffer then.
+
+
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Calculate buffer (= new geometry) around specified distance of geometry
+ \ingroup buffer
+ \param geometry_in input geometry
+ \param distance the distance used in buffer
+ \param chord_length length of the chord's in the generated arcs around points or bends
+ \param geometry_out buffered geometry
+ \note Currently only implemented for box, the trivial case, but still useful
+ \par Use case:
+ BOX + distance -> BOX: it is allowed that "geometry_out" the same object as "geometry_in"
+ */
+ template <typename G_IN, typename G_OUT, typename T>
+ inline void buffer(const G_IN& geometry_in, G_OUT& geometry_out, const T& distance, const T& chord_length = -1)
+ {
+ dispatch::buffer<typename tag<G_IN>::type,
+ typename tag<G_OUT>::type,
+ G_IN, T, G_OUT>::calculate(geometry_in, distance, chord_length, geometry_out);
+ }
+
+
+ /*!
+ \brief Calculate and return buffer (= new geometry) around specified distance of geometry
+ \ingroup buffer
+ \param geometry input geometry
+ \param distance the distance used in buffer
+ \param chord_length length of the chord's in the generated arcs around points or bends
+ \return the buffered geometry
+ \note See also: buffer
+ */
+ template <typename G_OUT, typename G_IN, typename T>
+ G_OUT make_buffer(const G_IN& geometry, const T& distance, const T& chord_length = -1)
+ {
+ G_OUT out;
+ dispatch::buffer<typename tag<G_IN>::type,
+ typename tag<G_OUT>::type,
+ G_IN, T, G_OUT>::calculate(geometry, distance, chord_length, out);
+ return out;
+ }
+
+};
+
+#endif // _GEOMETRY_BUFFER_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/centroid.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/centroid.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,271 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CENTROID_HPP
+#define _GEOMETRY_CENTROID_HPP
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/util/copy.hpp>
+#include <geometry/util/loop.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+/*!
+\defgroup centroid centroid calculation
+\par Source descriptions:
+- OGC description: The mathematical centroid for this Surface as a Point. The result is not guaranteed to be on this Surface.
+- From Wikipedia: Informally, it is the "average" of all points
+\see http://en.wikipedia.org/wiki/Centroid
+\note The "centroid" functions are taking a non const reference to the centroid. The "make_centroid" functions
+ return the centroid, the type has to be specified.
+
+\note There are versions where the centroid calculation strategy can be specified
+\par Geometries:
+- RING: \image html centroid_ring.png
+- BOX: the centroid of a 2D or 3D box is the center of the box
+- CIRCLE: the centroid of a circle or a sphere is its center
+- POLYGON \image html centroid_polygon.png
+- POINT, LINESTRING, SEGMENT: trying to calculate the centroid will result in a compilation error
+*/
+
+namespace geometry
+{
+ // Move elsewhere?
+ class centroid_exception : public std::exception
+ {
+ public:
+ centroid_exception() {}
+ virtual const char *what() const throw()
+ {
+ return "centroid calculation exception";
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+
+ namespace centroid
+ {
+
+ /*!
+ \brief Generic function which checks if enough points are present
+ */
+ template<typename P, typename R>
+ inline bool ring_ok(const R& ring, P& c)
+ {
+ size_t n = boost::size(ring);
+ if (n == 1)
+ {
+ // Take over the first point in a "coordinate neutral way"
+ copy_coordinates(ring.front(), c);
+ return false;
+ }
+ else if (n <= 0)
+ {
+ throw centroid_exception();
+ }
+ return true;
+ }
+
+
+ /*!
+ \brief Calculate the centroid of a ring.
+ */
+ template<typename P, typename R, typename S>
+ inline void centroid_ring(const R& ring, P& c, const S& strategy)
+ {
+ if (ring_ok(ring, c))
+ {
+ typename S::state_type state;
+ loop(ring, strategy, state);
+ state.centroid(c);
+ }
+ }
+
+ /*!
+ \brief Centroid of a polygon.
+ \note Because outer ring is clockwise, inners are counter clockwise,
+ triangle approach is OK and works for polygons with rings.
+ */
+ template<typename P, typename Y, typename S>
+ inline void centroid_polygon(const Y& poly, P& c, const S& strategy)
+ {
+ if (ring_ok(exterior_ring(poly), c))
+ {
+ typename S::state_type state;
+ loop(exterior_ring(poly), strategy, state);
+ typedef typename boost::range_const_iterator<typename interior_type<Y>::type>::type IT;
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ loop(*it, strategy, state);
+ }
+ state.centroid(c);
+ }
+ }
+
+
+ /*!
+ \brief Calculate centroid (==center) of a box
+ \todo Implement strategy
+ */
+ template<typename P, typename B>
+ inline void centroid_box(const B& box, P& c)
+ {
+ // TODO: adapt using strategies
+ assert_dimension<B, 2>();
+ set<0>(c, (get<min_corner, 0>(box) + get<max_corner, 0>(box)) / 2);
+ set<1>(c, (get<min_corner, 1>(box) + get<max_corner, 1>(box)) / 2);
+ }
+
+
+ } // namespace centroid
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G, typename P>
+ struct centroid {};
+
+
+ template <typename B, typename P>
+ struct centroid<box_tag, B, P>
+ {
+ inline static void calculate(const B& b, P& c)
+ {
+ impl::centroid::centroid_box<P>(b, c);
+ }
+ };
+
+
+
+ template <typename R, typename P>
+ struct centroid<ring_tag, R, P>
+ {
+
+ inline static void calculate(const R& ring, P& c)
+ {
+ impl::centroid::centroid_ring(ring, c,
+ typename strategy_centroid<typename cs_tag<P>::type,
+ P, typename boost::range_value<R>::type>::type());
+ }
+ };
+
+ template <typename Y, typename P>
+ struct centroid<polygon_tag, Y, P>
+ {
+ inline static void calculate(const Y& poly, P& c)
+ {
+ impl::centroid::centroid_polygon(poly, c,
+ typename strategy_centroid<typename cs_tag<P>::type,
+ P, typename point_type<Y>::type>::type());
+ }
+
+
+ template<typename S>
+ inline static void calculate(const Y& poly, P& c, const S& strategy)
+ {
+ impl::centroid::centroid_polygon(poly, c, strategy);
+ }
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+
+ /*!
+ \brief Calculate centroid
+ \ingroup centroid
+ \details The function centroid calculates the centroid of a geometry using the default strategy.
+ A polygon should be closed and orientated clockwise, holes, if any, must be orientated
+ counter clockwise
+ \param geometry a geometry (e.g. closed ring or polygon)
+ \param c reference to point which will contain the centroid
+ \exception centroid_exception if calculation is not successful, e.g. because polygon didn't contain points
+ \par Example:
+ Example showing centroid calculation
+ \dontinclude doxygen_examples.cpp
+ \skip example_centroid_polygon
+ \line {
+ \until }
+ */
+ template<typename G, typename P>
+ inline void centroid(const G& geometry, P& c)
+ {
+ dispatch::centroid<typename tag<G>::type, G, P>::calculate(geometry, c);
+ }
+
+ /*!
+ \brief Calculate centroid using a specified strategy
+ \ingroup centroid
+ \param geometry the geometry to calculate centroid from
+ \param c reference to point which will contain the centroid
+ \param strategy Calculation strategy for centroid
+ \exception centroid_exception if calculation is not successful, e.g. because polygon didn't contain points
+ */
+ template<typename G, typename P, typename S>
+ inline void centroid(const G& geometry, P& c, const S& strategy)
+ {
+ dispatch::centroid<typename tag<G>::type, G, P>::calculate(geometry, c, strategy);
+ }
+
+
+ // Versions returning a centroid
+
+ /*!
+ \brief Calculate and return centroid
+ \ingroup centroid
+ \param geometry the geometry to calculate centroid from
+ \return the centroid
+ \exception centroid_exception if calculation is not successful, e.g. because polygon didn't contain points
+ */
+ template<typename P, typename G>
+ inline P make_centroid(const G& geometry)
+ {
+ P c;
+ dispatch::centroid<typename tag<G>::type, G, P>::calculate(geometry, c);
+ return c;
+ }
+
+ /*!
+ \brief Calculate and return centroid
+ \ingroup centroid
+ \param geometry the geometry to calculate centroid from
+ \param strategy Calculation strategy for centroid
+ \return the centroid
+ \exception centroid_exception if calculation is not successful, e.g. because polygon didn't contain points
+ */
+ template<typename P, typename G, typename S>
+ inline P make_centroid(const G& geometry, const S& strategy)
+ {
+ P c;
+ dispatch::centroid<typename tag<G>::type, G, P>::calculate(geometry, c, strategy);
+ return c;
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_CENTROID_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/clear.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/clear.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,133 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CLEAR_HPP
+#define _GEOMETRY_CLEAR_HPP
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+
+
+namespace geometry
+{
+
+ // This traits is currently NOT defined in ../core/ but here, just because it default
+ // does not have to be implemented
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class, optional, might be implemented to clear a geometry
+ \details If a geometry type should not use the std ".clear()" then it can specialize
+ the "use_std" traits class to false, it should then implement (a.o.) clear
+ \ingroup traits
+ \par Geometries:
+ - linestring
+ - linear_ring
+ \par Specializations should provide:
+ - run
+ */
+ template <typename G>
+ struct clear
+ {
+ };
+ }
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename G>
+ struct use_std_clear
+ {
+ static inline void run(G& geometry)
+ {
+ geometry.clear();
+ }
+ };
+
+ template <typename G>
+ struct use_traits_clear
+ {
+ static inline void run(G& geometry)
+ {
+ traits::clear<G>::run(geometry);
+ }
+ };
+
+
+ template <typename P>
+ struct polygon_clear
+ {
+ static inline void run(P& polygon)
+ {
+ interior_rings(polygon).clear();
+ exterior_ring(polygon).clear();
+ }
+ };
+
+
+ } // namespace impl
+ #endif
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, bool STD, typename G>
+ struct clear {};
+
+
+ // True (default for all geometry types, unless otherwise implemented in traits)
+ // uses std::clear
+ template <typename TAG, typename G>
+ struct clear<TAG, true, G> : impl::use_std_clear<G> {};
+
+
+ // If any geometry specializes use_std<G> to false, specialize to use the traits clear.
+ template <typename TAG, typename G>
+ struct clear<TAG, false, G> : impl::use_traits_clear<G> {};
+
+
+ // Point/box/nsphere/segment do not have clear. So specialize to do nothing.
+ template <typename G> struct clear<point_tag, true, G> {};
+ template <typename G> struct clear<box_tag, true, G> {};
+ template <typename G> struct clear<segment_tag, true, G> {};
+ template <typename G> struct clear<nsphere_tag, true, G> {};
+
+
+ // Polygon can (indirectly) use std for clear
+ template <typename P>
+ struct clear<polygon_tag, true, P> : impl::polygon_clear<P> {};
+
+
+ } // namespace dispatch
+ #endif
+
+
+
+ /*!
+ \brief Clears a linestring, linear ring or polygon (exterior+interiors) or multi*
+ \details Generic function to clear a geometry
+ \ingroup access
+ \note points and boxes cannot be cleared, instead they can be set to zero by "assign_zero"
+ */
+ template <typename G>
+ inline void clear(G& geometry)
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ dispatch::clear<typename tag<G>::type, traits::use_std<NCG>::value, NCG>::run(geometry);
+ }
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/algorithms/combine.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/combine.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,170 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_COMBINE_HPP
+#define _GEOMETRY_COMBINE_HPP
+
+
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/box_concept.hpp>
+
+#include <geometry/arithmetic/arithmetic.hpp>
+
+#include <geometry/util/assign_box_corner.hpp>
+#include <geometry/util/promotion_traits.hpp>
+
+/*!
+\defgroup combine combine: add a geometry to a bounding box
+\par Geometries:
+- BOX + BOX -> BOX: the box will be combined with the other box \image html combine_box_box.png
+- BOX + POINT -> BOX: the box will combined with the point \image html combine_box_point.png
+\note Previously called "grow"
+*/
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace combine
+ {
+
+ template <typename B, typename P, size_t D, size_t N>
+ struct point_loop
+ {
+ static inline void check(B& box, const P& source)
+ {
+ typedef typename coordinate_type<P>::type T;
+ const T& coordinate = get<D>(source);
+
+ if (coordinate < get<min_corner, D>(box))
+ {
+ set<min_corner, D>(box, coordinate);
+ }
+ if (coordinate > get<max_corner, D>(box))
+ {
+ set<max_corner, D>(box, coordinate);
+ }
+
+ point_loop<B, P, D + 1, N>::check(box, source);
+ }
+ };
+
+ template <typename B, typename P, size_t N>
+ struct point_loop<B, P, N, N>
+ {
+ static inline void check(B&, const P&) {}
+ };
+
+
+ template <typename B1, typename B2, size_t C, size_t D, size_t N>
+ struct box_loop
+ {
+ typedef typename select_coordinate_type<B1, B2>::type T;
+
+ static inline void run(B1& box, const B2& source)
+ {
+ T coordinate = get<C, D>(source);
+
+ if (coordinate < get<min_corner, D>(box))
+ {
+ set<min_corner, D>(box, coordinate);
+ }
+ if (coordinate > get<max_corner, D>(box))
+ {
+ set<max_corner, D>(box, coordinate);
+ }
+
+ box_loop<B1, B2, C, D + 1, N>::run(box, source);
+ }
+ };
+
+ template <typename B1, typename B2, size_t C, size_t N>
+ struct box_loop<B1, B2, C, N, N>
+ {
+ static inline void run(B1&, const B2&) {}
+ };
+
+
+ // Changes a box b such that it also contains point p
+ template<typename B, typename P>
+ inline void combine_box_with_point(B& b, const P& p)
+ {
+ point_loop<B, P, 0, dimension<P>::value>::check(b, p);
+ }
+
+ // Changes a box such that the other box is also contained by the box
+ template<typename B1, typename B2>
+ inline void combine_box_with_box(B1& b, const B2& other)
+ {
+ typedef typename point_type<B2>::type P;
+ box_loop<B1, B2, min_corner, 0, dimension<P>::value>::run(b, other);
+ box_loop<B1, B2, max_corner, 0, dimension<P>::value>::run(b, other);
+ }
+
+
+
+ } // namespace combine
+ } // namespace impl
+ #endif
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename B, typename G>
+ struct combine
+ {
+ };
+
+
+ // Box + point -> new box containing also point
+ // Currently implemented for boxes of same type
+ template <typename B, typename P>
+ struct combine<point_tag, B, P>
+ {
+ static inline void calculate(B& box_out, const P& point)
+ {
+ impl::combine::combine_box_with_point(box_out, point);
+ }
+ };
+
+ // Box + box -> new box just containing two input boxes
+ template <typename B, typename B_IN>
+ struct combine<box_tag, B, B_IN>
+ {
+ static inline void calculate(B& box_out, const B_IN& box)
+ {
+ impl::combine::combine_box_with_box(box_out, box);
+ }
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Combines a box with another geometry (box, point)
+ \ingroup combine
+ \tparam B type of first geometry
+ \tparam G type of second geometry
+ \tparam G3 type of output geometry
+ \param box box to combine another geometry with, might be changed
+ \param geometry other geometry
+ */
+ template <typename B, typename G>
+ inline void combine(B& box, const G& geometry)
+ {
+ dispatch::combine<typename tag<G>::type, B, G>::calculate(box, geometry);
+ }
+
+};
+
+#endif // _GEOMETRY_COMBINE_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/convert.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/convert.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,158 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CONVERT_HPP
+#define _GEOMETRY_CONVERT_HPP
+
+#include <cmath>
+#include <iterator>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/cs.hpp>
+
+#include <geometry/geometries/segment.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+#include <geometry/algorithms/append.hpp>
+#include <geometry/algorithms/foreach.hpp>
+
+
+/*!
+\defgroup convert convert geometries from one type to another
+\details Convert from one geometry type to another type, for example from BOX to POLYGON
+*/
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace convert
+ {
+
+ template <typename P, typename B, size_t C, size_t D, size_t N>
+ struct point_to_box
+ {
+ static inline void loop(const P& point, B& box)
+ {
+ typedef typename coordinate_type<B>::type T;
+ set<C, D>(box, boost::numeric_cast<T>(get<D>(point)));
+ point_to_box<P, B, C, D + 1, N>::loop(point, box);
+ }
+ };
+
+ template <typename P, typename B, size_t C, size_t N>
+ struct point_to_box<P, B, C, N, N>
+ {
+ static inline void loop(const P& point, B& box)
+ {}
+ };
+
+
+ } // namespace convert
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG1, typename TAG2, typename G1, typename G2>
+ struct convert
+ {
+ };
+
+ template <typename TAG, typename G1, typename G2>
+ struct convert<TAG, TAG, G1, G2>
+ {
+ // Same geometry type -> copy coordinates from G1 to G2
+ };
+
+ template <typename TAG, typename G>
+ struct convert<TAG, TAG, G, G>
+ {
+ // Same geometry -> can be copied
+ };
+
+
+ // Partial specializations
+ template <typename B, typename R>
+ struct convert<box_tag, ring_tag, B, R>
+ {
+ inline static void calculate(const B& box, R& ring)
+ {
+ // go from box to ring -> add coordinates in correct order
+ // only valid for 2D
+ assert_dimension<B, 2>();
+
+ ring.clear();
+ typename point_type<B>::type p;
+
+ assign(p, get<min_corner, 0>(box), get<min_corner, 1>(box));
+ geometry::append(ring, p);
+
+ assign(p, get<min_corner, 0>(box), get<max_corner, 1>(box));
+ geometry::append(ring, p);
+
+ assign(p, get<max_corner, 0>(box), get<max_corner, 1>(box));
+ geometry::append(ring, p);
+
+ assign(p, get<max_corner, 0>(box), get<min_corner, 1>(box));
+ geometry::append(ring, p);
+
+ assign(p, get<min_corner, 0>(box), get<min_corner, 1>(box));
+ geometry::append(ring, p);
+ }
+ };
+
+ template <typename P, typename B>
+ struct convert<point_tag, box_tag, P, B>
+ {
+ inline static void calculate(const P& point, B& box)
+ {
+ // go from point to box -> box with volume of zero, 2D or 3D
+ static const size_t N = dimension<P>::value;
+ impl::convert::point_to_box<P, B, min_corner, 0, N>::loop(point, box);
+ impl::convert::point_to_box<P, B, max_corner, 0, N>::loop(point, box);
+ }
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+
+
+
+
+ /*!
+ \brief Converts one geometry to another geometry
+ \details The convert algorithm converts one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only
+ if it is possible and applicable.
+ \ingroup convert
+ \tparam G1 first geometry type
+ \tparam G2 second geometry type
+ \param geometry1 first geometry
+ \param geometry2 second geometry
+ */
+ template <typename G1, typename G2>
+ inline void convert(const G1& geometry1, G2& geometry2)
+ {
+ dispatch::convert<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2);
+ }
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_CONVERT_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/convex_hull.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/convex_hull.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,113 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CONVEX_HULL_HPP
+#define _GEOMETRY_CONVEX_HULL_HPP
+
+#include <boost/concept/requires.hpp>
+
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/cs.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+
+/*!
+\defgroup convex_hull convex hull calculation
+\par Source descriptions:
+- OGC description: Returns a geometric object that represents the convex hull of this geometric
+ object. Convex hulls, being dependent on straight lines, can be accurately represented in linear interpolations
+ for any geometry restricted to linear interpolations.
+\see http://en.wikipedia.org/wiki/Convex_hull
+
+\par Performance
+2776 counties of US are "hulled" in 0.52 seconds (other libraries: 2.8 seconds, 2.4 seconds, 3.4 seconds, 1.1 seconds)
+
+\note The convex hull is always a ring, holes are not possible. Therefore it is modelled as an output iterator.
+This gives the most flexibility, the user can decide what to do with it.
+\par Geometries:
+In the images below the convex hull is painted in red.
+- POINT: will not compile
+- POLYGON: will deliver a polygon without holes \image html convexhull_polygon_polygon.png
+*/
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace convex_hull
+ {
+ template <typename R, typename O_IT>
+ struct convex_hull_range
+ {
+ static inline O_IT calculate(const R& range, O_IT out)
+ {
+ typedef typename point_type<R>::type P;
+ typedef typename strategy_convex_hull<typename cs_tag<P>::type, P>::type strategy;
+ strategy s(range);
+ s.get(out);
+ return out;
+ }
+ };
+ }
+
+ }
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG, typename G, typename O_IT>
+ struct convex_hull {};
+
+
+ template <typename L, typename O_IT>
+ struct convex_hull<linestring_tag, L, O_IT> : impl::convex_hull::convex_hull_range<L, O_IT> {};
+
+
+ template <typename R, typename O_IT>
+ struct convex_hull<ring_tag, R, O_IT> : impl::convex_hull::convex_hull_range<R, O_IT> {};
+
+
+ template <typename P, typename O_IT>
+ struct convex_hull<polygon_tag, P, O_IT>
+ {
+ static inline O_IT calculate(const P& poly, O_IT out)
+ {
+ // Checking outer ring is sufficient for convex hull of polygon, holes are not relevant
+ typedef typename ring_type<P>::type R;
+ return impl::convex_hull::convex_hull_range<R, O_IT>::calculate(exterior_ring(poly), out);
+ }
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+ /*!
+ \brief Calculate the convex hull of a geometry
+ \ingroup convex_hull
+ \param geometry the geometry to calculate convex hull from
+ \param out an output iterator outputing points of the convex hull
+ \return the output iterator
+ */
+ template<typename G, typename O_IT>
+ inline O_IT convex_hull(const G& geometry, O_IT out)
+ {
+ return dispatch::convex_hull<typename tag<G>::type, G, O_IT>::calculate(geometry, out);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_CONVEX_HULL_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/correct.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/correct.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,156 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CORRECT_HPP
+#define _GEOMETRY_CORRECT_HPP
+
+#include <algorithm>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/ring_type.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/algorithms/area.hpp>
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace correct
+ {
+ // correct an box: make min/max are correct
+ template <typename B>
+ inline void correct_box(B& b)
+ {
+ // Currently only for Cartesian coordinates
+ // TODO: adapt using strategies
+ // TODO: adapt using traits
+ typedef typename coordinate_type<B>::type T;
+ if (get<min_corner, 0>(b) > get<max_corner, 0>(b))
+ {
+ T max_value = get<min_corner, 0>(b);
+ T min_value = get<max_corner, 0>(b);
+ set<min_corner, 0>(b, min_value);
+ set<max_corner, 0>(b, max_value);
+ }
+ if (get<min_corner, 1>(b) > get<max_corner, 1>(b))
+ {
+ T max_value = get<min_corner, 1>(b);
+ T min_value = get<max_corner, 1>(b);
+ set<min_corner, 1>(b, min_value);
+ set<max_corner, 1>(b, max_value);
+ }
+ }
+
+ // close a linear_ring, if not closed
+ template <typename R>
+ inline void ensure_closed_ring(R& r)
+ {
+ if (boost::size(r) > 2)
+ {
+ // check if closed, if not, close it
+ if (r.front() != r.back())
+ {
+ r.push_back(r.front());
+ }
+ }
+ }
+
+
+ // correct a polygon: normalizes all rings, sets outer linear_ring clockwise, sets all
+ // inner rings counter clockwise
+ template <typename Y>
+ inline void correct_polygon(Y& poly)
+ {
+ typename ring_type<Y>::type& outer = exterior_ring(poly);
+ ensure_closed_ring(outer);
+
+ typedef typename point_type<Y>::type P;
+ typename strategy_area<typename cs_tag<P>::type, P>::type strategy;
+
+ if (impl::area::area_ring(outer, strategy) < 0)
+ {
+ std::reverse(boost::begin(outer), boost::end(outer));
+ }
+
+ typedef typename boost::range_iterator<typename interior_type<Y>::type>::type IT;
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ ensure_closed_ring(*it);
+ if (impl::area::area_ring(*it, strategy) > 0)
+ {
+ std::reverse(boost::begin(*it), boost::end(*it));
+ }
+ }
+ }
+
+
+ }
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG, typename G>
+ struct correct {};
+
+
+ template <typename B>
+ struct correct<box_tag, B>
+ {
+ static inline void calculate(B& box)
+ {
+ impl::correct::correct_box(box);
+ }
+ };
+
+ template <typename R>
+ struct correct<ring_tag, R>
+ {
+ static inline void calculate(R& ring)
+ {
+ impl::correct::ensure_closed_ring(ring);
+ }
+ };
+
+ template <typename P>
+ struct correct<polygon_tag, P>
+ {
+ static inline void calculate(P& poly)
+ {
+ impl::correct::correct_polygon(poly);
+ }
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+
+ template <typename G>
+ inline void correct(G& geometry)
+ {
+ dispatch::correct<typename tag<G>::type, G>::calculate(geometry);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_CORRECT_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/distance.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/distance.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,289 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_DISTANCE_HPP
+#define _GEOMETRY_DISTANCE_HPP
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/cs.hpp>
+
+#include <geometry/geometries/segment.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+#include <geometry/strategies/distance_result.hpp>
+#include <geometry/util/promotion_traits.hpp>
+
+
+/*!
+\defgroup distance distance calculation
+The distance algorithm returns the distance between two geometries.
+\par Coordinate systems and strategies:
+With help of strategies the distance function returns the appropriate distance.
+If the input is in cartesian coordinates, the Euclidian distance (Pythagoras) is calculated.
+If the input is in spherical coordinates (either degree or radian), the distance over the sphere is returned.
+If the input is in geographic coordinates, distance is calculated over the globe and returned in meters.
+
+\par Distance result:
+Depending on calculation type the distance result is either a structure, convertable
+to a double, or a double value. In case of Pythagoras it makes sense to not draw the square root in the
+strategy itself. Taking a square root is relative expensive and is not necessary when comparing distances.
+
+\par Geometries:
+Currently implemented, for both cartesian and spherical/geographic:
+- POINT - POINT
+- POINT - SEGMENT and v.v.
+- POINT - LINESTRING and v.v.
+
+Not yet implemented:
+- POINT - RING etc, note that it will return a zero if the point is anywhere within the ring
+
+\par Example:
+Example showing distance calculation of two points, in xy and in latlong coordinates
+\dontinclude doxygen_examples.cpp
+\skip example_distance_point_point
+\line {
+\until }
+*/
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace distance
+ {
+ template <typename P1, typename P2, typename S>
+ inline typename S::return_type point_to_point(const P1& p1, const P2& p2, const S& strategy)
+ {
+ return strategy(p1, p2);
+ }
+
+ template<typename P, typename SEG, typename STR>
+ inline typename STR::return_type point_to_segment(const P& point, const SEG& segment, const STR& strategy)
+ {
+ return strategy(point, segment);
+ }
+
+ template<typename P, typename SEG>
+ inline typename distance_result<P, SEG>::type point_to_segment(const P& point, const SEG& segment)
+ {
+ typename strategy_distance_segment<
+ typename cs_tag<P>::type,
+ typename cs_tag<SEG>::type,
+ P, SEG>::type strategy;
+ return strategy(point, segment);
+ }
+
+ template<typename P, typename L, typename S>
+ inline typename S::return_type point_to_linestring(const P& point, const L& linestring, const S& strategy)
+ {
+ typedef typename select_coordinate_type<P, typename boost::range_value<L>::type>::type T;
+ typedef typename S::return_type RET;
+
+ if (boost::begin(linestring) == boost::end(linestring))
+ {
+ return RET(0);
+ }
+
+ // line of one point: return point square_distance
+ typedef typename boost::range_const_iterator<L>::type IT;
+ IT it = boost::begin(linestring);
+ IT prev = it++;
+ if (it == boost::end(linestring))
+ {
+ typename S::distance_strategy_type pp;
+ return pp(point, *boost::begin(linestring));
+ }
+
+ typedef segment<const typename point_type<L>::type> CS;
+
+ // start with first segment distance
+ S f2;
+ RET d = f2(point, CS(*prev, *it));
+
+ // check if other segments are closer
+ prev = it++;
+ while(it != boost::end(linestring))
+ {
+ RET ds = f2(point, CS(*prev, *it));
+ if (close_to_zero(ds))
+ {
+ return RET(0);
+ }
+ else if (ds < d)
+ {
+ d = ds;
+ }
+ prev = it++;
+ }
+ return d;
+ }
+
+ template<typename P, typename L>
+ inline typename distance_result<P, L>::type point_to_linestring(const P& point, const L& linestring)
+ {
+ typedef typename point_type<L>::type LP;
+ typedef segment<const LP> SEG; // helper geometry
+ typedef typename strategy_distance_segment<
+ typename cs_tag<P>::type,
+ typename cs_tag<LP>::type,
+ P, SEG>::type STRATEGY;
+
+ STRATEGY strategy;
+ return point_to_linestring(point, linestring, strategy);
+ }
+
+
+
+ } // namespace distance
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG1, typename TAG2, typename G1, typename G2>
+ struct distance
+ {
+ };
+
+ template <typename P1, typename P2>
+ struct distance<point_tag, point_tag, P1, P2>
+ {
+ template <typename S>
+ static inline typename S::return_type calculate(const P1& p1, const P2& p2, const S& strategy)
+ {
+ return impl::distance::point_to_point(p1, p2, strategy);
+ }
+
+ static inline typename distance_result<P1, P2>::type
+ calculate(const P1& p1, const P2& p2)
+ {
+ return impl::distance::point_to_point(p1, p2,
+ typename strategy_distance<
+ typename cs_tag<P1>::type,
+ typename cs_tag<P2>::type,
+ P1, P2>::type());
+ }
+ };
+
+ template <typename P, typename L>
+ struct distance<point_tag, linestring_tag, P, L>
+ {
+ template<typename S>
+ static inline typename S::return_type calculate(const P& point, const L& linestring, const S& strategy)
+ {
+ return impl::distance::point_to_linestring(point, linestring, strategy);
+ }
+ static inline typename distance_result<P, L>::type calculate(const P& point, const L& linestring)
+ {
+ return impl::distance::point_to_linestring(point, linestring);
+ }
+ };
+
+ template <typename L, typename P>
+ struct distance<linestring_tag, point_tag, L, P>
+ {
+ template<typename S>
+ static inline typename S::return_type calculate(const L& linestring, const P& point, const S& strategy)
+ {
+ return impl::distance::point_to_linestring(point, linestring, strategy);
+ }
+ static inline typename distance_result<P, L>::type calculate(const L& linestring, const P& point)
+ {
+ return impl::distance::point_to_linestring(point, linestring);
+ }
+ };
+
+ template <typename P, typename SEG>
+ struct distance<point_tag, segment_tag, P, SEG>
+ {
+ template<typename STR>
+ static inline typename STR::return_type calculate(const P& point, const SEG& segment, const STR& strategy)
+ {
+ return impl::distance::point_to_segment(point, segment, strategy);
+ }
+ static inline typename distance_result<P, SEG>::type calculate(const P& point, const SEG& segment)
+ {
+ return impl::distance::point_to_segment(point, segment);
+ }
+ };
+
+ template <typename SEG, typename P>
+ struct distance<segment_tag, point_tag, SEG, P>
+ {
+ template<typename STR>
+ static inline typename STR::return_type calculate(const SEG& segment, const P& point, const STR& strategy)
+ {
+ return impl::distance::point_to_segment(point, segment, strategy);
+ }
+ static inline typename distance_result<P, SEG>::type calculate(const SEG& segment, const P& point)
+ {
+ return impl::distance::point_to_segment(point, segment);
+ }
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Calculate distance between two geometries
+ \ingroup distance
+ \details The default strategy is used, belonging to the corresponding coordinate system of the geometries
+ \tparam G1 first geometry type
+ \tparam G2 second geometry type
+ \param geometry1 first geometry
+ \param geometry2 second geometry
+ \return the distance (either a double or a distance result, convertable to double)
+ */
+ template <typename G1, typename G2>
+ inline typename distance_result<G1, G2>::type
+ distance(const G1& geometry1, const G2& geometry2)
+ {
+ return dispatch::distance<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2);
+ }
+
+ /*!
+ \brief Calculate distance between two geometries with a specified strategy
+ \ingroup distance
+ \tparam G1 first geometry type
+ \tparam G2 second geometry type
+ \tparam S point-point-distance strategy type
+ \param geometry1 first geometry
+ \param geometry2 second geometry
+ \param strategy strategy to calculate distance between two points
+ \return the distance (either a double or a distance result, convertable to double)
+ \par Example:
+ Example showing distance calculation of two lat long points, using the accurate Vincenty approximation
+ \dontinclude doxygen_examples.cpp
+ \skip example_distance_point_point_strategy
+ \line {
+ \until }
+ */
+ template <typename G1, typename G2, typename S>
+ inline typename S::return_type distance(const G1& geometry1, const G2& geometry2, const S& strategy)
+ {
+ return dispatch::distance<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2, strategy);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_DISTANCE_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/envelope.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/envelope.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,317 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_ENVELOPE_HPP
+#define _GEOMETRY_ENVELOPE_HPP
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <boost/numeric/conversion/cast.hpp>
+
+
+#include <geometry/core/cs.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/box_concept.hpp>
+#include <geometry/core/concepts/nsphere_concept.hpp>
+#include <geometry/core/concepts/linestring_concept.hpp>
+#include <geometry/core/concepts/ring_concept.hpp>
+#include <geometry/core/concepts/polygon_concept.hpp>
+
+#include <geometry/core/exterior_ring.hpp>
+
+#include <geometry/algorithms/convert.hpp>
+
+
+
+#include <geometry/strategies/strategies.hpp>
+
+
+/*!
+\defgroup envelope envelope calculation
+\par Source descriptions:
+- OGC: Envelope (): Geometry - The minimum bounding box for this Geometry,
+ returned as a Geometry. The polygon is defined by the corner points of the bounding
+ box [(MINX, MINY), (MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)].
+
+\note Implemented in the Geometry library: The minimum bounding box, always as a box, having min <= max
+
+The envelope algorithm calculates the bounding box, or envelope, of a geometry. There are two versions:
+- envelope, taking a reference to a box as second parameter
+- make_envelope, returning a newly constructed box (type as a template parameter in the function call)
+- either of them has an optional strategy
+
+\par Geometries:
+- POINT: a box with zero area, the maximum and the minimum point of the box are
+set to the point itself.
+- LINESTRING, RING or RANGE is the smallest box that contains all points of the specified
+point sequence.
+If the linestring is empty, the envelope is the inverse infinite box, that is, the minimum point is very
+large (max infinite) and the maximum point is very small (min infinite).
+- POLYGON, the envelope of the outer ring
+ \image html envelope_polygon.png
+
+\par Example:
+Example showing envelope calculation
+\dontinclude doxygen_examples.cpp
+\skip example_envelope_linestring
+\line {
+\until }
+
+
+*/
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace envelope
+ {
+
+ /// Calculate envelope of an n-sphere, circle or sphere (currently only for Cartesian 2D points)
+ template<typename B, typename S>
+ inline void envelope_nsphere(const S& s, B& mbr)
+ {
+ assert_dimension<S, 2>;
+ assert_dimension<B, 2>;
+
+ typename radius_type<S>::type r = get_radius<0>(s);
+ set<min_corner, 0>(mbr, get<0>(s) - r);
+ set<min_corner, 1>(mbr, get<1>(s) - r);
+ set<max_corner, 0>(mbr, get<0>(s) + r);
+ set<max_corner, 1>(mbr, get<1>(s) + r);
+ }
+
+ /// Calculate envelope of an 2D or 3D point
+ template<typename B, typename P>
+ inline void envelope_point(const P& p, B& b)
+ {
+ // Envelope of a point is an empty box, a box with zero volume, located at the point.
+ // We just user the convert algorithm here
+ geometry::convert(p, b);
+ }
+
+ /// Version with state iterating through range (also used in multi*)
+ template<typename R, typename S>
+ inline void envelope_range_state(const R& range, const S& strategy, typename S::state_type& state)
+ {
+ typedef typename boost::range_const_iterator<R>::type IT;
+ for (IT it = boost::begin(range); it != boost::end(range); it++)
+ {
+ strategy(*it, state);
+ }
+ }
+
+
+ /// Version with strategy, calling state
+ template<typename B, typename R, typename S>
+ inline void envelope_range_strategy(const R& range, B& mbr, const S& strategy)
+ {
+ typename S::state_type state(mbr);
+ envelope_range_state(range, strategy, state);
+ }
+
+
+ /// Generic range dispatching struct
+ template <typename R, typename B>
+ struct envelope_range
+ {
+ /// Calculate envelope of range using a strategy
+ template<typename S>
+ static inline void calculate(const R& range, B& b, const S& strategy)
+ {
+ envelope_range_strategy(range, b, strategy);
+ }
+
+
+ /// Calculate envelope of range
+ static inline void calculate(const R& range, B& b)
+ {
+ typedef typename point_type<B>::type PB;
+ typedef typename point_type<R>::type PR;
+ typename strategy_envelope<
+ typename cs_tag<PR>::type,
+ typename cs_tag<PB>::type, PR, B>::type strategy;
+
+ calculate (range, b, strategy);
+ }
+ };
+
+
+
+ } // namespace envelope
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG1, typename TAG2, typename G, typename B>
+ struct envelope {};
+
+ template <typename P, typename B>
+ struct envelope<point_tag, box_tag, P, B>
+ {
+ /*!
+ \brief Calculate envelope of a point
+ \details The envelope of a point is a box containing just the point itself. It is provided
+ for consistence, on itself it is not useful.
+ */
+ static inline void calculate(const P& p, B& b)
+ {
+ impl::envelope::envelope_point(p, b);
+ }
+ private :
+ BOOST_CONCEPT_ASSERT((ConstPoint<P>));
+ BOOST_CONCEPT_ASSERT((Box<B>));
+ };
+
+
+ template <typename S, typename B>
+ struct envelope<nsphere_tag, box_tag, S, B>
+ {
+
+ /// Calculate envelope of a n-sphere
+ static inline void calculate(const S& n, B& b)
+ {
+ impl::envelope::envelope_nsphere(n, b);
+ }
+ private :
+ BOOST_CONCEPT_ASSERT((ConstNsphere<S>));
+ BOOST_CONCEPT_ASSERT((Box<B>));
+ };
+
+
+
+ template <typename L, typename B>
+ struct envelope<linestring_tag, box_tag, L, B> : impl::envelope::envelope_range<L, B>
+ {
+ private :
+ BOOST_CONCEPT_ASSERT((ConstLinestring<L>));
+ BOOST_CONCEPT_ASSERT((Box<B>));
+ };
+
+
+ template <typename R, typename B>
+ struct envelope<ring_tag, box_tag, R, B> : impl::envelope::envelope_range<R, B>
+ {
+ private :
+ BOOST_CONCEPT_ASSERT((ConstRing<R>));
+ BOOST_CONCEPT_ASSERT((Box<B>));
+ };
+
+
+
+ template <typename P, typename B>
+ struct envelope<polygon_tag, box_tag, P, B>
+ {
+
+ template<typename S>
+ static inline void calculate(const P& poly, B& b, const S& strategy)
+ {
+ // For polygon inspecting outer linear_ring is sufficient
+ impl::envelope::envelope_range_strategy(exterior_ring(poly), b, strategy);
+ }
+
+ static inline void calculate(const P& poly, B& b)
+ {
+ typedef typename point_type<B>::type PB;
+ typedef typename point_type<P>::type PP;
+ typename strategy_envelope<typename cs_tag<PP>::type,
+ typename cs_tag<PB>::type, PP, B>::type strategy;
+
+ calculate(poly, b, strategy);
+ }
+
+ private :
+ BOOST_CONCEPT_ASSERT((ConstPolygon<P>));
+ BOOST_CONCEPT_ASSERT((Box<B>));
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+
+ /*!
+ \brief Calculate envelope of a geometry
+ \ingroup envelope
+ \param geometry the geometry
+ \param box the box receiving the envelope
+ \par Example:
+ Example showing envelope calculation, using point_ll latlong points
+ \dontinclude doxygen_examples.cpp
+ \skip example_envelope_polygon
+ \line {
+ \until }
+ */
+ template<typename G, typename B>
+ inline void envelope(const G& geometry, B& box)
+ {
+ dispatch::envelope<typename tag<G>::type,
+ typename tag<B>::type, G, B>::calculate(geometry, box);
+ }
+
+
+ /*!
+ \brief Calculate envelope of a geometry, using a specified strategy
+ \ingroup envelope
+ \param geometry the geometry
+ \param box the box receiving the envelope
+ \param strategy strategy to be used
+ */
+ template<typename G, typename B, typename S>
+ inline void envelope(const G& geometry, B& box, const S& strategy)
+ {
+ dispatch::envelope<typename tag<G>::type,
+ typename tag<B>::type, G, B>::calculate(geometry, box, strategy);
+ }
+
+
+
+ /*!
+ \brief Calculate and return envelope of a geometry
+ \ingroup envelope
+ \param geometry the geometry
+ */
+ template<typename B, typename G>
+ inline B make_envelope(const G& geometry)
+ {
+ B box;
+ dispatch::envelope<typename tag<G>::type,
+ typename tag<B>::type, G, B>::calculate(geometry, box);
+ return box;
+ }
+
+ /*!
+ \brief Calculate and return envelope of a geometry
+ \ingroup envelope
+ \param geometry the geometry
+ \param strategy the strategy to be used
+ */
+ template<typename B, typename G, typename S>
+ inline B make_envelope(const G& geometry, const S& strategy)
+ {
+ B box;
+ dispatch::envelope<typename tag<G>::type,
+ typename tag<B>::type, G, B>::calculate(geometry, box, strategy);
+ return box;
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_ENVELOPE_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/foreach.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/foreach.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,239 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_FOREACH_HPP
+#define _GEOMETRY_FOREACH_HPP
+
+/*!
+\defgroup loop loops and for-each functionality
+There are several algorithms provided which walk through the points or segments
+of linestrings and polygons. They are called for_each_point, for_each_segment, after
+the standard library, and \b loop which is more adapted and of which the functor
+could break out if necessary.
+Of the for_each algorithms there is a \b const and a non-const version provided.
+*/
+
+
+#include <algorithm>
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/geometries/segment.hpp>
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace for_each
+ {
+
+ template <typename P, typename F>
+ struct fe_point
+ {
+ static inline F for_each_const_point(const P& p, F f)
+ {
+ f(p);
+ return (f);
+ }
+ static inline F for_each_point(P& p, F f)
+ {
+ f(p);
+ return (f);
+ }
+ };
+
+
+ template <typename R, typename F>
+ struct fe_range
+ {
+ static inline F for_each_const_point(const R& range, F f)
+ {
+ return (std::for_each(boost::begin(range), boost::end(range), f));
+ }
+
+ static inline F for_each_point(R& range, F f)
+ {
+ return (std::for_each(boost::begin(range), boost::end(range), f));
+ }
+
+ static inline F for_each_const_segment(const R& range, F f)
+ {
+ typedef typename boost::range_const_iterator<R>::type IT;
+ IT it = boost::begin(range);
+ IT previous = it++;
+ while(it != boost::end(range))
+ {
+ segment<typename point_type<R>::type> s(*previous, *it);
+ f(s);
+ previous = it++;
+ }
+
+ return (f);
+ }
+
+ static inline F for_each_segment(R& range, F f)
+ {
+ typedef typename boost::range_iterator<R>::type IT;
+ IT it = boost::begin(range);
+ IT previous = it++;
+ while(it != boost::end(range))
+ {
+ segment<typename point_type<R>::type> s(*previous, *it);
+ f(s);
+ previous = it++;
+ }
+
+ return (f);
+ }
+ };
+
+
+ template <typename P, typename F>
+ struct fe_polygon
+ {
+ static inline F for_each_const_point(const P& poly, F f)
+ {
+ typedef typename ring_type<P>::type R;
+ typedef typename boost::range_const_iterator<typename interior_type<P>::type>::type IT;
+ f = fe_range<R, F>::for_each_const_point(exterior_ring(poly), f);
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ f = fe_range<R, F>::for_each_const_point(*it, f);
+ }
+ return (f);
+ }
+ static inline F for_each_point(P& poly, F f)
+ {
+ typedef typename ring_type<P>::type R;
+ typedef typename boost::range_iterator<typename interior_type<P>::type>::type IT;
+ f = fe_range<R, F>::for_each_point(exterior_ring(poly), f);
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ f = fe_range<R, F>::for_each_point(*it, f);
+ }
+ return (f);
+ }
+
+ static inline F for_each_const_segment(const P& poly, F f)
+ {
+ typedef typename ring_type<P>::type R;
+ typedef typename boost::range_const_iterator<typename interior_type<P>::type>::type IT;
+ f = fe_range<R, F>::for_each_const_segment(exterior_ring(poly), f);
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ f = fe_range<R, F>::for_each_const_segment(*it, f);
+ }
+ return (f);
+ }
+ static inline F for_each_segment(P& poly, F f)
+ {
+ typedef typename ring_type<P>::type R;
+ typedef typename boost::range_iterator<typename interior_type<P>::type>::type IT;
+ f = fe_range<R, F>::for_each_segment(exterior_ring(poly), f);
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ f = fe_range<R, F>::for_each_segment(*it, f);
+ }
+ return (f);
+ }
+ };
+
+
+ } // namespace for_each
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G, typename F>
+ struct for_each {};
+
+ template <typename P, typename F>
+ struct for_each<point_tag, P, F> : impl::for_each::fe_point<P, F> {};
+
+ template <typename L, typename F>
+ struct for_each<linestring_tag, L, F> : impl::for_each::fe_range<L, F> {};
+
+ template <typename R, typename F>
+ struct for_each<ring_tag, R, F> : impl::for_each::fe_range<R, F> {};
+
+ template <typename P, typename F>
+ struct for_each<polygon_tag, P, F> : impl::for_each::fe_polygon<P, F> {};
+
+ } // namespace dispatch
+ #endif
+
+
+
+ /*!
+ \brief Calls functor for geometry
+ \ingroup loop
+ \param geometry geometry to loop through
+ \param f functor to use
+ \details Calls the functor the specified \b const geometry
+ */
+ template<typename G, typename F>
+ inline F for_each_point(const G& geometry, F f)
+ {
+ return (dispatch::for_each<typename tag<G>::type, G, F>::for_each_const_point(geometry, f));
+ }
+
+ /*!
+ \brief Calls functor for geometry
+ \ingroup loop
+ \param geometry geometry to loop through
+ \param f functor to use
+ \details Calls the functor for the specified geometry
+ */
+ template<typename G, typename F>
+ inline F for_each_point(G& geometry, F f)
+ {
+ return (dispatch::for_each<typename tag<G>::type, G, F>::for_each_point(geometry, f));
+ }
+
+ /*!
+ \brief Calls functor for segments on linestrings, rings, polygons, ...
+ \ingroup loop
+ \param geometry geometry to loop through
+ \param f functor to use
+ \details Calls the functor all \b const segments of the specified \b const geometry
+ */
+ template<typename G, typename F>
+ inline F for_each_segment(const G& geometry, F f)
+ {
+ return (dispatch::for_each<typename tag<G>::type, G, F>::for_each_const_segment(geometry, f));
+ }
+
+
+ /*!
+ \brief Calls functor for segments on linestrings, rings, polygons, ...
+ \ingroup loop
+ \param geometry geometry to loop through
+ \param f functor to use
+ \details Calls the functor all segments of the specified geometry
+ */
+ template<typename G, typename F>
+ inline F for_each_segment(G& geometry, F f)
+ {
+ return (dispatch::for_each<typename tag<G>::type, G, F>::for_each_segment(geometry, f));
+ }
+
+}
+
+#endif // _GEOMETRY_FOREACH_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/intersection.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/intersection.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,133 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_INTERSECTION_HPP
+#define _GEOMETRY_INTERSECTION_HPP
+
+#include <geometry/algorithms/intersection_segment.hpp>
+#include <geometry/algorithms/intersection_linestring.hpp>
+#include <geometry/algorithms/intersection_polygon.hpp>
+
+// Helper container and helper geometry
+#include <vector>
+#include <geometry/geometries/segment.hpp>
+
+
+/*!
+\defgroup intersection intersection (AND operation) and clipping
+\details The intersection of two geometries A and B is the geometry containing all points of A also belonging to B,
+but no other elements. The so-called clip is an intersection of a geometry with a box.
+\par Source description:
+- OGC: Returns a geometric object that represents the Point set intersection of this geometric object with another Geometry.
+\see http://en.wikipedia.org/wiki/Intersection_(set_theory)
+\note Any intersection can result in no geometry at all
+
+\note Used strategies still have to be modelled. Working only for cartesian
+\par Geometries:
+The intersection result is painted with a red outline.
+- clip: POLYGON + BOX -> output iterator of polygons
+ \image html clip_polygon.png
+- clip: LINESTRING + BOX -> output iterator of linestrings
+ \image html clip_linestring.png
+\note There are some difficulties to model an intersection in the template world. The intersection of two segments can
+result into nothing, into a point, into another segment. At compiletime the result type is not known. An output iterator
+iterating points is appropriate here.
+ \image html clip_segment_segment.png
+An intersection of two linestrings can result into nothing, one or more points, one or more segments or one or more
+linestrings. So an output iterator will NOT do here.
+So the output might be changed into a unified algorithm where the output is a multi-geometry.
+For the current clip-only operations the output iterator will do.
+
+\par Example:
+Example showing clipping of linestring with box
+\dontinclude doxygen_examples.cpp
+\skip example_intersection_linestring1
+\line {
+\until }
+\par Example:
+Example showing clipping of vector, outputting vectors, with box
+\dontinclude doxygen_examples.cpp
+\skip example_intersection_linestring2
+\line {
+\until }
+\par Example:
+Example showing clipping of polygon with box
+\dontinclude doxygen_examples.cpp
+\skip example_intersection_polygon1
+\line {
+\until }
+*/
+
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG1, typename TAG2, typename G1, typename G2>
+ struct intersection {};
+
+ template <typename B, typename L>
+ struct intersection<box_tag, linestring_tag, B, L>
+ {
+ template<typename O_IT>
+ static inline O_IT calculate(const B& box, const L& linestring, O_IT out)
+ {
+ typedef typename point_type<L>::type P;
+ typedef segment<P> S;
+ strategy::intersection::liang_barsky<B, S> strategy;
+
+ return (impl::intersection::clip_linestring_with_box(box, linestring, out, strategy));
+ }
+ };
+
+ template <typename B, typename P>
+ struct intersection<box_tag, polygon_tag, B, P>
+ {
+ template<typename O_IT>
+ static inline O_IT calculate(const B& box, const P& poly, O_IT out)
+ {
+ return impl::intersection::poly_weiler_atherton(box, poly, out);
+ }
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+
+
+
+ /*!
+ \brief Intersects two geometries which each other
+ \ingroup intersection
+ \details A sequence of points is intersected (clipped) by the specified box
+ and the resulting linestring, or pieces of linestrings, are sent to the specified output operator.
+ \tparam G1 first geometry type
+ \tparam G2 second geometry type
+ \tparam O_IT output iterator
+ \param geometry1 first geometry (currently only a BOX)
+ \param geometry2 second geometry (range, linestring, polygon)
+ \param out the output iterator, outputting linestrings or polygons
+ \return the output iterator
+ \note For linestrings: the default clipping strategy, Liang-Barsky, is used. The algorithm is currently only
+ implemented for 2D xy points. It could be generic for most ll cases, but not across the 180
+ meridian so that issue is still on the todo-list.
+ */
+ template <typename G1, typename G2, typename O_IT>
+ inline O_IT intersection(const G1& geometry1, const G2& geometry2, O_IT out)
+ {
+ return dispatch::intersection<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2, out);
+ }
+
+}
+
+#endif //_GEOMETRY_INTERSECTION_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/intersection_linestring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/intersection_linestring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,228 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_INTERSECTION_LINESTRING_HPP
+#define _GEOMETRY_INTERSECTION_LINESTRING_HPP
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/append.hpp>
+
+
+#include <geometry/geometries/segment.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace intersection
+ {
+ /*!
+ \brief Strategy: line clipping algorithm after Liang Barsky
+ \ingroup intersection
+ \details The Liang-Barsky line clipping algorithm clips a line with a clipping box.
+ It is slightly adapted in the sense that it returns which points are clipped
+ \tparam B box type of clipping box
+ \tparam S segment type of segments to be clipped
+ \note The algorithm is currently only implemented for 2D Cartesian points
+ \author Barend Gehrels, and the following recourses
+ - A tutorial: http://www.skytopia.com/project/articles/compsci/clipping.html
+ - a German applet (link broken): http://ls7-www.cs.uni-dortmund.de/students/projectgroups/acit/lineclip.shtml
+ */
+ template<typename B, typename S>
+ class liang_barsky
+ {
+ private :
+ inline bool check_edge(const double& p, const double& q, double &t1, double &t2) const
+ {
+ bool visible = true;
+
+ if(p < 0)
+ {
+ double r = q / p;
+ if(r > t2) visible = false;
+ else if(r > t1) t1 = r;
+ }
+ else if(p > 0)
+ {
+ double r = q / p;
+ if(r < t1) visible = false;
+ else if(r < t2) t2 = r;
+ }
+ else
+ {
+ if(q < 0) visible = false;
+ }
+
+ return visible;
+ }
+
+ public :
+ bool clip_segment(const B& b, S& s, bool& sp1_clipped, bool& sp2_clipped) const
+ {
+ typedef typename select_coordinate_type<B, S>::type T;
+
+ double t1 = 0;
+ double t2 = 1;
+
+ T dx = get<1, 0>(s) - get<0, 0>(s);
+ T dy = get<1, 1>(s) - get<0, 1>(s);
+
+ T p1 = -dx;
+ T p2 = dx;
+ T p3 = -dy;
+ T p4 = dy;
+
+ T q1 = get<0, 0>(s) - get<min_corner, 0>(b);
+ T q2 = get<max_corner, 0>(b) - get<0, 0>(s);
+ T q3 = get<0, 1>(s) - get<min_corner, 1>(b);
+ T q4 = get<max_corner, 1>(b) - get<0, 1>(s);
+
+ if(check_edge(p1, q1, t1, t2) // left
+ && check_edge(p2, q2, t1, t2) // right
+ && check_edge(p3, q3, t1, t2) // bottom
+ && check_edge(p4, q4, t1, t2) // top
+ )
+ {
+ sp1_clipped = t1 > 0;
+ sp2_clipped = t2 < 1;
+
+ // Todo, maybe: round coordinates in case of integer? define some round_traits<> or so?
+ // Take boost-round of Fernando
+ if (sp2_clipped)
+ {
+ set<1, 0>(s, get<0, 0>(s) + t2 * dx);
+ set<1, 1>(s, get<0, 1>(s) + t2 * dy);
+ }
+
+ if(sp1_clipped)
+ {
+ set<0, 0>(s, get<0, 0>(s) + t1 * dx);
+ set<0, 1>(s, get<0, 1>(s) + t1 * dy);
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ template<typename L, typename O_IT>
+ inline void add(L& line_out, O_IT out) const
+ {
+ if (! boost::empty(line_out))
+ {
+ *out = line_out;
+ out++;
+ geometry::clear(line_out);
+ }
+ }
+ };
+ }
+ }
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace intersection
+ {
+
+
+ /*!
+ \brief Clips a linestring, or pair of iterators, with a box
+ \details A linestring, defined by an iterator pair, is intersected (clipped) by the specified box
+ and the resulting linestring, or pieces of linestrings, are sent to the specified output operator.
+ \tparam C container type, for example a vector of points, matching the output-iterator type,
+ the points should also match the input-iterator type
+ \tparam B box type
+ \tparam IT in iterator type
+ \tparam O_IT output iterator type, which outputs linestrings
+ \tparam S strategy, a clipping strategy which should implement the methods "clip_segment" and "add"
+ */
+ template <typename L, typename B, typename O_IT, typename S>
+ O_IT clip_linestring_with_box(const B& b, const L& linestring, O_IT out, const S& strategy)
+ {
+ if (boost::begin(linestring) == boost::end(linestring))
+ {
+ return (out);
+ }
+ typedef typename point_type<L>::type P;
+ typedef segment<P> SEG;
+
+ L line_out;
+
+ typename boost::range_const_iterator<L>::type vertex = boost::begin(linestring);
+ typename boost::range_const_iterator<L>::type previous = vertex++;
+ while(vertex != boost::end(linestring))
+ {
+ P p1 = *previous;
+ P p2 = *vertex;
+
+ // Clip the segment. Five situations:
+ // 1. Segment is invisible, finish line if any (shouldn't occur)
+ // 2. Segment is completely visible. Add (p1)-p2 to line
+ // 3. Point 1 is invisible (clipped), point 2 is visible. Start new line from p1-p2...
+ // 4. Point 1 is visible, point 2 is invisible (clipped). End the line with ...p2
+ // 5. Point 1 and point 2 are both invisible (clipped). Start/finish an independant line p1-p2
+ //
+ // This results in:
+ // a. if p1 is clipped, start new line
+ // b. if segment is partly or completely visible, add the segment
+ // c. if p2 is clipped, end the line
+
+ bool c1, c2;
+ SEG s(p1, p2);
+ if (! strategy.clip_segment(b, s, c1, c2))
+ {
+ strategy.add(line_out, out);
+ }
+ else
+ {
+ // a. If necessary, finish the line and add a start a new one
+ if (c1)
+ {
+ strategy.add(line_out, out);
+ }
+
+ // b. Add p1 only if it is the first point, then add p2
+ if (boost::empty(line_out))
+ {
+ geometry::append(line_out, p1);
+ }
+ geometry::append(line_out, p2);
+
+ // c. If c2 is clipped, finish the line
+ if (c2)
+ {
+ strategy.add(line_out, out);
+ }
+ }
+ previous = vertex++;
+ }
+ // Add last part
+ strategy.add(line_out, out);
+ return (out);
+ }
+
+
+
+ } // namespace intersection
+ } // namespace impl
+ #endif
+
+
+
+} // namespace
+
+
+#endif //_GEOMETRY_INTERSECTION_LINESTRING_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/intersection_polygon.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/intersection_polygon.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,934 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_INTERSECTION_POLYGON_HPP
+#define _GEOMETRY_INTERSECTION_POLYGON_HPP
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/cs.hpp>
+
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/algorithms/area.hpp>
+#include <geometry/algorithms/append.hpp>
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/distance.hpp>
+#include <geometry/algorithms/within.hpp>
+
+
+
+#include <geometry/algorithms/intersection_segment.hpp>
+
+#include <geometry/algorithms/make.hpp>
+#include <geometry/util/assign_box_corner.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+// Helper geometries
+#include <geometry/geometries/point_xy.hpp>
+#include <geometry/geometries/segment.hpp>
+#include <geometry/geometries/linear_ring.hpp>
+
+
+#include <exception>
+
+
+//#define GL_DEBUG_INTERSECT_POLYGON
+
+
+namespace geometry
+{
+ // Move elsewhere?
+ class intersection_exception : public std::exception
+ {
+ public:
+ intersection_exception(const std::string& text)
+ : m_text(text)
+ {}
+ virtual ~intersection_exception() throw()
+ {}
+
+ virtual const char *what() const throw()
+ {
+ return m_text.c_str();
+ }
+ private :
+ std::string m_text;
+ };
+
+
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace intersection
+ {
+
+
+ //------------------------------------------------------------------------------------------------------------------------
+ // Weiler-Atherton approach to clip a polygon within a rectangle
+ // Can be relatively easily extended to clip polygon-polygon
+ // (Somewhat combined with "segment-code" idea of Cohen-Sutherland to see which segment needs clipping)
+
+ // Keep bitwise.
+ // See, e.g., http://www.sunshine2k.de/stuff/Java/CohenSutherland/CohenSutherland.html
+ const char cohen_sutherland_top = 1; // 0001
+ const char cohen_sutherland_bottom = 2; // 0010
+ const char cohen_sutherland_right = 4; // 0100
+ const char cohen_sutherland_left = 8; // 1000
+
+
+ const int ring_not_assigned = -99;
+
+
+ enum clip_polygon_type {clip_intersect, clip_box_within_ring,
+ clip_ring_within_box, clip_disjoint};
+
+
+
+ // Extend point type with "tag" information
+ // Weiler-Atherton:
+ // "The new vertices are tagged to indicate they are intersection vertices." --> intersection_id > 0
+ // and
+ // "Repeat steps "b" to "e" until the starting point has been reached." --> is_visited
+ template<typename P>
+ struct weiler_atherton_point : public P
+ {
+ typedef typename distance_result<P, P>::type DIST;
+
+ public :
+ inline weiler_atherton_point()
+ : outside(false)
+ , ring_index(ring_not_assigned)
+ , intersection_id(-1)
+ , is_visited(false)
+ {
+ // Init with zero
+ this->template set<0>(0);
+ this->template set<1>(0);
+ }
+
+ // Constructor with point
+ inline weiler_atherton_point(const P& p)
+ : P(p)
+ , outside(false)
+ , ring_index(ring_not_assigned)
+ , intersection_id(-1)
+ , vertex_index(-1)
+ , distance(0)
+ , is_visited(false)
+ {}
+
+ // Constructor with coordinates
+ // Note that "geometry::coordinate_type" cannot be used here, because traits definitions
+ // are declared below.
+ template <typename T>
+ inline weiler_atherton_point(const T& x, const T& y)
+ : outside(false)
+ , ring_index(ring_not_assigned)
+ , intersection_id(-1)
+ , vertex_index(-1)
+ , distance(0)
+ , is_visited(false)
+ {
+ this->template set<0>(x);
+ this->template set<1>(y);
+ }
+
+ // Constructor with point, Cohen-Sutherland code and linear_ring-index
+ inline weiler_atherton_point(const P& p, bool os, int r)
+ : P(p)
+ , outside(os)
+ , ring_index(r)
+ , intersection_id(-1)
+ , vertex_index(-1)
+ , distance(0)
+ , is_visited(false)
+ {}
+
+ inline weiler_atherton_point(const P& p, int si, double d)
+ : P(p)
+ , outside(false)
+ , ring_index(ring_not_assigned)
+ , intersection_id(-1)
+ , vertex_index(si)
+ , distance(d)
+ , is_visited(false)
+ {}
+
+
+ // Operator to sort on "start vertex", then on distance
+ inline bool operator<(const weiler_atherton_point& other) const
+ {
+ if (other.vertex_index == this->vertex_index)
+ {
+ // Compare on (possibly squared) distance
+ return this->distance < other.distance;
+ }
+ return this->vertex_index < other.vertex_index;
+ }
+
+ int ring_index;
+ int vertex_index;
+ bool outside;
+
+ bool is_visited;
+
+ // For intersections:
+ int intersection_id; // 1-based intersection ID
+ DIST distance; // distance to corresponding startpoing of segment
+
+ };
+
+
+ }
+ } // namespace impl (closing to adapt to traits)
+
+
+ // NOTE: the DOXYGEN_NO_IMPL still applies here
+
+
+ // Adapt the weiler atherton point to the concept
+ namespace traits
+ {
+ template <typename P>
+ struct coordinate_type<geometry::impl::intersection::weiler_atherton_point<P> >
+ { typedef typename geometry::coordinate_type<P>::type type; };
+
+ template <typename P>
+ struct coordinate_system<geometry::impl::intersection::weiler_atherton_point<P> >
+ { typedef cs::cartesian type; };
+
+ template <typename P>
+ struct dimension<geometry::impl::intersection::weiler_atherton_point<P> >: boost::mpl::int_<2> {};
+
+ template <typename P>
+ struct tag<geometry::impl::intersection::weiler_atherton_point<P> >
+ { typedef point_tag type; };
+
+ template <typename P>
+ struct access<geometry::impl::intersection::weiler_atherton_point<P> >
+ {
+ template <int I>
+ static typename coordinate_type<P>::type get(const geometry::impl::intersection::weiler_atherton_point<P>& p)
+ { return p.template get<I>(); }
+
+ template <int I>
+ static void set(geometry::impl::intersection::weiler_atherton_point<P>& p, const typename coordinate_type<P>::type& value)
+ { p.template set<I>(value); }
+ };
+
+ }
+
+ // Continuation of namespace impl
+ namespace impl
+ {
+ namespace intersection
+ {
+
+ // Small structure to keep two indices and an ID
+ struct intersection_indices
+ {
+ inline intersection_indices(int an_id)
+ : id(an_id)
+ , subject_index(-1)
+ , clip_index(-1)
+ {}
+
+ int id;
+ int subject_index;
+ int clip_index;
+ };
+ typedef std::vector<intersection_indices> intersection_index_vector;
+
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ template<typename P>
+ inline std::ostream& operator<< (std::ostream &stream, const weiler_atherton_point<P>& p)
+ {
+ stream << "(" << std::setw(4) << std::setprecision(3) << get<0>(p)
+ << " , " << std::setw(4) << std::setprecision(3) << get<1>(p) << ") "
+ << "; ri=";
+ if (p.ring_index == ring_not_assigned)
+ {
+ stream << " -";
+ }
+ else
+ {
+ stream << std::setw(3) << p.ring_index;
+ }
+ stream << "; vi=" << std::setw(3) << p.vertex_index;
+ stream << "; id=" << std::setw(3) << p.intersection_id;
+ stream << "; dist=" << std::setw(4) << std::setprecision(2) << double(p.distance);
+ if (p.outside)
+ {
+ stream << "; outside";
+ }
+ if (p.is_visited)
+ {
+ stream << "; visited";
+ }
+ return stream;
+ }
+#endif
+
+
+ template<typename B, typename P>
+ inline void _cs_clip_code(const B& b, const P& p,
+ char& code, bool& is_inside,
+ char& code_and, char& code_or, bool& has_inside, bool& disjoint)
+ {
+ code = 0;
+
+ // Note: border has to be included because of boundary cases
+ // Therefore we need a second variable to see if it is inside (including on boundary)
+
+ // Compare left/right.
+ if (get<0>(p) <= get<min_corner, 0>(b)) code = cohen_sutherland_left;
+ else if (get<0>(p) >= get<max_corner, 0>(b)) code = cohen_sutherland_right;
+
+ // Compare top/bottom
+ if (get<1>(p) <= get<min_corner, 1>(b)) code |= cohen_sutherland_bottom;
+ else if (get<1>(p) >= get<max_corner, 1>(b)) code |= cohen_sutherland_top;
+
+ code_and &= code;
+ code_or |= code;
+
+ // Check if point is lying inside clip, or on boundary
+ is_inside = geometry::within(p, b);
+ if (is_inside)
+ {
+ has_inside = true;
+ disjoint = false;
+ }
+ }
+
+
+ template<typename I>
+ inline bool on_same_ring(I& it, int ring_index)
+ {
+ return ring_index == ring_not_assigned
+ || it->ring_index == ring_not_assigned
+ || it->ring_index == ring_index;
+ }
+
+ // Iterate along the container. If on end, or on other ring, goto first element of same ring
+ template<typename I>
+ inline void traverse_along(I& it, const I& begin, const I& end)
+ {
+ int ri_1 = it->ring_index;
+ it++;
+ if (it == end || ! on_same_ring(it, ri_1))
+ {
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ if (it == end) std::cout << "GOTO BEGIN " << *begin << std::endl;
+ else std::cout << "FIND RING " << "RI:" << ri_1 << std::endl;
+#endif
+ it = begin;
+ if (! on_same_ring(it, ri_1))
+ {
+ for (I tit = begin; tit != end; tit++)
+ {
+ //std::cout << "evaluate " << *tit << " RI:" << ri_1 << std::endl;
+ if (tit->ring_index == ri_1)
+ {
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << "TAKE " << *tit << std::endl;
+#endif
+
+ it = tit;
+ return;
+ }
+ }
+
+ throw intersection_exception("internal error - no correct point on interator found");
+ }
+ }
+ }
+
+ // Traverse to an unvisited intersection point on the subject polygon.
+ template<typename W>
+ void traverse_to_intersection(W& subject, W& clip, intersection_index_vector& indices, typename W::iterator& it)
+ {
+ for (intersection_index_vector::iterator iit = indices.begin(); iit != indices.end(); iit++)
+ {
+ typename W::iterator next = subject.begin() + iit->subject_index;
+ // Check both for being visited - we don't know which one was taken
+ if (! next->is_visited && ! clip[iit->clip_index].is_visited)
+ {
+ it = next;
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << "Start with " << *it << std::endl;
+#endif
+ return;
+ }
+ }
+ }
+
+ template<typename W>
+ void traverse_to_after_id(W& subject, W& clip,
+ intersection_index_vector& indices, bool on_subject, int id, typename W::iterator& it)
+ {
+ for (intersection_index_vector::iterator iit = indices.begin(); iit != indices.end(); iit++)
+ {
+ if (iit->id == id)
+ {
+ if (on_subject)
+ {
+ it = subject.begin() + iit->subject_index;
+ traverse_along(it, subject.begin(), subject.end());
+ }
+ else
+ {
+ it = clip.begin() + iit->clip_index;
+ traverse_along(it, clip.begin(), clip.end());
+ }
+ return;
+ }
+ }
+ throw intersection_exception("internal error - intersection ID not found");
+ }
+
+ template<typename W>
+ void traverse_next(W& subject, W& clip,
+ intersection_index_vector& indices, bool& on_subject, typename W::iterator& it)
+ {
+ // 1. Go to next point
+ typename W::iterator next = it;
+ if (on_subject)
+ {
+ traverse_along(next, subject.begin(), subject.end());
+ }
+ else
+ {
+ traverse_along(next, clip.begin(), clip.end());
+ }
+
+ // 2. If current was not an intersection point,
+ // or next is an intersection point, we take this next point (but only on subject)
+ // or we are on the subject polygon and next is inside the clip
+ if (it->intersection_id <= 0
+ || (on_subject && next->intersection_id > 0)
+ || (on_subject && ! next->outside))
+ {
+ it = next;
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ if (it->intersection_id <= 0)
+ std::cout << "Take next " << *it << std::endl;
+ else if (on_subject && next->intersection_id > 0) std::cout << "next (sub) " << *it << std::endl;
+ else if (on_subject && ! next->outside) std::cout << "next (ins) " << *it << std::endl;
+ else
+ std::cout << "other " << *it << std::endl;
+#endif
+ }
+ else
+ {
+ // we are on subject or on clip, on intersection, next is not an intersection,
+ // navigate to the corresponding ID on the other polygon
+ traverse_to_after_id(subject, clip, indices, !on_subject, it->intersection_id, next);
+
+ // It may never be outside polygon
+ if (!on_subject && next->outside)
+ {
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << "return because of " << *next << std::endl;
+#endif
+ return;
+ }
+
+ on_subject = ! on_subject;
+ it = next;
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << "trav->" << (on_subject ? "subj " : "clip ") << *it << std::endl;
+#endif
+ }
+ }
+
+
+ template<typename S1, typename S2, typename WAP>
+ void segment_weiler_atherton_intersect(
+ const S1& subject, int subject_index, std::vector<WAP>& subject_points,
+ const S2& clip, int clip_index, std::vector<WAP>& clip_points,
+ int& id, intersection_index_vector& indices)
+ {
+ BOOST_CONCEPT_ASSERT( (Point<WAP>) );
+ BOOST_CONCEPT_ASSERT( (ConstSegment<S1>) );
+ BOOST_CONCEPT_ASSERT( (ConstSegment<S1>) );
+
+
+ std::vector<WAP> ip;
+ intersection_result r = intersection_segment<WAP>(subject, clip, std::back_inserter(ip));
+
+ // If there are two intersection points (== overlap), discard:
+ // 1) it can be in opposite direction, they share their border there
+ // but do not intersect -> return
+ // 2) it can be in same direction, it is OK but the intersection points are calculated
+ // before/after overlap (see figure)
+
+ if (ip.size() != 1)
+ {
+ return;
+ }
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << " CHECK : " << subject.first << "-" << subject.second
+ << " x " << clip.first << "-" << clip.second << std::endl;
+#endif
+
+
+ // If segment of subject intersects clip, and intersection point is on the clip,
+ // we examine further
+ if (r.is_type == is_intersect)
+ {
+ connection_type c = r.get_connection_type();
+ if (c != is_connect_no)
+ {
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << "CONNECT: " << subject.first << "-" << subject.second
+ << " x " << clip.first << "-" << clip.second << std::endl;
+#endif
+
+ //typedef typename cs_tag<typename S2::point_type>::type PTAG;// doesn't work... todo
+ typedef typename strategy_side<cartesian_tag, typename S2::point_type>::type SIDE;
+
+
+ switch(c)
+ {
+ // If it connects at at one end, always consider the subject-point:
+ // only continue if it is RIGHT of the clip
+ case is_connect_s1p1 :
+ if (SIDE::side(clip, subject.second) >= 0) return;
+ break;
+ case is_connect_s1p2 :
+ if (SIDE::side(clip, subject.second) >= 0) return;
+ break;
+ case is_connect_s2p1 :
+ case is_connect_s2p2 :
+ // Consider both points, at least one must be right of the clip
+ if (SIDE::side(clip, subject.first) >= 0 && SIDE::side(clip, subject.second) >= 0)
+ {
+ return;
+ }
+ break;
+ }
+ }
+
+ }
+
+ // Add intersection points, if any
+ for (typename std::vector<WAP>::iterator it = ip.begin(); it != ip.end(); it++)
+ {
+ // Tag the point(s) with unique id
+ it->intersection_id = ++id;
+ // Add it to intersection
+ indices.push_back(intersection_indices(id));
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << "-> INTERSECTION: " << id << " " << *it << std::endl;
+#endif
+
+ // Assign index, calc squared distance and store for addition to subject and to clip lateron
+ typedef typename point_type<S1>::type PS1;
+ typedef typename strategy_distance<
+ typename cs_tag<WAP>::type,
+ typename cs_tag<PS1>::type,
+ WAP, PS1>::type STRATEGY;
+
+ STRATEGY strategy;
+
+ it->vertex_index = subject_index;
+ it->distance = strategy(subject.first, *it);
+ subject_points.push_back(*it);
+
+ it->vertex_index = clip_index;
+ it->distance = strategy(clip.first, *it);
+ clip_points.push_back(*it);
+ }
+ }
+
+
+ template<typename B, typename R, typename WAP, typename WAR>
+ clip_polygon_type ring_weiler_atherton_intersect(const B& b, const R& in, int ring_index,
+ WAR& subject, std::vector<WAP>& clip, // todo, change to WAR
+ int& id, intersection_index_vector& indices)
+ {
+ // Some book keeping variables
+ char code_and = cohen_sutherland_left
+ | cohen_sutherland_right
+ | cohen_sutherland_top
+ | cohen_sutherland_bottom;
+ char code_or = 0;
+ bool has_inside = false;
+ bool is_disjoint = true;
+
+ // Define the 4 points defining the box
+ typedef typename boost::range_value<R>::type P;
+ P lower_left, upper_left, lower_right, upper_right;
+ assign_box_corners(b, lower_left, lower_right, upper_left, upper_right);
+
+ bool first = true;
+ char code_previous = 0;
+ //R::const_iterator last = in.end() - 1;
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ int point_index = 0;
+#endif
+
+ size_t subject_original_size = subject.size();
+
+ typename R::const_iterator it = in.begin();
+ typename R::const_iterator prev = it++;
+ while(it != in.end())
+ {
+ bool is_inside;
+ if (first)
+ {
+ // Add first point of polygon to subject vector
+ _cs_clip_code(b, *prev, code_previous, is_inside, code_and, code_or,
+ has_inside, is_disjoint);
+ subject.push_back(WAP(*prev, !is_inside, ring_index));
+ first = false;
+ }
+
+ char code_current;
+ _cs_clip_code(b, *it, code_current, is_inside, code_and, code_or,
+ has_inside, is_disjoint);
+
+ segment<const P> ss(*prev, *it);
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << ring_index << "." << point_index++
+ << " SGMNT: " << ss.first << "-" << ss.second
+ << " cs " << int(code_previous) << "," << int(code_current) << std::endl;
+#endif
+
+
+ // If both segments are not in same Cohen-Suth. segment, check for intersections
+ // Todo: check more efficient (if they are lying on same side -> no intersection possible)
+ if (code_previous != code_current)
+ {
+ // Intersections are first stored in a vector, then sorted, then added, see Weiler-Atherton:
+ // "If care is taken in placement of intersections where the subject and clip polygon
+ // contours are identical in the x-y plane, no degenerate polygons will be produced by
+ // the clipping process."
+ std::vector<WAP> ips;
+
+ // Clip all four sides of box
+ segment_weiler_atherton_intersect(ss, -1, ips,
+ segment<const P>(lower_left, upper_left),
+ 0, clip, id, indices);
+ segment_weiler_atherton_intersect(ss, -1, ips,
+ segment<const P>(upper_left, upper_right),
+ 1, clip, id, indices);
+ segment_weiler_atherton_intersect(ss, -1, ips,
+ segment<const P>(upper_right, lower_right),
+ 2, clip, id, indices);
+ segment_weiler_atherton_intersect(ss, -1, ips,
+ segment<const P>(lower_right, lower_left),
+ 3, clip, id, indices);
+
+ // Add all found intersection points to subject polygon, after sorting
+ // on distance from first point. There might be up to 4 intersection points
+ // in rectangular clips, and much more on polygon clips. However, often there are zero or one
+ // intersections, sorting is not a big issue here
+ std::sort(ips.begin(), ips.end());
+ for (typename std::vector<WAP>::const_iterator pit = ips.begin(); pit != ips.end(); pit++)
+ {
+ indices[pit->intersection_id - 1].subject_index = int(subject.size());
+ subject.push_back(*pit);
+
+ is_disjoint = false;
+ }
+ }
+
+ // After intersections, add endpoint of segment to subject vector
+ subject.push_back(WAP(*it, !is_inside, ring_index));
+
+ code_previous = code_current;
+ prev = it++;
+ }
+
+ // If all points are inside clip-box, output is original (for outer)
+ // or should be added completely (for inner)
+ if (code_or == 0)
+ {
+ // Remove from subject
+ subject.erase(subject.begin() + subject_original_size, subject.end());
+ return clip_ring_within_box;
+ }
+
+ // Special case: if no points are inside, the clip box might be inside the polygon
+ // -> output clip box and quit
+ if (! has_inside)
+ {
+ // Take any point of clip and check if it is within the linear_ring
+ typename point_type<B>::type p;
+ assign_box_corner<min_corner, min_corner>(b, p);
+ if (geometry::within(p, in))
+ {
+ return clip_box_within_ring;
+ }
+ // If clip points are not in the linear_ring, but not all on same side,
+ // there might still be an intersection
+ // TODO: can be checked more efficiently further
+ }
+
+
+ // Discard disjoint outer/inner rings
+ if (is_disjoint)
+ {
+ // Remove from subject
+ subject.erase(subject.begin() + subject_original_size, subject.end());
+ return clip_disjoint;
+ }
+
+ // Some points are inside, some are outside, clipping should go on
+ return clip_intersect;
+ }
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ template <typename RING>
+ void wa_debug_ring(const std::string& title, const RING& ring)
+ {
+ std::cout << title << ": (" << ring.size() << " points)" << std::endl;
+ for (int i = 0; i < ring.size(); i++)
+ {
+ std::cout << ring[i] << std::endl;
+ }
+ }
+ void wa_debug_clip_result(const std::string& title, clip_polygon_type type)
+ {
+ std::cout << title << ": ";
+ switch(type)
+ {
+ case clip_box_within_ring : std::cout << "clip within ring"; break;
+ case clip_ring_within_box : std::cout << "ring within clip"; break;
+ case clip_disjoint : std::cout << "clip disjoint ring"; break;
+ case clip_intersect : std::cout << "clip intersects ring"; break;
+ }
+ std::cout << std::endl;
+
+ }
+
+#endif
+
+
+
+ template<typename B, typename POLY, typename O_IT>
+ O_IT poly_weiler_atherton(const B& b, const POLY& in, O_IT output)
+ {
+ typedef weiler_atherton_point<typename point_type<POLY>::type> wap;
+ typedef linear_ring<wap> wa_ring;
+
+ // Weiler-Atherton:
+ // "A link is established between each pair of new vertices, permitting travel between two
+ // polygons wherever they intersect on the x-y plane."
+ // We keep this link in an index-vector
+ intersection_index_vector indices;
+
+ int id = 0;
+
+ // 1: Create a processed copy of the polygon (called, after Weiler-Atherton, the "subject"),
+ // which has all points of original AND all intersection points on correct positions.
+ // Create also a processed copy of the clipping box, called, the "clip", also with all found intersection points.
+ // The copy is
+ // Check the Cohen-Suth.segment
+ // - to avoid unnecessary intersections (in a BOX, two consecutive inside points doesn't need to be checked)
+ // - to choose the path, lateron
+ wa_ring subject, clip;
+
+
+ // For outerring and all rings
+ // TODO: check result code of function, if no intersections -> add to output iterator and quit
+ int ring_index = -1;
+
+ clip_polygon_type outer_result =
+ ring_weiler_atherton_intersect(b, exterior_ring(in), ring_index++, subject, clip, id, indices);
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ wa_debug_clip_result("exterior_ring", outer_result);
+#endif
+
+ switch(outer_result)
+ {
+ case clip_box_within_ring :
+ {
+ // If outer polygon completely contains the clipbox, return the clipbox as clip
+ POLY out;
+ typedef typename point_type<POLY>::type P;
+ geometry::append(exterior_ring(out), make<P>(get<min_corner, 0>(b), get<min_corner, 1>(b)));
+ geometry::append(exterior_ring(out), make<P>(get<min_corner, 0>(b), get<max_corner, 1>(b)));
+ geometry::append(exterior_ring(out), make<P>(get<max_corner, 0>(b), get<max_corner, 1>(b)));
+ geometry::append(exterior_ring(out), make<P>(get<max_corner, 0>(b), get<min_corner, 1>(b)));
+ geometry::append(exterior_ring(out), make<P>(get<min_corner, 0>(b), get<min_corner, 1>(b)));
+
+ // TODO: all innerrings must be evaluated:
+ // - completely within clipbox -> add as innerring
+ // - intersecting clipbox -> discard poly above and do complete process
+ // - completely outside clipbox (but clipbox still inside exterior ring) -> return
+
+
+ *output = out;
+ output++;
+
+ return output;
+ }
+ case clip_ring_within_box :
+ // Put input polygon to output vector (this assignment includes all inner rings)
+ *output = in;
+ return output;
+ case clip_disjoint :
+ // Put nothing to output vector, it is completely outside clipping box
+ return output;
+ }
+
+ std::vector<int> within_inner_rings;
+
+ typedef typename boost::range_const_iterator<typename interior_type<POLY>::type>::type IIT;
+
+ for (IIT it = boost::begin(interior_rings(in));
+ it != boost::end(interior_rings(in)); it++, ring_index++)
+ {
+ clip_polygon_type inner_result =
+ ring_weiler_atherton_intersect(b, *it, ring_index, subject, clip, id, indices);
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ wa_debug_clip_result("inner", inner_result);
+#endif
+
+ switch(inner_result)
+ {
+ case clip_ring_within_box :
+ // if innerring completly inside box, add lateron as innerring
+ within_inner_rings.push_back(ring_index);
+ break;
+ }
+ }
+
+
+ // If there are clip intersection points, build up the clip polyon. Add all corner points,
+ // then sort on segment-index and distance, then the clip is OK
+ typename point_type<B>::type lower_left, upper_left, lower_right, upper_right;
+ assign_box_corners(b, lower_left, lower_right, upper_left, upper_right);
+
+ clip.push_back(wap(lower_left, 0, 0.0));
+ clip.push_back(wap(upper_left, 1, 0.0));
+ clip.push_back(wap(upper_right, 2, 0.0));
+ clip.push_back(wap(lower_right, 3, 0.0));
+ clip.push_back(wap(lower_left, 4, 0.0));
+
+ std::sort(clip.begin(), clip.end());
+
+ // Update the id's of clip intersection points, now we have it
+ for (unsigned int j = 0; j < clip.size(); j++)
+ {
+ if (clip[j].intersection_id > 0)
+ {
+ indices[clip[j].intersection_id - 1].clip_index = j;
+ }
+ }
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << std::endl << "indices of intersections:" << std::endl;
+ for (intersection_index_vector::const_iterator it = indices.begin(); it != indices.end(); it++)
+ {
+ std::cout
+ << "subj:" << it->subject_index << " " << subject[it->subject_index] << std::endl
+ << "clip:" << it->clip_index << " " << clip[it->clip_index] << std::endl;
+ }
+
+ wa_debug_ring("SUBJECT", subject);
+ wa_debug_ring("CLIP", clip);
+
+#endif
+
+ // 4. build output polygon or polygons, start with an intersected point
+ // "4. The actual clipping is now performed
+ // a) An intersection vertex is removed from the first intersection list to be used as a
+ // starting point. If the list is exhausted, the clipping is complete; Go to step 5.
+ POLY out;
+ typename wa_ring::iterator it = subject.begin();
+ traverse_to_intersection(subject, clip, indices, it);
+ bool on_subject = true;
+ while(! it->is_visited)
+ {
+ // Add the point, but only if it differs from previous point
+ typedef typename point_type<POLY>::type P;
+ P p = make<P>(it->x(), it->y());
+ if (boost::empty(exterior_ring(out)) || ! (exterior_ring(out).back() == p))
+ {
+ geometry::append(exterior_ring(out), p);
+ }
+
+ it->is_visited = true;
+
+ traverse_next(subject, clip, indices, on_subject, it);
+
+ if (it->is_visited)
+ {
+ // Close (if not closed)
+ typename ring_type<POLY>::type outer_ring = exterior_ring(out);
+ if (! boost::empty(outer_ring) && ! (outer_ring.front() == outer_ring.back()))
+ {
+ geometry::append(outer_ring, outer_ring.front());
+ }
+
+ // Add all innerrings which are inside this polygon
+ for (unsigned int i = 0; i < within_inner_rings.size(); i++)
+ {
+
+ typedef typename boost::range_const_iterator<typename interior_type<POLY>::type>::type IIT;
+ IIT it = boost::begin(interior_rings(in)) + within_inner_rings[i];
+ // TODO: make more efficient, check using "envelope" of exterior first
+ if (geometry::within(it->front(), outer_ring))
+ {
+ // ASSUMPTION OF STD::CONTAINER HERE which is probably always the case
+ interior_rings(out).push_back(*it);
+ }
+ }
+
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ //std::cout << "out: " << make_as_wkt(out) << std::endl;
+#endif
+
+ *output = out;
+ output++;
+
+ clear(out);
+
+ // Go to first unvisited intersection point, if any
+ // Else the iterator will result is_visited and it will stop
+ traverse_to_intersection(subject, clip, indices, it);
+ on_subject = true;
+ }
+ }
+
+
+#ifdef GL_DEBUG_INTERSECT_POLYGON
+ std::cout << std::endl << "AFTER PROCESSING:" << std::endl;
+ wa_debug_ring("SUBJECT", subject);
+ wa_debug_ring("CLIP", clip);
+#endif
+ return output;
+
+ }
+
+
+ }
+ } // namespace impl
+ #endif
+
+
+} // namespace
+
+
+#endif //_GEOMETRY_INTERSECTION_POLYGON_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/intersection_segment.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/intersection_segment.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,252 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_INTERSECTION_SEGMENT_HPP
+#define _GEOMETRY_INTERSECTION_SEGMENT_HPP
+
+#include <limits>
+#include <vector>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/concepts/segment_concept.hpp>
+
+#include <geometry/util/math.hpp>
+#include <geometry/util/promotion_traits.hpp>
+
+
+namespace geometry
+{
+
+
+
+ /*!
+ \brief Enumeration containing intersection types
+ */
+ enum intersection_type {is_intersect_no,
+ is_intersect,
+ is_parallel,
+ is_collinear_no, is_collinear_one, is_collinear_connect, is_collinear_overlap,
+ is_collinear_overlap_opposite, is_collinear_connect_opposite};
+
+ /*!
+ \brief Enumeration containing connection types of intersected segments
+ */
+ enum connection_type { is_connect_no,
+ is_connect_s1p1, is_connect_s1p2,
+ is_connect_s2p1, is_connect_s2p2
+ };
+
+ /*!
+ \brief Encapsulates the result of a segment intersection.
+ \details The class contains the intersection type and two parameters
+ ra and rb, indicating how the two segments connect (if they connect).
+ This connection type can be examined with the method connection_type.
+ */
+ struct intersection_result
+ {
+ intersection_result()
+ : is_type(is_intersect_no)
+ , ra(0)
+ , rb(0)
+ {}
+
+ intersection_type is_type;
+ double ra;
+ double rb;
+
+ inline connection_type get_connection_type()
+ {
+ if (is_type == is_intersect)
+ {
+ if (equals(rb, 0.0)) return is_connect_s2p1;
+ if (equals(rb, 1.0)) return is_connect_s2p2;
+ if (equals(ra, 0.0)) return is_connect_s1p1;
+ if (equals(ra, 1.0)) return is_connect_s1p2;
+ }
+ return is_connect_no;
+ }
+
+ };
+
+
+
+
+ /*!
+ \brief Calculate zero, one or two intersections of two linesegments, using Cramer's rule.
+ \ingroup intersection
+ \details Two intersections are returned if segments are on same line and (partially) overlap.
+ One intersection is returned if segments intersect
+ Intersection points is vector of points, might be yet another pointtype then points making up segment
+ \tparam P type of outputted intersection point(s). Must be specified, cannot be deducted
+ from parameters. Type might be different from segment points.
+ \tparam S1 first segment type
+ \tparam S2 second segment type
+ \tparam O_IT output iterator
+ \param s1 first segment
+ \param s2 second segment
+ \param out output iterator
+ \return the intersection result, a struct containing the intersection type, and two calculated
+ values which can be examined further if necessary
+ \note <b>The algorithm is currently only implemented for 2D Cartesian points. It
+ will be redesigned to work with strategies.</b> Algorithms to calculate segment intersections
+ on a sphere are available, see http://williams.best.vwh.net/avform.htm.
+ \par Example:
+ Example showing intersection of two segments
+ \dontinclude doxygen_examples.cpp
+ \skip example_intersection_segment1
+ \line {
+ \until }
+ */
+ template <typename P, typename S1, typename S2, typename O_IT>
+ inline intersection_result intersection_segment(const S1& s1, const S2& s2, O_IT out)
+ {
+ BOOST_CONCEPT_ASSERT( (Point<P>) );
+
+ BOOST_CONCEPT_ASSERT( (ConstSegment<S1>) );
+ BOOST_CONCEPT_ASSERT( (ConstSegment<S2>) );
+
+ intersection_result result;
+
+ typedef typename select_coordinate_type<S1, S2>::type T;
+
+ T dx1 = get<1, 0>(s1) - get<0, 0>(s1);
+ T dx2 = get<1, 0>(s2) - get<0, 0>(s2);
+ T dy1 = get<1, 1>(s1) - get<0, 1>(s1);
+ T dy2 = get<1, 1>(s2) - get<0, 1>(s2);
+
+ T wx = get<0, 0>(s1) - get<0, 0>(s2);
+ T wy = get<0, 1>(s1) - get<0, 1>(s2);
+
+ // Calculate determinants - Cramers rule
+ T d = (dy2 * dx1) - (dx2 * dy1);
+ T a = (dx2 * wy) - (dy2 * wx);
+ T b = (dx1 * wy) - (dy1 * wx);
+
+ if(equals(d, 0))
+ {
+ if(equals(a, 0) && equals(b, 0))
+ {
+ bool vertical = equals(dx2, 0);
+
+ // Maybe change this by boost::minmax construct(s)
+
+ if (! vertical
+ && (std::min(get<0, 0>(s1), get<1, 0>(s1)) > std::max(get<0, 0>(s2), get<1, 0>(s2))
+ || std::min(get<0, 0>(s2), get<1, 0>(s2)) > std::max(get<0, 0>(s1), get<1, 0>(s1))))
+ {
+ // No overlap, segments are not connected
+ result.is_type = is_collinear_no;
+ return result;
+ }
+ else if (vertical
+ && (std::min(get<0, 1>(s1), get<1, 1>(s1)) > std::max(get<0, 1>(s2), get<1, 1>(s2))
+ || std::min(get<0, 1>(s2), get<1, 1>(s2)) > std::max(get<0, 1>(s1), get<1, 1>(s1))))
+ {
+ // No overlap, vertical segments are not connected
+ result.is_type = is_collinear_no;
+ return result;
+ }
+ else
+ {
+ // Partial or full overlap, calculate ratio in x-direction, for vertical lines in y-direction
+ // Adapted from http://www.geometryalgorithms.com/Archive/algorithm_0104/algorithm_0104B.htm
+ // Copyright 2001, softSurfer (www.softsurfer.com)
+ // This code may be freely used and modified for any purpose
+ // providing that this copyright notice is included with it.
+ // SoftSurfer makes no warranty for this code, and cannot be held
+ // liable for any real or imagined damage resulting from its use.
+ // Users of this code must verify correctness for their application.
+
+ // Segments of single point, with overlap
+ if (equals(dx1, 0) && equals(dy1, 0))
+ {
+ // Take point on first segment
+ // TODO: copy constructor only works for points with same type. Change.
+ P p(s1.first);
+ *out = p;
+ out++;
+ result.is_type = is_collinear_one;
+ return result;
+ }
+ if (equals(dx2, 0) && equals(dy2, 0))
+ {
+ P p(s2.first);
+ *out = p;
+ out++;
+ result.is_type = is_collinear_one;
+ return result;
+ }
+
+ result.ra = vertical
+ ? wy / dy2
+ : wx / dx2;
+ result.rb = vertical
+ ? (get<1, 1>(s1) - get<0, 1>(s2)) / dy2
+ : (get<1, 0>(s1) - get<0, 0>(s2)) / dx2;
+
+ result.is_type = is_collinear_overlap;
+ // Make sure a<b and a>= 0 and b<=1
+ if (result.ra > result.rb)
+ {
+ std::swap(result.ra, result.rb);
+ result.is_type = is_collinear_overlap_opposite;
+ }
+ if (result.ra < 0.0) result.ra = 0.0;
+ if (result.rb > 1.0) result.rb = 1.0;
+
+ // Calculate first intersection point
+ *out = P(get<0, 0>(s2) + result.ra * dx2, get<0, 1>(s2) + result.ra * dy2);
+ out++;
+
+ if (equals(result.ra, result.rb))
+ {
+ // Intersect with overlap at one point, segments connect
+ // They might connect in opposite direction and give different result (TODO)
+ result.is_type = is_collinear_connect;
+ return result;
+ }
+
+ // Calculate second intersection point
+ *out = P(get<0, 0>(s2) + result.rb * dx2, get<0, 1>(s2) + result.rb * dy2);
+ out++;
+ return result;
+ }
+ }
+
+ // Segments are parallel
+ result.is_type = is_parallel;
+ return result;
+ }
+
+ // Segments do intersect. Determinant d is nonzero.
+ result.ra = double(a) / double(d);
+ result.rb = double(b) / double(d);
+
+ // Check if intersection is on segment
+ if(result.ra >= 0.0 && result.ra <= 1.0
+ && result.rb >= 0.0 && result.rb <= 1.0)
+ {
+ // This is the normal case. All above are exceptions. Calculate intersection point.
+ *out = P(get<0, 0>(s1) + result.ra * dx1, get<0, 1>(s1) + result.ra * dy1);
+ out++;
+
+ result.is_type = is_intersect;
+ return result;
+ }
+
+ result.is_type = is_intersect_no;
+ return result;
+ }
+
+
+} // namespace
+
+
+#endif //_GEOMETRY_INTERSECTION_SEGMENT_HPP
+
+

Added: sandbox/ggl/boost/ggl/geometry/algorithms/length.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/length.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,151 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_LENGTH_HPP
+#define _GEOMETRY_LENGTH_HPP
+
+#include <iterator>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/cs.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+
+/*!
+\defgroup length length calculation
+The length algorithm is implemented for the linestring and the multi_linestring geometry and results
+in the length of the linestring. If the points of a linestring have coordinates expressed in kilometers,
+the length of the line is expressed in kilometers as well.
+\par Example:
+Example showing length calculation
+\dontinclude doxygen_examples.cpp
+\skip example_length_linestring_iterators1
+\line {
+\until }
+*/
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace length
+ {
+
+ /*!
+ \brief Internal, calculates length of a linestring using iterator pairs and specified strategy
+ \note for_each could be used here, now that point_type is changed by boost range iterator
+ */
+ template<typename R, typename S>
+ inline double length_range(const R& range, const S& strategy)
+ {
+ double sum = 0.0;
+
+ typedef typename boost::range_const_iterator<R>::type IT;
+ IT it = boost::begin(range);
+ if (it != boost::end(range))
+ {
+ IT previous = it++;
+ while(it != boost::end(range))
+ {
+ // Add point-point distance using the return type belonging to strategy
+ sum += strategy(*previous, *it);
+ previous = it++;
+ }
+ }
+ return sum;
+ }
+
+
+ }
+ } // namespace impl
+ #endif
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G>
+ struct length
+ {
+ };
+
+ // Partial specializations
+ template <typename G>
+ struct length<linestring_tag, G>
+ {
+
+ inline static double calculate(const G& range)
+ {
+ typedef typename boost::range_value<G>::type P;
+ typedef typename cs_tag<P>::type TAG;
+ return impl::length::length_range(range,
+ typename strategy_distance<TAG, TAG, P, P>::type());
+ }
+
+ template<typename S>
+ inline static double calculate(const G& range, const S& strategy)
+ {
+ return impl::length::length_range(range, strategy);
+ }
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Calculate length of a geometry
+ \ingroup length
+ \details The function length returns the length of a geometry, using the default distance-calculation-strategy
+ \param geometry the geometry, being a geometry::linestring, vector, iterator pair, or any other boost compatible range
+ \return the length
+ Example showing length calculation on a vector
+ \dontinclude doxygen_examples.cpp
+ \skip example_length_linestring_iterators2
+ \line {
+ \until }
+ */
+ template<typename G>
+ inline double length(const G& geometry)
+ {
+ return dispatch::length<typename tag<G>::type, G>::calculate(geometry);
+ }
+
+ /*!
+ \brief Calculate length of a geometry
+ \ingroup length
+ \details The function length returns the length of a geometry, using specified strategy
+ \param geometry the geometry, being a geometry::linestring, vector, iterator pair, or any other boost compatible range
+ \param strategy strategy to be used for distance calculations.
+ \return the length
+ \par Example:
+ Example showing length calculation using iterators and the Vincenty strategy
+ \dontinclude doxygen_examples.cpp
+ \skip example_length_linestring_iterators3
+ \line {
+ \until }
+ */
+ template<typename G, typename S>
+ inline double length(const G& geometry, const S& strategy)
+ {
+ return dispatch::length<typename tag<G>::type, G>::calculate(geometry, strategy);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_LENGTH_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/make.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/make.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,100 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_MAKE_HPP
+#define _GEOMETRY_MAKE_HPP
+
+
+#include <geometry/algorithms/assign.hpp>
+
+namespace geometry
+{
+
+ /*!
+ \brief Make a geometry
+ \ingroup access
+ \details The Geometry Library uses concepts for all its geometries. Therefore it does not rely
+ on constructors. The "make" functions are object generators creating geometries. There are overloads
+ with two, three, four or six values, which are implemented depending on the geometry specified.
+ \tparam G the geometry type
+ \tparam T the coordinate type
+ \return the geometry
+ */
+ template <typename G, typename T>
+ inline G make(const T& coor1, const T& coor2)
+ {
+ G geometry;
+ dispatch::assignment<typename tag<G>::type, G>::assign(geometry, coor1, coor2);
+ return geometry;
+ }
+
+
+ /*!
+ \brief Make a geometry
+ \ingroup access
+ \return a 3D point, a circle
+ */
+ template <typename G, typename T>
+ inline G make(const T& coor1, const T& coor2, const T& coor3)
+ {
+ G geometry;
+ dispatch::assignment<typename tag<G>::type, G>::assign(geometry, coor1, coor2, coor3);
+ return geometry;
+ }
+
+ template <typename G, typename T>
+ inline G make(const T& coor1, const T& coor2, const T& coor3, const T& coor4)
+ {
+ G geometry;
+ dispatch::assignment<typename tag<G>::type, G>::assign(geometry, coor1, coor2, coor3, coor4);
+ return geometry;
+ }
+
+ template <typename G, typename R>
+ inline G make(const R& range)
+ {
+ G geometry;
+ append(geometry, range);
+ return geometry;
+ }
+
+
+ /*!
+ \brief Create a box with inverse infinite coordinates
+ \ingroup access
+ \details The make_inverse function initialize a 2D or 3D box with large coordinates, the
+ min corner is very large, the max corner is very small
+ \tparam G the geometry type
+ \return the box
+ */
+ template <typename G>
+ inline G make_inverse()
+ {
+ G geometry;
+ dispatch::assignment<typename tag<G>::type, G>::assign_inverse(geometry);
+ return geometry;
+ }
+
+ /*!
+ \brief Create a geometry with "zero" coordinates
+ \ingroup access
+ \details The make_zero function initializes a 2D or 3D point or box with coordinates of zero
+ \tparam G the geometry type
+ \return the geometry
+ */
+ template <typename G>
+ inline G make_zero()
+ {
+ G geometry;
+ dispatch::assignment<typename tag<G>::type, G>::assign_zero(geometry);
+ return geometry;
+ }
+
+};
+
+#endif // _GEOMETRY_MAKE_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/num_points.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/num_points.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,116 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_NUM_POINTS_HPP
+#define _GEOMETRY_NUM_POINTS_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename R>
+ struct range_number_of_points
+ {
+ static inline size_t get(const R& range)
+ {
+ return boost::size(range);
+ }
+ };
+
+ template <typename G, size_t D>
+ struct other_number_of_points
+ {
+ static inline size_t get(const G& geometry)
+ {
+ return D;
+ }
+ };
+
+
+ template <typename P>
+ struct polygon_number_of_points
+ {
+ static inline size_t get(const P& poly)
+ {
+ size_t n = boost::size(exterior_ring(poly));
+ typedef typename boost::range_const_iterator<typename interior_type<P>::type>::type IT;
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ n += boost::size(*it);
+ }
+
+ return n;
+ }
+ };
+
+
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G>
+ struct num_points {};
+
+ template <typename G>
+ struct num_points<point_tag, G> : impl::other_number_of_points<G, 1> {};
+
+ template <typename G>
+ struct num_points<box_tag, G> : impl::other_number_of_points<G, 4> {};
+
+ template <typename G>
+ struct num_points<segment_tag, G> : impl::other_number_of_points<G, 2> {};
+
+ template <typename G>
+ struct num_points<nsphere_tag, G> : impl::other_number_of_points<G, 1> {};
+
+ template <typename G>
+ struct num_points<linestring_tag, G> : impl::range_number_of_points<G> {};
+
+ template <typename G>
+ struct num_points<ring_tag, G> : impl::range_number_of_points<G> {};
+
+ template <typename G>
+ struct num_points<polygon_tag, G> : impl::polygon_number_of_points<G> {};
+
+ } // namespace dispatch
+ #endif
+
+
+
+ /*!
+ \brief get number of points
+ \ingroup access
+ \tparam G geometry type
+ \param geometry the geometry to get number of points from
+ \return number of points
+ \note For linestrings/rings also boost::size or .size() could be used, however,
+ for polygons this is less obvious. So this function is provided. Besides that
+ it is described by OGC (numPoints)
+ */
+ template <typename G>
+ inline size_t num_points(G& geometry)
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ return dispatch::num_points<typename tag<G>::type, NCG>::get(geometry);
+ }
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/algorithms/overlaps.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/overlaps.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,53 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_OVERLAPS_HPP
+#define _GEOMETRY_OVERLAPS_HPP
+
+
+/*!
+\defgroup overlap overlap detection
+\par Source descriptions:
+- Egenhofer: Two objects overlap if they have common interior faces and the bounding faces have common parts
+with the opposite interior faces.
+
+\note Implemented in scratch the Generic Geometry library. Will be reworked internally to support more geometries
+but function call will stay as it is now.
+\see http://docs.codehaus.org/display/GEOTDOC/02+Geometry+Relationships#02GeometryRelationships-Overlaps
+ where is stated that "inside" is not an "overlap", this is probably true and should then be implemented as such.
+
+*/
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief Determines overlap between two geometries
+ \details parameters are now boxes but in the future will be geometries
+ \ingroup overlap
+ \return true if there is overlap
+ */
+ template <typename B>
+ bool overlaps(const B& b1, const B& b2)
+ {
+ return !(
+ get<max_corner, 0>(b1) <= get<min_corner, 0>(b2) ||
+ get<min_corner, 0>(b1) >= get<max_corner, 0>(b2) ||
+ get<max_corner, 1>(b1) <= get<min_corner, 1>(b2) ||
+ get<min_corner, 1>(b1) >= get<max_corner, 1>(b2)
+ );
+
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_OVERLAPS_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/parse.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/parse.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,114 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_PARSE_HPP
+#define _GEOMETRY_PARSE_HPP
+
+#include <string>
+
+#include <boost/concept/requires.hpp>
+
+#include <geometry/core/tags.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+
+
+
+
+/*!
+\defgroup parse parse and assign string values
+*/
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G>
+ struct parsing {};
+
+
+ template <typename P>
+ struct parsing<point_tag, P>
+ {
+ template <typename S>
+ static inline void parse(P& point, const std::string& coor1, const std::string& coor2, const S& strategy)
+ {
+ assert_dimension<P, 2>();
+ dms_result r1 = strategy(coor1.c_str());
+ dms_result r2 = strategy(coor2.c_str());
+ if (r1.axis() == 0) set<0>(point, r1); else set<1>(point, r1);
+ if (r2.axis() == 0) set<0>(point, r2); else set<1>(point, r2);
+ }
+
+
+ static inline void parse(P& point, const std::string& coor1, const std::string& coor2)
+ {
+ // strategy-parser corresponding to degree/radian
+ typename strategy_parse<typename cs_tag<P>::type,
+ typename coordinate_system<P>::type>::type strategy;
+ parse(point, coor1, coor2, strategy);
+ }
+
+
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+
+
+ /*!
+ \brief parse two strings to a spherical/geographic point, using W/E/N/S
+ \ingroup parse
+ */
+ template <typename G>
+ inline void parse(G& geometry, const std::string& coor1, const std::string& coor2)
+ {
+ dispatch::parsing<typename tag<G>::type, G>::parse(geometry, coor1, coor2);
+ }
+
+ /*!
+ \brief parse two strings to a spherical/geographic point, using a specified strategy
+ \details user can use N/E/S/O or N/O/Z/W or other formats
+ \ingroup parse
+ */
+ template <typename G, typename S>
+ inline void parse(G& geometry, const std::string& coor1, const std::string& coor2, const S& strategy)
+ {
+ dispatch::parsing<typename tag<G>::type, G>::parse(geometry, coor1, coor2, strategy);
+ }
+
+ // There will be a parsing function with three arguments (ANGLE,ANGLE,RADIUS)
+
+ template <typename G>
+ inline G parse(const std::string& coor1, const std::string& coor2)
+ {
+ G geometry;
+ dispatch::parsing<typename tag<G>::type, G>::parse(geometry, coor1, coor2);
+ return geometry;
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_PARSE_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/selected.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/selected.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,265 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_SELECTED_HPP
+#define _GEOMETRY_SELECTED_HPP
+
+#include <cmath> // fabs
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/topological_dimension.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/nsphere_concept.hpp>
+
+#include <geometry/algorithms/within.hpp>
+
+
+/*!
+\defgroup selected selection: check if a geometry is "selected" by a point
+
+Checks if one geometry is selected by a point lying within or in the neighborhood of that geometry
+
+\par Geometries:
+- POINT: checks if points are CLOSE TO each other (< search_radius)
+- LINESTRING: checks if selection point is CLOSE TO linestring (< search_radius)
+- RING: checks if selection point is INSIDE the ring, search radius is ignored
+- POLYGON: checks if selection point is INSIDE the polygon, but not inside any of its holes
+
+*/
+
+
+namespace geometry
+{
+ /*!
+ \ingroup impl
+ */
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace selected
+ {
+
+ /*!
+ \details Checks, per dimension, if d[I] not larger than search distance. If true for all
+ dimensions then returns true. If larger stops immediately and returns false.
+ Calculate during this process the sum, which is only valid if returning true
+ */
+ template <typename P1, typename P2, typename T, size_t D, size_t N>
+ struct differences_loop
+ {
+ static inline bool close(const P1& p1, const P2& p2, const T& distance, T& sum)
+ {
+ typedef typename select_coordinate_type<P1, P2>::type PT;
+ typedef typename select_type_traits<PT, T>::type T2;
+ T d = std::abs(boost::numeric_cast<PT>(get<D>(p1)) - boost::numeric_cast<PT>(get<D>(p2)));
+ if (d > distance)
+ {
+ return false;
+ }
+ sum += d * d;
+ return differences_loop<P1, P2, T, D + 1, N>::close(p1, p2, distance, sum);
+ }
+ };
+
+ template <typename P1, typename P2, typename T, size_t N>
+ struct differences_loop<P1, P2, T, N, N>
+ {
+ static inline bool close(const P1&, const P2&, const T&, T&)
+ {
+ return true;
+ }
+ };
+
+
+ template <typename S, typename P, typename T, size_t D, size_t N>
+ struct outside_loop
+ {
+ static inline bool outside(const S& seg, const P& point, const T& distance)
+ {
+ typedef typename select_coordinate_type<S, P>::type PT;
+ PT v = boost::numeric_cast<PT>(get<D>(point));
+
+ PT s1 = get<0, D>(seg);
+ PT s2 = get<1, D>(seg);
+ // Out of reach if left/bottom or right/top of both points making up the segment
+ // I know and currently accept that these comparisons/calculations are done twice per point
+ if ((v < s1 - distance && v < s2 - distance) || (v > s1 + distance && v > s2 + distance))
+ {
+ return true;
+ }
+ return outside_loop<S, P, T, D + 1, N>::outside(seg, point, distance);
+ }
+ };
+
+ template <typename S, typename P, typename T, size_t N>
+ struct outside_loop<S, P, T, N, N>
+ {
+ static inline bool outside(const S&, const P&, const T&)
+ {
+ return false;
+ }
+ };
+
+
+ template <typename P, typename SP, typename T>
+ struct close_to_point
+ {
+ inline static bool calculate(const P& point, const P& selection_point, const T& search_radius)
+ {
+ assert_dimension_equal<P, SP>();
+ static const size_t N = dimension<P>::value;
+ T sum = 0;
+ if (differences_loop<P, SP, T, 0, N>::close(point, selection_point, search_radius, sum))
+ {
+ return sum <= search_radius * search_radius;
+ }
+ return false;
+ }
+ };
+
+ template <typename S, typename P, typename T>
+ struct close_to_segment
+ {
+ inline static bool calculate(const S& seg, const P& selection_point, const T& search_radius)
+ {
+ assert_dimension_equal<S, P>();
+ static const size_t N = dimension<P>::value;
+ if (! outside_loop<S, P, T, 0, N>::outside(seg, selection_point, search_radius))
+ {
+ // Not outside, calculate dot product/square distance to segment.
+ // Call corresponding strategy
+ typedef typename strategy_distance_segment<
+ typename cs_tag<P>::type,
+ typename cs_tag<S>::type, P, S>::type STRATEGY;
+
+ typedef typename STRATEGY::return_type R;
+ STRATEGY strategy;
+ R result = strategy(selection_point, seg);
+ return result < search_radius;
+ }
+
+ return false;
+ }
+ };
+
+
+ template <typename R, typename P, typename T>
+ struct close_to_range
+ {
+ inline static bool calculate(const R& range, const P& selection_point, const T& search_radius)
+ {
+ assert_dimension_equal<R, P>();
+
+ size_t n = boost::size(range);
+ if (n == 0)
+ {
+ // Line with zero points, never close
+ return false;
+ }
+
+ typedef typename point_type<R>::type PR;
+ typedef typename boost::range_const_iterator<R>::type IT;
+ IT it = boost::begin(range);
+
+ if (n == 1)
+ {
+ // Line with one point ==> close to point
+ return close_to_point<P, PR, T>::calculate(*it, selection_point, search_radius);
+ }
+
+ IT previous = it++;
+ while(it != boost::end(range))
+ {
+ typedef segment<const PR> S;
+ S s(*previous, *it);
+ if (close_to_segment<S, P, T>::calculate(s, selection_point, search_radius))
+ {
+ return true;
+ }
+ previous = it++;
+ }
+
+ return false;
+ }
+ };
+
+
+ template <typename TAG, typename G, typename P, typename T>
+ struct use_within
+ {
+ inline static bool calculate(const G& geometry, const P& selection_point, const T& search_radius)
+ {
+ // Note the reversion, point-in-poly -> first point, then poly
+ // Selected-at-point -> first geometry, then point
+ return dispatch::within<point_tag, TAG, P, G>::calculate(selection_point, geometry);
+ }
+ };
+
+ } // namespace selected
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ /*!
+ \tparam TD topological dimension
+ */
+ template <typename TAG, typename G, size_t TD, typename P, typename T>
+ struct selected
+ {
+ };
+
+ template <typename P, typename SP, typename T>
+ struct selected<point_tag, P, 0, SP, T> : impl::selected::close_to_point<P, SP, T> { };
+
+ // SEGMENT, TODO HERE (close_to_segment)
+
+ template <typename L, typename P, typename T>
+ struct selected<linestring_tag, L, 1, P, T> : impl::selected::close_to_range<L, P, T> { };
+
+ template <typename TAG, typename G, typename P, typename T>
+ struct selected<TAG, G, 2, P, T> : impl::selected::use_within<TAG, G, P, T> { };
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Checks if one geometry is selected by a point lying within or in the neighborhood of that geometry
+ \ingroup selected
+ \tparam G type of geometry to check
+ \tparam P type of point to check
+ \tparam T type of search radius
+ \param geometry geometry which might be located in the neighborhood
+ \param selection_point point to select the geometry
+ \param search_radius for points/linestrings: defines radius of "neighborhood" to find things in
+ \return true if point is within or close to the other geometry
+
+ */
+ template<typename G, typename P, typename T>
+ inline bool selected(const G& geometry, const P& selection_point, const T& search_radius)
+ {
+ return dispatch::selected<typename tag<G>::type, G,
+ topological_dimension<G>::value,
+ P, T>::calculate(geometry, selection_point, search_radius);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_SELECTED_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/simplify.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/simplify.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,300 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_SIMPLIFY_HPP
+#define _GEOMETRY_SIMPLIFY_HPP
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/ring_type.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/algorithms/distance.hpp>
+#include <geometry/strategies/agnostic/agn_simplify.hpp>
+
+
+/*!
+\defgroup simplify simplification (generalization)
+\par Source description:
+- Wikipedia: given a 'curve' composed of line segments to find a curve not too dissimilar but that has fewer points
+
+\see http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
+
+\par Performance
+Performance is measured on simplification of a collection of rings, such that 10% of the points is kept.
+- 2776 counties of US are simplified in 0.8 seconds (2.5 seconds or 11.5 seconds in 2 other libraries)
+- 3918 zipcode areas of the Netherlands are simplified in 0.03 seconds (0.1 seconds or 0.45 seconds in 2 other libraries)
+
+
+\par Geometries
+- LINESTRING:
+ \image html simplify_linestring.png
+- POLYGON: simplifying a valid simple polygon (which never intersects itself) might result in an invalid polygon,
+where the simplified rings intersect themselves or one of the other outer or inner rings.
+Efficient simplification of a ring/polygon is still an "Open Problem"
+(http://maven.smith.edu/~orourke/TOPP/P24.html#Problem.24)
+
+*/
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace simplify
+ {
+
+ template<typename R, typename O_IT, typename S>
+ inline void simplify_range_strategy(const R& range, O_IT out, double max_distance, const S& strategy)
+ {
+ if (boost::begin(range) == boost::end(range) || max_distance < 0)
+ {
+ std::copy(boost::begin(range), boost::end(range), out);
+ return;
+ }
+ typename boost::range_const_iterator<R>::type it = boost::begin(range) + 1;
+ if (it == boost::end(range) || it + 1 == boost::end(range))
+ {
+ std::copy(boost::begin(range), boost::end(range), out);
+ return;
+ }
+
+ strategy.simplify(range, out, max_distance);
+ }
+
+ template<typename R, typename O_IT>
+ inline void simplify_range(const R& range, O_IT out, double max_distance)
+ {
+ // Define default strategy
+ typedef typename point_type<R>::type P;
+ typedef typename cs_tag<P>::type TAG;
+ typedef typename strategy_distance_segment<TAG, TAG, P, segment<const P> >::type S;
+
+ strategy::simplify::douglas_peucker<R, O_IT, S> douglas;
+
+ simplify_range_strategy(range, out, max_distance, douglas);
+ }
+
+
+
+ template<typename R, typename O_IT, typename S>
+ inline void simplify_ring(const R& r_in, O_IT out, double max_distance, const S& strategy)
+ {
+ // Call do_container for a ring
+
+ // The first/last point (the closing point of the ring) should maybe be excluded because it
+ // lies on a line with second/one but last. Here it is never excluded.
+
+ // Note also that, especially if max_distance is too large, the output ring might be self intersecting
+ // while the input ring is not, although chances are low in normal polygons
+
+ // Finally the inputring might have 4 points (=correct), the output < 4(=wrong)
+ if (boost::size(r_in) <= 4 || max_distance < 0)
+ {
+ std::copy(boost::begin(r_in), boost::end(r_in), out);
+ }
+ else
+ {
+ simplify_range_strategy(r_in, out, max_distance, strategy);
+ }
+ }
+
+ template<typename Y, typename S>
+ inline void simplify_polygon(const Y& poly_in, Y& poly_out, double max_distance, const S& strategy)
+ {
+ poly_out.clear();
+
+ // Note that if there are inner rings, and distance is too large, they might intersect with the
+ // outer ring in the output, while it didn't in the input.
+ simplify_ring(exterior_ring(poly_in), std::back_inserter(exterior_ring(poly_out)), max_distance, strategy);
+
+ interior_rings(poly_out).resize(boost::size(interior_rings(poly_in)));
+ typedef typename boost::range_const_iterator<typename interior_type<Y>::type>::type CIT;
+ typedef typename boost::range_iterator<typename interior_type<Y>::type>::type IT;
+
+ CIT it_in = boost::begin(interior_rings(poly_in));
+ IT it_out = boost::begin(interior_rings(poly_out));
+
+ for (; it_in != boost::end(interior_rings(poly_in)); it_in++, it_out++)
+ {
+ simplify_ring(*it_in, std::back_inserter(*it_out), max_distance, strategy);
+ }
+ }
+
+ template<typename Y>
+ inline void simplify_polygon(const Y& poly_in, Y& poly_out, double max_distance)
+ {
+ // Define default strategy
+ typedef typename ring_type<Y>::type R;
+ typedef std::back_insert_iterator<R> O_IT;
+
+ typedef typename point_type<Y>::type P;
+ typedef typename cs_tag<P>::type TAG;
+ typedef typename strategy_distance_segment<TAG, TAG, P, segment<const P> >::type S;
+
+ strategy::simplify::douglas_peucker<R, O_IT, S> douglas;
+
+ simplify_polygon(poly_in, poly_out, max_distance, douglas);
+ }
+
+
+
+
+ } // namespace simplify
+
+ } // namespace impl
+ #endif // DOXYGEN_NO_IMPL
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G>
+ struct simplify
+ {
+ };
+
+ // Partial specializations
+ template <typename R>
+ struct simplify<linestring_tag, R>
+ {
+
+
+ template<typename O_IT, typename S>
+ inline static void calculate(const R& range, O_IT out, double max_distance, const S& strategy)
+ {
+ strategy.simplify(range, out, max_distance);
+ }
+
+ template<typename O_IT>
+ inline static void calculate(const R& range, O_IT out, double max_distance)
+ {
+ // Define default strategy
+ typedef typename point_type<R>::type P;
+ typedef typename cs_tag<P>::type TAG;
+ typedef typename strategy_distance_segment<TAG, TAG, P, segment<const P> >::type S;
+
+ strategy::simplify::douglas_peucker<R, O_IT, S> douglas;
+
+ impl::simplify::simplify_range_strategy(range, out, max_distance, douglas);
+ }
+
+ };
+
+ template <typename P>
+ struct simplify<polygon_tag, P>
+ {
+ /// Simplify a polygon, using a strategy
+ template<typename S>
+ inline static void calculate(const P& poly_in, P& poly_out, double max_distance, const S& strategy)
+ {
+ impl::simplify::simplify_polygon(poly_in, poly_out, max_distance, strategy);
+ }
+
+ /// Simplify a polygon
+ inline static void calculate(const P& poly_in, P& poly_out, double max_distance)
+ {
+ impl::simplify::simplify_polygon(poly_in, poly_out, max_distance);
+ }
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+
+
+ // Model 1, using output iterator
+
+ /*!
+ \brief Simplify a geometry
+ \ingroup simplify
+ \details The simplify algorithm removes points, keeping the shape as much as possible.
+ This version of simplify uses an output iterator
+ \param geometry the geometry to be simplified, being a geometry::linestring, vector, iterator pair, or any other boost compatible range
+ \param out output iterator, outputs all simplified points
+ \param max_distance distance (in units of input coordinates) of a vertex to other segments to be removed
+ \par Example:
+ The simplify algorithm can be used as following:
+ \dontinclude doxygen_examples.cpp
+ \skip example_simplify_linestring1
+ \line {
+ \until }
+ */
+ template<typename G, typename O>
+ inline void simplify(const G& geometry, O out, double max_distance)
+ {
+ dispatch::simplify<typename tag<G>::type, G>::calculate(geometry, out, max_distance);
+ }
+
+ /*!
+ \brief Simplify a geometry
+ \ingroup simplify
+ \details The simplify algorithm removes points, keeping the shape as much as possible.
+ This version of simplify uses an output iterator and a simplify strategy
+ \param geometry the geometry to be simplified, being a geometry::linestring, vector, iterator pair, or any other boost compatible range
+ \param out output iterator, outputs all simplified points
+ \param max_distance distance (in units of input coordinates) of a vertex to other segments to be removed
+ \param strategy simplify strategy to be used for simplification, might include point-distance strategy
+ \par Example:
+ The simplify algorithm with strategy can be used as following:
+ \dontinclude doxygen_examples.cpp
+ \skip example_simplify_linestring2
+ \line {
+ \until }
+ */
+ template<typename G, typename O, typename S>
+ inline void simplify(const G& geometry, O out, double max_distance, const S& strategy)
+ {
+ dispatch::simplify<typename tag<G>::type, G>::calculate(geometry, out, max_distance, strategy);
+ }
+
+
+
+ // Model 2, where output is same type as input
+
+ /*!
+ \brief Simplify a geometry
+ \ingroup simplify
+ \details This version of simplify simplifies a geometry using the default strategy (Douglas Peucker),
+ where the output is of the same geometry type as the input.
+ \param geometry input geometry, to be simplified
+ \param out output geometry, simplified version of the input geometry
+ \param max_distance distance (in units of input coordinates) of a vertex to other segments to be removed
+ */
+ template<typename G>
+ inline void simplify(const G& geometry, G& out, double max_distance)
+ {
+ dispatch::simplify<typename tag<G>::type, G>::calculate(geometry, out, max_distance);
+ }
+
+
+
+ /*!
+ \brief Simplify a geometry
+ \ingroup simplify
+ \details This version of simplify simplifies a geometry using a specified strategy
+ where the output is of the same geometry type as the input.
+ \param geometry input geometry, to be simplified
+ \param out output geometry, simplified version of the input geometry
+ \param max_distance distance (in units of input coordinates) of a vertex to other segments to be removed
+ \param strategy simplify strategy to be used for simplification, might include point-distance strategy
+ */
+ template<typename G, typename S>
+ inline void simplify(const G& geometry, G& out, double max_distance, const S& strategy)
+ {
+ dispatch::simplify<typename tag<G>::type, G>::calculate(geometry, out, max_distance, strategy);
+ }
+
+} // namespace geometry
+
+#endif // _GEOMETRY_SIMPLIFY_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/transform.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/transform.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,262 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_TRANSFORM_HPP
+#define _GEOMETRY_TRANSFORM_HPP
+
+#include <cmath>
+#include <iterator>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/ring_type.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/geometries/segment.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+#include <geometry/algorithms/clear.hpp>
+
+
+/*!
+\defgroup transform transformations
+\brief Transforms from one geometry to another geometry, optionally using a strategy
+\details The transform algorithm automatically transforms from one coordinate system to another coordinate system.
+If the coordinate system of both geometries are the same, the geometry is copied. All point(s of the geometry)
+are transformed.
+
+There is a version without a strategy, transforming automatically, and there is a version with a strategy.
+
+This function has a lot of appliances, for example
+- transform from spherical coordinates to cartesian coordinates, and back
+- transform from geographic coordinates to cartesian coordinates (projections) and back
+- transform from degree to radian, and back
+- transform from and to cartesian coordinates (mapping, translations, etc)
+
+The automatic transformations look to the coordinate system family, and dimensions, of the point type and by this
+apply the strategy (internally bounded by traits classes).
+
+\par Examples:
+The example below shows automatic transformations to go from one coordinate system to another one:
+\dontinclude doxygen_2.cpp
+\skip example_for_transform()
+\skipline XYZ
+\until endl;
+
+The next example takes another approach and transforms from Cartesian to Cartesian:
+\skipline XY
+\until endl;
+See also \link p03_projmap_example.cpp the projmap example \endlink
+where this last one plus a transformation using a projection are used.
+
+\note Not every possibility is yet worked out, e.g. polar coordinate system is ignored until now
+\note This "transform" is broader then geodetic datum transformations, those are currently not worked out
+
+*/
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace transform
+ {
+ template <typename P1, typename P2, typename S>
+ inline bool transform_point(const P1& p1, P2& p2, const S& strategy)
+ {
+ return strategy(p1, p2);
+ }
+
+ template <typename P_OUT, typename O_IT, typename R, typename S>
+ inline bool transform_range_out(const R& range, O_IT out, const S& strategy)
+ {
+ P_OUT p_out;
+ for(typename boost::range_const_iterator<R>::type it = boost::begin(range);
+ it != boost::end(range); it++)
+ {
+ if (! transform_point(*it, p_out, strategy))
+ {
+ return false;
+ }
+ *out = p_out;
+ out++;
+ }
+ return true;
+ }
+
+ template <typename P1, typename P2, typename S>
+ inline bool transform_polygon(const P1& poly1, P2& poly2, const S& strategy)
+ {
+ typedef typename interior_type<P1>::type IR1;
+ typedef typename interior_type<P2>::type IR2;
+ typedef typename ring_type<P1>::type R1;
+ typedef typename ring_type<P2>::type R2;
+
+ typedef typename point_type<P2>::type POINT2;
+
+ geometry::clear(poly2);
+
+ if (! transform_range_out<POINT2>(exterior_ring(poly1), std::back_inserter(exterior_ring(poly2)), strategy))
+ {
+ return false;
+ }
+
+ interior_rings(poly2).resize(boost::size(interior_rings(poly1)));
+
+ typename boost::range_const_iterator<IR1>::type it1 = boost::begin(interior_rings(poly1));
+ typename boost::range_iterator<IR2>::type it2 = boost::begin(interior_rings(poly2));
+ for ( ; it1 != boost::end(interior_rings(poly1)); it1++, it2++)
+ {
+ if (! transform_range_out<POINT2>(*it1, std::back_inserter(*it2), strategy))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+ template <typename P1, typename P2>
+ struct select_strategy
+ {
+ typedef typename strategy_transform<
+ typename cs_tag<P1>::type,
+ typename cs_tag<P2>::type,
+ typename coordinate_system<P1>::type,
+ typename coordinate_system<P2>::type,
+ dimension<P1>::value,
+ dimension<P2>::value,
+ P1, P2>::type type;
+ };
+
+
+
+
+ template <typename R1, typename R2>
+ struct transform_range
+ {
+ template <typename S>
+ inline static bool calculate(const R1& range1, R2& range2, const S& strategy)
+ {
+ typedef typename point_type<R2>::type P2;
+ clear(range2);
+ return transform_range_out<P2>(range1, std::back_inserter(range2), strategy);
+ }
+
+ inline static bool calculate(const R1& range1, R2& range2)
+ {
+ typename select_strategy<typename point_type<R1>::type,
+ typename point_type<R2>::type>::type strategy;
+ return calculate(range1, range2, strategy);
+ }
+ };
+
+ } // namespace transform
+
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG1, typename TAG2, typename G1, typename G2>
+ struct transform {};
+
+
+ template <typename P1, typename P2>
+ struct transform<point_tag, point_tag, P1, P2>
+ {
+ template <typename S>
+ inline static bool calculate(const P1& p1, P2& p2, const S& strategy)
+ {
+ return impl::transform::transform_point(p1, p2, strategy);
+ }
+
+ inline static bool calculate(const P1& p1, P2& p2)
+ {
+ typename impl::transform::select_strategy<P1, P2>::type strategy;
+ return calculate(p1, p2, strategy);
+ }
+ };
+
+
+ template <typename L1, typename L2>
+ struct transform<linestring_tag, linestring_tag, L1, L2> : impl::transform::transform_range<L1, L2> {};
+
+
+ template <typename R1, typename R2>
+ struct transform<ring_tag, ring_tag, R1, R2> : impl::transform::transform_range<R1, R2> {};
+
+ template <typename P1, typename P2>
+ struct transform<polygon_tag, polygon_tag, P1, P2>
+ {
+ template <typename S>
+ inline static bool calculate(const P1& p1, P2& p2, const S& strategy)
+ {
+ return impl::transform::transform_polygon(p1, p2, strategy);
+ }
+
+ inline static bool calculate(const P1& p1, P2& p2)
+ {
+ typename impl::transform::select_strategy<
+ typename point_type<P1>::type,
+ typename point_type<P2>::type>::type strategy;
+ return calculate(p1, p2, strategy);
+ }
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+
+
+
+ /*!
+ \brief Transforms from one geometry to another geometry using a strategy
+ \ingroup transform
+ \tparam G1 first geometry type
+ \tparam G2 second geometry type
+ \tparam S strategy
+ \param geometry1 first geometry
+ \param geometry2 second geometry
+ \param strategy the strategy to be used for transformation
+ */
+ template <typename G1, typename G2, typename S>
+ inline bool transform(const G1& geometry1, G2& geometry2, const S& strategy)
+ {
+ return dispatch::transform<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2, strategy);
+ }
+
+ /*!
+ \brief Transforms from one geometry to another geometry using a strategy
+ \ingroup transform
+ \tparam G1 first geometry type
+ \tparam G2 second geometry type
+ \param geometry1 first geometry
+ \param geometry2 second geometry
+ \return true if the transformation could be done
+ */
+ template <typename G1, typename G2>
+ inline bool transform(const G1& geometry1, G2& geometry2)
+ {
+ return dispatch::transform<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2);
+ }
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_TRANSFORM_HPP

Added: sandbox/ggl/boost/ggl/geometry/algorithms/within.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/algorithms/within.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,355 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_WITHIN_HPP
+#define _GEOMETRY_WITHIN_HPP
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/nsphere_concept.hpp>
+
+#include <geometry/core/cs.hpp>
+
+#include <geometry/algorithms/distance.hpp>
+#include <geometry/algorithms/make.hpp>
+
+#include <geometry/util/loop.hpp>
+
+
+#include <geometry/strategies/strategies.hpp>
+
+
+/*!
+\defgroup within within: examine if one geometry is within another geometry (a.o. point in polygon)
+
+\par Source descriptions:
+- OGC: Returns 1 (TRUE) if this geometric object is "spatially within" another Geometry.
+
+\par Performance
+2776 within determinations using bounding box and polygon are done in 0.09 seconds (other libraries: 0.14 seconds, 3.0 seconds, 3.8)
+
+\par Example:
+The within algorithm is used as following:
+\dontinclude doxygen_examples.cpp
+\skip example_within
+\line {
+\until }
+\par Geometries:
+- POINT + POLYGON: The well-known point-in-polygon, returning true if a point falls within a polygon (and not
+ within one of its holes) \image html within_polygon.png
+- POINT + RING: returns true if point is completely within a ring \image html within_ring.png
+*/
+
+
+namespace geometry
+{
+ /*!
+ \ingroup impl
+ */
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace within
+ {
+
+ // Within, should return true if one geometry falls completely within another geometry
+ // Geometries can lie in something with an area, so in an box, circle, linear_ring,polygon
+
+ //-------------------------------------------------------------------------------------------------------
+ // Implementation for boxes. Supports boxes in 2 or 3 dimensions, in Euclidian system
+ // Todo: implement as strategy
+ //-------------------------------------------------------------------------------------------------------
+ template <typename P, typename B, size_t D, size_t N>
+ struct point_in_box
+ {
+ static bool inside(const P& p, const B& b)
+ {
+ if (get<D>(p) <= get<min_corner, D>(b) || get<D>(p) >= get<max_corner, D>(b))
+ {
+ return false;
+ }
+
+ return point_in_box<P, B, D + 1, N>::inside(p, b);
+ }
+ };
+
+ template <typename P, typename B, size_t N>
+ struct point_in_box<P, B, N, N>
+ {
+ static bool inside(const P& p, const B& b)
+ {
+ return true;
+ }
+ };
+
+
+ //-------------------------------------------------------------------------------------------------------
+ // Implementation for n-spheres. Supports circles or spheres, in 2 or 3 dimensions, in Euclidian system
+ // Circle center might be of other point-type as geometry
+ // Todo: implement as strategy
+ //-------------------------------------------------------------------------------------------------------
+ template<typename P, typename C>
+ inline bool point_in_circle(const P& p, const C& c)
+ {
+ assert_dimension<C, 2>();
+ typedef typename point_type<C>::type PC;
+
+ typedef typename strategy_distance<typename cs_tag<P>::type,
+ typename cs_tag<PC>::type,
+ P, PC>::type S;
+ typedef typename S::return_type RET;
+
+ P center = geometry::make<P>(get<0>(c), get<1>(c));
+ S distance;
+ RET r = distance(p, center);
+ RET rad = make_distance_result<RET>(get_radius<0>(c));
+ return r < rad;
+ }
+ /// 2D version
+ template<typename T, typename C>
+ inline bool point_in_circle(const T& coor1, const T& coor2, const C& c)
+ {
+ typedef typename point_type<C>::type P;
+ P p = geometry::make<P>(coor1, coor2);
+ return point_in_circle(p, c);
+ }
+
+
+ template<typename B, typename C>
+ inline bool box_in_circle(const B& b, const C& c)
+ {
+ typedef typename point_type<B>::type P;
+
+ // Currently only implemented for 2d geometries
+ assert_dimension<P, 2>();
+ assert_dimension<C, 2>();
+
+ // Box: all four points must lie within circle
+
+ // Check points lower-left and upper-right, then lower-right and upper-left
+ return point_in_circle(get<min_corner, 0>(b), get<min_corner, 1>(b), c)
+ && point_in_circle(get<max_corner, 0>(b), get<max_corner, 1>(b), c)
+ && point_in_circle(get<min_corner, 0>(b), get<max_corner, 1>(b), c)
+ && point_in_circle(get<max_corner, 0>(b), get<min_corner, 1>(b), c);
+ }
+
+
+ // Generic "range-in-circle", true if all points within circle
+ template<typename R, typename C>
+ inline bool range_in_circle(const R& range, const C& c)
+ {
+ assert_dimension<R, 2>();
+ assert_dimension<C, 2>();
+ for (typename boost::range_const_iterator<R>::type it = boost::begin(range);
+ it != boost::end(range); it++)
+ {
+ if (! point_in_circle(*it, c))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ template<typename Y, typename C>
+ inline bool polygon_in_circle(const Y& poly, const C& c)
+ {
+ return range_in_circle(exterior_ring(poly), c);
+ }
+
+
+
+
+ template<typename P, typename R, typename S>
+ inline bool point_in_ring(const P& p, const R& r, const S& strategy)
+ {
+ if (boost::size(r) < 4)
+ {
+ return false;
+ }
+
+ typename S::state_type state(p);
+ if (loop(r, strategy, state))
+ {
+ return state.within();
+ }
+ return false;
+ }
+
+ // Polygon: in exterior ring, and if so, not within interior ring(s)
+ template<typename P, typename Y, typename S>
+ inline bool point_in_polygon(const P& p, const Y& poly, const S& strategy)
+ {
+ if (point_in_ring(p, exterior_ring(poly), strategy))
+ {
+ typedef typename boost::range_const_iterator<typename interior_type<Y>::type>::type IT;
+ for (IT i = boost::begin(interior_rings(poly)); i != boost::end(interior_rings(poly)); i++)
+ {
+ if (point_in_ring(p, *i, strategy))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+
+
+
+
+
+ } // namespace within
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ template <typename TAG1, typename TAG2, typename G1, typename G2>
+ struct within {};
+
+
+ template <typename P, typename B>
+ struct within<point_tag, box_tag, P, B>
+ {
+ inline static bool calculate(const P& p, const B& b)
+ {
+ assert_dimension_equal<P, B>();
+ return impl::within::point_in_box<P, B,
+ 0, dimension<P>::value>::inside(p, b);
+ }
+ };
+
+ template <typename P, typename C>
+ struct within<point_tag, nsphere_tag, P, C>
+ {
+ inline static bool calculate(const P& p, const C& c)
+ {
+ return impl::within::point_in_circle(p, c);
+ }
+ };
+
+ template <typename B, typename C>
+ struct within<box_tag, nsphere_tag, B, C>
+ {
+ inline static bool calculate(const B& b, const C& c)
+ {
+ return impl::within::box_in_circle(b, c);
+ }
+ };
+
+ template <typename R, typename C>
+ struct within<linestring_tag, nsphere_tag, R, C>
+ {
+ inline static bool calculate(const R& ln, const C& c)
+ {
+ return impl::within::range_in_circle(ln, c);
+ }
+ };
+
+ template <typename R, typename C>
+ struct within<ring_tag, nsphere_tag, R, C>
+ {
+ inline static bool calculate(const R& r, const C& c)
+ {
+ return impl::within::range_in_circle(r, c);
+ }
+ };
+
+ template <typename Y, typename C>
+ struct within<polygon_tag, nsphere_tag, Y, C>
+ {
+ inline static bool calculate(const Y& poly, const C& c)
+ {
+ return impl::within::polygon_in_circle(poly, c);
+ }
+ };
+
+ template <typename P, typename R>
+ struct within<point_tag, ring_tag, P, R>
+ {
+ inline static bool calculate(const P& p, const R& r)
+ {
+ typedef typename boost::range_value<R>::type PS;
+ return impl::within::point_in_ring(p, r,
+ typename strategy_within<
+ typename cs_tag<P>::type, typename cs_tag<PS>::type,
+ P, PS>::type());
+ }
+ };
+
+ template <typename P, typename Y>
+ struct within<point_tag, polygon_tag, P, Y>
+ {
+ inline static bool calculate(const P& point, const Y& poly)
+ {
+ typedef typename point_type<Y>::type PS;
+ return impl::within::point_in_polygon(point, poly,
+ typename strategy_within<
+ typename cs_tag<P>::type, typename cs_tag<PS>::type,
+ P, PS>::type());
+ }
+
+ template<typename S>
+ inline static bool calculate(const P& point, const Y& poly, const S& strategy)
+ {
+ return impl::within::point_in_polygon(point, poly, strategy);
+ }
+ };
+
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Within check
+ \ingroup within
+ \param geometry1 geometry which might be within the second geometry
+ \param geometry2 geometry which might contain the first geometry
+ \return true if geometry1 is completely contained within geometry2, else false
+ \note The default strategy is used for within detection
+ */
+ template<typename G1, typename G2>
+ inline bool within(const G1& geometry1, const G2& geometry2)
+ {
+ return dispatch::within<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2);
+ }
+
+ /*!
+ \brief Within check using a strategy
+ \ingroup within
+ \param geometry1 geometry which might be within the second geometry
+ \param geometry2 geometry which might contain the first geometry
+ \param strategy strategy to be used
+ \return true if geometry1 is completely contained within geometry2, else false
+ */
+ template<typename G1, typename G2, typename S>
+ inline bool within(const G1& geometry1, const G2& geometry2, const S& strategy)
+ {
+ return dispatch::within<typename tag<G1>::type,
+ typename tag<G2>::type, G1, G2>::calculate(geometry1, geometry2, strategy);
+ }
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_WITHIN_HPP

Added: sandbox/ggl/boost/ggl/geometry/arithmetic/arithmetic.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/arithmetic/arithmetic.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,179 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_ARITHMETIC_HPP
+#define _GEOMETRY_ARITHMETIC_HPP
+
+
+#include <functional>
+
+#include <boost/call_traits.hpp>
+#include <boost/concept/requires.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/util/for_each_coordinate.hpp>
+
+
+/*!
+\defgroup arithmetic arithmetic: arithmetic operations on points
+*/
+
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename P>
+ struct param
+ {
+ typedef typename boost::call_traits
+ <typename coordinate_type<P>::type>
+ ::param_type type;
+ };
+
+
+ template <typename C, template <typename> class Function>
+ struct value_operation
+ {
+ C m_value;
+ value_operation(C value): m_value(value) {}
+
+ template <typename P, int I>
+ void run(P& point) const
+ { set<I>(point, Function<C>()(get<I>(point), m_value)); }
+ };
+
+ template <typename PS, template <typename> class Function>
+ struct point_operation
+ {
+ typedef typename coordinate_type<PS>::type T;
+ const PS& m_source_point;
+ point_operation(const PS& point): m_source_point(point) {}
+
+ template <typename PD, int I>
+ void run(PD& dest_point) const
+ {
+ set<I>(dest_point, Function<T>()(get<I>(dest_point), get<I>(m_source_point)));
+ }
+ };
+
+ } // namespace impl
+ #endif
+
+
+ /*!
+ \brief Adds a value to each coordinate of a point
+ \ingroup arithmetic
+ \details
+ \param p point
+ \param value value to add
+ */
+ template <typename P>
+ BOOST_CONCEPT_REQUIRES(((Point<P>)),
+ (void)) add_value(P& p, typename impl::param<P>::type value)
+ { for_each_coordinate(p, impl::value_operation<typename coordinate_type<P>::type, std::plus>(value)); }
+
+ /*!
+ \brief Adds a point to another
+ \ingroup arithmetic
+ \details The coordinates of the second point will be added to those of the first point. The second point is not modified.
+ \param p1 first point
+ \param p2 second point
+ */
+ template <typename P1, typename P2>
+ BOOST_CONCEPT_REQUIRES(((Point<P1>)) ((ConstPoint<P2>)),
+ (void)) add_point(P1& p1, const P2& p2)
+ { for_each_coordinate(p1, impl::point_operation<P2, std::plus>(p2)); }
+
+
+
+ /*!
+ \brief Subtracts a value to each coordinate of a point
+ \ingroup arithmetic
+ \details
+ \param p point
+ \param value value to subtract
+ */
+ template <typename P>
+ BOOST_CONCEPT_REQUIRES(((Point<P>)),
+ (void)) subtract_value(P& p, typename impl::param<P>::type value)
+ { for_each_coordinate(p, impl::value_operation<typename coordinate_type<P>::type, std::minus>(value)); }
+
+ /*!
+ \brief Subtracts a point to another
+ \ingroup arithmetic
+ \details The coordinates of the second point will be subtracted to those of the first point. The second point is not modified.
+ \param p1 first point
+ \param p2 second point
+ */
+ template <typename P1, typename P2>
+ BOOST_CONCEPT_REQUIRES(((Point<P1>)) ((ConstPoint<P2>)),
+ (void)) subtract_point(P1& p1, const P2& p2)
+ { for_each_coordinate(p1, impl::point_operation<P2, std::minus>(p2)); }
+
+
+
+ /*!
+ \brief Multiplies each coordinate of a point by a value
+ \ingroup arithmetic
+ \details
+ \param p point
+ \param value value to multiply by
+ */
+ template <typename P>
+ BOOST_CONCEPT_REQUIRES(((Point<P>)),
+ (void)) multiply_value(P& p, typename impl::param<P>::type value)
+ { for_each_coordinate(p, impl::value_operation<typename coordinate_type<P>::type, std::multiplies>(value)); }
+
+ /*!
+ \brief Multiplies a point by another
+ \ingroup arithmetic
+ \details The coordinates of the second point will be multiplied by those of the first point. The second point is not modified.
+ \param p1 first point
+ \param p2 second point
+ \note This is *not* a dot, cross or wedge product. It is a mere field-by-field multiplication.
+ */
+ template <typename P1, typename P2>
+ BOOST_CONCEPT_REQUIRES(((Point<P1>)) ((ConstPoint<P2>)),
+ (void)) multiply_point(P1& p1, const P2& p2)
+ { for_each_coordinate(p1, impl::point_operation<P2, std::multiplies>(p2)); }
+
+
+
+ /*!
+ \brief Divides each coordinate of a point by a value
+ \ingroup arithmetic
+ \details
+ \param p point
+ \param value value to divide by
+ */
+ template <typename P>
+ BOOST_CONCEPT_REQUIRES(((Point<P>)),
+ (void)) divide_value(P& p, typename impl::param<P>::type value)
+ { for_each_coordinate(p, impl::value_operation<typename coordinate_type<P>::type, std::divides>(value)); }
+
+ /*!
+ \brief Divides a point by another
+ \ingroup arithmetic
+ \details The coordinates of the second point will be divided by those of the first point. The second point is not modified.
+ \param p1 first point
+ \param p2 second point
+ */
+ template <typename P1, typename P2>
+ BOOST_CONCEPT_REQUIRES(((Point<P1>)) ((ConstPoint<P2>)),
+ (void)) divide_point(P1& p1, const P2& p2)
+ { for_each_coordinate(p1, impl::point_operation<P2, std::divides>(p2)); }
+
+
+} // namespace geometry
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/arithmetic/dot_product.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/arithmetic/dot_product.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,67 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_DOT_PRODUCT_HPP
+#define _GEOMETRY_DOT_PRODUCT_HPP
+
+
+#include <boost/concept/requires.hpp>
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <int I, int N>
+ struct dot_product_maker
+ {
+ template <typename P1, typename P2>
+ static typename coordinate_type<P1>::type
+ run(const P1& p1, const P2& p2)
+ {
+ return get<I>(p1)*get<I>(p2)
+ + dot_product_maker<I+1, N>::run(p1, p2);
+ }
+ };
+
+ template <int N>
+ struct dot_product_maker<N, N>
+ {
+ template <typename P1, typename P2>
+ static typename coordinate_type<P1>::type
+ run(const P1& p1, const P2& p2)
+ {
+ return get<N>(p1)*get<N>(p2);
+ }
+ };
+
+ } // namespace impl
+ #endif
+
+
+ /*!
+ \brief Computes the dot product of 2 points
+ \ingroup arithmetic
+ \param p1 first point
+ \param p2 second point
+ \return the dot product
+ */
+ template <typename P1, typename P2>
+ BOOST_CONCEPT_REQUIRES(((ConstPoint<P1>)) ((ConstPoint<P2>)),
+ (typename coordinate_type<P1>::type)) dot_product(const P1& p1, const P2& p2)
+ {
+ return impl::dot_product_maker<0, dimension<P1>::value - 1>::run(p1, p2);
+ }
+
+} // namespace geometry
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/access.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/access.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,270 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ACCESS_HPP
+#define _GEOMETRY_ACCESS_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+// #include <boost/mpl/bool.hpp>
+
+#include <geometry/core/coordinate_type.hpp>
+#include <geometry/core/point_type.hpp>
+#include <geometry/core/tag.hpp>
+
+
+
+namespace geometry
+{
+ static const int min_corner = 0;
+ static const int max_corner = 1;
+
+
+ namespace traits
+ {
+ /*!
+ \brief Traits class which gives access (get,set) to points
+ \ingroup traits
+ \par Geometries:
+ - point
+ - n-sphere (circle,sphere) for their center
+ \par Specializations should provide:
+ - static inline T get<I>(const G&)
+ - static inline void set<I>(G&, const T&)
+ \tparam G geometry
+ */
+ template <typename G>
+ struct access {};
+
+
+
+ /*!
+ \brief Traits class defining "get" and "set" to get and set point coordinate values
+ \tparam G geometry (box, segment)
+ \tparam I index (min_corner/max_corner for box, 0/1 for segment)
+ \tparam D dimension
+ \par Geometries:
+ - box
+ - segment
+ \par Specializations should provide:
+ - static inline T get(const G&)
+ - static inline void set(G&, const T&)
+ \ingroup traits
+ */
+ template <typename G, size_t I, size_t D>
+ struct indexed_access {};
+
+
+
+
+ /*!
+ \brief Traits class, optional, indicating that the std-library should be used
+ \details The default geometry (linestring, ring, multi*) follow std:: for
+ its modifying operations (push_back, clear, size, resize, reserve, etc)
+ If they NOT follow the std:: library they should specialize this traits
+ class
+ \ingroup traits
+ \par Geometries:
+ - linestring
+ - linear_ring
+ \par Specializations should provide:
+ - value (defaults to true)
+ */
+ template <typename G>
+ struct use_std
+ {
+ static const bool value = true;
+ };
+
+ }
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+ template <typename TAG, typename G, typename T, size_t D>
+ struct access
+ {
+ //static inline T get(const G& ) {}
+ //static inline void set(G& g, const T& value) {}
+ };
+
+ template <typename TAG, typename G, typename T, size_t I, size_t D>
+ struct indexed_access
+ {
+ //static inline T get(const G& ) {}
+ //static inline void set(G& g, const T& value) {}
+ };
+
+
+
+ template <typename P, typename T, size_t D>
+ struct access<point_tag, P, T, D>
+ {
+ static inline T get(const P& p)
+ {
+ return traits::access<P>::template get<D>(p);
+ }
+ static inline void set(P& p, const T& value)
+ {
+ traits::access<P>::template set<D>(p, value);
+ }
+ };
+
+
+ template <typename S, typename T, size_t D>
+ struct access<nsphere_tag, S, T, D>
+ {
+ static inline T get(const S& s)
+ {
+ return traits::access<S>::template get<D>(s);
+ }
+ static inline void set(S& s, const T& value)
+ {
+ traits::access<S>::template set<D>(s, value);
+ }
+ };
+
+
+ template <typename B, typename T, size_t I, size_t D>
+ struct indexed_access<box_tag, B, T, I, D>
+ {
+ static inline T get(const B& b)
+ {
+ return traits::indexed_access<B, I, D>::get(b);
+ }
+ static inline void set(B& b, const T& value)
+ {
+ traits::indexed_access<B, I, D>::set(b, value);
+ }
+ };
+
+ template <typename S, typename T, size_t I, size_t D>
+ struct indexed_access<segment_tag, S, T, I, D>
+ {
+ static inline T get(const S& segment)
+ {
+ return traits::indexed_access<S, I, D>::get(segment);
+ }
+ static inline void set(S& segment, const T& value)
+ {
+ traits::indexed_access<S, I, D>::set(segment, value);
+ }
+ };
+
+
+ } // namespace core_dispatch
+ #endif
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ // Two dummy tags to distinguish get/set variants below.
+ // They don't have to be specified by the user. The functions are distinguished
+ // by template signature also, but for e.g. GCC this is not enough. So give them
+ // a different signature.
+ struct signature_getset_dimension {};
+ struct signature_getset_index_dimension {};
+ } // namespace impl
+ #endif
+
+
+ /*!
+ \brief get a coordinate value of a point / nsphere
+ \return coordinate value
+ \ingroup access
+ \tparam D dimension
+ \tparam G geometry
+ \param geometry geometry to get coordinate value from
+ \param dummy does not have to be specified
+ */
+ template <size_t D, typename G>
+ inline typename coordinate_type<G>::type get(const G& geometry
+ , impl::signature_getset_dimension* dummy = NULL
+ )
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ return core_dispatch::access<typename tag<G>::type, NCG,
+ typename coordinate_type<NCG>::type, D>::get(geometry);
+ };
+
+
+ /*!
+ \brief assign coordinate value to a point / sphere
+ \ingroup access
+ \tparam D dimension
+ \tparam G geometry
+ \param geometry geometry to assign coordinate to
+ \param value coordinate value to assign
+ \param dummy does not have to be specified
+ */
+ template <size_t D, typename G>
+ inline void set(G& geometry, const typename coordinate_type<G>::type& value
+ , impl::signature_getset_dimension* dummy = NULL
+ )
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ core_dispatch::access<typename tag<G>::type, NCG,
+ typename coordinate_type<NCG>::type, D>::set(geometry, value);
+ }
+
+
+ // Note: doxygen needs a construct to distinguish get/set (like the gcc compiler)
+
+
+ /*!
+ \brief get a coordinate value of a box / segment
+ \return coordinate value
+ \ingroup access
+ \tparam I index, for boxes: min_corner or max_corner. For segment: 0 / 1
+ \tparam D dimension
+ \tparam G geometry
+ \param geometry geometry to get coordinate value from
+ \param dummy does not have to be specified
+ */
+ template <size_t I, size_t D, typename G>
+ inline typename coordinate_type<G>::type get(const G& geometry
+ , impl::signature_getset_index_dimension* dummy = NULL
+ )
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ return core_dispatch::indexed_access<typename tag<G>::type, NCG,
+ typename coordinate_type<NCG>::type, I, D>::get(geometry);
+ };
+
+ /*!
+ \brief assign a coordinate value of a box / segment
+ \ingroup access
+ \tparam I index, for boxes: min_corner or max_corner. For segment: 0 / 1
+ \tparam D dimension
+ \tparam G geometry
+ \param geometry geometry to assign coordinate to
+ \param value coordinate value to assign
+ \param dummy does not have to be specified
+ */
+ template <size_t I, size_t D, typename G>
+ inline void set(G& geometry, const typename coordinate_type<G>::type& value
+ , impl::signature_getset_index_dimension* dummy = NULL
+ )
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ core_dispatch::indexed_access<typename tag<G>::type, NCG,
+ typename coordinate_type<NCG>::type, I, D>::set(geometry, value);
+ }
+
+
+
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/concepts/box_concept.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/concepts/box_concept.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,109 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_BOX_CONCEPT_HPP
+#define _GEOMETRY_BOX_CONCEPT_HPP
+
+
+#include <boost/concept_check.hpp>
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/point_type.hpp>
+
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief Checks box concept, using Boost Concept Check Library and metafunctions
+ \ingroup concepts
+ */
+ template <typename B>
+ struct Box
+ {
+ private :
+ typedef typename point_type<B>::type P;
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <size_t C, size_t D, size_t N>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ B* b;
+ geometry::set<C, D>(*b, geometry::get<C, D>(*b));
+ dimension_checker<C, D + 1, N>::check();
+ }
+ };
+
+ template <size_t C, size_t N>
+ struct dimension_checker<C, N, N>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the Box concept
+ BOOST_CONCEPT_USAGE(Box)
+ {
+ static const size_t N = dimension<B>::value;
+ dimension_checker<min_corner, 0, N>::check();
+ dimension_checker<max_corner, 0, N>::check();
+ }
+ };
+
+
+ /*!
+ \brief Checks Box concept (const version)
+ \ingroup concepts
+ \details The ConstBox concept check the same as the Box concept,
+ but does not check write access.
+ */
+ template <typename B>
+ struct ConstBox
+ {
+ private :
+ typedef typename point_type<B>::type P;
+ typedef typename coordinate_type<B>::type T;
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <size_t C, size_t D, size_t N>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ const B* b = 0;
+ T coord(geometry::get<C, D>(*b));
+ (void)sizeof(coord); // To avoid "unused variable" warnings
+ dimension_checker<C, D + 1, N>::check();
+ }
+ };
+
+ template <size_t C, size_t N>
+ struct dimension_checker<C, N, N>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the ConstBox concept
+ BOOST_CONCEPT_USAGE(ConstBox)
+ {
+ static const size_t N = dimension<B>::value;
+ dimension_checker<min_corner, 0, N>::check();
+ dimension_checker<max_corner, 0, N>::check();
+ }
+ };
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/concepts/linestring_concept.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/concepts/linestring_concept.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,84 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding L.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_LINESTRING_CONCEPT_HPP
+#define _GEOMETRY_LINESTRING_CONCEPT_HPP
+
+
+#include <boost/concept_check.hpp>
+#include <boost/range/concepts.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/point_type.hpp>
+
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/append.hpp>
+
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief Checks linestring concept, using Boost Concept Check Library and metafunctions
+ \ingroup concepts
+ */
+ template <typename L>
+ struct Linestring
+ {
+ private :
+ typedef typename point_type<L>::type P;
+
+ BOOST_CONCEPT_ASSERT( (Point<P>) );
+ BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<L>) );
+
+ public :
+ /// BCCL macro to check the Linestring concept
+ BOOST_CONCEPT_USAGE(Linestring)
+ {
+
+ // Check if it can be modified
+ L* ls;
+ clear(*ls);
+ append(*ls, P());
+ }
+ };
+
+
+ /*!
+ \brief Checks Linestring concept (const version)
+ \ingroup concepts
+ \details The ConstLinestring concept check the same as the Linestring concept,
+ but does not check write access.
+ */
+ template <typename L>
+ struct ConstLinestring
+ {
+ private :
+ typedef typename point_type<L>::type P;
+
+ BOOST_CONCEPT_ASSERT( (ConstPoint<P>) );
+ BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<L>) );
+
+
+ public :
+ /// BCCL macro to check the ConstLinestring concept
+ BOOST_CONCEPT_USAGE(ConstLinestring)
+ {
+ }
+ };
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/concepts/nsphere_concept.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/concepts/nsphere_concept.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,122 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, Geodan Holding S.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_NSPHERE_CONCEPT_HPP
+#define _GEOMETRY_NSPHERE_CONCEPT_HPP
+
+
+#include <boost/concept_check.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/radius.hpp>
+
+
+
+namespace geometry
+{
+ /*!
+ \brief Checks Nsphere concept (const version)
+ \ingroup concepts
+ \details The ConstNsphere concept check the same as the Nsphere concept,
+ but does not check write access.
+ */
+ template <typename S>
+ struct ConstNsphere
+ {
+ private :
+ typedef typename point_type<S>::type P;
+ typedef typename radius_type<S>::type R;
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <size_t D, size_t N>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ typedef typename coordinate_type<S>::type T;
+ const S* s = 0;
+ T coord(geometry::get<D>(*s));
+ (void)sizeof(coord); // To avoid "unused variable" warnings
+ dimension_checker<D + 1, N>::check();
+ }
+ };
+
+ template <size_t N>
+ struct dimension_checker<N, N>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the ConstNsphere concept
+ BOOST_CONCEPT_USAGE(ConstNsphere)
+ {
+ static const size_t N = dimension<S>::value;
+ dimension_checker<0, N>::check();
+ dimension_checker<0, N>::check();
+
+ // Check radius access
+ const S* s = 0;
+ R coord(geometry::get_radius<0>(*s));
+ (void)sizeof(coord); // To avoid "unused variable" warnings
+ }
+ };
+
+
+ /*!
+ \brief Checks nsphere concept, using Boost Concept Check Library and metafunctions
+ \ingroup concepts
+ */
+ template <typename S>
+ struct Nsphere
+ {
+ private :
+ BOOST_CONCEPT_ASSERT((ConstNsphere<S>));
+
+ typedef typename point_type<S>::type P;
+ typedef typename radius_type<S>::type R;
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <size_t D, size_t N>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ S* s;
+ geometry::set<D>(*s, geometry::get<D>(*s));
+ dimension_checker<D + 1, N>::check();
+ }
+ };
+
+ template <size_t N>
+ struct dimension_checker<N, N>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the Nsphere concept
+ BOOST_CONCEPT_USAGE(Nsphere)
+ {
+ static const size_t N = dimension<S>::value;
+ dimension_checker<0, N>::check();
+ dimension_checker<0, N>::check();
+
+ // Check radius access
+ S* s = 0;
+ set_radius<0>(*s, get_radius<0>(*s));
+
+ }
+ };
+
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/concepts/point_concept.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/concepts/point_concept.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,144 @@
+// Generic Geometry Library Point concept
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_POINT_CONCEPT_HPP
+#define _GEOMETRY_POINT_CONCEPT_HPP
+
+
+#include <boost/concept_check.hpp>
+
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/coordinate_dimension.hpp>
+#include <geometry/core/coordinate_system.hpp>
+
+
+/*!
+\defgroup concepts concept checking
+Concepts are used to check if pointtypes provide required implementation. Concept checking
+is done using BCCL (Boost Concept Check Library) and MPL (Meta Programming Library)
+*/
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief Checks point concept, using Boost Concept Check Library and metafunctions
+ \ingroup concepts
+ \details The concept is separated into 4 metafunctions:
+ - \ref geometry::traits::coordinate_type "coordinate_type": provides the type of the coordinates of a point
+ - \ref geometry::traits::coordinate_system "coordinate system": provides the coordinate system in which the point is placed
+ - \ref geometry::traits::dimension "dimension": provides the number of coordinates of a point
+ - \ref geometry::traits::access "access": provides access to the coordinates of a point
+
+ In MPL, a metafunction that provides a type must expose is as "type"
+ and a metafunction that provides a value must expose it as "value", so
+ here the same convention are used: coordinate_type<P>::type and
+ dimension<P>::value provide the type and number of coordinates. This
+ makes them compatible with any MPL and Fusion algorithm and
+ metafunction.
+
+ \par Example:
+ First example, using an own pointtype, for example a legacy point, defining the necessary
+ properties outside the pointtype in a traits class
+ \dontinclude doxygen_examples.cpp
+ \skip example_point_1
+ \until //:\\
+ \par Example:
+ Second example, deriving a pointtype from boost::tuple. It defines the necessary properties
+ itself, so a separate traits class is not necessary.
+ \dontinclude doxygen_examples.cpp
+ \skip example_own_point2
+ \line {
+ \until //:\\
+ */
+ template <typename X>
+ struct Point
+ {
+ private :
+ typedef typename coordinate_type<X>::type ctype;
+ typedef typename coordinate_system<X>::type csystem;
+ enum { ccount = dimension<X>::value };
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <typename P, size_t I, size_t Count>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ P* p;
+ geometry::set<I>(*p, geometry::get<I>(*p));
+ dimension_checker<P, I+1, Count>::check();
+ }
+ };
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <typename P, size_t Count>
+ struct dimension_checker<P, Count, Count>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the Point concept
+ BOOST_CONCEPT_USAGE(Point)
+ {
+ dimension_checker<X, 0, ccount>::check();
+ }
+ };
+
+
+ /*!
+ \brief Checks point concept (const version)
+ \ingroup concepts
+ \details The ConstPoint concept check the same as the Point concept,
+ but does not check write access.
+ */
+ template <typename X>
+ struct ConstPoint
+ {
+ private :
+ typedef typename coordinate_type<X>::type ctype;
+ typedef typename coordinate_system<X>::type csystem;
+ enum { ccount = dimension<X>::value };
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <typename P, size_t I, size_t Count>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ const P* p = 0;
+ ctype coord(geometry::get<I>(*p));
+ (void)sizeof(coord); // To avoid "unused variable" warnings
+ dimension_checker<P, I+1, Count>::check();
+ }
+ };
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <typename P, size_t Count>
+ struct dimension_checker<P, Count, Count>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the ConstPoint concept
+ BOOST_CONCEPT_USAGE(ConstPoint)
+ {
+ dimension_checker<X, 0, ccount>::check();
+ }
+ };
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/concepts/polygon_concept.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/concepts/polygon_concept.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,122 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding P.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_POLYGON_CONCEPT_HPP
+#define _GEOMETRY_POLYGON_CONCEPT_HPP
+
+
+#include <boost/concept_check.hpp>
+#include <boost/range/concepts.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/ring_concept.hpp>
+
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/point_type.hpp>
+#include <geometry/core/ring_type.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/append.hpp>
+
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename P>
+ struct PolygonChecker
+ {
+ typedef typename point_type<P>::type PNT;
+ typedef typename ring_type<P>::type R;
+ typedef typename interior_type<P>::type I;
+
+ BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<I>) );
+
+ void constraints()
+ {
+
+ P* poly;
+ R& e = exterior_ring(*poly);
+ const R& ce = exterior_ring(*poly);
+
+ I& i = interior_rings(*poly);
+ const I& ci = interior_rings(*poly);
+ }
+
+ };
+ }
+ #endif // DOXYGEN_NO_IMPL
+
+ /*!
+ \brief Checks polygon concept, using Boost Concept Check Library and metafunctions
+ \ingroup concepts
+ */
+ template <typename P>
+ struct Polygon : impl::PolygonChecker<P>
+ {
+ private :
+ typedef typename point_type<P>::type PNT;
+ typedef typename ring_type<P>::type R;
+ typedef typename interior_type<P>::type I;
+
+ BOOST_CONCEPT_ASSERT( (Point<PNT>) );
+ BOOST_CONCEPT_ASSERT( (Ring<R>) );
+
+
+ public :
+ /// BCCL macro to check the Polygon concept
+ BOOST_CONCEPT_USAGE(Polygon)
+ {
+ // Check if it can be modified
+ P* poly;
+ clear(*poly);
+ append(*poly, PNT());
+
+ this->constraints();
+
+ }
+ };
+
+
+ /*!
+ \brief Checks Polygon concept (const version)
+ \ingroup concepts
+ \details The ConstPolygon concept check the same as the Polygon concept,
+ but does not check write access.
+ */
+ template <typename P>
+ struct ConstPolygon : impl::PolygonChecker<P>
+ {
+ private :
+ typedef typename point_type<P>::type PNT;
+ typedef typename ring_type<P>::type R;
+ typedef typename interior_type<P>::type I;
+
+ BOOST_CONCEPT_ASSERT( (ConstPoint<PNT>) );
+ BOOST_CONCEPT_ASSERT( (ConstRing<R>) );
+
+
+ public :
+ /// BCCL macro to check the ConstPolygon concept
+ BOOST_CONCEPT_USAGE(ConstPolygon)
+ {
+ this->constraints();
+ }
+ };
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/concepts/ring_concept.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/concepts/ring_concept.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,83 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding R.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_LINEAR_RING_CONCEPT_HPP
+#define _GEOMETRY_LINEAR_RING_CONCEPT_HPP
+
+
+#include <boost/concept_check.hpp>
+#include <boost/range/concepts.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/point_type.hpp>
+
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/append.hpp>
+
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief Checks linestring concept, using Boost Concept Check Library and metafunctions
+ \ingroup concepts
+ */
+ template <typename R>
+ struct Ring
+ {
+ private :
+ typedef typename point_type<R>::type P;
+
+ BOOST_CONCEPT_ASSERT( (Point<P>) );
+ BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<R>) );
+
+
+ public :
+ /// BCCL macro to check the Ring concept
+ BOOST_CONCEPT_USAGE(Ring)
+ {
+ // Check if it can be modified
+ R* ls;
+ clear(*ls);
+ append(*ls, P());
+ }
+ };
+
+
+ /*!
+ \brief Checks Ring concept (const version)
+ \ingroup concepts
+ \details The ConstLinearRing concept check the same as the Ring concept,
+ but does not check write access.
+ */
+ template <typename R>
+ struct ConstRing
+ {
+ private :
+ typedef typename point_type<R>::type P;
+
+ BOOST_CONCEPT_ASSERT( (ConstPoint<P>) );
+ BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<R>) );
+
+ public :
+ /// BCCL macro to check the ConstLinearRing concept
+ BOOST_CONCEPT_USAGE(ConstRing)
+ {
+ }
+ };
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/concepts/segment_concept.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/concepts/segment_concept.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,118 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, Geodan Holding S.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_SEGMENT_CONCEPT_HPP
+#define _GEOMETRY_SEGMENT_CONCEPT_HPP
+
+
+#include <boost/concept_check.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/point_type.hpp>
+
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief Checks segment concept, using Boost Concept Check Library and metafunctions
+ \ingroup concepts
+ */
+ template <typename S>
+ struct Segment
+ {
+ private :
+ typedef typename point_type<S>::type P;
+
+ BOOST_CONCEPT_ASSERT( (Point<P>) );
+
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <size_t C, size_t D, size_t N>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ S* s;
+ geometry::set<C, D>(*s, geometry::get<C, D>(*s));
+ dimension_checker<C, D + 1, N>::check();
+ }
+ };
+
+ template <size_t C, size_t N>
+ struct dimension_checker<C, N, N>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the Segment concept
+ BOOST_CONCEPT_USAGE(Segment)
+ {
+ static const size_t N = dimension<P>::value;
+ dimension_checker<0, 0, N>::check();
+ dimension_checker<1, 0, N>::check();
+ }
+ };
+
+
+ /*!
+ \brief Checks Segment concept (const version)
+ \ingroup concepts
+ \details The ConstSegment concept check the same as the Segment concept,
+ but does not check write access.
+ */
+ template <typename S>
+ struct ConstSegment
+ {
+ private :
+ typedef typename point_type<S>::type P;
+ typedef typename coordinate_type<S>::type T;
+
+ BOOST_CONCEPT_ASSERT( (ConstPoint<P>) );
+
+
+ /// Internal structure to check if access is OK for all dimensions
+ template <size_t C, size_t D, size_t N>
+ struct dimension_checker
+ {
+ static void check()
+ {
+ const S* s = 0;
+ T coord(geometry::get<C, D>(*s));
+ (void)sizeof(coord); // To avoid "unused variable" warnings
+ dimension_checker<C, D + 1, N>::check();
+ }
+ };
+
+ template <size_t C, size_t N>
+ struct dimension_checker<C, N, N>
+ {
+ static void check() {}
+ };
+
+ public :
+ /// BCCL macro to check the ConstSegment concept
+ BOOST_CONCEPT_USAGE(ConstSegment)
+ {
+ static const size_t N = dimension<P>::value;
+ dimension_checker<0, 0, N>::check();
+ dimension_checker<1, 0, N>::check();
+ }
+ };
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/coordinate_dimension.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/coordinate_dimension.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,109 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_COORDINATE_DIMENSION_HPP
+#define _GEOMETRY_COORDINATE_DIMENSION_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/mpl/equal_to.hpp>
+
+#include <geometry/core/point_type.hpp>
+
+
+namespace geometry
+{
+
+ namespace traits
+ {
+ /*!
+ \brief Traits class indicating the number of dimensions of a point
+ \par Geometries:
+ - point
+ \par Specializations should provide:
+ - value (should be derived from boost::mpl::int_<D>
+ \ingroup traits
+ */
+ template <typename P>
+ struct dimension {};
+
+ } // namespace traits
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+ // Base class derive from its own specialization of point-tag
+ template <typename TAG, typename G>
+ struct dimension : dimension<point_tag, typename point_type<TAG, G>::type> { };
+
+ template <typename P>
+ struct dimension<point_tag, P> : traits::dimension<P> {};
+
+ } // namespace core_dispatch
+ #endif
+
+
+
+
+ /*!
+ \brief Meta-function which defines coordinate dimensions, i.e. the number of axes of any geometry
+ \ingroup core
+ */
+ template <typename G>
+ struct dimension : core_dispatch::dimension<typename tag<G>::type,
+ typename boost::remove_const<G>::type>
+ { };
+
+
+
+
+
+ /*!
+ \brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected
+ \ingroup utility
+ */
+ template <typename G, size_t D>
+ inline void assert_dimension()
+ {
+ BOOST_STATIC_ASSERT((boost::mpl::equal_to<
+ geometry::dimension<G>,
+ boost::mpl::int_<D> >::type::value));
+ }
+
+ /*!
+ \brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected
+ \ingroup utility
+ */
+ template <typename G, size_t D>
+ inline void assert_dimension_max()
+ {
+ BOOST_STATIC_ASSERT(( dimension<G>::value <= D ));
+ }
+
+
+ /*!
+ \brief assert_dimension_equal, enables compile-time checking if coordinate dimensions of two geometries are equal
+ \ingroup utility
+ */
+ template <typename G1, typename G2>
+ inline void assert_dimension_equal()
+ {
+ BOOST_STATIC_ASSERT(( dimension<G1>::value == dimension<G2>::value ));
+ }
+
+
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/coordinate_system.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/coordinate_system.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,78 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_COORDINATE_SYSTEM_HPP
+#define _GEOMETRY_COORDINATE_SYSTEM_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+#include <geometry/core/point_type.hpp>
+
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class defining the coordinate system of a point, important for strategy selection
+ \ingroup traits
+ \par Geometries:
+ - point
+ \par Specializations should provide:
+ - typedef CS type; (cs::cartesian, cs::spherical, etc)
+ */
+ template <typename P>
+ struct coordinate_system {};
+
+ } // namespace traits
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+ template <typename TAG, typename G>
+ struct coordinate_system
+ {
+ typedef typename point_type<TAG, G>::type P;
+
+ // Call its own specialization on point-tag
+ typedef typename coordinate_system<point_tag, P>::type type;
+ };
+
+
+ template <typename P>
+ struct coordinate_system<point_tag, P>
+ {
+ typedef typename traits::coordinate_system<P>::type type;
+ };
+
+
+ } // namespace core_dispatch
+ #endif
+
+
+ /*!
+ \brief Meta-function which defines coordinate system for any geometry
+ \ingroup core
+ */
+ template <typename G>
+ struct coordinate_system
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ typedef typename core_dispatch::coordinate_system<typename tag<G>::type, NCG>::type type;
+ };
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/coordinate_type.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/coordinate_type.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,76 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_COORDINATE_TYPE_HPP
+#define _GEOMETRY_COORDINATE_TYPE_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+#include <geometry/core/point_type.hpp>
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class which indicate the coordinate type (double,float,...) of a point
+ \ingroup traits
+ \par Geometries:
+ - point
+ \par Specializations should provide:
+ - typedef T type; (double,float,int,etc)
+ */
+ template <typename P>
+ struct coordinate_type {};
+
+
+ } // namespace traits
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+ template <typename TAG, typename G>
+ struct coordinate_type
+ {
+ typedef typename point_type<TAG, G>::type P;
+
+ // Call its own specialization on point-tag
+ typedef typename coordinate_type<point_tag, P>::type type;
+ };
+
+
+ template <typename P>
+ struct coordinate_type<point_tag, P>
+ {
+ typedef typename traits::coordinate_type<P>::type type;
+ };
+
+ } // namespace core_dispatch
+ #endif
+
+ /*!
+ \brief Meta-function which defines coordinate type (int, float, double, etc) of any geometry
+ \ingroup core
+ */
+ template <typename G>
+ struct coordinate_type
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ typedef typename core_dispatch::coordinate_type<typename tag<G>::type, NCG>::type type;
+ };
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/cs.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/cs.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,231 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CS_HPP
+#define _GEOMETRY_CS_HPP
+
+#include <boost/type_traits.hpp>
+
+#include <geometry/core/tags.hpp>
+#include <geometry/core/coordinate_system.hpp>
+
+/*!
+\defgroup cs coordinate systems
+\brief Defines coordinate systems
+\details Coordinate systems are essential for any point in the Generic Geometry Library. Many
+ algorithms such as distance or transform use coordinate systems to select the strategy to use.
+*/
+
+namespace geometry
+{
+
+ /*!
+ \brief Unit of plan angles: degrees
+ \ingroup utility
+ */
+ class degree {};
+
+
+ /*!
+ \brief Unit of plan angles: radians
+ \ingroup utility
+ */
+ class radian {};
+
+
+ namespace cs
+ {
+ /*!
+ \brief Cartesian coordinate system
+ \details Defines the Cartesian or rectangular coordinate system where points are defined in 2 or 3 (or more)
+ dimensions and usually (but not always) known as x,y,z
+ \see http://en.wikipedia.org/wiki/Cartesian_coordinate_system
+ \ingroup cs
+ */
+ struct cartesian
+ {};
+
+
+
+ /*!
+ \brief EPSG Cartesian coordinate system
+ \details EPSG (European Petrol Survey Group) has a standard list of projections,
+ each having a code
+ \see
+ \ingroup cs
+ \tparam C the EPSG code
+ */
+ template<size_t C>
+ struct epsg
+ {
+ static const size_t epsg_code = C;
+ };
+
+
+ /*!
+ \brief Geographic coordinate system, in degree or in radian
+ \details Defines the geographic coordinate system where points are defined in two angles and usually
+ known as lat,long or lo,la or phi,lambda
+ \see http://en.wikipedia.org/wiki/Geographic_coordinate_system
+ \ingroup cs
+ */
+ template<typename D>
+ struct geographic
+ {
+ typedef D units;
+ };
+
+ /*!
+ \brief Earth Centered, Earth Fixed
+ \details Defines a Cartesian coordinate system x,y,z with the center of the earth as its origin,
+ going through the Greenwich
+ \see http://en.wikipedia.org/wiki/ECEF
+ \see http://en.wikipedia.org/wiki/Geodetic_system
+ \note Also known as "Geocentric", but geocentric is also an astronomic coordinate system
+ \ingroup cs
+ */
+ struct ecef
+ {
+ };
+
+ /*!
+ \brief Spherical coordinate system, in degree or in radian
+ \details Defines the spherical coordinate system where points are defined in two angles
+ and an optional radius usually known as r, theta, phi
+ \par Coordinates:
+ - coordinate 0:
+ 0 <= phi < 2pi is the angle between the positive x-axis and the line from the origin to the P projected onto the xy-plane.
+ - coordinate 1:
+ 0 <= theta <= pi is the angle between the positive z-axis and the line formed between the origin and P.
+ - coordinate 2 (if specified):
+ r >= 0 is the distance from the origin to a given point P.
+
+ \see http://en.wikipedia.org/wiki/Spherical_coordinates
+ \ingroup cs
+ */
+ template<typename D>
+ struct spherical
+ {
+ typedef D units;
+ };
+
+ /*!
+ \brief Polar coordinate system
+ \details Defines the polar coordinate system "in which each point on a plane is determined by an angle and a distance"
+ \see http://en.wikipedia.org/wiki/Polar_coordinates
+ \ingroup cs
+ */
+ template<typename D>
+ struct polar
+ {
+ typedef D units;
+ };
+
+
+ namespace celestial
+ {
+ /*!
+ \brief Ecliptic (celestial) coordinate system
+ \details Defines the astronomical ecliptic coordinate system "that uses the ecliptic for its fundamental plane"
+ It uses Beta and Lambda as its latitude and longitude.
+ \see http://en.wikipedia.org/wiki/Ecliptic_coordinate_system
+ \ingroup cs
+ */
+ template<typename D>
+ struct ecliptic
+ {};
+
+
+ // More celestial coordinate systems could be defined
+ }
+
+ }
+
+ namespace traits
+ {
+ /*!
+ \brief Traits class defining coordinate system tag, bound to coordinate system
+ \ingroup traits
+ \tparam CS coordinate system
+ */
+ template <typename CS>
+ struct cs_tag
+ {
+ };
+
+
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+
+ template<typename DR>
+ struct cs_tag<cs::geographic<DR> >
+ {
+ typedef geographic_tag type;
+ };
+
+ template<typename DR>
+ struct cs_tag<cs::spherical<DR> >
+ {
+ typedef spherical_tag type;
+ };
+
+
+ template<>
+ struct cs_tag<cs::cartesian>
+ {
+ typedef cartesian_tag type;
+ };
+
+ template<>
+ struct cs_tag<cs::ecef>
+ {
+ typedef cartesian_tag type;
+ };
+
+ template <size_t C>
+ struct cs_tag<cs::epsg<C> >
+ {
+ typedef cartesian_tag type;
+ };
+
+ #endif
+
+ }
+
+ /*!
+ \brief Meta-function returning coordinate system tag (cs family) of any geometry
+ \ingroup core
+ */
+ template <typename G>
+ struct cs_tag
+ {
+ typedef typename traits::cs_tag<typename geometry::coordinate_system<G>::type>::type type;
+ };
+
+
+ /*!
+ \brief Meta-function to verify if a coordinate system is radian
+ \ingroup core
+ */
+ template <typename CS>
+ struct is_radian : boost::true_type {};
+
+
+ #ifndef DOXYGEN_NO_SPECIALIZATIONS
+
+ // Specialization for any degree coordinate systems
+ template <template<typename> class CS>
+ struct is_radian< CS<degree> > : boost::false_type {};
+
+ #endif
+
+
+
+} // namespace geometry
+
+
+#endif //_GEOMETRY_CS_HPP

Added: sandbox/ggl/boost/ggl/geometry/core/exterior_ring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/exterior_ring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,100 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_EXTERIOR_RING_HPP
+#define _GEOMETRY_EXTERIOR_RING_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+#include <geometry/core/tag.hpp>
+#include <geometry/core/tags.hpp>
+#include <geometry/core/ring_type.hpp>
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+
+ /*!
+ \brief Traits class defining access to exterior_ring of a polygon
+ \details Should define const and non const access
+ \ingroup traits
+ \tparam G geometry
+ \par Geometries:
+ - polygon
+ \par Specializations should provide:
+ - static inline RING& get(POLY& )
+ - static inline const RING& get(const POLY& )
+ */
+ template <typename P>
+ struct exterior_ring {};
+
+ } // namespace traits
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+ template <typename TAG, typename G> struct exterior_ring {};
+
+ template <typename P>
+ struct exterior_ring<polygon_tag, P>
+ {
+ static inline typename ring_type<polygon_tag, P>::type& get(P& polygon)
+ {
+ return traits::exterior_ring<P>::get(polygon);
+ }
+
+ static inline const typename ring_type<polygon_tag, P>::type& get(const P& polygon)
+ {
+ return traits::exterior_ring<P>::get(polygon);
+ }
+ };
+
+
+ } // namespace core_dispatch
+ #endif
+
+
+ /*!
+ \brief Function to get the exterior_ring ring of a polygon
+ \ingroup access
+ \note OGC compliance: instead of ExteriorRing
+ \tparam P polygon type
+ \param polygon the polygon to get the exterior ring from
+ \return a reference to the exterior ring
+ */
+ template <typename P>
+ inline typename ring_type<P>::type& exterior_ring(P& polygon)
+ {
+ return core_dispatch::exterior_ring<typename tag<P>::type, P>::get(polygon);
+ }
+
+ /*!
+ \brief Function to get the exterior ring of a polygon (const version)
+ \ingroup access
+ \note OGC compliance: instead of ExteriorRing
+ \tparam P polygon type
+ \param polygon the polygon to get the exterior ring from
+ \return a const reference to the exterior ring
+ */
+ template <typename P>
+ inline const typename ring_type<P>::type& exterior_ring(const P& polygon)
+ {
+ return core_dispatch::exterior_ring<typename tag<P>::type, P>::get(polygon);
+ }
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/interior_rings.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/interior_rings.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,162 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_INTERIOR_RINGS_HPP
+#define _GEOMETRY_INTERIOR_RINGS_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+#include <geometry/core/tag.hpp>
+#include <geometry/core/tags.hpp>
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class indicating interior container type of a polygon
+ \details defines inner container type, so the container containing the interior rings
+ \ingroup traits
+ \par Geometries:
+ - polygon
+ \par Specializations should provide:
+ - typedef CONTAINER<RING<P> > type (e.g. std::vector<linear_ring<P> >)
+ \tparam G geometry
+ */
+ template <typename G>
+ struct interior_type { };
+
+
+ /*!
+ \brief Traits class defining access to interior_rings of a polygon
+ \details defines access (const and non const) to interior ring
+ \ingroup traits
+ \par Geometries:
+ - polygon
+ \par Specializations should provide:
+ - static inline INTERIOR& get(POLY&)
+ - static inline const INTERIOR& get(const POLY&)
+ \tparam G geometry
+ */
+ template <typename G>
+ struct interior_rings
+ {
+ };
+
+
+ } // namespace traits
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+ template <typename TAG, typename G> struct interior_type {};
+
+ template <typename P>
+ struct interior_type<polygon_tag, P>
+ {
+ typedef typename traits::interior_type<P>::type type;
+ };
+
+
+
+ template <typename TAG, typename G> struct interior_rings {};
+
+ template <typename P>
+ struct interior_rings<polygon_tag, P>
+ {
+ static inline typename interior_type<polygon_tag, P>::type& get(P& polygon)
+ {
+ return traits::interior_rings<P>::get(polygon);
+ }
+
+ static inline const typename interior_type<polygon_tag, P>::type& get(const P& polygon)
+ {
+ return traits::interior_rings<P>::get(polygon);
+ }
+ };
+
+
+
+ } // namespace core_dispatch
+ #endif
+
+
+
+
+ /*!
+ \brief Meta-function defining container type of inner rings of (multi)polygon geometriy
+ \details the interior rings should be organized as a container (std::vector, std::deque, boost::array) with
+ boost range support. This meta function defines the type of that container.
+ \ingroup core
+ */
+ template <typename G>
+ struct interior_type
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ typedef typename core_dispatch::interior_type<typename tag<G>::type, NCG>::type type;
+ };
+
+
+
+ /*!
+ \brief Function to get the interior rings of a polygon (non const version)
+ \ingroup access
+ \note OGC compliance: instead of InteriorRingN
+ \tparam P polygon type
+ \param polygon the polygon to get the interior rings from
+ \return a reference to the interior rings
+ */
+ template <typename P>
+ inline typename interior_type<P>::type& interior_rings(P& polygon)
+ {
+ return core_dispatch::interior_rings<typename tag<P>::type, P>::get(polygon);
+ }
+
+
+ /*!
+ \brief Function to get the interior rings of a polygon (const version)
+ \ingroup access
+ \note OGC compliance: instead of InteriorRingN
+ \tparam P polygon type
+ \param polygon the polygon to get the interior rings from
+ \return a const reference to the interior rings
+ */
+ template <typename P>
+ inline const typename interior_type<P>::type& interior_rings(const P& polygon)
+ {
+ return core_dispatch::interior_rings<typename tag<P>::type, P>::get(polygon);
+ }
+
+
+
+ /*!
+ \brief Function to get the number of interior rings of a polygon
+ \ingroup access
+ \note Defined by OGC as "numInteriorRing". To be consistent with "numPoints"
+ letter "s" is appended
+ \tparam P polygon type
+ \param polygon the polygon
+ \return the nubmer of interior rings
+ */
+ template <typename P>
+ inline size_t num_interior_rings(const P& polygon)
+ {
+ return boost::size(interior_rings(polygon));
+ }
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/point_type.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/point_type.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,106 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_POINT_TYPE_HPP
+#define _GEOMETRY_POINT_TYPE_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/tag.hpp>
+#include <geometry/core/tags.hpp>
+#include <geometry/core/ring_type.hpp>
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class indicating the type of contained points
+ \ingroup traits
+ \par Geometries:
+ - all geometries except point
+ \par Specializations should provide:
+ - typedef P type (where P should fulfil the Point concept)
+ \tparam G geometry
+ */
+ template <typename G>
+ struct point_type {};
+
+ } // namespace traits
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+
+
+ template <typename TAG, typename G>
+ struct point_type
+ {
+ // Default: call traits to get point type
+ typedef typename boost::remove_const<typename traits::point_type<G>::type>::type type;
+ };
+
+ // Specialization for point: the point itself
+ template <typename P>
+ struct point_type<point_tag, P>
+ {
+ typedef P type;
+ };
+
+ // Specializations for linestring/linear ring, via boost::range
+ template <typename R>
+ struct point_type<linestring_tag, R>
+ {
+ typedef typename boost::range_value<R>::type type;
+ };
+
+ template <typename R>
+ struct point_type<ring_tag, R>
+ {
+ typedef typename boost::range_value<R>::type type;
+ };
+
+
+ // Specialization for polygon: the point-type is the point-type of its rinsg
+ template <typename P>
+ struct point_type<polygon_tag, P>
+ {
+ typedef typename ring_type<polygon_tag, P>::type R;
+ typedef typename point_type<ring_tag, R>::type type;
+ };
+
+ } // namespace core_dispatch
+ #endif
+
+
+ /*!
+ \brief Meta-function which defines point type of any geometry
+ \ingroup core
+ */
+ template <typename G>
+ struct point_type
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ typedef typename core_dispatch::point_type<typename tag<G>::type, NCG>::type type;
+ };
+
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/radian_access.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/radian_access.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,104 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_RADIAN_ACCESS_HPP
+#define _GEOMETRY_RADIAN_ACCESS_HPP
+
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/cs.hpp>
+
+#include <geometry/util/math.hpp>
+
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <size_t D, typename G, typename DR>
+ struct radian_access
+ {
+ };
+
+ template <size_t D, typename G, template<typename> class CS>
+ struct radian_access<D, G, CS<radian> >
+ {
+ typedef typename coordinate_type<G>::type T;
+
+ static inline T get(const G& geometry)
+ {
+ return geometry::get<D>(geometry);
+ }
+
+ static inline void set(G& geometry, const typename coordinate_type<G>::type& radians)
+ {
+ geometry::set<D>(geometry, radians);
+ }
+
+ };
+
+ template <size_t D, typename G, template<typename> class CS>
+ struct radian_access<D, G, CS<degree> >
+ {
+ typedef typename coordinate_type<G>::type T;
+
+ static inline T get(const G& geometry)
+ {
+ return geometry::get<D>(geometry) * math::d2r;
+ }
+
+ static inline void set(G& geometry, const typename coordinate_type<G>::type& radians)
+ {
+ geometry::set<D>(geometry, radians * math::r2d);
+ }
+
+ };
+
+ } // namespace impl
+ #endif
+
+
+ /*!
+ \brief get a coordinate value of a point, result is in RADIAN
+ \details also if coordinate system was in degree, result is in radian
+ \return coordinate value
+ \ingroup access
+ \tparam D dimension
+ \tparam G geometry
+ \param geometry geometry to get coordinate value from
+ */
+ template <size_t D, typename G>
+ inline typename coordinate_type<G>::type get_as_radian(const G& geometry)
+ {
+ return impl::radian_access<D, G, typename coordinate_system<G>::type>::get(geometry);
+ };
+
+
+ /*!
+ \brief assign coordinate value (which is in radian) to a point
+ \details if coordinate system of point is in degree, will be converted to degree
+ \ingroup access
+ \tparam D dimension
+ \tparam G geometry
+ \param geometry geometry to assign coordinate to
+ \param radians coordinate value to assign
+ */
+ template <size_t D, typename G>
+ inline void set_from_radian(G& geometry, const typename coordinate_type<G>::type& radians)
+ {
+ impl::radian_access<D, G, typename coordinate_system<G>::type>::set(geometry, radians);
+ }
+
+
+}
+
+
+#endif // _GEOMETRY_RADIAN_ACCESS_HPP

Added: sandbox/ggl/boost/ggl/geometry/core/radius.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/radius.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,159 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_RADIUS_HPP
+#define _GEOMETRY_RADIUS_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+#include <geometry/core/tag.hpp>
+
+
+namespace geometry
+{
+
+ namespace traits
+ {
+ /*!
+ \brief Traits class to get/set radius of a circle/sphere/(ellipse)
+ \details the radius access meta-functions give read/write access to the radius of a circle or a sphere,
+ or to the major/minor axis or an ellipse, or to one of the 3 equatorial radii of an ellipsoid.
+
+ It should be specialized per geometry, in namespace core_dispatch. Those specializations should
+ forward the call via traits to the geometry class, which could be specified by the user.
+
+ There is a corresponding generic radius_get and radius_set function
+ \par Geometries:
+ - n-sphere (circle,sphere)
+ - upcoming ellipse
+ \par Specializations should provide:
+ - inline static T get(const G& geometry)
+ - inline static void set(G& geometry, const T& radius)
+ \ingroup traits
+ */
+ template <typename G, typename T, size_t D>
+ struct radius_access {};
+
+
+ /*!
+ \brief Traits class indicating the type (double,float,...) of the radius of a circle or a sphere
+ \par Geometries:
+ - n-sphere (circle,sphere)
+ - upcoming ellipse
+ \par Specializations should provide:
+ - typedef T type (double,float,int,etc)
+ \ingroup traits
+ */
+ template <typename G>
+ struct radius_type {};
+
+ }
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+
+ template <typename TAG, typename G>
+ struct radius_type
+ {
+ //typedef core_dispatch_specialization_required type;
+ };
+
+
+ /*!
+ \brief radius access meta-functions, used by concept n-sphere and upcoming ellipse.
+ */
+ template <typename TAG, typename G, typename T, size_t D>
+ struct radius_access
+ {
+ //static inline T get(const G& ) {}
+ //static inline void set(G& g, const T& value) {}
+ };
+
+
+
+ template <typename S>
+ struct radius_type<nsphere_tag, S>
+ {
+ typedef typename traits::radius_type<S>::type type;
+ };
+
+
+
+ template <typename S, typename T, size_t D>
+ struct radius_access<nsphere_tag, S, T, D>
+ {
+ BOOST_STATIC_ASSERT((D == 0));
+ static inline T get(const S& s)
+ {
+ return traits::radius_access<S, T, D>::get(s);
+ }
+ static inline void set(S& s, const T& radius)
+ {
+ traits::radius_access<S, T, D>::set(s, radius);
+ }
+ };
+
+ } // namespace core_dispatch
+ #endif
+
+
+
+ template <typename G>
+ struct radius_type
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ typedef typename core_dispatch::radius_type<
+ typename tag<G>::type, NCG>::type type;
+ };
+
+
+ /*!
+ \brief Function to get radius
+ \return radius of a circle / sphere / ellipse
+ \ingroup access
+ \param geometry the geometry to get the radius from
+ \tparam I index, for circle/sphere always zero, for ellipse major/minor axis,
+ for ellipsoid one of the 3 equatorial radii
+ */
+ template <size_t I, typename G>
+ inline typename radius_type<G>::type get_radius(const G& geometry)
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ return core_dispatch::radius_access<typename tag<G>::type, NCG,
+ typename radius_type<G>::type, I>::get(geometry);
+ };
+
+
+ /*!
+ \brief Function to set the radius of a circle / sphere / (ellipse)
+ \ingroup access
+ \tparam I index, for circle/sphere always zero, for ellipse major/minor axis,
+ for ellipsoid one of the 3 equatorial radii
+ \param geometry the geometry to change
+ \param radius the radius to set
+ */
+ template <size_t I, typename G>
+ inline void set_radius(G& geometry, const typename radius_type<G>::type& radius)
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ core_dispatch::radius_access<typename tag<G>::type, G,
+ typename radius_type<G>::type, I>::set(geometry, radius);
+ }
+
+
+
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/ring_type.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/ring_type.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,90 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_RING_TYPE_HPP
+#define _GEOMETRY_RING_TYPE_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+
+#include <geometry/core/tag.hpp>
+#include <geometry/core/tags.hpp>
+
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class to indicate ring-type of a polygon's exterior ring/interior rings
+ \ingroup traits
+ \par Geometries:
+ - polygon
+ \par Specializations should provide:
+ - typedef XXX type (e.g. linear_ring<P>)
+ \tparam G geometry
+ */
+ template <typename G>
+ struct ring_type
+ {
+ // should define type
+ };
+
+
+
+ } // namespace traits
+
+
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+
+
+ template <typename TAG, typename G> struct ring_type {};
+
+ // Specialization for polygon
+ template <typename P>
+ struct ring_type<polygon_tag, P>
+ {
+ typedef typename traits::ring_type<P>::type type;
+ };
+
+
+
+
+ } // namespace core_dispatch
+ #endif
+
+
+ /*!
+ \brief Meta-function which defines ring type of (multi)polygon geometry
+ \details a polygon contains one exterior ring and zero or more interior rings (holes).
+ The type of those rings is assumed to be equal. This meta function retrieves the type
+ of such rings.
+ \ingroup core
+ */
+ template <typename G>
+ struct ring_type
+ {
+ typedef typename boost::remove_const<G>::type NCG;
+ typedef typename core_dispatch::ring_type<typename tag<G>::type, NCG>::type type;
+ };
+
+
+
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/tag.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/tag.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,65 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_TAG_HPP
+#define _GEOMETRY_TAG_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+#include <geometry/core/tags.hpp>
+
+/*!
+\defgroup core core: meta-functions for geometry types
+*/
+
+namespace geometry
+{
+
+ namespace traits
+ {
+
+ /*!
+ \brief Traits class to attach a tag to a geometry
+ \details All geometries should implement a traits::tag<G>::type metafunction to indicate their
+ own geometry type.
+ \ingroup traits
+ \par Geometries:
+ - all geometries
+ \par Specializations should provide:
+ - typedef XXX_tag type; (point_tag, box_tag, ...)
+ \tparam G geometry
+ */
+ template <typename G>
+ struct tag
+ {
+ typedef geometry_not_recognized_tag type;
+ };
+
+ }
+
+
+ /*!
+ \brief Meta-function to get the tag of any geometry type
+ \details All geometries tell their geometry type (point, linestring, polygon, etc) by implementing
+ a tag traits class. This meta-function uses that traits class to retrieve the tag.
+ If the input type is not a geometry at all, a geometry_not_recognized_tag will be returned.
+ \tparam G geometry
+ \ingroup core
+ */
+ template <typename G>
+ struct tag
+ {
+ typedef typename traits::tag<typename boost::remove_const<G>::type>::type type;
+ };
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/core/tags.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/tags.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,83 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_TAGS_HPP
+#define _GEOMETRY_TAGS_HPP
+
+
+/*!
+\defgroup traits traits: adapt geometries
+\brief Traits classes are small classes or structs to adapt geometries
+such that they are recognized by the Generic Geometry Library
+*/
+
+
+namespace geometry
+{
+
+
+
+ // Tags defining strategies linked to coordinate systems
+
+ /// Tag indicating Cartesian coordinate system family (cartesian,epsg)
+ struct cartesian_tag {};
+
+
+ /// Tag indicating Geographic coordinate system family (geographic)
+ struct geographic_tag {};
+
+ /// Tag indicating Spherical coordinate system family (spherical,celestial,...)
+ struct spherical_tag {};
+
+
+ // Tags defining geometry types
+
+
+ /// "default" tag
+ struct geometry_not_recognized_tag {};
+
+ /// OGC Point identifying tag
+ struct point_tag {};
+
+ /// OGC Linestring identifying tag
+ struct linestring_tag {};
+
+ /// OGC Polygon identifying tag
+ struct polygon_tag {};
+
+ /// OGC Multi point identifying tag
+ struct multi_point_tag {};
+
+ /// OGC Multi linestring identifying tag
+ struct multi_linestring_tag {};
+
+ /// OGC Multi polygon identifying tag
+ struct multi_polygon_tag {};
+
+ /// OGC Geometry Collection identifying tag
+ struct geometry_collection_tag {};
+
+
+
+ /// Convenience (linear) ring identifying tag
+ struct ring_tag {};
+
+ /// Convenience 2D or 3D box (mbr) identifying tag
+ struct box_tag {};
+
+ /// Convenience 2D (circle) or 3D (sphere) n-sphere identifying tag
+ struct nsphere_tag {};
+
+ /// Convenience segment (2-points) identifying tag
+ struct segment_tag {};
+
+
+
+} // namespace geometry
+
+#endif // _GEOMETRY_TAGS_HPP

Added: sandbox/ggl/boost/ggl/geometry/core/topological_dimension.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/core/topological_dimension.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,66 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_TOPOLOGICAL_DIMENSION_HPP
+#define _GEOMETRY_TOPOLOGICAL_DIMENSION_HPP
+
+
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/mpl/int.hpp>
+
+#include <geometry/core/tag.hpp>
+#include <geometry/core/tags.hpp>
+
+
+namespace geometry
+{
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace core_dispatch
+ {
+ template <typename TAG, typename G>
+ struct top_dim {};
+
+ template <typename G> struct top_dim<point_tag, G> : boost::mpl::int_<0> {};
+ template <typename G> struct top_dim<linestring_tag, G> : boost::mpl::int_<1> {};
+ template <typename G> struct top_dim<segment_tag, G> : boost::mpl::int_<1> {};
+ template <typename G> struct top_dim<ring_tag, G> : boost::mpl::int_<2> {};
+ template <typename G> struct top_dim<box_tag, G> : boost::mpl::int_<2> {};
+ template <typename G> struct top_dim<polygon_tag, G> : boost::mpl::int_<2> {};
+
+ // check, sphere=3?
+ template <typename G> struct top_dim<nsphere_tag, G> : boost::mpl::int_<2> {};
+
+
+
+ } // namespace core_dispatch
+ #endif
+
+
+
+
+ /*!
+ \brief Meta-function returning gives the topological dimension of a geometry
+ \details The topological dimension defines a point as 0-dimensional, a linestring as 1-dimensional,
+ and a ring or polygon as 2-dimensional.
+ \see http://www.math.okstate.edu/mathdept/dynamics/lecnotes/node36.html
+ \ingroup core
+ */
+ template <typename G>
+ struct topological_dimension
+ : core_dispatch::top_dim
+ < typename tag<G>::type , typename boost::remove_const<G>::type >
+ { };
+
+
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/boost_array_as_linestring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/boost_array_as_linestring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,40 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_BOOST_ARRAY_AS_LINESTRING_HPP
+#define _GEOMETRY_ADAPTED_BOOST_ARRAY_AS_LINESTRING_HPP
+
+
+#ifdef _GEOMETRY_ADAPTED_BOOST_ARRAY_RANGE_TAG_DEFINED
+#error Include only one headerfile to register tag for adapted boost::array
+#endif
+
+#define _GEOMETRY_ADAPTED_BOOST_ARRAY_RANGE_TAG_DEFINED
+
+
+#include <boost/array.hpp>
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ template <typename T, size_t N>
+ struct tag< boost::array<T, N> >
+ {
+ typedef linestring_tag type;
+ };
+
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/boost_array_as_ring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/boost_array_as_ring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,40 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_BOOST_ARRAY_AS_RING_HPP
+#define _GEOMETRY_ADAPTED_BOOST_ARRAY_AS_RING_HPP
+
+
+#ifdef _GEOMETRY_ADAPTED_BOOST_ARRAY_RANGE_TAG_DEFINED
+#error Include only one headerfile to register tag for adapted boost::array
+#endif
+
+#define _GEOMETRY_ADAPTED_BOOST_ARRAY_RANGE_TAG_DEFINED
+
+
+#include <boost/array.hpp>
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ template <typename T, size_t N>
+ struct tag< boost::array<T, N> >
+ {
+ typedef ring_tag type;
+ };
+
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,70 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_C_ARRAY_HPP
+#define _GEOMETRY_ADAPTED_C_ARRAY_HPP
+
+#include <boost/type_traits/is_arithmetic.hpp>
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/tags.hpp>
+#include <geometry/core/coordinate_type.hpp>
+#include <geometry/core/coordinate_dimension.hpp>
+#include <geometry/core/access.hpp>
+
+
+
+
+namespace geometry
+{
+
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ // Create class and specialization to indicate the tag
+ // for normal cases and the case that the type of the c-array is arithmetic
+ template <bool> struct c_array_tag { typedef geometry_not_recognized_tag type; };
+ template <> struct c_array_tag<true> { typedef point_tag type; };
+ }
+ #endif
+
+ // Assign the point-tag, preventing arrays of points getting a point-tag
+ template <typename T, size_t N>
+ struct tag<T[N]> : impl::c_array_tag<boost::is_arithmetic<T>::value> {};
+
+ template <typename T, size_t N>
+ struct coordinate_type<T[N]> { typedef T type; };
+
+ template <typename T, size_t N>
+ struct dimension<T[N]>: boost::mpl::int_<N> {};
+
+ template <typename T, size_t N>
+ struct access<T[N]>
+ {
+ template <size_t I>
+ static inline T get(const T p[N]) { return p[I]; }
+
+ template <size_t I>
+ static inline void set(T p[N], const T& value) { p[I] = value; }
+ };
+
+
+ // The library user has
+ // 1) either to specify the coordinate system
+ // 2) or include <geometry/geometries/adapted/c_array__at_.hpp> where @=cartesian,geographic,...
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array_cartesian.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array_cartesian.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,37 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_C_ARRAY_CARTESIAN_HPP
+#define _GEOMETRY_ADAPTED_C_ARRAY_CARTESIAN_HPP
+
+#ifdef _GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED
+#error Include only one headerfile to register coordinate coordinate_system for adapted c array
+#endif
+
+#define _GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED
+
+
+#include <geometry/geometries/adapted/c_array.hpp>
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename T, int N>
+ struct coordinate_system<T[N]>
+ { typedef cs::cartesian type; };
+
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array_geographic.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/c_array_geographic.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,35 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_C_ARRAY_GEOGRAPHIC_HPP
+#define _GEOMETRY_ADAPTED_C_ARRAY_GEOGRAPHIC_HPP
+
+#ifdef _GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED
+#error Include only one headerfile to register coordinate coordinate_system for adapted c array
+#endif
+
+#define _GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED
+
+#include <geometry/geometries/adapted/c_array.hpp>
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename T, int N>
+ struct coordinate_system<T[N]>
+ { typedef cs::geographic type; };
+
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/std_as_linestring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/std_as_linestring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,61 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_STD_AS_LINESTRING_HPP
+#define _GEOMETRY_ADAPTED_STD_AS_LINESTRING_HPP
+
+
+#ifdef _GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
+#error Include only one headerfile to register tag for adapted std:: containers or iterator pair
+#endif
+
+#define _GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
+
+
+#include <vector>
+#include <deque>
+#include <list>
+#include <utility>
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace util
+ {
+ struct std_as_linestring
+ {
+ typedef linestring_tag type;
+ };
+
+ }
+ #endif
+
+
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ // specialization for an iterator pair (read only)
+ template <typename P> struct tag< std::pair<P, P> > : util::std_as_linestring {};
+
+ // Indicate that std::library is not used to add things to std::pair.
+ // Don't implement anything else -> adding points or clearing not possible
+ template <typename P> struct use_std< std::pair<P, P> > : boost::mpl::false_ {};
+
+ // specializations for a std:: containers: vector, deque, list
+ template <typename P> struct tag< std::vector<P> > : util::std_as_linestring {};
+ template <typename P> struct tag< std::deque<P> > : util::std_as_linestring {};
+ template <typename P> struct tag< std::list<P> > : util::std_as_linestring {};
+
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/std_as_ring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/std_as_ring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,43 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_STD_AS_RING_HPP
+#define _GEOMETRY_ADAPTED_STD_AS_RING_HPP
+
+
+#ifdef _GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
+#error Include only one headerfile to register tag for adapted std:: containers or iterator pair
+#endif
+
+#define _GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
+
+
+#include <vector>
+#include <deque>
+#include <list>
+#include <utility>
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ // specialization for an iterator pair
+ template <typename T> struct tag< std::pair<T, T> > { typedef ring_tag type; };
+
+ // specialization for a std:: containers: vector, deque, list
+ template <typename T> struct tag< std::vector<T> > { typedef ring_tag type; };
+ template <typename T> struct tag< std::deque<T> > { typedef ring_tag type; };
+ template <typename T> struct tag< std::list<T> > { typedef ring_tag type; };
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,60 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_TUPLE_HPP
+#define _GEOMETRY_ADAPTED_TUPLE_HPP
+
+
+#include <boost/tuple/tuple.hpp>
+
+#include <geometry/core/tags.hpp>
+
+#include <geometry/core/coordinate_type.hpp>
+#include <geometry/core/coordinate_dimension.hpp>
+#include <geometry/core/point_type.hpp>
+
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename T>
+ struct coordinate_type<boost::tuple<T, T> >
+ { typedef T type; };
+
+ template <typename T>
+ struct dimension<boost::tuple<T, T> > : boost::mpl::int_<2> {};
+
+ template <typename T>
+ struct access<boost::tuple<T, T> >
+ {
+ template <int I>
+ static inline T get(const boost::tuple<T, T>& p) { return p.get<I>(); }
+
+ template <int I>
+ static inline void set(boost::tuple<T, T>& p, const T& value) { p.get<I>() = value; }
+ };
+
+
+ template <typename T>
+ struct tag<boost::tuple<T, T> >
+ { typedef point_tag type; };
+
+
+ // The library user has
+ // 1) either to specify the coordinate system
+ // 2) or include <geometry/geometries/adapted/tuple__at_.hpp> where @=cartesian,geographic,...
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple_cartesian.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple_cartesian.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,37 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_TUPLE_CARTESIAN_HPP
+#define _GEOMETRY_ADAPTED_TUPLE_CARTESIAN_HPP
+
+#ifdef _GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED
+#error Include only one headerfile to register coordinate coordinate_system for adapted tuple
+#endif
+
+#define _GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED
+
+
+#include <geometry/geometries/adapted/tuple.hpp>
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename T>
+ struct coordinate_system<boost::tuple<T, T> >
+ { typedef cs::cartesian type; };
+
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple_geographic.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/adapted/tuple_geographic.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,37 @@
+// Generic Geometry Library
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_ADAPTED_TUPLE_GEOGRAPHIC_HPP
+#define _GEOMETRY_ADAPTED_TUPLE_GEOGRAPHIC_HPP
+
+#ifdef _GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED
+#error Include only one headerfile to register coordinate coordinate_system for adapted tuple
+#endif
+
+#define _GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED
+
+
+#include <geometry/geometries/adapted/tuple.hpp>
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename T>
+ struct coordinate_system<boost::tuple<T, T> >
+ { typedef cs::geographic type; };
+
+ }
+ #endif
+}
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/geometries/box.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/box.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,106 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_BOX_HPP
+#define _GEOMETRY_BOX_HPP
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+#include <geometry/algorithms/assign.hpp>
+#include <geometry/util/copy.hpp>
+
+namespace geometry
+{
+
+ /*!
+ \brief Class box: defines a box made of two describing points
+ \ingroup Geometry
+ \details Box is always described by a min_corner() and a max_corner() point. If another
+ rectangle is used, use linear_ring or polygon.
+ \note Boxes are for selections and for calculating the envelope of geometries. Not all algorithms
+ are implemented for box. Boxes are also used in Spatial Indexes.
+ \tparam P point type. The box takes a point type as template parameter.
+ The point type can be any point type.
+ It can be 2D but can also be 3D or more dimensional.
+ The box can also take a latlong point type as template parameter.
+ */
+
+ template<typename P>
+ class box
+ {
+ BOOST_CONCEPT_ASSERT((Point<P>));
+
+ public :
+ inline box()
+ {}
+
+ /*!
+ \brief Constructor taking the minimum corner point and the maximum corner point
+ */
+ inline box(const P& min_corner, const P& max_corner)
+ {
+ copy_coordinates(min_corner, m_min_corner);
+ copy_coordinates(max_corner, m_max_corner);
+ }
+
+
+ inline const P& min_corner() const { return m_min_corner; }
+ inline const P& max_corner() const { return m_max_corner; }
+
+ inline P& min_corner() { return m_min_corner; }
+ inline P& max_corner() { return m_max_corner; }
+
+ private :
+ P m_min_corner, m_max_corner;
+ };
+
+
+
+ // Traits specializations for box above
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ template <typename P>
+ struct tag< box<P> > { typedef box_tag type; };
+
+ template <typename P>
+ struct point_type<box<P> > { typedef P type; };
+
+
+ template <typename P, size_t C, size_t D>
+ struct indexed_access<box<P>, C, D>
+ {
+ typedef box<P> B;
+
+ static inline typename geometry::coordinate_type<B>::type get(const B& b)
+ {
+ return C == min_corner ? geometry::get<D>(b.min_corner()) : geometry::get<D>(b.max_corner());
+ }
+
+ static inline void set(B& b, const typename geometry::coordinate_type<B>::type& value)
+ {
+ if (C == min_corner)
+ {
+ geometry::set<D>(b.min_corner(), value);
+ }
+ else
+ {
+ geometry::set<D>(b.max_corner(), value);
+ }
+ }
+ };
+
+ }
+ #endif
+
+
+};
+
+#endif // _GEOMETRY_BOX_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/cartesian2d.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/cartesian2d.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,29 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CARTESIAN2D_HPP
+#define _GEOMETRY_CARTESIAN2D_HPP
+
+// Predeclare common Cartesian 2D points for convenience
+
+#include <geometry/geometries/geometries.hpp>
+
+namespace geometry
+{
+ typedef point_xy<double, cs::cartesian> point_2d;
+ typedef linestring<point_2d> linestring_2d;
+ typedef linear_ring<point_2d> ring_2d;
+ typedef polygon<point_2d> polygon_2d;
+ typedef box<point_2d> box_2d;
+ typedef segment<point_2d> segment_2d;
+
+ typedef nsphere<point_2d, double> circle;
+}
+
+
+#endif // _GEOMETRY_CARTESIAN2D_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/cartesian3d.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/cartesian3d.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,28 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_CARTESIAN3D_HPP
+#define _GEOMETRY_CARTESIAN3D_HPP
+
+// Predeclare common Cartesian 3D points for convenience
+
+#include <geometry/geometries/geometries.hpp>
+
+namespace geometry
+{
+ typedef point<double, 3, cs::cartesian> point_3d;
+ typedef linestring<point_3d> linestring_3d;
+ typedef linear_ring<point_3d> ring_3d;
+ typedef polygon<point_3d> polygon_3d;
+ typedef box<point_3d> box_3d;
+
+ typedef nsphere<point_3d, double> sphere;
+}
+
+
+#endif // _GEOMETRY_CARTESIAN3D_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/geometries.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/geometries.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,29 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_GEOMETRIES_HPP
+#define _GEOMETRY_GEOMETRIES_HPP
+
+
+#include <geometry/geometries/adapted/c_array.hpp>
+#include <geometry/geometries/adapted/tuple.hpp>
+
+#include <geometry/geometries/point.hpp>
+#include <geometry/geometries/point_ll.hpp>
+#include <geometry/geometries/point_xy.hpp>
+#include <geometry/geometries/linestring.hpp>
+#include <geometry/geometries/linear_ring.hpp>
+#include <geometry/geometries/polygon.hpp>
+
+
+#include <geometry/geometries/box.hpp>
+#include <geometry/geometries/nsphere.hpp>
+#include <geometry/geometries/segment.hpp>
+
+
+#endif // _GEOMETRY_GEOMETRIES_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/latlong.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/latlong.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,34 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_LATLONG_HPP
+#define _GEOMETRY_LATLONG_HPP
+
+// Predeclare common Cartesian 3D points for convenience
+
+#include <geometry/geometries/geometries.hpp>
+
+namespace geometry
+{
+ typedef point_ll<double, cs::geographic<degree> > point_ll_deg;
+ typedef linestring<point_ll_deg> linestring_ll_deg;
+ typedef linear_ring<point_ll_deg> ring_ll_deg;
+ typedef polygon<point_ll_deg> polygon_ll_deg;
+ typedef box<point_ll_deg> box_ll_deg;
+ typedef segment<point_ll_deg> segment_ll_deg;
+
+ typedef point_ll<double, cs::geographic<radian> > point_ll_rad;
+ typedef linestring<point_ll_rad> linestring_ll_rad;
+ typedef linear_ring<point_ll_rad> ring_ll_rad;
+ typedef polygon<point_ll_rad> polygon_ll_rad;
+ typedef box<point_ll_rad> box_ll_rad;
+ typedef segment<point_ll_rad> segment_ll_rad;
+}
+
+
+#endif // _GEOMETRY_LATLONG_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/linear_ring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/linear_ring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,56 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_LINEAR_RING_HPP
+#define _GEOMETRY_LINEAR_RING_HPP
+
+#include <vector>
+
+#include <boost/concept/assert.hpp>
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief A linear_ring (linear linear_ring) is a closed line which should not be selfintersecting
+ \ingroup Geometry
+ \tparam P point type
+ \tparam V optional container type, for example std::vector, std::list, std::deque
+ \tparam A optional container-allocator-type
+ */
+ template<typename P,
+ template<typename,typename> class V = std::vector,
+ template<typename> class A = std::allocator>
+ class linear_ring : public V<P, A<P> >
+ {
+ BOOST_CONCEPT_ASSERT((Point<P>));
+ };
+
+
+
+
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename P, template<typename,typename> class V, template<typename> class A>
+ struct tag< linear_ring<P, V, A> >
+ {
+ typedef ring_tag type;
+ };
+
+
+ }
+ #endif
+
+
+} // namespace geometry
+
+
+#endif //_GEOMETRY_LINEAR_RING_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/linestring.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/linestring.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,57 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_LINESTRING_HPP
+#define _GEOMETRY_LINESTRING_HPP
+
+#include <vector>
+
+#include <boost/concept/assert.hpp>
+#include <boost/range/functions.hpp>
+
+
+namespace geometry
+{
+
+
+ /*!
+ \brief A linestring (named so by OGC) is a collection (default a vector) of points.
+ \ingroup Geometry
+ \tparam P point type
+ \tparam V optional container type, for example std::vector, std::list, std::deque
+ \tparam A optional container-allocator-type
+ (see http://accu.org/index.php/journals/427#ftn.d0e249 )
+ \par Concepts:
+ All algorithms work on ranges, based on a container with point types fulfilling
+ the point concepts. They will take linestring, but also vector, std::pair, or other containers.
+ */
+ template<typename P,
+ template<typename,typename> class V = std::vector,
+ template<typename> class A = std::allocator>
+ class linestring : public V<P, A<P> >
+ {
+ BOOST_CONCEPT_ASSERT((Point<P>));
+ };
+
+
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename P, template<typename,typename> class V, template<typename> class A>
+ struct tag< linestring<P, V, A> >
+ {
+ typedef linestring_tag type;
+ };
+ }
+ #endif
+
+
+} // namespace geometry
+
+
+#endif //_GEOMETRY_LINESTRING_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/nsphere.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/nsphere.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,122 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_NSPHERE_HPP
+#define _GEOMETRY_NSPHERE_HPP
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/nsphere_concept.hpp>
+
+#include <geometry/algorithms/assign.hpp>
+#include <geometry/util/copy.hpp>
+
+namespace geometry
+{
+ /*!
+ \brief Class nsphere: defines a circle or a sphere: a point with radius
+ \ingroup Geometry
+ \details The name nsphere is quite funny but the best description of the class. It can be a circle (2D),
+ a sphere (3D), or higher (hypersphere) or lower. According to Wikipedia this name is the most appropriate.
+ It was mentioned on the Boost list.
+ An alternative is the more fancy name "sphercle" but that might be a bit too much an invention.
+ \note Circle is currently used for selections, for example polygon_in_circle. Currently not all
+ algorithms are implemented for n-spheres.
+ \tparam P point type of the center
+ \tparam T number type of the radius
+ */
+ template <typename P, typename T>
+ class nsphere
+ {
+ BOOST_CONCEPT_ASSERT((Point<P>));
+
+ public :
+ typedef T radius_type;
+ typedef typename coordinate_type<P>::type coordinate_type;
+
+ nsphere()
+ : m_radius(0)
+ {
+ impl::assign::assign_value(m_center, coordinate_type());
+ }
+
+ nsphere(const P& center, const T& radius)
+ : m_radius(radius)
+ {
+ copy_coordinates(center, m_center);
+ }
+
+ inline const P& center() const { return m_center; }
+ inline const T& radius() const { return m_radius; }
+
+ inline void radius(const T& r) { m_radius = r; }
+ inline P& center() { return m_center; }
+
+ private :
+ P m_center;
+ T m_radius;
+ };
+
+
+
+ // Traits specializations for n-sphere above
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ template <typename P, typename T>
+ struct tag< nsphere<P, T> > { typedef nsphere_tag type; };
+
+ template <typename P, typename T>
+ struct point_type<nsphere<P, T> > { typedef P type; };
+
+ template <typename P, typename T>
+ struct radius_type<nsphere<P, T> > { typedef T type; };
+
+ template <typename P, typename T>
+ struct access<nsphere<P, T> >
+ {
+ typedef nsphere<P, T> S;
+
+ template <size_t D>
+ static inline typename geometry::coordinate_type<S>::type get(const S& s)
+ {
+ return geometry::get<D>(s.center());
+ }
+
+ template <size_t D>
+ static inline void set(S& s, const typename geometry::coordinate_type<S>::type& value)
+ {
+ geometry::set<D>(s.center(), value);
+ }
+ };
+
+
+ template <typename P, typename T>
+ struct radius_access<nsphere<P, T>, T, 0>
+ {
+ typedef nsphere<P, T> S;
+
+ static inline T get(const S& s)
+ {
+ return s.radius();
+ }
+
+ static inline void set(S& s, const T& value)
+ {
+ s.radius(value);
+ }
+ };
+
+
+ }
+ #endif
+
+
+}
+
+#endif // _GEOMETRY_NSPHERE_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/point.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/point.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,135 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_POINT_HPP
+#define _GEOMETRY_POINT_HPP
+
+
+#include <boost/mpl/int.hpp>
+#include <boost/static_assert.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/coordinate_type.hpp>
+#include <geometry/core/coordinate_system.hpp>
+#include <geometry/core/coordinate_dimension.hpp>
+
+#include <geometry/util/math.hpp>
+
+namespace geometry
+{
+
+
+ /*!
+ \brief Basic point class, having coordinates dfined in a neutral way
+ \ingroup Geometry
+ \tparam T numeric type, for example double, float, int
+ \tparam D number of coordinates, for example 2
+ \tparam C coordinate system, for example cs::cartesian
+ */
+ template<typename T, size_t D, typename C>
+ class point
+ {
+ public :
+ // Concept typedefs and members
+ typedef T coordinate_type;
+ typedef C coordinate_system;
+ static const size_t coordinate_count = D;
+
+
+ /// Default constructor, no initialization at all
+ inline point()
+ {}
+
+
+ /// Compile time access to coordinate values
+ template <size_t K>
+ inline const T& get() const
+ {
+ BOOST_STATIC_ASSERT(K < D);
+ return m_values[K];
+ }
+
+ template <size_t K>
+ inline void set(T value)
+ {
+ BOOST_STATIC_ASSERT(K < D);
+ m_values[K] = value;
+ }
+
+
+ /// Examine if point is equal to other point
+ inline bool operator==(const point& other) const
+ {
+ for (register size_t i = 0; i < D; i++)
+ {
+ if (! equals(m_values[i], other.m_values[i]))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /// Examine if points are NOT equal
+ inline bool operator!=(const point& other) const
+ {
+ return ! operator==(other);
+ }
+
+ /// Constructs with one, or optionally two or three values
+ inline point(const T& v0, const T& v1 = 0, const T& v2 = 0)
+ {
+ if (D >= 1) m_values[0] = v0;
+ if (D >= 2) m_values[1] = v1;
+ if (D >= 3) m_values[2] = v2;
+ }
+
+ private :
+ T m_values[D];
+ };
+
+
+
+ // Adapt the point to the concept
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ template <typename T, size_t D, typename C>
+ struct tag<point<T, D, C> > { typedef point_tag type; };
+
+ template<typename T, size_t D, typename C>
+ struct coordinate_type<point<T, D, C> > { typedef T type; };
+
+ template<typename T, size_t D, typename C>
+ struct coordinate_system<point<T, D, C> > { typedef C type; };
+
+ template<typename T, size_t D, typename C>
+ struct dimension<point<T, D, C> >: boost::mpl::int_<D> {};
+
+ template<typename T, size_t D, typename C>
+ struct access<point<T, D, C> >
+ {
+ template <size_t I>
+ static inline T get(const point<T, D, C>& p)
+ { return p.template get<I>(); }
+
+ template <size_t I>
+ static inline void set(point<T, D, C>& p, const T& value)
+ { p.template set<I>(value); }
+ };
+
+ }
+ #endif
+
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_POINT_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/point_ll.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/point_ll.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,114 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_POINT_LL_HPP
+#define _GEOMETRY_POINT_LL_HPP
+
+#include <string>
+#include <sstream>
+
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/core/cs.hpp>
+
+#include <geometry/geometries/point.hpp>
+#include <geometry/arithmetic/arithmetic.hpp>
+
+#include <geometry/util/graticule.hpp>
+#include <geometry/util/copy.hpp>
+
+namespace geometry
+{
+
+ /*!
+ \brief Point using spherical coordinates \a lat and \a lon, on Earth
+ \ingroup Geometry
+ \details The point_ll class implements a point with lat and lon functions. It can be constructed
+ using latitude and longitude classes. The latlong class can be defined in degrees or in radians.
+ There is a conversion method from degree to radian, and from radian to degree.
+ \tparam D degree/radian enumeration
+ \tparam T coordinate type, double (the default) or float (it might be int as well)
+ \note There is NO constructor with two values to avoid exchanging lat and long
+ \note Construction with latitude and longitude can be done in both orders, so lat/long and long/lat
+ \par Example:
+ Example showing how the point_ll class can be constructed. Note that it can also be constructed using
+ decimal degrees (43.123).
+ \dontinclude doxygen_examples.cpp
+ \skip example_point_ll_construct
+ \line {
+ \until }
+ */
+ template <typename T = double, typename C = cs::geographic<degree> >
+ class point_ll : public point<T, 2, C>
+ {
+ public :
+
+ /// Default constructor, does not initialize anything
+ inline point_ll() : point<T, 2, C>() {}
+
+ /// Constructor with longitude/latitude
+ inline point_ll(const longitude<T>& lo, const latitude<T>& la) : point<T, 2, C>(lo, la) {}
+
+ /// Constructor with latitude/longitude
+ inline point_ll(const latitude<T>& la, const longitude<T>& lo) : point<T, 2, C>(lo, la) {}
+
+ /// Get longitude
+ inline const T& lon() const { return this->template get<0>(); }
+ /// Get latitude
+ inline const T& lat() const { return this->template get<1>(); }
+
+ /// Set longitude
+ inline void lon(const T& v) { this->template set<0>(v); }
+ /// Set latitude
+ inline void lat(const T& v) { this->template set<1>(v); }
+
+ /// Get longitude
+ /// Set
+ inline void lon(const dms<east, T>& v) { this->template set<0>(v.as_value()); }
+ inline void lon(const dms<west, T>& v) { this->template set<0>(v.as_value()); }
+
+ inline void lat(const dms<north, T>& v) { this->template set<1>(v.as_value()); }
+ inline void lat(const dms<south, T>& v) { this->template set<1>(v.as_value()); }
+ };
+
+
+ // Adapt the point_ll to the concept
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename T, typename C>
+ struct tag<point_ll<T, C> > { typedef point_tag type; };
+
+ template<typename T, typename C>
+ struct coordinate_type<point_ll<T, C> > { typedef T type; };
+
+ template<typename T, typename C>
+ struct coordinate_system<point_ll<T, C> > { typedef C type; };
+
+ template<typename T, typename C>
+ struct dimension<point_ll<T, C> >: boost::mpl::int_<2> {};
+
+ template<typename T, typename C>
+ struct access<point_ll<T, C> >
+ {
+ template <size_t I>
+ static inline T get(const point_ll<T, C>& p)
+ { return p.template get<I>(); }
+
+ template <size_t I>
+ static inline void set(point_ll<T, C>& p, const T& value)
+ { p.template set<I>(value); }
+ };
+
+ }
+ #endif
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_POINT_LL_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/point_xy.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/point_xy.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,93 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_POINT_XY_HPP
+#define _GEOMETRY_POINT_XY_HPP
+
+#include <geometry/geometries/point.hpp>
+#include <geometry/core/cs.hpp>
+
+namespace geometry
+{
+
+
+ /*!
+ \brief 2D point in Cartesian coordinate system
+ \ingroup Geometry
+ \tparam T numeric type, arguments can be, for example, double, float, int
+ */
+ template<typename T, typename C = cs::cartesian>
+ class point_xy : public point<T, 2, C>
+ {
+ public :
+ /// Default constructor, does not initialize anything
+ inline point_xy() : point<T, 2, C>() {}
+ /// Constructor with x/y values
+ inline point_xy(const T& x, const T& y) : point<T, 2, C>(x, y) {}
+
+ /// Get x-value
+ inline const T& x() const
+ { return this->template get<0>(); }
+
+ /// Get y-value
+ inline const T& y() const
+ { return this->template get<1>(); }
+
+ /// Set x-value
+ inline void x(const T& v)
+ { this->template set<0>(v); }
+
+ /// Set y-value
+ inline void y(const T& v)
+ { this->template set<1>(v); }
+
+ /// Compare two points
+ inline bool operator<(const point_xy& other) const
+ {
+ return equals(x(), other.x()) ? y() < other.y() : x() < other.x();
+ }
+ };
+
+
+ // Adapt the point_xy to the concept
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+ template <typename T, typename C>
+ struct tag<point_xy<T, C> > { typedef point_tag type; };
+
+ template<typename T, typename C>
+ struct coordinate_type<point_xy<T, C> > { typedef T type; };
+
+ template<typename T, typename C>
+ struct coordinate_system<point_xy<T, C> > { typedef C type; };
+
+
+ template<typename T, typename C>
+ struct dimension<point_xy<T, C> >: boost::mpl::int_<2> {};
+
+ template<typename T, typename C>
+ struct access<point_xy<T, C> >
+ {
+ template <size_t I>
+ static inline T get(const point_xy<T, C>& p)
+ { return p.template get<I>(); }
+
+ template <size_t I>
+ static inline void set(point_xy<T, C>& p, const T& value)
+ { p.template set<I>(value); }
+ };
+
+ }
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_POINT_XY_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/polygon.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/polygon.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,150 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_POLYGON_HPP
+#define _GEOMETRY_POLYGON_HPP
+
+#include <vector>
+
+#include <boost/concept/assert.hpp>
+
+#include <geometry/core/point_type.hpp>
+#include <geometry/core/ring_type.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/geometries/linear_ring.hpp>
+
+
+namespace geometry
+{
+
+ /*!
+ \brief The \b polygon contains an outer ring and zero or more inner rings.
+ \ingroup Geometry
+ \tparam P point type
+ \tparam VR optional container type for inner rings, for example std::vector, std::list, std::deque
+ \tparam VP optional container type for points, for example std::vector, std::list, std::deque
+ \tparam AR container-allocator-type
+ \tparam AP container-allocator-type
+ \note The container collecting the points in the rings can be different from the
+ container collecting the inner rings. They all default to vector.
+ */
+ template<typename P,
+ template<typename,typename> class VP = std::vector,
+ template<typename,typename> class VR = std::vector,
+ template<typename> class AP = std::allocator,
+ template<typename> class AR = std::allocator>
+ class polygon
+ {
+ BOOST_CONCEPT_ASSERT((Point<P>));
+
+ public :
+ // Member types
+ typedef P point_type;
+ typedef linear_ring<P, VP, AP> ring_type;
+ typedef VR<ring_type , AR<ring_type > > inner_container_type;
+
+ inline const ring_type& outer() const { return m_outer; }
+ inline const inner_container_type & inners() const { return m_inners; }
+
+ inline ring_type& outer() { return m_outer; }
+ inline inner_container_type & inners() { return m_inners; }
+
+ /// Utility method, clears outer and inner rings
+ inline void clear()
+ {
+ m_outer.clear();
+ m_inners.clear();
+ }
+
+ private :
+ ring_type m_outer;
+ inner_container_type m_inners;
+ };
+
+
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ template<typename P,
+ template<typename,typename> class VP, template<typename,typename> class VR,
+ template<typename> class AP, template<typename> class AR>
+ struct tag< polygon<P, VP, VR, AP, AR> >
+ {
+ typedef polygon_tag type;
+ };
+
+
+ template<typename P,
+ template<typename,typename> class VP, template<typename,typename> class VR,
+ template<typename> class AP, template<typename> class AR>
+ struct ring_type< polygon<P, VP, VR, AP, AR> >
+ {
+ typedef typename polygon<P, VP, VR, AP, AR>::ring_type type;
+ };
+
+
+ template<typename P,
+ template<typename,typename> class VP, template<typename,typename> class VR,
+ template<typename> class AP, template<typename> class AR>
+ struct interior_type< polygon<P, VP, VR, AP, AR> >
+ {
+ typedef typename polygon<P, VP, VR, AP, AR>::inner_container_type type;
+ };
+
+
+ template<typename P,
+ template<typename,typename> class VP, template<typename,typename> class VR,
+ template<typename> class AP, template<typename> class AR>
+ struct exterior_ring< polygon<P, VP, VR, AP, AR> >
+ {
+ typedef polygon<P, VP, VR, AP, AR> POLY;
+ static inline typename POLY::ring_type& get(POLY& polygon)
+ {
+ return polygon.outer();
+ }
+
+ static inline const typename POLY::ring_type& get(const POLY& polygon)
+ {
+ return polygon.outer();
+ }
+ };
+
+
+ template<typename P,
+ template<typename,typename> class VP, template<typename,typename> class VR,
+ template<typename> class AP, template<typename> class AR>
+ struct interior_rings< polygon<P, VP, VR, AP, AR> >
+ {
+ typedef polygon<P, VP, VR, AP, AR> POLY;
+
+ static inline typename POLY::inner_container_type& get(POLY& polygon)
+ {
+ return polygon.inners();
+ }
+
+ static inline const typename POLY::inner_container_type& get(const POLY& polygon)
+ {
+ return polygon.inners();
+ }
+ };
+
+
+ }
+ #endif
+
+
+} // namespace geometry
+
+
+#endif //_GEOMETRY_POLYGON_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/register/register_box.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/register/register_box.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,106 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_BOX_REGISTER_HPP
+#define _GEOMETRY_BOX_REGISTER_HPP
+
+
+#ifndef DOXYGEN_NO_SPECIALIZATIONS
+
+// box based on point
+#define GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, Point, MinCorner, MaxCorner) \
+template <size_t C, size_t D> \
+struct indexed_access<Box, C, D> \
+{ \
+ static inline typename coordinate_type<Point>::type get(const Box& b) \
+ { \
+ return C == min_corner ? geometry::get<D>(b. MinCorner) : geometry::get<D>(b. MaxCorner); \
+ } \
+ static inline void set(Box& b, const typename coordinate_type<Point>::type& value) \
+ { \
+ if (C == min_corner) geometry::set<D>(b. MinCorner, value); else geometry::set<D>(b. MaxCorner, value); \
+ } \
+};
+
+
+#define GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATIZED(Box, Point, MinCorner, MaxCorner) \
+template <typename Point, size_t C, size_t D> \
+struct indexed_access<Box<Point>, C, D> \
+{ \
+ static inline typename coordinate_type<Point>::type get(const Box<Point>& b) \
+ { \
+ return C == min_corner ? geometry::get<D>(b. MinCorner) : geometry::get<D>(b. MaxCorner); \
+ } \
+ static inline void set(Box<Point>& b, const typename coordinate_type<Point>::type& value) \
+ { \
+ if (C == min_corner) geometry::set<D>(b. MinCorner, value); else geometry::set<D>(b. MaxCorner, value); \
+ } \
+};
+
+
+#define GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, Point, Left, Bottom, Right, Top) \
+template <size_t C, size_t D> \
+struct indexed_access<Box, C, D> \
+{ \
+ static inline typename coordinate_type<Point>::type get(const Box& b) \
+ { \
+ return C == min_corner && D == 0 ? b. Left \
+ : C == min_corner && D == 1 ? b. Bottom \
+ : C == max_corner && D == 0 ? b. Right \
+ : C == max_corner && D == 1 ? b. Top \
+ : 0; \
+ } \
+ static inline void set(Box& b, const typename coordinate_type<Point>::type& value) \
+ { \
+ if (C == min_corner && D == 0) b. Left = value; \
+ else if (C == min_corner && D == 1) b. Bottom = value; \
+ else if (C == max_corner && D == 0) b. Right = value; \
+ else if (C == max_corner && D == 1) b. Top = value; \
+ } \
+};
+
+
+
+#define GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, PointType) \
+ template<> struct tag<Box > { typedef box_tag type; }; \
+ template<> struct point_type<Box > { typedef PointType type; };
+
+#define GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATIZED(Box, PointType) \
+ template<typename PointType> struct tag<Box<PointType> > { typedef box_tag type; }; \
+ template<typename PointType> struct point_type<Box<PointType> > { typedef PointType type; };
+
+#endif // DOXYGEN_NO_SPECIALIZATIONS
+
+
+
+#define GEOMETRY_REGISTER_BOX(Box, PointType, MinCorner, MaxCorner) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, PointType) \
+ GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, PointType, MinCorner, MaxCorner) \
+}}
+
+
+#define GEOMETRY_REGISTER_BOX_TEMPLATIZED(Box, PointType, MinCorner, MaxCorner) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATIZED(Box, PointType) \
+ GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATIZED(Box, PointType, MinCorner, MaxCorner) \
+}}
+
+#define GEOMETRY_REGISTER_BOX_2D_4VALUES(Box, PointType, Left, Bottom, Right, Top) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, PointType) \
+ GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, PointType, Left, Bottom, Right, Top) \
+}}
+
+
+
+// CONST versions are for boxes probably not that common. Leave this for the moment.
+
+
+#endif // _GEOMETRY_BOX_REGISTER_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/register/register_point.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/register/register_point.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,154 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_POINT_REGISTER_HPP
+#define _GEOMETRY_POINT_REGISTER_HPP
+
+
+
+// This file implements a "macro party", nevertheless very useful for registration of custom geometry types
+
+#ifndef DOXYGEN_NO_SPECIALIZATIONS
+
+// Starting point, specialize basic traits necessary to register a point
+// (the 'accessor' is technically not specialization but definition, specialized in another macro)
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, Dim, CoordinateType, CoordinateSystem) \
+ template<> struct tag<Point> { typedef point_tag type; }; \
+ template<> struct dimension<Point> : boost::mpl::int_<Dim> {}; \
+ template<> struct coordinate_type<Point> { typedef CoordinateType type; }; \
+ template<> struct coordinate_system<Point> { typedef CoordinateSystem type; }; \
+ template<int I> struct Point##accessor {};
+
+
+// Non Const version
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, CoordinateType) \
+ template<> struct access<Point> { \
+ template <int I> \
+ static inline CoordinateType get(const Point& p) { return Point##accessor<I>::get(p); } \
+ template <int I> \
+ static inline void set(Point& p, const CoordinateType& value) { Point##accessor<I>::set(p, value); } \
+ };
+
+// Const version
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, CoordinateType) \
+ template<> struct access<Point> { \
+ template <int I> \
+ static inline CoordinateType get(const Point& p) { return Point##accessor<I>::get(p); } \
+ };
+
+
+
+
+// Specialize the point-specific-accessor class, declared below, per dimension
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR(Point, Dim, CoordinateType, Get, Set) \
+ template<> struct Point##accessor< Dim > \
+ { \
+ static inline CoordinateType get(const Point& p) { return p. Get; } \
+ static inline void set(Point& p, const CoordinateType& value) { p. Set = value; } \
+ };
+
+
+// Const version
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_CONST(Point, Dim, CoordinateType, Get) \
+ template<> struct Point##accessor< Dim > \
+ { \
+ static inline CoordinateType get(const Point& p) { return p. Get; } \
+ };
+
+
+// Get/set version
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_GET_SET(Point, Dim, CoordinateType, Get, Set) \
+ template<> struct Point##accessor< Dim > \
+ { \
+ static inline CoordinateType get(const Point& p) { return p. Get (); } \
+ static inline void set(Point& p, const CoordinateType& value) { p. Set ( value ); } \
+ };
+
+
+
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_2D(Point, CoordinateType, Get0, Get1, Set0, Set1) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR(Point, 0, CoordinateType, Get0, Set0) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR(Point, 1, CoordinateType, Get1, Set1)
+
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_3D(Point, CoordinateType, Get0, Get1, Get2, Set0, Set1, Set2) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR(Point, 0, CoordinateType, Get0, Set0) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR(Point, 1, CoordinateType, Get1, Set1) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR(Point, 2, CoordinateType, Get2, Set2)
+
+// Const versions
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST_2D(Point, CoordinateType, Get0, Get1) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_CONST(Point, 0, CoordinateType, Get0) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_CONST(Point, 1, CoordinateType, Get1)
+
+#define GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST_3D(Point, CoordinateType, Get0, Get1, Get2) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_CONST(Point, 0, CoordinateType, Get0) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_CONST(Point, 1, CoordinateType, Get1) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_CONST(Point, 2, CoordinateType, Get2)
+
+#endif // DOXYGEN_NO_SPECIALIZATIONS
+
+
+
+// Library user macro to register a custom 2D point
+#define GEOMETRY_REGISTER_POINT_2D(Point, CoordinateType, CoordinateSystem, Field0, Field1) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 2, CoordinateType, CoordinateSystem) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, CoordinateType) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_2D(Point, CoordinateType, Field0, Field1, Field0, Field1) \
+}}
+
+// Library user macro to register a custom 3D point
+#define GEOMETRY_REGISTER_POINT_3D(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 3, CoordinateType, CoordinateSystem) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, CoordinateType) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_3D(Point, CoordinateType, Field0, Field1, Field2, Field0, Field1, Field2) \
+}}
+
+
+
+// Library user macro to register a custom 2D point (CONST version)
+#define GEOMETRY_REGISTER_POINT_2D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 2, CoordinateType, CoordinateSystem) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, CoordinateType) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST_2D(Point, CoordinateType, Field0, Field1) \
+}}
+
+// Library user macro to register a custom 3D point (CONST version)
+#define GEOMETRY_REGISTER_POINT_3D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 3, CoordinateType, CoordinateSystem) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, CoordinateType) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST_3D(Point, CoordinateType, Field0, Field1, Field2) \
+}}
+
+
+// Library user macro to register a custom 2D point (having separate get/set methods)
+#define GEOMETRY_REGISTER_POINT_2D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Set0, Set1) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 2, CoordinateType, CoordinateSystem) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, CoordinateType) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_GET_SET(Point, 0, CoordinateType, Get0, Set0) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_GET_SET(Point, 1, CoordinateType, Get1, Set1) \
+}}
+
+
+// Library user macro to register a custom 3D point (having separate get/set methods)
+#define GEOMETRY_REGISTER_POINT_3D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Get2, Set0, Set1, Set2) \
+namespace geometry { namespace traits { \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 3, CoordinateType, CoordinateSystem) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, CoordinateType) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_GET_SET(Point, 0, CoordinateType, Get0, Set0) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_GET_SET(Point, 1, CoordinateType, Get1, Set1) \
+ GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESSOR_GET_SET(Point, 2, CoordinateType, Get2, Set2) \
+}}
+
+
+#endif // _GEOMETRY_POINT_REGISTER_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometries/segment.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometries/segment.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,96 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_SEGMENT_HPP
+#define _GEOMETRY_SEGMENT_HPP
+
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/concept/assert.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+namespace geometry
+{
+
+ /*!
+ \brief Class segment: small containing two (templatized) point references
+ \ingroup Geometry
+ \details From Wikipedia: In geometry, a line segment is a part of a line that is bounded
+ by two distinct end points, and contains every point on the line between its end points
+ \note The structure is like std::pair, and can often be used interchangeable.
+ So points are public available. We cannot derive from std::pair<P&, P&> because of reference
+ assignments. Points are not const and might be changed by the algorithm
+ (used in intersection_linestring)
+ \tparam P point type of the segment
+ */
+ template<typename P>
+ struct segment
+ {
+ private :
+ BOOST_CONCEPT_ASSERT((typename boost::mpl::if_<
+ boost::is_const<P>,
+ ConstPoint<P>,
+ Point<P>
+ >
+ ));
+
+ public :
+ typedef P point_type;
+ P& first;
+ P& second;
+ inline segment(P& p1, P& p2)
+ : first(p1), second(p2)
+ {}
+ };
+
+
+ // Traits specializations for segment above
+ #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+ namespace traits
+ {
+
+ template <typename P>
+ struct tag< segment<P> > { typedef segment_tag type; };
+
+ template <typename P>
+ struct point_type<segment<P> > { typedef P type; };
+
+ template <typename P, size_t I, size_t D>
+ struct indexed_access<segment<P>, I, D>
+ {
+ typedef segment<P> S;
+ typedef typename geometry::coordinate_type<S>::type T;
+
+ static inline T get(const S& s)
+ {
+ return I == 0 ? geometry::get<D>(s.first) : geometry::get<D>(s.second);
+ }
+
+ static inline void set(S& s, const T& value)
+ {
+ if (I == 0)
+ {
+ geometry::set<D>(s.first, value);
+ }
+ else
+ {
+ geometry::set<D>(s.second, value);
+ }
+ }
+ };
+
+ }
+ #endif
+
+
+} // namespace geometry
+
+
+#endif //_GEOMETRY_SEGMENT_HPP

Added: sandbox/ggl/boost/ggl/geometry/geometry.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/geometry.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,72 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_GEOMETRY_HPP
+#define _GEOMETRY_GEOMETRY_HPP
+
+// Shortcut to include all header files
+
+
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/concepts/ring_concept.hpp>
+#include <geometry/core/concepts/linestring_concept.hpp>
+#include <geometry/core/concepts/polygon_concept.hpp>
+
+#include <geometry/core/concepts/box_concept.hpp>
+#include <geometry/core/concepts/nsphere_concept.hpp>
+#include <geometry/core/concepts/segment_concept.hpp>
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/tag.hpp>
+#include <geometry/core/tags.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/radian_access.hpp>
+#include <geometry/core/topological_dimension.hpp>
+
+
+#include <geometry/arithmetic/arithmetic.hpp>
+#include <geometry/arithmetic/dot_product.hpp>
+
+#include <geometry/strategies/strategies.hpp>
+
+#include <geometry/algorithms/append.hpp>
+#include <geometry/algorithms/area.hpp>
+#include <geometry/algorithms/assign.hpp>
+#include <geometry/algorithms/buffer.hpp>
+#include <geometry/algorithms/centroid.hpp>
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/convert.hpp>
+#include <geometry/algorithms/convex_hull.hpp>
+#include <geometry/algorithms/correct.hpp>
+#include <geometry/algorithms/distance.hpp>
+#include <geometry/algorithms/envelope.hpp>
+#include <geometry/algorithms/foreach.hpp>
+#include <geometry/algorithms/intersection.hpp>
+#include <geometry/algorithms/length.hpp>
+#include <geometry/algorithms/make.hpp>
+#include <geometry/algorithms/num_points.hpp>
+#include <geometry/algorithms/parse.hpp>
+#include <geometry/algorithms/selected.hpp>
+#include <geometry/algorithms/simplify.hpp>
+#include <geometry/algorithms/transform.hpp>
+#include <geometry/algorithms/within.hpp>
+
+
+#include <geometry/io/wkt/aswkt.hpp>
+#include <geometry/io/wkt/fromwkt.hpp>
+
+#include <geometry/util/for_each_coordinate.hpp>
+#include <geometry/util/copy.hpp>
+#include <geometry/util/loop.hpp>
+#include <geometry/util/promotion_traits.hpp>
+#include <geometry/util/math.hpp>
+
+
+#endif // _GEOMETRY_GEOMETRY_HPP

Added: sandbox/ggl/boost/ggl/geometry/io/wkt/aswkt.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/io/wkt/aswkt.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,298 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_ASWKT_HPP
+#define _GEOMETRY_ASWKT_HPP
+
+#include <iostream>
+#include <string>
+
+#include <boost/concept/assert.hpp>
+
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/ring_type.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/geometries/linear_ring.hpp>
+#include <geometry/algorithms/convert.hpp>
+
+
+
+/*!
+\defgroup wkt wkt: parse and stream WKT (Well-Known Text)
+The wkt classes stream the specified geometry as \ref OGC Well Known Text (\ref WKT). It is defined for OGC geometries.
+It is therefore not defined for all geometries (e.g. not for circle)
+\note The implementation is independant from point type, point_xy and point_ll are supported,
+as well as points with more than two coordinates.
+
+*/
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace wkt
+ {
+ template <typename P, int I, int Count>
+ struct dump_coordinate
+ {
+ template <typename CH, typename TR>
+ inline static void dump(std::basic_ostream<CH, TR>& os, const P& p)
+ {
+ os << (I > 0 ? " " : "") << get<I>(p);
+ dump_coordinate<P, I + 1, Count>::dump(os, p);
+ }
+ };
+
+ template <typename P, int Count>
+ struct dump_coordinate<P, Count, Count>
+ {
+ template <typename CH, typename TR>
+ inline static void dump(std::basic_ostream<CH, TR>&, const P&)
+ {}
+ };
+
+
+
+ /*!
+ \brief Stream points as \ref WKT
+ */
+ template <typename P>
+ struct wkt_point
+ {
+ template <typename CH, typename TR>
+ inline static void stream(std::basic_ostream<CH, TR>& os, const P& p)
+ {
+ os << "POINT(";
+ dump_coordinate<P, 0, dimension<P>::value>::dump(os, p);
+ os << ")";
+ }
+
+ private :
+ BOOST_CONCEPT_ASSERT( (ConstPoint<P>) );
+ };
+
+
+ /*!
+ \brief Stream ranges as WKT
+ \note CRTP is used to stream prefix/postfix, enabling derived classes to override this
+ */
+ template <typename R, typename C>
+ struct wkt_range
+ {
+ template <typename CH, typename TR>
+ inline static void stream(std::basic_ostream<CH, TR>& os, const R& range)
+ {
+ os << C::prefix();
+
+ bool first = true;
+ typedef typename boost::range_const_iterator<R>::type IT;
+ for (IT it = boost::begin(range); it != boost::end(range); it++)
+ {
+ os << (first ? "" : ",");
+ dump_coordinate<P, 0, dimension<P>::value>::dump(os, *it);
+ first = false;
+ }
+
+ os << C::postfix();
+ }
+
+ private :
+ typedef typename boost::range_value<R>::type P;
+ BOOST_CONCEPT_ASSERT( (ConstPoint<P>) );
+ };
+
+ template <typename R>
+ struct wkt_poly_ring : wkt_range<R, wkt_poly_ring<R> >
+ {
+ inline static const char* prefix() { return "("; }
+ inline static const char* postfix() { return ")"; }
+ };
+
+ template <typename P>
+ struct wkt_poly
+ {
+ template <typename CH, typename TR>
+ inline static void stream(std::basic_ostream<CH, TR>& os, const P& poly)
+ {
+ os << "POLYGON(";
+
+ typedef typename ring_type<P>::type R;
+ wkt_poly_ring<R>::stream(os, exterior_ring(poly));
+
+ typedef typename boost::range_const_iterator<typename interior_type<P>::type>::type IT;
+ for (IT it = boost::begin(interior_rings(poly)); it != boost::end(interior_rings(poly)); it++)
+ {
+ os << ",";
+ wkt_poly_ring<R>::stream(os, *it);
+ }
+
+ os << ")";
+ }
+
+ private :
+ BOOST_CONCEPT_ASSERT( (ConstPoint<typename point_type<P>::type>) );
+ };
+
+ template <typename B>
+ struct wkt_box
+ {
+ typedef typename point_type<B>::type P;
+ template <typename CH, typename TR>
+ inline static void stream(std::basic_ostream<CH, TR>& os, const B& box)
+ {
+ // Convert to linear ring, then stream
+ typedef linear_ring<P> R;
+ R ring;
+ geometry::convert(box, ring);
+ os << "POLYGON(";
+ wkt_poly_ring<R>::stream(os, ring);
+ os << ")";
+ }
+
+ private :
+ BOOST_CONCEPT_ASSERT( (ConstPoint<P>) );
+
+ inline wkt_box()
+ {
+ // Only streaming of boxes with two dimensions is support, otherwise it is a polyhedron!
+ //assert_dimension<B, 2>();
+ }
+ };
+
+
+ } // namespace wkt
+ } // namespace impl
+ #endif
+
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+
+ /*!
+ \brief Dispatching base struct for WKT streaming, specialized below per geometry type
+ \details Specializations should implement a static method "stream" to stream a geometry
+ The static method should have the signatur:
+
+ template <typename CH, typename TR>
+ inline static void stream(std::basic_ostream<CH, TR>& os, const G& geometry)
+ */
+ template <typename T, typename G>
+ struct wkt {};
+
+
+ /*!
+ \brief Specialization to stream point as WKT
+ */
+ template <typename P>
+ struct wkt<point_tag, P> : public impl::wkt::wkt_point<P> {};
+
+
+ /*!
+ \brief Specialization to stream linestring as WKT
+ */
+ template <typename R>
+ struct wkt<linestring_tag, R> : public impl::wkt::wkt_range<R, wkt<linestring_tag, R> >
+ {
+ inline static const char* prefix() { return "LINESTRING("; }
+ inline static const char* postfix() { return ")"; }
+ };
+
+ /*!
+ \brief Specialization to stream a ring as WKT
+ \details A "linear_ring" does not exist in WKT.
+ A linear ring is equivalent to a polygon without inner rings
+ It is therefore streamed as a polygon
+ */
+ template <typename B>
+ struct wkt<box_tag, B> : public impl::wkt::wkt_box<B> {};
+
+ /*!
+ \brief Specialization to stream a ring as WKT
+ \details A "linear_ring" does not exist in WKT.
+ A linear ring is equivalent to a polygon without inner rings
+ It is therefore streamed as a polygon
+ */
+ template <typename R>
+ struct wkt<ring_tag, R> : public impl::wkt::wkt_range<R, wkt<ring_tag, R> >
+ {
+ // Note, double parentheses are intentional, indicating WKT ring begin/end
+ inline static const char* prefix() { return "POLYGON(("; }
+ inline static const char* postfix() { return "))"; }
+ };
+
+ /*!
+ \brief Specialization to stream polygon as WKT
+ */
+ template <typename P>
+ struct wkt<polygon_tag, P> : public impl::wkt::wkt_poly<P> {};
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Generic geometry template manipulator class, takes corresponding output class from traits class
+ \ingroup wkt
+ \details Stream manipulator, streams geometry classes as \ref WKT streams
+ \par Example:
+ Small example showing how to use the wkt class
+ \dontinclude doxygen_examples.cpp
+ \skip example_as_wkt_point
+ \line {
+ \until }
+ \note the template parameter must be specified. If that is inconvient, users might use streamwkt
+ which streams geometries as manipulators, or the object generator make_wkt
+ */
+ template <typename G>
+ class wkt
+ {
+ public :
+ inline wkt(const G& g) : m_geometry(g) {}
+
+ template <typename CH, typename TR>
+ inline friend std::basic_ostream<CH, TR>& operator<<(std::basic_ostream<CH, TR>& os, const wkt& m)
+ {
+ dispatch::wkt<typename tag<G>::type, G>::stream(os, m.m_geometry);
+ os.flush();
+ return os;
+ }
+
+ private :
+ const G& m_geometry;
+ };
+
+
+ /*!
+ \brief Object generator to conveniently stream objects without including streamwkt
+ \ingroup wkt
+ \par Example:
+ Small example showing how to use the make_wkt helper function
+ \dontinclude doxygen_examples.cpp
+ \skip example_as_wkt_vector
+ \line {
+ \until }
+ */
+ template <typename T>
+ inline wkt<T> make_wkt(const T& t)
+ {
+ return wkt<T>(t);
+ }
+
+
+
+}
+
+#endif // _GEOMETRY_ASWKT_HPP

Added: sandbox/ggl/boost/ggl/geometry/io/wkt/fromwkt.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/io/wkt/fromwkt.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,354 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_FROMWKT_HPP
+#define _GEOMETRY_FROMWKT_HPP
+
+#include <string>
+
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <boost/tokenizer.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string.hpp>
+
+#include <boost/concept/requires.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/exterior_ring.hpp>
+#include <geometry/core/interior_rings.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/algorithms/clear.hpp>
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace wkt
+ {
+ // (wkt: Well Known Text, defined by OGC for all geometries and implemented by e.g. databases (MySQL, PostgreSQL))
+
+ typedef boost::tokenizer<boost::char_separator<char> > TOK;
+
+ namespace impl
+ {
+ template <typename P, int I, int N>
+ struct parsing_assigner
+ {
+ static void run(TOK::iterator& it, TOK::iterator end, P& point)
+ {
+ typedef typename coordinate_type<P>::type ctype;
+
+ // Stop at end of tokens, or at "," ot ")"
+ bool finished = (it == end || *it == "," || *it == ")");
+
+ set<I>(point,
+ finished ?
+ // Initialize missing coordinates to default constructor (zero)
+ ctype():
+ // Use lexical_cast for conversion to double/int
+ // Note that it is much slower than atof. However, it is more standard
+ // and in parsing the change in performance falls probably away against
+ // the tokenizing
+ boost::lexical_cast<ctype>(it->c_str())
+ );
+
+ parsing_assigner<P, I+1, N>::run(finished ? it : ++it, end, point);
+ }
+ };
+
+ template <typename P, int N>
+ struct parsing_assigner<P, N, N>
+ {
+ static void run(TOK::iterator&, TOK::iterator, P&) {}
+ };
+ }
+
+ /*!
+ \brief Internal, parses coordinate sequences, strings are formated like "(1 2,3 4,...)"
+ \param it token-iterator, should be pre-positioned at "(", is post-positions after last ")"
+ \param end end-token-iterator
+ \param out Output itererator receiving coordinates
+ \return true if string starts with "(" and ends with ")" and all coordinates are parsed
+ */
+ template <typename P, typename O_IT>
+ inline bool parse_container(TOK::iterator& it, TOK::iterator end, O_IT out)
+ {
+ // Start with "("
+ if (it == end || *it != "(")
+ {
+ return false;
+ }
+ it++;
+
+ // Stop at ")"
+ while (it != end && *it != ")")
+ {
+ P point;
+ impl::parsing_assigner<P, 0, dimension<P>::value>::run(it, end, point);
+ out = point;
+ out++;
+ if (it != end && *it == ",")
+ {
+ it++;
+ }
+ }
+ // Should end with ")"
+ if (it != end && *it == ")")
+ {
+ it++;
+ return true;
+ }
+ return false;
+ }
+
+ /*!
+ \brief Internal, starts parsing
+ \param tokens boost tokens, parsed with separator " " and keeping separator "()"
+ \param geometry string to compare with first token
+ \return iterator put after geometry and/or optional m, z modifiers
+ */
+ inline TOK::iterator parse_begin(const TOK& tokens, const std::string& geometry)
+ {
+ TOK::iterator it = tokens.begin();
+ if (it != tokens.end() && boost::iequals(*it++, geometry))
+ {
+ while (it != tokens.end() && (boost::iequals(*it, "M")
+ || boost::iequals(*it, "Z")
+ || boost::iequals(*it, "MZ")
+ || boost::iequals(*it, "ZM")))
+ {
+ it++;
+ }
+ }
+ return it;
+ }
+
+ /*!
+ \brief Parses point from \ref WKT
+ \param wkt string containing Well-Known Text
+ \param point point receiving coordinates, if string has less than point, rest is initialized to zero
+ \return true if string starts with "POINT(". It is forgiving for last ")"
+ \note It is case insensitive and can have the WKT forms "point", "point m", "point z", "point zm", "point mz"
+ */
+ template <typename P>
+ inline
+ BOOST_CONCEPT_REQUIRES(((Point<P>)),
+ (bool))
+ parse_point(const std::string& wkt, P& point)
+ {
+ // Break it apart into "POINT" "(" c1 c2 c3 ... ")"
+ // WKT Coordinate string is space separated. Points in a sequence are comma separated
+ // Token iterator is thus created with " ", ",()"
+
+ TOK tokens(wkt, boost::char_separator<char>(" ", "()"));
+ TOK::iterator it = parse_begin(tokens, "point");
+ if (it != tokens.end() && *it == "(")
+ {
+ it++;
+ }
+ impl::parsing_assigner<P, 0, dimension<P>::value>::run(it, tokens.end(), point);
+ return true;
+ }
+
+
+
+ /*!
+ \brief Parses linestring from \ref WKT
+ \param wkt string containing Well-Known Text
+ \param out appending/inserting iterator which will receive the parsed coordinates
+ \return true if string starts with "LINESTRING(" (case-insensitive) and coordinate-string can be parsed
+ */
+ template <typename P, typename O_IT>
+ inline bool parse_linestring(const std::string& wkt, O_IT out)
+ {
+ // Break it apart into "LINESTRING" "(" point(s) ")"
+ TOK tokens(wkt, boost::char_separator<char>(" ", ",()"));
+ TOK::iterator it = parse_begin(tokens, "linestring");
+ return parse_container<P>(it, tokens.end(), out);
+ }
+
+
+
+ /*!
+ \brief Parses polygon from \ref WKT
+ \param wkt string containing Well-Known Text
+ \param poly polygon which will be cleared and set to the specified coordinates
+ \return true if string starts with "POLYGON(" (case-insensitive) and rings can be parsed
+ */
+ template <typename Y>
+ inline bool parse_polygon(const std::string& wkt, Y& poly)
+ {
+ poly.clear();
+
+ TOK tokens(wkt, boost::char_separator<char>(" ", ",()"));
+ TOK::iterator it = parse_begin(tokens, "polygon");
+ // Polygon string begin
+ if (it != tokens.end() && *it++ == "(")
+ {
+ int n = -1;
+ // For each ring
+ while (it != tokens.end())
+ {
+ if (++n == 0)
+ {
+ parse_container<typename point_type<Y>::type>(it, tokens.end(), std::back_inserter(exterior_ring(poly)));
+ }
+ else
+ {
+ interior_rings(poly).resize(n);
+ parse_container<typename point_type<Y>::type>(it, tokens.end(), std::back_inserter(interior_rings(poly).back()));
+ }
+ if (it != tokens.end())
+ {
+ // Skip "," or ")" after container is parsed
+ it++;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+
+ } // namespace wkt
+ } // namespace impl
+ #endif
+
+ #ifndef DOXYGEN_NO_DISPATCH
+ namespace dispatch
+ {
+ template <typename TAG, typename G>
+ struct from_wkt
+ {
+ };
+
+ // Partial specializations
+
+ /*!
+ \brief Build a point from OGC Well-Known Text (\ref WKT)
+ \ingroup wkt
+ \param wkt string containing \ref WKT
+ \param p point which will be cleared and set to the specified point
+ \return true if \ref WKT can be parsed
+ */
+ template <typename G>
+ struct from_wkt<point_tag, G>
+ {
+ inline static bool parse(const std::string& wkt, G& geometry)
+ {
+ return impl::wkt::parse_point(wkt, geometry);
+ }
+ };
+
+
+ /*!
+ \brief Build a linestring from OGC Well-Known Text (\ref WKT)
+ \ingroup wkt
+ \param wkt string containing \ref WKT
+ \param line linestring which will be cleared and set to the specified points
+ \return true if \ref WKT can be parsed
+ */
+ template <typename L>
+ struct from_wkt<linestring_tag, L>
+ {
+ inline static bool parse(const std::string& wkt, L& linestring)
+ {
+ geometry::clear(linestring);
+ typedef typename boost::range_value<L>::type P;
+ return impl::wkt::parse_linestring<P>(wkt, std::back_inserter(linestring));
+ }
+ };
+
+ /*!
+ \brief Build a polygon from OGC Well-Known Text (\ref WKT)
+ \ingroup wkt
+ \param wkt string containing \ref WKT
+ \param poly polygon which will be cleared and set to the specified polygon
+ \return true if \ref WKT can be parsed to the polygon (starts with "POLYGON", has valid rings and coordinates)
+ */
+ template <typename G>
+ struct from_wkt<polygon_tag, G>
+ {
+ inline static bool parse(const std::string& wkt, G& geometry)
+ {
+ return impl::wkt::parse_polygon(wkt, geometry);
+ }
+ };
+
+ } // namespace dispatch
+ #endif
+
+
+ /*!
+ \brief Parses OGC Well-Known Text (\ref WKT) into a geometry (any geometry)
+ \ingroup wkt
+ \param wkt string containing \ref WKT
+ \param geometry output geometry
+ \return true if \ref WKT can be parsed
+ \par Example:
+ Small example showing how to use from_wkt to build a point
+ \dontinclude doxygen_examples.cpp
+ \skip example_from_wkt_point
+ \line {
+ \until }
+ \par Example:
+ Small example showing how to use from_wkt to build a linestring
+ \dontinclude doxygen_examples.cpp
+ \skip example_from_wkt_linestring
+ \line {
+ \until }
+ \par Example:
+ Small example showing how to use from_wkt to build a polygon
+ \dontinclude doxygen_examples.cpp
+ \skip example_from_wkt_polygon
+ \line {
+ \until }
+ */
+ template <typename G>
+ inline bool from_wkt(const std::string& wkt, G& geometry)
+ {
+ return dispatch::from_wkt<typename tag<G>::type, G>::parse(wkt, geometry);
+ }
+
+
+ /*!
+ \brief Parses OGC Well-Known Text (\ref WKT) and outputs using an output iterator
+ \ingroup wkt
+ \param wkt string containing \ref WKT
+ \param out output iterator
+ \return true if \ref WKT can be parsed
+ \note Because the output iterator doesn't always have the type value_type, it should be
+ specified in the function call.
+ \par Example:
+ Small example showing how to use from_wkt with an output iterator
+ \dontinclude doxygen_examples.cpp
+ \skip example_from_wkt_output_iterator
+ \line {
+ \until }
+ */
+ template <typename P, typename O_IT>
+ inline bool from_wkt(const std::string& wkt, O_IT out)
+ {
+ // Todo: maybe take this from the string, or do not call parse_begin, such that
+ // any coordinate string is parsed and outputted
+ const std::string& tag = "linestring";
+
+ impl::wkt::TOK tokens(wkt, boost::char_separator<char>(" ", ",()"));
+ impl::wkt::TOK::iterator it = impl::wkt::parse_begin(tokens, tag);
+ return impl::wkt::parse_container<P>(it, tokens.end(), out);
+ }
+
+}
+
+#endif // _GEOMETRY_FROMWKT_HPP

Added: sandbox/ggl/boost/ggl/geometry/io/wkt/streamwkt.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/io/wkt/streamwkt.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,39 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STREAMWKT_HPP
+#define _GEOMETRY_STREAMWKT_HPP
+
+#include <geometry/io/wkt/aswkt.hpp>
+
+// This short file contains only one manipulator, streaming as WKT
+// Don't move contents to as_wkt, developers must be able to choose how to stream
+
+// Don't use namespace geometry, to enable the library to stream custom geometries which
+// are living outside the namespace geometry
+
+//namespace geometry
+//{
+
+
+ /*!
+ \brief Streams a geometry as Well-Known Text
+ \ingroup wkt
+ */
+ template<typename CH, typename TR, typename G>
+ inline std::basic_ostream<CH,TR>& operator<<(std::basic_ostream<CH,TR> &os, const G& geometry)
+ {
+ os << geometry::make_wkt(geometry);
+ return os;
+ }
+
+
+//}
+
+#endif
+

Added: sandbox/ggl/boost/ggl/geometry/projections/epsg.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/epsg.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,3566 @@
+#ifndef _PROJECTIONS_EPGS_HPP
+#define _PROJECTIONS_EPGS_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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/projections/parameters.hpp>
+#include <geometry/projections/impl/pj_init.hpp>
+
+// This file is OPTIONAL
+// Only to be included if EPSG codes are necessary.
+// It is not included automatically
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ std::string code_to_string(int code)
+ {
+ switch(code)
+ {
+
+ case 2000 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m";
+ case 2001 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m";
+ case 2002 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=725,685,536,0,0,0,0 +units=m";
+ case 2003 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0 +units=m";
+ case 2004 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=174,359,365,0,0,0,0 +units=m";
+ case 2005 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m";
+ case 2006 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=-149,128,296,0,0,0,0 +units=m";
+ case 2007 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=195.671,332.517,274.607,0,0,0,0 +units=m";
+ case 2008 : return "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2009 : return "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2010 : return "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2011 : return "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2012 : return "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2013 : return "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2014 : return "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2015 : return "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2016 : return "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2017 : return "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2018 : return "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2019 : return "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2020 : return "+proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2021 : return "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2022 : return "+proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2023 : return "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2024 : return "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2025 : return "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2026 : return "+proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +units=m";
+ case 2027 : return "+proj=utm +zone=15 +ellps=clrk66 +units=m";
+ case 2028 : return "+proj=utm +zone=16 +ellps=clrk66 +units=m";
+ case 2029 : return "+proj=utm +zone=17 +ellps=clrk66 +units=m";
+ case 2030 : return "+proj=utm +zone=18 +ellps=clrk66 +units=m";
+ case 2031 : return "+proj=utm +zone=17 +ellps=clrk66 +units=m";
+ case 2032 : return "+proj=utm +zone=18 +ellps=clrk66 +units=m";
+ case 2033 : return "+proj=utm +zone=19 +ellps=clrk66 +units=m";
+ case 2034 : return "+proj=utm +zone=20 +ellps=clrk66 +units=m";
+ case 2035 : return "+proj=utm +zone=21 +ellps=clrk66 +units=m";
+ case 2036 : return "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2037 : return "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2038 : return "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2039 : return "+proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +towgs84=-48,55,52,0,0,0,0 +units=m";
+ case 2040 : return "+proj=utm +zone=30 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m";
+ case 2041 : return "+proj=utm +zone=30 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m";
+ case 2042 : return "+proj=utm +zone=29 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m";
+ case 2043 : return "+proj=utm +zone=29 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m";
+ case 2044 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m";
+ case 2045 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m";
+ case 2056 : return "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m";
+ case 2057 : return "+proj=omerc +lat_0=27.51882880555555 +lonc=52.60353916666667 +alpha=0.5716611944444444 +k=0.999895934 +x_0=658377.437 +y_0=3044969.194 +ellps=intl +towgs84=-133.63,-157.5,-158.62,0,0,0,0 +units=m";
+ case 2058 : return "+proj=utm +zone=38 +ellps=intl +units=m";
+ case 2059 : return "+proj=utm +zone=39 +ellps=intl +units=m";
+ case 2060 : return "+proj=utm +zone=40 +ellps=intl +units=m";
+ case 2061 : return "+proj=utm +zone=41 +ellps=intl +units=m";
+ case 2062 : return "+proj=lcc +lat_1=40 +lat_0=40 +lon_0=0 +k_0=0.9988085293 +x_0=600000 +y_0=600000 +a=6378298.3 +b=6356657.142669561 +pm=madrid +units=m";
+ case 2063 : return "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m";
+ case 2064 : return "+proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m";
+ case 2065 : return "+proj=krovak +lat_0=49.5 +lon_0=42.5 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 2066 : return "+proj=cass +lat_0=11.25217861111111 +lon_0=-60.68600888888889 +x_0=37718.66159325 +y_0=36209.91512952 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.201166195164";
+ case 2067 : return "+proj=utm +zone=20 +ellps=intl +units=m";
+ case 2068 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2069 : return "+proj=tmerc +lat_0=0 +lon_0=11 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2070 : return "+proj=tmerc +lat_0=0 +lon_0=13 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2071 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2072 : return "+proj=tmerc +lat_0=0 +lon_0=17 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2073 : return "+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2074 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2075 : return "+proj=tmerc +lat_0=0 +lon_0=23 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2076 : return "+proj=tmerc +lat_0=0 +lon_0=25 +k=0.9999 +x_0=200000 +y_0=0 +ellps=intl +units=m";
+ case 2077 : return "+proj=utm +zone=32 +ellps=intl +units=m";
+ case 2078 : return "+proj=utm +zone=33 +ellps=intl +units=m";
+ case 2079 : return "+proj=utm +zone=34 +ellps=intl +units=m";
+ case 2080 : return "+proj=utm +zone=35 +ellps=intl +units=m";
+ case 2081 : return "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +units=m";
+ case 2082 : return "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=27.5,14,186.4,0,0,0,0 +units=m";
+ case 2083 : return "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +units=m";
+ case 2084 : return "+proj=utm +zone=19 +south +ellps=intl +units=m";
+ case 2085 : return "+proj=lcc +lat_1=22.35 +lat_0=22.35 +lon_0=-81 +k_0=0.99993602 +x_0=500000 +y_0=280296.016 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 2086 : return "+proj=lcc +lat_1=20.71666666666667 +lat_0=20.71666666666667 +lon_0=-76.83333333333333 +k_0=0.99994848 +x_0=500000 +y_0=229126.939 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 2087 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2088 : return "+proj=tmerc +lat_0=0 +lon_0=11 +k=0.9996 +x_0=500000 +y_0=0 +a=6378249.2 +b=6356515 +units=m";
+ case 2089 : return "+proj=utm +zone=38 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2090 : return "+proj=utm +zone=39 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2091 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m";
+ case 2092 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m";
+ case 2093 : return "+proj=tmerc +lat_0=0 +lon_0=106 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +units=m";
+ case 2094 : return "+proj=tmerc +lat_0=0 +lon_0=106 +k=0.9996 +x_0=500000 +y_0=0 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 2095 : return "+proj=utm +zone=28 +ellps=intl +towgs84=-173,253,27,0,0,0,0 +units=m";
+ case 2096 : return "+proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m";
+ case 2097 : return "+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m";
+ case 2098 : return "+proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +units=m";
+ case 2099 : return "+proj=cass +lat_0=25.38236111111111 +lon_0=50.76138888888889 +x_0=100000 +y_0=100000 +ellps=helmert +units=m";
+ case 2100 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0 +units=m";
+ case 2101 : return "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=0 +y_0=-52684.972 +ellps=intl +units=m";
+ case 2102 : return "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=200000 +y_0=147315.028 +ellps=intl +units=m";
+ case 2103 : return "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=500000 +y_0=447315.028 +ellps=intl +units=m";
+ case 2104 : return "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666667 +lon_0=-71.60561777777777 +k_0=1 +x_0=-17044 +y_0=-23139.97 +ellps=intl +units=m";
+ case 2105 : return "+proj=tmerc +lat_0=-36.87972222222222 +lon_0=174.7641666666667 +k=0.9999 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2106 : return "+proj=tmerc +lat_0=-37.76111111111111 +lon_0=176.4661111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2107 : return "+proj=tmerc +lat_0=-38.62444444444444 +lon_0=177.8855555555556 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2108 : return "+proj=tmerc +lat_0=-39.65083333333333 +lon_0=176.6736111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2109 : return "+proj=tmerc +lat_0=-39.13555555555556 +lon_0=174.2277777777778 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2110 : return "+proj=tmerc +lat_0=-39.51222222222222 +lon_0=175.64 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2111 : return "+proj=tmerc +lat_0=-40.24194444444444 +lon_0=175.4880555555555 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2112 : return "+proj=tmerc +lat_0=-40.92527777777777 +lon_0=175.6472222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2113 : return "+proj=tmerc +lat_0=-41.3011111111111 +lon_0=174.7763888888889 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2114 : return "+proj=tmerc +lat_0=-40.71472222222223 +lon_0=172.6719444444444 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2115 : return "+proj=tmerc +lat_0=-41.27444444444444 +lon_0=173.2991666666667 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2116 : return "+proj=tmerc +lat_0=-41.28972222222222 +lon_0=172.1088888888889 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2117 : return "+proj=tmerc +lat_0=-41.81055555555555 +lon_0=171.5811111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2118 : return "+proj=tmerc +lat_0=-42.33361111111111 +lon_0=171.5497222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2119 : return "+proj=tmerc +lat_0=-42.68888888888888 +lon_0=173.01 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2120 : return "+proj=tmerc +lat_0=-41.54444444444444 +lon_0=173.8019444444444 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2121 : return "+proj=tmerc +lat_0=-42.88611111111111 +lon_0=170.9797222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2122 : return "+proj=tmerc +lat_0=-43.11 +lon_0=170.2608333333333 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2123 : return "+proj=tmerc +lat_0=-43.97777777777778 +lon_0=168.6061111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2124 : return "+proj=tmerc +lat_0=-43.59055555555556 +lon_0=172.7269444444445 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2125 : return "+proj=tmerc +lat_0=-43.74861111111111 +lon_0=171.3605555555555 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2126 : return "+proj=tmerc +lat_0=-44.40194444444445 +lon_0=171.0572222222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2127 : return "+proj=tmerc +lat_0=-44.735 +lon_0=169.4675 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2128 : return "+proj=tmerc +lat_0=-45.13277777777778 +lon_0=168.3986111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2129 : return "+proj=tmerc +lat_0=-45.56361111111111 +lon_0=167.7386111111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2130 : return "+proj=tmerc +lat_0=-45.81611111111111 +lon_0=170.6283333333333 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2131 : return "+proj=tmerc +lat_0=-45.86138888888889 +lon_0=170.2825 +k=0.99996 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2132 : return "+proj=tmerc +lat_0=-46.6 +lon_0=168.3427777777778 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2133 : return "+proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2134 : return "+proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2135 : return "+proj=utm +zone=60 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2136 : return "+proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.99975 +x_0=274319.7391633579 +y_0=0 +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +to_meter=0.3047997101815088";
+ case 2137 : return "+proj=tmerc +lat_0=0 +lon_0=-1 +k=0.9996 +x_0=500000 +y_0=0 +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0 +units=m";
+ case 2138 : return "+proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=clrk66 +units=m";
+ case 2139 : return "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2140 : return "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2141 : return "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2142 : return "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2143 : return "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2144 : return "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2145 : return "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2146 : return "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2147 : return "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2148 : return "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2149 : return "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2150 : return "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2151 : return "+proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2152 : return "+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2153 : return "+proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2154 : return "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2155 : return "+proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +to_meter=0.3048006096012192";
+ case 2156 : return "+proj=utm +zone=59 +south +ellps=GRS80 +units=m";
+ case 2157 : return "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=0.99982 +x_0=600000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2158 : return "+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2159 : return "+proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1 +x_0=152399.8550907544 +y_0=0 +a=6378300 +b=6356751.689189189 +to_meter=0.3047997101815088";
+ case 2160 : return "+proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1 +x_0=243839.7681452071 +y_0=182879.8261089053 +a=6378300 +b=6356751.689189189 +to_meter=0.3047997101815088";
+ case 2161 : return "+proj=utm +zone=28 +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +units=m";
+ case 2162 : return "+proj=utm +zone=29 +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +units=m";
+ case 2163 : return "+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m";
+ case 2164 : return "+proj=tmerc +lat_0=0 +lon_0=-5 +k=0.9996 +x_0=500000 +y_0=0 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m";
+ case 2165 : return "+proj=tmerc +lat_0=0 +lon_0=-5 +k=0.9996 +x_0=500000 +y_0=0 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +units=m";
+ case 2166 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m";
+ case 2167 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m";
+ case 2168 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m";
+ case 2169 : return "+proj=tmerc +lat_0=49.83333333333334 +lon_0=6.166666666666667 +k=1 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-193,13.7,-39.3,-0.41,-2.933,2.688,0.43 +units=m";
+ case 2170 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 2171 : return "+proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0.9998 +x_0=4637000 +y_0=5647000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 2172 : return "+proj=sterea +lat_0=53.00194444444445 +lon_0=21.50277777777778 +k=0.9998 +x_0=4603000 +y_0=5806000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 2173 : return "+proj=sterea +lat_0=53.58333333333334 +lon_0=17.00833333333333 +k=0.9998 +x_0=3501000 +y_0=5999000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 2174 : return "+proj=sterea +lat_0=51.67083333333333 +lon_0=16.67222222222222 +k=0.9998 +x_0=3703000 +y_0=5627000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 2175 : return "+proj=tmerc +lat_0=0 +lon_0=18.95833333333333 +k=0.999983 +x_0=237000 +y_0=-4700000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 2176 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.999923 +x_0=5500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2177 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.999923 +x_0=6500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2178 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.999923 +x_0=7500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2179 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.999923 +x_0=8500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2180 : return "+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +units=m";
+ case 2188 : return "+proj=utm +zone=25 +ellps=intl +units=m";
+ case 2189 : return "+proj=utm +zone=26 +ellps=intl +towgs84=-104,167,-38,0,0,0,0 +units=m";
+ case 2190 : return "+proj=utm +zone=26 +ellps=intl +towgs84=-203,141,53,0,0,0,0 +units=m";
+ case 2191 : return "+proj=utm +zone=28 +ellps=intl +units=m";
+ case 2192 : return "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.337229166666667 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=intl +units=m";
+ case 2193 : return "+proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2194 : return "+proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=-170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +to_meter=0.3048006096012192";
+ case 2195 : return "+proj=utm +zone=2 +south +ellps=GRS80 +units=m";
+ case 2196 : return "+proj=tmerc +lat_0=0 +lon_0=9.5 +k=0.99995 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2197 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.99995 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2198 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=900000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2199 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +units=m";
+ case 2200 : return "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=300000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m";
+ case 2201 : return "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2202 : return "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2203 : return "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2204 : return "+proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.66666666666666 +lon_0=-86 +x_0=609601.2192024384 +y_0=30480.06096012192 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 2205 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 2206 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=intl +units=m";
+ case 2207 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=intl +units=m";
+ case 2208 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=intl +units=m";
+ case 2209 : return "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=intl +units=m";
+ case 2210 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=intl +units=m";
+ case 2211 : return "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0 +ellps=intl +units=m";
+ case 2212 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0 +ellps=intl +units=m";
+ case 2213 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2214 : return "+proj=tmerc +lat_0=0 +lon_0=10.5 +k=0.999 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0,0,0 +units=m";
+ case 2215 : return "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-70.9,-151.8,-41.4,0,0,0,0 +units=m";
+ case 2216 : return "+proj=utm +zone=22 +ellps=intl +units=m";
+ case 2217 : return "+proj=utm +zone=23 +ellps=intl +units=m";
+ case 2219 : return "+proj=utm +zone=19 +a=6378135 +b=6356750.304921594 +units=m";
+ case 2220 : return "+proj=utm +zone=20 +a=6378135 +b=6356750.304921594 +units=m";
+ case 2222 : return "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2223 : return "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2224 : return "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2225 : return "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2226 : return "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2227 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2228 : return "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2229 : return "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2230 : return "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2231 : return "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2232 : return "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2233 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2234 : return "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2235 : return "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2236 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2237 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2238 : return "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2239 : return "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2240 : return "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2241 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2242 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2243 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2244 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249364.9987299975 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2245 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249364.9987299975 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2246 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2247 : return "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2248 : return "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2249 : return "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2250 : return "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2251 : return "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2252 : return "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2253 : return "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2254 : return "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2255 : return "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2256 : return "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2257 : return "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2258 : return "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2259 : return "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2260 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2261 : return "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2262 : return "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2263 : return "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2264 : return "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2265 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2266 : return "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2267 : return "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2268 : return "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2269 : return "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2270 : return "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2271 : return "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2272 : return "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2273 : return "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2274 : return "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2275 : return "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2276 : return "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2277 : return "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2278 : return "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2279 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2280 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2281 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2282 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2283 : return "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2284 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2285 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2286 : return "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2287 : return "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2288 : return "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2289 : return "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2290 : return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=700000 +y_0=400000 +a=6378135 +b=6356750.304921594 +units=m";
+ case 2291 : return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m";
+ case 2292 : return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2294 : return "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=4500000 +y_0=0 +a=6378135 +b=6356750.304921594 +units=m";
+ case 2295 : return "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=5500000 +y_0=0 +a=6378135 +b=6356750.304921594 +units=m";
+ case 2308 : return "+proj=tmerc +lat_0=0 +lon_0=109 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=bessel +units=m";
+ case 2309 : return "+proj=tmerc +lat_0=0 +lon_0=116 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 2310 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 2311 : return "+proj=tmerc +lat_0=0 +lon_0=6 +k=0.9996 +x_0=500000 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 2312 : return "+proj=utm +zone=33 +ellps=clrk80 +units=m";
+ case 2313 : return "+proj=utm +zone=33 +ellps=clrk80 +units=m";
+ case 2314 : return "+proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46392052001 +y_0=65379.0134283 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.3047972654";
+ case 2315 : return "+proj=utm +zone=19 +south +ellps=intl +units=m";
+ case 2316 : return "+proj=utm +zone=20 +south +ellps=intl +units=m";
+ case 2317 : return "+proj=lcc +lat_1=9 +lat_2=3 +lat_0=6 +lon_0=-66 +x_0=1000000 +y_0=1000000 +ellps=intl +units=m";
+ case 2318 : return "+proj=lcc +lat_1=17 +lat_2=33 +lat_0=25.08951 +lon_0=48 +x_0=0 +y_0=0 +ellps=intl +units=m";
+ case 2319 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2320 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2321 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2322 : return "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2323 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2324 : return "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2325 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 2326 : return "+proj=tmerc +lat_0=22.31213333333334 +lon_0=114.1785555555556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +units=m";
+ case 2327 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2328 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2329 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2330 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2331 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2332 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2333 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2334 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2335 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2336 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2337 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2338 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2339 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2340 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2341 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2342 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2343 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2344 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2345 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2346 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2347 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2348 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2349 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2350 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2351 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2352 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2353 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2354 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2355 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2356 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2357 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2358 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2359 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2360 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2361 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2362 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2363 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2364 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2365 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2366 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2367 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2368 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2369 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2370 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2371 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2372 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2373 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2374 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2375 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2376 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2377 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2378 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2379 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2380 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2381 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2382 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2383 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2384 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2385 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2386 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2387 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2388 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2389 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2390 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m";
+ case 2391 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,-1.37646,1.4964 +units=m";
+ case 2392 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,-1.37646,1.4964 +units=m";
+ case 2393 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=3500000 +y_0=0 +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,-1.37646,1.4964 +units=m";
+ case 2394 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=4500000 +y_0=0 +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,-1.37646,1.4964 +units=m";
+ case 2395 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m";
+ case 2396 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m";
+ case 2397 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m";
+ case 2398 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m";
+ case 2399 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1 +units=m";
+ case 2400 : return "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 2401 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +units=m";
+ case 2402 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +units=m";
+ case 2403 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +units=m";
+ case 2404 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +units=m";
+ case 2405 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +units=m";
+ case 2406 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +units=m";
+ case 2407 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +units=m";
+ case 2408 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +units=m";
+ case 2409 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +units=m";
+ case 2410 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +units=m";
+ case 2411 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +units=m";
+ case 2412 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +units=m";
+ case 2413 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +units=m";
+ case 2414 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +units=m";
+ case 2415 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +units=m";
+ case 2416 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +units=m";
+ case 2417 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +units=m";
+ case 2418 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +units=m";
+ case 2419 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +units=m";
+ case 2420 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +units=m";
+ case 2421 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +units=m";
+ case 2422 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2423 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2424 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2425 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2426 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2427 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2428 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2429 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2430 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2431 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2432 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2433 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2434 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2435 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2436 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2437 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2438 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2439 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2440 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2441 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2442 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2443 : return "+proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2444 : return "+proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2445 : return "+proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2446 : return "+proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2447 : return "+proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2448 : return "+proj=tmerc +lat_0=36 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2449 : return "+proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2450 : return "+proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2451 : return "+proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2452 : return "+proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2453 : return "+proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2454 : return "+proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2455 : return "+proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2456 : return "+proj=tmerc +lat_0=26 +lon_0=142 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2457 : return "+proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2458 : return "+proj=tmerc +lat_0=26 +lon_0=124 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2459 : return "+proj=tmerc +lat_0=26 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2460 : return "+proj=tmerc +lat_0=20 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2461 : return "+proj=tmerc +lat_0=26 +lon_0=154 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2462 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +units=m";
+ case 2463 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2464 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2465 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2466 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2467 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2468 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2469 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2470 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2471 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2472 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2473 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2474 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2475 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2476 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2477 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2478 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2479 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2480 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2481 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2482 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2483 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2484 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2485 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2486 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2487 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2488 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2489 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2490 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2491 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2492 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2493 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2494 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2495 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2496 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2497 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2498 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2499 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2500 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2501 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2502 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2503 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2504 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2505 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2506 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2507 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2508 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2509 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2510 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2511 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2512 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2513 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2514 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2515 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2516 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2517 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2518 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2519 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2520 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2521 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2522 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2523 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +units=m";
+ case 2524 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +units=m";
+ case 2525 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +units=m";
+ case 2526 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +units=m";
+ case 2527 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +units=m";
+ case 2528 : return "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +units=m";
+ case 2529 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +units=m";
+ case 2530 : return "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +units=m";
+ case 2531 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +units=m";
+ case 2532 : return "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +units=m";
+ case 2533 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +units=m";
+ case 2534 : return "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +units=m";
+ case 2535 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +units=m";
+ case 2536 : return "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +units=m";
+ case 2537 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +units=m";
+ case 2538 : return "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +units=m";
+ case 2539 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +units=m";
+ case 2540 : return "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +units=m";
+ case 2541 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +units=m";
+ case 2542 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +units=m";
+ case 2543 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +units=m";
+ case 2544 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +units=m";
+ case 2545 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +units=m";
+ case 2546 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +units=m";
+ case 2547 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +units=m";
+ case 2548 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +units=m";
+ case 2549 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +units=m";
+ case 2550 : return "+proj=utm +zone=50 +south +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0 +units=m";
+ case 2551 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +units=m";
+ case 2552 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +units=m";
+ case 2553 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +units=m";
+ case 2554 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +units=m";
+ case 2555 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +units=m";
+ case 2556 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +units=m";
+ case 2557 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +units=m";
+ case 2558 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +units=m";
+ case 2559 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +units=m";
+ case 2560 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +units=m";
+ case 2561 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +units=m";
+ case 2562 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +units=m";
+ case 2563 : return "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=46500000 +y_0=0 +ellps=krass +units=m";
+ case 2564 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=47500000 +y_0=0 +ellps=krass +units=m";
+ case 2565 : return "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=48500000 +y_0=0 +ellps=krass +units=m";
+ case 2566 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=49500000 +y_0=0 +ellps=krass +units=m";
+ case 2567 : return "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=50500000 +y_0=0 +ellps=krass +units=m";
+ case 2568 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=51500000 +y_0=0 +ellps=krass +units=m";
+ case 2569 : return "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=52500000 +y_0=0 +ellps=krass +units=m";
+ case 2570 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=53500000 +y_0=0 +ellps=krass +units=m";
+ case 2571 : return "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=54500000 +y_0=0 +ellps=krass +units=m";
+ case 2572 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=55500000 +y_0=0 +ellps=krass +units=m";
+ case 2573 : return "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=56500000 +y_0=0 +ellps=krass +units=m";
+ case 2574 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=57500000 +y_0=0 +ellps=krass +units=m";
+ case 2575 : return "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=58500000 +y_0=0 +ellps=krass +units=m";
+ case 2576 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=59500000 +y_0=0 +ellps=krass +units=m";
+ case 2577 : return "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60000000 +y_0=0 +ellps=krass +units=m";
+ case 2578 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=61500000 +y_0=0 +ellps=krass +units=m";
+ case 2579 : return "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=62500000 +y_0=0 +ellps=krass +units=m";
+ case 2580 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=63500000 +y_0=0 +ellps=krass +units=m";
+ case 2581 : return "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=64500000 +y_0=0 +ellps=krass +units=m";
+ case 2582 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2583 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2584 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2585 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2586 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2587 : return "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2588 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2589 : return "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2590 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2591 : return "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2592 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2593 : return "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2594 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2595 : return "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2596 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2597 : return "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2598 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2599 : return "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2600 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2601 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2602 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2603 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2604 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2605 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2606 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2607 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2608 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2609 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2610 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2611 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2612 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2613 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2614 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2615 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2616 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2617 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2618 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2619 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2620 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2621 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2622 : return "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2623 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2624 : return "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2625 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2626 : return "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2627 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2628 : return "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2629 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2630 : return "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2631 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2632 : return "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2633 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2634 : return "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2635 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2636 : return "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2637 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2638 : return "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2639 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2640 : return "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2641 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +units=m";
+ case 2642 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +units=m";
+ case 2643 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +units=m";
+ case 2644 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +units=m";
+ case 2645 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +units=m";
+ case 2646 : return "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +units=m";
+ case 2647 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +units=m";
+ case 2648 : return "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +units=m";
+ case 2649 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +units=m";
+ case 2650 : return "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +units=m";
+ case 2651 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +units=m";
+ case 2652 : return "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +units=m";
+ case 2653 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +units=m";
+ case 2654 : return "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +units=m";
+ case 2655 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +units=m";
+ case 2656 : return "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +units=m";
+ case 2657 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +units=m";
+ case 2658 : return "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +units=m";
+ case 2659 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +units=m";
+ case 2660 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +units=m";
+ case 2661 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +units=m";
+ case 2662 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +units=m";
+ case 2663 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +units=m";
+ case 2664 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +units=m";
+ case 2665 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +units=m";
+ case 2666 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +units=m";
+ case 2667 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=krass +units=m";
+ case 2668 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=krass +units=m";
+ case 2669 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=krass +units=m";
+ case 2670 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=krass +units=m";
+ case 2671 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=krass +units=m";
+ case 2672 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=krass +units=m";
+ case 2673 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=krass +units=m";
+ case 2674 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=krass +units=m";
+ case 2675 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=krass +units=m";
+ case 2676 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=krass +units=m";
+ case 2677 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=krass +units=m";
+ case 2678 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=krass +units=m";
+ case 2679 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=krass +units=m";
+ case 2680 : return "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=46500000 +y_0=0 +ellps=krass +units=m";
+ case 2681 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=47500000 +y_0=0 +ellps=krass +units=m";
+ case 2682 : return "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=48500000 +y_0=0 +ellps=krass +units=m";
+ case 2683 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=49500000 +y_0=0 +ellps=krass +units=m";
+ case 2684 : return "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=50500000 +y_0=0 +ellps=krass +units=m";
+ case 2685 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=51500000 +y_0=0 +ellps=krass +units=m";
+ case 2686 : return "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=52500000 +y_0=0 +ellps=krass +units=m";
+ case 2687 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=53500000 +y_0=0 +ellps=krass +units=m";
+ case 2688 : return "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=54500000 +y_0=0 +ellps=krass +units=m";
+ case 2689 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=55500000 +y_0=0 +ellps=krass +units=m";
+ case 2690 : return "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=56500000 +y_0=0 +ellps=krass +units=m";
+ case 2691 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=57500000 +y_0=0 +ellps=krass +units=m";
+ case 2692 : return "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=58500000 +y_0=0 +ellps=krass +units=m";
+ case 2693 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=59500000 +y_0=0 +ellps=krass +units=m";
+ case 2694 : return "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60000000 +y_0=0 +ellps=krass +units=m";
+ case 2695 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=61500000 +y_0=0 +ellps=krass +units=m";
+ case 2696 : return "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=62500000 +y_0=0 +ellps=krass +units=m";
+ case 2697 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=63500000 +y_0=0 +ellps=krass +units=m";
+ case 2698 : return "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=64500000 +y_0=0 +ellps=krass +units=m";
+ case 2699 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2700 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2701 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2702 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2703 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2704 : return "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2705 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2706 : return "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2707 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2708 : return "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2709 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2710 : return "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2711 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2712 : return "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2713 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2714 : return "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2715 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2716 : return "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2717 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2718 : return "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2719 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2720 : return "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2721 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2722 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2723 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2724 : return "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2725 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2726 : return "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2727 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2728 : return "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2729 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2730 : return "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2731 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2732 : return "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2733 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2734 : return "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2735 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2736 : return "+proj=utm +zone=36 +south +ellps=clrk66 +units=m";
+ case 2737 : return "+proj=utm +zone=37 +south +ellps=clrk66 +units=m";
+ case 2738 : return "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2739 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2740 : return "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2741 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2742 : return "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2743 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2744 : return "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2745 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2746 : return "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2747 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2748 : return "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2749 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2750 : return "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2751 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2752 : return "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2753 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2754 : return "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2755 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2756 : return "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2757 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2758 : return "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 2759 : return "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2760 : return "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2761 : return "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m";
+ case 2762 : return "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m";
+ case 2763 : return "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m";
+ case 2764 : return "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2765 : return "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m";
+ case 2766 : return "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 2767 : return "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 2768 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 2769 : return "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 2770 : return "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 2771 : return "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 2772 : return "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m";
+ case 2773 : return "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m";
+ case 2774 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m";
+ case 2775 : return "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +units=m";
+ case 2776 : return "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2777 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2778 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2779 : return "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2780 : return "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2781 : return "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2782 : return "+proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2783 : return "+proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2784 : return "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2785 : return "+proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2786 : return "+proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2787 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2788 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2789 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2790 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2791 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2792 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +units=m";
+ case 2793 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +units=m";
+ case 2794 : return "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +units=m";
+ case 2795 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2796 : return "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2797 : return "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m";
+ case 2798 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2799 : return "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 2800 : return "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2801 : return "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2802 : return "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2803 : return "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2804 : return "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2805 : return "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +units=m";
+ case 2806 : return "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2807 : return "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2808 : return "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2809 : return "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2810 : return "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m";
+ case 2811 : return "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m";
+ case 2812 : return "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m";
+ case 2813 : return "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2814 : return "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2815 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2816 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2817 : return "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=850000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2818 : return "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2819 : return "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2820 : return "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +units=m";
+ case 2821 : return "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +units=m";
+ case 2822 : return "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +units=m";
+ case 2823 : return "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2824 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2825 : return "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2826 : return "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2827 : return "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2828 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2829 : return "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2830 : return "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2831 : return "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2832 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2833 : return "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2834 : return "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2835 : return "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2836 : return "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2837 : return "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2838 : return "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2839 : return "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2840 : return "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=100000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2841 : return "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2842 : return "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2843 : return "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2844 : return "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +units=m";
+ case 2845 : return "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +units=m";
+ case 2846 : return "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +units=m";
+ case 2847 : return "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +units=m";
+ case 2848 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +units=m";
+ case 2849 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +units=m";
+ case 2850 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +units=m";
+ case 2851 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +units=m";
+ case 2852 : return "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2853 : return "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +units=m";
+ case 2854 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +units=m";
+ case 2855 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2856 : return "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2857 : return "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2858 : return "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2859 : return "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2860 : return "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2861 : return "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2862 : return "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2863 : return "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +units=m";
+ case 2864 : return "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2865 : return "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m";
+ case 2866 : return "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +units=m";
+ case 2867 : return "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2868 : return "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2869 : return "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2870 : return "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2871 : return "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2872 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2873 : return "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2874 : return "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2875 : return "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2876 : return "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2877 : return "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2878 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2879 : return "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2880 : return "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2881 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2882 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2883 : return "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2884 : return "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2885 : return "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2886 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2887 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2888 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2889 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249364.9987299975 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2890 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249364.9987299975 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2891 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2892 : return "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2893 : return "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2894 : return "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2895 : return "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2896 : return "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2897 : return "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2898 : return "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2899 : return "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2900 : return "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2901 : return "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2902 : return "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2903 : return "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2904 : return "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2905 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2906 : return "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2907 : return "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2908 : return "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2909 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2910 : return "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2911 : return "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2912 : return "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2913 : return "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2914 : return "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2915 : return "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2916 : return "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2917 : return "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2918 : return "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2919 : return "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2920 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2921 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +ellps=GRS80 +to_meter=0.3048";
+ case 2922 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +ellps=GRS80 +to_meter=0.3048";
+ case 2923 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +ellps=GRS80 +to_meter=0.3048";
+ case 2924 : return "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2925 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2926 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2927 : return "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2928 : return "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2929 : return "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2930 : return "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2931 : return "+proj=tmerc +lat_0=0 +lon_0=13 +k=0.9996 +x_0=500000 +y_0=0 +a=6378249.2 +b=6356515 +towgs84=-106,-87,188,0,0,0,0 +units=m";
+ case 2932 : return "+proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.99999 +x_0=200000 +y_0=300000 +ellps=intl +towgs84=-119.425,-303.659,-11.0006,1.1643,0.174458,1.09626,3.65706 +units=m";
+ case 2933 : return "+proj=utm +zone=50 +south +ellps=bessel +units=m";
+ case 2934 : return "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +pm=jakarta +units=m";
+ case 2935 : return "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=41.53333333333333 +k=1 +x_0=1300000 +y_0=0 +ellps=krass +units=m";
+ case 2936 : return "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=44.53333333333333 +k=1 +x_0=2300000 +y_0=0 +ellps=krass +units=m";
+ case 2937 : return "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=47.53333333333333 +k=1 +x_0=3300000 +y_0=0 +ellps=krass +units=m";
+ case 2938 : return "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=50.53333333333333 +k=1 +x_0=4300000 +y_0=0 +ellps=krass +units=m";
+ case 2939 : return "+proj=tmerc +lat_0=0.1333333333333333 +lon_0=50.76666666666667 +k=1 +x_0=2300000 +y_0=0 +ellps=krass +units=m";
+ case 2940 : return "+proj=tmerc +lat_0=0.1333333333333333 +lon_0=53.76666666666667 +k=1 +x_0=3300000 +y_0=0 +ellps=krass +units=m";
+ case 2941 : return "+proj=tmerc +lat_0=0.1333333333333333 +lon_0=56.76666666666667 +k=1 +x_0=4300000 +y_0=0 +ellps=krass +units=m";
+ case 2942 : return "+proj=utm +zone=28 +ellps=intl +towgs84=-499,-249,314,0,0,0,0 +units=m";
+ case 2943 : return "+proj=utm +zone=28 +ellps=intl +units=m";
+ case 2944 : return "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2945 : return "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2946 : return "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2947 : return "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2948 : return "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2949 : return "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2950 : return "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2951 : return "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2952 : return "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m";
+ case 2953 : return "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +units=m";
+ case 2954 : return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +units=m";
+ case 2955 : return "+proj=utm +zone=11 +ellps=GRS80 +units=m";
+ case 2956 : return "+proj=utm +zone=12 +ellps=GRS80 +units=m";
+ case 2957 : return "+proj=utm +zone=13 +ellps=GRS80 +units=m";
+ case 2958 : return "+proj=utm +zone=17 +ellps=GRS80 +units=m";
+ case 2959 : return "+proj=utm +zone=18 +ellps=GRS80 +units=m";
+ case 2960 : return "+proj=utm +zone=19 +ellps=GRS80 +units=m";
+ case 2961 : return "+proj=utm +zone=20 +ellps=GRS80 +units=m";
+ case 2962 : return "+proj=utm +zone=21 +ellps=GRS80 +units=m";
+ case 2964 : return "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 2965 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2966 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 2967 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2968 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 2969 : return "+proj=utm +zone=20 +ellps=intl +towgs84=137,248,-430,0,0,0,0 +units=m";
+ case 2970 : return "+proj=utm +zone=20 +ellps=intl +units=m";
+ case 2971 : return "+proj=utm +zone=22 +ellps=intl +towgs84=-186,230,110,0,0,0,0 +units=m";
+ case 2972 : return "+proj=utm +zone=22 +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 +units=m";
+ case 2973 : return "+proj=utm +zone=20 +ellps=intl +units=m";
+ case 2975 : return "+proj=utm +zone=40 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2976 : return "+proj=utm +zone=6 +south +ellps=intl +towgs84=162,117,154,0,0,0,0 +units=m";
+ case 2977 : return "+proj=utm +zone=5 +south +ellps=intl +units=m";
+ case 2978 : return "+proj=utm +zone=7 +south +ellps=intl +units=m";
+ case 2979 : return "+proj=utm +zone=42 +south +ellps=intl +towgs84=145,-187,103,0,0,0,0 +units=m";
+ case 2980 : return "+proj=utm +zone=38 +south +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +units=m";
+ case 2981 : return "+proj=utm +zone=58 +south +ellps=intl +units=m";
+ case 2982 : return "+proj=utm +zone=58 +south +ellps=intl +units=m";
+ case 2983 : return "+proj=utm +zone=58 +south +ellps=intl +towgs84=-122.383,-188.696,103.344,3.5107,-4.9668,-5.7047,4.4798 +units=m";
+ case 2984 : return "+proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=intl +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2987 : return "+proj=utm +zone=21 +ellps=clrk66 +towgs84=30,430,368,0,0,0,0 +units=m";
+ case 2988 : return "+proj=utm +zone=1 +south +ellps=intl +units=m";
+ case 2989 : return "+proj=utm +zone=20 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 2990 : return "+proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333333333 +k=1 +x_0=50000 +y_0=160000 +ellps=intl +units=m";
+ case 2991 : return "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 2992 : return "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048";
+ case 2993 : return "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m";
+ case 2994 : return "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 2995 : return "+proj=utm +zone=58 +south +ellps=intl +units=m";
+ case 2996 : return "+proj=utm +zone=58 +south +ellps=intl +units=m";
+ case 2997 : return "+proj=utm +zone=58 +south +ellps=intl +towgs84=-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7 +units=m";
+ case 2998 : return "+proj=utm +zone=58 +south +ellps=intl +units=m";
+ case 2999 : return "+proj=utm +zone=38 +south +ellps=intl +units=m";
+ case 3000 : return "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m";
+ case 3001 : return "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m";
+ case 3002 : return "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +units=m";
+ case 3003 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +units=m";
+ case 3004 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +units=m";
+ case 3005 : return "+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3006 : return "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3007 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3008 : return "+proj=tmerc +lat_0=0 +lon_0=13.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3009 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3010 : return "+proj=tmerc +lat_0=0 +lon_0=16.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3011 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3012 : return "+proj=tmerc +lat_0=0 +lon_0=14.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3013 : return "+proj=tmerc +lat_0=0 +lon_0=15.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3014 : return "+proj=tmerc +lat_0=0 +lon_0=17.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3015 : return "+proj=tmerc +lat_0=0 +lon_0=18.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3016 : return "+proj=tmerc +lat_0=0 +lon_0=20.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3017 : return "+proj=tmerc +lat_0=0 +lon_0=21.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3018 : return "+proj=tmerc +lat_0=0 +lon_0=23.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3019 : return "+proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3020 : return "+proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3021 : return "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3022 : return "+proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3023 : return "+proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3024 : return "+proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3025 : return "+proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3026 : return "+proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3027 : return "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3028 : return "+proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3029 : return "+proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3030 : return "+proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 3031 : return "+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3032 : return "+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=70 +k=1 +x_0=6000000 +y_0=6000000 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3033 : return "+proj=lcc +lat_1=-68.5 +lat_2=-74.5 +lat_0=-50 +lon_0=70 +x_0=6000000 +y_0=6000000 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3034 : return "+proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4000000 +y_0=2800000 +ellps=GRS80 +units=m";
+ case 3035 : return "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m";
+ case 3036 : return "+proj=utm +zone=36 +south +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m";
+ case 3037 : return "+proj=utm +zone=37 +south +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +units=m";
+ case 3038 : return "+proj=utm +zone=26 +ellps=GRS80 +units=m";
+ case 3039 : return "+proj=utm +zone=27 +ellps=GRS80 +units=m";
+ case 3040 : return "+proj=utm +zone=28 +ellps=GRS80 +units=m";
+ case 3041 : return "+proj=utm +zone=29 +ellps=GRS80 +units=m";
+ case 3042 : return "+proj=utm +zone=30 +ellps=GRS80 +units=m";
+ case 3043 : return "+proj=utm +zone=31 +ellps=GRS80 +units=m";
+ case 3044 : return "+proj=utm +zone=32 +ellps=GRS80 +units=m";
+ case 3045 : return "+proj=utm +zone=33 +ellps=GRS80 +units=m";
+ case 3046 : return "+proj=utm +zone=34 +ellps=GRS80 +units=m";
+ case 3047 : return "+proj=utm +zone=35 +ellps=GRS80 +units=m";
+ case 3048 : return "+proj=utm +zone=36 +ellps=GRS80 +units=m";
+ case 3049 : return "+proj=utm +zone=37 +ellps=GRS80 +units=m";
+ case 3050 : return "+proj=utm +zone=38 +ellps=GRS80 +units=m";
+ case 3051 : return "+proj=utm +zone=39 +ellps=GRS80 +units=m";
+ case 3054 : return "+proj=utm +zone=26 +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +units=m";
+ case 3055 : return "+proj=utm +zone=27 +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +units=m";
+ case 3056 : return "+proj=utm +zone=28 +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +units=m";
+ case 3057 : return "+proj=lcc +lat_1=64.25 +lat_2=65.75 +lat_0=65 +lon_0=-19 +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3058 : return "+proj=tmerc +lat_0=0 +lon_0=-8.5 +k=1 +x_0=50000 +y_0=-7800000 +ellps=intl +towgs84=982.609,552.753,-540.873,32.3934,-153.257,-96.2266,16.805 +units=m";
+ case 3059 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3060 : return "+proj=utm +zone=58 +south +ellps=intl +units=m";
+ case 3061 : return "+proj=utm +zone=28 +ellps=intl +units=m";
+ case 3062 : return "+proj=utm +zone=26 +ellps=intl +units=m";
+ case 3063 : return "+proj=utm +zone=26 +ellps=intl +units=m";
+ case 3064 : return "+proj=utm +zone=32 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3065 : return "+proj=utm +zone=33 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3066 : return "+proj=tmerc +lat_0=0 +lon_0=37 +k=0.9998 +x_0=500000 +y_0=-3000000 +ellps=intl +units=m";
+ case 3067 : return "+proj=utm +zone=35 +ellps=GRS80 +units=m";
+ case 3068 : return "+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +datum=potsdam +units=m";
+ case 3069 : return "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=500000 +y_0=-4500000 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 3070 : return "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y_0=-4480000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3071 : return "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y_0=-4480000 +ellps=GRS80 +units=m";
+ case 3072 : return "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0.99998 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3073 : return "+proj=tmerc +lat_0=43 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3074 : return "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0.99998 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3075 : return "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0.99998 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3076 : return "+proj=tmerc +lat_0=43 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3077 : return "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0.99998 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3078 : return "+proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3079 : return "+proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +ellps=GRS80 +units=m";
+ case 3080 : return "+proj=lcc +lat_1=27.41666666666667 +lat_2=34.91666666666666 +lat_0=31.16666666666667 +lon_0=-100 +x_0=914400 +y_0=914400 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048";
+ case 3081 : return "+proj=lcc +lat_1=27.41666666666667 +lat_2=34.91666666666666 +lat_0=31.16666666666667 +lon_0=-100 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3082 : return "+proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3083 : return "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3084 : return "+proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +units=m";
+ case 3085 : return "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +units=m";
+ case 3086 : return "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3087 : return "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3088 : return "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3089 : return "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=999999.9998983998 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3090 : return "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +units=m";
+ case 3091 : return "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=999999.9998983998 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3092 : return "+proj=utm +zone=51 +ellps=bessel +units=m";
+ case 3093 : return "+proj=utm +zone=52 +ellps=bessel +units=m";
+ case 3094 : return "+proj=utm +zone=53 +ellps=bessel +units=m";
+ case 3095 : return "+proj=utm +zone=54 +ellps=bessel +units=m";
+ case 3096 : return "+proj=utm +zone=55 +ellps=bessel +units=m";
+ case 3097 : return "+proj=utm +zone=51 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3098 : return "+proj=utm +zone=52 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3099 : return "+proj=utm +zone=53 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3100 : return "+proj=utm +zone=54 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3101 : return "+proj=utm +zone=55 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3102 : return "+proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.26666666666667 +lon_0=-170 +k_0=1 +x_0=152400.3048006096 +y_0=95169.31165862332 +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3103 : return "+proj=utm +zone=28 +ellps=clrk80 +units=m";
+ case 3104 : return "+proj=utm +zone=29 +ellps=clrk80 +units=m";
+ case 3105 : return "+proj=utm +zone=30 +ellps=clrk80 +units=m";
+ case 3106 : return "+proj=tmerc +lat_0=0 +lon_0=90 +k=0.9996 +x_0=500000 +y_0=0 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 3107 : return "+proj=lcc +lat_1=-28 +lat_2=-36 +lat_0=-32 +lon_0=135 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3108 : return "+proj=tmerc +lat_0=49.5 +lon_0=-2.416666666666667 +k=0.999997 +x_0=47000 +y_0=50000 +ellps=GRS80 +units=m";
+ case 3109 : return "+proj=tmerc +lat_0=49.225 +lon_0=-2.135 +k=0.9999999000000001 +x_0=40000 +y_0=70000 +ellps=GRS80 +units=m";
+ case 3110 : return "+proj=lcc +lat_1=-36 +lat_2=-38 +lat_0=-37 +lon_0=145 +x_0=2500000 +y_0=4500000 +ellps=aust_SA +units=m";
+ case 3111 : return "+proj=lcc +lat_1=-36 +lat_2=-38 +lat_0=-37 +lon_0=145 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3112 : return "+proj=lcc +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=134 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3113 : return "+proj=tmerc +lat_0=-28 +lon_0=153 +k=0.99999 +x_0=50000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3114 : return "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-80.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3115 : return "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-77.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3116 : return "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-74.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3117 : return "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-71.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3118 : return "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-68.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3119 : return "+proj=tmerc +lat_0=0 +lon_0=10.5 +k=0.999 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0,0,0 +units=m";
+ case 3120 : return "+proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0.9998 +x_0=4637000 +y_0=5467000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3121 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m";
+ case 3122 : return "+proj=tmerc +lat_0=0 +lon_0=119 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m";
+ case 3123 : return "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m";
+ case 3124 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m";
+ case 3125 : return "+proj=tmerc +lat_0=0 +lon_0=125 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06 +units=m";
+ case 3126 : return "+proj=tmerc +lat_0=0 +lon_0=19 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3127 : return "+proj=tmerc +lat_0=0 +lon_0=20 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3128 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3129 : return "+proj=tmerc +lat_0=0 +lon_0=22 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3130 : return "+proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3131 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3132 : return "+proj=tmerc +lat_0=0 +lon_0=25 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3133 : return "+proj=tmerc +lat_0=0 +lon_0=26 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3134 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3135 : return "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3136 : return "+proj=tmerc +lat_0=0 +lon_0=29 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3137 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3138 : return "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3140 : return "+proj=cass +lat_0=-18 +lon_0=178 +x_0=109435.392 +y_0=141622.272 +a=6378306.3696 +b=6356571.996 +towgs84=51,391,-36,0,0,0,0 +to_meter=0.201168";
+ case 3141 : return "+proj=utm +zone=60 +south +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0 +units=m";
+ case 3142 : return "+proj=utm +zone=1 +south +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0 +units=m";
+ case 3143 : return "+proj=tmerc +lat_0=-17 +lon_0=178.75 +k=0.99985 +x_0=2000000 +y_0=4000000 +ellps=WGS72 +units=m";
+ case 3146 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +units=m";
+ case 3147 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 3148 : return "+proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 3149 : return "+proj=utm +zone=49 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 3150 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +units=m";
+ case 3151 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 3152 : return "+proj=tmerc +lat_0=0 +lon_0=18.05779 +k=0.99999425 +x_0=100178.1808 +y_0=-6500614.7836 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3153 : return "+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3154 : return "+proj=utm +zone=7 +ellps=GRS80 +units=m";
+ case 3155 : return "+proj=utm +zone=8 +ellps=GRS80 +units=m";
+ case 3156 : return "+proj=utm +zone=9 +ellps=GRS80 +units=m";
+ case 3157 : return "+proj=utm +zone=10 +ellps=GRS80 +units=m";
+ case 3158 : return "+proj=utm +zone=14 +ellps=GRS80 +units=m";
+ case 3159 : return "+proj=utm +zone=15 +ellps=GRS80 +units=m";
+ case 3160 : return "+proj=utm +zone=16 +ellps=GRS80 +units=m";
+ case 3161 : return "+proj=lcc +lat_1=44.5 +lat_2=53.5 +lat_0=0 +lon_0=-85 +x_0=930000 +y_0=6430000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3162 : return "+proj=lcc +lat_1=44.5 +lat_2=53.5 +lat_0=0 +lon_0=-85 +x_0=930000 +y_0=6430000 +ellps=GRS80 +units=m";
+ case 3163 : return "+proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.33333333333333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3164 : return "+proj=utm +zone=58 +south +ellps=WGS84 +towgs84=-56.263,16.136,-22.856,0,0,0,0 +units=m";
+ case 3165 : return "+proj=lcc +lat_1=-22.24469175 +lat_2=-22.29469175 +lat_0=-22.26969175 +lon_0=166.44242575 +x_0=0.66 +y_0=1.02 +ellps=intl +units=m";
+ case 3166 : return "+proj=lcc +lat_1=-22.24472222222222 +lat_2=-22.29472222222222 +lat_0=-22.26972222222222 +lon_0=166.4425 +x_0=8.313000000000001 +y_0=-2.354 +ellps=intl +units=m";
+ case 3167 : return "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=40000 +y_0=0 +a=6377295.664 +b=6356094.667915204 +to_meter=20.116756";
+ case 3168 : return "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=804670.24 +y_0=0 +a=6377295.664 +b=6356094.667915204 +units=m";
+ case 3169 : return "+proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3170 : return "+proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3171 : return "+proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3172 : return "+proj=utm +zone=59 +south +ellps=intl +units=m";
+ case 3174 : return "+proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568977 +lon_0=-84.455955 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3175 : return "+proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568977 +lon_0=-83.248627 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3176 : return "+proj=tmerc +lat_0=0 +lon_0=106 +k=0.9996 +x_0=500000 +y_0=0 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 3177 : return "+proj=tmerc +lat_0=0 +lon_0=17 +k=0.9965000000000001 +x_0=1000000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3178 : return "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3179 : return "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3180 : return "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3181 : return "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3182 : return "+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3183 : return "+proj=utm +zone=23 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3184 : return "+proj=utm +zone=24 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3185 : return "+proj=utm +zone=25 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3186 : return "+proj=utm +zone=26 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3187 : return "+proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3188 : return "+proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3189 : return "+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3190 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3191 : return "+proj=tmerc +lat_0=0 +lon_0=11 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3192 : return "+proj=tmerc +lat_0=0 +lon_0=13 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3193 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3194 : return "+proj=tmerc +lat_0=0 +lon_0=17 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3195 : return "+proj=tmerc +lat_0=0 +lon_0=19 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3196 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3197 : return "+proj=tmerc +lat_0=0 +lon_0=23 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3198 : return "+proj=tmerc +lat_0=0 +lon_0=25 +k=0.99995 +x_0=200000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3199 : return "+proj=utm +zone=32 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3200 : return "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +units=m";
+ case 3201 : return "+proj=utm +zone=33 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3202 : return "+proj=utm +zone=34 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3203 : return "+proj=utm +zone=35 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0 +units=m";
+ case 3204 : return "+proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.33333333333334 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3205 : return "+proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.33333333333334 +lat_0=-90 +lon_0=-54 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3206 : return "+proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.33333333333334 +lat_0=-90 +lon_0=-42 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3207 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=-174 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3208 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3209 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=-54 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3210 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=42 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3211 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=54 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3212 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=66 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3213 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=78 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3214 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=90 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3215 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=102 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3216 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=114 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3217 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=126 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3218 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=138 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3219 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=150 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3220 : return "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.33333333333333 +lat_0=-90 +lon_0=162 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3221 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-102 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3222 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-90 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3223 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-78 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3224 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3225 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-18 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3226 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=-6 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3227 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=6 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3228 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=18 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3229 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=30 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3230 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=42 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3231 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=54 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3232 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=66 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3233 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=78 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3234 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=90 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3235 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=102 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3236 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=114 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3237 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=126 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3238 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=138 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3239 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=150 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3240 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=162 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3241 : return "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.33333333333333 +lat_0=-90 +lon_0=174 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3242 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-153 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3243 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-135 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3244 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-117 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3245 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-99 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3246 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-81 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3247 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-63 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3248 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-27 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3249 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=-9 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3250 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=9 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3251 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=27 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3252 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=45 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3253 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=63 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3254 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=81 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3255 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=99 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3256 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=117 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3257 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=135 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3258 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=153 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3259 : return "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.33333333333333 +lat_0=-90 +lon_0=171 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3260 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-168 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3261 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-144 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3262 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-120 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3263 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-96 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3264 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-72 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3265 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-48 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3266 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=-24 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3267 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3268 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=24 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3269 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=48 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3270 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=72 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3271 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=96 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3272 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=120 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3273 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=144 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3274 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-90 +lon_0=168 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3275 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-165 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3276 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-135 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3277 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-105 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3278 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-75 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3279 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3280 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-15 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3281 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=15 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3282 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3283 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=75 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3284 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=105 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3285 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=135 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3286 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=165 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3287 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-150 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3288 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-90 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3289 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=-30 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3290 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=30 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3291 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=90 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3292 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=150 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3293 : return "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3294 : return "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.33333333333333 +lat_0=-78 +lon_0=162 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3296 : return "+proj=utm +zone=5 +south +ellps=GRS80 +units=m";
+ case 3297 : return "+proj=utm +zone=6 +south +ellps=GRS80 +units=m";
+ case 3298 : return "+proj=utm +zone=7 +south +ellps=GRS80 +units=m";
+ case 3299 : return "+proj=utm +zone=8 +south +ellps=GRS80 +units=m";
+ case 3300 : return "+proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.014 +units=m";
+ case 3301 : return "+proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3302 : return "+proj=utm +zone=7 +south +ellps=intl +units=m";
+ case 3303 : return "+proj=utm +zone=7 +south +ellps=intl +towgs84=347.103,1078.12,2623.92,-33.8875,70.6773,-9.3943,186.074 +units=m";
+ case 3304 : return "+proj=utm +zone=6 +south +ellps=intl +units=m";
+ case 3305 : return "+proj=utm +zone=6 +south +ellps=intl +towgs84=215.525,149.593,176.229,-3.2624,-1.692,-1.1571,10.4773 +units=m";
+ case 3306 : return "+proj=utm +zone=5 +south +ellps=intl +towgs84=217.037,86.959,23.956,0,0,0,0 +units=m";
+ case 3307 : return "+proj=utm +zone=39 +ellps=WGS84 +towgs84=0,-0.15,0.68,0,0,0,0 +units=m";
+ case 3308 : return "+proj=lcc +lat_1=-30.75 +lat_2=-35.75 +lat_0=-33.25 +lon_0=147 +x_0=9300000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3309 : return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 3310 : return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3311 : return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +units=m";
+ case 3312 : return "+proj=utm +zone=21 +ellps=intl +towgs84=-186,230,110,0,0,0,0 +units=m";
+ case 3313 : return "+proj=utm +zone=21 +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 +units=m";
+ case 3314 : return "+proj=lcc +lat_1=-6.5 +lat_2=-11.5 +lat_0=0 +lon_0=26 +x_0=0 +y_0=0 +ellps=clrk66 +units=m";
+ case 3315 : return "+proj=tmerc +lat_0=-9 +lon_0=26 +k=0.9998 +x_0=0 +y_0=0 +ellps=clrk66 +units=m";
+ case 3316 : return "+proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3317 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3318 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3319 : return "+proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3320 : return "+proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3321 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3322 : return "+proj=tmerc +lat_0=0 +lon_0=20 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3323 : return "+proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3324 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3325 : return "+proj=tmerc +lat_0=0 +lon_0=26 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3326 : return "+proj=tmerc +lat_0=0 +lon_0=28 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3327 : return "+proj=tmerc +lat_0=0 +lon_0=30 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 3328 : return "+proj=sterea +lat_0=52.16666666666666 +lon_0=19.16666666666667 +k=0.999714 +x_0=500000 +y_0=500000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3329 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3330 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3331 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3332 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3333 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3334 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3335 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ case 3336 : return "+proj=utm +zone=42 +south +ellps=intl +towgs84=145,-187,103,0,0,0,0 +units=m";
+ case 3337 : return "+proj=lcc +lat_1=-20.19506944444445 +lat_0=-20.19506944444445 +lon_0=57.52182777777778 +k_0=1 +x_0=1000000 +y_0=1000000 +ellps=clrk80 +towgs84=-770.1,158.4,-498.2,0,0,0,0 +units=m";
+ case 3338 : return "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3339 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m";
+ case 3340 : return "+proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m";
+ case 3341 : return "+proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m";
+ case 3342 : return "+proj=utm +zone=33 +south +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0 +units=m";
+ case 3343 : return "+proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3344 : return "+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3345 : return "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3346 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3347 : return "+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3348 : return "+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +units=m";
+ case 3349 : return "+proj=merc +lon_0=-150 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3350 : return "+proj=tmerc +lat_0=0.1 +lon_0=21.95 +k=1 +x_0=250000 +y_0=0 +ellps=krass +units=m";
+ case 3351 : return "+proj=tmerc +lat_0=0.1 +lon_0=24.95 +k=1 +x_0=1250000 +y_0=0 +ellps=krass +units=m";
+ case 3352 : return "+proj=tmerc +lat_0=0.1 +lon_0=27.95 +k=1 +x_0=2250000 +y_0=0 +ellps=krass +units=m";
+ case 3353 : return "+proj=utm +zone=32 +south +ellps=intl +units=m";
+ case 3354 : return "+proj=utm +zone=32 +south +ellps=intl +units=m";
+ case 3355 : return "+proj=tmerc +lat_0=30 +lon_0=31 +k=1 +x_0=615000 +y_0=810000 +ellps=helmert +towgs84=-146.21,112.63,4.05,0,0,0,0 +units=m";
+ case 3356 : return "+proj=utm +zone=17 +ellps=clrk66 +towgs84=67.8,106.1,138.8,0,0,0,0 +units=m";
+ case 3357 : return "+proj=utm +zone=17 +ellps=clrk66 +units=m";
+ case 3358 : return "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m";
+ case 3359 : return "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024385 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 3360 : return "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +units=m";
+ case 3361 : return "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +to_meter=0.3048";
+ case 3362 : return "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3363 : return "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3364 : return "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3365 : return "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3366 : return "+proj=cass +lat_0=22.31213333333334 +lon_0=114.1785555555556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=6378293.645208759 +b=6356617.987679838 +units=m";
+ case 3367 : return "+proj=utm +zone=28 +ellps=clrk80 +units=m";
+ case 3368 : return "+proj=utm +zone=29 +ellps=clrk80 +units=m";
+ case 3369 : return "+proj=utm +zone=30 +ellps=clrk80 +units=m";
+ case 3370 : return "+proj=utm +zone=59 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 3371 : return "+proj=utm +zone=60 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 3372 : return "+proj=utm +zone=59 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3373 : return "+proj=utm +zone=60 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3374 : return "+proj=utm +zone=29 +ellps=intl +units=m";
+ case 3375 : return "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257964666666 +k=0.99984 +x_0=804671 +y_0=0 +ellps=GRS80 +units=m";
+ case 3376 : return "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +ellps=GRS80 +units=m";
+ case 3377 : return "+proj=cass +lat_0=2.121679744444445 +lon_0=103.4279362361111 +x_0=-14810.562 +y_0=8758.32 +ellps=GRS80 +units=m";
+ case 3378 : return "+proj=cass +lat_0=2.682347636111111 +lon_0=101.9749050416667 +x_0=3673.785 +y_0=-4240.573 +ellps=GRS80 +units=m";
+ case 3379 : return "+proj=cass +lat_0=3.769388088888889 +lon_0=102.3682989833333 +x_0=-7368.228 +y_0=6485.858 +ellps=GRS80 +units=m";
+ case 3380 : return "+proj=cass +lat_0=3.68464905 +lon_0=101.3891079138889 +x_0=-34836.161 +y_0=56464.049 +ellps=GRS80 +units=m";
+ case 3381 : return "+proj=cass +lat_0=4.9762852 +lon_0=103.070275625 +x_0=19594.245 +y_0=3371.895 +ellps=GRS80 +units=m";
+ case 3382 : return "+proj=cass +lat_0=5.421517541666667 +lon_0=100.3443769638889 +x_0=-23.414 +y_0=62.283 +ellps=GRS80 +units=m";
+ case 3383 : return "+proj=cass +lat_0=5.964672713888889 +lon_0=100.6363711111111 +x_0=0 +y_0=0 +ellps=GRS80 +units=m";
+ case 3384 : return "+proj=cass +lat_0=4.859063022222222 +lon_0=100.8154105861111 +x_0=-1.769 +y_0=133454.779 +ellps=GRS80 +units=m";
+ case 3385 : return "+proj=cass +lat_0=5.972543658333334 +lon_0=102.2952416694444 +x_0=13227.851 +y_0=8739.894 +ellps=GRS80 +units=m";
+ case 3386 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,-1.37646,1.4964 +units=m";
+ case 3387 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=5500000 +y_0=0 +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,-1.37646,1.4964 +units=m";
+ case 3388 : return "+proj=merc +lon_0=51 +k=1 +x_0=0 +y_0=0 +ellps=krass +units=m";
+ case 3389 : return "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60500000 +y_0=0 +ellps=krass +units=m";
+ case 3390 : return "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60500000 +y_0=0 +ellps=krass +units=m";
+ case 3391 : return "+proj=utm +zone=37 +ellps=clrk80 +towgs84=84.1,-320.1,218.7,0,0,0,0 +units=m";
+ case 3392 : return "+proj=utm +zone=38 +ellps=clrk80 +towgs84=84.1,-320.1,218.7,0,0,0,0 +units=m";
+ case 3393 : return "+proj=utm +zone=39 +ellps=clrk80 +towgs84=84.1,-320.1,218.7,0,0,0,0 +units=m";
+ case 3394 : return "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +units=m";
+ case 3395 : return "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3396 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +units=m";
+ case 3397 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +units=m";
+ case 3398 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +units=m";
+ case 3399 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +units=m";
+ case 3400 : return "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3401 : return "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3402 : return "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3403 : return "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=0 +y_0=0 +ellps=GRS80 +units=m";
+ case 3404 : return "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3405 : return "+proj=utm +zone=48 +ellps=WGS84 +units=m";
+ case 3406 : return "+proj=utm +zone=49 +ellps=WGS84 +units=m";
+ case 3407 : return "+proj=cass +lat_0=22.31213333333334 +lon_0=114.1785555555556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.3047972654";
+ case 3408 : return "+proj=laea +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m";
+ case 3409 : return "+proj=laea +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m";
+ case 3411 : return "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m";
+ case 3412 : return "+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m";
+ case 3413 : return "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3414 : return "+proj=tmerc +lat_0=1.366666666666667 +lon_0=103.8333333333333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +units=m";
+ case 3415 : return "+proj=lcc +lat_1=18 +lat_2=24 +lat_0=21 +lon_0=114 +x_0=500000 +y_0=500000 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 3416 : return "+proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m";
+ case 3417 : return "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3418 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3419 : return "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3420 : return "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3421 : return "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3422 : return "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3423 : return "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3424 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3425 : return "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3426 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3427 : return "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3428 : return "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3429 : return "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3430 : return "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3431 : return "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3432 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3433 : return "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3434 : return "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3435 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3436 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3437 : return "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3438 : return "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3439 : return "+proj=utm +zone=39 +ellps=clrk80 +units=m";
+ case 3440 : return "+proj=utm +zone=40 +ellps=clrk80 +units=m";
+ case 3441 : return "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3442 : return "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3443 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3444 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3445 : return "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3446 : return "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3447 : return "+proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=50.797815 +lon_0=4.359215833333333 +x_0=150328 +y_0=166262 +ellps=GRS80 +units=m";
+ case 3448 : return "+proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=750000 +y_0=650000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3449 : return "+proj=utm +zone=17 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3450 : return "+proj=utm +zone=18 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3451 : return "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3452 : return "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3453 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3454 : return "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3455 : return "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3456 : return "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3457 : return "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3458 : return "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3459 : return "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3460 : return "+proj=tmerc +lat_0=-17 +lon_0=178.75 +k=0.99985 +x_0=2000000 +y_0=4000000 +ellps=WGS72 +units=m";
+ case 3461 : return "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-83,37,124,0,0,0,0 +units=m";
+ case 3462 : return "+proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-83,37,124,0,0,0,0 +units=m";
+ case 3463 : return "+proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3464 : return "+proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 3465 : return "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3466 : return "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3467 : return "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3468 : return "+proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3469 : return "+proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3470 : return "+proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3471 : return "+proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3472 : return "+proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3473 : return "+proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3474 : return "+proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3475 : return "+proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3476 : return "+proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3477 : return "+proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3478 : return "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3479 : return "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3480 : return "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3481 : return "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3482 : return "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3483 : return "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3484 : return "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3485 : return "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3486 : return "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3487 : return "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3488 : return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3489 : return "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3490 : return "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3491 : return "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3492 : return "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3493 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3494 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3495 : return "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3496 : return "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3497 : return "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3498 : return "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3499 : return "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3500 : return "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3501 : return "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3502 : return "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3503 : return "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3504 : return "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3505 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3506 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3507 : return "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3508 : return "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3509 : return "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3510 : return "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3511 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3512 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3513 : return "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3514 : return "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3515 : return "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3516 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3517 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3518 : return "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3519 : return "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3520 : return "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3521 : return "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3522 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3523 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3524 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3525 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3526 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3527 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3528 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3529 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3530 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3531 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3532 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3533 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3534 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3535 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3536 : return "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3537 : return "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3538 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3539 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3540 : return "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3541 : return "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3542 : return "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3543 : return "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3544 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3545 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3546 : return "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3547 : return "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3548 : return "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3549 : return "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3550 : return "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3551 : return "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3552 : return "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3553 : return "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3554 : return "+proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3555 : return "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0.99998 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3556 : return "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0.99998 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3557 : return "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3558 : return "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3559 : return "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3560 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=999999.9999898402 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3561 : return "+proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192";
+ case 3562 : return "+proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192";
+ case 3563 : return "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192";
+ case 3564 : return "+proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.99999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192";
+ case 3565 : return "+proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +to_meter=0.3048006096012192";
+ case 3566 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=2000000.00001016 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3567 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3568 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=999999.9999898402 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3569 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=2000000.00001016 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3570 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0=3000000 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3571 : return "+proj=laea +lat_0=90 +lon_0=180 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3572 : return "+proj=laea +lat_0=90 +lon_0=-150 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3573 : return "+proj=laea +lat_0=90 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3574 : return "+proj=laea +lat_0=90 +lon_0=-40 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3575 : return "+proj=laea +lat_0=90 +lon_0=10 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3576 : return "+proj=laea +lat_0=90 +lon_0=90 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3577 : return "+proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=132 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3578 : return "+proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +lon_0=-132.5 +x_0=500000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3579 : return "+proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +lon_0=-132.5 +x_0=500000 +y_0=500000 +ellps=GRS80 +units=m";
+ case 3580 : return "+proj=lcc +lat_1=62 +lat_2=70 +lat_0=0 +lon_0=-112 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 3581 : return "+proj=lcc +lat_1=62 +lat_2=70 +lat_0=0 +lon_0=-112 +x_0=0 +y_0=0 +ellps=GRS80 +units=m";
+ case 3582 : return "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3583 : return "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3584 : return "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3585 : return "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3586 : return "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3587 : return "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3588 : return "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3589 : return "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3590 : return "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3591 : return "+proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3592 : return "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3593 : return "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3594 : return "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3595 : return "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3596 : return "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3597 : return "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3598 : return "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3599 : return "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3600 : return "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3601 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3602 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3603 : return "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=850000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3604 : return "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3605 : return "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3606 : return "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3607 : return "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3608 : return "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3609 : return "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3610 : return "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3611 : return "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3612 : return "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3613 : return "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3614 : return "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3615 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3616 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3617 : return "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3618 : return "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3619 : return "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3620 : return "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3621 : return "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3622 : return "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3623 : return "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3624 : return "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3625 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3626 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3627 : return "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3628 : return "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3629 : return "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3630 : return "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3631 : return "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3632 : return "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3633 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3634 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3635 : return "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3636 : return "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3637 : return "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3638 : return "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3639 : return "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3640 : return "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3641 : return "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3642 : return "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3643 : return "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3644 : return "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3645 : return "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3646 : return "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3647 : return "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3648 : return "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3649 : return "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3650 : return "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3651 : return "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3652 : return "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3653 : return "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=100000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3654 : return "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3655 : return "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3656 : return "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3657 : return "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3658 : return "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3659 : return "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3660 : return "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3661 : return "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3662 : return "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3663 : return "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3664 : return "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3665 : return "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3666 : return "+proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3667 : return "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3668 : return "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3669 : return "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3670 : return "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3671 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3672 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3673 : return "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3674 : return "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3675 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3676 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=1999999.999992 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3677 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=2000000.00001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3678 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3679 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0=999999.9999960001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3680 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3681 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3682 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0=2999999.999988 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048";
+ case 3683 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3684 : return "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3685 : return "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3686 : return "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3687 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3688 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3689 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3690 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3691 : return "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3692 : return "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3693 : return "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3694 : return "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3695 : return "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3696 : return "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3697 : return "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3698 : return "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3699 : return "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3700 : return "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3701 : return "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y_0=-4480000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3702 : return "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3703 : return "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3704 : return "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3705 : return "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3706 : return "+proj=utm +zone=59 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3707 : return "+proj=utm +zone=60 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3708 : return "+proj=utm +zone=1 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3709 : return "+proj=utm +zone=2 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3710 : return "+proj=utm +zone=3 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3711 : return "+proj=utm +zone=4 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3712 : return "+proj=utm +zone=5 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3713 : return "+proj=utm +zone=6 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3714 : return "+proj=utm +zone=7 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3715 : return "+proj=utm +zone=8 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3716 : return "+proj=utm +zone=9 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3717 : return "+proj=utm +zone=10 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3718 : return "+proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3719 : return "+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3720 : return "+proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3721 : return "+proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3722 : return "+proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3723 : return "+proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3724 : return "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3725 : return "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3726 : return "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 3727 : return "+proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333333333 +k=1 +x_0=160000 +y_0=50000 +ellps=intl +units=m";
+ case 3728 : return "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3729 : return "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3730 : return "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3731 : return "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3732 : return "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3733 : return "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3734 : return "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3735 : return "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3736 : return "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3737 : return "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3738 : return "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3739 : return "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3740 : return "+proj=utm +zone=10 +ellps=GRS80 +units=m";
+ case 3741 : return "+proj=utm +zone=11 +ellps=GRS80 +units=m";
+ case 3742 : return "+proj=utm +zone=12 +ellps=GRS80 +units=m";
+ case 3743 : return "+proj=utm +zone=13 +ellps=GRS80 +units=m";
+ case 3744 : return "+proj=utm +zone=14 +ellps=GRS80 +units=m";
+ case 3745 : return "+proj=utm +zone=15 +ellps=GRS80 +units=m";
+ case 3746 : return "+proj=utm +zone=16 +ellps=GRS80 +units=m";
+ case 3747 : return "+proj=utm +zone=17 +ellps=GRS80 +units=m";
+ case 3748 : return "+proj=utm +zone=18 +ellps=GRS80 +units=m";
+ case 3749 : return "+proj=utm +zone=19 +ellps=GRS80 +units=m";
+ case 3750 : return "+proj=utm +zone=4 +ellps=GRS80 +units=m";
+ case 3751 : return "+proj=utm +zone=5 +ellps=GRS80 +units=m";
+ case 3752 : return "+proj=merc +lon_0=100 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3753 : return "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3754 : return "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3755 : return "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3756 : return "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3757 : return "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3758 : return "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3759 : return "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 3760 : return "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +to_meter=0.3048006096012192";
+ case 3761 : return "+proj=utm +zone=22 +ellps=GRS80 +units=m";
+ case 3762 : return "+proj=lcc +lat_1=-54 +lat_2=-54.75 +lat_0=-55 +lon_0=-37 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 3920 : return "+proj=utm +zone=20 +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 +units=m";
+ case 3991 : return "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 +to_meter=0.3048006096012192";
+ case 3992 : return "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=152400.3048006096 +y_0=30480.06096012192 +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 +to_meter=0.3048006096012192";
+ case 4001 : return "+proj=longlat +ellps=airy";
+ case 4002 : return "+proj=longlat +a=6377340.189 +b=6356034.447938534";
+ case 4003 : return "+proj=longlat +ellps=aust_SA";
+ case 4004 : return "+proj=longlat +ellps=bessel";
+ case 4005 : return "+proj=longlat +a=6377492.018 +b=6356173.508712696";
+ case 4006 : return "+proj=longlat +ellps=bess_nam";
+ case 4007 : return "+proj=longlat +a=6378293.645208759 +b=6356617.987679838";
+ case 4008 : return "+proj=longlat +ellps=clrk66";
+ case 4009 : return "+proj=longlat +a=6378450.047548896 +b=6356826.621488444";
+ case 4010 : return "+proj=longlat +a=6378300.789 +b=6356566.435";
+ case 4011 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4012 : return "+proj=longlat +ellps=clrk80";
+ case 4013 : return "+proj=longlat +a=6378249.145 +b=6356514.966398753";
+ case 4014 : return "+proj=longlat +a=6378249.2 +b=6356514.996941779";
+ case 4015 : return "+proj=longlat +a=6377276.345 +b=6356075.41314024";
+ case 4016 : return "+proj=longlat +ellps=evrstSS";
+ case 4018 : return "+proj=longlat +a=6377304.063 +b=6356103.038993155";
+ case 4019 : return "+proj=longlat +ellps=GRS80";
+ case 4020 : return "+proj=longlat +ellps=helmert";
+ case 4021 : return "+proj=longlat +a=6378160 +b=6356774.50408554";
+ case 4022 : return "+proj=longlat +ellps=intl";
+ case 4024 : return "+proj=longlat +ellps=krass";
+ case 4025 : return "+proj=longlat +ellps=WGS66";
+ case 4027 : return "+proj=longlat +a=6376523 +b=6355862.933255573";
+ case 4028 : return "+proj=longlat +a=6378298.3 +b=6356657.142669561";
+ case 4029 : return "+proj=longlat +a=6378300 +b=6356751.689189189";
+ case 4030 : return "+proj=longlat +ellps=WGS84";
+ case 4031 : return "+proj=longlat +ellps=WGS84";
+ case 4032 : return "+proj=longlat +a=6378136.2 +b=6356751.516927429";
+ case 4033 : return "+proj=longlat +a=6378136.3 +b=6356751.616592146";
+ case 4034 : return "+proj=longlat +ellps=clrk80";
+ case 4035 : return "+proj=longlat +a=6371000 +b=6371000";
+ case 4036 : return "+proj=longlat +ellps=GRS67";
+ case 4041 : return "+proj=longlat +a=6378135 +b=6356750.304921594";
+ case 4042 : return "+proj=longlat +a=6377299.36559538 +b=6356098.357204818";
+ case 4043 : return "+proj=longlat +ellps=WGS72";
+ case 4044 : return "+proj=longlat +a=6377301.243 +b=6356100.230165384";
+ case 4045 : return "+proj=longlat +a=6377299.151 +b=6356098.145120132";
+ case 4047 : return "+proj=longlat +a=6371007 +b=6371007";
+ case 4052 : return "+proj=longlat +a=6370997 +b=6370997";
+ case 4053 : return "+proj=longlat +a=6371228 +b=6371228";
+ case 4054 : return "+proj=longlat +a=6378273 +b=6356889.449";
+ case 4120 : return "+proj=longlat +ellps=bessel";
+ case 4121 : return "+proj=longlat +ellps=GRS80 +towgs84=-199.87,74.79,246.62,0,0,0,0";
+ case 4122 : return "+proj=longlat +a=6378135 +b=6356750.304921594";
+ case 4123 : return "+proj=longlat +ellps=intl +towgs84=-96.0617,-82.4278,-121.743,4.80107,0.34543,-1.37646,1.4964";
+ case 4124 : return "+proj=longlat +ellps=bessel";
+ case 4125 : return "+proj=longlat +ellps=bessel +towgs84=-404.78,685.68,45.47,0,0,0,0";
+ case 4126 : return "+proj=longlat +ellps=GRS80";
+ case 4127 : return "+proj=longlat +ellps=clrk66";
+ case 4128 : return "+proj=longlat +ellps=clrk66";
+ case 4129 : return "+proj=longlat +ellps=clrk66";
+ case 4130 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0";
+ case 4131 : return "+proj=longlat +a=6377276.345 +b=6356075.41314024";
+ case 4132 : return "+proj=longlat +ellps=clrk80";
+ case 4133 : return "+proj=longlat +ellps=GRS80 +towgs84=0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.014";
+ case 4134 : return "+proj=longlat +ellps=clrk80";
+ case 4135 : return "+proj=longlat +ellps=clrk66";
+ case 4136 : return "+proj=longlat +ellps=clrk66";
+ case 4137 : return "+proj=longlat +ellps=clrk66";
+ case 4138 : return "+proj=longlat +ellps=clrk66";
+ case 4139 : return "+proj=longlat +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0";
+ case 4140 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4141 : return "+proj=longlat +ellps=GRS80 +towgs84=-48,55,52,0,0,0,0";
+ case 4142 : return "+proj=longlat +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0";
+ case 4143 : return "+proj=longlat +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0";
+ case 4144 : return "+proj=longlat +a=6377276.345 +b=6356075.41314024";
+ case 4145 : return "+proj=longlat +a=6377301.243 +b=6356100.230165384";
+ case 4146 : return "+proj=longlat +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0";
+ case 4147 : return "+proj=longlat +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0";
+ case 4148 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4149 : return "+proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0";
+ case 4150 : return "+proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0";
+ case 4151 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4152 : return "+proj=longlat +ellps=GRS80";
+ case 4153 : return "+proj=longlat +ellps=intl +towgs84=-133.63,-157.5,-158.62,0,0,0,0";
+ case 4154 : return "+proj=longlat +ellps=intl";
+ case 4155 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-83,37,124,0,0,0,0";
+ case 4156 : return "+proj=longlat +ellps=bessel";
+ case 4157 : return "+proj=longlat +a=6378293.645208759 +b=6356617.987679838";
+ case 4158 : return "+proj=longlat +ellps=intl";
+ case 4159 : return "+proj=longlat +ellps=intl";
+ case 4160 : return "+proj=longlat +ellps=intl";
+ case 4161 : return "+proj=longlat +ellps=intl +towgs84=27.5,14,186.4,0,0,0,0";
+ case 4162 : return "+proj=longlat +ellps=bessel";
+ case 4163 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4164 : return "+proj=longlat +ellps=krass +towgs84=-76,-138,67,0,0,0,0";
+ case 4165 : return "+proj=longlat +ellps=intl +towgs84=-173,253,27,0,0,0,0";
+ case 4166 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4167 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4168 : return "+proj=longlat +a=6378300 +b=6356751.689189189 +towgs84=-199,32,322,0,0,0,0";
+ case 4169 : return "+proj=longlat +ellps=clrk66 +towgs84=-115,118,426,0,0,0,0";
+ case 4170 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4171 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4172 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4173 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4174 : return "+proj=longlat +a=6378300 +b=6356751.689189189";
+ case 4175 : return "+proj=longlat +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0";
+ case 4176 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4178 : return "+proj=longlat +ellps=krass +towgs84=24,-123,-94,0.02,-0.25,-0.13,1.1";
+ case 4179 : return "+proj=longlat +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84";
+ case 4180 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4181 : return "+proj=longlat +ellps=intl +towgs84=-193,13.7,-39.3,-0.41,-2.933,2.688,0.43";
+ case 4182 : return "+proj=longlat +ellps=intl";
+ case 4183 : return "+proj=longlat +ellps=intl +towgs84=-104,167,-38,0,0,0,0";
+ case 4184 : return "+proj=longlat +ellps=intl +towgs84=-203,141,53,0,0,0,0";
+ case 4185 : return "+proj=longlat +ellps=intl";
+ case 4188 : return "+proj=longlat +ellps=airy +towgs84=482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15";
+ case 4189 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4190 : return "+proj=longlat +ellps=GRS80";
+ case 4191 : return "+proj=longlat +ellps=krass";
+ case 4192 : return "+proj=longlat +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0,0,0";
+ case 4193 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-70.9,-151.8,-41.4,0,0,0,0";
+ case 4194 : return "+proj=longlat +ellps=intl";
+ case 4195 : return "+proj=longlat +ellps=intl +towgs84=105,326,-102.5,0,0,0.814,-0.6";
+ case 4196 : return "+proj=longlat +ellps=intl +towgs84=-45,417,-3.5,0,0,0.814,-0.6";
+ case 4197 : return "+proj=longlat +ellps=clrk80";
+ case 4198 : return "+proj=longlat +ellps=clrk80";
+ case 4199 : return "+proj=longlat +ellps=intl";
+ case 4200 : return "+proj=longlat +ellps=krass";
+ case 4201 : return "+proj=longlat +ellps=clrk80";
+ case 4202 : return "+proj=longlat +ellps=aust_SA";
+ case 4203 : return "+proj=longlat +ellps=aust_SA";
+ case 4204 : return "+proj=longlat +ellps=intl";
+ case 4205 : return "+proj=longlat +ellps=krass +towgs84=-43,-163,45,0,0,0,0";
+ case 4206 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4207 : return "+proj=longlat +ellps=intl";
+ case 4208 : return "+proj=longlat +ellps=intl";
+ case 4209 : return "+proj=longlat +a=6378249.145 +b=6356514.966398753";
+ case 4210 : return "+proj=longlat +ellps=clrk80";
+ case 4211 : return "+proj=longlat +ellps=bessel";
+ case 4212 : return "+proj=longlat +ellps=clrk80 +towgs84=31.95,300.99,419.19,0,0,0,0";
+ case 4213 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-106,-87,188,0,0,0,0";
+ case 4214 : return "+proj=longlat +ellps=krass";
+ case 4215 : return "+proj=longlat +ellps=intl";
+ case 4216 : return "+proj=longlat +ellps=clrk66 +towgs84=-73,213,296,0,0,0,0";
+ case 4218 : return "+proj=longlat +ellps=intl +towgs84=307,304,-318,0,0,0,0";
+ case 4219 : return "+proj=longlat +ellps=bessel +towgs84=-384,664,-48,0,0,0,0";
+ case 4220 : return "+proj=longlat +ellps=clrk80";
+ case 4221 : return "+proj=longlat +ellps=intl";
+ case 4222 : return "+proj=longlat +a=6378249.145 +b=6356514.966398753";
+ case 4223 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4224 : return "+proj=longlat +ellps=intl +towgs84=-134,229,-29,0,0,0,0";
+ case 4225 : return "+proj=longlat +ellps=intl +towgs84=-206,172,-6,0,0,0,0";
+ case 4226 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4227 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4228 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4229 : return "+proj=longlat +ellps=helmert";
+ case 4230 : return "+proj=longlat +ellps=intl";
+ case 4231 : return "+proj=longlat +ellps=intl";
+ case 4232 : return "+proj=longlat +ellps=clrk80";
+ case 4233 : return "+proj=longlat +ellps=intl +towgs84=-133,-321,50,0,0,0,0";
+ case 4234 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4235 : return "+proj=longlat +ellps=intl";
+ case 4236 : return "+proj=longlat +ellps=intl +towgs84=-637,-549,-203,0,0,0,0";
+ case 4237 : return "+proj=longlat +ellps=GRS67";
+ case 4238 : return "+proj=longlat +a=6378160 +b=6356774.50408554";
+ case 4239 : return "+proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0";
+ case 4240 : return "+proj=longlat +a=6377276.345 +b=6356075.41314024";
+ case 4241 : return "+proj=longlat +ellps=clrk80";
+ case 4242 : return "+proj=longlat +ellps=clrk66";
+ case 4243 : return "+proj=longlat +a=6377299.36559538 +b=6356098.357204818";
+ case 4244 : return "+proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=-97,787,86,0,0,0,0";
+ case 4245 : return "+proj=longlat +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0";
+ case 4246 : return "+proj=longlat +ellps=clrk80 +towgs84=-294.7,-200.1,525.5,0,0,0,0";
+ case 4247 : return "+proj=longlat +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0";
+ case 4248 : return "+proj=longlat +ellps=intl";
+ case 4249 : return "+proj=longlat +ellps=intl";
+ case 4250 : return "+proj=longlat +ellps=clrk80 +towgs84=-130,29,364,0,0,0,0";
+ case 4251 : return "+proj=longlat +ellps=clrk80 +towgs84=-90,40,88,0,0,0,0";
+ case 4252 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4253 : return "+proj=longlat +ellps=clrk66";
+ case 4254 : return "+proj=longlat +ellps=intl";
+ case 4255 : return "+proj=longlat +ellps=intl +towgs84=-333,-222,114,0,0,0,0";
+ case 4256 : return "+proj=longlat +ellps=clrk80 +towgs84=41,-220,-134,0,0,0,0";
+ case 4257 : return "+proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0";
+ case 4258 : return "+proj=longlat +ellps=GRS80";
+ case 4259 : return "+proj=longlat +ellps=intl";
+ case 4260 : return "+proj=longlat +ellps=clrk80 +towgs84=-70.9,-151.8,-41.4,0,0,0,0";
+ case 4261 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0";
+ case 4262 : return "+proj=longlat +ellps=bessel +towgs84=639,405,60,0,0,0,0";
+ case 4263 : return "+proj=longlat +ellps=clrk80";
+ case 4264 : return "+proj=longlat +ellps=intl +towgs84=-252.95,-4.11,-96.38,0,0,0,0";
+ case 4265 : return "+proj=longlat +ellps=intl";
+ case 4266 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4267 : return "+proj=longlat +ellps=clrk66 +datum=NAD27";
+ case 4268 : return "+proj=longlat +a=6378450.047548896 +b=6356826.621488444";
+ case 4269 : return "+proj=longlat +ellps=GRS80 +datum=NAD83";
+ case 4270 : return "+proj=longlat +ellps=clrk80";
+ case 4271 : return "+proj=longlat +ellps=intl";
+ case 4272 : return "+proj=longlat +ellps=intl +datum=nzgd49";
+ case 4273 : return "+proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21";
+ case 4274 : return "+proj=longlat +ellps=intl";
+ case 4275 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0";
+ case 4276 : return "+proj=longlat +ellps=WGS66";
+ case 4277 : return "+proj=longlat +ellps=airy +datum=OSGB36";
+ case 4278 : return "+proj=longlat +ellps=airy";
+ case 4279 : return "+proj=longlat +ellps=airy";
+ case 4280 : return "+proj=longlat +ellps=bessel";
+ case 4281 : return "+proj=longlat +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1";
+ case 4282 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4283 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4284 : return "+proj=longlat +ellps=krass";
+ case 4285 : return "+proj=longlat +ellps=intl";
+ case 4286 : return "+proj=longlat +ellps=helmert";
+ case 4287 : return "+proj=longlat +ellps=intl +towgs84=164,138,-189,0,0,0,0";
+ case 4288 : return "+proj=longlat +ellps=intl";
+ case 4289 : return "+proj=longlat +ellps=bessel";
+ case 4291 : return "+proj=longlat +ellps=GRS67";
+ case 4292 : return "+proj=longlat +ellps=intl +towgs84=-355,21,72,0,0,0,0";
+ case 4293 : return "+proj=longlat +ellps=bess_nam";
+ case 4294 : return "+proj=longlat +ellps=bessel";
+ case 4295 : return "+proj=longlat +ellps=bessel";
+ case 4296 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4297 : return "+proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0";
+ case 4298 : return "+proj=longlat +ellps=evrstSS";
+ case 4299 : return "+proj=longlat +a=6377340.189 +b=6356034.447938534";
+ case 4300 : return "+proj=longlat +a=6377340.189 +b=6356034.447938534";
+ case 4301 : return "+proj=longlat +ellps=bessel";
+ case 4302 : return "+proj=longlat +a=6378293.645208759 +b=6356617.987679838";
+ case 4303 : return "+proj=longlat +ellps=helmert";
+ case 4304 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0";
+ case 4306 : return "+proj=longlat +ellps=bessel";
+ case 4307 : return "+proj=longlat +ellps=clrk80";
+ case 4308 : return "+proj=longlat +ellps=bessel";
+ case 4309 : return "+proj=longlat +ellps=intl +towgs84=-155,171,37,0,0,0,0";
+ case 4310 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4311 : return "+proj=longlat +ellps=intl +towgs84=-265,120,-358,0,0,0,0";
+ case 4312 : return "+proj=longlat +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232";
+ case 4313 : return "+proj=longlat +ellps=intl +towgs84=106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1";
+ case 4314 : return "+proj=longlat +ellps=bessel +datum=potsdam";
+ case 4315 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0";
+ case 4316 : return "+proj=longlat +ellps=intl";
+ case 4317 : return "+proj=longlat +ellps=krass";
+ case 4318 : return "+proj=longlat +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0,0,0,0";
+ case 4319 : return "+proj=longlat +ellps=GRS80";
+ case 4322 : return "+proj=longlat +ellps=WGS72";
+ case 4324 : return "+proj=longlat +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38";
+ case 4326 : return "+proj=longlat +ellps=WGS84 +datum=WGS84";
+ case 4600 : return "+proj=longlat +ellps=clrk80";
+ case 4601 : return "+proj=longlat +ellps=clrk80";
+ case 4602 : return "+proj=longlat +ellps=clrk80 +towgs84=725,685,536,0,0,0,0";
+ case 4603 : return "+proj=longlat +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0";
+ case 4604 : return "+proj=longlat +ellps=clrk80 +towgs84=174,359,365,0,0,0,0";
+ case 4605 : return "+proj=longlat +ellps=clrk80";
+ case 4606 : return "+proj=longlat +ellps=clrk80 +towgs84=-149,128,296,0,0,0,0";
+ case 4607 : return "+proj=longlat +ellps=clrk80 +towgs84=195.671,332.517,274.607,0,0,0,0";
+ case 4608 : return "+proj=longlat +ellps=clrk66";
+ case 4609 : return "+proj=longlat +ellps=clrk66";
+ case 4610 : return "+proj=longlat +a=6378140 +b=6356755.288157528";
+ case 4611 : return "+proj=longlat +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425";
+ case 4612 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4613 : return "+proj=longlat +ellps=bessel";
+ case 4614 : return "+proj=longlat +ellps=intl +towgs84=-119.425,-303.659,-11.0006,1.1643,0.174458,1.09626,3.65706";
+ case 4615 : return "+proj=longlat +ellps=intl +towgs84=-499,-249,314,0,0,0,0";
+ case 4616 : return "+proj=longlat +ellps=intl";
+ case 4617 : return "+proj=longlat +ellps=GRS80";
+ case 4618 : return "+proj=longlat +ellps=aust_SA";
+ case 4619 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4620 : return "+proj=longlat +ellps=clrk80 +towgs84=-106,-129,165,0,0,0,0";
+ case 4621 : return "+proj=longlat +ellps=intl +towgs84=137,248,-430,0,0,0,0";
+ case 4622 : return "+proj=longlat +ellps=intl";
+ case 4623 : return "+proj=longlat +ellps=intl +towgs84=-186,230,110,0,0,0,0";
+ case 4624 : return "+proj=longlat +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0";
+ case 4625 : return "+proj=longlat +ellps=intl";
+ case 4626 : return "+proj=longlat +ellps=intl";
+ case 4627 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4628 : return "+proj=longlat +ellps=intl +towgs84=162,117,154,0,0,0,0";
+ case 4629 : return "+proj=longlat +ellps=intl";
+ case 4630 : return "+proj=longlat +ellps=intl";
+ case 4631 : return "+proj=longlat +ellps=intl +towgs84=145,-187,103,0,0,0,0";
+ case 4632 : return "+proj=longlat +ellps=intl +towgs84=-382,-59,-262,0,0,0,0";
+ case 4633 : return "+proj=longlat +ellps=intl";
+ case 4634 : return "+proj=longlat +ellps=intl";
+ case 4635 : return "+proj=longlat +ellps=intl +towgs84=-122.383,-188.696,103.344,3.5107,-4.9668,-5.7047,4.4798";
+ case 4636 : return "+proj=longlat +ellps=intl +towgs84=365,194,166,0,0,0,0";
+ case 4637 : return "+proj=longlat +ellps=intl +towgs84=325,154,172,0,0,0,0";
+ case 4638 : return "+proj=longlat +ellps=clrk66 +towgs84=30,430,368,0,0,0,0";
+ case 4639 : return "+proj=longlat +ellps=intl";
+ case 4640 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4641 : return "+proj=longlat +ellps=intl";
+ case 4642 : return "+proj=longlat +ellps=intl";
+ case 4643 : return "+proj=longlat +ellps=intl +towgs84=-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7";
+ case 4644 : return "+proj=longlat +ellps=intl";
+ case 4645 : return "+proj=longlat +ellps=intl +towgs84=0,0,0,0,0,0,0";
+ case 4646 : return "+proj=longlat +ellps=intl";
+ case 4657 : return "+proj=longlat +a=6377019.27 +b=6355762.5391 +towgs84=-28,199,5,0,0,0,0";
+ case 4658 : return "+proj=longlat +ellps=intl +towgs84=-73,46,-86,0,0,0,0";
+ case 4659 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4660 : return "+proj=longlat +ellps=intl +towgs84=982.609,552.753,-540.873,32.3934,-153.257,-96.2266,16.805";
+ case 4661 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4662 : return "+proj=longlat +ellps=intl";
+ case 4663 : return "+proj=longlat +ellps=intl";
+ case 4664 : return "+proj=longlat +ellps=intl";
+ case 4665 : return "+proj=longlat +ellps=intl";
+ case 4666 : return "+proj=longlat +ellps=bessel";
+ case 4667 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4668 : return "+proj=longlat +ellps=intl +towgs84=-86,-98,-119,0,0,0,0";
+ case 4669 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4670 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4671 : return "+proj=longlat +a=6378249.2 +b=6356515";
+ case 4672 : return "+proj=longlat +ellps=intl +towgs84=175,-38,113,0,0,0,0";
+ case 4673 : return "+proj=longlat +ellps=intl +towgs84=174.05,-25.49,112.57,-0,-0,0.554,0.2263";
+ case 4674 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4675 : return "+proj=longlat +ellps=clrk66 +towgs84=-100,-248,259,0,0,0,0";
+ case 4676 : return "+proj=longlat +ellps=krass";
+ case 4677 : return "+proj=longlat +ellps=krass";
+ case 4678 : return "+proj=longlat +ellps=krass +towgs84=44.585,-131.212,-39.544,0,0,0,0";
+ case 4679 : return "+proj=longlat +ellps=clrk80 +towgs84=-80.01,253.26,291.19,0,0,0,0";
+ case 4680 : return "+proj=longlat +ellps=clrk80 +towgs84=124.5,-63.5,-281,0,0,0,0";
+ case 4681 : return "+proj=longlat +ellps=clrk80";
+ case 4682 : return "+proj=longlat +a=6377276.345 +b=6356075.41314024";
+ case 4683 : return "+proj=longlat +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06";
+ case 4684 : return "+proj=longlat +ellps=intl +towgs84=-133,-321,50,0,0,0,0";
+ case 4685 : return "+proj=longlat +ellps=intl";
+ case 4686 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4687 : return "+proj=longlat +ellps=GRS80";
+ case 4688 : return "+proj=longlat +ellps=intl +towgs84=347.103,1078.12,2623.92,-33.8875,70.6773,-9.3943,186.074";
+ case 4689 : return "+proj=longlat +ellps=intl";
+ case 4690 : return "+proj=longlat +ellps=intl";
+ case 4691 : return "+proj=longlat +ellps=intl +towgs84=215.525,149.593,176.229,-3.2624,-1.692,-1.1571,10.4773";
+ case 4692 : return "+proj=longlat +ellps=intl +towgs84=217.037,86.959,23.956,0,0,0,0";
+ case 4693 : return "+proj=longlat +ellps=WGS84 +towgs84=0,-0.15,0.68,0,0,0,0";
+ case 4694 : return "+proj=longlat +ellps=GRS80";
+ case 4695 : return "+proj=longlat +ellps=clrk66";
+ case 4696 : return "+proj=longlat +ellps=clrk80";
+ case 4697 : return "+proj=longlat +ellps=clrk80";
+ case 4698 : return "+proj=longlat +ellps=intl +towgs84=145,-187,103,0,0,0,0";
+ case 4699 : return "+proj=longlat +ellps=clrk80 +towgs84=-770.1,158.4,-498.2,0,0,0,0";
+ case 4700 : return "+proj=longlat +ellps=clrk80";
+ case 4701 : return "+proj=longlat +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,0,0";
+ case 4702 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4703 : return "+proj=longlat +ellps=clrk80";
+ case 4704 : return "+proj=longlat +ellps=intl";
+ case 4705 : return "+proj=longlat +ellps=intl";
+ case 4706 : return "+proj=longlat +ellps=helmert +towgs84=-146.21,112.63,4.05,0,0,0,0";
+ case 4707 : return "+proj=longlat +ellps=intl +towgs84=114,-116,-333,0,0,0,0";
+ case 4708 : return "+proj=longlat +ellps=aust_SA +towgs84=-491,-22,435,0,0,0,0";
+ case 4709 : return "+proj=longlat +ellps=intl +towgs84=145,75,-272,0,0,0,0";
+ case 4710 : return "+proj=longlat +ellps=intl +towgs84=-320,550,-494,0,0,0,0";
+ case 4711 : return "+proj=longlat +ellps=intl +towgs84=124,-234,-25,0,0,0,0";
+ case 4712 : return "+proj=longlat +ellps=intl +towgs84=-205,107,53,0,0,0,0";
+ case 4713 : return "+proj=longlat +ellps=clrk80 +towgs84=-79,-129,145,0,0,0,0";
+ case 4714 : return "+proj=longlat +ellps=intl +towgs84=-127,-769,472,0,0,0,0";
+ case 4715 : return "+proj=longlat +ellps=intl +towgs84=-104,-129,239,0,0,0,0";
+ case 4716 : return "+proj=longlat +ellps=intl +towgs84=298,-304,-375,0,0,0,0";
+ case 4717 : return "+proj=longlat +ellps=clrk66 +towgs84=-2,151,181,0,0,0,0";
+ case 4718 : return "+proj=longlat +ellps=intl";
+ case 4719 : return "+proj=longlat +ellps=intl +towgs84=211,147,111,0,0,0,0";
+ case 4720 : return "+proj=longlat +ellps=WGS72";
+ case 4721 : return "+proj=longlat +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0";
+ case 4722 : return "+proj=longlat +ellps=intl +towgs84=-794,119,-298,0,0,0,0";
+ case 4723 : return "+proj=longlat +ellps=clrk66 +towgs84=67.8,106.1,138.8,0,0,0,0";
+ case 4724 : return "+proj=longlat +ellps=intl +towgs84=208,-435,-229,0,0,0,0";
+ case 4725 : return "+proj=longlat +ellps=intl +towgs84=189,-79,-202,0,0,0,0";
+ case 4726 : return "+proj=longlat +ellps=clrk66";
+ case 4727 : return "+proj=longlat +ellps=intl";
+ case 4728 : return "+proj=longlat +ellps=intl +towgs84=-307,-92,127,0,0,0,0";
+ case 4729 : return "+proj=longlat +ellps=intl +towgs84=185,165,42,0,0,0,0";
+ case 4730 : return "+proj=longlat +ellps=intl +towgs84=170,42,84,0,0,0,0";
+ case 4731 : return "+proj=longlat +ellps=clrk80 +towgs84=51,391,-36,0,0,0,0";
+ case 4732 : return "+proj=longlat +a=6378270 +b=6356794.343434343 +towgs84=102,52,-38,0,0,0,0";
+ case 4733 : return "+proj=longlat +ellps=intl +towgs84=276,-57,149,0,0,0,0";
+ case 4734 : return "+proj=longlat +ellps=intl +towgs84=-632,438,-609,0,0,0,0";
+ case 4735 : return "+proj=longlat +ellps=intl +towgs84=647,1777,-1124,0,0,0,0";
+ case 4736 : return "+proj=longlat +ellps=clrk80 +towgs84=260,12,-147,0,0,0,0";
+ case 4737 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4738 : return "+proj=longlat +a=6378293.645208759 +b=6356617.987679838";
+ case 4739 : return "+proj=longlat +ellps=intl +towgs84=-156,-271,-189,0,0,0,0";
+ case 4740 : return "+proj=longlat +a=6378136 +b=6356751.361745712 +towgs84=0,0,1.5,-0,-0,0.076,0";
+ case 4741 : return "+proj=longlat +ellps=intl";
+ case 4742 : return "+proj=longlat +ellps=GRS80";
+ case 4743 : return "+proj=longlat +ellps=clrk80 +towgs84=84.1,-320.1,218.7,0,0,0,0";
+ case 4744 : return "+proj=longlat +ellps=clrk80";
+ case 4745 : return "+proj=longlat +ellps=bessel";
+ case 4746 : return "+proj=longlat +ellps=bessel";
+ case 4747 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4748 : return "+proj=longlat +a=6378306.3696 +b=6356571.996 +towgs84=51,391,-36,0,0,0,0";
+ case 4749 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4750 : return "+proj=longlat +ellps=WGS84 +towgs84=-56.263,16.136,-22.856,0,0,0,0";
+ case 4751 : return "+proj=longlat +a=6377295.664 +b=6356094.667915204";
+ case 4752 : return "+proj=longlat +a=6378306.3696 +b=6356571.996 +towgs84=51,391,-36,0,0,0,0";
+ case 4753 : return "+proj=longlat +ellps=intl";
+ case 4754 : return "+proj=longlat +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0,0";
+ case 4755 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4756 : return "+proj=longlat +ellps=WGS84";
+ case 4757 : return "+proj=longlat +ellps=WGS84";
+ case 4758 : return "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0";
+ case 4759 : return "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0";
+ case 4760 : return "+proj=longlat +ellps=WGS66";
+ case 4801 : return "+proj=longlat +ellps=bessel +pm=bern";
+ case 4802 : return "+proj=longlat +ellps=intl +pm=bogota";
+ case 4803 : return "+proj=longlat +ellps=intl +pm=lisbon";
+ case 4804 : return "+proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm=jakarta";
+ case 4805 : return "+proj=longlat +ellps=bessel +pm=ferro";
+ case 4806 : return "+proj=longlat +ellps=intl +pm=rome";
+ case 4807 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris";
+ case 4808 : return "+proj=longlat +ellps=bessel +pm=jakarta";
+ case 4809 : return "+proj=longlat +ellps=intl +pm=brussels";
+ case 4810 : return "+proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris";
+ case 4811 : return "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +pm=paris";
+ case 4813 : return "+proj=longlat +ellps=bessel +pm=jakarta";
+ case 4814 : return "+proj=longlat +ellps=bessel +pm=stockholm";
+ case 4815 : return "+proj=longlat +ellps=bessel +pm=athens";
+ case 4816 : return "+proj=longlat +a=6378249.2 +b=6356515 +pm=paris";
+ case 4817 : return "+proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo";
+ case 4818 : return "+proj=longlat +ellps=bessel +pm=ferro";
+ case 4819 : return "+proj=longlat +ellps=clrk80 +pm=paris";
+ case 4820 : return "+proj=longlat +ellps=bessel +pm=jakarta";
+ case 4821 : return "+proj=longlat +a=6378249.2 +b=6356515 +pm=paris";
+ case 4901 : return "+proj=longlat +a=6376523 +b=6355862.933255573 +pm=paris";
+ case 4902 : return "+proj=longlat +a=6376523 +b=6355862.933255573 +pm=paris";
+ case 4903 : return "+proj=longlat +a=6378298.3 +b=6356657.142669561 +pm=madrid";
+ case 4904 : return "+proj=longlat +ellps=bessel +pm=lisbon";
+ case 20004 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +units=m";
+ case 20005 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +units=m";
+ case 20006 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +units=m";
+ case 20007 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +units=m";
+ case 20008 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +units=m";
+ case 20009 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +units=m";
+ case 20010 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +units=m";
+ case 20011 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +units=m";
+ case 20012 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +units=m";
+ case 20013 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +units=m";
+ case 20014 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +units=m";
+ case 20015 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +units=m";
+ case 20016 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +units=m";
+ case 20017 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +units=m";
+ case 20018 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +units=m";
+ case 20019 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +units=m";
+ case 20020 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +units=m";
+ case 20021 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +units=m";
+ case 20022 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +units=m";
+ case 20023 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +units=m";
+ case 20024 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +units=m";
+ case 20025 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +units=m";
+ case 20026 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +units=m";
+ case 20027 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +units=m";
+ case 20028 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +units=m";
+ case 20029 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +units=m";
+ case 20030 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +units=m";
+ case 20031 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +units=m";
+ case 20032 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +units=m";
+ case 20064 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20065 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20066 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20067 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20068 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20069 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20070 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20071 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20072 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20073 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20074 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20075 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20076 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20077 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20078 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20079 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20080 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20081 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20082 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20083 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20084 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20085 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20086 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20087 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20088 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20089 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20090 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20091 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20092 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 20135 : return "+proj=utm +zone=35 +ellps=clrk80 +units=m";
+ case 20136 : return "+proj=utm +zone=36 +ellps=clrk80 +units=m";
+ case 20137 : return "+proj=utm +zone=37 +ellps=clrk80 +units=m";
+ case 20138 : return "+proj=utm +zone=38 +ellps=clrk80 +units=m";
+ case 20248 : return "+proj=utm +zone=48 +south +ellps=aust_SA +units=m";
+ case 20249 : return "+proj=utm +zone=49 +south +ellps=aust_SA +units=m";
+ case 20250 : return "+proj=utm +zone=50 +south +ellps=aust_SA +units=m";
+ case 20251 : return "+proj=utm +zone=51 +south +ellps=aust_SA +units=m";
+ case 20252 : return "+proj=utm +zone=52 +south +ellps=aust_SA +units=m";
+ case 20253 : return "+proj=utm +zone=53 +south +ellps=aust_SA +units=m";
+ case 20254 : return "+proj=utm +zone=54 +south +ellps=aust_SA +units=m";
+ case 20255 : return "+proj=utm +zone=55 +south +ellps=aust_SA +units=m";
+ case 20256 : return "+proj=utm +zone=56 +south +ellps=aust_SA +units=m";
+ case 20257 : return "+proj=utm +zone=57 +south +ellps=aust_SA +units=m";
+ case 20258 : return "+proj=utm +zone=58 +south +ellps=aust_SA +units=m";
+ case 20348 : return "+proj=utm +zone=48 +south +ellps=aust_SA +units=m";
+ case 20349 : return "+proj=utm +zone=49 +south +ellps=aust_SA +units=m";
+ case 20350 : return "+proj=utm +zone=50 +south +ellps=aust_SA +units=m";
+ case 20351 : return "+proj=utm +zone=51 +south +ellps=aust_SA +units=m";
+ case 20352 : return "+proj=utm +zone=52 +south +ellps=aust_SA +units=m";
+ case 20353 : return "+proj=utm +zone=53 +south +ellps=aust_SA +units=m";
+ case 20354 : return "+proj=utm +zone=54 +south +ellps=aust_SA +units=m";
+ case 20355 : return "+proj=utm +zone=55 +south +ellps=aust_SA +units=m";
+ case 20356 : return "+proj=utm +zone=56 +south +ellps=aust_SA +units=m";
+ case 20357 : return "+proj=utm +zone=57 +south +ellps=aust_SA +units=m";
+ case 20358 : return "+proj=utm +zone=58 +south +ellps=aust_SA +units=m";
+ case 20436 : return "+proj=utm +zone=36 +ellps=intl +units=m";
+ case 20437 : return "+proj=utm +zone=37 +ellps=intl +units=m";
+ case 20438 : return "+proj=utm +zone=38 +ellps=intl +units=m";
+ case 20439 : return "+proj=utm +zone=39 +ellps=intl +units=m";
+ case 20440 : return "+proj=utm +zone=40 +ellps=intl +units=m";
+ case 20499 : return "+proj=utm +zone=39 +ellps=intl +units=m";
+ case 20538 : return "+proj=utm +zone=38 +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +units=m";
+ case 20539 : return "+proj=utm +zone=39 +ellps=krass +towgs84=-43,-163,45,0,0,0,0 +units=m";
+ case 20790 : return "+proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1 +x_0=200000 +y_0=300000 +ellps=intl +pm=lisbon +units=m";
+ case 20791 : return "+proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1 +x_0=0 +y_0=0 +ellps=intl +pm=lisbon +units=m";
+ case 20822 : return "+proj=utm +zone=22 +south +ellps=intl +units=m";
+ case 20823 : return "+proj=utm +zone=23 +south +ellps=intl +units=m";
+ case 20824 : return "+proj=utm +zone=24 +south +ellps=intl +units=m";
+ case 20934 : return "+proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +units=m";
+ case 20935 : return "+proj=utm +zone=35 +south +a=6378249.145 +b=6356514.966398753 +units=m";
+ case 20936 : return "+proj=utm +zone=36 +south +a=6378249.145 +b=6356514.966398753 +units=m";
+ case 21035 : return "+proj=utm +zone=35 +south +ellps=clrk80 +units=m";
+ case 21036 : return "+proj=utm +zone=36 +south +ellps=clrk80 +units=m";
+ case 21037 : return "+proj=utm +zone=37 +south +ellps=clrk80 +units=m";
+ case 21095 : return "+proj=utm +zone=35 +ellps=clrk80 +units=m";
+ case 21096 : return "+proj=utm +zone=36 +ellps=clrk80 +units=m";
+ case 21097 : return "+proj=utm +zone=37 +ellps=clrk80 +units=m";
+ case 21100 : return "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +pm=jakarta +units=m";
+ case 21148 : return "+proj=utm +zone=48 +south +ellps=bessel +units=m";
+ case 21149 : return "+proj=utm +zone=49 +south +ellps=bessel +units=m";
+ case 21150 : return "+proj=utm +zone=50 +south +ellps=bessel +units=m";
+ case 21291 : return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=31.95,300.99,419.19,0,0,0,0 +units=m";
+ case 21292 : return "+proj=tmerc +lat_0=13.17638888888889 +lon_0=-59.55972222222222 +k=0.9999986 +x_0=30000 +y_0=75000 +ellps=clrk80 +towgs84=31.95,300.99,419.19,0,0,0,0 +units=m";
+ case 21413 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +units=m";
+ case 21414 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +units=m";
+ case 21415 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +units=m";
+ case 21416 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +units=m";
+ case 21417 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +units=m";
+ case 21418 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +units=m";
+ case 21419 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +units=m";
+ case 21420 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +units=m";
+ case 21421 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +units=m";
+ case 21422 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +units=m";
+ case 21423 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +units=m";
+ case 21453 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21454 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21455 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21456 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21457 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21458 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21459 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21460 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21461 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21462 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21463 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21473 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21474 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21475 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21476 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21477 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21478 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21479 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21480 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21481 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21482 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21483 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 21500 : return "+proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=90 +lon_0=0 +x_0=150000 +y_0=5400000 +ellps=intl +pm=brussels +units=m";
+ case 21780 : return "+proj=somerc +lat_0=46.95240555555556 +lon_0=0 +x_0=0 +y_0=0 +ellps=bessel +pm=bern +units=m";
+ case 21781 : return "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m";
+ case 21817 : return "+proj=utm +zone=17 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21818 : return "+proj=utm +zone=18 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21891 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-77.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21892 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21893 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-71.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21894 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-68.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21896 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-77.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21897 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21898 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-71.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 21899 : return "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-68.08091666666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs84=307,304,-318,0,0,0,0 +units=m";
+ case 22032 : return "+proj=utm +zone=32 +south +ellps=clrk80 +units=m";
+ case 22033 : return "+proj=utm +zone=33 +south +ellps=clrk80 +units=m";
+ case 22091 : return "+proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 22092 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=clrk80 +units=m";
+ case 22171 : return "+proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22172 : return "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22173 : return "+proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22174 : return "+proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22175 : return "+proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22176 : return "+proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22177 : return "+proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22181 : return "+proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22182 : return "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22183 : return "+proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22184 : return "+proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22185 : return "+proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22186 : return "+proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22187 : return "+proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 22191 : return "+proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=intl +units=m";
+ case 22192 : return "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0=0 +ellps=intl +units=m";
+ case 22193 : return "+proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0=0 +ellps=intl +units=m";
+ case 22194 : return "+proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0=0 +ellps=intl +units=m";
+ case 22195 : return "+proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=intl +units=m";
+ case 22196 : return "+proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0=0 +ellps=intl +units=m";
+ case 22197 : return "+proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0=0 +ellps=intl +units=m";
+ case 22234 : return "+proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +units=m";
+ case 22235 : return "+proj=utm +zone=35 +south +a=6378249.145 +b=6356514.966398753 +units=m";
+ case 22236 : return "+proj=utm +zone=36 +south +a=6378249.145 +b=6356514.966398753 +units=m";
+ case 22332 : return "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m";
+ case 22391 : return "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=9.9 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m";
+ case 22392 : return "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=9.9 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m";
+ case 22521 : return "+proj=utm +zone=21 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m";
+ case 22522 : return "+proj=utm +zone=22 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m";
+ case 22523 : return "+proj=utm +zone=23 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m";
+ case 22524 : return "+proj=utm +zone=24 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m";
+ case 22525 : return "+proj=utm +zone=25 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m";
+ case 22700 : return "+proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0.9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m";
+ case 22770 : return "+proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0.9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m";
+ case 22780 : return "+proj=sterea +lat_0=34.2 +lon_0=39.15 +k=0.9995341 +x_0=0 +y_0=0 +a=6378249.2 +b=6356515 +units=m";
+ case 22832 : return "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m";
+ case 22991 : return "+proj=tmerc +lat_0=30 +lon_0=35 +k=1 +x_0=300000 +y_0=1100000 +ellps=helmert +units=m";
+ case 22992 : return "+proj=tmerc +lat_0=30 +lon_0=31 +k=1 +x_0=615000 +y_0=810000 +ellps=helmert +units=m";
+ case 22993 : return "+proj=tmerc +lat_0=30 +lon_0=27 +k=1 +x_0=700000 +y_0=200000 +ellps=helmert +units=m";
+ case 22994 : return "+proj=tmerc +lat_0=30 +lon_0=27 +k=1 +x_0=700000 +y_0=1200000 +ellps=helmert +units=m";
+ case 23028 : return "+proj=utm +zone=28 +ellps=intl +units=m";
+ case 23029 : return "+proj=utm +zone=29 +ellps=intl +units=m";
+ case 23030 : return "+proj=utm +zone=30 +ellps=intl +units=m";
+ case 23031 : return "+proj=utm +zone=31 +ellps=intl +units=m";
+ case 23032 : return "+proj=utm +zone=32 +ellps=intl +units=m";
+ case 23033 : return "+proj=utm +zone=33 +ellps=intl +units=m";
+ case 23034 : return "+proj=utm +zone=34 +ellps=intl +units=m";
+ case 23035 : return "+proj=utm +zone=35 +ellps=intl +units=m";
+ case 23036 : return "+proj=utm +zone=36 +ellps=intl +units=m";
+ case 23037 : return "+proj=utm +zone=37 +ellps=intl +units=m";
+ case 23038 : return "+proj=utm +zone=38 +ellps=intl +units=m";
+ case 23090 : return "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 23095 : return "+proj=tmerc +lat_0=0 +lon_0=5 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +units=m";
+ case 23239 : return "+proj=utm +zone=39 +ellps=clrk80 +units=m";
+ case 23240 : return "+proj=utm +zone=40 +ellps=clrk80 +units=m";
+ case 23433 : return "+proj=utm +zone=33 +a=6378249.2 +b=6356515 +units=m";
+ case 23700 : return "+proj=somerc +lat_0=47.14439372222222 +lon_0=19.04857177777778 +x_0=650000 +y_0=200000 +ellps=GRS67 +units=m";
+ case 23830 : return "+proj=tmerc +lat_0=0 +lon_0=94.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23831 : return "+proj=tmerc +lat_0=0 +lon_0=97.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23832 : return "+proj=tmerc +lat_0=0 +lon_0=100.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23833 : return "+proj=tmerc +lat_0=0 +lon_0=103.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23834 : return "+proj=tmerc +lat_0=0 +lon_0=106.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23835 : return "+proj=tmerc +lat_0=0 +lon_0=109.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23836 : return "+proj=tmerc +lat_0=0 +lon_0=112.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23837 : return "+proj=tmerc +lat_0=0 +lon_0=115.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23838 : return "+proj=tmerc +lat_0=0 +lon_0=118.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23839 : return "+proj=tmerc +lat_0=0 +lon_0=121.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23840 : return "+proj=tmerc +lat_0=0 +lon_0=124.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23841 : return "+proj=tmerc +lat_0=0 +lon_0=127.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23842 : return "+proj=tmerc +lat_0=0 +lon_0=130.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23843 : return "+proj=tmerc +lat_0=0 +lon_0=133.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23844 : return "+proj=tmerc +lat_0=0 +lon_0=136.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23845 : return "+proj=tmerc +lat_0=0 +lon_0=139.5 +k=0.9999 +x_0=200000 +y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23846 : return "+proj=utm +zone=46 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23847 : return "+proj=utm +zone=47 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23848 : return "+proj=utm +zone=48 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23849 : return "+proj=utm +zone=49 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23850 : return "+proj=utm +zone=50 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23851 : return "+proj=utm +zone=51 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23852 : return "+proj=utm +zone=52 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23853 : return "+proj=utm +zone=53 +a=6378160 +b=6356774.50408554 +units=m";
+ case 23866 : return "+proj=utm +zone=46 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23867 : return "+proj=utm +zone=47 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23868 : return "+proj=utm +zone=48 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23869 : return "+proj=utm +zone=49 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23870 : return "+proj=utm +zone=50 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23871 : return "+proj=utm +zone=51 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23872 : return "+proj=utm +zone=52 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23877 : return "+proj=utm +zone=47 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23878 : return "+proj=utm +zone=48 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23879 : return "+proj=utm +zone=49 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23880 : return "+proj=utm +zone=50 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23881 : return "+proj=utm +zone=51 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23882 : return "+proj=utm +zone=52 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23883 : return "+proj=utm +zone=53 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23884 : return "+proj=utm +zone=54 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 23886 : return "+proj=utm +zone=46 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23887 : return "+proj=utm +zone=47 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23888 : return "+proj=utm +zone=48 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23889 : return "+proj=utm +zone=49 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23890 : return "+proj=utm +zone=50 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23891 : return "+proj=utm +zone=51 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23892 : return "+proj=utm +zone=52 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23893 : return "+proj=utm +zone=53 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23894 : return "+proj=utm +zone=54 +south +a=6378160 +b=6356774.50408554 +units=m";
+ case 23946 : return "+proj=utm +zone=46 +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0 +units=m";
+ case 23947 : return "+proj=utm +zone=47 +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0 +units=m";
+ case 23948 : return "+proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +towgs84=217,823,299,0,0,0,0 +units=m";
+ case 24047 : return "+proj=utm +zone=47 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 24048 : return "+proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 24100 : return "+proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=167638.49597 +y_0=121918.90616 +ellps=clrk80 +to_meter=0.3047972654";
+ case 24200 : return "+proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=250000 +y_0=150000 +ellps=clrk66 +units=m";
+ case 24305 : return "+proj=utm +zone=45 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 24306 : return "+proj=utm +zone=46 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 24311 : return "+proj=utm +zone=41 +a=6377301.243 +b=6356100.230165384 +units=m";
+ case 24312 : return "+proj=utm +zone=42 +a=6377301.243 +b=6356100.230165384 +units=m";
+ case 24313 : return "+proj=utm +zone=43 +a=6377301.243 +b=6356100.230165384 +units=m";
+ case 24342 : return "+proj=utm +zone=42 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24343 : return "+proj=utm +zone=43 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24344 : return "+proj=utm +zone=44 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24345 : return "+proj=utm +zone=45 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24346 : return "+proj=utm +zone=46 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24347 : return "+proj=utm +zone=47 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24370 : return "+proj=lcc +lat_1=39.5 +lat_0=39.5 +lon_0=68 +k_0=0.99846154 +x_0=2153865.73916853 +y_0=2368292.194628102 +a=6377299.36559538 +b=6356098.357204818 +to_meter=0.9143985307444408";
+ case 24371 : return "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204818 +to_meter=0.9143985307444408";
+ case 24372 : return "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204818 +to_meter=0.9143985307444408";
+ case 24373 : return "+proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204818 +to_meter=0.9143985307444408";
+ case 24374 : return "+proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204818 +to_meter=0.9143985307444408";
+ case 24375 : return "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743185.69 +y_0=914395.23 +a=6377276.345 +b=6356075.41314024 +units=m";
+ case 24376 : return "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=6356100.230165384 +units=m";
+ case 24377 : return "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=6356100.230165384 +units=m";
+ case 24378 : return "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24379 : return "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24380 : return "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24381 : return "+proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24382 : return "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299.36559538 +b=6356098.357204818 +to_meter=0.9143985307444408";
+ case 24383 : return "+proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.145120132 +towgs84=295,736,257,0,0,0,0 +units=m";
+ case 24500 : return "+proj=cass +lat_0=1.287646666666667 +lon_0=103.8530022222222 +x_0=30000 +y_0=30000 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m";
+ case 24547 : return "+proj=utm +zone=47 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m";
+ case 24548 : return "+proj=utm +zone=48 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m";
+ case 24571 : return "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k=0.99984 +x_0=804671.2997750348 +y_0=0 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +to_meter=20.11678249437587";
+ case 24600 : return "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.9987864078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +towgs84=-294.7,-200.1,525.5,0,0,0,0 +units=m";
+ case 24718 : return "+proj=utm +zone=18 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m";
+ case 24719 : return "+proj=utm +zone=19 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m";
+ case 24720 : return "+proj=utm +zone=20 +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +units=m";
+ case 24817 : return "+proj=utm +zone=17 +ellps=intl +units=m";
+ case 24818 : return "+proj=utm +zone=18 +ellps=intl +units=m";
+ case 24819 : return "+proj=utm +zone=19 +ellps=intl +units=m";
+ case 24820 : return "+proj=utm +zone=20 +ellps=intl +units=m";
+ case 24821 : return "+proj=utm +zone=21 +ellps=intl +units=m";
+ case 24877 : return "+proj=utm +zone=17 +south +ellps=intl +units=m";
+ case 24878 : return "+proj=utm +zone=18 +south +ellps=intl +units=m";
+ case 24879 : return "+proj=utm +zone=19 +south +ellps=intl +units=m";
+ case 24880 : return "+proj=utm +zone=20 +south +ellps=intl +units=m";
+ case 24881 : return "+proj=utm +zone=21 +south +ellps=intl +units=m";
+ case 24882 : return "+proj=utm +zone=22 +south +ellps=intl +units=m";
+ case 24891 : return "+proj=tmerc +lat_0=-6 +lon_0=-80.5 +k=0.99983008 +x_0=222000 +y_0=1426834.743 +ellps=intl +units=m";
+ case 24892 : return "+proj=tmerc +lat_0=-9.5 +lon_0=-76 +k=0.99932994 +x_0=720000 +y_0=1039979.159 +ellps=intl +units=m";
+ case 24893 : return "+proj=tmerc +lat_0=-9.5 +lon_0=-70.5 +k=0.99952992 +x_0=1324000 +y_0=1040084.558 +ellps=intl +units=m";
+ case 25000 : return "+proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.99975 +x_0=274319.51 +y_0=0 +ellps=clrk80 +towgs84=-130,29,364,0,0,0,0 +units=m";
+ case 25231 : return "+proj=utm +zone=31 +a=6378249.2 +b=6356515 +units=m";
+ case 25391 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m";
+ case 25392 : return "+proj=tmerc +lat_0=0 +lon_0=119 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m";
+ case 25393 : return "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m";
+ case 25394 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m";
+ case 25395 : return "+proj=tmerc +lat_0=0 +lon_0=125 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +units=m";
+ case 25700 : return "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm=jakarta +units=m";
+ case 25828 : return "+proj=utm +zone=28 +ellps=GRS80 +units=m";
+ case 25829 : return "+proj=utm +zone=29 +ellps=GRS80 +units=m";
+ case 25830 : return "+proj=utm +zone=30 +ellps=GRS80 +units=m";
+ case 25831 : return "+proj=utm +zone=31 +ellps=GRS80 +units=m";
+ case 25832 : return "+proj=utm +zone=32 +ellps=GRS80 +units=m";
+ case 25833 : return "+proj=utm +zone=33 +ellps=GRS80 +units=m";
+ case 25834 : return "+proj=utm +zone=34 +ellps=GRS80 +units=m";
+ case 25835 : return "+proj=utm +zone=35 +ellps=GRS80 +units=m";
+ case 25836 : return "+proj=utm +zone=36 +ellps=GRS80 +units=m";
+ case 25837 : return "+proj=utm +zone=37 +ellps=GRS80 +units=m";
+ case 25838 : return "+proj=utm +zone=38 +ellps=GRS80 +units=m";
+ case 25884 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 25932 : return "+proj=utm +zone=32 +south +ellps=intl +units=m";
+ case 26191 : return "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=-5.4 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m";
+ case 26192 : return "+proj=lcc +lat_1=29.7 +lat_0=29.7 +lon_0=-5.4 +k_0=0.9996155960000001 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m";
+ case 26193 : return "+proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.9996 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m";
+ case 26194 : return "+proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.999616304 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m";
+ case 26195 : return "+proj=lcc +lat_1=22.5 +lat_0=22.5 +lon_0=-5.4 +k_0=0.999616437 +x_0=1500000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m";
+ case 26237 : return "+proj=utm +zone=37 +ellps=bessel +towgs84=639,405,60,0,0,0,0 +units=m";
+ case 26331 : return "+proj=utm +zone=31 +ellps=clrk80 +units=m";
+ case 26332 : return "+proj=utm +zone=32 +ellps=clrk80 +units=m";
+ case 26391 : return "+proj=tmerc +lat_0=4 +lon_0=4.5 +k=0.99975 +x_0=230738.26 +y_0=0 +ellps=clrk80 +units=m";
+ case 26392 : return "+proj=tmerc +lat_0=4 +lon_0=8.5 +k=0.99975 +x_0=670553.98 +y_0=0 +ellps=clrk80 +units=m";
+ case 26393 : return "+proj=tmerc +lat_0=4 +lon_0=12.5 +k=0.99975 +x_0=1110369.7 +y_0=0 +ellps=clrk80 +units=m";
+ case 26432 : return "+proj=utm +zone=32 +south +ellps=intl +towgs84=-252.95,-4.11,-96.38,0,0,0,0 +units=m";
+ case 26591 : return "+proj=tmerc +lat_0=0 +lon_0=-3.45233333333333 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +pm=rome +units=m";
+ case 26592 : return "+proj=tmerc +lat_0=0 +lon_0=2.54766666666666 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +pm=rome +units=m";
+ case 26632 : return "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m";
+ case 26692 : return "+proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +units=m";
+ case 26701 : return "+proj=utm +zone=1 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26702 : return "+proj=utm +zone=2 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26703 : return "+proj=utm +zone=3 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26704 : return "+proj=utm +zone=4 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26705 : return "+proj=utm +zone=5 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26706 : return "+proj=utm +zone=6 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26707 : return "+proj=utm +zone=7 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26708 : return "+proj=utm +zone=8 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26709 : return "+proj=utm +zone=9 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26710 : return "+proj=utm +zone=10 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26711 : return "+proj=utm +zone=11 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26712 : return "+proj=utm +zone=12 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26713 : return "+proj=utm +zone=13 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26714 : return "+proj=utm +zone=14 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26715 : return "+proj=utm +zone=15 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26716 : return "+proj=utm +zone=16 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26717 : return "+proj=utm +zone=17 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26718 : return "+proj=utm +zone=18 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26719 : return "+proj=utm +zone=19 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26720 : return "+proj=utm +zone=20 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26721 : return "+proj=utm +zone=21 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26722 : return "+proj=utm +zone=22 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 26729 : return "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26730 : return "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26731 : return "+proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000.001016002 +y_0=-5000000.001016002 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26732 : return "+proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26733 : return "+proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26734 : return "+proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26735 : return "+proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26736 : return "+proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26737 : return "+proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=213360.4267208534 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26738 : return "+proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26739 : return "+proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=182880.3657607315 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26740 : return "+proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=914401.8288036576 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26741 : return "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26742 : return "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26743 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26744 : return "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26745 : return "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26746 : return "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26747 : return "+proj=lcc +lat_1=34.41666666666666 +lat_2=33.86666666666667 +lat_0=34.13333333333333 +lon_0=-118.3333333333333 +x_0=1276106.450596901 +y_0=127079.524511049 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26748 : return "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26749 : return "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26750 : return "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26751 : return "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26752 : return "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26753 : return "+proj=lcc +lat_1=39.71666666666667 +lat_2=40.78333333333333 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26754 : return "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26755 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26756 : return "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=182880.3657607315 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26757 : return "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26758 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26759 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26760 : return "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26766 : return "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26767 : return "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26768 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26769 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26770 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26771 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26772 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26773 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26774 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26775 : return "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26776 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26777 : return "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26778 : return "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26779 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26780 : return "+proj=lcc +lat_1=36.73333333333333 +lat_2=37.93333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26781 : return "+proj=lcc +lat_1=31.16666666666667 +lat_2=32.66666666666666 +lat_0=30.66666666666667 +lon_0=-92.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26782 : return "+proj=lcc +lat_1=29.3 +lat_2=30.7 +lat_0=28.66666666666667 +lon_0=-91.33333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26783 : return "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-68.5 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26784 : return "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26785 : return "+proj=lcc +lat_1=38.3 +lat_2=39.45 +lat_0=37.83333333333334 +lon_0=-77 +x_0=243840.4876809754 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26786 : return "+proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 +lon_0=-71.5 +x_0=182880.3657607315 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26787 : return "+proj=lcc +lat_1=41.28333333333333 +lat_2=41.48333333333333 +lat_0=41 +lon_0=-70.5 +x_0=60960.12192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26791 : return "+proj=lcc +lat_1=47.03333333333333 +lat_2=48.63333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26792 : return "+proj=lcc +lat_1=45.61666666666667 +lat_2=47.05 +lat_0=45 +lon_0=-94.25 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26793 : return "+proj=lcc +lat_1=43.78333333333333 +lat_2=45.21666666666667 +lat_0=43 +lon_0=-94 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26794 : return "+proj=tmerc +lat_0=29.66666666666667 +lon_0=-88.83333333333333 +k=0.99996 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26795 : return "+proj=tmerc +lat_0=30.5 +lon_0=-90.33333333333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26796 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26797 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26798 : return "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26799 : return "+proj=lcc +lat_1=34.41666666666666 +lat_2=33.86666666666667 +lat_0=34.13333333333333 +lon_0=-118.3333333333333 +x_0=1276106.450596901 +y_0=1268253.006858014 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 26801 : return "+proj=tmerc +lat_0=41.5 +lon_0=-83.66666666666667 +k=0.999942857 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192";
+ case 26802 : return "+proj=tmerc +lat_0=41.5 +lon_0=-85.75 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192";
+ case 26803 : return "+proj=tmerc +lat_0=41.5 +lon_0=-88.75 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192";
+ case 26811 : return "+proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192";
+ case 26812 : return "+proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192";
+ case 26813 : return "+proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +to_meter=0.3048006096012192";
+ case 26901 : return "+proj=utm +zone=1 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26902 : return "+proj=utm +zone=2 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26903 : return "+proj=utm +zone=3 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26904 : return "+proj=utm +zone=4 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26905 : return "+proj=utm +zone=5 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26906 : return "+proj=utm +zone=6 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26907 : return "+proj=utm +zone=7 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26908 : return "+proj=utm +zone=8 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26909 : return "+proj=utm +zone=9 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26910 : return "+proj=utm +zone=10 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26911 : return "+proj=utm +zone=11 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26912 : return "+proj=utm +zone=12 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26913 : return "+proj=utm +zone=13 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26914 : return "+proj=utm +zone=14 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26915 : return "+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26916 : return "+proj=utm +zone=16 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26917 : return "+proj=utm +zone=17 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26918 : return "+proj=utm +zone=18 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26919 : return "+proj=utm +zone=19 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26920 : return "+proj=utm +zone=20 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26921 : return "+proj=utm +zone=21 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26922 : return "+proj=utm +zone=22 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26923 : return "+proj=utm +zone=23 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26929 : return "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26930 : return "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26931 : return "+proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26932 : return "+proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26933 : return "+proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26934 : return "+proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26935 : return "+proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26936 : return "+proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26937 : return "+proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26938 : return "+proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26939 : return "+proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26940 : return "+proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26941 : return "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26942 : return "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26943 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26944 : return "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26945 : return "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26946 : return "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26948 : return "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26949 : return "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26950 : return "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26951 : return "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26952 : return "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26953 : return "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26954 : return "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26955 : return "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26956 : return "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26957 : return "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26958 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26959 : return "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26960 : return "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26961 : return "+proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26962 : return "+proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26963 : return "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26964 : return "+proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26965 : return "+proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26966 : return "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26967 : return "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26968 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26969 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26970 : return "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26971 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26972 : return "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26973 : return "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26974 : return "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26975 : return "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26976 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26977 : return "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26978 : return "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26979 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=37.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26980 : return "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26981 : return "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26982 : return "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26983 : return "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26984 : return "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26985 : return "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26986 : return "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26987 : return "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26988 : return "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26989 : return "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26990 : return "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26991 : return "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26992 : return "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26993 : return "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26994 : return "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26995 : return "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26996 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26997 : return "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 26998 : return "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=850000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 27037 : return "+proj=utm +zone=37 +ellps=clrk80 +units=m";
+ case 27038 : return "+proj=utm +zone=38 +ellps=clrk80 +units=m";
+ case 27039 : return "+proj=utm +zone=39 +ellps=clrk80 +units=m";
+ case 27040 : return "+proj=utm +zone=40 +ellps=clrk80 +units=m";
+ case 27120 : return "+proj=utm +zone=20 +ellps=intl +units=m";
+ case 27200 : return "+proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=intl +datum=nzgd49 +units=m";
+ case 27205 : return "+proj=tmerc +lat_0=-36.87986527777778 +lon_0=174.7643393611111 +k=0.9999 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27206 : return "+proj=tmerc +lat_0=-37.76124980555556 +lon_0=176.46619725 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27207 : return "+proj=tmerc +lat_0=-38.62470277777778 +lon_0=177.8856362777778 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27208 : return "+proj=tmerc +lat_0=-39.65092930555556 +lon_0=176.6736805277778 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27209 : return "+proj=tmerc +lat_0=-39.13575830555556 +lon_0=174.22801175 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27210 : return "+proj=tmerc +lat_0=-39.51247038888889 +lon_0=175.6400368055556 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27211 : return "+proj=tmerc +lat_0=-40.24194713888889 +lon_0=175.4880996111111 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27212 : return "+proj=tmerc +lat_0=-40.92553263888889 +lon_0=175.6473496666667 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27213 : return "+proj=tmerc +lat_0=-41.30131963888888 +lon_0=174.7766231111111 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27214 : return "+proj=tmerc +lat_0=-40.71475905555556 +lon_0=172.6720465 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27215 : return "+proj=tmerc +lat_0=-41.27454472222222 +lon_0=173.2993168055555 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27216 : return "+proj=tmerc +lat_0=-41.28991152777778 +lon_0=172.1090281944444 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27217 : return "+proj=tmerc +lat_0=-41.81080286111111 +lon_0=171.5812600555556 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27218 : return "+proj=tmerc +lat_0=-42.33369427777778 +lon_0=171.5497713055556 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27219 : return "+proj=tmerc +lat_0=-42.68911658333333 +lon_0=173.0101333888889 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27220 : return "+proj=tmerc +lat_0=-41.54448666666666 +lon_0=173.8020741111111 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27221 : return "+proj=tmerc +lat_0=-42.88632236111111 +lon_0=170.9799935 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27222 : return "+proj=tmerc +lat_0=-43.11012813888889 +lon_0=170.2609258333333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27223 : return "+proj=tmerc +lat_0=-43.97780288888889 +lon_0=168.606267 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27224 : return "+proj=tmerc +lat_0=-43.59063758333333 +lon_0=172.7271935833333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27225 : return "+proj=tmerc +lat_0=-43.74871155555556 +lon_0=171.3607484722222 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27226 : return "+proj=tmerc +lat_0=-44.40222036111111 +lon_0=171.0572508333333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27227 : return "+proj=tmerc +lat_0=-44.73526797222222 +lon_0=169.4677550833333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27228 : return "+proj=tmerc +lat_0=-45.13290258333333 +lon_0=168.3986411944444 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27229 : return "+proj=tmerc +lat_0=-45.56372616666666 +lon_0=167.7388617777778 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27230 : return "+proj=tmerc +lat_0=-45.81619661111111 +lon_0=170.6285951666667 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27231 : return "+proj=tmerc +lat_0=-45.86151336111111 +lon_0=170.2825891111111 +k=0.99996 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +units=m";
+ case 27232 : return "+proj=tmerc +lat_0=-46.60000961111111 +lon_0=168.342872 +k=1 +x_0=300002.66 +y_0=699999.58 +ellps=intl +datum=nzgd49 +units=m";
+ case 27258 : return "+proj=utm +zone=58 +south +ellps=intl +datum=nzgd49 +units=m";
+ case 27259 : return "+proj=utm +zone=59 +south +ellps=intl +datum=nzgd49 +units=m";
+ case 27260 : return "+proj=utm +zone=60 +south +ellps=intl +datum=nzgd49 +units=m";
+ case 27291 : return "+proj=tmerc +lat_0=-39 +lon_0=175.5 +k=1 +x_0=274319.5243848086 +y_0=365759.3658464114 +ellps=intl +datum=nzgd49 +to_meter=0.9143984146160287";
+ case 27292 : return "+proj=tmerc +lat_0=-44 +lon_0=171.5 +k=1 +x_0=457199.2073080143 +y_0=457199.2073080143 +ellps=intl +datum=nzgd49 +to_meter=0.9143984146160287";
+ case 27391 : return "+proj=tmerc +lat_0=58 +lon_0=-4.666666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27392 : return "+proj=tmerc +lat_0=58 +lon_0=-2.333333333333333 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27393 : return "+proj=tmerc +lat_0=58 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27394 : return "+proj=tmerc +lat_0=58 +lon_0=2.5 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27395 : return "+proj=tmerc +lat_0=58 +lon_0=6.166666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27396 : return "+proj=tmerc +lat_0=58 +lon_0=10.16666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27397 : return "+proj=tmerc +lat_0=58 +lon_0=14.16666666666667 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27398 : return "+proj=tmerc +lat_0=58 +lon_0=18.33333333333333 +k=1 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m";
+ case 27429 : return "+proj=utm +zone=29 +ellps=intl +units=m";
+ case 27492 : return "+proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1 +x_0=180.598 +y_0=-86.98999999999999 +ellps=intl +units=m";
+ case 27500 : return "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=5.399999999999999 +k_0=0.99950908 +x_0=500000 +y_0=300000 +a=6376523 +b=6355862.933255573 +pm=paris +units=m";
+ case 27561 : return "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27562 : return "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27563 : return "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27564 : return "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27571 : return "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27572 : return "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27573 : return "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27574 : return "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27581 : return "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27582 : return "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27583 : return "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27584 : return "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27591 : return "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27592 : return "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27593 : return "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27594 : return "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
+ case 27700 : return "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m";
+ case 28191 : return "+proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m";
+ case 28192 : return "+proj=tmerc +lat_0=31.73409694444445 +lon_0=35.21208055555556 +k=1 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m";
+ case 28193 : return "+proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m";
+ case 28232 : return "+proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +units=m";
+ case 28348 : return "+proj=utm +zone=48 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28349 : return "+proj=utm +zone=49 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28350 : return "+proj=utm +zone=50 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28351 : return "+proj=utm +zone=51 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28352 : return "+proj=utm +zone=52 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28353 : return "+proj=utm +zone=53 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28354 : return "+proj=utm +zone=54 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28355 : return "+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28356 : return "+proj=utm +zone=56 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28357 : return "+proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28358 : return "+proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 28402 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=2500000 +y_0=0 +ellps=krass +units=m";
+ case 28403 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 +ellps=krass +units=m";
+ case 28404 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +units=m";
+ case 28405 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +units=m";
+ case 28406 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +units=m";
+ case 28407 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +units=m";
+ case 28408 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +units=m";
+ case 28409 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +units=m";
+ case 28410 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +units=m";
+ case 28411 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +units=m";
+ case 28412 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +units=m";
+ case 28413 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +units=m";
+ case 28414 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +units=m";
+ case 28415 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +units=m";
+ case 28416 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +units=m";
+ case 28417 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +units=m";
+ case 28418 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +units=m";
+ case 28419 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +units=m";
+ case 28420 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +units=m";
+ case 28421 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +units=m";
+ case 28422 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +units=m";
+ case 28423 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +units=m";
+ case 28424 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=24500000 +y_0=0 +ellps=krass +units=m";
+ case 28425 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=25500000 +y_0=0 +ellps=krass +units=m";
+ case 28426 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=26500000 +y_0=0 +ellps=krass +units=m";
+ case 28427 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=27500000 +y_0=0 +ellps=krass +units=m";
+ case 28428 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=28500000 +y_0=0 +ellps=krass +units=m";
+ case 28429 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=29500000 +y_0=0 +ellps=krass +units=m";
+ case 28430 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=30500000 +y_0=0 +ellps=krass +units=m";
+ case 28431 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=31500000 +y_0=0 +ellps=krass +units=m";
+ case 28432 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=32500000 +y_0=0 +ellps=krass +units=m";
+ case 28462 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28463 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28464 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28465 : return "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28466 : return "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28467 : return "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28468 : return "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28469 : return "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28470 : return "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28471 : return "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28472 : return "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28473 : return "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28474 : return "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28475 : return "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28476 : return "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28477 : return "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28478 : return "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28479 : return "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28480 : return "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28481 : return "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28482 : return "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28483 : return "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28484 : return "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28485 : return "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28486 : return "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28487 : return "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28488 : return "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28489 : return "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28490 : return "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28491 : return "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28492 : return "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m";
+ case 28600 : return "+proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.99999 +x_0=200000 +y_0=300000 +ellps=intl +units=m";
+ case 28991 : return "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 28992 : return "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m";
+ case 29100 : return "+proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS67 +units=m";
+ case 29101 : return "+proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +units=m";
+ case 29118 : return "+proj=utm +zone=18 +ellps=GRS67 +units=m";
+ case 29119 : return "+proj=utm +zone=19 +ellps=GRS67 +units=m";
+ case 29120 : return "+proj=utm +zone=20 +ellps=GRS67 +units=m";
+ case 29121 : return "+proj=utm +zone=21 +ellps=GRS67 +units=m";
+ case 29122 : return "+proj=utm +zone=22 +ellps=GRS67 +units=m";
+ case 29168 : return "+proj=utm +zone=18 +ellps=aust_SA +units=m";
+ case 29169 : return "+proj=utm +zone=19 +ellps=aust_SA +units=m";
+ case 29170 : return "+proj=utm +zone=20 +ellps=aust_SA +units=m";
+ case 29171 : return "+proj=utm +zone=21 +ellps=aust_SA +units=m";
+ case 29172 : return "+proj=utm +zone=22 +ellps=aust_SA +units=m";
+ case 29177 : return "+proj=utm +zone=17 +south +ellps=GRS67 +units=m";
+ case 29178 : return "+proj=utm +zone=18 +south +ellps=GRS67 +units=m";
+ case 29179 : return "+proj=utm +zone=19 +south +ellps=GRS67 +units=m";
+ case 29180 : return "+proj=utm +zone=20 +south +ellps=GRS67 +units=m";
+ case 29181 : return "+proj=utm +zone=21 +south +ellps=GRS67 +units=m";
+ case 29182 : return "+proj=utm +zone=22 +south +ellps=GRS67 +units=m";
+ case 29183 : return "+proj=utm +zone=23 +south +ellps=GRS67 +units=m";
+ case 29184 : return "+proj=utm +zone=24 +south +ellps=GRS67 +units=m";
+ case 29185 : return "+proj=utm +zone=25 +south +ellps=GRS67 +units=m";
+ case 29187 : return "+proj=utm +zone=17 +south +ellps=aust_SA +units=m";
+ case 29188 : return "+proj=utm +zone=18 +south +ellps=aust_SA +units=m";
+ case 29189 : return "+proj=utm +zone=19 +south +ellps=aust_SA +units=m";
+ case 29190 : return "+proj=utm +zone=20 +south +ellps=aust_SA +units=m";
+ case 29191 : return "+proj=utm +zone=21 +south +ellps=aust_SA +units=m";
+ case 29192 : return "+proj=utm +zone=22 +south +ellps=aust_SA +units=m";
+ case 29193 : return "+proj=utm +zone=23 +south +ellps=aust_SA +units=m";
+ case 29194 : return "+proj=utm +zone=24 +south +ellps=aust_SA +units=m";
+ case 29195 : return "+proj=utm +zone=25 +south +ellps=aust_SA +units=m";
+ case 29220 : return "+proj=utm +zone=20 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m";
+ case 29221 : return "+proj=utm +zone=21 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m";
+ case 29333 : return "+proj=utm +zone=33 +south +ellps=bess_nam +units=m";
+ case 29635 : return "+proj=utm +zone=35 +a=6378249.2 +b=6356515 +units=m";
+ case 29636 : return "+proj=utm +zone=36 +a=6378249.2 +b=6356515 +units=m";
+ case 29700 : return "+proj=omerc +lat_0=-18.9 +lonc=44.10000000000001 +alpha=18.9 +k=0.9995000000000001 +x_0=400000 +y_0=800000 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +units=m";
+ case 29702 : return "+proj=omerc +lat_0=-18.9 +lonc=44.10000000000001 +alpha=18.9 +k=0.9995000000000001 +x_0=400000 +y_0=800000 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +units=m";
+ case 29738 : return "+proj=utm +zone=38 +south +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m";
+ case 29739 : return "+proj=utm +zone=39 +south +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m";
+ case 29849 : return "+proj=utm +zone=49 +ellps=evrstSS +units=m";
+ case 29850 : return "+proj=utm +zone=50 +ellps=evrstSS +units=m";
+ case 29871 : return "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.8714630401 +y_0=442857.653094361 +ellps=evrstSS +to_meter=20.11676512155263";
+ case 29872 : return "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.8727431979 +y_0=442857.6545573985 +ellps=evrstSS +to_meter=0.3047994715386762";
+ case 29873 : return "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 +k=0.99984 +x_0=590476.87 +y_0=442857.65 +ellps=evrstSS +units=m";
+ case 29900 : return "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m";
+ case 29901 : return "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1 +x_0=200000 +y_0=250000 +ellps=airy +towgs84=482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15 +units=m";
+ case 29902 : return "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m";
+ case 29903 : return "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +a=6377340.189 +b=6356034.447938534 +units=m";
+ case 30161 : return "+proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30162 : return "+proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30163 : return "+proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30164 : return "+proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30165 : return "+proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30166 : return "+proj=tmerc +lat_0=36 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30167 : return "+proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30168 : return "+proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30169 : return "+proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30170 : return "+proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30171 : return "+proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30172 : return "+proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30173 : return "+proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30174 : return "+proj=tmerc +lat_0=26 +lon_0=142 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30175 : return "+proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30176 : return "+proj=tmerc +lat_0=26 +lon_0=124 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30177 : return "+proj=tmerc +lat_0=26 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30178 : return "+proj=tmerc +lat_0=20 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30179 : return "+proj=tmerc +lat_0=26 +lon_0=154 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ case 30200 : return "+proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46392051999 +y_0=65379.0134283 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.201166195164";
+ case 30339 : return "+proj=utm +zone=39 +ellps=helmert +units=m";
+ case 30340 : return "+proj=utm +zone=40 +ellps=helmert +units=m";
+ case 30491 : return "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +units=m";
+ case 30492 : return "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-73,-247,227,0,0,0,0 +units=m";
+ case 30493 : return "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m";
+ case 30494 : return "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units=m";
+ case 30729 : return "+proj=utm +zone=29 +ellps=clrk80 +units=m";
+ case 30730 : return "+proj=utm +zone=30 +ellps=clrk80 +units=m";
+ case 30731 : return "+proj=utm +zone=31 +ellps=clrk80 +units=m";
+ case 30732 : return "+proj=utm +zone=32 +ellps=clrk80 +units=m";
+ case 30791 : return "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.999625544 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m";
+ case 30792 : return "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.999625769 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m";
+ case 30800 : return "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +units=m";
+ case 31028 : return "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +units=m";
+ case 31121 : return "+proj=utm +zone=21 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m";
+ case 31154 : return "+proj=tmerc +lat_0=0 +lon_0=-54 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m";
+ case 31170 : return "+proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.9996 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m";
+ case 31171 : return "+proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.9999 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m";
+ case 31251 : return "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +pm=ferro +units=m";
+ case 31252 : return "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +pm=ferro +units=m";
+ case 31253 : return "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +pm=ferro +units=m";
+ case 31254 : return "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31255 : return "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31256 : return "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31257 : return "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=150000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31258 : return "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31259 : return "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=750000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31265 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31266 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31267 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31268 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31275 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=5500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31276 : return "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=6500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31277 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31278 : return "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31279 : return "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=8500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31281 : return "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31282 : return "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31283 : return "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31284 : return "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=150000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31285 : return "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31286 : return "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=750000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31287 : return "+proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31288 : return "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=150000 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31289 : return "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=450000 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31290 : return "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=750000 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31291 : return "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31292 : return "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31293 : return "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m";
+ case 31294 : return "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=150000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31295 : return "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31296 : return "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=750000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31297 : return "+proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m";
+ case 31300 : return "+proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666666 +lat_0=90 +lon_0=4.356939722222222 +x_0=150000.01256 +y_0=5400088.4378 +ellps=intl +towgs84=106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1 +units=m";
+ case 31370 : return "+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1 +units=m";
+ case 31461 : return "+proj=tmerc +lat_0=0 +lon_0=3 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31462 : return "+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31463 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31464 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31465 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31466 : return "+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31467 : return "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31468 : return "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31469 : return "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m";
+ case 31528 : return "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m";
+ case 31529 : return "+proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,259,-9,0,0,0,0 +units=m";
+ case 31600 : return "+proj=sterea +lat_0=45.9 +lon_0=25.39246588888889 +k=0.9996667 +x_0=500000 +y_0=500000 +ellps=intl +units=m";
+ case 31700 : return "+proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000 +ellps=krass +units=m";
+ case 31838 : return "+proj=utm +zone=38 +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0,0,0,0 +units=m";
+ case 31839 : return "+proj=utm +zone=39 +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0,0,0,0 +units=m";
+ case 31900 : return "+proj=tmerc +lat_0=0 +lon_0=48 +k=0.9996 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 31901 : return "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m";
+ case 31965 : return "+proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31966 : return "+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31967 : return "+proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31968 : return "+proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31969 : return "+proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31970 : return "+proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31971 : return "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31972 : return "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31973 : return "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31974 : return "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31975 : return "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31976 : return "+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31977 : return "+proj=utm +zone=17 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31978 : return "+proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31979 : return "+proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31980 : return "+proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31981 : return "+proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31982 : return "+proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31983 : return "+proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31984 : return "+proj=utm +zone=24 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31985 : return "+proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31986 : return "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31987 : return "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31988 : return "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31989 : return "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31990 : return "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31991 : return "+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31992 : return "+proj=utm +zone=17 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31993 : return "+proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31994 : return "+proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31995 : return "+proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31996 : return "+proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31997 : return "+proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31998 : return "+proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 31999 : return "+proj=utm +zone=24 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 32000 : return "+proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ case 32001 : return "+proj=lcc +lat_1=48.71666666666667 +lat_2=47.85 +lat_0=47 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32002 : return "+proj=lcc +lat_1=47.88333333333333 +lat_2=46.45 +lat_0=45.83333333333334 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32003 : return "+proj=lcc +lat_1=46.4 +lat_2=44.86666666666667 +lat_0=44 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32005 : return "+proj=lcc +lat_1=41.85 +lat_2=42.81666666666667 +lat_0=41.33333333333334 +lon_0=-100 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32006 : return "+proj=lcc +lat_1=40.28333333333333 +lat_2=41.71666666666667 +lat_0=39.66666666666666 +lon_0=-99.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32007 : return "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32008 : return "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32009 : return "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32010 : return "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32011 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.66666666666667 +k=0.9999749999999999 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32012 : return "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32013 : return "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32014 : return "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32015 : return "+proj=tmerc +lat_0=40 +lon_0=-74.33333333333333 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32016 : return "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32017 : return "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32018 : return "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.5 +lon_0=-74 +x_0=304800.6096012192 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32019 : return "+proj=lcc +lat_1=34.33333333333334 +lat_2=36.16666666666666 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32020 : return "+proj=lcc +lat_1=47.43333333333333 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-100.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32021 : return "+proj=lcc +lat_1=46.18333333333333 +lat_2=47.48333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32022 : return "+proj=lcc +lat_1=40.43333333333333 +lat_2=41.7 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32023 : return "+proj=lcc +lat_1=38.73333333333333 +lat_2=40.03333333333333 +lat_0=38 +lon_0=-82.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32024 : return "+proj=lcc +lat_1=35.56666666666667 +lat_2=36.76666666666667 +lat_0=35 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32025 : return "+proj=lcc +lat_1=33.93333333333333 +lat_2=35.23333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32026 : return "+proj=lcc +lat_1=44.33333333333334 +lat_2=46 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32027 : return "+proj=lcc +lat_1=42.33333333333334 +lat_2=44 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32028 : return "+proj=lcc +lat_1=40.88333333333333 +lat_2=41.95 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32029 : return "+proj=lcc +lat_1=39.93333333333333 +lat_2=40.8 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32030 : return "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9999938 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32031 : return "+proj=lcc +lat_1=33.76666666666667 +lat_2=34.96666666666667 +lat_0=33 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32033 : return "+proj=lcc +lat_1=32.33333333333334 +lat_2=33.66666666666666 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32034 : return "+proj=lcc +lat_1=44.41666666666666 +lat_2=45.68333333333333 +lat_0=43.83333333333334 +lon_0=-100 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32035 : return "+proj=lcc +lat_1=42.83333333333334 +lat_2=44.4 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32036 : return "+proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=34.66666666666666 +lon_0=-86 +x_0=30480.06096012192 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32037 : return "+proj=lcc +lat_1=34.65 +lat_2=36.18333333333333 +lat_0=34 +lon_0=-101.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32038 : return "+proj=lcc +lat_1=32.13333333333333 +lat_2=33.96666666666667 +lat_0=31.66666666666667 +lon_0=-97.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32039 : return "+proj=lcc +lat_1=30.11666666666667 +lat_2=31.88333333333333 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32040 : return "+proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32041 : return "+proj=lcc +lat_1=26.16666666666667 +lat_2=27.83333333333333 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32042 : return "+proj=lcc +lat_1=40.71666666666667 +lat_2=41.78333333333333 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32043 : return "+proj=lcc +lat_1=39.01666666666667 +lat_2=40.65 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32044 : return "+proj=lcc +lat_1=37.21666666666667 +lat_2=38.35 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32045 : return "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32046 : return "+proj=lcc +lat_1=38.03333333333333 +lat_2=39.2 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32047 : return "+proj=lcc +lat_1=36.76666666666667 +lat_2=37.96666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32048 : return "+proj=lcc +lat_1=47.5 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-120.8333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32049 : return "+proj=lcc +lat_1=45.83333333333334 +lat_2=47.33333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32050 : return "+proj=lcc +lat_1=39 +lat_2=40.25 +lat_0=38.5 +lon_0=-79.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32051 : return "+proj=lcc +lat_1=37.48333333333333 +lat_2=38.88333333333333 +lat_0=37 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32052 : return "+proj=lcc +lat_1=45.56666666666667 +lat_2=46.76666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32053 : return "+proj=lcc +lat_1=44.25 +lat_2=45.5 +lat_0=43.83333333333334 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32054 : return "+proj=lcc +lat_1=42.73333333333333 +lat_2=44.06666666666667 +lat_0=42 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32055 : return "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-105.1666666666667 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32056 : return "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-107.3333333333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32057 : return "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-108.75 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32058 : return "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-110.0833333333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32061 : return "+proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32062 : return "+proj=lcc +lat_1=14.9 +lat_0=14.9 +lon_0=-90.33333333333333 +k_0=0.99989906 +x_0=500000 +y_0=325992.681 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32064 : return "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32065 : return "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32066 : return "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32067 : return "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32074 : return "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32075 : return "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32076 : return "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32077 : return "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32081 : return "+proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32082 : return "+proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32083 : return "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32084 : return "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32085 : return "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32086 : return "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32098 : return "+proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m";
+ case 32099 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-91.33333333333333 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ case 32100 : return "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32104 : return "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32107 : return "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32108 : return "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32109 : return "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32110 : return "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32111 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32112 : return "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32113 : return "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32114 : return "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32115 : return "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32116 : return "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32117 : return "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32118 : return "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32119 : return "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32120 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32121 : return "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32122 : return "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32123 : return "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32124 : return "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32125 : return "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32126 : return "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32127 : return "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32128 : return "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32129 : return "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32130 : return "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=100000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32133 : return "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32134 : return "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32135 : return "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32136 : return "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32137 : return "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32138 : return "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32139 : return "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32140 : return "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32141 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32142 : return "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32143 : return "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32144 : return "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32145 : return "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32146 : return "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32147 : return "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32148 : return "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32149 : return "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32150 : return "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32151 : return "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32152 : return "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32153 : return "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32154 : return "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32155 : return "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32156 : return "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32157 : return "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32158 : return "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32161 : return "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32164 : return "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 32165 : return "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 32166 : return "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 32167 : return "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192";
+ case 32180 : return "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32181 : return "+proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32182 : return "+proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32183 : return "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32184 : return "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32185 : return "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32186 : return "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32187 : return "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32188 : return "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32189 : return "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32190 : return "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32191 : return "+proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32192 : return "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32193 : return "+proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32194 : return "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32195 : return "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32196 : return "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32197 : return "+proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32198 : return "+proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32199 : return "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ case 32201 : return "+proj=utm +zone=1 +ellps=WGS72 +units=m";
+ case 32202 : return "+proj=utm +zone=2 +ellps=WGS72 +units=m";
+ case 32203 : return "+proj=utm +zone=3 +ellps=WGS72 +units=m";
+ case 32204 : return "+proj=utm +zone=4 +ellps=WGS72 +units=m";
+ case 32205 : return "+proj=utm +zone=5 +ellps=WGS72 +units=m";
+ case 32206 : return "+proj=utm +zone=6 +ellps=WGS72 +units=m";
+ case 32207 : return "+proj=utm +zone=7 +ellps=WGS72 +units=m";
+ case 32208 : return "+proj=utm +zone=8 +ellps=WGS72 +units=m";
+ case 32209 : return "+proj=utm +zone=9 +ellps=WGS72 +units=m";
+ case 32210 : return "+proj=utm +zone=10 +ellps=WGS72 +units=m";
+ case 32211 : return "+proj=utm +zone=11 +ellps=WGS72 +units=m";
+ case 32212 : return "+proj=utm +zone=12 +ellps=WGS72 +units=m";
+ case 32213 : return "+proj=utm +zone=13 +ellps=WGS72 +units=m";
+ case 32214 : return "+proj=utm +zone=14 +ellps=WGS72 +units=m";
+ case 32215 : return "+proj=utm +zone=15 +ellps=WGS72 +units=m";
+ case 32216 : return "+proj=utm +zone=16 +ellps=WGS72 +units=m";
+ case 32217 : return "+proj=utm +zone=17 +ellps=WGS72 +units=m";
+ case 32218 : return "+proj=utm +zone=18 +ellps=WGS72 +units=m";
+ case 32219 : return "+proj=utm +zone=19 +ellps=WGS72 +units=m";
+ case 32220 : return "+proj=utm +zone=20 +ellps=WGS72 +units=m";
+ case 32221 : return "+proj=utm +zone=21 +ellps=WGS72 +units=m";
+ case 32222 : return "+proj=utm +zone=22 +ellps=WGS72 +units=m";
+ case 32223 : return "+proj=utm +zone=23 +ellps=WGS72 +units=m";
+ case 32224 : return "+proj=utm +zone=24 +ellps=WGS72 +units=m";
+ case 32225 : return "+proj=utm +zone=25 +ellps=WGS72 +units=m";
+ case 32226 : return "+proj=utm +zone=26 +ellps=WGS72 +units=m";
+ case 32227 : return "+proj=utm +zone=27 +ellps=WGS72 +units=m";
+ case 32228 : return "+proj=utm +zone=28 +ellps=WGS72 +units=m";
+ case 32229 : return "+proj=utm +zone=29 +ellps=WGS72 +units=m";
+ case 32230 : return "+proj=utm +zone=30 +ellps=WGS72 +units=m";
+ case 32231 : return "+proj=utm +zone=31 +ellps=WGS72 +units=m";
+ case 32232 : return "+proj=utm +zone=32 +ellps=WGS72 +units=m";
+ case 32233 : return "+proj=utm +zone=33 +ellps=WGS72 +units=m";
+ case 32234 : return "+proj=utm +zone=34 +ellps=WGS72 +units=m";
+ case 32235 : return "+proj=utm +zone=35 +ellps=WGS72 +units=m";
+ case 32236 : return "+proj=utm +zone=36 +ellps=WGS72 +units=m";
+ case 32237 : return "+proj=utm +zone=37 +ellps=WGS72 +units=m";
+ case 32238 : return "+proj=utm +zone=38 +ellps=WGS72 +units=m";
+ case 32239 : return "+proj=utm +zone=39 +ellps=WGS72 +units=m";
+ case 32240 : return "+proj=utm +zone=40 +ellps=WGS72 +units=m";
+ case 32241 : return "+proj=utm +zone=41 +ellps=WGS72 +units=m";
+ case 32242 : return "+proj=utm +zone=42 +ellps=WGS72 +units=m";
+ case 32243 : return "+proj=utm +zone=43 +ellps=WGS72 +units=m";
+ case 32244 : return "+proj=utm +zone=44 +ellps=WGS72 +units=m";
+ case 32245 : return "+proj=utm +zone=45 +ellps=WGS72 +units=m";
+ case 32246 : return "+proj=utm +zone=46 +ellps=WGS72 +units=m";
+ case 32247 : return "+proj=utm +zone=47 +ellps=WGS72 +units=m";
+ case 32248 : return "+proj=utm +zone=48 +ellps=WGS72 +units=m";
+ case 32249 : return "+proj=utm +zone=49 +ellps=WGS72 +units=m";
+ case 32250 : return "+proj=utm +zone=50 +ellps=WGS72 +units=m";
+ case 32251 : return "+proj=utm +zone=51 +ellps=WGS72 +units=m";
+ case 32252 : return "+proj=utm +zone=52 +ellps=WGS72 +units=m";
+ case 32253 : return "+proj=utm +zone=53 +ellps=WGS72 +units=m";
+ case 32254 : return "+proj=utm +zone=54 +ellps=WGS72 +units=m";
+ case 32255 : return "+proj=utm +zone=55 +ellps=WGS72 +units=m";
+ case 32256 : return "+proj=utm +zone=56 +ellps=WGS72 +units=m";
+ case 32257 : return "+proj=utm +zone=57 +ellps=WGS72 +units=m";
+ case 32258 : return "+proj=utm +zone=58 +ellps=WGS72 +units=m";
+ case 32259 : return "+proj=utm +zone=59 +ellps=WGS72 +units=m";
+ case 32260 : return "+proj=utm +zone=60 +ellps=WGS72 +units=m";
+ case 32301 : return "+proj=utm +zone=1 +south +ellps=WGS72 +units=m";
+ case 32302 : return "+proj=utm +zone=2 +south +ellps=WGS72 +units=m";
+ case 32303 : return "+proj=utm +zone=3 +south +ellps=WGS72 +units=m";
+ case 32304 : return "+proj=utm +zone=4 +south +ellps=WGS72 +units=m";
+ case 32305 : return "+proj=utm +zone=5 +south +ellps=WGS72 +units=m";
+ case 32306 : return "+proj=utm +zone=6 +south +ellps=WGS72 +units=m";
+ case 32307 : return "+proj=utm +zone=7 +south +ellps=WGS72 +units=m";
+ case 32308 : return "+proj=utm +zone=8 +south +ellps=WGS72 +units=m";
+ case 32309 : return "+proj=utm +zone=9 +south +ellps=WGS72 +units=m";
+ case 32310 : return "+proj=utm +zone=10 +south +ellps=WGS72 +units=m";
+ case 32311 : return "+proj=utm +zone=11 +south +ellps=WGS72 +units=m";
+ case 32312 : return "+proj=utm +zone=12 +south +ellps=WGS72 +units=m";
+ case 32313 : return "+proj=utm +zone=13 +south +ellps=WGS72 +units=m";
+ case 32314 : return "+proj=utm +zone=14 +south +ellps=WGS72 +units=m";
+ case 32315 : return "+proj=utm +zone=15 +south +ellps=WGS72 +units=m";
+ case 32316 : return "+proj=utm +zone=16 +south +ellps=WGS72 +units=m";
+ case 32317 : return "+proj=utm +zone=17 +south +ellps=WGS72 +units=m";
+ case 32318 : return "+proj=utm +zone=18 +south +ellps=WGS72 +units=m";
+ case 32319 : return "+proj=utm +zone=19 +south +ellps=WGS72 +units=m";
+ case 32320 : return "+proj=utm +zone=20 +south +ellps=WGS72 +units=m";
+ case 32321 : return "+proj=utm +zone=21 +south +ellps=WGS72 +units=m";
+ case 32322 : return "+proj=utm +zone=22 +south +ellps=WGS72 +units=m";
+ case 32323 : return "+proj=utm +zone=23 +south +ellps=WGS72 +units=m";
+ case 32324 : return "+proj=utm +zone=24 +south +ellps=WGS72 +units=m";
+ case 32325 : return "+proj=utm +zone=25 +south +ellps=WGS72 +units=m";
+ case 32326 : return "+proj=utm +zone=26 +south +ellps=WGS72 +units=m";
+ case 32327 : return "+proj=utm +zone=27 +south +ellps=WGS72 +units=m";
+ case 32328 : return "+proj=utm +zone=28 +south +ellps=WGS72 +units=m";
+ case 32329 : return "+proj=utm +zone=29 +south +ellps=WGS72 +units=m";
+ case 32330 : return "+proj=utm +zone=30 +south +ellps=WGS72 +units=m";
+ case 32331 : return "+proj=utm +zone=31 +south +ellps=WGS72 +units=m";
+ case 32332 : return "+proj=utm +zone=32 +south +ellps=WGS72 +units=m";
+ case 32333 : return "+proj=utm +zone=33 +south +ellps=WGS72 +units=m";
+ case 32334 : return "+proj=utm +zone=34 +south +ellps=WGS72 +units=m";
+ case 32335 : return "+proj=utm +zone=35 +south +ellps=WGS72 +units=m";
+ case 32336 : return "+proj=utm +zone=36 +south +ellps=WGS72 +units=m";
+ case 32337 : return "+proj=utm +zone=37 +south +ellps=WGS72 +units=m";
+ case 32338 : return "+proj=utm +zone=38 +south +ellps=WGS72 +units=m";
+ case 32339 : return "+proj=utm +zone=39 +south +ellps=WGS72 +units=m";
+ case 32340 : return "+proj=utm +zone=40 +south +ellps=WGS72 +units=m";
+ case 32341 : return "+proj=utm +zone=41 +south +ellps=WGS72 +units=m";
+ case 32342 : return "+proj=utm +zone=42 +south +ellps=WGS72 +units=m";
+ case 32343 : return "+proj=utm +zone=43 +south +ellps=WGS72 +units=m";
+ case 32344 : return "+proj=utm +zone=44 +south +ellps=WGS72 +units=m";
+ case 32345 : return "+proj=utm +zone=45 +south +ellps=WGS72 +units=m";
+ case 32346 : return "+proj=utm +zone=46 +south +ellps=WGS72 +units=m";
+ case 32347 : return "+proj=utm +zone=47 +south +ellps=WGS72 +units=m";
+ case 32348 : return "+proj=utm +zone=48 +south +ellps=WGS72 +units=m";
+ case 32349 : return "+proj=utm +zone=49 +south +ellps=WGS72 +units=m";
+ case 32350 : return "+proj=utm +zone=50 +south +ellps=WGS72 +units=m";
+ case 32351 : return "+proj=utm +zone=51 +south +ellps=WGS72 +units=m";
+ case 32352 : return "+proj=utm +zone=52 +south +ellps=WGS72 +units=m";
+ case 32353 : return "+proj=utm +zone=53 +south +ellps=WGS72 +units=m";
+ case 32354 : return "+proj=utm +zone=54 +south +ellps=WGS72 +units=m";
+ case 32355 : return "+proj=utm +zone=55 +south +ellps=WGS72 +units=m";
+ case 32356 : return "+proj=utm +zone=56 +south +ellps=WGS72 +units=m";
+ case 32357 : return "+proj=utm +zone=57 +south +ellps=WGS72 +units=m";
+ case 32358 : return "+proj=utm +zone=58 +south +ellps=WGS72 +units=m";
+ case 32359 : return "+proj=utm +zone=59 +south +ellps=WGS72 +units=m";
+ case 32360 : return "+proj=utm +zone=60 +south +ellps=WGS72 +units=m";
+ case 32401 : return "+proj=utm +zone=1 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32402 : return "+proj=utm +zone=2 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32403 : return "+proj=utm +zone=3 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32404 : return "+proj=utm +zone=4 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32405 : return "+proj=utm +zone=5 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32406 : return "+proj=utm +zone=6 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32407 : return "+proj=utm +zone=7 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32408 : return "+proj=utm +zone=8 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32409 : return "+proj=utm +zone=9 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32410 : return "+proj=utm +zone=10 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32411 : return "+proj=utm +zone=11 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32412 : return "+proj=utm +zone=12 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32413 : return "+proj=utm +zone=13 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32414 : return "+proj=utm +zone=14 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32415 : return "+proj=utm +zone=15 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32416 : return "+proj=utm +zone=16 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32417 : return "+proj=utm +zone=17 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32418 : return "+proj=utm +zone=18 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32419 : return "+proj=utm +zone=19 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32420 : return "+proj=utm +zone=20 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32421 : return "+proj=utm +zone=21 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32422 : return "+proj=utm +zone=22 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32423 : return "+proj=utm +zone=23 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32424 : return "+proj=utm +zone=24 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32425 : return "+proj=utm +zone=25 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32426 : return "+proj=utm +zone=26 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32427 : return "+proj=utm +zone=27 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32428 : return "+proj=utm +zone=28 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32429 : return "+proj=utm +zone=29 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32430 : return "+proj=utm +zone=30 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32431 : return "+proj=utm +zone=31 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32432 : return "+proj=utm +zone=32 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32433 : return "+proj=utm +zone=33 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32434 : return "+proj=utm +zone=34 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32435 : return "+proj=utm +zone=35 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32436 : return "+proj=utm +zone=36 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32437 : return "+proj=utm +zone=37 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32438 : return "+proj=utm +zone=38 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32439 : return "+proj=utm +zone=39 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32440 : return "+proj=utm +zone=40 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32441 : return "+proj=utm +zone=41 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32442 : return "+proj=utm +zone=42 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32443 : return "+proj=utm +zone=43 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32444 : return "+proj=utm +zone=44 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32445 : return "+proj=utm +zone=45 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32446 : return "+proj=utm +zone=46 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32447 : return "+proj=utm +zone=47 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32448 : return "+proj=utm +zone=48 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32449 : return "+proj=utm +zone=49 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32450 : return "+proj=utm +zone=50 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32451 : return "+proj=utm +zone=51 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32452 : return "+proj=utm +zone=52 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32453 : return "+proj=utm +zone=53 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32454 : return "+proj=utm +zone=54 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32455 : return "+proj=utm +zone=55 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32456 : return "+proj=utm +zone=56 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32457 : return "+proj=utm +zone=57 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32458 : return "+proj=utm +zone=58 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32459 : return "+proj=utm +zone=59 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32460 : return "+proj=utm +zone=60 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32501 : return "+proj=utm +zone=1 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32502 : return "+proj=utm +zone=2 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32503 : return "+proj=utm +zone=3 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32504 : return "+proj=utm +zone=4 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32505 : return "+proj=utm +zone=5 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32506 : return "+proj=utm +zone=6 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32507 : return "+proj=utm +zone=7 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32508 : return "+proj=utm +zone=8 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32509 : return "+proj=utm +zone=9 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32510 : return "+proj=utm +zone=10 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32511 : return "+proj=utm +zone=11 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32512 : return "+proj=utm +zone=12 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32513 : return "+proj=utm +zone=13 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32514 : return "+proj=utm +zone=14 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32515 : return "+proj=utm +zone=15 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32516 : return "+proj=utm +zone=16 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32517 : return "+proj=utm +zone=17 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32518 : return "+proj=utm +zone=18 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32519 : return "+proj=utm +zone=19 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32520 : return "+proj=utm +zone=20 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32521 : return "+proj=utm +zone=21 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32522 : return "+proj=utm +zone=22 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32523 : return "+proj=utm +zone=23 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32524 : return "+proj=utm +zone=24 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32525 : return "+proj=utm +zone=25 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32526 : return "+proj=utm +zone=26 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32527 : return "+proj=utm +zone=27 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32528 : return "+proj=utm +zone=28 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32529 : return "+proj=utm +zone=29 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32530 : return "+proj=utm +zone=30 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32531 : return "+proj=utm +zone=31 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32532 : return "+proj=utm +zone=32 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32533 : return "+proj=utm +zone=33 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32534 : return "+proj=utm +zone=34 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32535 : return "+proj=utm +zone=35 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32536 : return "+proj=utm +zone=36 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32537 : return "+proj=utm +zone=37 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32538 : return "+proj=utm +zone=38 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32539 : return "+proj=utm +zone=39 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32540 : return "+proj=utm +zone=40 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32541 : return "+proj=utm +zone=41 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32542 : return "+proj=utm +zone=42 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32543 : return "+proj=utm +zone=43 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32544 : return "+proj=utm +zone=44 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32545 : return "+proj=utm +zone=45 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32546 : return "+proj=utm +zone=46 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32547 : return "+proj=utm +zone=47 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32548 : return "+proj=utm +zone=48 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32549 : return "+proj=utm +zone=49 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32550 : return "+proj=utm +zone=50 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32551 : return "+proj=utm +zone=51 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32552 : return "+proj=utm +zone=52 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32553 : return "+proj=utm +zone=53 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32554 : return "+proj=utm +zone=54 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32555 : return "+proj=utm +zone=55 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32556 : return "+proj=utm +zone=56 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32557 : return "+proj=utm +zone=57 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32558 : return "+proj=utm +zone=58 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32559 : return "+proj=utm +zone=59 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32560 : return "+proj=utm +zone=60 +south +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m";
+ case 32601 : return "+proj=utm +zone=1 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32602 : return "+proj=utm +zone=2 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32603 : return "+proj=utm +zone=3 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32604 : return "+proj=utm +zone=4 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32605 : return "+proj=utm +zone=5 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32606 : return "+proj=utm +zone=6 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32607 : return "+proj=utm +zone=7 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32608 : return "+proj=utm +zone=8 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32609 : return "+proj=utm +zone=9 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32610 : return "+proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32611 : return "+proj=utm +zone=11 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32612 : return "+proj=utm +zone=12 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32613 : return "+proj=utm +zone=13 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32614 : return "+proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32615 : return "+proj=utm +zone=15 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32616 : return "+proj=utm +zone=16 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32617 : return "+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32618 : return "+proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32619 : return "+proj=utm +zone=19 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32620 : return "+proj=utm +zone=20 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32621 : return "+proj=utm +zone=21 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32622 : return "+proj=utm +zone=22 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32623 : return "+proj=utm +zone=23 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32624 : return "+proj=utm +zone=24 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32625 : return "+proj=utm +zone=25 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32626 : return "+proj=utm +zone=26 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32627 : return "+proj=utm +zone=27 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32628 : return "+proj=utm +zone=28 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32629 : return "+proj=utm +zone=29 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32630 : return "+proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32631 : return "+proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32632 : return "+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32633 : return "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32634 : return "+proj=utm +zone=34 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32635 : return "+proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32636 : return "+proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32637 : return "+proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32638 : return "+proj=utm +zone=38 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32639 : return "+proj=utm +zone=39 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32640 : return "+proj=utm +zone=40 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32641 : return "+proj=utm +zone=41 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32642 : return "+proj=utm +zone=42 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32643 : return "+proj=utm +zone=43 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32644 : return "+proj=utm +zone=44 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32645 : return "+proj=utm +zone=45 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32646 : return "+proj=utm +zone=46 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32647 : return "+proj=utm +zone=47 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32648 : return "+proj=utm +zone=48 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32649 : return "+proj=utm +zone=49 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32650 : return "+proj=utm +zone=50 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32651 : return "+proj=utm +zone=51 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32652 : return "+proj=utm +zone=52 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32653 : return "+proj=utm +zone=53 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32654 : return "+proj=utm +zone=54 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32655 : return "+proj=utm +zone=55 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32656 : return "+proj=utm +zone=56 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32657 : return "+proj=utm +zone=57 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32658 : return "+proj=utm +zone=58 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32659 : return "+proj=utm +zone=59 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32660 : return "+proj=utm +zone=60 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32661 : return "+proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32662 : return "+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32664 : return "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +to_meter=0.3048006096012192";
+ case 32665 : return "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +to_meter=0.3048006096012192";
+ case 32666 : return "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +to_meter=0.3048006096012192";
+ case 32667 : return "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.001016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +to_meter=0.3048006096012192";
+ case 32701 : return "+proj=utm +zone=1 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32702 : return "+proj=utm +zone=2 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32703 : return "+proj=utm +zone=3 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32704 : return "+proj=utm +zone=4 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32705 : return "+proj=utm +zone=5 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32706 : return "+proj=utm +zone=6 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32707 : return "+proj=utm +zone=7 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32708 : return "+proj=utm +zone=8 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32709 : return "+proj=utm +zone=9 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32710 : return "+proj=utm +zone=10 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32711 : return "+proj=utm +zone=11 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32712 : return "+proj=utm +zone=12 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32713 : return "+proj=utm +zone=13 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32714 : return "+proj=utm +zone=14 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32715 : return "+proj=utm +zone=15 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32716 : return "+proj=utm +zone=16 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32717 : return "+proj=utm +zone=17 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32718 : return "+proj=utm +zone=18 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32719 : return "+proj=utm +zone=19 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32720 : return "+proj=utm +zone=20 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32721 : return "+proj=utm +zone=21 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32722 : return "+proj=utm +zone=22 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32723 : return "+proj=utm +zone=23 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32724 : return "+proj=utm +zone=24 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32725 : return "+proj=utm +zone=25 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32726 : return "+proj=utm +zone=26 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32727 : return "+proj=utm +zone=27 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32728 : return "+proj=utm +zone=28 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32729 : return "+proj=utm +zone=29 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32730 : return "+proj=utm +zone=30 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32731 : return "+proj=utm +zone=31 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32732 : return "+proj=utm +zone=32 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32733 : return "+proj=utm +zone=33 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32734 : return "+proj=utm +zone=34 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32735 : return "+proj=utm +zone=35 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32736 : return "+proj=utm +zone=36 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32737 : return "+proj=utm +zone=37 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32738 : return "+proj=utm +zone=38 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32739 : return "+proj=utm +zone=39 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32740 : return "+proj=utm +zone=40 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32741 : return "+proj=utm +zone=41 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32742 : return "+proj=utm +zone=42 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32743 : return "+proj=utm +zone=43 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32744 : return "+proj=utm +zone=44 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32745 : return "+proj=utm +zone=45 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32746 : return "+proj=utm +zone=46 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32747 : return "+proj=utm +zone=47 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32748 : return "+proj=utm +zone=48 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32749 : return "+proj=utm +zone=49 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32750 : return "+proj=utm +zone=50 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32751 : return "+proj=utm +zone=51 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32752 : return "+proj=utm +zone=52 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32753 : return "+proj=utm +zone=53 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32754 : return "+proj=utm +zone=54 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32755 : return "+proj=utm +zone=55 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32756 : return "+proj=utm +zone=56 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32757 : return "+proj=utm +zone=57 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32758 : return "+proj=utm +zone=58 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32759 : return "+proj=utm +zone=59 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32760 : return "+proj=utm +zone=60 +south +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32761 : return "+proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m";
+ case 32766 : return "+proj=tmerc +lat_0=0 +lon_0=36 +k=0.9996 +x_0=500000 +y_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m";
+ }
+ return "";
+ }
+
+ }
+ #endif // DOXYGEN_NO_IMPL
+
+ // Overloaded function
+ parameters init(int epsg_code)
+ {
+ std::string args = impl::code_to_string(epsg_code);
+ return impl::pj_init_plus(args, false);
+ }
+
+}
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/epsg_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/epsg_traits.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,40 @@
+#ifndef _PROJECTIONS_EPSG_TRAITS_HPP
+#define _PROJECTIONS_EPSG_TRAITS_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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/projections/impl/projects.hpp"
+
+
+namespace projection
+{
+ /*!
+ \brief EPSG traits
+ \details With help of the EPSG traits library users can statically use projections
+ or coordinate systems specifying an EPSG code. The correct projections for transformations
+ are used automically then, still keeping static polymorphism.
+ \ingroup projection
+ \tparam EPSG epsg code
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type, normally not specified
+ */
+ template <size_t EPSG, typename LLR, typename XY, typename PAR = parameters>
+ struct epsg_traits
+ {
+ // Specializations define:
+ // - type to get projection type
+ // - function par to get parameters
+ };
+
+}
+
+#endif
+

Added: sandbox/ggl/boost/ggl/geometry/projections/factory.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/factory.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,242 @@
+#ifndef _PROJECTIONS_FACTORY_HPP
+#define _PROJECTIONS_FACTORY_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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/projections/parameters.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+#include <geometry/projections/proj/aea.hpp>
+#include <geometry/projections/proj/aeqd.hpp>
+#include <geometry/projections/proj/airy.hpp>
+#include <geometry/projections/proj/aitoff.hpp>
+#include <geometry/projections/proj/august.hpp>
+#include <geometry/projections/proj/bacon.hpp>
+#include <geometry/projections/proj/bipc.hpp>
+#include <geometry/projections/proj/boggs.hpp>
+#include <geometry/projections/proj/bonne.hpp>
+#include <geometry/projections/proj/cass.hpp>
+#include <geometry/projections/proj/cc.hpp>
+#include <geometry/projections/proj/cea.hpp>
+#include <geometry/projections/proj/chamb.hpp> // control points XY
+#include <geometry/projections/proj/collg.hpp>
+#include <geometry/projections/proj/crast.hpp>
+#include <geometry/projections/proj/denoy.hpp>
+#include <geometry/projections/proj/eck1.hpp>
+#include <geometry/projections/proj/eck2.hpp>
+#include <geometry/projections/proj/eck3.hpp>
+#include <geometry/projections/proj/eck4.hpp>
+#include <geometry/projections/proj/eck5.hpp>
+#include <geometry/projections/proj/eqc.hpp>
+#include <geometry/projections/proj/eqdc.hpp>
+#include <geometry/projections/proj/fahey.hpp>
+#include <geometry/projections/proj/fouc_s.hpp>
+#include <geometry/projections/proj/gall.hpp>
+#include <geometry/projections/proj/geocent.hpp>
+#include <geometry/projections/proj/geos.hpp>
+#include <geometry/projections/proj/gins8.hpp>
+#include <geometry/projections/proj/gn_sinu.hpp>
+#include <geometry/projections/proj/gnom.hpp>
+#include <geometry/projections/proj/goode.hpp> // includes two other projections
+#include <geometry/projections/proj/gstmerc.hpp>
+#include <geometry/projections/proj/hammer.hpp>
+#include <geometry/projections/proj/hatano.hpp>
+#include <geometry/projections/proj/krovak.hpp>
+#include <geometry/projections/proj/imw_p.hpp> // xy functions after inverse
+#include <geometry/projections/proj/laea.hpp>
+#include <geometry/projections/proj/labrd.hpp>
+#include <geometry/projections/proj/lagrng.hpp>
+#include <geometry/projections/proj/larr.hpp>
+#include <geometry/projections/proj/lask.hpp>
+#include <geometry/projections/proj/latlong.hpp>
+#include <geometry/projections/proj/lcc.hpp>
+#include <geometry/projections/proj/lcca.hpp>
+#include <geometry/projections/proj/loxim.hpp>
+#include <geometry/projections/proj/lsat.hpp>
+#include <geometry/projections/proj/mbtfpp.hpp>
+#include <geometry/projections/proj/mbtfpq.hpp>
+#include <geometry/projections/proj/mbt_fps.hpp>
+#include <geometry/projections/proj/merc.hpp>
+#include <geometry/projections/proj/mill.hpp>
+#include <geometry/projections/proj/mod_ster.hpp>
+#include <geometry/projections/proj/moll.hpp>
+#include <geometry/projections/proj/nell.hpp>
+#include <geometry/projections/proj/nell_h.hpp>
+#include <geometry/projections/proj/nocol.hpp>
+#include <geometry/projections/proj/nsper.hpp>
+#include <geometry/projections/proj/nzmg.hpp>
+#include <geometry/projections/proj/ob_tran.hpp> // includes other projection
+#include <geometry/projections/proj/ocea.hpp>
+#include <geometry/projections/proj/oea.hpp>
+#include <geometry/projections/proj/omerc.hpp>
+#include <geometry/projections/proj/ortho.hpp>
+#include <geometry/projections/proj/poly.hpp>
+#include <geometry/projections/proj/putp2.hpp>
+#include <geometry/projections/proj/putp3.hpp>
+#include <geometry/projections/proj/putp4p.hpp>
+#include <geometry/projections/proj/putp5.hpp>
+#include <geometry/projections/proj/putp6.hpp>
+#include <geometry/projections/proj/robin.hpp>
+#include <geometry/projections/proj/rouss.hpp>
+#include <geometry/projections/proj/rpoly.hpp>
+#include <geometry/projections/proj/sconics.hpp>
+#include <geometry/projections/proj/somerc.hpp>
+#include <geometry/projections/proj/stere.hpp>
+#include <geometry/projections/proj/sterea.hpp>
+#include <geometry/projections/proj/sts.hpp>
+#include <geometry/projections/proj/tcc.hpp>
+#include <geometry/projections/proj/tcea.hpp>
+#include <geometry/projections/proj/tmerc.hpp>
+#include <geometry/projections/proj/tpeqd.hpp>
+#include <geometry/projections/proj/urm5.hpp>
+#include <geometry/projections/proj/urmfps.hpp>
+#include <geometry/projections/proj/vandg.hpp>
+#include <geometry/projections/proj/vandg2.hpp>
+#include <geometry/projections/proj/vandg4.hpp>
+#include <geometry/projections/proj/wag2.hpp>
+#include <geometry/projections/proj/wag3.hpp>
+#include <geometry/projections/proj/wag7.hpp>
+#include <geometry/projections/proj/wink1.hpp>
+#include <geometry/projections/proj/wink2.hpp>
+
+#include <boost/shared_ptr.hpp>
+
+#include <map>
+
+namespace projection
+{
+ template <typename LL, typename XY, typename PAR = parameters>
+ class factory : public impl::base_factory<LL, XY, PAR>
+ {
+ private :
+ typedef std::map<std::string, boost::shared_ptr<impl::factory_entry<LL, XY, PAR> > > MAP;
+ MAP m_registry;
+
+ public :
+ factory()
+ {
+ impl::aea_init(*this);
+ impl::aeqd_init(*this);
+ impl::airy_init(*this);
+ impl::aitoff_init(*this);
+ impl::august_init(*this);
+ impl::bacon_init(*this);
+ impl::bipc_init(*this);
+ impl::boggs_init(*this);
+ impl::bonne_init(*this);
+ impl::cass_init(*this);
+ impl::cc_init(*this);
+ impl::cea_init(*this);
+ impl::chamb_init(*this);
+ impl::collg_init(*this);
+ impl::crast_init(*this);
+ impl::denoy_init(*this);
+ impl::eck1_init(*this);
+ impl::eck2_init(*this);
+ impl::eck3_init(*this);
+ impl::eck4_init(*this);
+ impl::eck5_init(*this);
+ impl::eqc_init(*this);
+ impl::eqdc_init(*this);
+ impl::fahey_init(*this);
+ impl::fouc_s_init(*this);
+ impl::gall_init(*this);
+ impl::geocent_init(*this);
+ impl::geos_init(*this);
+ impl::gins8_init(*this);
+ impl::gn_sinu_init(*this);
+ impl::gnom_init(*this);
+ impl::goode_init(*this);
+ impl::gstmerc_init(*this);
+ impl::hammer_init(*this);
+ impl::hatano_init(*this);
+ impl::krovak_init(*this);
+ impl::imw_p_init(*this);
+ impl::labrd_init(*this);
+ impl::laea_init(*this);
+ impl::lagrng_init(*this);
+ impl::larr_init(*this);
+ impl::lask_init(*this);
+ impl::latlong_init(*this);
+ impl::lcc_init(*this);
+ impl::lcca_init(*this);
+ impl::loxim_init(*this);
+ impl::lsat_init(*this);
+ impl::mbtfpp_init(*this);
+ impl::mbtfpq_init(*this);
+ impl::mbt_fps_init(*this);
+ impl::merc_init(*this);
+ impl::mill_init(*this);
+ impl::mod_ster_init(*this);
+ impl::moll_init(*this);
+ impl::nell_init(*this);
+ impl::nell_h_init(*this);
+ impl::nocol_init(*this);
+ impl::nsper_init(*this);
+ impl::nzmg_init(*this);
+ impl::ob_tran_init(*this);
+ impl::ocea_init(*this);
+ impl::oea_init(*this);
+ impl::omerc_init(*this);
+ impl::ortho_init(*this);
+ impl::poly_init(*this);
+ impl::putp2_init(*this);
+ impl::putp3_init(*this);
+ impl::putp4p_init(*this);
+ impl::putp5_init(*this);
+ impl::putp6_init(*this);
+ impl::robin_init(*this);
+ impl::rouss_init(*this);
+ impl::rpoly_init(*this);
+ impl::sconics_init(*this);
+ impl::somerc_init(*this);
+ impl::stere_init(*this);
+ impl::sterea_init(*this);
+ impl::sts_init(*this);
+ impl::tcc_init(*this);
+ impl::tcea_init(*this);
+ impl::tmerc_init(*this);
+ impl::tpeqd_init(*this);
+ impl::urm5_init(*this);
+ impl::urmfps_init(*this);
+ impl::vandg_init(*this);
+ impl::vandg2_init(*this);
+ impl::vandg4_init(*this);
+ impl::wag2_init(*this);
+ impl::wag3_init(*this);
+ impl::wag7_init(*this);
+ impl::wink1_init(*this);
+ impl::wink2_init(*this);
+ }
+
+ virtual ~factory() {}
+
+ virtual void add_to_factory(const std::string& name, impl::factory_entry<LL, XY, PAR>* sub)
+ {
+ m_registry[name].reset(sub);
+ }
+
+ inline projection<LL, XY>* create_new(const PAR& parameters)
+ {
+ typename MAP::iterator it = m_registry.find(parameters.name);
+ if (it != m_registry.end())
+ {
+ return it->second->create_new(parameters);
+ }
+ return NULL;
+ }
+
+
+ };
+
+
+};
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/aasincos.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/aasincos.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,80 @@
+#ifndef _PROJECTIONS_AASINCOS_HPP
+#define _PROJECTIONS_AASINCOS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+namespace projection
+{
+ namespace impl
+ {
+ namespace aasincos
+ {
+ static const double ONE_TOL= 1.00000000000001;
+ //static const double TOL = 0.000000001;
+ static const double ATOL = 1e-50;
+ }
+
+ double
+ aasin(double v) {
+ double av;
+
+ if ((av = fabs(v)) >= 1.) {
+ if (av > aasincos::ONE_TOL)
+ throw proj_exception(-19);
+ return (v < 0. ? -HALFPI : HALFPI);
+ }
+ return asin(v);
+ }
+ double
+ aacos(double v) {
+ double av;
+
+ if ((av = fabs(v)) >= 1.) {
+ if (av > aasincos::ONE_TOL)
+ throw proj_exception(-19);
+ return (v < 0. ? PI : 0.);
+ }
+ return acos(v);
+ }
+ double
+ asqrt(double v) { return ((v <= 0) ? 0. : sqrt(v)); }
+ double
+ aatan2(double n, double d) {
+ return ((fabs(n) < aasincos::ATOL && fabs(d) < aasincos::ATOL) ? 0. : atan2(n,d));
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/adjlon.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/adjlon.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,58 @@
+#ifndef _PROJECTIONS_ADJLON_HPP
+#define _PROJECTIONS_ADJLON_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/projects.hpp>
+
+namespace projection
+{
+ namespace impl
+ {
+ /* reduce argument to range +/- PI */
+ inline double adjlon (double lon)
+ {
+ static const double SPI = 3.14159265359;
+ static const double TWOPI = 6.2831853071795864769;
+ static const double ONEPI = 3.14159265358979323846;
+ if (fabs(lon) <= SPI) return( lon );
+ lon += ONEPI; /* adjust to 0..2pi rad */
+ lon -= TWOPI * floor(lon / TWOPI); /* remove integral # of 'revolutions'*/
+ lon -= ONEPI; /* adjust back to -pi..pi rad */
+ return( lon );
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/base_dynamic.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/base_dynamic.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,88 @@
+#ifndef _PROJECTIONS_BASE_DYNAMIC_HPP
+#define _PROJECTIONS_BASE_DYNAMIC_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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/projections/projection.hpp>
+
+
+namespace projection
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ // Base-virtual-forward
+ template <typename C, typename LL, typename XY, typename PAR>
+ class base_v_f : public projection<LL, XY>
+ {
+ protected :
+ typedef typename projection<LL, XY>::LL_T LL_T;
+ typedef typename projection<LL, XY>::XY_T XY_T;
+ C m_proj;
+
+ public :
+ base_v_f(const PAR& par) : m_proj(par) {}
+
+ virtual bool forward(const LL& ll, XY& xy) const
+ {
+ return m_proj.forward(ll, xy);
+ }
+ virtual void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ m_proj.fwd(lp_lon, lp_lat, xy_x, xy_y);
+ }
+
+ virtual bool inverse(const XY& xy, LL& ll) const
+ {
+ // exception?
+ return false;
+ }
+ virtual void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ // exception?
+ }
+
+ virtual std::string name() const
+ {
+ return m_proj.name();
+ }
+
+ };
+
+ // Base-virtual-forward/inverse
+ template <typename C, typename LL, typename XY, typename PAR>
+ class base_v_fi : public base_v_f<C, LL, XY, PAR>
+ {
+ typedef typename base_v_f<C, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_v_f<C, LL, XY, PAR>::XY_T XY_T;
+
+ public :
+ base_v_fi(const PAR& par) : base_v_f<C, LL, XY, PAR>(par) {}
+
+ virtual bool inverse(const XY& xy, LL& ll) const
+ {
+ return this->m_proj.inverse(xy, ll);
+ }
+ void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ this->m_proj.inv(xy_x, xy_y, lp_lon, lp_lat);
+ }
+
+ };
+ }
+ #endif
+
+}
+
+
+
+#endif
+

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/base_static.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/base_static.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,85 @@
+#ifndef _PROJECTIONS_BASE_STATIC_HPP
+#define _PROJECTIONS_BASE_STATIC_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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/projections/impl/pj_fwd.hpp>
+#include <geometry/projections/impl/pj_inv.hpp>
+
+
+namespace projection
+{
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ // Base-template-forward
+ template <typename PRJ, typename LL, typename XY, typename PAR>
+ struct base_t_f
+ {
+ protected :
+ // some projections do not work with float -> wrong results
+ // todo: make traits which select <double> from int/float/double and else selects T
+
+ //typedef typename geometry::coordinate_type<LL>::type LL_T;
+ //typedef typename geometry::coordinate_type<XY>::type XY_T;
+ typedef double LL_T;
+ typedef double XY_T;
+ PAR m_par;
+ const PRJ& m_prj;
+
+ public :
+ inline base_t_f(const PRJ& prj, const PAR& par) : m_par(par), m_prj(prj) {}
+ inline bool forward(const LL& lp, XY& xy) const
+ {
+ try
+ {
+ pj_fwd(m_prj, m_par, lp, xy);
+ return true;
+ }
+ catch(...)
+ {
+ return false;
+ }
+ }
+
+ inline std::string name() const { return this->m_par.name; }
+
+ };
+
+ // Base-template-forward/inverse
+ template <typename PRJ, typename LL, typename XY, typename PAR>
+ struct base_t_fi : public base_t_f<PRJ, LL, XY, PAR>
+ {
+ public :
+ inline base_t_fi(const PRJ& prj, const PAR& par) : base_t_f<PRJ, LL, XY, PAR>(prj, par) {}
+
+ inline bool inverse(const XY& xy, LL& lp) const
+ {
+ try
+ {
+ pj_inv(this->m_prj, this->m_par, xy, lp);
+ return true;
+ }
+ catch(...)
+ {
+ return false;
+ }
+ }
+ };
+ }
+ #endif
+
+}
+
+
+
+#endif
+

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/factory_entry.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/factory_entry.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,43 @@
+#ifndef _PROJECTIONS_FACTORY_ENTRY_HPP
+#define _PROJECTIONS_FACTORY_ENTRY_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 <string>
+
+
+#include <geometry/projections/projection.hpp>
+
+
+namespace projection
+{
+ namespace impl
+ {
+ template <typename LL, typename XY, typename PAR>
+ class factory_entry
+ {
+ public :
+ virtual ~factory_entry() {}
+ virtual projection<LL, XY>* create_new(const PAR& par) const = 0;
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class base_factory
+ {
+ public :
+ virtual ~base_factory() {}
+ virtual void add_to_factory(const std::string& name, factory_entry<LL, XY, PAR>* sub) = 0;
+ };
+
+ }
+
+}
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/function_overloads.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/function_overloads.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,37 @@
+#ifndef _PROJECTIONS_FUNCTION_OVERLOADS_HPP
+#define _PROJECTIONS_FUNCTION_OVERLOADS_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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)
+
+
+
+namespace projection
+{
+
+ // Functions to resolve ambiguity when compiling with coordinates of different types
+ /*inline double atan2(double a, double b)
+ {
+ return ::atan2(a, b);
+ }
+ inline double pow(double a, double b)
+ {
+ return ::pow(a, b);
+ }
+ */
+
+ inline int int_floor(double f)
+ {
+ return int(::floor(f));
+ }
+
+}
+
+
+#endif
+

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_auth.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_auth.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,75 @@
+#ifndef _PROJECTIONS_PJ_AUTH_HPP
+#define _PROJECTIONS_PJ_AUTH_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+namespace projection
+{
+ namespace impl
+ {
+ static const double P00 = .33333333333333333333;
+ static const double P01 = .17222222222222222222;
+ static const double P02 = .10257936507936507936;
+ static const double P10 = .06388888888888888888;
+ static const double P11 = .06640211640211640211;
+ static const double P20 = .01641501294219154443;
+ static const int APA_SIZE = 3;
+
+ /* determine latitude from authalic latitude */
+ inline void pj_authset(double es, double* APA)
+ {
+ double t;
+
+ // if (APA = (double *)pj_malloc(APA_SIZE * sizeof(double)))
+ {
+ APA[0] = es * P00;
+ t = es * es;
+ APA[0] += t * P01;
+ APA[1] = t * P10;
+ t *= es;
+ APA[0] += t * P02;
+ APA[1] += t * P11;
+ APA[2] = t * P20;
+ }
+ }
+ inline double pj_authlat(double beta, const double *APA)
+ {
+ double t = beta+beta;
+ return(beta + APA[0] * sin(t) + APA[1] * sin(t+t) + APA[2] * sin(t+t+t));
+ }
+
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_datum_set.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_datum_set.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,160 @@
+#ifndef _PROJECTIONS_PJ_DATUM_SET_HPP
+#define _PROJECTIONS_PJ_DATUM_SET_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+#include "geometry/projections/parameters.hpp"
+#include "geometry/projections/impl/pj_param.hpp"
+#include "geometry/projections/impl/pj_datums.hpp"
+
+
+namespace projection
+{
+ namespace impl
+ {
+
+
+ /* SEC_TO_RAD = Pi/180/3600 */
+ const double SEC_TO_RAD = 4.84813681109535993589914102357e-6;
+
+ /************************************************************************/
+ /* pj_datum_set() */
+ /************************************************************************/
+
+ void pj_datum_set(std::vector<pvalue>& pvalues, parameters& projdef)
+
+ {
+ std::string name, towgs84, nadgrids;
+
+ projdef.datum_type = PJD_UNKNOWN;
+
+ /* -------------------------------------------------------------------- */
+ /* Is there a datum definition in the parameter list? If so, */
+ /* add the defining values to the parameter list. Note that */
+ /* this will append the ellipse definition as well as the */
+ /* towgs84= and related parameters. It should also be pointed */
+ /* out that the addition is permanent rather than temporary */
+ /* like most other keyword expansion so that the ellipse */
+ /* definition will last into the pj_ell_set() function called */
+ /* after this one. */
+ /* -------------------------------------------------------------------- */
+ name = pj_param(pvalues, "sdatum").s;
+ if(! name.empty())
+ {
+ /* find the datum definition */
+ const int n = sizeof(pj_datums) / sizeof(pj_datums[0]);
+ int index = -1;
+ for (int i = 0; i < n && index == -1; i++)
+ {
+ if(pj_datums[i].id == name)
+ {
+ index = i;
+ }
+ }
+
+ if (index == -1) { throw proj_exception(-9); }
+
+ if(! pj_datums[index].ellipse_id.empty())
+ {
+ std::string entry("ellps=");
+ entry +=pj_datums[index].ellipse_id;
+ pvalues.push_back(pj_mkparam(entry));
+ }
+
+ if(! pj_datums[index].defn.empty())
+ {
+ pvalues.push_back(pj_mkparam(pj_datums[index].defn));
+ }
+ }
+
+ /* -------------------------------------------------------------------- */
+ /* Check for nadgrids parameter. */
+ /* -------------------------------------------------------------------- */
+ nadgrids = pj_param(pvalues, "snadgrids").s;
+ towgs84 = pj_param(pvalues, "stowgs84").s;
+ if(! nadgrids.empty())
+ {
+ /* We don't actually save the value separately. It will continue
+ to exist int he param list for use in pj_apply_gridshift.c */
+
+ projdef.datum_type = PJD_GRIDSHIFT;
+ }
+
+ /* -------------------------------------------------------------------- */
+ /* Check for towgs84 parameter. */
+ /* -------------------------------------------------------------------- */
+ else if(! towgs84.empty())
+ {
+ int parm_count = 0;
+
+ int n = sizeof(projdef.datum_params) / sizeof(projdef.datum_params[0]);
+
+ /* parse out the pvalues */
+ std::vector<std::string> parm;
+ boost::split(parm, towgs84, boost::is_any_of(" ,"));
+ for (std::vector<std::string>::const_iterator it = parm.begin();
+ it != parm.end() && parm_count < n;
+ it++, parm_count++)
+ {
+ projdef.datum_params[parm_count++] = atof(it->c_str());
+ }
+
+ if( projdef.datum_params[3] != 0.0
+ || projdef.datum_params[4] != 0.0
+ || projdef.datum_params[5] != 0.0
+ || projdef.datum_params[6] != 0.0 )
+ {
+ projdef.datum_type = PJD_7PARAM;
+
+ /* transform from arc seconds to radians */
+ projdef.datum_params[3] *= SEC_TO_RAD;
+ projdef.datum_params[4] *= SEC_TO_RAD;
+ projdef.datum_params[5] *= SEC_TO_RAD;
+ /* transform from parts per million to scaling factor */
+ projdef.datum_params[6] =
+ (projdef.datum_params[6]/1000000.0) + 1;
+ }
+ else
+ projdef.datum_type = PJD_3PARAM;
+
+ /* Note that pj_init() will later switch datum_type to
+ PJD_WGS84 if shifts are all zero, and ellipsoid is WGS84 or GRS80 */
+ }
+
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_datums.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_datums.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,88 @@
+#ifndef _PROJECTIONS_PJ_DATUMS_HPP
+#define _PROJECTIONS_PJ_DATUMS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+namespace projection
+{
+ namespace impl
+ {
+
+ /*
+ * The ellipse code must match one from pj_ellps.c. The datum id should
+ * be kept to 12 characters or less if possible. Use the official OGC
+ * datum name for the comments if available.
+ */
+
+ PJ_DATUMS pj_datums[] = {
+ /* id definition ellipse comments */
+ /* -- ---------- ------- -------- */
+ "WGS84", "towgs84=0,0,0", "WGS84", "",
+ "GGRS87", "towgs84=-199.87,74.79,246.62", "GRS80", "Greek_Geodetic_Reference_System_1987",
+ "NAD83", "towgs84=0,0,0", "GRS80","North_American_Datum_1983",
+ "NAD27", "nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
+ "clrk66", "North_American_Datum_1927",
+ "potsdam", "towgs84=606.0,23.0,413.0", "bessel", "Potsdam Rauenberg 1950 DHDN",
+ "carthage", "towgs84=-263.0,6.0,431.0", "clark80", "Carthage 1934 Tunisia",
+ "hermannskogel", "towgs84=653.0,-212.0,449.0", "bessel", "Hermannskogel",
+ "ire65", "towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", "mod_airy", "Ireland 1965",
+ "nzgd49", "towgs84=59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", "intl", "New Zealand Geodetic Datum 1949",
+ "OSGB36", "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "airy", "Airy 1830",
+ };
+
+
+
+ PJ_PRIME_MERIDIANS pj_prime_meridians[] = {
+ /* id definition */
+ /* -- ---------- */
+ "greenwich", "0dE",
+ "lisbon", "9d07'54.862\"W",
+ "paris", "2d20'14.025\"E",
+ "bogota", "74d04'51.3\"W",
+ "madrid", "3d41'16.58\"W",
+ "rome", "12d27'8.4\"E",
+ "bern", "7d26'22.5\"E",
+ "jakarta", "106d48'27.79\"E",
+ "ferro", "17d40'W",
+ "brussels", "4d22'4.71\"E",
+ "stockholm", "18d3'29.8\"E",
+ "athens", "23d42'58.815\"E",
+ "oslo", "10d43'22.5\"E",
+ };
+
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_ell_set.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_ell_set.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,147 @@
+#ifndef _PROJECTIONS_PJ_ELL_SET_HPP
+#define _PROJECTIONS_PJ_ELL_SET_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include "geometry/projections/impl/pj_param.hpp"
+#include "geometry/projections/impl/pj_ellps.hpp"
+
+
+namespace projection
+{
+ namespace impl
+ {
+
+ /* set ellipsoid parameters a and es */
+ static const double SIXTH = .1666666666666666667; /* 1/6 */
+ static const double RA4 = .04722222222222222222; /* 17/360 */
+ static const double RA6 = .02215608465608465608; /* 67/3024 */
+ static const double RV4 = .06944444444444444444; /* 5/72 */
+ static const double RV6 = .04243827160493827160; /* 55/1296 */
+
+ void /* initialize geographic shape parameters */
+ pj_ell_set(std::vector<pvalue>& parameters, double &a, double &es)
+ {
+ int i;
+ double b=0.0, e;
+ std::string name;
+
+ /* check for varying forms of ellipsoid input */
+ a = es = 0.;
+ /* R takes precedence */
+ if (pj_param(parameters, "tR").i)
+ a = pj_param(parameters, "dR").f;
+ else { /* probable elliptical figure */
+
+ /* check if ellps present and temporarily append its values to pl */
+ name = pj_param(parameters, "sellps").s;
+ if (! name.empty())
+ {
+ const int n = sizeof(pj_ellps) / sizeof(pj_ellps[0]);
+ int index = -1;
+ for (int i = 0; i < n && index == -1; i++)
+ {
+ if(pj_ellps[i].id == name)
+ {
+ index = i;
+ }
+ }
+
+ if (index == -1) { throw proj_exception(-9); }
+
+ parameters.push_back(pj_mkparam(pj_ellps[index].major));
+ parameters.push_back(pj_mkparam(pj_ellps[index].ell));
+ }
+ a = pj_param(parameters, "da").f;
+ if (pj_param(parameters, "tes").i) /* eccentricity squared */
+ es = pj_param(parameters, "des").f;
+ else if (pj_param(parameters, "te").i) { /* eccentricity */
+ e = pj_param(parameters, "de").f;
+ es = e * e;
+ } else if (pj_param(parameters, "trf").i) { /* recip flattening */
+ es = pj_param(parameters, "drf").f;
+ if (!es) {
+ throw proj_exception(-10);
+ }
+ es = 1./ es;
+ es = es * (2. - es);
+ } else if (pj_param(parameters, "tf").i) { /* flattening */
+ es = pj_param(parameters, "df").f;
+ es = es * (2. - es);
+ } else if (pj_param(parameters, "tb").i) { /* minor axis */
+ b = pj_param(parameters, "db").f;
+ es = 1. - (b * b) / (a * a);
+ } /* else es == 0. and sphere of radius a */
+ if (!b)
+ b = a * sqrt(1. - es);
+ /* following options turn ellipsoid into equivalent sphere */
+ if (pj_param(parameters, "bR_A").i) { /* sphere--area of ellipsoid */
+ a *= 1. - es * (SIXTH + es * (RA4 + es * RA6));
+ es = 0.;
+ } else if (pj_param(parameters, "bR_V").i) { /* sphere--vol. of ellipsoid */
+ a *= 1. - es * (SIXTH + es * (RV4 + es * RV6));
+ es = 0.;
+ } else if (pj_param(parameters, "bR_a").i) { /* sphere--arithmetic mean */
+ a = .5 * (a + b);
+ es = 0.;
+ } else if (pj_param(parameters, "bR_g").i) { /* sphere--geometric mean */
+ a = sqrt(a * b);
+ es = 0.;
+ } else if (pj_param(parameters, "bR_h").i) { /* sphere--harmonic mean */
+ a = 2. * a * b / (a + b);
+ es = 0.;
+ } else if ((i = pj_param(parameters, "tR_lat_a").i) || /* sphere--arith. */
+ pj_param(parameters, "tR_lat_g").i) { /* or geom. mean at latitude */
+ double tmp;
+
+ tmp = sin(pj_param(parameters, i ? "rR_lat_a" : "rR_lat_g").f);
+ if (fabs(tmp) > HALFPI) {
+ throw proj_exception(-11);
+ }
+ tmp = 1. - es * tmp * tmp;
+ a *= i ? .5 * (1. - es + tmp) / ( tmp * sqrt(tmp)) :
+ sqrt(1. - es) / tmp;
+ es = 0.;
+ }
+ }
+ /* some remaining checks */
+ if (es < 0.)
+ { throw proj_exception(-12); }
+ if (a <= 0.)
+ { throw proj_exception(-13); }
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_ellps.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_ellps.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,91 @@
+#ifndef _PROJECTIONS_PJ_ELLPS_HPP
+#define _PROJECTIONS_PJ_ELLPS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+namespace projection
+{
+ namespace impl
+ {
+
+ PJ_ELLPS pj_ellps[] = {
+ "MERIT", "a=6378137.0", "rf=298.257", "MERIT 1983",
+ "SGS85", "a=6378136.0", "rf=298.257", "Soviet Geodetic System 85",
+ "GRS80", "a=6378137.0", "rf=298.257222101", "GRS 1980(IUGG, 1980)",
+ "IAU76", "a=6378140.0", "rf=298.257", "IAU 1976",
+ "airy", "a=6377563.396", "b=6356256.910", "Airy 1830",
+ "APL4.9", "a=6378137.0.", "rf=298.25", "Appl. Physics. 1965",
+ "NWL9D", "a=6378145.0.", "rf=298.25", "Naval Weapons Lab., 1965",
+ "mod_airy", "a=6377340.189", "b=6356034.446", "Modified Airy",
+ "andrae", "a=6377104.43", "rf=300.0", "Andrae 1876 (Den., Iclnd.)",
+ "aust_SA", "a=6378160.0", "rf=298.25", "Australian Natl & S. Amer. 1969",
+ "GRS67", "a=6378160.0", "rf=298.2471674270", "GRS 67(IUGG 1967)",
+ "bessel", "a=6377397.155", "rf=299.1528128", "Bessel 1841",
+ "bess_nam", "a=6377483.865", "rf=299.1528128", "Bessel 1841 (Namibia)",
+ "clrk66", "a=6378206.4", "b=6356583.8", "Clarke 1866",
+ "clrk80", "a=6378249.145", "rf=293.4663", "Clarke 1880 mod.",
+ "CPM", "a=6375738.7", "rf=334.29", "Comm. des Poids et Mesures 1799",
+ "delmbr", "a=6376428.", "rf=311.5", "Delambre 1810 (Belgium)",
+ "engelis", "a=6378136.05", "rf=298.2566", "Engelis 1985",
+ "evrst30", "a=6377276.345", "rf=300.8017", "Everest 1830",
+ "evrst48", "a=6377304.063", "rf=300.8017", "Everest 1948",
+ "evrst56", "a=6377301.243", "rf=300.8017", "Everest 1956",
+ "evrst69", "a=6377295.664", "rf=300.8017", "Everest 1969",
+ "evrstSS", "a=6377298.556", "rf=300.8017", "Everest (Sabah & Sarawak)",
+ "fschr60", "a=6378166.", "rf=298.3", "Fischer (Mercury Datum) 1960",
+ "fschr60m", "a=6378155.", "rf=298.3", "Modified Fischer 1960",
+ "fschr68", "a=6378150.", "rf=298.3", "Fischer 1968",
+ "helmert", "a=6378200.", "rf=298.3", "Helmert 1906",
+ "hough", "a=6378270.0", "rf=297.", "Hough",
+ "intl", "a=6378388.0", "rf=297.", "International 1909 (Hayford)",
+ "krass", "a=6378245.0", "rf=298.3", "Krassovsky, 1942",
+ "kaula", "a=6378163.", "rf=298.24", "Kaula 1961",
+ "lerch", "a=6378139.", "rf=298.257", "Lerch 1979",
+ "mprts", "a=6397300.", "rf=191.", "Maupertius 1738",
+ "new_intl", "a=6378157.5", "b=6356772.2", "New International 1967",
+ "plessis", "a=6376523.", "b=6355863.", "Plessis 1817 (France)",
+ "SEasia", "a=6378155.0", "b=6356773.3205", "Southeast Asia",
+ "walbeck", "a=6376896.0", "b=6355834.8467", "Walbeck",
+ "WGS60", "a=6378165.0", "rf=298.3", "WGS 60",
+ "WGS66", "a=6378145.0", "rf=298.25", "WGS 66",
+ "WGS72", "a=6378135.0", "rf=298.26", "WGS 72",
+ "WGS84", "a=6378137.0", "rf=298.257223563", "WGS 84",
+ "sphere", "a=6370997.0", "b=6370997.0", "Normal Sphere (r=6370997)",
+ };
+
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_fwd.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,91 @@
+#ifndef _PROJECTIONS_PJ_FWD_HPP
+#define _PROJECTIONS_PJ_FWD_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+/* general forward projection */
+#include <geometry/projections/impl/adjlon.hpp>
+#include <geometry/core/radian_access.hpp>
+
+namespace projection
+{
+ namespace impl
+ {
+ namespace forwrd
+ {
+ static const double EPS = 1.0e-12;
+ }
+
+ /* forward projection entry */
+ template <typename PRJ, typename LL, typename XY, typename PAR>
+ inline void pj_fwd(const PRJ& prj, const PAR& par, const LL& ll, XY& xy)
+ {
+ using namespace impl;
+ double lp_lon = geometry::get_as_radian<0>(ll);
+ double lp_lat = geometry::get_as_radian<1>(ll);
+ double t = fabs(lp_lat) - HALFPI;
+
+ /* check for forward and latitude or longitude overange */
+ if (t > forwrd::EPS || fabs(lp_lon) > 10.)
+ {
+ throw proj_exception();
+ }
+
+ if (fabs(t) <= forwrd::EPS)
+ {
+ lp_lat = lp_lat < 0. ? -HALFPI : HALFPI;
+ }
+ else if (par.geoc)
+ {
+ lp_lat = atan(par.rone_es * tan(lp_lat));
+ }
+ lp_lon -= par.lam0; /* compute del lp.lam */
+ if (! par.over)
+ {
+ lp_lon = adjlon(lp_lon); /* post_forward del longitude */
+ }
+
+ double x = 0, y = 0;
+ prj.fwd(lp_lon, lp_lat, x, y);
+ geometry::set<0>(xy, par.fr_meter * (par.a * x + par.x0));
+ geometry::set<1>(xy, par.fr_meter * (par.a * y + par.y0));
+ }
+ }
+
+
+
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_gauss.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_gauss.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,114 @@
+#ifndef _PROJECTIONS_PJ_GAUSS_HPP
+#define _PROJECTIONS_PJ_GAUSS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+namespace projection
+{
+ namespace impl
+ {
+ namespace gauss
+ {
+ static const int MAX_ITER = 20;
+
+ struct GAUSS
+ {
+ double C;
+ double K;
+ double e;
+ double ratexp;
+ };
+
+ static const double DEL_TOL = 1e-14;
+ inline double srat(double esinp, double exp)
+ {
+ return(pow((1.-esinp)/(1.+esinp), exp));
+ }
+
+
+ GAUSS gauss_ini(double e, double phi0, double &chi, double &rc)
+ {
+ double sphi, cphi, es;
+ GAUSS en;
+ es = e * e;
+ en.e = e;
+ sphi = sin(phi0);
+ cphi = cos(phi0); cphi *= cphi;
+ rc = sqrt(1. - es) / (1. - es * sphi * sphi);
+ en.C = sqrt(1. + es * cphi * cphi / (1. - es));
+ chi = asin(sphi / en.C);
+ en.ratexp = 0.5 * en.C * e;
+ en.K = tan(.5 * chi + impl::FORTPI) / (
+ pow(tan(.5 * phi0 + impl::FORTPI), en.C) *
+ srat(en.e * sphi, en.ratexp) );
+ return en;
+ }
+
+
+ template <typename T>
+ inline void gauss(const GAUSS& en, T& lam, T& phi)
+ {
+ phi = 2. * atan( en.K *
+ pow(tan(.5 * phi + FORTPI), en.C) *
+ srat(en.e * sin(phi), en.ratexp) ) - HALFPI;
+ lam *= en.C;
+ }
+
+ template <typename T>
+ inline void inv_gauss(const GAUSS& en, T& lam, T& phi)
+ {
+ lam /= en.C;
+ double num = pow(tan(.5 * phi + FORTPI)/en.K, 1./en.C);
+ int i;
+ for (i = MAX_ITER; i; --i)
+ {
+ double elp_phi = 2. * atan(num * srat(en.e * sin(phi), -.5 * en.e))
+ - HALFPI;
+ if (fabs(elp_phi - phi) < DEL_TOL) break;
+ phi = elp_phi;
+ }
+ /* convergence failed */
+ if (!i)
+ throw proj_exception(-17);
+ }
+
+ }
+ }
+
+
+
+}
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_init.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_init.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,289 @@
+#ifndef _PROJECTIONS_PJ_INIT_HPP
+#define _PROJECTIONS_PJ_INIT_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <string>
+
+#include <boost/algorithm/string.hpp>
+
+#include <boost/range/functions.hpp>
+
+
+#include "geometry/strategies/geographic/geo_parse.hpp"
+
+#include "geometry/projections/parameters.hpp"
+
+#include "geometry/projections/impl/projects.hpp"
+
+#include "geometry/projections/impl/pj_param.hpp"
+#include "geometry/projections/impl/pj_ell_set.hpp"
+#include "geometry/projections/impl/pj_datum_set.hpp"
+#include "geometry/projections/impl/pj_units.hpp"
+
+
+namespace projection
+{
+ namespace impl
+ {
+
+ /************************************************************************/
+ /* pj_init() */
+ /* */
+ /* Main entry point for initialing a PJ projections */
+ /* definition. Note that the projection specific function is */
+ /* called to do the initial allocation so it can be created */
+ /* large enough to hold projection specific parameters. */
+ /************************************************************************/
+ template <typename R>
+ parameters pj_init(const R& arguments, bool use_defaults = true)
+ {
+ parameters pin;
+ for (std::vector<std::string>::const_iterator it = boost::begin(arguments);
+ it != boost::end(arguments); it++)
+ {
+ pin.params.push_back(pj_mkparam(*it));
+ }
+
+ /* check if +init present */
+ if (pj_param(pin.params, "tinit").i)
+ {
+ // maybe TODO: handle "init" parameter
+ //if (!(curr = get_init(&arguments, curr, pj_param(pin.params, "sinit").s)))
+ }
+
+ // find projection -> implemented in projection factory
+ pin.name = pj_param(pin.params, "sproj").s;
+ //if (pin.name.empty())
+ //{ throw proj_exception(-4); }
+
+
+ // set defaults, unless inhibited
+ // GL-Addition, if use_defaults is false then defaults are ignored
+ if (use_defaults && ! pj_param(pin.params, "bno_defs").i)
+ {
+ // proj4 gets defaults from "proj_def.dat", file of 94/02/23 with a few defaults.
+ // Here manually
+ if (pin.name == "lcc")
+ {
+ pin.params.push_back(pj_mkparam("lat_1=33"));
+ pin.params.push_back(pj_mkparam("lat_2=45"));
+ }
+ else if (pin.name == "aea")
+ {
+ pin.params.push_back(pj_mkparam("lat_1=29.5"));
+ pin.params.push_back(pj_mkparam("lat_2=45.5 "));
+ }
+ else
+ {
+ //<general>ellps=WGS84
+ }
+ //curr = get_defaults(&arguments, curr, name);
+ }
+
+ /* allocate projection structure */
+ // done by constructor:
+ // pin.is_latlong = 0;
+ // pin.is_geocent = 0;
+ // pin.long_wrap_center = 0.0;
+
+ /* set datum parameters */
+ pj_datum_set(pin.params, pin);
+
+ /* set ellipsoid/sphere parameters */
+ pj_ell_set(pin.params, pin.a, pin.es);
+
+ pin.a_orig = pin.a;
+ pin.es_orig = pin.es;
+
+ pin.e = sqrt(pin.es);
+ pin.ra = 1. / pin.a;
+ pin.one_es = 1. - pin.es;
+ if (pin.one_es == 0.) { throw proj_exception(-6); }
+ pin.rone_es = 1./pin.one_es;
+
+ /* Now that we have ellipse information check for WGS84 datum */
+ if( pin.datum_type == PJD_3PARAM
+ && pin.datum_params[0] == 0.0
+ && pin.datum_params[1] == 0.0
+ && pin.datum_params[2] == 0.0
+ && pin.a == 6378137.0
+ && fabs(pin.es - 0.006694379990) < 0.000000000050 )/*WGS84/GRS80*/
+ {
+ pin.datum_type = PJD_WGS84;
+ }
+
+ /* set pin.geoc coordinate system */
+ pin.geoc = (pin.es && pj_param(pin.params, "bgeoc").i);
+
+ /* over-ranging flag */
+ pin.over = pj_param(pin.params, "bover").i;
+
+ /* longitude center for wrapping */
+ pin.long_wrap_center = pj_param(pin.params, "rlon_wrap").f;
+
+ /* central meridian */
+ pin.lam0 = pj_param(pin.params, "rlon_0").f;
+
+ /* central latitude */
+ pin.phi0 = pj_param(pin.params, "rlat_0").f;
+
+ /* false easting and northing */
+ pin.x0 = pj_param(pin.params, "dx_0").f;
+ pin.y0 = pj_param(pin.params, "dy_0").f;
+
+ /* general scaling factor */
+ if (pj_param(pin.params, "tk_0").i)
+ pin.k0 = pj_param(pin.params, "dk_0").f;
+ else if (pj_param(pin.params, "tk").i)
+ pin.k0 = pj_param(pin.params, "dk").f;
+ else
+ pin.k0 = 1.;
+ if (pin.k0 <= 0.) {
+ throw proj_exception(-31);
+ }
+
+ /* set units */
+ std::string s;
+ std::string units = pj_param(pin.params, "sunits").s;
+ if (! units.empty())
+ {
+ const int n = sizeof(pj_units) / sizeof(pj_units[0]);
+ int index = -1;
+ for (int i = 0; i < n && index == -1; i++)
+ {
+ if(pj_units[i].id == units)
+ {
+ index = i;
+ }
+ }
+
+ if (index == -1) { throw proj_exception(-7); }
+ s = pj_units[index].to_meter;
+ }
+ if (s.empty())
+ {
+ s = pj_param(pin.params, "sto_meter").s;
+ }
+ if (! s.empty())
+ {
+ // TODO: IMPLEMENT SPLIT
+ pin.to_meter = atof(s.c_str());
+ //if (*s == '/') /* ratio number */
+ // pin.to_meter /= strtod(++s, 0);
+ pin.fr_meter = 1. / pin.to_meter;
+ } else
+ pin.to_meter = pin.fr_meter = 1.;
+
+ /* prime meridian */
+ s.clear();
+ std::string pm = pj_param(pin.params, "spm").s;
+ if (! pm.empty())
+ {
+ std::string value;
+
+ int n = sizeof(pj_prime_meridians) / sizeof(pj_prime_meridians[0]);
+ int index = -1;
+ for (int i = 0; i < n && index == -1; i++)
+ {
+ if(pj_prime_meridians[i].id == pm)
+ {
+ value = pj_prime_meridians[i].defn;
+ index = i;
+ }
+ }
+ if (index == -1) { throw proj_exception(-7); }
+ if (value.empty()) { throw proj_exception(-46); }
+
+ geometry::strategy::dms_parser<true> parser;
+ pin.from_greenwich = parser(value.c_str());
+ }
+ else
+ pin.from_greenwich = 0.0;
+
+ return pin;
+ }
+
+ /************************************************************************/
+ /* pj_init_plus() */
+ /* */
+ /* Same as pj_init() except it takes one argument string with */
+ /* individual arguments preceeded by '+', such as "+proj=utm */
+ /* +zone=11 +ellps=WGS84". */
+ /************************************************************************/
+
+
+ parameters pj_init_plus(const std::string& definition, bool use_defaults = true)
+ {
+ static const char* sep = " +";
+
+ /* split into arguments based on '+' and trim white space */
+
+ // boost::split splits on one character, here it should be on " +", so implementation below
+ // todo: put in different routine or sort out
+ std::vector<std::string> arguments;
+ std::string def = boost::trim_copy(definition);
+ boost::trim_left_if(def, boost::is_any_of(sep));
+ std::string::size_type loc = def.find(sep);
+ while (loc != std::string::npos)
+ {
+ std::string par = def.substr(0, loc);
+ boost::trim(par);
+ if (! par.empty())
+ {
+ arguments.push_back(par);
+ }
+
+ def.erase(0, loc);
+ boost::trim_left_if(def, boost::is_any_of(sep));
+ loc = def.find(sep);
+ }
+ if (! def.empty())
+ {
+ arguments.push_back(def);
+ }
+ /*boost::split(arguments, definition, boost::is_any_of("+"));
+ for (std::vector<std::string>::iterator it = arguments.begin(); it != arguments.end(); it++)
+ {
+ boost::trim(*it);
+ }*/
+ return pj_init(arguments, use_defaults);
+ }
+
+ }
+
+
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_inv.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_inv.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,76 @@
+#ifndef _PROJECTIONS_PJ_INV_HPP
+#define _PROJECTIONS_PJ_INV_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+#include <geometry/projections/impl/adjlon.hpp>
+#include <geometry/core/radian_access.hpp>
+
+/* general inverse projection */
+
+namespace projection
+{
+ namespace impl
+ {
+ namespace inv
+ {
+ static const double EPS = 1.0e-12;
+ }
+
+ /* inverse projection entry */
+ template <typename PRJ, typename LL, typename XY, typename PAR>
+ void pj_inv(const PRJ& prj, const PAR& par, const XY& xy, LL& ll)
+ {
+ /* can't do as much preliminary checking as with forward */
+ /* descale and de-offset */
+ double xy_x = (geometry::get<0>(xy) * par.to_meter - par.x0) * par.ra;
+ double xy_y = (geometry::get<1>(xy) * par.to_meter - par.y0) * par.ra;
+ double lon = 0, lat = 0;
+ prj.inv(xy_x, xy_y, lon, lat); /* inverse project */
+ lon += par.lam0; /* reduce from del lp.lam */
+ if (!par.over)
+ lon = adjlon(lon); /* adjust longitude to CM */
+ if (par.geoc && fabs(fabs(lat)-HALFPI) > inv::EPS)
+ lat = atan(par.one_es * tan(lat));
+
+ geometry::set_from_radian<0>(ll, lon);
+ geometry::set_from_radian<1>(ll, lat);
+ }
+ }
+
+
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_mlfn.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_mlfn.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,104 @@
+#ifndef _PROJECTIONS_PJ_MLFN_HPP
+#define _PROJECTIONS_PJ_MLFN_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+namespace projection
+{
+ namespace impl
+ {
+ /* meridinal distance for ellipsoid and inverse
+ ** 8th degree - accurate to < 1e-5 meters when used in conjuction
+ ** with typical major axis values.
+ ** Inverse determines phi to EPS (1e-11) radians, about 1e-6 seconds.
+ */
+ static const double C00 = 1.;
+ static const double C02 = .25;
+ static const double C04 = .046875;
+ static const double C06 = .01953125;
+ static const double C08 = .01068115234375;
+ static const double C22 = .75;
+ static const double C44 = .46875;
+ static const double C46 = .01302083333333333333;
+ static const double C48 = .00712076822916666666;
+ static const double C66 = .36458333333333333333;
+ static const double C68 = .00569661458333333333;
+ static const double C88 = .3076171875;
+ static const double EPS = 1e-11;
+ static const int MAX_ITER = 10;
+ static const int EN_SIZE = 5;
+
+ inline void pj_enfn(double es, double* en)
+ {
+ double t; //, *en;
+
+ //if (en = (double *)pj_malloc(EN_SIZE * sizeof(double)))
+ {
+ en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
+ en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
+ en[2] = (t = es * es) * (C44 - es * (C46 + es * C48));
+ en[3] = (t *= es) * (C66 - es * C68);
+ en[4] = t * es * C88;
+ }
+ // return en;
+ }
+
+ inline double pj_mlfn(double phi, double sphi, double cphi, const double *en)
+ {
+ cphi *= sphi;
+ sphi *= sphi;
+ return(en[0] * phi - cphi * (en[1] + sphi*(en[2]
+ + sphi*(en[3] + sphi*en[4]))));
+ }
+
+ inline double pj_inv_mlfn(double arg, double es, const double *en)
+ {
+ double s, t, phi, k = 1./(1.-es);
+ int i;
+
+ phi = arg;
+ for (i = MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */
+ s = sin(phi);
+ t = 1. - es * s * s;
+ phi -= t = (pj_mlfn(phi, s, cos(phi), en) - arg) * (t * sqrt(t)) * k;
+ if (fabs(t) < EPS)
+ return phi;
+ }
+ throw proj_exception(-17);
+ return phi;
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_msfn.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_msfn.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,51 @@
+#ifndef _PROJECTIONS_PJ_MSFN_HPP
+#define _PROJECTIONS_PJ_MSFN_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+namespace projection
+{
+ namespace impl
+ {
+ /* determine constant small m */
+ inline double pj_msfn(double sinphi, double cosphi, double es)
+ {
+ return (cosphi / sqrt (1. - es * sinphi * sinphi));
+ }
+
+
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_param.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_param.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,152 @@
+#ifndef _PROJECTIONS_PJ_PARAM_HPP
+#define _PROJECTIONS_PJ_PARAM_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <string>
+#include <vector>
+
+#include "geometry/strategies/geographic/geo_parse.hpp"
+
+#include "geometry/projections/impl/projects.hpp"
+
+
+namespace projection { namespace impl {
+
+
+
+
+
+/* create pvalue list entry */
+pvalue pj_mkparam(const std::string& str)
+{
+ std::string name = str;
+ std::string value;
+ boost::trim_left_if(name, boost::is_any_of("+"));
+ std::string::size_type loc = name.find("=");
+ if (loc != std::string::npos)
+ {
+ value = name.substr(loc + 1);
+ name.erase(loc);
+ }
+
+
+ pvalue newitem;
+ newitem.param = name;
+ newitem.s = value;
+ newitem.used = 0;
+ newitem.i = atoi(value.c_str());
+ newitem.f = atof(value.c_str());
+ return newitem;
+}
+
+/************************************************************************/
+/* pj_param() */
+/* */
+/* Test for presence or get pvalue value. The first */
+/* character in `opt' is a pvalue type which can take the */
+/* values: */
+/* */
+/* `t' - test for presence, return TRUE/FALSE in pvalue.i */
+/* `i' - integer value returned in pvalue.i */
+/* `d' - simple valued real input returned in pvalue.f */
+/* `r' - degrees (DMS translation applied), returned as */
+/* radians in pvalue.f */
+/* `s' - string returned in pvalue.s */
+/* `b' - test for t/T/f/F, return in pvalue.i */
+/* */
+/************************************************************************/
+
+pvalue pj_param(const std::vector<pvalue>& pl, std::string opt)
+{
+ char type = opt[0];
+ opt.erase(opt.begin());
+
+ pvalue value;
+
+ /* simple linear lookup */
+ for (std::vector<pvalue>::const_iterator it = pl.begin(); it != pl.end(); it++)
+ {
+ if (it->param == opt)
+ {
+ //it->used = 1;
+ switch (type)
+ {
+ case 't':
+ value.i = 1;
+ break;
+ case 'i': /* integer input */
+ value.i = atoi(it->s.c_str());
+ break;
+ case 'd': /* simple real input */
+ value.f = atof(it->s.c_str());
+ break;
+ case 'r': /* degrees input */
+ {
+ geometry::strategy::dms_parser<true> parser;
+ value.f = parser(it->s.c_str());
+ }
+ break;
+ case 's': /* char string */
+ value.s = it->s;
+ break;
+ case 'b': /* boolean */
+ switch (it->s[0])
+ {
+ case 'F': case 'f':
+ value.i = 0;
+ break;
+ case '\0': case 'T': case 't':
+ value.i = 1;
+ break;
+ default:
+ value.i = 0;
+ break;
+ }
+ break;
+ }
+ return value;
+ }
+
+ }
+
+ value.i = 0;
+ value.f = 0.0;
+ value.s = "";
+ return value;
+}
+
+} }
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_phi2.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_phi2.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,69 @@
+#ifndef _PROJECTIONS_PHI2_HPP
+#define _PROJECTIONS_PHI2_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+namespace projection
+{
+ namespace impl
+ {
+ namespace phi2
+ {
+ static const double TOL = 1.0e-10;
+ static const int N_ITER = 15;
+ }
+
+ double pj_phi2(double ts, double e)
+ {
+ double eccnth, Phi, con, dphi;
+ int i;
+
+ eccnth = .5 * e;
+ Phi = HALFPI - 2. * atan (ts);
+ i = phi2::N_ITER;
+ do {
+ con = e * sin (Phi);
+ dphi = HALFPI - 2. * atan (ts * pow((1. - con) /
+ (1. + con), eccnth)) - Phi;
+ Phi += dphi;
+ } while ( fabs(dphi) > phi2::TOL && --i);
+ if (i <= 0)
+ throw proj_exception(-18);
+ return Phi;
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_qsfn.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_qsfn.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,57 @@
+#ifndef _PROJECTIONS_PJ_QSFN_HPP
+#define _PROJECTIONS_PJ_QSFN_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+namespace projection
+{
+ namespace impl
+ {
+ /* determine small q */
+ inline double pj_qsfn(double sinphi, double e, double one_es)
+ {
+ static const double EPSILON = 1.0e-7;
+
+ if (e >= EPSILON)
+ {
+ double con = e * sinphi;
+ return (one_es * (sinphi / (1. - con * con) -
+ (.5 / e) * log ((1. - con) / (1. + con))));
+ } else
+ return (sinphi + sinphi);
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_tsfn.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_tsfn.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,54 @@
+#ifndef _PROJECTIONS_PJ_TSFN_HPP
+#define _PROJECTIONS_PJ_TSFN_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/projects.hpp>
+
+namespace projection
+{
+ namespace impl
+ {
+ /* determine small t */
+ inline double pj_tsfn(double phi, double sinphi, double e)
+ {
+ sinphi *= e;
+ return (tan (.5 * (HALFPI - phi)) /
+ pow((1. - sinphi) / (1. + sinphi), .5 * e));
+ }
+
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_units.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_units.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,76 @@
+#ifndef _PROJECTIONS_UNITS_HPP
+#define _PROJECTIONS_UNITS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include "geometry/projections/impl/projects.hpp"
+
+
+namespace projection
+{
+ namespace impl
+ {
+
+ /* Field 2 that contains the multiplier to convert named units to meters
+ ** may be expressed by either a simple floating point constant or a
+ ** numerator/denomenator values (e.g. 1/1000) */
+ PJ_UNITS
+ pj_units[] = {
+ "km", "1000.", "Kilometer",
+ "m", "1.", "Meter",
+ "dm", "1/10", "Decimeter",
+ "cm", "1/100", "Centimeter",
+ "mm", "1/1000", "Millimeter",
+ "kmi", "1852.0", "International Nautical Mile",
+ "in", "0.0254", "International Inch",
+ "ft", "0.3048", "International Foot",
+ "yd", "0.9144", "International Yard",
+ "mi", "1609.344", "International Statute Mile",
+ "fath", "1.8288", "International Fathom",
+ "ch", "20.1168", "International Chain",
+ "link", "0.201168", "International Link",
+ "us-in", "1./39.37", "U.S. Surveyor's Inch",
+ "us-ft", "0.304800609601219", "U.S. Surveyor's Foot",
+ "us-yd", "0.914401828803658", "U.S. Surveyor's Yard",
+ "us-ch", "20.11684023368047", "U.S. Surveyor's Chain",
+ "us-mi", "1609.347218694437", "U.S. Surveyor's Statute Mile",
+ "ind-yd", "0.91439523", "Indian Yard",
+ "ind-ft", "0.30479841", "Indian Foot",
+ "ind-ch", "20.11669506", "Indian Chain",
+ };
+
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/pj_zpoly1.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/pj_zpoly1.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,94 @@
+#ifndef _PROJECTIONS_ZPOLY1_HPP
+#define _PROJECTIONS_ZPOLY1_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/projects.hpp>
+
+
+namespace projection
+{
+ namespace impl
+ {
+ /* evaluate complex polynomial */
+
+ /* note: coefficients are always from C_1 to C_n
+ ** i.e. C_0 == (0., 0)
+ ** n should always be >= 1 though no checks are made
+ */
+ COMPLEX
+ pj_zpoly1(COMPLEX z, COMPLEX *C, int n) {
+ COMPLEX a;
+ double t;
+
+ a = *(C += n);
+ while (n-- > 0) {
+ a.r = (--C)->r + z.r * (t = a.r) - z.i * a.i;
+ a.i = C->i + z.r * a.i + z.i * t;
+ }
+ a.r = z.r * (t = a.r) - z.i * a.i;
+ a.i = z.r * a.i + z.i * t;
+ return a;
+ }
+
+ /* evaluate complex polynomial and derivative */
+ COMPLEX
+ pj_zpolyd1(COMPLEX z, COMPLEX *C, int n, COMPLEX *der) {
+ COMPLEX a, b;
+ double t;
+ int first = 1;
+
+ a = *(C += n);
+ while (n-- > 0) {
+ if (first) {
+ first = 0;
+ b = a;
+ } else {
+ b.r = a.r + z.r * (t = b.r) - z.i * b.i;
+ b.i = a.i + z.r * b.i + z.i * t;
+ }
+ a.r = (--C)->r + z.r * (t = a.r) - z.i * a.i;
+ a.i = C->i + z.r * a.i + z.i * t;
+ }
+ b.r = a.r + z.r * (t = b.r) - z.i * b.i;
+ b.i = a.i + z.r * b.i + z.i * t;
+ a.r = z.r * (t = a.r) - z.i * a.i;
+ a.i = z.r * a.i + z.i * t;
+ *der = b;
+ return a;
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/proj_mdist.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/proj_mdist.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,131 @@
+#ifndef _PROJECTIONS_PROJ_MDIST_HPP
+#define _PROJECTIONS_PROJ_MDIST_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+namespace projection
+{
+ namespace impl
+ {
+ static const int MDIST_MAX_ITER = 20;
+
+ struct MDIST
+ {
+ int nb;
+ double es;
+ double E;
+ double b[MDIST_MAX_ITER];
+ };
+
+ void proj_mdist_ini(double es, MDIST& b)
+ {
+ double numf, numfi, twon1, denf, denfi, ens, T, twon;
+ double den, El, Es;
+ double E[MDIST_MAX_ITER];
+ int i, j;
+
+ /* generate E(e^2) and its terms E[] */
+ ens = es;
+ numf = twon1 = denfi = 1.;
+ denf = 1.;
+ twon = 4.;
+ Es = El = E[0] = 1.;
+ for (i = 1; i < MDIST_MAX_ITER ; ++i)
+ {
+ numf *= (twon1 * twon1);
+ den = twon * denf * denf * twon1;
+ T = numf/den;
+ Es -= (E[i] = T * ens);
+ ens *= es;
+ twon *= 4.;
+ denf *= ++denfi;
+ twon1 += 2.;
+ if (Es == El) /* jump out if no change */
+ break;
+ El = Es;
+ }
+ b.nb = i - 1;
+ b.es = es;
+ b.E = Es;
+ /* generate b_n coefficients--note: collapse with prefix ratios */
+ b.b[0] = Es = 1. - Es;
+ numf = denf = 1.;
+ numfi = 2.;
+ denfi = 3.;
+ for (j = 1; j < i; ++j)
+ {
+ Es -= E[j];
+ numf *= numfi;
+ denf *= denfi;
+ b.b[j] = Es * numf / denf;
+ numfi += 2.;
+ denfi += 2.;
+ }
+ }
+ inline double proj_mdist(double phi, double sphi, double cphi, const MDIST& b)
+ {
+ double sc, sum, sphi2, D;
+ int i;
+
+ sc = sphi * cphi;
+ sphi2 = sphi * sphi;
+ D = phi * b.E - b.es * sc / sqrt(1. - b.es * sphi2);
+ sum = b.b[i = b.nb];
+ while (i) sum = b.b[--i] + sphi2 * sum;
+ return(D + sc * sum);
+ }
+ inline double proj_inv_mdist(double dist, const MDIST& b)
+ {
+ static const double TOL = 1e-14;
+ double s, t, phi, k;
+ int i;
+
+ k = 1./(1.- b.es);
+ i = MDIST_MAX_ITER;
+ phi = dist;
+ while ( i-- ) {
+ s = sin(phi);
+ t = 1. - b.es * s * s;
+ phi -= t = (proj_mdist(phi, s, cos(phi), b) - dist) *
+ (t * sqrt(t)) * k;
+ if (fabs(t) < TOL) /* that is no change */
+ return phi;
+ }
+ /* convergence failed */
+ throw proj_exception(-17);
+ }
+ }
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/proj_util.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/proj_util.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1 @@
+// obsolete

Added: sandbox/ggl/boost/ggl/geometry/projections/impl/projects.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/impl/projects.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+#ifndef _PROJECTIONS_PROJECTS_HPP
+#define _PROJECTIONS_PROJECTS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is manually converted from PROJ4 (projects.h)
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ /* some useful constants */
+ static const double HALFPI = 1.5707963267948966;
+ static const double FORTPI = 0.78539816339744833;
+ static const double PI = 3.14159265358979323846;
+ static const double TWOPI = 6.2831853071795864769;
+
+
+ static const double RAD_TO_DEG = 57.29577951308232;
+ static const double DEG_TO_RAD = .0174532925199432958;
+
+
+ static const int PJD_UNKNOWN =0;
+ static const int PJD_3PARAM = 1;
+ static const int PJD_7PARAM = 2;
+ static const int PJD_GRIDSHIFT = 3;
+ static const int PJD_WGS84 = 4; /* WGS84 (or anything considered equivelent) */
+
+
+ struct pvalue
+ {
+ std::string param;
+ int used;
+
+ int i;
+ double f;
+ std::string s;
+ };
+
+
+ struct pj_const_pod
+ {
+ int over; /* over-range flag */
+ int geoc; /* geocentric latitude flag */
+ int is_latlong; /* proj=latlong ... not really a projection at all */
+ int is_geocent; /* proj=geocent ... not really a projection at all */
+ double
+ a, /* major axis or radius if es==0 */
+ a_orig, /* major axis before any +proj related adjustment */
+ es, /* e ^ 2 */
+ es_orig, /* es before any +proj related adjustment */
+ e, /* eccentricity */
+ ra, /* 1/A */
+ one_es, /* 1 - e^2 */
+ rone_es, /* 1/one_es */
+ lam0, phi0, /* central longitude, latitude */
+ x0, y0, /* easting and northing */
+ k0, /* general scaling factor */
+ to_meter, fr_meter; /* cartesian scaling */
+
+ int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */
+ double datum_params[7];
+ double from_greenwich; /* prime meridian offset (in radians) */
+ double long_wrap_center; /* 0.0 for -180 to 180, actually in radians*/
+
+ // Initialize all variables to zero
+ pj_const_pod()
+ {
+ memset(this, 0, sizeof(pj_const_pod));
+ }
+ };
+
+
+ // PROJ4 complex. Might be replaced with std::complex
+ struct COMPLEX { double r, i; } ;
+
+
+ struct PJ_ELLPS
+ {
+ std::string id; /* ellipse keyword name */
+ std::string major; /* a= value */
+ std::string ell; /* elliptical parameter */
+ std::string name; /* comments */
+ };
+
+ struct PJ_DATUMS
+ {
+ std::string id; /* datum keyword */
+ std::string defn; /* ie. "to_wgs84=..." */
+ std::string ellipse_id; /* ie from ellipse table */
+ std::string comments; /* EPSG code, etc */
+ };
+
+ struct PJ_PRIME_MERIDIANS
+ {
+ std::string id; /* prime meridian keyword */
+ std::string defn; /* offset from greenwich in DMS format. */
+ };
+
+ struct PJ_UNITS
+ {
+ std::string id; /* units keyword */
+ std::string to_meter; /* multiply by value to get meters */
+ std::string name; /* comments */
+ };
+
+ struct DERIVS
+ {
+ double x_l, x_p; /* derivatives of x for lambda-phi */
+ double y_l, y_p; /* derivatives of y for lambda-phi */
+ };
+
+ struct FACTORS
+ {
+ struct DERIVS der;
+ double h, k; /* meridinal, parallel scales */
+ double omega, thetap; /* angular distortion, theta prime */
+ double conv; /* convergence */
+ double s; /* areal scale factor */
+ double a, b; /* max-min scale error */
+ int code; /* info as to analytics, see following */
+ };
+ }
+ #endif
+
+
+
+ /*!
+ \brief parameters, projection parameters
+ \details This structure initializes all projections
+ \ingroup projection
+ */
+ struct parameters : public impl::pj_const_pod
+ {
+ std::string name;
+ std::vector<impl::pvalue> params;
+ };
+
+
+ // TODO: derived from boost::exception / make more for forward/inverse/init/setup
+ class proj_exception
+ {
+ public :
+ proj_exception(int code = 0)
+ {}
+ };
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/parameters.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/parameters.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,66 @@
+#ifndef _PROJECTIONS_PARAMETERS_HPP
+#define _PROJECTIONS_PARAMETERS_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 <string>
+#include <vector>
+
+
+#include <geometry/projections/impl/pj_init.hpp>
+#include <geometry/projections/impl/projects.hpp>
+
+
+namespace projection
+{
+
+ template <typename R>
+ parameters init(const R& arguments)
+ {
+ return impl::pj_init(arguments);
+ }
+
+ /*!
+ \ingroup projection
+ \brief Initializes a projection as a string, using the format with + and =
+ \details The projection can be initialized with a string (with the same format as the PROJ4 package) for
+ convenient initialization from, for example, the command line
+ \par Example
+ <tt>+proj=labrd +ellps=intl +lon_0=46d26'13.95E +lat_0=18d54S +azi=18d54 +k_0=.9995 +x_0=400000 +y_0=800000</tt>
+ for the Madagascar projection.
+ \note Parameters are described in the group
+ */
+ parameters init(const std::string& arguments)
+ {
+ return impl::pj_init_plus(arguments);
+ }
+
+ /*!
+ \ingroup projection
+ \brief Overload using a const char*
+ */
+ parameters init(const char* arguments)
+ {
+ return impl::pj_init_plus(arguments);
+ }
+
+
+ // todo:
+ /*
+ parameters init(const std::map<std::string, std::string>& arguments)
+ {
+ return impl::pj_init_plus(arguments);
+ }
+ */
+
+
+
+}
+#endif

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/aea.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/aea.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,522 @@
+#ifndef _PROJECTIONS_AEA_HPP
+#define _PROJECTIONS_AEA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_msfn.hpp>
+#include <geometry/projections/impl/pj_qsfn.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+#include <geometry/projections/epsg_traits.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace aea
+ {
+ static const double EPS10 = 1.e-10;
+ static const double TOL7 = 1.e-7;
+ static const int N_ITER = 15;
+ static const double EPSILON = 1.0e-7;
+ static const double TOL = 1.0e-10;
+
+ struct par_aea
+ {
+ double ec;
+ double n;
+ double c;
+ double dd;
+ double n2;
+ double rho0;
+ double rho;
+ double phi1;
+ double phi2;
+ double en[EN_SIZE];
+ int ellips;
+ };
+
+
+
+
+
+ /* determine latitude angle phi-1 */
+ inline double
+ phi1_(double qs, double Te, double Tone_es) {
+ int i;
+ double Phi, sinpi, cospi, con, com, dphi;
+
+ Phi = asin (.5 * qs);
+ if (Te < EPSILON)
+ return( Phi );
+ i = N_ITER;
+ do {
+ sinpi = sin (Phi);
+ cospi = cos (Phi);
+ con = Te * sinpi;
+ com = 1. - con * con;
+ dphi = .5 * com * com / cospi * (qs / Tone_es -
+ sinpi / com + .5 / Te * log ((1. - con) /
+ (1. + con)));
+ Phi += dphi;
+ } while (fabs(dphi) > TOL && --i);
+ return( i ? Phi : HUGE_VAL );
+ }
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_aea_ellipsoid : public base_t_fi<base_aea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_aea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_aea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ mutable par_aea m_proj_parm;
+
+ inline base_aea_ellipsoid(const PAR& par)
+ : base_t_fi<base_aea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if ((this->m_proj_parm.rho = this->m_proj_parm.c - (this->m_proj_parm.ellips ? this->m_proj_parm.n * pj_qsfn(sin(lp_lat),
+ this->m_par.e, this->m_par.one_es) : this->m_proj_parm.n2 * sin(lp_lat))) < 0.) throw proj_exception();
+ this->m_proj_parm.rho = this->m_proj_parm.dd * sqrt(this->m_proj_parm.rho);
+ xy_x = this->m_proj_parm.rho * sin( lp_lon *= this->m_proj_parm.n );
+ xy_y = this->m_proj_parm.rho0 - this->m_proj_parm.rho * cos(lp_lon);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ if( (this->m_proj_parm.rho = hypot(xy_x, xy_y = this->m_proj_parm.rho0 - xy_y)) != 0.0 ) {
+ if (this->m_proj_parm.n < 0.) {
+ this->m_proj_parm.rho = -this->m_proj_parm.rho;
+ xy_x = -xy_x;
+ xy_y = -xy_y;
+ }
+ lp_lat = this->m_proj_parm.rho / this->m_proj_parm.dd;
+ if (this->m_proj_parm.ellips) {
+ lp_lat = (this->m_proj_parm.c - lp_lat * lp_lat) / this->m_proj_parm.n;
+ if (fabs(this->m_proj_parm.ec - fabs(lp_lat)) > TOL7) {
+ if ((lp_lat = phi1_(lp_lat, this->m_par.e, this->m_par.one_es)) == HUGE_VAL)
+ throw proj_exception();
+ } else
+ lp_lat = lp_lat < 0. ? -HALFPI : HALFPI;
+ } else if (fabs(lp_lat = (this->m_proj_parm.c - lp_lat * lp_lat) / this->m_proj_parm.n2) <= 1.)
+ lp_lat = asin(lp_lat);
+ else
+ lp_lat = lp_lat < 0. ? -HALFPI : HALFPI;
+ lp_lon = atan2(xy_x, xy_y) / this->m_proj_parm.n;
+ } else {
+ lp_lon = 0.;
+ lp_lat = this->m_proj_parm.n > 0. ? HALFPI : - HALFPI;
+ }
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_aea& proj_parm)
+ {
+ double cosphi, sinphi;
+ int secant;
+ if (fabs(proj_parm.phi1 + proj_parm.phi2) < EPS10) throw proj_exception(-21);
+ proj_parm.n = sinphi = sin(proj_parm.phi1);
+ cosphi = cos(proj_parm.phi1);
+ secant = fabs(proj_parm.phi1 - proj_parm.phi2) >= EPS10;
+ if( (proj_parm.ellips = (par.es > 0.))) {
+ double ml1, m1;
+ pj_enfn(par.es, proj_parm.en);
+ m1 = pj_msfn(sinphi, cosphi, par.es);
+ ml1 = pj_qsfn(sinphi, par.e, par.one_es);
+ if (secant) { /* secant cone */
+ double ml2, m2;
+ sinphi = sin(proj_parm.phi2);
+ cosphi = cos(proj_parm.phi2);
+ m2 = pj_msfn(sinphi, cosphi, par.es);
+ ml2 = pj_qsfn(sinphi, par.e, par.one_es);
+ proj_parm.n = (m1 * m1 - m2 * m2) / (ml2 - ml1);
+ }
+ proj_parm.ec = 1. - .5 * par.one_es * log((1. - par.e) /
+ (1. + par.e)) / par.e;
+ proj_parm.c = m1 * m1 + proj_parm.n * ml1;
+ proj_parm.dd = 1. / proj_parm.n;
+ proj_parm.rho0 = proj_parm.dd * sqrt(proj_parm.c - proj_parm.n * pj_qsfn(sin(par.phi0),
+ par.e, par.one_es));
+ } else {
+ if (secant) proj_parm.n = .5 * (proj_parm.n + sin(proj_parm.phi2));
+ proj_parm.n2 = proj_parm.n + proj_parm.n;
+ proj_parm.c = cosphi * cosphi + proj_parm.n2 * sinphi;
+ proj_parm.dd = 1. / proj_parm.n;
+ proj_parm.rho0 = proj_parm.dd * sqrt(proj_parm.c - proj_parm.n2 * sin(par.phi0));
+ }
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+
+ // Albers Equal Area
+ template <typename PAR>
+ void setup_aea(PAR& par, par_aea& proj_parm)
+ {
+ proj_parm.phi1 = pj_param(par.params, "rlat_1").f;
+ proj_parm.phi2 = pj_param(par.params, "rlat_2").f;
+ setup(par, proj_parm);
+ }
+
+ // Lambert Equal Area Conic
+ template <typename PAR>
+ void setup_leac(PAR& par, par_aea& proj_parm)
+ {
+ proj_parm.phi2 = pj_param(par.params, "rlat_1").f;
+ proj_parm.phi1 = pj_param(par.params, "bsouth").i ? - HALFPI: HALFPI;
+ setup(par, proj_parm);
+ }
+
+ } // namespace aea
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Albers Equal Area projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ - lat_1= lat_2=
+ \par Example
+ \image html ex_aea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct aea_ellipsoid : public impl::aea::base_aea_ellipsoid<LL, XY, PAR>
+ {
+ inline aea_ellipsoid(const PAR& par) : impl::aea::base_aea_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::aea::setup_aea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Lambert Equal Area Conic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ - lat_1= south
+ \par Example
+ \image html ex_leac.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct leac_ellipsoid : public impl::aea::base_aea_ellipsoid<LL, XY, PAR>
+ {
+ inline leac_ellipsoid(const PAR& par) : impl::aea::base_aea_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::aea::setup_leac(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class aea_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<aea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class leac_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<leac_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void aea_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("aea", new aea_entry<LL, XY, PAR>);
+ factory.add_to_factory("leac", new leac_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ // Create EPSG specializations
+ // (Proof of Concept, only for some)
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2964, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3005, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3083, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3085, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3086, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3087, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3153, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3174, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568977 +lon_0=-84.455955 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3175, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568977 +lon_0=-83.248627 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3309, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=clrk66 +datum=NAD27 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3310, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3311, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3338, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3467, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3488, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3513, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3577, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=132 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3578, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +lon_0=-132.5 +x_0=500000 +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3579, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +lon_0=-132.5 +x_0=500000 +y_0=500000 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3665, LLR, XY, PAR>
+ {
+ typedef aea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ }
+ };
+
+
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_AEA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/aeqd.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/aeqd.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,449 @@
+#ifndef _PROJECTIONS_AEQD_HPP
+#define _PROJECTIONS_AEQD_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/aasincos.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace aeqd
+ {
+ static const double EPS10 = 1.e-10;
+ static const double TOL = 1.e-14;
+ static const int N_POLE = 0;
+ static const int S_POLE = 1;
+ static const int EQUIT = 2;
+ static const int OBLIQ = 3;
+
+ struct par_aeqd
+ {
+ double sinph0;
+ double cosph0;
+ double en[EN_SIZE];
+ double M1;
+ double N1;
+ double Mp;
+ double He;
+ double G;
+ int mode;
+ };
+
+
+
+
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_aeqd_ellipsoid : public base_t_fi<base_aeqd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_aeqd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_aeqd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_aeqd m_proj_parm;
+
+ inline base_aeqd_ellipsoid(const PAR& par)
+ : base_t_fi<base_aeqd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, cosphi, sinphi, rho, s, H, H2, c, Az, t, ct, st, cA, sA;
+
+ coslam = cos(lp_lon);
+ cosphi = cos(lp_lat);
+ sinphi = sin(lp_lat);
+ switch (this->m_proj_parm.mode) {
+ case N_POLE:
+ coslam = - coslam;
+ case S_POLE:
+ xy_x = (rho = fabs(this->m_proj_parm.Mp - pj_mlfn(lp_lat, sinphi, cosphi, this->m_proj_parm.en))) *
+ sin(lp_lon);
+ xy_y = rho * coslam;
+ break;
+ case EQUIT:
+ case OBLIQ:
+ if (fabs(lp_lon) < EPS10 && fabs(lp_lat - this->m_par.phi0) < EPS10) {
+ xy_x = xy_y = 0.;
+ break;
+ }
+ t = atan2(this->m_par.one_es * sinphi + this->m_par.es * this->m_proj_parm.N1 * this->m_proj_parm.sinph0 *
+ sqrt(1. - this->m_par.es * sinphi * sinphi), cosphi);
+ ct = cos(t); st = sin(t);
+ Az = atan2(sin(lp_lon) * ct, this->m_proj_parm.cosph0 * st - this->m_proj_parm.sinph0 * coslam * ct);
+ cA = cos(Az); sA = sin(Az);
+ s = aasin( fabs(sA) < TOL ?
+ (this->m_proj_parm.cosph0 * st - this->m_proj_parm.sinph0 * coslam * ct) / cA :
+ sin(lp_lon) * ct / sA );
+ H = this->m_proj_parm.He * cA;
+ H2 = H * H;
+ c = this->m_proj_parm.N1 * s * (1. + s * s * (- H2 * (1. - H2)/6. +
+ s * ( this->m_proj_parm.G * H * (1. - 2. * H2 * H2) / 8. +
+ s * ((H2 * (4. - 7. * H2) - 3. * this->m_proj_parm.G * this->m_proj_parm.G * (1. - 7. * H2)) /
+ 120. - s * this->m_proj_parm.G * H / 48.))));
+ xy_x = c * sA;
+ xy_y = c * cA;
+ break;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double c, Az, cosAz, A, B, D, E, F, psi, t;
+
+ if ((c = hypot(xy_x, xy_y)) < EPS10) {
+ lp_lat = this->m_par.phi0;
+ lp_lon = 0.;
+ return;
+ }
+ if (this->m_proj_parm.mode == OBLIQ || this->m_proj_parm.mode == EQUIT) {
+ cosAz = cos(Az = atan2(xy_x, xy_y));
+ t = this->m_proj_parm.cosph0 * cosAz;
+ B = this->m_par.es * t / this->m_par.one_es;
+ A = - B * t;
+ B *= 3. * (1. - A) * this->m_proj_parm.sinph0;
+ D = c / this->m_proj_parm.N1;
+ E = D * (1. - D * D * (A * (1. + A) / 6. + B * (1. + 3.*A) * D / 24.));
+ F = 1. - E * E * (A / 2. + B * E / 6.);
+ psi = aasin(this->m_proj_parm.sinph0 * cos(E) + t * sin(E));
+ lp_lon = aasin(sin(Az) * sin(E) / cos(psi));
+ if ((t = fabs(psi)) < EPS10)
+ lp_lat = 0.;
+ else if (fabs(t - HALFPI) < 0.)
+ lp_lat = HALFPI;
+ else
+ lp_lat = atan((1. - this->m_par.es * F * this->m_proj_parm.sinph0 / sin(psi)) * tan(psi) /
+ this->m_par.one_es);
+ } else { /* Polar */
+ lp_lat = pj_inv_mlfn(this->m_proj_parm.mode == N_POLE ? this->m_proj_parm.Mp - c : this->m_proj_parm.Mp + c,
+ this->m_par.es, this->m_proj_parm.en);
+ lp_lon = atan2(xy_x, this->m_proj_parm.mode == N_POLE ? -xy_y : xy_y);
+ }
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_aeqd_guam : public base_t_fi<base_aeqd_guam<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_aeqd_guam<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_aeqd_guam<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_aeqd m_proj_parm;
+
+ inline base_aeqd_guam(const PAR& par)
+ : base_t_fi<base_aeqd_guam<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double cosphi, sinphi, t;
+
+ cosphi = cos(lp_lat);
+ sinphi = sin(lp_lat);
+ t = 1. / sqrt(1. - this->m_par.es * sinphi * sinphi);
+ xy_x = lp_lon * cosphi * t;
+ xy_y = pj_mlfn(lp_lat, sinphi, cosphi, this->m_proj_parm.en) - this->m_proj_parm.M1 +
+ .5 * lp_lon * lp_lon * cosphi * sinphi * t;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double x2, t;
+ int i;
+
+ x2 = 0.5 * xy_x * xy_x;
+ lp_lat = this->m_par.phi0;
+ for (i = 0; i < 3; ++i) {
+ t = this->m_par.e * sin(lp_lat);
+ lp_lat = pj_inv_mlfn(this->m_proj_parm.M1 + xy_y -
+ x2 * tan(lp_lat) * (t = sqrt(1. - t * t)), this->m_par.es, this->m_proj_parm.en);
+ }
+ lp_lon = xy_x * t / cos(lp_lat);
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_aeqd_spheroid : public base_t_fi<base_aeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_aeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_aeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_aeqd m_proj_parm;
+
+ inline base_aeqd_spheroid(const PAR& par)
+ : base_t_fi<base_aeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, cosphi, sinphi;
+
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ coslam = cos(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ xy_y = cosphi * coslam;
+ goto oblcon;
+ case OBLIQ:
+ xy_y = this->m_proj_parm.sinph0 * sinphi + this->m_proj_parm.cosph0 * cosphi * coslam;
+ oblcon:
+ if (fabs(fabs(xy_y) - 1.) < TOL)
+ if (xy_y < 0.)
+ throw proj_exception();
+ else
+ xy_x = xy_y = 0.;
+ else {
+ xy_y = acos(xy_y);
+ xy_y /= sin(xy_y);
+ xy_x = xy_y * cosphi * sin(lp_lon);
+ xy_y *= (this->m_proj_parm.mode == EQUIT) ? sinphi :
+ this->m_proj_parm.cosph0 * sinphi - this->m_proj_parm.sinph0 * cosphi * coslam;
+ }
+ break;
+ case N_POLE:
+ lp_lat = -lp_lat;
+ coslam = -coslam;
+ case S_POLE:
+ if (fabs(lp_lat - HALFPI) < EPS10) throw proj_exception();;
+ xy_x = (xy_y = (HALFPI + lp_lat)) * sin(lp_lon);
+ xy_y *= coslam;
+ break;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double cosc, c_rh, sinc;
+
+ if ((c_rh = hypot(xy_x, xy_y)) > PI) {
+ if (c_rh - EPS10 > PI) throw proj_exception();;
+ c_rh = PI;
+ } else if (c_rh < EPS10) {
+ lp_lat = this->m_par.phi0;
+ lp_lon = 0.;
+ return;
+ }
+ if (this->m_proj_parm.mode == OBLIQ || this->m_proj_parm.mode == EQUIT) {
+ sinc = sin(c_rh);
+ cosc = cos(c_rh);
+ if (this->m_proj_parm.mode == EQUIT) {
+ lp_lat = aasin(xy_y * sinc / c_rh);
+ xy_x *= sinc;
+ xy_y = cosc * c_rh;
+ } else {
+ lp_lat = aasin(cosc * this->m_proj_parm.sinph0 + xy_y * sinc * this->m_proj_parm.cosph0 /
+ c_rh);
+ xy_y = (cosc - this->m_proj_parm.sinph0 * sin(lp_lat)) * c_rh;
+ xy_x *= sinc * this->m_proj_parm.cosph0;
+ }
+ lp_lon = xy_y == 0. ? 0. : atan2(xy_x, xy_y);
+ } else if (this->m_proj_parm.mode == N_POLE) {
+ lp_lat = HALFPI - c_rh;
+ lp_lon = atan2(xy_x, -xy_y);
+ } else {
+ lp_lat = c_rh - HALFPI;
+ lp_lon = atan2(xy_x, xy_y);
+ }
+ }
+ };
+
+ // Azimuthal Equidistant
+ template <typename PAR>
+ void setup_aeqd(PAR& par, par_aeqd& proj_parm)
+ {
+ par.phi0 = pj_param(par.params, "rlat_0").f;
+ if (fabs(fabs(par.phi0) - HALFPI) < EPS10) {
+ proj_parm.mode = par.phi0 < 0. ? S_POLE : N_POLE;
+ proj_parm.sinph0 = par.phi0 < 0. ? -1. : 1.;
+ proj_parm.cosph0 = 0.;
+ } else if (fabs(par.phi0) < EPS10) {
+ proj_parm.mode = EQUIT;
+ proj_parm.sinph0 = 0.;
+ proj_parm.cosph0 = 1.;
+ } else {
+ proj_parm.mode = OBLIQ;
+ proj_parm.sinph0 = sin(par.phi0);
+ proj_parm.cosph0 = cos(par.phi0);
+ }
+ if (! par.es) {
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ } else {
+ pj_enfn(par.es, proj_parm.en);
+ if (pj_param(par.params, "bguam").i) {
+ proj_parm.M1 = pj_mlfn(par.phi0, proj_parm.sinph0, proj_parm.cosph0, proj_parm.en);
+ // par.inv = e_guam_inv;
+ // par.fwd = e_guam_fwd;
+ } else {
+ switch (proj_parm.mode) {
+ case N_POLE:
+ proj_parm.Mp = pj_mlfn(HALFPI, 1., 0., proj_parm.en);
+ break;
+ case S_POLE:
+ proj_parm.Mp = pj_mlfn(-HALFPI, -1., 0., proj_parm.en);
+ break;
+ case EQUIT:
+ case OBLIQ:
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ proj_parm.N1 = 1. / sqrt(1. - par.es * proj_parm.sinph0 * proj_parm.sinph0);
+ proj_parm.G = proj_parm.sinph0 * (proj_parm.He = par.e / sqrt(par.one_es));
+ proj_parm.He *= proj_parm.cosph0;
+ break;
+ }
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+ }
+ }
+
+ } // namespace aeqd
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Azimuthal Equidistant projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - lat_0 guam
+ \par Example
+ \image html ex_aeqd.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct aeqd_ellipsoid : public impl::aeqd::base_aeqd_ellipsoid<LL, XY, PAR>
+ {
+ inline aeqd_ellipsoid(const PAR& par) : impl::aeqd::base_aeqd_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::aeqd::setup_aeqd(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Azimuthal Equidistant projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - lat_0 guam
+ \par Example
+ \image html ex_aeqd.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct aeqd_guam : public impl::aeqd::base_aeqd_guam<LL, XY, PAR>
+ {
+ inline aeqd_guam(const PAR& par) : impl::aeqd::base_aeqd_guam<LL, XY, PAR>(par)
+ {
+ impl::aeqd::setup_aeqd(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Azimuthal Equidistant projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - lat_0 guam
+ \par Example
+ \image html ex_aeqd.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct aeqd_spheroid : public impl::aeqd::base_aeqd_spheroid<LL, XY, PAR>
+ {
+ inline aeqd_spheroid(const PAR& par) : impl::aeqd::base_aeqd_spheroid<LL, XY, PAR>(par)
+ {
+ impl::aeqd::setup_aeqd(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class aeqd_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (! par.es)
+ return new base_v_fi<aeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else if (pj_param(par.params, "bguam").i)
+ return new base_v_fi<aeqd_guam<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<aeqd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void aeqd_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("aeqd", new aeqd_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_AEQD_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/airy.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/airy.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,217 @@
+#ifndef _PROJECTIONS_AIRY_HPP
+#define _PROJECTIONS_AIRY_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace airy
+ {
+ static const double EPS = 1.e-10;
+ static const int N_POLE = 0;
+ static const int S_POLE = 1;
+ static const int EQUIT = 2;
+ static const int OBLIQ = 3;
+
+ struct par_airy
+ {
+ double p_halfpi;
+ double sinph0;
+ double cosph0;
+ double Cb;
+ int mode;
+ int no_cut; /* do not cut at hemisphere limit */
+ };
+
+
+
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_airy_spheroid : public base_t_f<base_airy_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_airy_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_airy_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_airy m_proj_parm;
+
+ inline base_airy_spheroid(const PAR& par)
+ : base_t_f<base_airy_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double sinlam, coslam, cosphi, sinphi, t, s, Krho, cosz;
+
+ sinlam = sin(lp_lon);
+ coslam = cos(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ case OBLIQ:
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ cosz = cosphi * coslam;
+ if (this->m_proj_parm.mode == OBLIQ)
+ cosz = this->m_proj_parm.sinph0 * sinphi + this->m_proj_parm.cosph0 * cosz;
+ if (!this->m_proj_parm.no_cut && cosz < -EPS)
+ throw proj_exception();;
+ if (fabs(s = 1. - cosz) > EPS) {
+ t = 0.5 * (1. + cosz);
+ Krho = -log(t)/s - this->m_proj_parm.Cb / t;
+ } else
+ Krho = 0.5 - this->m_proj_parm.Cb;
+ xy_x = Krho * cosphi * sinlam;
+ if (this->m_proj_parm.mode == OBLIQ)
+ xy_y = Krho * (this->m_proj_parm.cosph0 * sinphi -
+ this->m_proj_parm.sinph0 * cosphi * coslam);
+ else
+ xy_y = Krho * sinphi;
+ break;
+ case S_POLE:
+ case N_POLE:
+ lp_lat = fabs(this->m_proj_parm.p_halfpi - lp_lat);
+ if (!this->m_proj_parm.no_cut && (lp_lat - EPS) > HALFPI)
+ throw proj_exception();;
+ if ((lp_lat *= 0.5) > EPS) {
+ t = tan(lp_lat);
+ Krho = -2.*(log(cos(lp_lat)) / t + t * this->m_proj_parm.Cb);
+ xy_x = Krho * sinlam;
+ xy_y = Krho * coslam;
+ if (this->m_proj_parm.mode == N_POLE)
+ xy_y = -xy_y;
+ } else
+ xy_x = xy_y = 0.;
+ }
+ }
+ };
+
+ // Airy
+ template <typename PAR>
+ void setup_airy(PAR& par, par_airy& proj_parm)
+ {
+ double beta;
+ proj_parm.no_cut = pj_param(par.params, "bno_cut").i;
+ beta = 0.5 * (HALFPI - pj_param(par.params, "rlat_b").f);
+ if (fabs(beta) < EPS)
+ proj_parm.Cb = -0.5;
+ else {
+ proj_parm.Cb = 1./tan(beta);
+ proj_parm.Cb *= proj_parm.Cb * log(cos(beta));
+ }
+ if (fabs(fabs(par.phi0) - HALFPI) < EPS)
+ if (par.phi0 < 0.) {
+ proj_parm.p_halfpi = -HALFPI;
+ proj_parm.mode = S_POLE;
+ } else {
+ proj_parm.p_halfpi = HALFPI;
+ proj_parm.mode = N_POLE;
+ }
+ else {
+ if (fabs(par.phi0) < EPS)
+ proj_parm.mode = EQUIT;
+ else {
+ proj_parm.mode = OBLIQ;
+ proj_parm.sinph0 = sin(par.phi0);
+ proj_parm.cosph0 = cos(par.phi0);
+ }
+ }
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace airy
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Airy projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ - no_cut lat_b=
+ \par Example
+ \image html ex_airy.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct airy_spheroid : public impl::airy::base_airy_spheroid<LL, XY, PAR>
+ {
+ inline airy_spheroid(const PAR& par) : impl::airy::base_airy_spheroid<LL, XY, PAR>(par)
+ {
+ impl::airy::setup_airy(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class airy_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<airy_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void airy_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("airy", new airy_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_AIRY_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/aitoff.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/aitoff.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,207 @@
+#ifndef _PROJECTIONS_AITOFF_HPP
+#define _PROJECTIONS_AITOFF_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace aitoff
+ {
+
+ struct par_aitoff
+ {
+ double cosphi1;
+ int mode;
+ };
+
+
+
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_aitoff_spheroid : public base_t_f<base_aitoff_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_aitoff_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_aitoff_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_aitoff m_proj_parm;
+
+ inline base_aitoff_spheroid(const PAR& par)
+ : base_t_f<base_aitoff_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double c, d;
+
+ if((d = acos(cos(lp_lat) * cos(c = 0.5 * lp_lon)))) {/* basic Aitoff */
+ xy_x = 2. * d * cos(lp_lat) * sin(c) * (xy_y = 1. / sin(d));
+ xy_y *= d * sin(lp_lat);
+ } else
+ xy_x = xy_y = 0.;
+ if (this->m_proj_parm.mode) { /* Winkel Tripel */
+ xy_x = (xy_x + lp_lon * this->m_proj_parm.cosphi1) * 0.5;
+ xy_y = (xy_y + lp_lat) * 0.5;
+ }
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_aitoff& proj_parm)
+ {
+ // par.inv = 0;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+
+ // Aitoff
+ template <typename PAR>
+ void setup_aitoff(PAR& par, par_aitoff& proj_parm)
+ {
+ proj_parm.mode = 0;
+ setup(par, proj_parm);
+ }
+
+ // Winkel Tripel
+ template <typename PAR>
+ void setup_wintri(PAR& par, par_aitoff& proj_parm)
+ {
+ proj_parm.mode = 1;
+ if (pj_param(par.params, "tlat_1").i)
+ {
+ if ((proj_parm.cosphi1 = cos(pj_param(par.params, "rlat_1").f)) == 0.)
+ throw proj_exception(-22);
+ }
+ else /* 50d28' or acos(2/pi) */
+ proj_parm.cosphi1 = 0.636619772367581343;
+ setup(par, proj_parm);
+ }
+
+ } // namespace aitoff
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Aitoff projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ \par Example
+ \image html ex_aitoff.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct aitoff_spheroid : public impl::aitoff::base_aitoff_spheroid<LL, XY, PAR>
+ {
+ inline aitoff_spheroid(const PAR& par) : impl::aitoff::base_aitoff_spheroid<LL, XY, PAR>(par)
+ {
+ impl::aitoff::setup_aitoff(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Winkel Tripel projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - lat_1
+ \par Example
+ \image html ex_wintri.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wintri_spheroid : public impl::aitoff::base_aitoff_spheroid<LL, XY, PAR>
+ {
+ inline wintri_spheroid(const PAR& par) : impl::aitoff::base_aitoff_spheroid<LL, XY, PAR>(par)
+ {
+ impl::aitoff::setup_wintri(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class aitoff_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<aitoff_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class wintri_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<wintri_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void aitoff_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("aitoff", new aitoff_entry<LL, XY, PAR>);
+ factory.add_to_factory("wintri", new wintri_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_AITOFF_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/august.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/august.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,141 @@
+#ifndef _PROJECTIONS_AUGUST_HPP
+#define _PROJECTIONS_AUGUST_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace august
+ {
+ static const double M = 1.333333333333333;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_august_spheroid : public base_t_f<base_august_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_august_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_august_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_august_spheroid(const PAR& par)
+ : base_t_f<base_august_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double t, c1, c, x1, x12, y1, y12;
+
+ t = tan(.5 * lp_lat);
+ c1 = sqrt(1. - t * t);
+ c = 1. + c1 * cos(lp_lon *= .5);
+ x1 = sin(lp_lon) * c1 / c;
+ y1 = t / c;
+ xy_x = M * x1 * (3. + (x12 = x1 * x1) - 3. * (y12 = y1 * y1));
+ xy_y = M * y1 * (3. + 3. * x12 - y12);
+ }
+ };
+
+ // August Epicycloidal
+ template <typename PAR>
+ void setup_august(PAR& par)
+ {
+ // par.inv = 0;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace august
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief August Epicycloidal projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_august.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct august_spheroid : public impl::august::base_august_spheroid<LL, XY, PAR>
+ {
+ inline august_spheroid(const PAR& par) : impl::august::base_august_spheroid<LL, XY, PAR>(par)
+ {
+ impl::august::setup_august(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class august_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<august_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void august_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("august", new august_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_AUGUST_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/bacon.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/bacon.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,238 @@
+#ifndef _PROJECTIONS_BACON_HPP
+#define _PROJECTIONS_BACON_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace bacon
+ {
+ static const double HLFPI2 = 2.46740110027233965467;
+ static const double EPS = 1e-10;
+
+ struct par_bacon
+ {
+ int bacn;
+ int ortl;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_bacon_spheroid : public base_t_f<base_bacon_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_bacon_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_bacon_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_bacon m_proj_parm;
+
+ inline base_bacon_spheroid(const PAR& par)
+ : base_t_f<base_bacon_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double ax, f;
+
+ xy_y = this->m_proj_parm.bacn ? HALFPI * sin(lp_lat) : lp_lat;
+ if ((ax = fabs(lp_lon)) >= EPS) {
+ if (this->m_proj_parm.ortl && ax >= HALFPI)
+ xy_x = sqrt(HLFPI2 - lp_lat * lp_lat + EPS) + ax - HALFPI;
+ else {
+ f = 0.5 * (HLFPI2 / ax + ax);
+ xy_x = ax - f + sqrt(f * f - xy_y * xy_y);
+ }
+ if (lp_lon < 0.) xy_x = - xy_x;
+ } else
+ xy_x = 0.;
+ }
+ };
+
+ // Apian Globular I
+ template <typename PAR>
+ void setup_apian(PAR& par, par_bacon& proj_parm)
+ {
+ proj_parm.bacn = proj_parm.ortl = 0;
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ // Ortelius Oval
+ template <typename PAR>
+ void setup_ortel(PAR& par, par_bacon& proj_parm)
+ {
+ proj_parm.bacn = 0;
+ proj_parm.ortl = 1;
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ // Bacon Globular
+ template <typename PAR>
+ void setup_bacon(PAR& par, par_bacon& proj_parm)
+ {
+ proj_parm.bacn = 1;
+ proj_parm.ortl = 0;
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace bacon
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Apian Globular I projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_apian.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct apian_spheroid : public impl::bacon::base_bacon_spheroid<LL, XY, PAR>
+ {
+ inline apian_spheroid(const PAR& par) : impl::bacon::base_bacon_spheroid<LL, XY, PAR>(par)
+ {
+ impl::bacon::setup_apian(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Ortelius Oval projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_ortel.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct ortel_spheroid : public impl::bacon::base_bacon_spheroid<LL, XY, PAR>
+ {
+ inline ortel_spheroid(const PAR& par) : impl::bacon::base_bacon_spheroid<LL, XY, PAR>(par)
+ {
+ impl::bacon::setup_ortel(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Bacon Globular projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_bacon.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct bacon_spheroid : public impl::bacon::base_bacon_spheroid<LL, XY, PAR>
+ {
+ inline bacon_spheroid(const PAR& par) : impl::bacon::base_bacon_spheroid<LL, XY, PAR>(par)
+ {
+ impl::bacon::setup_bacon(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class apian_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<apian_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class ortel_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<ortel_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class bacon_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<bacon_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void bacon_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("apian", new apian_entry<LL, XY, PAR>);
+ factory.add_to_factory("ortel", new ortel_entry<LL, XY, PAR>);
+ factory.add_to_factory("bacon", new bacon_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_BACON_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/bipc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/bipc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,253 @@
+#ifndef _PROJECTIONS_BIPC_HPP
+#define _PROJECTIONS_BIPC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace bipc
+ {
+ static const double EPS = 1e-10;
+ static const double EPS10 = 1e-10;
+ static const double ONEEPS = 1.000000001;
+ static const int NITER = 10;
+ static const double lamB = -.34894976726250681539;
+ static const double n = .63055844881274687180;
+ static const double F = 1.89724742567461030582;
+ static const double Azab = .81650043674686363166;
+ static const double Azba = 1.82261843856185925133;
+ static const double T = 1.27246578267089012270;
+ static const double rhoc = 1.20709121521568721927;
+ static const double cAzc = .69691523038678375519;
+ static const double sAzc = .71715351331143607555;
+ static const double C45 = .70710678118654752469;
+ static const double S45 = .70710678118654752410;
+ static const double C20 = .93969262078590838411;
+ static const double S20 = -.34202014332566873287;
+ static const double R110 = 1.91986217719376253360;
+ static const double R104 = 1.81514242207410275904;
+
+ struct par_bipc
+ {
+ int noskew;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_bipc_spheroid : public base_t_fi<base_bipc_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_bipc_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_bipc_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_bipc m_proj_parm;
+
+ inline base_bipc_spheroid(const PAR& par)
+ : base_t_fi<base_bipc_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double cphi, sphi, tphi, t, al, Az, z, Av, cdlam, sdlam, r;
+ int tag;
+
+ cphi = cos(lp_lat);
+ sphi = sin(lp_lat);
+ cdlam = cos(sdlam = lamB - lp_lon);
+ sdlam = sin(sdlam);
+ if (fabs(fabs(lp_lat) - HALFPI) < EPS10) {
+ Az = lp_lat < 0. ? PI : 0.;
+ tphi = HUGE_VAL;
+ } else {
+ tphi = sphi / cphi;
+ Az = atan2(sdlam , C45 * (tphi - cdlam));
+ }
+ if( (tag = (Az > Azba)) ) {
+ cdlam = cos(sdlam = lp_lon + R110);
+ sdlam = sin(sdlam);
+ z = S20 * sphi + C20 * cphi * cdlam;
+ if (fabs(z) > 1.) {
+ if (fabs(z) > ONEEPS) throw proj_exception();
+ else z = z < 0. ? -1. : 1.;
+ } else
+ z = acos(z);
+ if (tphi != HUGE_VAL)
+ Az = atan2(sdlam, (C20 * tphi - S20 * cdlam));
+ Av = Azab;
+ xy_y = rhoc;
+ } else {
+ z = S45 * (sphi + cphi * cdlam);
+ if (fabs(z) > 1.) {
+ if (fabs(z) > ONEEPS) throw proj_exception();
+ else z = z < 0. ? -1. : 1.;
+ } else
+ z = acos(z);
+ Av = Azba;
+ xy_y = -rhoc;
+ }
+ if (z < 0.) throw proj_exception();;
+ r = F * (t = pow(tan(.5 * z), n));
+ if ((al = .5 * (R104 - z)) < 0.) throw proj_exception();;
+ al = (t + pow(al, n)) / T;
+ if (fabs(al) > 1.) {
+ if (fabs(al) > ONEEPS) throw proj_exception();
+ else al = al < 0. ? -1. : 1.;
+ } else
+ al = acos(al);
+ if (fabs(t = n * (Av - Az)) < al)
+ r /= cos(al + (tag ? t : -t));
+ xy_x = r * sin(t);
+ xy_y += (tag ? -r : r) * cos(t);
+ if (this->m_proj_parm.noskew) {
+ t = xy_x;
+ xy_x = -xy_x * cAzc - xy_y * sAzc;
+ xy_y = -xy_y * cAzc + t * sAzc;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double t, r, rp, rl, al, z, fAz, Az, s, c, Av;
+ int neg, i;
+
+ if (this->m_proj_parm.noskew) {
+ t = xy_x;
+ xy_x = -xy_x * cAzc + xy_y * sAzc;
+ xy_y = -xy_y * cAzc - t * sAzc;
+ }
+ if( (neg = (xy_x < 0.)) ) {
+ xy_y = rhoc - xy_y;
+ s = S20;
+ c = C20;
+ Av = Azab;
+ } else {
+ xy_y += rhoc;
+ s = S45;
+ c = C45;
+ Av = Azba;
+ }
+ rl = rp = r = hypot(xy_x, xy_y);
+ fAz = fabs(Az = atan2(xy_x, xy_y));
+ for (i = NITER; i ; --i) {
+ z = 2. * atan(pow(r / F,1 / n));
+ al = acos((pow(tan(.5 * z), n) +
+ pow(tan(.5 * (R104 - z)), n)) / T);
+ if (fAz < al)
+ r = rp * cos(al + (neg ? Az : -Az));
+ if (fabs(rl - r) < EPS)
+ break;
+ rl = r;
+ }
+ if (! i) throw proj_exception();;
+ Az = Av - Az / n;
+ lp_lat = asin(s * cos(z) + c * sin(z) * cos(Az));
+ lp_lon = atan2(sin(Az), c / tan(z) - s * cos(Az));
+ if (neg)
+ lp_lon -= R110;
+ else
+ lp_lon = lamB - lp_lon;
+ }
+ };
+
+ // Bipolar conic of western hemisphere
+ template <typename PAR>
+ void setup_bipc(PAR& par, par_bipc& proj_parm)
+ {
+ proj_parm.noskew = pj_param(par.params, "bns").i;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace bipc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Bipolar conic of western hemisphere projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ \par Example
+ \image html ex_bipc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct bipc_spheroid : public impl::bipc::base_bipc_spheroid<LL, XY, PAR>
+ {
+ inline bipc_spheroid(const PAR& par) : impl::bipc::base_bipc_spheroid<LL, XY, PAR>(par)
+ {
+ impl::bipc::setup_bipc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class bipc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<bipc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void bipc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("bipc", new bipc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_BIPC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/boggs.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/boggs.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,154 @@
+#ifndef _PROJECTIONS_BOGGS_HPP
+#define _PROJECTIONS_BOGGS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace boggs
+ {
+ static const int NITER = 20;
+ static const double EPS = 1e-7;
+ static const double ONETOL = 1.000001;
+ static const double FXC = 2.00276;
+ static const double FXC2 = 1.11072;
+ static const double FYC = 0.49931;
+ static const double FYC2 = 1.41421356237309504880;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_boggs_spheroid : public base_t_f<base_boggs_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_boggs_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_boggs_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_boggs_spheroid(const PAR& par)
+ : base_t_f<base_boggs_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double theta, th1, c;
+ int i;
+
+ theta = lp_lat;
+ if (fabs(fabs(lp_lat) - HALFPI) < EPS)
+ xy_x = 0.;
+ else {
+ c = sin(theta) * PI;
+ for (i = NITER; i; --i) {
+ theta -= th1 = (theta + sin(theta) - c) /
+ (1. + cos(theta));
+ if (fabs(th1) < EPS) break;
+ }
+ theta *= 0.5;
+ xy_x = FXC * lp_lon / (1. / cos(lp_lat) + FXC2 / cos(theta));
+ }
+ xy_y = FYC * (lp_lat + FYC2 * sin(theta));
+ }
+ };
+
+ // Boggs Eumorphic
+ template <typename PAR>
+ void setup_boggs(PAR& par)
+ {
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace boggs
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Boggs Eumorphic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - no inverse
+ - Spheroid
+ \par Example
+ \image html ex_boggs.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct boggs_spheroid : public impl::boggs::base_boggs_spheroid<LL, XY, PAR>
+ {
+ inline boggs_spheroid(const PAR& par) : impl::boggs::base_boggs_spheroid<LL, XY, PAR>(par)
+ {
+ impl::boggs::setup_boggs(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class boggs_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<boggs_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void boggs_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("boggs", new boggs_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_BOGGS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/bonne.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/bonne.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,244 @@
+#ifndef _PROJECTIONS_BONNE_HPP
+#define _PROJECTIONS_BONNE_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace bonne
+ {
+ static const double EPS10 = 1e-10;
+
+ struct par_bonne
+ {
+ double phi1;
+ double cphi1;
+ double am1;
+ double m1;
+ double en[EN_SIZE];
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_bonne_ellipsoid : public base_t_fi<base_bonne_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_bonne_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_bonne_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_bonne m_proj_parm;
+
+ inline base_bonne_ellipsoid(const PAR& par)
+ : base_t_fi<base_bonne_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double rh, E, c;
+
+ rh = this->m_proj_parm.am1 + this->m_proj_parm.m1 - pj_mlfn(lp_lat, E = sin(lp_lat), c = cos(lp_lat), this->m_proj_parm.en);
+ E = c * lp_lon / (rh * sqrt(1. - this->m_par.es * E * E));
+ xy_x = rh * sin(E);
+ xy_y = this->m_proj_parm.am1 - rh * cos(E);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double s, rh;
+
+ rh = hypot(xy_x, xy_y = this->m_proj_parm.am1 - xy_y);
+ lp_lat = pj_inv_mlfn(this->m_proj_parm.am1 + this->m_proj_parm.m1 - rh, this->m_par.es, this->m_proj_parm.en);
+ if ((s = fabs(lp_lat)) < HALFPI) {
+ s = sin(lp_lat);
+ lp_lon = rh * atan2(xy_x, xy_y) *
+ sqrt(1. - this->m_par.es * s * s) / cos(lp_lat);
+ } else if (fabs(s - HALFPI) <= EPS10)
+ lp_lon = 0.;
+ else throw proj_exception();;
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_bonne_spheroid : public base_t_fi<base_bonne_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_bonne_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_bonne_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_bonne m_proj_parm;
+
+ inline base_bonne_spheroid(const PAR& par)
+ : base_t_fi<base_bonne_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double E, rh;
+
+ rh = this->m_proj_parm.cphi1 + this->m_proj_parm.phi1 - lp_lat;
+ if (fabs(rh) > EPS10) {
+ xy_x = rh * sin(E = lp_lon * cos(lp_lat) / rh);
+ xy_y = this->m_proj_parm.cphi1 - rh * cos(E);
+ } else
+ xy_x = xy_y = 0.;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double rh;
+
+ rh = hypot(xy_x, xy_y = this->m_proj_parm.cphi1 - xy_y);
+ lp_lat = this->m_proj_parm.cphi1 + this->m_proj_parm.phi1 - rh;
+ if (fabs(lp_lat) > HALFPI) throw proj_exception();;
+ if (fabs(fabs(lp_lat) - HALFPI) <= EPS10)
+ lp_lon = 0.;
+ else
+ lp_lon = rh * atan2(xy_x, xy_y) / cos(lp_lat);
+ }
+ };
+
+ // Bonne (Werner lat_1=90)
+ template <typename PAR>
+ void setup_bonne(PAR& par, par_bonne& proj_parm)
+ {
+ double c;
+ proj_parm.phi1 = pj_param(par.params, "rlat_1").f;
+ if (fabs(proj_parm.phi1) < EPS10) throw proj_exception(-23);
+ if (par.es) {
+ pj_enfn(par.es, proj_parm.en);
+ proj_parm.m1 = pj_mlfn(proj_parm.phi1, proj_parm.am1 = sin(proj_parm.phi1),
+ c = cos(proj_parm.phi1), proj_parm.en);
+ proj_parm.am1 = c / (sqrt(1. - par.es * proj_parm.am1 * proj_parm.am1) * proj_parm.am1);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ if (fabs(proj_parm.phi1) + EPS10 >= HALFPI)
+ proj_parm.cphi1 = 0.;
+ else
+ proj_parm.cphi1 = 1. / tan(proj_parm.phi1);
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+ } // namespace bonne
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Bonne (Werner lat_1=90) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ - lat_1=
+ \par Example
+ \image html ex_bonne.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct bonne_ellipsoid : public impl::bonne::base_bonne_ellipsoid<LL, XY, PAR>
+ {
+ inline bonne_ellipsoid(const PAR& par) : impl::bonne::base_bonne_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::bonne::setup_bonne(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Bonne (Werner lat_1=90) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ - lat_1=
+ \par Example
+ \image html ex_bonne.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct bonne_spheroid : public impl::bonne::base_bonne_spheroid<LL, XY, PAR>
+ {
+ inline bonne_spheroid(const PAR& par) : impl::bonne::base_bonne_spheroid<LL, XY, PAR>(par)
+ {
+ impl::bonne::setup_bonne(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class bonne_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<bonne_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<bonne_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void bonne_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("bonne", new bonne_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_BONNE_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/cass.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/cass.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,463 @@
+#ifndef _PROJECTIONS_CASS_HPP
+#define _PROJECTIONS_CASS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+#include <geometry/projections/epsg_traits.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace cass
+ {
+ static const double EPS10 = 1e-10;
+ static const double C1 = .16666666666666666666;
+ static const double C2 = .00833333333333333333;
+ static const double C3 = .04166666666666666666;
+ static const double C4 = .33333333333333333333;
+ static const double C5 = .06666666666666666666;
+
+ struct par_cass
+ {
+ double m0;
+ double n;
+ double t;
+ double a1;
+ double c;
+ double r;
+ double dd;
+ double d2;
+ double a2;
+ double tn;
+ double en[EN_SIZE];
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_cass_ellipsoid : public base_t_fi<base_cass_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_cass_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_cass_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ mutable par_cass m_proj_parm;
+
+ inline base_cass_ellipsoid(const PAR& par)
+ : base_t_fi<base_cass_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_y = pj_mlfn(lp_lat, this->m_proj_parm.n = sin(lp_lat), this->m_proj_parm.c = cos(lp_lat), this->m_proj_parm.en);
+ this->m_proj_parm.n = 1./sqrt(1. - this->m_par.es * this->m_proj_parm.n * this->m_proj_parm.n);
+ this->m_proj_parm.tn = tan(lp_lat); this->m_proj_parm.t = this->m_proj_parm.tn * this->m_proj_parm.tn;
+ this->m_proj_parm.a1 = lp_lon * this->m_proj_parm.c;
+ this->m_proj_parm.c *= this->m_par.es * this->m_proj_parm.c / (1 - this->m_par.es);
+ this->m_proj_parm.a2 = this->m_proj_parm.a1 * this->m_proj_parm.a1;
+ xy_x = this->m_proj_parm.n * this->m_proj_parm.a1 * (1. - this->m_proj_parm.a2 * this->m_proj_parm.t *
+ (C1 - (8. - this->m_proj_parm.t + 8. * this->m_proj_parm.c) * this->m_proj_parm.a2 * C2));
+ xy_y -= this->m_proj_parm.m0 - this->m_proj_parm.n * this->m_proj_parm.tn * this->m_proj_parm.a2 *
+ (.5 + (5. - this->m_proj_parm.t + 6. * this->m_proj_parm.c) * this->m_proj_parm.a2 * C3);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double ph1;
+
+ ph1 = pj_inv_mlfn(this->m_proj_parm.m0 + xy_y, this->m_par.es, this->m_proj_parm.en);
+ this->m_proj_parm.tn = tan(ph1); this->m_proj_parm.t = this->m_proj_parm.tn * this->m_proj_parm.tn;
+ this->m_proj_parm.n = sin(ph1);
+ this->m_proj_parm.r = 1. / (1. - this->m_par.es * this->m_proj_parm.n * this->m_proj_parm.n);
+ this->m_proj_parm.n = sqrt(this->m_proj_parm.r);
+ this->m_proj_parm.r *= (1. - this->m_par.es) * this->m_proj_parm.n;
+ this->m_proj_parm.dd = xy_x / this->m_proj_parm.n;
+ this->m_proj_parm.d2 = this->m_proj_parm.dd * this->m_proj_parm.dd;
+ lp_lat = ph1 - (this->m_proj_parm.n * this->m_proj_parm.tn / this->m_proj_parm.r) * this->m_proj_parm.d2 *
+ (.5 - (1. + 3. * this->m_proj_parm.t) * this->m_proj_parm.d2 * C3);
+ lp_lon = this->m_proj_parm.dd * (1. + this->m_proj_parm.t * this->m_proj_parm.d2 *
+ (-C4 + (1. + 3. * this->m_proj_parm.t) * this->m_proj_parm.d2 * C5)) / cos(ph1);
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_cass_spheroid : public base_t_fi<base_cass_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_cass_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_cass_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ mutable par_cass m_proj_parm;
+
+ inline base_cass_spheroid(const PAR& par)
+ : base_t_fi<base_cass_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = asin(cos(lp_lat) * sin(lp_lon));
+ xy_y = atan2(tan(lp_lat) , cos(lp_lon)) - this->m_par.phi0;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = asin(sin(this->m_proj_parm.dd = xy_y + this->m_par.phi0) * cos(xy_x));
+ lp_lon = atan2(tan(xy_x), cos(this->m_proj_parm.dd));
+ }
+ };
+
+ // Cassini
+ template <typename PAR>
+ void setup_cass(PAR& par, par_cass& proj_parm)
+ {
+ if (par.es) {
+ pj_enfn(par.es, proj_parm.en);
+ proj_parm.m0 = pj_mlfn(par.phi0, sin(par.phi0), cos(par.phi0), proj_parm.en);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+ } // namespace cass
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Cassini projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_cass.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct cass_ellipsoid : public impl::cass::base_cass_ellipsoid<LL, XY, PAR>
+ {
+ inline cass_ellipsoid(const PAR& par) : impl::cass::base_cass_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::cass::setup_cass(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Cassini projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_cass.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct cass_spheroid : public impl::cass::base_cass_spheroid<LL, XY, PAR>
+ {
+ inline cass_spheroid(const PAR& par) : impl::cass::base_cass_spheroid<LL, XY, PAR>(par)
+ {
+ impl::cass::setup_cass(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class cass_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<cass_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<cass_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void cass_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("cass", new cass_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ // Create EPSG specializations
+ // (Proof of Concept, only for some)
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2066, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=11.25217861111111 +lon_0=-60.68600888888889 +x_0=37718.66159325 +y_0=36209.91512952 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.201166195164";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2099, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=25.38236111111111 +lon_0=50.76138888888889 +x_0=100000 +y_0=100000 +ellps=helmert +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2314, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46392052001 +y_0=65379.0134283 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.3047972654";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3068, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +datum=potsdam +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3140, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=-18 +lon_0=178 +x_0=109435.392 +y_0=141622.272 +a=6378306.3696 +b=6356571.996 +towgs84=51,391,-36,0,0,0,0 +to_meter=0.201168";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3366, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=22.31213333333334 +lon_0=114.1785555555556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=6378293.645208759 +b=6356617.987679838 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3377, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=2.121679744444445 +lon_0=103.4279362361111 +x_0=-14810.562 +y_0=8758.32 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3378, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=2.682347636111111 +lon_0=101.9749050416667 +x_0=3673.785 +y_0=-4240.573 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3379, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=3.769388088888889 +lon_0=102.3682989833333 +x_0=-7368.228 +y_0=6485.858 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3380, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=3.68464905 +lon_0=101.3891079138889 +x_0=-34836.161 +y_0=56464.049 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3381, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=4.9762852 +lon_0=103.070275625 +x_0=19594.245 +y_0=3371.895 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3382, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=5.421517541666667 +lon_0=100.3443769638889 +x_0=-23.414 +y_0=62.283 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3383, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=5.964672713888889 +lon_0=100.6363711111111 +x_0=0 +y_0=0 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3384, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=4.859063022222222 +lon_0=100.8154105861111 +x_0=-1.769 +y_0=133454.779 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3385, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=5.972543658333334 +lon_0=102.2952416694444 +x_0=13227.851 +y_0=8739.894 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3407, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=22.31213333333334 +lon_0=114.1785555555556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.3047972654";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<24500, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=1.287646666666667 +lon_0=103.8530022222222 +x_0=30000 +y_0=30000 +a=6377304.063 +b=6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<28191, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<28193, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<30200, LLR, XY, PAR>
+ {
+ typedef cass_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=cass +lat_0=10.44166666666667 +lon_0=-61.33333333333334 +x_0=86501.46392051999 +y_0=65379.0134283 +a=6378293.645208759 +b=6356617.987679838 +to_meter=0.201166195164";
+ }
+ };
+
+
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_CASS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/cc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/cc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,145 @@
+#ifndef _PROJECTIONS_CC_HPP
+#define _PROJECTIONS_CC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace cc
+ {
+ static const double EPS10 = 1.e-10;
+
+ struct par_cc
+ {
+ double ap;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_cc_spheroid : public base_t_fi<base_cc_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_cc_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_cc_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_cc m_proj_parm;
+
+ inline base_cc_spheroid(const PAR& par)
+ : base_t_fi<base_cc_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if (fabs(fabs(lp_lat) - HALFPI) <= EPS10) throw proj_exception();;
+ xy_x = lp_lon;
+ xy_y = tan(lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = atan(xy_y);
+ lp_lon = xy_x;
+ }
+ };
+
+ // Central Cylindrical
+ template <typename PAR>
+ void setup_cc(PAR& par, par_cc& proj_parm)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace cc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Central Cylindrical projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ \par Example
+ \image html ex_cc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct cc_spheroid : public impl::cc::base_cc_spheroid<LL, XY, PAR>
+ {
+ inline cc_spheroid(const PAR& par) : impl::cc::base_cc_spheroid<LL, XY, PAR>(par)
+ {
+ impl::cc::setup_cc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class cc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<cc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void cc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("cc", new cc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_CC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/cea.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/cea.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,222 @@
+#ifndef _PROJECTIONS_CEA_HPP
+#define _PROJECTIONS_CEA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_qsfn.hpp>
+#include <geometry/projections/impl/pj_auth.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace cea
+ {
+ static const double EPS = 1e-10;
+
+ struct par_cea
+ {
+ double qp;
+ double apa[APA_SIZE];
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_cea_ellipsoid : public base_t_fi<base_cea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_cea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_cea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_cea m_proj_parm;
+
+ inline base_cea_ellipsoid(const PAR& par)
+ : base_t_fi<base_cea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = this->m_par.k0 * lp_lon;
+ xy_y = .5 * pj_qsfn(sin(lp_lat), this->m_par.e, this->m_par.one_es) / this->m_par.k0;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = pj_authlat(asin( 2. * xy_y * this->m_par.k0 / this->m_proj_parm.qp), this->m_proj_parm.apa);
+ lp_lon = xy_x / this->m_par.k0;
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_cea_spheroid : public base_t_fi<base_cea_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_cea_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_cea_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_cea m_proj_parm;
+
+ inline base_cea_spheroid(const PAR& par)
+ : base_t_fi<base_cea_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = this->m_par.k0 * lp_lon;
+ xy_y = sin(lp_lat) / this->m_par.k0;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double t;
+
+ if ((t = fabs(xy_y *= this->m_par.k0)) - EPS <= 1.) {
+ if (t >= 1.)
+ lp_lat = xy_y < 0. ? -HALFPI : HALFPI;
+ else
+ lp_lat = asin(xy_y);
+ lp_lon = xy_x / this->m_par.k0;
+ } else throw proj_exception();;
+ }
+ };
+
+ // Equal Area Cylindrical
+ template <typename PAR>
+ void setup_cea(PAR& par, par_cea& proj_parm)
+ {
+ double t;
+ if (pj_param(par.params, "tlat_ts").i &&
+ (par.k0 = cos(t = pj_param(par.params, "rlat_ts").f)) < 0.) throw proj_exception(-24);
+ else
+ t = 0.;
+ if (par.es) {
+ t = sin(t);
+ par.k0 /= sqrt(1. - par.es * t * t);
+ par.e = sqrt(par.es);
+ pj_authset(par.es, proj_parm.apa);
+ proj_parm.qp = pj_qsfn(1., par.e, par.one_es);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+ } // namespace cea
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Equal Area Cylindrical projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ - lat_ts=
+ \par Example
+ \image html ex_cea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct cea_ellipsoid : public impl::cea::base_cea_ellipsoid<LL, XY, PAR>
+ {
+ inline cea_ellipsoid(const PAR& par) : impl::cea::base_cea_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::cea::setup_cea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Equal Area Cylindrical projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ - lat_ts=
+ \par Example
+ \image html ex_cea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct cea_spheroid : public impl::cea::base_cea_spheroid<LL, XY, PAR>
+ {
+ inline cea_spheroid(const PAR& par) : impl::cea::base_cea_spheroid<LL, XY, PAR>(par)
+ {
+ impl::cea::setup_cea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class cea_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<cea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<cea_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void cea_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("cea", new cea_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_CEA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/chamb.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/chamb.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,240 @@
+#ifndef _PROJECTIONS_CHAMB_HPP
+#define _PROJECTIONS_CHAMB_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/aasincos.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace chamb
+ {
+ static const double THIRD = 0.333333333333333333;
+ static const double TOL = 1e-9;
+
+ struct VECT { double r, Az; };
+ struct CXY { double x, y; }; // x/y for chamb
+
+ struct par_chamb
+ {
+ struct { /* control point data */
+ double phi, lam;
+ double cosphi, sinphi;
+ VECT v;
+ CXY p;
+ double Az;
+ } c[3];
+ CXY p;
+ double beta_0, beta_1, beta_2;
+ };
+ inline VECT /* distance and azimuth from point 1 to point 2 */
+ vect(double dphi, double c1, double s1, double c2, double s2, double dlam) {
+ VECT v;
+ double cdl, dp, dl;
+
+ cdl = cos(dlam);
+ if (fabs(dphi) > 1. || fabs(dlam) > 1.)
+ v.r = aacos(s1 * s2 + c1 * c2 * cdl);
+ else { /* more accurate for smaller distances */
+ dp = sin(.5 * dphi);
+ dl = sin(.5 * dlam);
+ v.r = 2. * aasin(sqrt(dp * dp + c1 * c2 * dl * dl));
+ }
+ if (fabs(v.r) > TOL)
+ v.Az = atan2(c2 * sin(dlam), c1 * s2 - s1 * c2 * cdl);
+ else
+ v.r = v.Az = 0.;
+ return v;
+ }
+ inline double /* law of cosines */
+ lc(double b,double c,double a) {
+ return aacos(.5 * (b * b + c * c - a * a) / (b * c));
+ }
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_chamb_spheroid : public base_t_f<base_chamb_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_chamb_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_chamb_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_chamb m_proj_parm;
+
+ inline base_chamb_spheroid(const PAR& par)
+ : base_t_f<base_chamb_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double sinphi, cosphi, a;
+ VECT v[3];
+ int i, j;
+
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ for (i = 0; i < 3; ++i) { /* dist/azimiths from control */
+ v[i] = vect(lp_lat - this->m_proj_parm.c[i].phi, this->m_proj_parm.c[i].cosphi, this->m_proj_parm.c[i].sinphi,
+ cosphi, sinphi, lp_lon - this->m_proj_parm.c[i].lam);
+ if ( ! v[i].r)
+ break;
+ v[i].Az = adjlon(v[i].Az - this->m_proj_parm.c[i].v.Az);
+ }
+ if (i < 3) /* current point at control point */
+ { xy_x = this->m_proj_parm.c[i].p.x; xy_y = this->m_proj_parm.c[i].p.y; }
+ else { /* point mean of intersepts */
+ { xy_x = this->m_proj_parm.p.x; xy_y = this->m_proj_parm.p.y; }
+ for (i = 0; i < 3; ++i) {
+ j = i == 2 ? 0 : i + 1;
+ a = lc(this->m_proj_parm.c[i].v.r, v[i].r, v[j].r);
+ if (v[i].Az < 0.)
+ a = -a;
+ if (! i) { /* coord comp unique to each arc */
+ xy_x += v[i].r * cos(a);
+ xy_y -= v[i].r * sin(a);
+ } else if (i == 1) {
+ a = this->m_proj_parm.beta_1 - a;
+ xy_x -= v[i].r * cos(a);
+ xy_y -= v[i].r * sin(a);
+ } else {
+ a = this->m_proj_parm.beta_2 - a;
+ xy_x += v[i].r * cos(a);
+ xy_y += v[i].r * sin(a);
+ }
+ }
+ xy_x *= THIRD; /* mean of arc intercepts */
+ xy_y *= THIRD;
+ }
+ }
+ };
+
+ // Chamberlin Trimetric
+ template <typename PAR>
+ void setup_chamb(PAR& par, par_chamb& proj_parm)
+ {
+ int i, j;
+ char line[10];
+ for (i = 0;
+ i < 3;
+ ++i) { /* get control point locations */
+ (void)sprintf(line, "rlat_%d", i+1);
+ proj_parm.c[i].phi = pj_param(par.params, line).f;
+ (void)sprintf(line, "rlon_%d", i+1);
+ proj_parm.c[i].lam = pj_param(par.params, line).f;
+ proj_parm.c[i].lam = adjlon(proj_parm.c[i].lam - par.lam0);
+ proj_parm.c[i].cosphi = cos(proj_parm.c[i].phi);
+ proj_parm.c[i].sinphi = sin(proj_parm.c[i].phi);
+ }
+ for (i = 0;
+ i < 3;
+ ++i) { /* inter ctl pt. distances and azimuths */
+ j = i == 2 ? 0 : i + 1;
+ proj_parm.c[i].v = vect(proj_parm.c[j].phi - proj_parm.c[i].phi, proj_parm.c[i].cosphi, proj_parm.c[i].sinphi,
+ proj_parm.c[j].cosphi, proj_parm.c[j].sinphi, proj_parm.c[j].lam - proj_parm.c[i].lam);
+ if (! proj_parm.c[i].v.r) throw proj_exception(-25);
+ /* co-linearity problem ignored for now */
+ }
+ proj_parm.beta_0 = lc(proj_parm.c[0].v.r, proj_parm.c[2].v.r, proj_parm.c[1].v.r);
+ proj_parm.beta_1 = lc(proj_parm.c[0].v.r, proj_parm.c[1].v.r, proj_parm.c[2].v.r);
+ proj_parm.beta_2 = PI - proj_parm.beta_0;
+ proj_parm.p.y = 2. * (proj_parm.c[0].p.y = proj_parm.c[1].p.y = proj_parm.c[2].v.r * sin(proj_parm.beta_0));
+ proj_parm.c[2].p.y = 0.;
+ proj_parm.c[0].p.x = - (proj_parm.c[1].p.x = 0.5 * proj_parm.c[0].v.r);
+ proj_parm.p.x = proj_parm.c[2].p.x = proj_parm.c[0].p.x + proj_parm.c[2].v.r * cos(proj_parm.beta_0);
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace chamb
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Chamberlin Trimetric projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ - lat_1= lon_1= lat_2= lon_2= lat_3= lon_3=
+ \par Example
+ \image html ex_chamb.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct chamb_spheroid : public impl::chamb::base_chamb_spheroid<LL, XY, PAR>
+ {
+ inline chamb_spheroid(const PAR& par) : impl::chamb::base_chamb_spheroid<LL, XY, PAR>(par)
+ {
+ impl::chamb::setup_chamb(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class chamb_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<chamb_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void chamb_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("chamb", new chamb_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_CHAMB_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/collg.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/collg.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,152 @@
+#ifndef _PROJECTIONS_COLLG_HPP
+#define _PROJECTIONS_COLLG_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace collg
+ {
+ static const double FXC = 1.12837916709551257390;
+ static const double FYC = 1.77245385090551602729;
+ static const double ONEEPS = 1.0000001;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_collg_spheroid : public base_t_fi<base_collg_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_collg_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_collg_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_collg_spheroid(const PAR& par)
+ : base_t_fi<base_collg_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if ((xy_y = 1. - sin(lp_lat)) <= 0.)
+ xy_y = 0.;
+ else
+ xy_y = sqrt(xy_y);
+ xy_x = FXC * lp_lon * xy_y;
+ xy_y = FYC * (1. - xy_y);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y / FYC - 1.;
+ if (fabs(lp_lat = 1. - lp_lat * lp_lat) < 1.)
+ lp_lat = asin(lp_lat);
+ else if (fabs(lp_lat) > ONEEPS) throw proj_exception();
+ else lp_lat = lp_lat < 0. ? -HALFPI : HALFPI;
+ if ((lp_lon = 1. - sin(lp_lat)) <= 0.)
+ lp_lon = 0.;
+ else
+ lp_lon = xy_x / (FXC * sqrt(lp_lon));
+ }
+ };
+
+ // Collignon
+ template <typename PAR>
+ void setup_collg(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace collg
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Collignon projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_collg.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct collg_spheroid : public impl::collg::base_collg_spheroid<LL, XY, PAR>
+ {
+ inline collg_spheroid(const PAR& par) : impl::collg::base_collg_spheroid<LL, XY, PAR>(par)
+ {
+ impl::collg::setup_collg(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class collg_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<collg_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void collg_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("collg", new collg_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_COLLG_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/crast.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/crast.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,144 @@
+#ifndef _PROJECTIONS_CRAST_HPP
+#define _PROJECTIONS_CRAST_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace crast
+ {
+ static const double XM = 0.97720502380583984317;
+ static const double RXM = 1.02332670794648848847;
+ static const double YM = 3.06998012383946546542;
+ static const double RYM = 0.32573500793527994772;
+ static const double THIRD = 0.333333333333333333;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_crast_spheroid : public base_t_fi<base_crast_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_crast_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_crast_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_crast_spheroid(const PAR& par)
+ : base_t_fi<base_crast_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ lp_lat *= THIRD;
+ xy_x = XM * lp_lon * (2. * cos(lp_lat + lp_lat) - 1.);
+ xy_y = YM * sin(lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = 3. * asin(xy_y * RYM);
+ lp_lon = xy_x * RXM / (2. * cos((lp_lat + lp_lat) * THIRD) - 1);
+ }
+ };
+
+ // Craster Parabolic (Putnins P4)
+ template <typename PAR>
+ void setup_crast(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace crast
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Craster Parabolic (Putnins P4) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_crast.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct crast_spheroid : public impl::crast::base_crast_spheroid<LL, XY, PAR>
+ {
+ inline crast_spheroid(const PAR& par) : impl::crast::base_crast_spheroid<LL, XY, PAR>(par)
+ {
+ impl::crast::setup_crast(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class crast_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<crast_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void crast_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("crast", new crast_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_CRAST_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/denoy.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/denoy.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,140 @@
+#ifndef _PROJECTIONS_DENOY_HPP
+#define _PROJECTIONS_DENOY_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace denoy
+ {
+ static const double C0 = 0.95;
+ static const double C1 = -.08333333333333333333;
+ static const double C3 = .00166666666666666666;
+ static const double D1 = 0.9;
+ static const double D5 = 0.03;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_denoy_spheroid : public base_t_f<base_denoy_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_denoy_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_denoy_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_denoy_spheroid(const PAR& par)
+ : base_t_f<base_denoy_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_y = lp_lat;
+ xy_x = lp_lon;
+ lp_lon = fabs(lp_lon);
+ xy_x *= cos((C0 + lp_lon * (C1 + lp_lon * lp_lon * C3)) *
+ (lp_lat * (D1 + D5 * lp_lat * lp_lat * lp_lat * lp_lat)));
+ }
+ };
+
+ // Denoyer Semi-Elliptical
+ template <typename PAR>
+ void setup_denoy(PAR& par)
+ {
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace denoy
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Denoyer Semi-Elliptical projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - no inverse
+ - Spheroid
+ \par Example
+ \image html ex_denoy.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct denoy_spheroid : public impl::denoy::base_denoy_spheroid<LL, XY, PAR>
+ {
+ inline denoy_spheroid(const PAR& par) : impl::denoy::base_denoy_spheroid<LL, XY, PAR>(par)
+ {
+ impl::denoy::setup_denoy(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class denoy_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<denoy_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void denoy_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("denoy", new denoy_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_DENOY_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/eck1.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/eck1.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,140 @@
+#ifndef _PROJECTIONS_ECK1_HPP
+#define _PROJECTIONS_ECK1_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace eck1
+ {
+ static const double FC = .92131773192356127802;
+ static const double RP = .31830988618379067154;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_eck1_spheroid : public base_t_fi<base_eck1_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_eck1_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_eck1_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_eck1_spheroid(const PAR& par)
+ : base_t_fi<base_eck1_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = FC * lp_lon * (1. - RP * fabs(lp_lat));
+ xy_y = FC * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y / FC;
+ lp_lon = xy_x / (FC * (1. - RP * fabs(lp_lat)));
+ }
+ };
+
+ // Eckert I
+ template <typename PAR>
+ void setup_eck1(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace eck1
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Eckert I projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_eck1.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eck1_spheroid : public impl::eck1::base_eck1_spheroid<LL, XY, PAR>
+ {
+ inline eck1_spheroid(const PAR& par) : impl::eck1::base_eck1_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck1::setup_eck1(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class eck1_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eck1_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void eck1_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("eck1", new eck1_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ECK1_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/eck2.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/eck2.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,151 @@
+#ifndef _PROJECTIONS_ECK2_HPP
+#define _PROJECTIONS_ECK2_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace eck2
+ {
+ static const double FXC = 0.46065886596178063902;
+ static const double FYC = 1.44720250911653531871;
+ static const double C13 = 0.33333333333333333333;
+ static const double ONEEPS = 1.0000001;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_eck2_spheroid : public base_t_fi<base_eck2_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_eck2_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_eck2_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_eck2_spheroid(const PAR& par)
+ : base_t_fi<base_eck2_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = FXC * lp_lon * (xy_y = sqrt(4. - 3. * sin(fabs(lp_lat))));
+ xy_y = FYC * (2. - xy_y);
+ if ( lp_lat < 0.) xy_y = -xy_y;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lon = xy_x / (FXC * ( lp_lat = 2. - fabs(xy_y) / FYC) );
+ lp_lat = (4. - lp_lat * lp_lat) * C13;
+ if (fabs(lp_lat) >= 1.) {
+ if (fabs(lp_lat) > ONEEPS) throw proj_exception();
+ else
+ lp_lat = lp_lat < 0. ? -HALFPI : HALFPI;
+ } else
+ lp_lat = asin(lp_lat);
+ if (xy_y < 0)
+ lp_lat = -lp_lat;
+ }
+ };
+
+ // Eckert II
+ template <typename PAR>
+ void setup_eck2(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace eck2
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Eckert II projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_eck2.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eck2_spheroid : public impl::eck2::base_eck2_spheroid<LL, XY, PAR>
+ {
+ inline eck2_spheroid(const PAR& par) : impl::eck2::base_eck2_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck2::setup_eck2(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class eck2_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eck2_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void eck2_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("eck2", new eck2_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ECK2_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/eck3.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/eck3.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,283 @@
+#ifndef _PROJECTIONS_ECK3_HPP
+#define _PROJECTIONS_ECK3_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace eck3
+ {
+
+ struct par_eck3
+ {
+ double C_x, C_y, A, B;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_eck3_spheroid : public base_t_fi<base_eck3_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_eck3_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_eck3_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_eck3 m_proj_parm;
+
+ inline base_eck3_spheroid(const PAR& par)
+ : base_t_fi<base_eck3_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_y = this->m_proj_parm.C_y * lp_lat;
+ xy_x = this->m_proj_parm.C_x * lp_lon * (this->m_proj_parm.A + asqrt(1. - this->m_proj_parm.B * lp_lat * lp_lat));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y / this->m_proj_parm.C_y;
+ lp_lon = xy_x / (this->m_proj_parm.C_x * (this->m_proj_parm.A + asqrt(1. - this->m_proj_parm.B * lp_lat * lp_lat)));
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_eck3& proj_parm)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // Eckert III
+ template <typename PAR>
+ void setup_eck3(PAR& par, par_eck3& proj_parm)
+ {
+ proj_parm.C_x = .42223820031577120149;
+ proj_parm.C_y = .84447640063154240298;
+ proj_parm.A = 1.;
+ proj_parm.B = 0.4052847345693510857755;
+ setup(par, proj_parm);
+ }
+
+ // Putnins P1
+ template <typename PAR>
+ void setup_putp1(PAR& par, par_eck3& proj_parm)
+ {
+ proj_parm.C_x = 1.89490;
+ proj_parm.C_y = 0.94745;
+ proj_parm.A = -0.5;
+ proj_parm.B = 0.30396355092701331433;
+ setup(par, proj_parm);
+ }
+
+ // Wagner VI
+ template <typename PAR>
+ void setup_wag6(PAR& par, par_eck3& proj_parm)
+ {
+ proj_parm.C_x = proj_parm.C_y = 0.94745;
+ proj_parm.A = 0.;
+ proj_parm.B = 0.30396355092701331433;
+ setup(par, proj_parm);
+ }
+
+ // Kavraisky VII
+ template <typename PAR>
+ void setup_kav7(PAR& par, par_eck3& proj_parm)
+ {
+ proj_parm.C_x = 0.2632401569273184856851;
+ proj_parm.C_x = 0.8660254037844;
+ proj_parm.C_y = 1.;
+ proj_parm.A = 0.;
+ proj_parm.B = 0.30396355092701331433;
+ setup(par, proj_parm);
+ }
+
+ } // namespace eck3
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Eckert III projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_eck3.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eck3_spheroid : public impl::eck3::base_eck3_spheroid<LL, XY, PAR>
+ {
+ inline eck3_spheroid(const PAR& par) : impl::eck3::base_eck3_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck3::setup_eck3(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Putnins P1 projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp1.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp1_spheroid : public impl::eck3::base_eck3_spheroid<LL, XY, PAR>
+ {
+ inline putp1_spheroid(const PAR& par) : impl::eck3::base_eck3_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck3::setup_putp1(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Wagner VI projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_wag6.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wag6_spheroid : public impl::eck3::base_eck3_spheroid<LL, XY, PAR>
+ {
+ inline wag6_spheroid(const PAR& par) : impl::eck3::base_eck3_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck3::setup_wag6(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Kavraisky VII projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_kav7.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct kav7_spheroid : public impl::eck3::base_eck3_spheroid<LL, XY, PAR>
+ {
+ inline kav7_spheroid(const PAR& par) : impl::eck3::base_eck3_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck3::setup_kav7(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class eck3_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eck3_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class putp1_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp1_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class wag6_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<wag6_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class kav7_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<kav7_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void eck3_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("eck3", new eck3_entry<LL, XY, PAR>);
+ factory.add_to_factory("putp1", new putp1_entry<LL, XY, PAR>);
+ factory.add_to_factory("wag6", new wag6_entry<LL, XY, PAR>);
+ factory.add_to_factory("kav7", new kav7_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ECK3_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/eck4.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/eck4.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,167 @@
+#ifndef _PROJECTIONS_ECK4_HPP
+#define _PROJECTIONS_ECK4_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace eck4
+ {
+ static const double C_x = .42223820031577120149;
+ static const double C_y = 1.32650042817700232218;
+ static const double RC_y = .75386330736002178205;
+ static const double C_p = 3.57079632679489661922;
+ static const double RC_p = .28004957675577868795;
+ static const double EPS = 1e-7;
+ static const int NITER = 6;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_eck4_spheroid : public base_t_fi<base_eck4_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_eck4_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_eck4_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_eck4_spheroid(const PAR& par)
+ : base_t_fi<base_eck4_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double p, V, s, c;
+ int i;
+
+ p = C_p * sin(lp_lat);
+ V = lp_lat * lp_lat;
+ lp_lat *= 0.895168 + V * ( 0.0218849 + V * 0.00826809 );
+ for (i = NITER; i ; --i) {
+ c = cos(lp_lat);
+ s = sin(lp_lat);
+ lp_lat -= V = (lp_lat + s * (c + 2.) - p) /
+ (1. + c * (c + 2.) - s * s);
+ if (fabs(V) < EPS)
+ break;
+ }
+ if (!i) {
+ xy_x = C_x * lp_lon;
+ xy_y = lp_lat < 0. ? -C_y : C_y;
+ } else {
+ xy_x = C_x * lp_lon * (1. + cos(lp_lat));
+ xy_y = C_y * sin(lp_lat);
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double c;
+
+ lp_lat = aasin(xy_y / C_y);
+ lp_lon = xy_x / (C_x * (1. + (c = cos(lp_lat))));
+ lp_lat = aasin((lp_lat + sin(lp_lat) * (c + 2.)) / C_p);
+ }
+ };
+
+ // Eckert IV
+ template <typename PAR>
+ void setup_eck4(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace eck4
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Eckert IV projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_eck4.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eck4_spheroid : public impl::eck4::base_eck4_spheroid<LL, XY, PAR>
+ {
+ inline eck4_spheroid(const PAR& par) : impl::eck4::base_eck4_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck4::setup_eck4(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class eck4_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eck4_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void eck4_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("eck4", new eck4_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ECK4_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/eck5.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/eck5.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,141 @@
+#ifndef _PROJECTIONS_ECK5_HPP
+#define _PROJECTIONS_ECK5_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace eck5
+ {
+ static const double XF = 0.44101277172455148219;
+ static const double RXF = 2.26750802723822639137;
+ static const double YF = 0.88202554344910296438;
+ static const double RYF = 1.13375401361911319568;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_eck5_spheroid : public base_t_fi<base_eck5_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_eck5_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_eck5_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_eck5_spheroid(const PAR& par)
+ : base_t_fi<base_eck5_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = XF * (1. + cos(lp_lat)) * lp_lon;
+ xy_y = YF * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lon = RXF * xy_x / (1. + cos( lp_lat = RYF * xy_y));
+ }
+ };
+
+ // Eckert V
+ template <typename PAR>
+ void setup_eck5(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace eck5
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Eckert V projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_eck5.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eck5_spheroid : public impl::eck5::base_eck5_spheroid<LL, XY, PAR>
+ {
+ inline eck5_spheroid(const PAR& par) : impl::eck5::base_eck5_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eck5::setup_eck5(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class eck5_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eck5_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void eck5_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("eck5", new eck5_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ECK5_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/eqc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/eqc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,146 @@
+#ifndef _PROJECTIONS_EQC_HPP
+#define _PROJECTIONS_EQC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace eqc
+ {
+
+ struct par_eqc
+ {
+ double rc;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_eqc_spheroid : public base_t_fi<base_eqc_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_eqc_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_eqc_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_eqc m_proj_parm;
+
+ inline base_eqc_spheroid(const PAR& par)
+ : base_t_fi<base_eqc_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = this->m_proj_parm.rc * lp_lon;
+ xy_y = lp_lat - this->m_par.phi0;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lon = xy_x / this->m_proj_parm.rc;
+ lp_lat = xy_y + this->m_par.phi0;
+ }
+ };
+
+ // Equidistant Cylindrical (Plate Caree)
+ template <typename PAR>
+ void setup_eqc(PAR& par, par_eqc& proj_parm)
+ {
+ if ((proj_parm.rc = cos(pj_param(par.params, "rlat_ts").f)) <= 0.) throw proj_exception(-24);
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace eqc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Equidistant Cylindrical (Plate Caree) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - lat_ts=[
+ - lat_0=0]
+ \par Example
+ \image html ex_eqc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eqc_spheroid : public impl::eqc::base_eqc_spheroid<LL, XY, PAR>
+ {
+ inline eqc_spheroid(const PAR& par) : impl::eqc::base_eqc_spheroid<LL, XY, PAR>(par)
+ {
+ impl::eqc::setup_eqc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class eqc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eqc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void eqc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("eqc", new eqc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_EQC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/eqdc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/eqdc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,212 @@
+#ifndef _PROJECTIONS_EQDC_HPP
+#define _PROJECTIONS_EQDC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_msfn.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace eqdc
+ {
+ static const double EPS10 = 1.e-10;
+
+ struct par_eqdc
+ {
+ double phi1;
+ double phi2;
+ double n;
+ double rho;
+ double rho0;
+ double c;
+ double en[EN_SIZE];
+ int ellips;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_eqdc_ellipsoid : public base_t_fi<base_eqdc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_eqdc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_eqdc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ mutable par_eqdc m_proj_parm;
+
+ inline base_eqdc_ellipsoid(const PAR& par)
+ : base_t_fi<base_eqdc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ this->m_proj_parm.rho = this->m_proj_parm.c - (this->m_proj_parm.ellips ? pj_mlfn(lp_lat, sin(lp_lat),
+ cos(lp_lat), this->m_proj_parm.en) : lp_lat);
+ xy_x = this->m_proj_parm.rho * sin( lp_lon *= this->m_proj_parm.n );
+ xy_y = this->m_proj_parm.rho0 - this->m_proj_parm.rho * cos(lp_lon);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ if ((this->m_proj_parm.rho = hypot(xy_x, xy_y = this->m_proj_parm.rho0 - xy_y)) != 0.0 ) {
+ if (this->m_proj_parm.n < 0.) {
+ this->m_proj_parm.rho = -this->m_proj_parm.rho;
+ xy_x = -xy_x;
+ xy_y = -xy_y;
+ }
+ lp_lat = this->m_proj_parm.c - this->m_proj_parm.rho;
+ if (this->m_proj_parm.ellips)
+ lp_lat = pj_inv_mlfn(lp_lat, this->m_par.es, this->m_proj_parm.en);
+ lp_lon = atan2(xy_x, xy_y) / this->m_proj_parm.n;
+ } else {
+ lp_lon = 0.;
+ lp_lat = this->m_proj_parm.n > 0. ? HALFPI : - HALFPI;
+ }
+ }
+
+ #ifdef SPECIAL_FACTORS_NOT_CONVERTED
+ inline void fac(LL lp, FACTORS &fac) const
+ {
+ double sinphi, cosphi;
+
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ this->m_fac.code |= IS_ANAL_HK;
+ this->m_fac.h = 1.;
+ this->m_fac.k = this->m_proj_parm.n * (this->m_proj_parm.c - (this->m_proj_parm.ellips ? pj_mlfn(lp_lat, sinphi,
+ cosphi, this->m_proj_parm.en) : lp_lat)) / pj_msfn(sinphi, cosphi, this->m_par.es);
+ }
+ #endif
+ };
+
+ // Equidistant Conic
+ template <typename PAR>
+ void setup_eqdc(PAR& par, par_eqdc& proj_parm)
+ {
+ double cosphi, sinphi;
+ int secant;
+ proj_parm.phi1 = pj_param(par.params, "rlat_1").f;
+ proj_parm.phi2 = pj_param(par.params, "rlat_2").f;
+ if (fabs(proj_parm.phi1 + proj_parm.phi2) < EPS10) throw proj_exception(-21);
+ pj_enfn(par.es, proj_parm.en);
+
+ proj_parm.n = sinphi = sin(proj_parm.phi1);
+ cosphi = cos(proj_parm.phi1);
+ secant = fabs(proj_parm.phi1 - proj_parm.phi2) >= EPS10;
+ if( (proj_parm.ellips = (par.es > 0.)) ) {
+ double ml1, m1;
+ m1 = pj_msfn(sinphi, cosphi, par.es);
+ ml1 = pj_mlfn(proj_parm.phi1, sinphi, cosphi, proj_parm.en);
+ if (secant) { /* secant cone */
+ sinphi = sin(proj_parm.phi2);
+ cosphi = cos(proj_parm.phi2);
+ proj_parm.n = (m1 - pj_msfn(sinphi, cosphi, par.es)) /
+ (pj_mlfn(proj_parm.phi2, sinphi, cosphi, proj_parm.en) - ml1);
+ }
+ proj_parm.c = ml1 + m1 / proj_parm.n;
+ proj_parm.rho0 = proj_parm.c - pj_mlfn(par.phi0, sin(par.phi0),
+ cos(par.phi0), proj_parm.en);
+ } else {
+ if (secant)
+ proj_parm.n = (cosphi - cos(proj_parm.phi2)) / (proj_parm.phi2 - proj_parm.phi1);
+ proj_parm.c = proj_parm.phi1 + cos(proj_parm.phi1) / proj_parm.n;
+ proj_parm.rho0 = proj_parm.c - par.phi0;
+ }
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ // par.spc = fac;
+ }
+
+ } // namespace eqdc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Equidistant Conic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ - lat_1= lat_2=
+ \par Example
+ \image html ex_eqdc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eqdc_ellipsoid : public impl::eqdc::base_eqdc_ellipsoid<LL, XY, PAR>
+ {
+ inline eqdc_ellipsoid(const PAR& par) : impl::eqdc::base_eqdc_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::eqdc::setup_eqdc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class eqdc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eqdc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void eqdc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("eqdc", new eqdc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_EQDC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/fahey.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/fahey.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,140 @@
+#ifndef _PROJECTIONS_FAHEY_HPP
+#define _PROJECTIONS_FAHEY_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace fahey
+ {
+ static const double TOL = 1e-6;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_fahey_spheroid : public base_t_fi<base_fahey_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_fahey_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_fahey_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_fahey_spheroid(const PAR& par)
+ : base_t_fi<base_fahey_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_y = 1.819152 * ( xy_x = tan(0.5 * lp_lat) );
+ xy_x = 0.819152 * lp_lon * asqrt(1 - xy_x * xy_x);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = 2. * atan(xy_y /= 1.819152);
+ lp_lon = fabs(xy_y = 1. - xy_y * xy_y) < TOL ? 0. :
+ xy_x / (0.819152 * sqrt(xy_y));
+ }
+ };
+
+ // Fahey
+ template <typename PAR>
+ void setup_fahey(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace fahey
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Fahey projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_fahey.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct fahey_spheroid : public impl::fahey::base_fahey_spheroid<LL, XY, PAR>
+ {
+ inline fahey_spheroid(const PAR& par) : impl::fahey::base_fahey_spheroid<LL, XY, PAR>(par)
+ {
+ impl::fahey::setup_fahey(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class fahey_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<fahey_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void fahey_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("fahey", new fahey_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_FAHEY_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/fouc_s.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/fouc_s.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,167 @@
+#ifndef _PROJECTIONS_FOUC_S_HPP
+#define _PROJECTIONS_FOUC_S_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace fouc_s
+ {
+ static const int MAX_ITER = 10;
+ static const double LOOP_TOL = 1e-7;
+
+ struct par_fouc_s
+ {
+ double n, n1;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_fouc_s_spheroid : public base_t_fi<base_fouc_s_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_fouc_s_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_fouc_s_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_fouc_s m_proj_parm;
+
+ inline base_fouc_s_spheroid(const PAR& par)
+ : base_t_fi<base_fouc_s_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double t;
+
+ t = cos(lp_lat);
+ xy_x = lp_lon * t / (this->m_proj_parm.n + this->m_proj_parm.n1 * t);
+ xy_y = this->m_proj_parm.n * lp_lat + this->m_proj_parm.n1 * sin(lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double V;
+ int i;
+
+ if (this->m_proj_parm.n) {
+ lp_lat = xy_y;
+ for (i = MAX_ITER; i ; --i) {
+ lp_lat -= V = (this->m_proj_parm.n * lp_lat + this->m_proj_parm.n1 * sin(lp_lat) - xy_y ) /
+ (this->m_proj_parm.n + this->m_proj_parm.n1 * cos(lp_lat));
+ if (fabs(V) < LOOP_TOL)
+ break;
+ }
+ if (!i)
+ lp_lat = xy_y < 0. ? -HALFPI : HALFPI;
+ } else
+ lp_lat = aasin(xy_y);
+ V = cos(lp_lat);
+ lp_lon = xy_x * (this->m_proj_parm.n + this->m_proj_parm.n1 * V) / V;
+ }
+ };
+
+ // Foucaut Sinusoidal
+ template <typename PAR>
+ void setup_fouc_s(PAR& par, par_fouc_s& proj_parm)
+ {
+ proj_parm.n = pj_param(par.params, "dn").f;
+ if (proj_parm.n < 0. || proj_parm.n > 1.)
+ throw proj_exception(-99);
+ proj_parm.n1 = 1. - proj_parm.n;
+ par.es = 0;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace fouc_s
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Foucaut Sinusoidal projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_fouc_s.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct fouc_s_spheroid : public impl::fouc_s::base_fouc_s_spheroid<LL, XY, PAR>
+ {
+ inline fouc_s_spheroid(const PAR& par) : impl::fouc_s::base_fouc_s_spheroid<LL, XY, PAR>(par)
+ {
+ impl::fouc_s::setup_fouc_s(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class fouc_s_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<fouc_s_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void fouc_s_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("fouc_s", new fouc_s_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_FOUC_S_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/gall.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/gall.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,142 @@
+#ifndef _PROJECTIONS_GALL_HPP
+#define _PROJECTIONS_GALL_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace gall
+ {
+ static const double YF = 1.70710678118654752440;
+ static const double XF = 0.70710678118654752440;
+ static const double RYF = 0.58578643762690495119;
+ static const double RXF = 1.41421356237309504880;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_gall_spheroid : public base_t_fi<base_gall_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_gall_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_gall_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_gall_spheroid(const PAR& par)
+ : base_t_fi<base_gall_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = XF * lp_lon;
+ xy_y = YF * tan(.5 * lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lon = RXF * xy_x;
+ lp_lat = 2. * atan(xy_y * RYF);
+ }
+ };
+
+ // Gall (Gall Stereographic)
+ template <typename PAR>
+ void setup_gall(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace gall
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Gall (Gall Stereographic) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ \par Example
+ \image html ex_gall.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct gall_spheroid : public impl::gall::base_gall_spheroid<LL, XY, PAR>
+ {
+ inline gall_spheroid(const PAR& par) : impl::gall::base_gall_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gall::setup_gall(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class gall_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<gall_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void gall_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("gall", new gall_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GALL_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/geocent.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/geocent.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,143 @@
+#ifndef _PROJECTIONS_GEOCENT_HPP
+#define _PROJECTIONS_GEOCENT_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace geocent
+ {
+
+
+
+
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_geocent_other : public base_t_fi<base_geocent_other<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_geocent_other<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_geocent_other<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_geocent_other(const PAR& par)
+ : base_t_fi<base_geocent_other<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = lp_lon;
+ xy_y = lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y;
+ lp_lon = xy_x;
+ }
+ };
+
+ // Geocentric
+ template <typename PAR>
+ void setup_geocent(PAR& par)
+ {
+ par.is_geocent = 1;
+
+ par.x0 = 0.0;
+ par.y0 = 0.0;
+ // par.inv = inverse;
+ // par.fwd = forward;
+ }
+
+ } // namespace geocent
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Geocentric projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ \par Example
+ \image html ex_geocent.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct geocent_other : public impl::geocent::base_geocent_other<LL, XY, PAR>
+ {
+ inline geocent_other(const PAR& par) : impl::geocent::base_geocent_other<LL, XY, PAR>(par)
+ {
+ impl::geocent::setup_geocent(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class geocent_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<geocent_other<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void geocent_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("geocent", new geocent_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GEOCENT_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/geos.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/geos.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,278 @@
+#ifndef _PROJECTIONS_GEOS_HPP
+#define _PROJECTIONS_GEOS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace geos
+ {
+
+ struct par_geos
+ {
+ double h;
+ double radius_p;
+ double radius_p2;
+ double radius_p_inv2;
+ double radius_g;
+ double radius_g_1;
+ double C;
+ };
+
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_geos_ellipsoid : public base_t_fi<base_geos_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_geos_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_geos_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_geos m_proj_parm;
+
+ inline base_geos_ellipsoid(const PAR& par)
+ : base_t_fi<base_geos_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double r, Vx, Vy, Vz, tmp;
+
+ /* Calculation of geocentric latitude. */
+ lp_lat = atan (this->m_proj_parm.radius_p2 * tan (lp_lat));
+ /* Calculation of the three components of the vector from satellite to
+ ** position on earth surface (lon,lat).*/
+ r = (this->m_proj_parm.radius_p) / hypot(this->m_proj_parm.radius_p * cos (lp_lat), sin (lp_lat));
+ Vx = r * cos (lp_lon) * cos (lp_lat);
+ Vy = r * sin (lp_lon) * cos (lp_lat);
+ Vz = r * sin (lp_lat);
+ /* Check visibility. */
+ if (((this->m_proj_parm.radius_g - Vx) * Vx - Vy * Vy - Vz * Vz * this->m_proj_parm.radius_p_inv2) < 0.)
+ throw proj_exception();;
+ /* Calculation based on view angles from satellite. */
+ tmp = this->m_proj_parm.radius_g - Vx;
+ xy_x = this->m_proj_parm.radius_g_1 * atan (Vy / tmp);
+ xy_y = this->m_proj_parm.radius_g_1 * atan (Vz / hypot (Vy, tmp));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double Vx, Vy, Vz, a, b, c, det, k;
+
+ /* Setting three components of vector from satellite to position.*/
+ Vx = -1.0;
+ Vy = tan (xy_x / this->m_proj_parm.radius_g_1);
+ Vz = tan (xy_y / this->m_proj_parm.radius_g_1) * hypot(1.0, Vy);
+ /* Calculation of terms in cubic equation and determinant.*/
+ a = Vz / this->m_proj_parm.radius_p;
+ a = Vy * Vy + a * a + Vx * Vx;
+ b = 2 * this->m_proj_parm.radius_g * Vx;
+ if ((det = (b * b) - 4 * a * this->m_proj_parm.C) < 0.) throw proj_exception();;
+ /* Calculation of three components of vector from satellite to position.*/
+ k = (-b - sqrt(det)) / (2. * a);
+ Vx = this->m_proj_parm.radius_g + k * Vx;
+ Vy *= k;
+ Vz *= k;
+ /* Calculation of longitude and latitude.*/
+ lp_lon = atan2 (Vy, Vx);
+ lp_lat = atan (Vz * cos (lp_lon) / Vx);
+ lp_lat = atan (this->m_proj_parm.radius_p_inv2 * tan (lp_lat));
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_geos_spheroid : public base_t_fi<base_geos_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_geos_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_geos_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_geos m_proj_parm;
+
+ inline base_geos_spheroid(const PAR& par)
+ : base_t_fi<base_geos_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double Vx, Vy, Vz, tmp;
+
+ /* Calculation of the three components of the vector from satellite to
+ ** position on earth surface (lon,lat).*/
+ tmp = cos(lp_lat);
+ Vx = cos (lp_lon) * tmp;
+ Vy = sin (lp_lon) * tmp;
+ Vz = sin (lp_lat);
+ /* Check visibility.*/
+ if (((this->m_proj_parm.radius_g - Vx) * Vx - Vy * Vy - Vz * Vz) < 0.) throw proj_exception();;
+ /* Calculation based on view angles from satellite.*/
+ tmp = this->m_proj_parm.radius_g - Vx;
+ xy_x = this->m_proj_parm.radius_g_1 * atan(Vy / tmp);
+ xy_y = this->m_proj_parm.radius_g_1 * atan(Vz / hypot(Vy, tmp));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double Vx, Vy, Vz, a, b, c, det, k;
+
+ /* Setting three components of vector from satellite to position.*/
+ Vx = -1.0;
+ Vy = tan (xy_x / (this->m_proj_parm.radius_g - 1.0));
+ Vz = tan (xy_y / (this->m_proj_parm.radius_g - 1.0)) * sqrt (1.0 + Vy * Vy);
+ /* Calculation of terms in cubic equation and determinant.*/
+ a = Vy * Vy + Vz * Vz + Vx * Vx;
+ b = 2 * this->m_proj_parm.radius_g * Vx;
+ if ((det = (b * b) - 4 * a * this->m_proj_parm.C) < 0.) throw proj_exception();;
+ /* Calculation of three components of vector from satellite to position.*/
+ k = (-b - sqrt(det)) / (2 * a);
+ Vx = this->m_proj_parm.radius_g + k * Vx;
+ Vy *= k;
+ Vz *= k;
+ /* Calculation of longitude and latitude.*/
+ lp_lon = atan2 (Vy, Vx);
+ lp_lat = atan (Vz * cos (lp_lon) / Vx);
+ }
+ };
+
+ // Geostationary Satellite View
+ template <typename PAR>
+ void setup_geos(PAR& par, par_geos& proj_parm)
+ {
+ if ((proj_parm.h = pj_param(par.params, "dh").f) <= 0.) throw proj_exception(-30);
+ if (par.phi0) throw proj_exception(-46);
+ proj_parm.radius_g = 1. + (proj_parm.radius_g_1 = proj_parm.h / par.a);
+ proj_parm.C = proj_parm.radius_g * proj_parm.radius_g - 1.0;
+ if (par.es) {
+ proj_parm.radius_p = sqrt (par.one_es);
+ proj_parm.radius_p2 = par.one_es;
+ proj_parm.radius_p_inv2 = par.rone_es;
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ proj_parm.radius_p = proj_parm.radius_p2 = proj_parm.radius_p_inv2 = 1.0;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+ } // namespace geos
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Geostationary Satellite View projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - h=
+ \par Example
+ \image html ex_geos.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct geos_ellipsoid : public impl::geos::base_geos_ellipsoid<LL, XY, PAR>
+ {
+ inline geos_ellipsoid(const PAR& par) : impl::geos::base_geos_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::geos::setup_geos(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Geostationary Satellite View projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - h=
+ \par Example
+ \image html ex_geos.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct geos_spheroid : public impl::geos::base_geos_spheroid<LL, XY, PAR>
+ {
+ inline geos_spheroid(const PAR& par) : impl::geos::base_geos_spheroid<LL, XY, PAR>(par)
+ {
+ impl::geos::setup_geos(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class geos_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<geos_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<geos_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void geos_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("geos", new geos_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GEOS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/gins8.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/gins8.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,140 @@
+#ifndef _PROJECTIONS_GINS8_HPP
+#define _PROJECTIONS_GINS8_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace gins8
+ {
+ static const double Cl = 0.000952426;
+ static const double Cp = 0.162388;
+ static const double C12 = 0.08333333333333333;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_gins8_spheroid : public base_t_f<base_gins8_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_gins8_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_gins8_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_gins8_spheroid(const PAR& par)
+ : base_t_f<base_gins8_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double t = lp_lat * lp_lat;
+
+ xy_y = lp_lat * (1. + t * C12);
+ xy_x = lp_lon * (1. - Cp * t);
+ t = lp_lon * lp_lon;
+ xy_x *= (0.87 - Cl * t * t);
+ }
+ };
+
+ // Ginsburg VIII (TsNIIGAiK)
+ template <typename PAR>
+ void setup_gins8(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = 0;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace gins8
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Ginsburg VIII (TsNIIGAiK) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_gins8.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct gins8_spheroid : public impl::gins8::base_gins8_spheroid<LL, XY, PAR>
+ {
+ inline gins8_spheroid(const PAR& par) : impl::gins8::base_gins8_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gins8::setup_gins8(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class gins8_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<gins8_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void gins8_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("gins8", new gins8_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GINS8_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/gn_sinu.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/gn_sinu.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,375 @@
+#ifndef _PROJECTIONS_GN_SINU_HPP
+#define _PROJECTIONS_GN_SINU_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace gn_sinu
+ {
+ static const double EPS10 = 1e-10;
+ static const int MAX_ITER = 8;
+ static const double LOOP_TOL = 1e-7;
+
+ struct par_gn_sinu
+ {
+ double en[EN_SIZE];
+ double m, n, C_x, C_y;
+ };
+ /* Ellipsoidal Sinusoidal only */
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_gn_sinu_ellipsoid : public base_t_fi<base_gn_sinu_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_gn_sinu_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_gn_sinu_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_gn_sinu m_proj_parm;
+
+ inline base_gn_sinu_ellipsoid(const PAR& par)
+ : base_t_fi<base_gn_sinu_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double s, c;
+
+ xy_y = pj_mlfn(lp_lat, s = sin(lp_lat), c = cos(lp_lat), this->m_proj_parm.en);
+ xy_x = lp_lon * c / sqrt(1. - this->m_par.es * s * s);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double s;
+
+ if ((s = fabs(lp_lat = pj_inv_mlfn(xy_y, this->m_par.es, this->m_proj_parm.en))) < HALFPI) {
+ s = sin(lp_lat);
+ lp_lon = xy_x * sqrt(1. - this->m_par.es * s * s) / cos(lp_lat);
+ } else if ((s - EPS10) < HALFPI)
+ lp_lon = 0.;
+ else throw proj_exception();;
+ return;
+ }
+ /* General spherical sinusoidals */
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_gn_sinu_spheroid : public base_t_fi<base_gn_sinu_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_gn_sinu_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_gn_sinu_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_gn_sinu m_proj_parm;
+
+ inline base_gn_sinu_spheroid(const PAR& par)
+ : base_t_fi<base_gn_sinu_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if (!this->m_proj_parm.m)
+ lp_lat = this->m_proj_parm.n != 1. ? aasin(this->m_proj_parm.n * sin(lp_lat)): lp_lat;
+ else {
+ double k, V;
+ int i;
+
+ k = this->m_proj_parm.n * sin(lp_lat);
+ for (i = MAX_ITER; i ; --i) {
+ lp_lat -= V = (this->m_proj_parm.m * lp_lat + sin(lp_lat) - k) /
+ (this->m_proj_parm.m + cos(lp_lat));
+ if (fabs(V) < LOOP_TOL)
+ break;
+ }
+ if (!i)
+ throw proj_exception();
+ }
+ xy_x = this->m_proj_parm.C_x * lp_lon * (this->m_proj_parm.m + cos(lp_lat));
+ xy_y = this->m_proj_parm.C_y * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double s;
+
+ xy_y /= this->m_proj_parm.C_y;
+ lp_lat = this->m_proj_parm.m ? aasin((this->m_proj_parm.m * xy_y + sin(xy_y)) / this->m_proj_parm.n) :
+ ( this->m_proj_parm.n != 1. ? aasin(sin(xy_y) / this->m_proj_parm.n) : xy_y );
+ lp_lon = xy_x / (this->m_proj_parm.C_x * (this->m_proj_parm.m + cos(xy_y)));
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_gn_sinu& proj_parm)
+ {
+ par.es = 0;
+ proj_parm.C_x = (proj_parm.C_y = sqrt((proj_parm.m + 1.) / proj_parm.n))/(proj_parm.m + 1.);
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // General Sinusoidal Series
+ template <typename PAR>
+ void setup_gn_sinu(PAR& par, par_gn_sinu& proj_parm)
+ {
+ if (pj_param(par.params, "tn").i && pj_param(par.params, "tm").i) {
+ proj_parm.n = pj_param(par.params, "dn").f;
+ proj_parm.m = pj_param(par.params, "dm").f;
+ } else
+ throw proj_exception(-99);
+ setup(par, proj_parm);
+ }
+
+ // Sinusoidal (Sanson-Flamsteed)
+ template <typename PAR>
+ void setup_sinu(PAR& par, par_gn_sinu& proj_parm)
+ {
+ pj_enfn(par.es, proj_parm.en);
+
+ if (par.es) {
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ proj_parm.n = 1.;
+ proj_parm.m = 0.;
+ setup(par, proj_parm);
+ }
+ }
+
+ // Eckert VI
+ template <typename PAR>
+ void setup_eck6(PAR& par, par_gn_sinu& proj_parm)
+ {
+ proj_parm.m = 1.;
+ proj_parm.n = 2.570796326794896619231321691;
+ setup(par, proj_parm);
+ }
+
+ // McBryde-Thomas Flat-Polar Sinusoidal
+ template <typename PAR>
+ void setup_mbtfps(PAR& par, par_gn_sinu& proj_parm)
+ {
+ proj_parm.m = 0.5;
+ proj_parm.n = 1.785398163397448309615660845;
+ setup(par, proj_parm);
+ }
+
+ } // namespace gn_sinu
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Sinusoidal (Sanson-Flamsteed) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_sinu.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct sinu_ellipsoid : public impl::gn_sinu::base_gn_sinu_ellipsoid<LL, XY, PAR>
+ {
+ inline sinu_ellipsoid(const PAR& par) : impl::gn_sinu::base_gn_sinu_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::gn_sinu::setup_sinu(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief General Sinusoidal Series projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - m= n=
+ \par Example
+ \image html ex_gn_sinu.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct gn_sinu_spheroid : public impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>
+ {
+ inline gn_sinu_spheroid(const PAR& par) : impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gn_sinu::setup_gn_sinu(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Sinusoidal (Sanson-Flamsteed) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_sinu.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct sinu_spheroid : public impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>
+ {
+ inline sinu_spheroid(const PAR& par) : impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gn_sinu::setup_sinu(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Eckert VI projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_eck6.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct eck6_spheroid : public impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>
+ {
+ inline eck6_spheroid(const PAR& par) : impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gn_sinu::setup_eck6(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief McBryde-Thomas Flat-Polar Sinusoidal projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_mbtfps.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct mbtfps_spheroid : public impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>
+ {
+ inline mbtfps_spheroid(const PAR& par) : impl::gn_sinu::base_gn_sinu_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gn_sinu::setup_mbtfps(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class gn_sinu_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<gn_sinu_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class sinu_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<sinu_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<sinu_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class eck6_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<eck6_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class mbtfps_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<mbtfps_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void gn_sinu_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("gn_sinu", new gn_sinu_entry<LL, XY, PAR>);
+ factory.add_to_factory("sinu", new sinu_entry<LL, XY, PAR>);
+ factory.add_to_factory("eck6", new eck6_entry<LL, XY, PAR>);
+ factory.add_to_factory("mbtfps", new mbtfps_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GN_SINU_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/gnom.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/gnom.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,227 @@
+#ifndef _PROJECTIONS_GNOM_HPP
+#define _PROJECTIONS_GNOM_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace gnom
+ {
+ static const double EPS10 = 1.e-10;
+ static const int N_POLE = 0;
+ static const int S_POLE = 1;
+ static const int EQUIT = 2;
+ static const int OBLIQ = 3;
+
+ struct par_gnom
+ {
+ double sinph0;
+ double cosph0;
+ int mode;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_gnom_spheroid : public base_t_fi<base_gnom_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_gnom_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_gnom_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_gnom m_proj_parm;
+
+ inline base_gnom_spheroid(const PAR& par)
+ : base_t_fi<base_gnom_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, cosphi, sinphi;
+
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ coslam = cos(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ xy_y = cosphi * coslam;
+ break;
+ case OBLIQ:
+ xy_y = this->m_proj_parm.sinph0 * sinphi + this->m_proj_parm.cosph0 * cosphi * coslam;
+ break;
+ case S_POLE:
+ xy_y = - sinphi;
+ break;
+ case N_POLE:
+ xy_y = sinphi;
+ break;
+ }
+ if (xy_y <= EPS10) throw proj_exception();;
+ xy_x = (xy_y = 1. / xy_y) * cosphi * sin(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ xy_y *= sinphi;
+ break;
+ case OBLIQ:
+ xy_y *= this->m_proj_parm.cosph0 * sinphi - this->m_proj_parm.sinph0 * cosphi * coslam;
+ break;
+ case N_POLE:
+ coslam = - coslam;
+ case S_POLE:
+ xy_y *= cosphi * coslam;
+ break;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double rh, cosz, sinz;
+
+ rh = hypot(xy_x, xy_y);
+ sinz = sin(lp_lat = atan(rh));
+ cosz = sqrt(1. - sinz * sinz);
+ if (fabs(rh) <= EPS10) {
+ lp_lat = this->m_par.phi0;
+ lp_lon = 0.;
+ } else {
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ lp_lat = cosz * this->m_proj_parm.sinph0 + xy_y * sinz * this->m_proj_parm.cosph0 / rh;
+ if (fabs(lp_lat) >= 1.)
+ lp_lat = lp_lat > 0. ? HALFPI : - HALFPI;
+ else
+ lp_lat = asin(lp_lat);
+ xy_y = (cosz - this->m_proj_parm.sinph0 * sin(lp_lat)) * rh;
+ xy_x *= sinz * this->m_proj_parm.cosph0;
+ break;
+ case EQUIT:
+ lp_lat = xy_y * sinz / rh;
+ if (fabs(lp_lat) >= 1.)
+ lp_lat = lp_lat > 0. ? HALFPI : - HALFPI;
+ else
+ lp_lat = asin(lp_lat);
+ xy_y = cosz * rh;
+ xy_x *= sinz;
+ break;
+ case S_POLE:
+ lp_lat -= HALFPI;
+ break;
+ case N_POLE:
+ lp_lat = HALFPI - lp_lat;
+ xy_y = -xy_y;
+ break;
+ }
+ lp_lon = atan2(xy_x, xy_y);
+ }
+ }
+ };
+
+ // Gnomonic
+ template <typename PAR>
+ void setup_gnom(PAR& par, par_gnom& proj_parm)
+ {
+ if (fabs(fabs(par.phi0) - HALFPI) < EPS10)
+ proj_parm.mode = par.phi0 < 0. ? S_POLE : N_POLE;
+ else if (fabs(par.phi0) < EPS10)
+ proj_parm.mode = EQUIT;
+ else {
+ proj_parm.mode = OBLIQ;
+ proj_parm.sinph0 = sin(par.phi0);
+ proj_parm.cosph0 = cos(par.phi0);
+ }
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace gnom
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Gnomonic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ \par Example
+ \image html ex_gnom.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct gnom_spheroid : public impl::gnom::base_gnom_spheroid<LL, XY, PAR>
+ {
+ inline gnom_spheroid(const PAR& par) : impl::gnom::base_gnom_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gnom::setup_gnom(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class gnom_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<gnom_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void gnom_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("gnom", new gnom_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GNOM_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/goode.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/goode.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,160 @@
+#ifndef _PROJECTIONS_GOODE_HPP
+#define _PROJECTIONS_GOODE_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+#include <geometry/projections/proj/moll.hpp>
+#include <geometry/projections/proj/gn_sinu.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace goode
+ {
+ static const double Y_COR = 0.05280;
+ static const double PHI_LIM = .71093078197902358062;
+
+ template <typename LL, typename XY, typename PAR>
+ struct par_goode
+ {
+ sinu_ellipsoid<LL, XY, PAR> sinu;
+ moll_spheroid<LL, XY, PAR> moll;
+
+ par_goode(const PAR& par) : sinu(par), moll(par) {}
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_goode_spheroid : public base_t_fi<base_goode_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_goode_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_goode_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_goode<LL, XY, PAR> m_proj_parm;
+
+ inline base_goode_spheroid(const PAR& par)
+ : base_t_fi<base_goode_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par), m_proj_parm(par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if (fabs(lp_lat) <= PHI_LIM)
+ this->m_proj_parm.sinu.fwd(lp_lon, lp_lat, xy_x, xy_y);
+ else {
+ this->m_proj_parm.moll.fwd(lp_lon, lp_lat, xy_x, xy_y);
+ xy_y -= lp_lat >= 0.0 ? Y_COR : -Y_COR;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ if (fabs(xy_y) <= PHI_LIM)
+ this->m_proj_parm.sinu.inv(xy_x, xy_y, lp_lon, lp_lat);
+ else {
+ xy_y += xy_y >= 0.0 ? Y_COR : -Y_COR;
+ this->m_proj_parm.moll.inv(xy_x, xy_y, lp_lon, lp_lat);
+ }
+ }
+ };
+
+ // Goode Homolosine
+ template <typename LL, typename XY, typename PAR>
+ void setup_goode(PAR& par, par_goode<LL, XY, PAR>& proj_parm)
+ {
+ par.es = 0.;
+ // par.fwd = s_forward;
+ // par.inv = s_inverse;
+ }
+
+ } // namespace goode
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Goode Homolosine projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_goode.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct goode_spheroid : public impl::goode::base_goode_spheroid<LL, XY, PAR>
+ {
+ inline goode_spheroid(const PAR& par) : impl::goode::base_goode_spheroid<LL, XY, PAR>(par)
+ {
+ impl::goode::setup_goode(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class goode_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<goode_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void goode_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("goode", new goode_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GOODE_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/gstmerc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/gstmerc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,169 @@
+#ifndef _PROJECTIONS_GSTMERC_HPP
+#define _PROJECTIONS_GSTMERC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_tsfn.hpp>
+#include <geometry/projections/impl/pj_phi2.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace gstmerc
+ {
+
+ struct par_gstmerc
+ {
+ double lamc;
+ double phic;
+ double c;
+ double n1;
+ double n2;
+ double XS;
+ double YS;
+ };
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_gstmerc_spheroid : public base_t_fi<base_gstmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_gstmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_gstmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_gstmerc m_proj_parm;
+
+ inline base_gstmerc_spheroid(const PAR& par)
+ : base_t_fi<base_gstmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double L, Ls, sinLs1, Ls1;
+ L= this->m_proj_parm.n1*lp_lon;
+ Ls= this->m_proj_parm.c+this->m_proj_parm.n1*log(pj_tsfn(-1.0*lp_lat,-1.0*sin(lp_lat),this->m_par.e));
+ sinLs1= sin(L)/cosh(Ls);
+ Ls1= log(pj_tsfn(-1.0*asin(sinLs1),0.0,0.0));
+ xy_x= (this->m_proj_parm.XS + this->m_proj_parm.n2*Ls1)*this->m_par.ra;
+ xy_y= (this->m_proj_parm.YS + this->m_proj_parm.n2*atan(sinh(Ls)/cos(L)))*this->m_par.ra;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double L, LC, sinC;
+ L= atan(sinh((xy_x - this->m_proj_parm.XS)*this->m_par.a/this->m_proj_parm.n2)/cos((xy_y - this->m_proj_parm.YS)*this->m_par.a/this->m_proj_parm.n2));
+ sinC= sin((xy_y - this->m_proj_parm.YS)*this->m_par.a/this->m_proj_parm.n2)/cosh((xy_x - this->m_proj_parm.XS)*this->m_par.a/this->m_proj_parm.n2);
+ LC= log(pj_tsfn(-1.0*asin(sinC),0.0,0.0));
+ lp_lon= L/this->m_proj_parm.n1;
+ lp_lat= -1.0*pj_phi2(exp((LC-this->m_proj_parm.c)/this->m_proj_parm.n1),this->m_par.e);
+ }
+ };
+
+ // Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)
+ template <typename PAR>
+ void setup_gstmerc(PAR& par, par_gstmerc& proj_parm)
+ {
+ proj_parm.n1= sqrt(1.0+par.es*pow(cos(par.phi0),4.0)/(1.0-par.es));
+ proj_parm.phic= asin(sin(par.phi0)/proj_parm.n1);
+ proj_parm.c= log(pj_tsfn(-1.0*proj_parm.phic,0.0,0.0))
+ -proj_parm.n1*log(pj_tsfn(-1.0*par.phi0,-1.0*sin(par.phi0),par.e));
+ proj_parm.n2= par.k0*par.a*sqrt(1.0-par.es)/(1.0-par.es*sin(par.phi0)*sin(par.phi0));
+ proj_parm.XS= 0;
+ proj_parm.YS= -1.0*proj_parm.n2*proj_parm.phic;
+ // par.inv= s_inverse;
+ // par.fwd= s_forward;
+ }
+
+ } // namespace gstmerc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ - lat_0= lon_0= k_0=
+ \par Example
+ \image html ex_gstmerc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct gstmerc_spheroid : public impl::gstmerc::base_gstmerc_spheroid<LL, XY, PAR>
+ {
+ inline gstmerc_spheroid(const PAR& par) : impl::gstmerc::base_gstmerc_spheroid<LL, XY, PAR>(par)
+ {
+ impl::gstmerc::setup_gstmerc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class gstmerc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<gstmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void gstmerc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("gstmerc", new gstmerc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_GSTMERC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/hammer.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/hammer.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,152 @@
+#ifndef _PROJECTIONS_HAMMER_HPP
+#define _PROJECTIONS_HAMMER_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace hammer
+ {
+
+ struct par_hammer
+ {
+ double w;
+ double m, rm;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_hammer_spheroid : public base_t_f<base_hammer_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_hammer_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_hammer_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_hammer m_proj_parm;
+
+ inline base_hammer_spheroid(const PAR& par)
+ : base_t_f<base_hammer_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double cosphi, d;
+
+ d = sqrt(2./(1. + (cosphi = cos(lp_lat)) * cos(lp_lon *= this->m_proj_parm.w)));
+ xy_x = this->m_proj_parm.m * d * cosphi * sin(lp_lon);
+ xy_y = this->m_proj_parm.rm * d * sin(lp_lat);
+ }
+ };
+
+ // Hammer & Eckert-Greifendorff
+ template <typename PAR>
+ void setup_hammer(PAR& par, par_hammer& proj_parm)
+ {
+ if (pj_param(par.params, "tW").i) {
+ if ((proj_parm.w = fabs(pj_param(par.params, "dW").f)) <= 0.) throw proj_exception(-27);
+ } else
+ proj_parm.w = .5;
+ if (pj_param(par.params, "tM").i) {
+ if ((proj_parm.m = fabs(pj_param(par.params, "dM").f)) <= 0.) throw proj_exception(-27);
+ } else
+ proj_parm.m = 1.;
+ proj_parm.rm = 1. / proj_parm.m;
+ proj_parm.m /= proj_parm.w;
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace hammer
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Hammer & Eckert-Greifendorff projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ - W= M=
+ \par Example
+ \image html ex_hammer.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct hammer_spheroid : public impl::hammer::base_hammer_spheroid<LL, XY, PAR>
+ {
+ inline hammer_spheroid(const PAR& par) : impl::hammer::base_hammer_spheroid<LL, XY, PAR>(par)
+ {
+ impl::hammer::setup_hammer(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class hammer_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<hammer_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void hammer_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("hammer", new hammer_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_HAMMER_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/hatano.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/hatano.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,173 @@
+#ifndef _PROJECTIONS_HATANO_HPP
+#define _PROJECTIONS_HATANO_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace hatano
+ {
+ static const int NITER = 20;
+ static const double EPS = 1e-7;
+ static const double ONETOL = 1.000001;
+ static const double CN = 2.67595;
+ static const double CS = 2.43763;
+ static const double RCN = 0.37369906014686373063;
+ static const double RCS = 0.41023453108141924738;
+ static const double FYCN = 1.75859;
+ static const double FYCS = 1.93052;
+ static const double RYCN = 0.56863737426006061674;
+ static const double RYCS = 0.51799515156538134803;
+ static const double FXC = 0.85;
+ static const double RXC = 1.17647058823529411764;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_hatano_spheroid : public base_t_fi<base_hatano_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_hatano_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_hatano_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_hatano_spheroid(const PAR& par)
+ : base_t_fi<base_hatano_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double th1, c;
+ int i;
+
+ c = sin(lp_lat) * (lp_lat < 0. ? CS : CN);
+ for (i = NITER; i; --i) {
+ lp_lat -= th1 = (lp_lat + sin(lp_lat) - c) / (1. + cos(lp_lat));
+ if (fabs(th1) < EPS) break;
+ }
+ xy_x = FXC * lp_lon * cos(lp_lat *= .5);
+ xy_y = sin(lp_lat) * (lp_lat < 0. ? FYCS : FYCN);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double th;
+
+ th = xy_y * ( xy_y < 0. ? RYCS : RYCN);
+ if (fabs(th) > 1.)
+ if (fabs(th) > ONETOL) throw proj_exception();
+ else th = th > 0. ? HALFPI : - HALFPI;
+ else
+ th = asin(th);
+ lp_lon = RXC * xy_x / cos(th);
+ th += th;
+ lp_lat = (th + sin(th)) * (xy_y < 0. ? RCS : RCN);
+ if (fabs(lp_lat) > 1.)
+ if (fabs(lp_lat) > ONETOL) throw proj_exception();
+ else lp_lat = lp_lat > 0. ? HALFPI : - HALFPI;
+ else
+ lp_lat = asin(lp_lat);
+ }
+ };
+
+ // Hatano Asymmetrical Equal Area
+ template <typename PAR>
+ void setup_hatano(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace hatano
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Hatano Asymmetrical Equal Area projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_hatano.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct hatano_spheroid : public impl::hatano::base_hatano_spheroid<LL, XY, PAR>
+ {
+ inline hatano_spheroid(const PAR& par) : impl::hatano::base_hatano_spheroid<LL, XY, PAR>(par)
+ {
+ impl::hatano::setup_hatano(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class hatano_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<hatano_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void hatano_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("hatano", new hatano_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_HATANO_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/imw_p.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/imw_p.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,281 @@
+#ifndef _PROJECTIONS_IMW_P_HPP
+#define _PROJECTIONS_IMW_P_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace imw_p
+ {
+ static const double TOL = 1e-10;
+ static const double EPS = 1e-10;
+
+ struct PXY { double x, y; }; // x/y projection specific
+
+ struct par_imw_p
+ {
+ double P, Pp, Q, Qp, R_1, R_2, sphi_1, sphi_2, C2;
+ double phi_1, phi_2, lam_1;
+ double en[EN_SIZE];
+ int mode; /* = 0, phi_1 and phi_2 != 0, = 1, phi_1 = 0, = -1 phi_2 = 0 */
+ };
+ template <typename PAR>
+ inline int
+ phi12(PAR& par, par_imw_p& proj_parm, double *del, double *sig) {
+ int err = 0;
+
+ if (!pj_param(par.params, "tlat_1").i ||
+ !pj_param(par.params, "tlat_2").i) {
+ err = -41;
+ } else {
+ proj_parm.phi_1 = pj_param(par.params, "rlat_1").f;
+ proj_parm.phi_2 = pj_param(par.params, "rlat_2").f;
+ *del = 0.5 * (proj_parm.phi_2 - proj_parm.phi_1);
+ *sig = 0.5 * (proj_parm.phi_2 + proj_parm.phi_1);
+ err = (fabs(*del) < EPS || fabs(*sig) < EPS) ? -42 : 0;
+ }
+ return err;
+ }
+ template <typename PAR>
+ inline PXY
+ loc_for(const double& lp_lam, const double& lp_phi, const PAR& par, const par_imw_p& proj_parm, double *yc) {
+ PXY xy;
+
+ if (! lp_phi) {
+ xy.x = lp_lam;
+ xy.y = 0.;
+ } else {
+ double xa, ya, xb, yb, xc, yc, D, B, m, sp, t, R, C;
+
+ sp = sin(lp_phi);
+ m = pj_mlfn(lp_phi, sp, cos(lp_phi), proj_parm.en);
+ xa = proj_parm.Pp + proj_parm.Qp * m;
+ ya = proj_parm.P + proj_parm.Q * m;
+ R = 1. / (tan(lp_phi) * sqrt(1. - par.es * sp * sp));
+ C = sqrt(R * R - xa * xa);
+ if (lp_phi < 0.) C = - C;
+ C += ya - R;
+ if (proj_parm.mode < 0) {
+ xb = lp_lam;
+ yb = proj_parm.C2;
+ } else {
+ t = lp_lam * proj_parm.sphi_2;
+ xb = proj_parm.R_2 * sin(t);
+ yb = proj_parm.C2 + proj_parm.R_2 * (1. - cos(t));
+ }
+ if (proj_parm.mode > 0) {
+ xc = lp_lam;
+ yc = 0.;
+ } else {
+ t = lp_lam * proj_parm.sphi_1;
+ xc = proj_parm.R_1 * sin(t);
+ yc = proj_parm.R_1 * (1. - cos(t));
+ }
+ D = (xb - xc)/(yb - yc);
+ B = xc + D * (C + R - yc);
+ xy.x = D * sqrt(R * R * (1 + D * D) - B * B);
+ if (lp_phi > 0)
+ xy.x = - xy.x;
+ xy.x = (B + xy.x) / (1. + D * D);
+ xy.y = sqrt(R * R - xy.x * xy.x);
+ if (lp_phi > 0)
+ xy.y = - xy.y;
+ xy.y += C + R;
+ }
+ return (xy);
+ }
+
+ template <typename PAR>
+ inline void
+ xy(PAR& par, par_imw_p& proj_parm, double phi, double *x, double *y, double *sp, double *R) {
+ double F;
+
+ *sp = sin(phi);
+ *R = 1./(tan(phi) * sqrt(1. - par.es * *sp * *sp ));
+ F = proj_parm.lam_1 * *sp;
+ *y = *R * (1 - cos(F));
+ *x = *R * sin(F);
+ }
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_imw_p_ellipsoid : public base_t_fi<base_imw_p_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_imw_p_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_imw_p_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_imw_p m_proj_parm;
+
+ inline base_imw_p_ellipsoid(const PAR& par)
+ : base_t_fi<base_imw_p_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double yc;
+ PXY xy = loc_for(lp_lon, lp_lat, this->m_par, m_proj_parm, &yc);
+ xy_x = xy.x; xy_y = xy.y;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ PXY t;
+ double yc;
+
+ lp_lat = this->m_proj_parm.phi_2;
+ lp_lon = xy_x / cos(lp_lat);
+ do {
+ t = loc_for(lp_lon, lp_lat, this->m_par, m_proj_parm, &yc);
+ lp_lat = ((lp_lat - this->m_proj_parm.phi_1) * (xy_y - yc) / (t.y - yc)) + this->m_proj_parm.phi_1;
+ lp_lon = lp_lon * xy_x / t.x;
+ } while (fabs(t.x - xy_x) > TOL || fabs(t.y - xy_y) > TOL);
+ }
+ };
+
+ // International Map of the World Polyconic
+ template <typename PAR>
+ void setup_imw_p(PAR& par, par_imw_p& proj_parm)
+ {
+ double del, sig, s, t, x1, x2, T2, y1, m1, m2, y2;
+ int i;
+ pj_enfn(par.es, proj_parm.en);
+ if( (i = phi12(par, proj_parm, &del, &sig)) != 0)
+ throw proj_exception(i);
+ if (proj_parm.phi_2 < proj_parm.phi_1) { /* make sure proj_parm.phi_1 most southerly */
+ del = proj_parm.phi_1;
+ proj_parm.phi_1 = proj_parm.phi_2;
+ proj_parm.phi_2 = del;
+ }
+ if (pj_param(par.params, "tlon_1").i)
+ proj_parm.lam_1 = pj_param(par.params, "rlon_1").f;
+ else { /* use predefined based upon latitude */
+ sig = fabs(sig * RAD_TO_DEG);
+ if (sig <= 60) sig = 2.;
+ else if (sig <= 76) sig = 4.;
+ else sig = 8.;
+ proj_parm.lam_1 = sig * DEG_TO_RAD;
+ }
+ proj_parm.mode = 0;
+ if (proj_parm.phi_1) xy(par, proj_parm, proj_parm.phi_1, &x1, &y1, &proj_parm.sphi_1, &proj_parm.R_1);
+ else {
+ proj_parm.mode = 1;
+ y1 = 0.;
+ x1 = proj_parm.lam_1;
+ }
+ if (proj_parm.phi_2) xy(par, proj_parm, proj_parm.phi_2, &x2, &T2, &proj_parm.sphi_2, &proj_parm.R_2);
+ else {
+ proj_parm.mode = -1;
+ T2 = 0.;
+ x2 = proj_parm.lam_1;
+ }
+ m1 = pj_mlfn(proj_parm.phi_1, proj_parm.sphi_1, cos(proj_parm.phi_1), proj_parm.en);
+ m2 = pj_mlfn(proj_parm.phi_2, proj_parm.sphi_2, cos(proj_parm.phi_2), proj_parm.en);
+ t = m2 - m1;
+ s = x2 - x1;
+ y2 = sqrt(t * t - s * s) + y1;
+ proj_parm.C2 = y2 - T2;
+ t = 1. / t;
+ proj_parm.P = (m2 * y1 - m1 * y2) * t;
+ proj_parm.Q = (y2 - y1) * t;
+ proj_parm.Pp = (m2 * x1 - m1 * x2) * t;
+ proj_parm.Qp = (x2 - x1) * t;
+ // par.fwd = e_forward;
+ // par.inv = e_inverse;
+ }
+
+ } // namespace imw_p
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief International Map of the World Polyconic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Mod Polyconic
+ - Ellipsoid
+ - lat_1= and lat_2= [lon_1=]
+ \par Example
+ \image html ex_imw_p.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct imw_p_ellipsoid : public impl::imw_p::base_imw_p_ellipsoid<LL, XY, PAR>
+ {
+ inline imw_p_ellipsoid(const PAR& par) : impl::imw_p::base_imw_p_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::imw_p::setup_imw_p(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class imw_p_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<imw_p_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void imw_p_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("imw_p", new imw_p_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_IMW_P_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/krovak.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/krovak.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,338 @@
+#ifndef _PROJECTIONS_KROVAK_HPP
+#define _PROJECTIONS_KROVAK_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace krovak
+ {
+
+ struct par_krovak
+ {
+ double C_x;
+ };
+
+
+
+
+
+ /**
+ NOTES: According to EPSG the full Krovak projection method should have
+ the following parameters. Within PROJ.4 the azimuth, and pseudo
+ standard parallel are hardcoded in the algorithm and can't be
+ altered from outside. The others all have defaults to match the
+ common usage with Krovak projection.
+
+ lat_0 = latitude of centre of the projection
+
+ lon_0 = longitude of centre of the projection
+
+ ** = azimuth (true) of the centre line passing through the centre of the projection
+
+ ** = latitude of pseudo standard parallel
+
+ k = scale factor on the pseudo standard parallel
+
+ x_0 = False Easting of the centre of the projection at the apex of the cone
+
+ y_0 = False Northing of the centre of the projection at the apex of the cone
+
+ **/
+
+
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_krovak_ellipsoid : public base_t_fi<base_krovak_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_krovak_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_krovak_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_krovak m_proj_parm;
+
+ inline base_krovak_ellipsoid(const PAR& par)
+ : base_t_fi<base_krovak_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ /* calculate xy from lat/lon */
+
+ char errmess[255];
+ char tmp[16];
+
+ /* Constants, identical to inverse transform function */
+ double s45, s90, e2, e, alfa, uq, u0, g, k, k1, n0, ro0, ad, a, s0, n;
+ double gfi, u, fi0, lon17, lamdd, deltav, s, d, eps, ro;
+
+
+ s45 = 0.785398163397448; /* 45° */
+ s90 = 2 * s45;
+ fi0 = this->m_par.phi0; /* Latitude of projection centre 49° 30' */
+
+ /* Ellipsoid is used as Parameter in for.c and inv.c, therefore a must
+ be set to 1 here.
+ Ellipsoid Bessel 1841 a = 6377397.155m 1/f = 299.1528128,
+ e2=0.006674372230614;
+ */
+ a = 1; /* 6377397.155; */
+ /* e2 = this->m_par.es;*/ /* 0.006674372230614; */
+ e2 = 0.006674372230614;
+ e = sqrt(e2);
+
+ alfa = sqrt(1. + (e2 * pow(cos(fi0), 4)) / (1. - e2));
+
+ uq = 1.04216856380474; /* DU(2, 59, 42, 42.69689) */
+ u0 = asin(sin(fi0) / alfa);
+ g = pow( (1. + e * sin(fi0)) / (1. - e * sin(fi0)) , alfa * e / 2. );
+
+ k = tan( u0 / 2. + s45) / pow (tan(fi0 / 2. + s45) , alfa) * g;
+
+ k1 = this->m_par.k0;
+ n0 = a * sqrt(1. - e2) / (1. - e2 * pow(sin(fi0), 2));
+ s0 = 1.37008346281555; /* Latitude of pseudo standard parallel 78° 30'00" N */
+ n = sin(s0);
+ ro0 = k1 * n0 / tan(s0);
+ ad = s90 - uq;
+
+ /* Transformation */
+
+ gfi =pow ( ((1. + e * sin(lp_lat)) /
+ (1. - e * sin(lp_lat))) , (alfa * e / 2.));
+
+ u= 2. * (atan(k * pow( tan(lp_lat / 2. + s45), alfa) / gfi)-s45);
+
+ deltav = - lp_lon * alfa;
+
+ s = asin(cos(ad) * sin(u) + sin(ad) * cos(u) * cos(deltav));
+ d = asin(cos(u) * sin(deltav) / cos(s));
+ eps = n * d;
+ ro = ro0 * pow(tan(s0 / 2. + s45) , n) / pow(tan(s / 2. + s45) , n) ;
+
+ /* x and y are reverted! */
+ xy_y = ro * cos(eps) / a;
+ xy_x = ro * sin(eps) / a;
+
+ if( !pj_param(this->m_par.params, "tczech").i )
+ {
+ xy_y *= -1.0;
+ xy_x *= -1.0;
+ }
+
+ return;
+ }
+
+
+
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ /* calculate lat/lon from xy */
+
+ /* Constants, identisch wie in der Umkehrfunktion */
+ double s45, s90, fi0, e2, e, alfa, uq, u0, g, k, k1, n0, ro0, ad, a, s0, n;
+ double u, l24, lamdd, deltav, s, d, eps, ro, fi1, xy0, lon17;
+ int ok;
+
+ s45 = 0.785398163397448; /* 45° */
+ s90 = 2 * s45;
+ fi0 = this->m_par.phi0; /* Latitude of projection centre 49° 30' */
+
+
+ /* Ellipsoid is used as Parameter in for.c and inv.c, therefore a must
+ be set to 1 here.
+ Ellipsoid Bessel 1841 a = 6377397.155m 1/f = 299.1528128,
+ e2=0.006674372230614;
+ */
+ a = 1; /* 6377397.155; */
+ /* e2 = this->m_par.es; */ /* 0.006674372230614; */
+ e2 = 0.006674372230614;
+ e = sqrt(e2);
+
+ alfa = sqrt(1. + (e2 * pow(cos(fi0), 4)) / (1. - e2));
+ uq = 1.04216856380474; /* DU(2, 59, 42, 42.69689) */
+ u0 = asin(sin(fi0) / alfa);
+ g = pow( (1. + e * sin(fi0)) / (1. - e * sin(fi0)) , alfa * e / 2. );
+
+ k = tan( u0 / 2. + s45) / pow (tan(fi0 / 2. + s45) , alfa) * g;
+
+ k1 = this->m_par.k0;
+ n0 = a * sqrt(1. - e2) / (1. - e2 * pow(sin(fi0), 2));
+ s0 = 1.37008346281555; /* Latitude of pseudo standard parallel 78° 30'00" N */
+ n = sin(s0);
+ ro0 = k1 * n0 / tan(s0);
+ ad = s90 - uq;
+
+
+ /* Transformation */
+ /* revert y, x*/
+ xy0=xy_x;
+ xy_x=xy_y;
+ xy_y=xy0;
+
+ if( !pj_param(this->m_par.params, "tczech").i )
+ {
+ xy_x *= -1.0;
+ xy_y *= -1.0;
+ }
+
+ ro = sqrt(xy_x * xy_x + xy_y * xy_y);
+ eps = atan2(xy_y, xy_x);
+ d = eps / sin(s0);
+ s = 2. * (atan( pow(ro0 / ro, 1. / n) * tan(s0 / 2. + s45)) - s45);
+
+ u = asin(cos(ad) * sin(s) - sin(ad) * cos(s) * cos(d));
+ deltav = asin(cos(s) * sin(d) / cos(u));
+
+ lp_lon = this->m_par.lam0 - deltav / alfa;
+
+ /* ITERATION FOR lp_lat */
+ fi1 = u;
+
+ ok = 0;
+ do
+ {
+ lp_lat = 2. * ( atan( pow( k, -1. / alfa) *
+ pow( tan(u / 2. + s45) , 1. / alfa) *
+ pow( (1. + e * sin(fi1)) / (1. - e * sin(fi1)) , e / 2.)
+ ) - s45);
+
+ if (fabs(fi1 - lp_lat) < 0.000000000000001) ok=1;
+ fi1 = lp_lat;
+
+ }
+ while (ok==0);
+
+ lp_lon -= this->m_par.lam0;
+
+ return;
+ }
+
+ };
+
+ // Krovak
+ template <typename PAR>
+ void setup_krovak(PAR& par, par_krovak& proj_parm)
+ {
+ double ts;
+ /* read some Parameters,
+ * here Latitude Truescale */
+ ts = pj_param(par.params, "rlat_ts").f;
+ proj_parm.C_x = ts;
+
+ /* we want Bessel as fixed ellipsoid */
+ par.a = 6377397.155;
+ par.e = sqrt(par.es = 0.006674372230614);
+ /* if latitude of projection center is not set, use 49d30'N */
+ if (!pj_param(par.params, "tlat_0").i)
+ par.phi0 = 0.863937979737193;
+
+ /* if center long is not set use 42d30'E of Ferro - 17d40' for Ferro */
+ /* that will correspond to using longitudes relative to greenwich */
+ /* as input and output, instead of lat/long relative to Ferro */
+ if (!pj_param(par.params, "tlon_0").i)
+ par.lam0 = 0.7417649320975901 - 0.308341501185665;
+ /* if scale not set default to 0.9999 */
+ if (!pj_param(par.params, "tk").i)
+ par.k0 = 0.9999;
+ /* always the same */
+ // par.inv = e_inverse;
+
+ // par.fwd = e_forward;
+ }
+
+ } // namespace krovak
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Krovak projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Ellps
+ \par Example
+ \image html ex_krovak.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct krovak_ellipsoid : public impl::krovak::base_krovak_ellipsoid<LL, XY, PAR>
+ {
+ inline krovak_ellipsoid(const PAR& par) : impl::krovak::base_krovak_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::krovak::setup_krovak(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class krovak_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<krovak_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void krovak_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("krovak", new krovak_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_KROVAK_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/labrd.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/labrd.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,231 @@
+#ifndef _PROJECTIONS_LABRD_HPP
+#define _PROJECTIONS_LABRD_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace labrd
+ {
+ static const double EPS = 1.e-10;
+
+ struct par_labrd
+ {
+ double Az, kRg, p0s, A, C, Ca, Cb, Cc, Cd;
+ int rot;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_labrd_ellipsoid : public base_t_fi<base_labrd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_labrd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_labrd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_labrd m_proj_parm;
+
+ inline base_labrd_ellipsoid(const PAR& par)
+ : base_t_fi<base_labrd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double V1, V2, ps, sinps, cosps, sinps2, cosps2, I1, I2, I3, I4, I5, I6,
+ x2, y2, t;
+
+ V1 = this->m_proj_parm.A * log( tan(FORTPI + .5 * lp_lat) );
+ t = this->m_par.e * sin(lp_lat);
+ V2 = .5 * this->m_par.e * this->m_proj_parm.A * log ((1. + t)/(1. - t));
+ ps = 2. * (atan(exp(V1 - V2 + this->m_proj_parm.C)) - FORTPI);
+ I1 = ps - this->m_proj_parm.p0s;
+ cosps = cos(ps); cosps2 = cosps * cosps;
+ sinps = sin(ps); sinps2 = sinps * sinps;
+ I4 = this->m_proj_parm.A * cosps;
+ I2 = .5 * this->m_proj_parm.A * I4 * sinps;
+ I3 = I2 * this->m_proj_parm.A * this->m_proj_parm.A * (5. * cosps2 - sinps2) / 12.;
+ I6 = I4 * this->m_proj_parm.A * this->m_proj_parm.A;
+ I5 = I6 * (cosps2 - sinps2) / 6.;
+ I6 *= this->m_proj_parm.A * this->m_proj_parm.A *
+ (5. * cosps2 * cosps2 + sinps2 * (sinps2 - 18. * cosps2)) / 120.;
+ t = lp_lon * lp_lon;
+ xy_x = this->m_proj_parm.kRg * lp_lon * (I4 + t * (I5 + t * I6));
+ xy_y = this->m_proj_parm.kRg * (I1 + t * (I2 + t * I3));
+ x2 = xy_x * xy_x;
+ y2 = xy_y * xy_y;
+ V1 = 3. * xy_x * y2 - xy_x * x2;
+ V2 = xy_y * y2 - 3. * x2 * xy_y;
+ xy_x += this->m_proj_parm.Ca * V1 + this->m_proj_parm.Cb * V2;
+ xy_y += this->m_proj_parm.Ca * V2 - this->m_proj_parm.Cb * V1;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double x2, y2, V1, V2, V3, V4, t, t2, ps, pe, tpe, s,
+ I7, I8, I9, I10, I11, d, Re;
+ int i;
+
+ x2 = xy_x * xy_x;
+ y2 = xy_y * xy_y;
+ V1 = 3. * xy_x * y2 - xy_x * x2;
+ V2 = xy_y * y2 - 3. * x2 * xy_y;
+ V3 = xy_x * (5. * y2 * y2 + x2 * (-10. * y2 + x2 ));
+ V4 = xy_y * (5. * x2 * x2 + y2 * (-10. * x2 + y2 ));
+ xy_x += - this->m_proj_parm.Ca * V1 - this->m_proj_parm.Cb * V2 + this->m_proj_parm.Cc * V3 + this->m_proj_parm.Cd * V4;
+ xy_y += this->m_proj_parm.Cb * V1 - this->m_proj_parm.Ca * V2 - this->m_proj_parm.Cd * V3 + this->m_proj_parm.Cc * V4;
+ ps = this->m_proj_parm.p0s + xy_y / this->m_proj_parm.kRg;
+ pe = ps + this->m_par.phi0 - this->m_proj_parm.p0s;
+ for ( i = 20; i; --i) {
+ V1 = this->m_proj_parm.A * log(tan(FORTPI + .5 * pe));
+ tpe = this->m_par.e * sin(pe);
+ V2 = .5 * this->m_par.e * this->m_proj_parm.A * log((1. + tpe)/(1. - tpe));
+ t = ps - 2. * (atan(exp(V1 - V2 + this->m_proj_parm.C)) - FORTPI);
+ pe += t;
+ if (fabs(t) < EPS)
+ break;
+ }
+ /*
+ if (!i) {
+ } else {
+ }
+ */
+ t = this->m_par.e * sin(pe);
+ t = 1. - t * t;
+ Re = this->m_par.one_es / ( t * sqrt(t) );
+ t = tan(ps);
+ t2 = t * t;
+ s = this->m_proj_parm.kRg * this->m_proj_parm.kRg;
+ d = Re * this->m_par.k0 * this->m_proj_parm.kRg;
+ I7 = t / (2. * d);
+ I8 = t * (5. + 3. * t2) / (24. * d * s);
+ d = cos(ps) * this->m_proj_parm.kRg * this->m_proj_parm.A;
+ I9 = 1. / d;
+ d *= s;
+ I10 = (1. + 2. * t2) / (6. * d);
+ I11 = (5. + t2 * (28. + 24. * t2)) / (120. * d * s);
+ x2 = xy_x * xy_x;
+ lp_lat = pe + x2 * (-I7 + I8 * x2);
+ lp_lon = xy_x * (I9 + x2 * (-I10 + x2 * I11));
+ }
+ };
+
+ // Laborde
+ template <typename PAR>
+ void setup_labrd(PAR& par, par_labrd& proj_parm)
+ {
+ double Az, sinp, R, N, t;
+ proj_parm.rot = pj_param(par.params, "bno_rot").i == 0;
+ Az = pj_param(par.params, "razi").f;
+ sinp = sin(par.phi0);
+ t = 1. - par.es * sinp * sinp;
+ N = 1. / sqrt(t);
+ R = par.one_es * N / t;
+ proj_parm.kRg = par.k0 * sqrt( N * R );
+ proj_parm.p0s = atan( sqrt(R / N) * tan(par.phi0) );
+ proj_parm.A = sinp / sin(proj_parm.p0s);
+ t = par.e * sinp;
+ proj_parm.C = .5 * par.e * proj_parm.A * log((1. + t)/(1. - t)) +
+ - proj_parm.A * log( tan(FORTPI + .5 * par.phi0))
+ + log( tan(FORTPI + .5 * proj_parm.p0s));
+ t = Az + Az;
+ proj_parm.Ca = (1. - cos(t)) * ( proj_parm.Cb = 1. / (12. * proj_parm.kRg * proj_parm.kRg) );
+ proj_parm.Cb *= sin(t);
+ proj_parm.Cc = 3. * (proj_parm.Ca * proj_parm.Ca - proj_parm.Cb * proj_parm.Cb);
+ proj_parm.Cd = 6. * proj_parm.Ca * proj_parm.Cb;
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+ } // namespace labrd
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Laborde projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Special for Madagascar
+ \par Example
+ \image html ex_labrd.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct labrd_ellipsoid : public impl::labrd::base_labrd_ellipsoid<LL, XY, PAR>
+ {
+ inline labrd_ellipsoid(const PAR& par) : impl::labrd::base_labrd_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::labrd::setup_labrd(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class labrd_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<labrd_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void labrd_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("labrd", new labrd_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LABRD_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/laea.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/laea.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,389 @@
+#ifndef _PROJECTIONS_LAEA_HPP
+#define _PROJECTIONS_LAEA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_qsfn.hpp>
+#include <geometry/projections/impl/pj_auth.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace laea
+ {
+ static const double EPS10 = 1.e-10;
+ static const int NITER = 20;
+ static const double CONV = 1.e-10;
+ static const int N_POLE = 0;
+ static const int S_POLE = 1;
+ static const int EQUIT = 2;
+ static const int OBLIQ = 3;
+
+ struct par_laea
+ {
+ double sinb1;
+ double cosb1;
+ double xmf;
+ double ymf;
+ double mmf;
+ double qp;
+ double dd;
+ double rq;
+ double apa[APA_SIZE];
+ int mode;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_laea_ellipsoid : public base_t_fi<base_laea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_laea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_laea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_laea m_proj_parm;
+
+ inline base_laea_ellipsoid(const PAR& par)
+ : base_t_fi<base_laea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, sinlam, sinphi, q, sinb=0.0, cosb=0.0, b=0.0;
+
+ coslam = cos(lp_lon);
+ sinlam = sin(lp_lon);
+ sinphi = sin(lp_lat);
+ q = pj_qsfn(sinphi, this->m_par.e, this->m_par.one_es);
+ if (this->m_proj_parm.mode == OBLIQ || this->m_proj_parm.mode == EQUIT) {
+ sinb = q / this->m_proj_parm.qp;
+ cosb = sqrt(1. - sinb * sinb);
+ }
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ b = 1. + this->m_proj_parm.sinb1 * sinb + this->m_proj_parm.cosb1 * cosb * coslam;
+ break;
+ case EQUIT:
+ b = 1. + cosb * coslam;
+ break;
+ case N_POLE:
+ b = HALFPI + lp_lat;
+ q = this->m_proj_parm.qp - q;
+ break;
+ case S_POLE:
+ b = lp_lat - HALFPI;
+ q = this->m_proj_parm.qp + q;
+ break;
+ }
+ if (fabs(b) < EPS10) throw proj_exception();;
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ xy_y = this->m_proj_parm.ymf * ( b = sqrt(2. / b) )
+ * (this->m_proj_parm.cosb1 * sinb - this->m_proj_parm.sinb1 * cosb * coslam);
+ goto eqcon;
+ break;
+ case EQUIT:
+ xy_y = (b = sqrt(2. / (1. + cosb * coslam))) * sinb * this->m_proj_parm.ymf;
+ eqcon:
+ xy_x = this->m_proj_parm.xmf * b * cosb * sinlam;
+ break;
+ case N_POLE:
+ case S_POLE:
+ if (q >= 0.) {
+ xy_x = (b = sqrt(q)) * sinlam;
+ xy_y = coslam * (this->m_proj_parm.mode == S_POLE ? b : -b);
+ } else
+ xy_x = xy_y = 0.;
+ break;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double cCe, sCe, q, rho, ab=0.0;
+
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ case OBLIQ:
+ if ((rho = hypot(xy_x /= this->m_proj_parm.dd, xy_y *= this->m_proj_parm.dd)) < EPS10) {
+ lp_lon = 0.;
+ lp_lat = this->m_par.phi0;
+ return;
+ }
+ cCe = cos(sCe = 2. * asin(.5 * rho / this->m_proj_parm.rq));
+ xy_x *= (sCe = sin(sCe));
+ if (this->m_proj_parm.mode == OBLIQ) {
+ q = this->m_proj_parm.qp * (ab = cCe * this->m_proj_parm.sinb1 + xy_y * sCe * this->m_proj_parm.cosb1 / rho);
+ xy_y = rho * this->m_proj_parm.cosb1 * cCe - xy_y * this->m_proj_parm.sinb1 * sCe;
+ } else {
+ q = this->m_proj_parm.qp * (ab = xy_y * sCe / rho);
+ xy_y = rho * cCe;
+ }
+ break;
+ case N_POLE:
+ xy_y = -xy_y;
+ case S_POLE:
+ if (!(q = (xy_x * xy_x + xy_y * xy_y)) ) {
+ lp_lon = 0.;
+ lp_lat = this->m_par.phi0;
+ return;
+ }
+ /*
+ q = this->m_proj_parm.qp - q;
+ */
+ ab = 1. - q / this->m_proj_parm.qp;
+ if (this->m_proj_parm.mode == S_POLE)
+ ab = - ab;
+ break;
+ }
+ lp_lon = atan2(xy_x, xy_y);
+ lp_lat = pj_authlat(asin(ab), this->m_proj_parm.apa);
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_laea_spheroid : public base_t_fi<base_laea_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_laea_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_laea_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_laea m_proj_parm;
+
+ inline base_laea_spheroid(const PAR& par)
+ : base_t_fi<base_laea_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, cosphi, sinphi;
+
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ coslam = cos(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ xy_y = 1. + cosphi * coslam;
+ goto oblcon;
+ case OBLIQ:
+ xy_y = 1. + this->m_proj_parm.sinb1 * sinphi + this->m_proj_parm.cosb1 * cosphi * coslam;
+ oblcon:
+ if (xy_y <= EPS10) throw proj_exception();;
+ xy_x = (xy_y = sqrt(2. / xy_y)) * cosphi * sin(lp_lon);
+ xy_y *= this->m_proj_parm.mode == EQUIT ? sinphi :
+ this->m_proj_parm.cosb1 * sinphi - this->m_proj_parm.sinb1 * cosphi * coslam;
+ break;
+ case N_POLE:
+ coslam = -coslam;
+ case S_POLE:
+ if (fabs(lp_lat + this->m_par.phi0) < EPS10) throw proj_exception();;
+ xy_y = FORTPI - lp_lat * .5;
+ xy_y = 2. * (this->m_proj_parm.mode == S_POLE ? cos(xy_y) : sin(xy_y));
+ xy_x = xy_y * sin(lp_lon);
+ xy_y *= coslam;
+ break;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double cosz=0.0, rh, sinz=0.0;
+
+ rh = hypot(xy_x, xy_y);
+ if ((lp_lat = rh * .5 ) > 1.) throw proj_exception();;
+ lp_lat = 2. * asin(lp_lat);
+ if (this->m_proj_parm.mode == OBLIQ || this->m_proj_parm.mode == EQUIT) {
+ sinz = sin(lp_lat);
+ cosz = cos(lp_lat);
+ }
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ lp_lat = fabs(rh) <= EPS10 ? 0. : asin(xy_y * sinz / rh);
+ xy_x *= sinz;
+ xy_y = cosz * rh;
+ break;
+ case OBLIQ:
+ lp_lat = fabs(rh) <= EPS10 ? this->m_par.phi0 :
+ asin(cosz * this->m_proj_parm.sinb1 + xy_y * sinz * this->m_proj_parm.cosb1 / rh);
+ xy_x *= sinz * this->m_proj_parm.cosb1;
+ xy_y = (cosz - sin(lp_lat) * this->m_proj_parm.sinb1) * rh;
+ break;
+ case N_POLE:
+ xy_y = -xy_y;
+ lp_lat = HALFPI - lp_lat;
+ break;
+ case S_POLE:
+ lp_lat -= HALFPI;
+ break;
+ }
+ lp_lon = (xy_y == 0. && (this->m_proj_parm.mode == EQUIT || this->m_proj_parm.mode == OBLIQ)) ?
+ 0. : atan2(xy_x, xy_y);
+ }
+ };
+
+ // Lambert Azimuthal Equal Area
+ template <typename PAR>
+ void setup_laea(PAR& par, par_laea& proj_parm)
+ {
+ double t;
+ if (fabs((t = fabs(par.phi0)) - HALFPI) < EPS10)
+ proj_parm.mode = par.phi0 < 0. ? S_POLE : N_POLE;
+ else if (fabs(t) < EPS10)
+ proj_parm.mode = EQUIT;
+ else
+ proj_parm.mode = OBLIQ;
+ if (par.es) {
+ double sinphi;
+ par.e = sqrt(par.es);
+ proj_parm.qp = pj_qsfn(1., par.e, par.one_es);
+ proj_parm.mmf = .5 / (1. - par.es);
+ pj_authset(par.es, proj_parm.apa);
+ switch (proj_parm.mode) {
+ case N_POLE:
+ case S_POLE:
+ proj_parm.dd = 1.;
+ break;
+ case EQUIT:
+ proj_parm.dd = 1. / (proj_parm.rq = sqrt(.5 * proj_parm.qp));
+ proj_parm.xmf = 1.;
+ proj_parm.ymf = .5 * proj_parm.qp;
+ break;
+ case OBLIQ:
+ proj_parm.rq = sqrt(.5 * proj_parm.qp);
+ sinphi = sin(par.phi0);
+ proj_parm.sinb1 = pj_qsfn(sinphi, par.e, par.one_es) / proj_parm.qp;
+ proj_parm.cosb1 = sqrt(1. - proj_parm.sinb1 * proj_parm.sinb1);
+ proj_parm.dd = cos(par.phi0) / (sqrt(1. - par.es * sinphi * sinphi) *
+ proj_parm.rq * proj_parm.cosb1);
+ proj_parm.ymf = (proj_parm.xmf = proj_parm.rq) / proj_parm.dd;
+ proj_parm.xmf *= proj_parm.dd;
+ break;
+ }
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ if (proj_parm.mode == OBLIQ) {
+ proj_parm.sinb1 = sin(par.phi0);
+ proj_parm.cosb1 = cos(par.phi0);
+ }
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+ } // namespace laea
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Lambert Azimuthal Equal Area projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_laea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct laea_ellipsoid : public impl::laea::base_laea_ellipsoid<LL, XY, PAR>
+ {
+ inline laea_ellipsoid(const PAR& par) : impl::laea::base_laea_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::laea::setup_laea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Lambert Azimuthal Equal Area projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_laea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct laea_spheroid : public impl::laea::base_laea_spheroid<LL, XY, PAR>
+ {
+ inline laea_spheroid(const PAR& par) : impl::laea::base_laea_spheroid<LL, XY, PAR>(par)
+ {
+ impl::laea::setup_laea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class laea_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<laea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<laea_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void laea_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("laea", new laea_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LAEA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/lagrng.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/lagrng.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,158 @@
+#ifndef _PROJECTIONS_LAGRNG_HPP
+#define _PROJECTIONS_LAGRNG_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace lagrng
+ {
+ static const double TOL = 1e-10;
+
+ struct par_lagrng
+ {
+ double hrw;
+ double rw;
+ double a1;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_lagrng_spheroid : public base_t_f<base_lagrng_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_lagrng_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_lagrng_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_lagrng m_proj_parm;
+
+ inline base_lagrng_spheroid(const PAR& par)
+ : base_t_f<base_lagrng_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double v, c;
+
+ if (fabs(fabs(lp_lat) - HALFPI) < TOL) {
+ xy_x = 0;
+ xy_y = lp_lat < 0 ? -2. : 2.;
+ } else {
+ lp_lat = sin(lp_lat);
+ v = this->m_proj_parm.a1 * pow((1. + lp_lat)/(1. - lp_lat), this->m_proj_parm.hrw);
+ if ((c = 0.5 * (v + 1./v) + cos(lp_lon *= this->m_proj_parm.rw)) < TOL)
+ throw proj_exception();;
+ xy_x = 2. * sin(lp_lon) / c;
+ xy_y = (v - 1./v) / c;
+ }
+ }
+ };
+
+ // Lagrange
+ template <typename PAR>
+ void setup_lagrng(PAR& par, par_lagrng& proj_parm)
+ {
+ double phi1;
+ if ((proj_parm.rw = pj_param(par.params, "dW").f) <= 0) throw proj_exception(-27);
+ proj_parm.hrw = 0.5 * (proj_parm.rw = 1. / proj_parm.rw);
+ phi1 = pj_param(par.params, "rlat_1").f;
+ if (fabs(fabs(phi1 = sin(phi1)) - 1.) < TOL) throw proj_exception(-22);
+ proj_parm.a1 = pow((1. - phi1)/(1. + phi1), proj_parm.hrw);
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace lagrng
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Lagrange projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ - W=
+ \par Example
+ \image html ex_lagrng.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct lagrng_spheroid : public impl::lagrng::base_lagrng_spheroid<LL, XY, PAR>
+ {
+ inline lagrng_spheroid(const PAR& par) : impl::lagrng::base_lagrng_spheroid<LL, XY, PAR>(par)
+ {
+ impl::lagrng::setup_lagrng(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class lagrng_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<lagrng_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void lagrng_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("lagrng", new lagrng_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LAGRNG_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/larr.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/larr.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,134 @@
+#ifndef _PROJECTIONS_LARR_HPP
+#define _PROJECTIONS_LARR_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace larr
+ {
+ static const double SIXTH = .16666666666666666;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_larr_spheroid : public base_t_f<base_larr_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_larr_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_larr_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_larr_spheroid(const PAR& par)
+ : base_t_f<base_larr_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = 0.5 * lp_lon * (1. + sqrt(cos(lp_lat)));
+ xy_y = lp_lat / (cos(0.5 * lp_lat) * cos(SIXTH * lp_lon));
+ }
+ };
+
+ // Larrivee
+ template <typename PAR>
+ void setup_larr(PAR& par)
+ {
+ // par.fwd = s_forward;
+ // par.inv = 0;
+ par.es = 0.;
+ }
+
+ } // namespace larr
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Larrivee projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_larr.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct larr_spheroid : public impl::larr::base_larr_spheroid<LL, XY, PAR>
+ {
+ inline larr_spheroid(const PAR& par) : impl::larr::base_larr_spheroid<LL, XY, PAR>(par)
+ {
+ impl::larr::setup_larr(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class larr_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<larr_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void larr_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("larr", new larr_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LARR_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/lask.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/lask.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,148 @@
+#ifndef _PROJECTIONS_LASK_HPP
+#define _PROJECTIONS_LASK_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace lask
+ {
+ static const double a10 = 0.975534;
+ static const double a12 = -0.119161;
+ static const double a32 = -0.0143059;
+ static const double a14 = -0.0547009;
+ static const double b01 = 1.00384;
+ static const double b21 = 0.0802894;
+ static const double b03 = 0.0998909;
+ static const double b41 = 0.000199025;
+ static const double b23 = -0.0285500;
+ static const double b05 = -0.0491032;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_lask_spheroid : public base_t_f<base_lask_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_lask_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_lask_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_lask_spheroid(const PAR& par)
+ : base_t_f<base_lask_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double l2, p2;
+
+ l2 = lp_lon * lp_lon;
+ p2 = lp_lat * lp_lat;
+ xy_x = lp_lon * (a10 + p2 * (a12 + l2 * a32 + p2 * a14));
+ xy_y = lp_lat * (b01 + l2 * (b21 + p2 * b23 + l2 * b41) +
+ p2 * (b03 + p2 * b05));
+ }
+ };
+
+ // Laskowski
+ template <typename PAR>
+ void setup_lask(PAR& par)
+ {
+ // par.fwd = s_forward;
+ // par.inv = 0;
+ par.es = 0.;
+ }
+
+ } // namespace lask
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Laskowski projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_lask.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct lask_spheroid : public impl::lask::base_lask_spheroid<LL, XY, PAR>
+ {
+ inline lask_spheroid(const PAR& par) : impl::lask::base_lask_spheroid<LL, XY, PAR>(par)
+ {
+ impl::lask::setup_lask(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class lask_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<lask_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void lask_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("lask", new lask_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LASK_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/latlong.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/latlong.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,282 @@
+#ifndef _PROJECTIONS_LATLONG_HPP
+#define _PROJECTIONS_LATLONG_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+#include <geometry/projections/epsg_traits.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace latlong
+ {
+
+
+ /* very loosely based upon DMA code by Bradford W. Drew */
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_latlong_other : public base_t_fi<base_latlong_other<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_latlong_other<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_latlong_other<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_latlong_other(const PAR& par)
+ : base_t_fi<base_latlong_other<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+
+ xy_x = lp_lon / this->m_par.a;
+ xy_y = lp_lat / this->m_par.a;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+
+ lp_lat = xy_y * this->m_par.a;
+ lp_lon = xy_x * this->m_par.a;
+ }
+ };
+
+ // Lat/long (Geodetic)
+ template <typename PAR>
+ void setup_lonlat(PAR& par)
+ {
+ par.is_latlong = 1;
+ par.x0 = 0.0;
+ par.y0 = 0.0;
+ // par.inv = inverse;
+ // par.fwd = forward;
+ }
+
+ // Lat/long (Geodetic alias)
+ template <typename PAR>
+ void setup_latlon(PAR& par)
+ {
+ par.is_latlong = 1;
+ par.x0 = 0.0;
+ par.y0 = 0.0;
+ // par.inv = inverse;
+ // par.fwd = forward;
+ }
+
+ // Lat/long (Geodetic alias)
+ template <typename PAR>
+ void setup_latlong(PAR& par)
+ {
+ par.is_latlong = 1;
+ par.x0 = 0.0;
+ par.y0 = 0.0;
+ // par.inv = inverse;
+ // par.fwd = forward;
+ }
+
+ // Lat/long (Geodetic alias)
+ template <typename PAR>
+ void setup_longlat(PAR& par)
+ {
+ par.is_latlong = 1;
+ par.x0 = 0.0;
+ par.y0 = 0.0;
+ // par.inv = inverse;
+ // par.fwd = forward;
+ }
+
+ } // namespace latlong
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Lat/long (Geodetic) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ \par Example
+ \image html ex_lonlat.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct lonlat_other : public impl::latlong::base_latlong_other<LL, XY, PAR>
+ {
+ inline lonlat_other(const PAR& par) : impl::latlong::base_latlong_other<LL, XY, PAR>(par)
+ {
+ impl::latlong::setup_lonlat(this->m_par);
+ }
+ };
+
+ /*!
+ \brief Lat/long (Geodetic alias) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ \par Example
+ \image html ex_latlon.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct latlon_other : public impl::latlong::base_latlong_other<LL, XY, PAR>
+ {
+ inline latlon_other(const PAR& par) : impl::latlong::base_latlong_other<LL, XY, PAR>(par)
+ {
+ impl::latlong::setup_latlon(this->m_par);
+ }
+ };
+
+ /*!
+ \brief Lat/long (Geodetic alias) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ \par Example
+ \image html ex_latlong.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct latlong_other : public impl::latlong::base_latlong_other<LL, XY, PAR>
+ {
+ inline latlong_other(const PAR& par) : impl::latlong::base_latlong_other<LL, XY, PAR>(par)
+ {
+ impl::latlong::setup_latlong(this->m_par);
+ }
+ };
+
+ /*!
+ \brief Lat/long (Geodetic alias) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ \par Example
+ \image html ex_longlat.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct longlat_other : public impl::latlong::base_latlong_other<LL, XY, PAR>
+ {
+ inline longlat_other(const PAR& par) : impl::latlong::base_latlong_other<LL, XY, PAR>(par)
+ {
+ impl::latlong::setup_longlat(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class lonlat_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<lonlat_other<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class latlon_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<latlon_other<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class latlong_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<latlong_other<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class longlat_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<longlat_other<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void latlong_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("lonlat", new lonlat_entry<LL, XY, PAR>);
+ factory.add_to_factory("latlon", new latlon_entry<LL, XY, PAR>);
+ factory.add_to_factory("latlong", new latlong_entry<LL, XY, PAR>);
+ factory.add_to_factory("longlat", new longlat_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ // Create EPSG specializations
+ // (Proof of Concept, only for some)
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<4326, LLR, XY, PAR>
+ {
+ typedef longlat_other<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=longlat +ellps=WGS84 +datum=WGS84";
+ }
+ };
+
+
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LATLONG_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/lcc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/lcc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,247 @@
+#ifndef _PROJECTIONS_LCC_HPP
+#define _PROJECTIONS_LCC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_msfn.hpp>
+#include <geometry/projections/impl/pj_tsfn.hpp>
+#include <geometry/projections/impl/pj_phi2.hpp>
+
+#include <geometry/projections/epsg_traits.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace lcc
+ {
+ static const double EPS10 = 1.e-10;
+
+ struct par_lcc
+ {
+ double phi1;
+ double phi2;
+ double n;
+ double rho;
+ double rho0;
+ double c;
+ int ellips;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_lcc_ellipsoid : public base_t_fi<base_lcc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_lcc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_lcc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ mutable par_lcc m_proj_parm;
+
+ inline base_lcc_ellipsoid(const PAR& par)
+ : base_t_fi<base_lcc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if (fabs(fabs(lp_lat) - HALFPI) < EPS10) {
+ if ((lp_lat * this->m_proj_parm.n) <= 0.) throw proj_exception();;
+ this->m_proj_parm.rho = 0.;
+ }
+ else
+ this->m_proj_parm.rho = this->m_proj_parm.c * (this->m_proj_parm.ellips ? pow(pj_tsfn(lp_lat, sin(lp_lat),
+ this->m_par.e), this->m_proj_parm.n) : pow(tan(FORTPI + .5 * lp_lat), -this->m_proj_parm.n));
+ xy_x = this->m_par.k0 * (this->m_proj_parm.rho * sin( lp_lon *= this->m_proj_parm.n ) );
+ xy_y = this->m_par.k0 * (this->m_proj_parm.rho0 - this->m_proj_parm.rho * cos(lp_lon) );
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ xy_x /= this->m_par.k0;
+ xy_y /= this->m_par.k0;
+ if( (this->m_proj_parm.rho = hypot(xy_x, xy_y = this->m_proj_parm.rho0 - xy_y)) != 0.0) {
+ if (this->m_proj_parm.n < 0.) {
+ this->m_proj_parm.rho = -this->m_proj_parm.rho;
+ xy_x = -xy_x;
+ xy_y = -xy_y;
+ }
+ if (this->m_proj_parm.ellips) {
+ if ((lp_lat = pj_phi2(pow(this->m_proj_parm.rho / this->m_proj_parm.c, 1./this->m_proj_parm.n), this->m_par.e))
+ == HUGE_VAL)
+ throw proj_exception();;
+ } else
+ lp_lat = 2. * atan(pow(this->m_proj_parm.c / this->m_proj_parm.rho, 1./this->m_proj_parm.n)) - HALFPI;
+ lp_lon = atan2(xy_x, xy_y) / this->m_proj_parm.n;
+ } else {
+ lp_lon = 0.;
+ lp_lat = this->m_proj_parm.n > 0. ? HALFPI : - HALFPI;
+ }
+ }
+
+ #ifdef SPECIAL_FACTORS_NOT_CONVERTED
+ inline void fac(LL lp, FACTORS &fac) const
+ {
+ if (fabs(fabs(lp_lat) - HALFPI) < EPS10) {
+ if ((lp_lat * this->m_proj_parm.n) <= 0.) return;
+ this->m_proj_parm.rho = 0.;
+ } else
+ this->m_proj_parm.rho = this->m_proj_parm.c * (this->m_proj_parm.ellips ? pow(pj_tsfn(lp_lat, sin(lp_lat),
+ this->m_par.e), this->m_proj_parm.n) : pow(tan(FORTPI + .5 * lp_lat), -this->m_proj_parm.n));
+ this->m_fac.code |= IS_ANAL_HK + IS_ANAL_CONV;
+ this->m_fac.k = this->m_fac.h = this->m_par.k0 * this->m_proj_parm.n * this->m_proj_parm.rho /
+ pj_msfn(sin(lp_lat), cos(lp_lat), this->m_par.es);
+ this->m_fac.conv = - this->m_proj_parm.n * lp_lon;
+ }
+ #endif
+ };
+
+ // Lambert Conformal Conic
+ template <typename PAR>
+ void setup_lcc(PAR& par, par_lcc& proj_parm)
+ {
+ double cosphi, sinphi;
+ int secant;
+ proj_parm.phi1 = pj_param(par.params, "rlat_1").f;
+ if (pj_param(par.params, "tlat_2").i)
+ proj_parm.phi2 = pj_param(par.params, "rlat_2").f;
+ else {
+ proj_parm.phi2 = proj_parm.phi1;
+ if (!pj_param(par.params, "tlat_0").i)
+ par.phi0 = proj_parm.phi1;
+ }
+ if (fabs(proj_parm.phi1 + proj_parm.phi2) < EPS10) throw proj_exception(-21);
+ proj_parm.n = sinphi = sin(proj_parm.phi1);
+ cosphi = cos(proj_parm.phi1);
+ secant = fabs(proj_parm.phi1 - proj_parm.phi2) >= EPS10;
+ if( (proj_parm.ellips = (par.es != 0.)) ) {
+ double ml1, m1;
+ par.e = sqrt(par.es);
+ m1 = pj_msfn(sinphi, cosphi, par.es);
+ ml1 = pj_tsfn(proj_parm.phi1, sinphi, par.e);
+ if (secant) { /* secant cone */
+ proj_parm.n = log(m1 /
+ pj_msfn(sinphi = sin(proj_parm.phi2), cos(proj_parm.phi2), par.es));
+ proj_parm.n /= log(ml1 / pj_tsfn(proj_parm.phi2, sinphi, par.e));
+ }
+ proj_parm.c = (proj_parm.rho0 = m1 * pow(ml1, -proj_parm.n) / proj_parm.n);
+ proj_parm.rho0 *= (fabs(fabs(par.phi0) - HALFPI) < EPS10) ? 0. :
+ pow(pj_tsfn(par.phi0, sin(par.phi0), par.e), proj_parm.n);
+ } else {
+ if (secant)
+ proj_parm.n = log(cosphi / cos(proj_parm.phi2)) /
+ log(tan(FORTPI + .5 * proj_parm.phi2) /
+ tan(FORTPI + .5 * proj_parm.phi1));
+ proj_parm.c = cosphi * pow(tan(FORTPI + .5 * proj_parm.phi1), proj_parm.n) / proj_parm.n;
+ proj_parm.rho0 = (fabs(fabs(par.phi0) - HALFPI) < EPS10) ? 0. :
+ proj_parm.c * pow(tan(FORTPI + .5 * par.phi0), -proj_parm.n);
+ }
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ // par.spc = fac;
+ }
+
+ } // namespace lcc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Lambert Conformal Conic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ - lat_1= and lat_2= or lat_0
+ \par Example
+ \image html ex_lcc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct lcc_ellipsoid : public impl::lcc::base_lcc_ellipsoid<LL, XY, PAR>
+ {
+ inline lcc_ellipsoid(const PAR& par) : impl::lcc::base_lcc_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::lcc::setup_lcc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class lcc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<lcc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void lcc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("lcc", new lcc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ // Create EPSG specializations
+ // (Proof of Concept, only for some)
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2805, LLR, XY, PAR>
+ {
+ typedef lcc_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LCC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/lcca.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/lcca.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,191 @@
+#ifndef _PROJECTIONS_LCCA_HPP
+#define _PROJECTIONS_LCCA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace lcca
+ {
+ static const int MAX_ITER = 10;
+ static const double DEL_TOL = 1e-12;
+
+ struct par_lcca
+ {
+ double en[EN_SIZE];
+ double r0, l, M0;
+ double C;
+ };
+
+
+ inline double /* func to compute dr */
+ fS(double S, double C) {
+ return(S * ( 1. + S * S * C));
+ }
+ inline double /* deriv of fs */
+ fSp(double S, double C) {
+ return(1. + 3.* S * S * C);
+ }
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_lcca_ellipsoid : public base_t_fi<base_lcca_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_lcca_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_lcca_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_lcca m_proj_parm;
+
+ inline base_lcca_ellipsoid(const PAR& par)
+ : base_t_fi<base_lcca_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double S, S3, r, dr;
+
+ S = pj_mlfn(lp_lat, sin(lp_lat), cos(lp_lat), this->m_proj_parm.en) - this->m_proj_parm.M0;
+ dr = fS(S, this->m_proj_parm.C);
+ r = this->m_proj_parm.r0 - dr;
+ xy_x = this->m_par.k0 * (r * sin( lp_lon *= this->m_proj_parm.l ) );
+ xy_y = this->m_par.k0 * (this->m_proj_parm.r0 - r * cos(lp_lon) );
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double theta, dr, S, dif;
+ int i;
+
+ xy_x /= this->m_par.k0;
+ xy_y /= this->m_par.k0;
+ theta = atan2(xy_x , this->m_proj_parm.r0 - xy_y);
+ dr = xy_y - xy_x * tan(0.5 * theta);
+ lp_lon = theta / this->m_proj_parm.l;
+ S = dr;
+ for (i = MAX_ITER; i ; --i) {
+ S -= (dif = (fS(S, this->m_proj_parm.C) - dr) / fSp(S, this->m_proj_parm.C));
+ if (fabs(dif) < DEL_TOL) break;
+ }
+ if (!i) throw proj_exception();
+ lp_lat = pj_inv_mlfn(S + this->m_proj_parm.M0, this->m_par.es, this->m_proj_parm.en);
+ }
+ };
+
+ // Lambert Conformal Conic Alternative
+ template <typename PAR>
+ void setup_lcca(PAR& par, par_lcca& proj_parm)
+ {
+ double s2p0, N0, R0, tan0, tan20;
+ pj_enfn(par.es, proj_parm.en);
+ if (!pj_param(par.params, "tlat_0").i) throw proj_exception(50);
+ if (par.phi0 == 0.) throw proj_exception(51);
+ proj_parm.l = sin(par.phi0);
+ proj_parm.M0 = pj_mlfn(par.phi0, proj_parm.l, cos(par.phi0), proj_parm.en);
+ s2p0 = proj_parm.l * proj_parm.l;
+ R0 = 1. / (1. - par.es * s2p0);
+ N0 = sqrt(R0);
+ R0 *= par.one_es * N0;
+ tan0 = tan(par.phi0);
+ tan20 = tan0 * tan0;
+ proj_parm.r0 = N0 / tan0;
+ proj_parm.C = 1. / (6. * R0 * N0);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+ } // namespace lcca
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Lambert Conformal Conic Alternative projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ - lat_0=
+ \par Example
+ \image html ex_lcca.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct lcca_ellipsoid : public impl::lcca::base_lcca_ellipsoid<LL, XY, PAR>
+ {
+ inline lcca_ellipsoid(const PAR& par) : impl::lcca::base_lcca_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::lcca::setup_lcca(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class lcca_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<lcca_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void lcca_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("lcca", new lcca_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LCCA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/loxim.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/loxim.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,164 @@
+#ifndef _PROJECTIONS_LOXIM_HPP
+#define _PROJECTIONS_LOXIM_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace loxim
+ {
+ static const double EPS = 1e-8;
+
+ struct par_loxim
+ {
+ double phi1;
+ double cosphi1;
+ double tanphi1;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_loxim_spheroid : public base_t_fi<base_loxim_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_loxim_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_loxim_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_loxim m_proj_parm;
+
+ inline base_loxim_spheroid(const PAR& par)
+ : base_t_fi<base_loxim_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_y = lp_lat - this->m_proj_parm.phi1;
+ if (fabs(xy_y) < EPS)
+ xy_x = lp_lon * this->m_proj_parm.cosphi1;
+ else {
+ xy_x = FORTPI + 0.5 * lp_lat;
+ if (fabs(xy_x) < EPS || fabs(fabs(xy_x) - HALFPI) < EPS)
+ xy_x = 0.;
+ else
+ xy_x = lp_lon * xy_y / log( tan(xy_x) / this->m_proj_parm.tanphi1 );
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y + this->m_proj_parm.phi1;
+ if (fabs(xy_y) < EPS)
+ lp_lon = xy_x / this->m_proj_parm.cosphi1;
+ else
+ if (fabs( lp_lon = FORTPI + 0.5 * lp_lat ) < EPS ||
+ fabs(fabs(lp_lon) - HALFPI) < EPS)
+ lp_lon = 0.;
+ else
+ lp_lon = xy_x * log( tan(lp_lon) / this->m_proj_parm.tanphi1 ) / xy_y ;
+ }
+ };
+
+ // Loximuthal
+ template <typename PAR>
+ void setup_loxim(PAR& par, par_loxim& proj_parm)
+ {
+ proj_parm.phi1 = pj_param(par.params, "rlat_1").f;
+ if ((proj_parm.cosphi1 = cos(proj_parm.phi1)) < EPS) throw proj_exception(-22);
+ proj_parm.tanphi1 = tan(FORTPI + 0.5 * proj_parm.phi1);
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace loxim
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Loximuthal projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_loxim.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct loxim_spheroid : public impl::loxim::base_loxim_spheroid<LL, XY, PAR>
+ {
+ inline loxim_spheroid(const PAR& par) : impl::loxim::base_loxim_spheroid<LL, XY, PAR>(par)
+ {
+ impl::loxim::setup_loxim(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class loxim_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<loxim_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void loxim_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("loxim", new loxim_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LOXIM_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/lsat.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/lsat.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,299 @@
+#ifndef _PROJECTIONS_LSAT_HPP
+#define _PROJECTIONS_LSAT_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace lsat
+ {
+ static const double TOL = 1e-7;
+ static const double PI_HALFPI = 4.71238898038468985766;
+ static const double TWOPI_HALFPI = 7.85398163397448309610;
+
+ struct par_lsat
+ {
+ double a2, a4, b, c1, c3;
+ double q, t, u, w, p22, sa, ca, xj, rlm, rlm2;
+ };
+ /* based upon Snyder and Linck, USGS-NMD */
+ template <typename PAR>
+ inline void
+ seraz0(double lam, double mult, PAR& par, par_lsat& proj_parm) {
+ double sdsq, h, s, fc, sd, sq, d__1;
+
+ lam *= DEG_TO_RAD;
+ sd = sin(lam);
+ sdsq = sd * sd;
+ s = proj_parm.p22 * proj_parm.sa * cos(lam) * sqrt((1. + proj_parm.t * sdsq) / ((
+ 1. + proj_parm.w * sdsq) * (1. + proj_parm.q * sdsq)));
+ d__1 = 1. + proj_parm.q * sdsq;
+ h = sqrt((1. + proj_parm.q * sdsq) / (1. + proj_parm.w * sdsq)) * ((1. +
+ proj_parm.w * sdsq) / (d__1 * d__1) - proj_parm.p22 * proj_parm.ca);
+ sq = sqrt(proj_parm.xj * proj_parm.xj + s * s);
+ proj_parm.b += fc = mult * (h * proj_parm.xj - s * s) / sq;
+ proj_parm.a2 += fc * cos(lam + lam);
+ proj_parm.a4 += fc * cos(lam * 4.);
+ fc = mult * s * (h + proj_parm.xj) / sq;
+ proj_parm.c1 += fc * cos(lam);
+ proj_parm.c3 += fc * cos(lam * 3.);
+ }
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_lsat_ellipsoid : public base_t_fi<base_lsat_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_lsat_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_lsat_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_lsat m_proj_parm;
+
+ inline base_lsat_ellipsoid(const PAR& par)
+ : base_t_fi<base_lsat_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ int l, nn;
+ double lamt, xlam, sdsq, c, d, s, lamdp, phidp, lampp, tanph,
+ lamtp, cl, sd, sp, fac, sav, tanphi;
+
+ if (lp_lat > HALFPI)
+ lp_lat = HALFPI;
+ else if (lp_lat < -HALFPI)
+ lp_lat = -HALFPI;
+ lampp = lp_lat >= 0. ? HALFPI : PI_HALFPI;
+ tanphi = tan(lp_lat);
+ for (nn = 0;;) {
+ sav = lampp;
+ lamtp = lp_lon + this->m_proj_parm.p22 * lampp;
+ cl = cos(lamtp);
+ if (fabs(cl) < TOL)
+ lamtp -= TOL;
+ fac = lampp - sin(lampp) * (cl < 0. ? -HALFPI : HALFPI);
+ for (l = 50; l; --l) {
+ lamt = lp_lon + this->m_proj_parm.p22 * sav;
+ if (fabs(c = cos(lamt)) < TOL)
+ lamt -= TOL;
+ xlam = (this->m_par.one_es * tanphi * this->m_proj_parm.sa + sin(lamt) * this->m_proj_parm.ca) / c;
+ lamdp = atan(xlam) + fac;
+ if (fabs(fabs(sav) - fabs(lamdp)) < TOL)
+ break;
+ sav = lamdp;
+ }
+ if (!l || ++nn >= 3 || (lamdp > this->m_proj_parm.rlm && lamdp < this->m_proj_parm.rlm2))
+ break;
+ if (lamdp <= this->m_proj_parm.rlm)
+ lampp = TWOPI_HALFPI;
+ else if (lamdp >= this->m_proj_parm.rlm2)
+ lampp = HALFPI;
+ }
+ if (l) {
+ sp = sin(lp_lat);
+ phidp = aasin((this->m_par.one_es * this->m_proj_parm.ca * sp - this->m_proj_parm.sa * cos(lp_lat) *
+ sin(lamt)) / sqrt(1. - this->m_par.es * sp * sp));
+ tanph = log(tan(FORTPI + .5 * phidp));
+ sd = sin(lamdp);
+ sdsq = sd * sd;
+ s = this->m_proj_parm.p22 * this->m_proj_parm.sa * cos(lamdp) * sqrt((1. + this->m_proj_parm.t * sdsq)
+ / ((1. + this->m_proj_parm.w * sdsq) * (1. + this->m_proj_parm.q * sdsq)));
+ d = sqrt(this->m_proj_parm.xj * this->m_proj_parm.xj + s * s);
+ xy_x = this->m_proj_parm.b * lamdp + this->m_proj_parm.a2 * sin(2. * lamdp) + this->m_proj_parm.a4 *
+ sin(lamdp * 4.) - tanph * s / d;
+ xy_y = this->m_proj_parm.c1 * sd + this->m_proj_parm.c3 * sin(lamdp * 3.) + tanph * this->m_proj_parm.xj / d;
+ } else
+ xy_x = xy_y = HUGE_VAL;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ int nn;
+ double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
+
+ lamdp = xy_x / this->m_proj_parm.b;
+ nn = 50;
+ do {
+ sav = lamdp;
+ sd = sin(lamdp);
+ sdsq = sd * sd;
+ s = this->m_proj_parm.p22 * this->m_proj_parm.sa * cos(lamdp) * sqrt((1. + this->m_proj_parm.t * sdsq)
+ / ((1. + this->m_proj_parm.w * sdsq) * (1. + this->m_proj_parm.q * sdsq)));
+ lamdp = xy_x + xy_y * s / this->m_proj_parm.xj - this->m_proj_parm.a2 * sin(
+ 2. * lamdp) - this->m_proj_parm.a4 * sin(lamdp * 4.) - s / this->m_proj_parm.xj * (
+ this->m_proj_parm.c1 * sin(lamdp) + this->m_proj_parm.c3 * sin(lamdp * 3.));
+ lamdp /= this->m_proj_parm.b;
+ } while (fabs(lamdp - sav) >= TOL && --nn);
+ sl = sin(lamdp);
+ fac = exp(sqrt(1. + s * s / this->m_proj_parm.xj / this->m_proj_parm.xj) * (xy_y -
+ this->m_proj_parm.c1 * sl - this->m_proj_parm.c3 * sin(lamdp * 3.)));
+ phidp = 2. * (atan(fac) - FORTPI);
+ dd = sl * sl;
+ if (fabs(cos(lamdp)) < TOL)
+ lamdp -= TOL;
+ spp = sin(phidp);
+ sppsq = spp * spp;
+ lamt = atan(((1. - sppsq * this->m_par.rone_es) * tan(lamdp) *
+ this->m_proj_parm.ca - spp * this->m_proj_parm.sa * sqrt((1. + this->m_proj_parm.q * dd) * (
+ 1. - sppsq) - sppsq * this->m_proj_parm.u) / cos(lamdp)) / (1. - sppsq
+ * (1. + this->m_proj_parm.u)));
+ sl = lamt >= 0. ? 1. : -1.;
+ scl = cos(lamdp) >= 0. ? 1. : -1;
+ lamt -= HALFPI * (1. - scl) * sl;
+ lp_lon = lamt - this->m_proj_parm.p22 * lamdp;
+ if (fabs(this->m_proj_parm.sa) < TOL)
+ lp_lat = aasin(spp / sqrt(this->m_par.one_es * this->m_par.one_es + this->m_par.es * sppsq));
+ else
+ lp_lat = atan((tan(lamdp) * cos(lamt) - this->m_proj_parm.ca * sin(lamt)) /
+ (this->m_par.one_es * this->m_proj_parm.sa));
+ }
+ };
+
+ // Space oblique for LANDSAT
+ template <typename PAR>
+ void setup_lsat(PAR& par, par_lsat& proj_parm)
+ {
+ int land, path;
+ double lam, alf, esc, ess;
+ land = pj_param(par.params, "ilsat").i;
+ if (land <= 0 || land > 5) throw proj_exception(-28);
+ path = pj_param(par.params, "ipath").i;
+ if (path <= 0 || path > (land <= 3 ? 251 : 233)) throw proj_exception(-29);
+ if (land <= 3) {
+ par.lam0 = DEG_TO_RAD * 128.87 - TWOPI / 251. * path;
+ proj_parm.p22 = 103.2669323;
+ alf = DEG_TO_RAD * 99.092;
+ } else {
+ par.lam0 = DEG_TO_RAD * 129.3 - TWOPI / 233. * path;
+ proj_parm.p22 = 98.8841202;
+ alf = DEG_TO_RAD * 98.2;
+ }
+ proj_parm.p22 /= 1440.;
+ proj_parm.sa = sin(alf);
+ proj_parm.ca = cos(alf);
+ if (fabs(proj_parm.ca) < 1e-9)
+ proj_parm.ca = 1e-9;
+ esc = par.es * proj_parm.ca * proj_parm.ca;
+ ess = par.es * proj_parm.sa * proj_parm.sa;
+ proj_parm.w = (1. - esc) * par.rone_es;
+ proj_parm.w = proj_parm.w * proj_parm.w - 1.;
+ proj_parm.q = ess * par.rone_es;
+ proj_parm.t = ess * (2. - par.es) * par.rone_es * par.rone_es;
+ proj_parm.u = esc * par.rone_es;
+ proj_parm.xj = par.one_es * par.one_es * par.one_es;
+ proj_parm.rlm = PI * (1. / 248. + .5161290322580645);
+ proj_parm.rlm2 = proj_parm.rlm + TWOPI;
+ proj_parm.a2 = proj_parm.a4 = proj_parm.b = proj_parm.c1 = proj_parm.c3 = 0.;
+ seraz0(0., 1., par, proj_parm);
+ for (lam = 9.;
+ lam <= 81.0001;
+ lam += 18.)
+ seraz0(lam, 4., par, proj_parm);
+ for (lam = 18;
+ lam <= 72.0001;
+ lam += 18.)
+ seraz0(lam, 2., par, proj_parm);
+ seraz0(90., 1., par, proj_parm);
+ proj_parm.a2 /= 30.;
+ proj_parm.a4 /= 60.;
+ proj_parm.b /= 30.;
+ proj_parm.c1 /= 15.;
+ proj_parm.c3 /= 45.;
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+ } // namespace lsat
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Space oblique for LANDSAT projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ - lsat= path=
+ \par Example
+ \image html ex_lsat.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct lsat_ellipsoid : public impl::lsat::base_lsat_ellipsoid<LL, XY, PAR>
+ {
+ inline lsat_ellipsoid(const PAR& par) : impl::lsat::base_lsat_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::lsat::setup_lsat(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class lsat_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<lsat_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void lsat_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("lsat", new lsat_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_LSAT_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/mbt_fps.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/mbt_fps.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,161 @@
+#ifndef _PROJECTIONS_MBT_FPS_HPP
+#define _PROJECTIONS_MBT_FPS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace mbt_fps
+ {
+ static const int MAX_ITER = 10;
+ static const double LOOP_TOL = 1e-7;
+ static const double C1 = 0.45503;
+ static const double C2 = 1.36509;
+ static const double C3 = 1.41546;
+ static const double C_x = 0.22248;
+ static const double C_y = 1.44492;
+ static const double C1_2 = 0.33333333333333333333333333;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_mbt_fps_spheroid : public base_t_fi<base_mbt_fps_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_mbt_fps_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_mbt_fps_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_mbt_fps_spheroid(const PAR& par)
+ : base_t_fi<base_mbt_fps_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double k, V, t;
+ int i;
+
+ k = C3 * sin(lp_lat);
+ for (i = MAX_ITER; i ; --i) {
+ t = lp_lat / C2;
+ lp_lat -= V = (C1 * sin(t) + sin(lp_lat) - k) /
+ (C1_2 * cos(t) + cos(lp_lat));
+ if (fabs(V) < LOOP_TOL)
+ break;
+ }
+ t = lp_lat / C2;
+ xy_x = C_x * lp_lon * (1. + 3. * cos(lp_lat)/cos(t) );
+ xy_y = C_y * sin(t);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double t, s;
+
+ lp_lat = C2 * (t = aasin(xy_y / C_y));
+ lp_lon = xy_x / (C_x * (1. + 3. * cos(lp_lat)/cos(t)));
+ lp_lat = aasin((C1 * sin(t) + sin(lp_lat)) / C3);
+ }
+ };
+
+ // McBryde-Thomas Flat-Pole Sine (No. 2)
+ template <typename PAR>
+ void setup_mbt_fps(PAR& par)
+ {
+ par.es = 0;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace mbt_fps
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief McBryde-Thomas Flat-Pole Sine (No. 2) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ \par Example
+ \image html ex_mbt_fps.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct mbt_fps_spheroid : public impl::mbt_fps::base_mbt_fps_spheroid<LL, XY, PAR>
+ {
+ inline mbt_fps_spheroid(const PAR& par) : impl::mbt_fps::base_mbt_fps_spheroid<LL, XY, PAR>(par)
+ {
+ impl::mbt_fps::setup_mbt_fps(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class mbt_fps_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<mbt_fps_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void mbt_fps_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("mbt_fps", new mbt_fps_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_MBT_FPS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/mbtfpp.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/mbtfpp.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,155 @@
+#ifndef _PROJECTIONS_MBTFPP_HPP
+#define _PROJECTIONS_MBTFPP_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace mbtfpp
+ {
+ static const double CS = .95257934441568037152;
+ static const double FXC = .92582009977255146156;
+ static const double FYC = 3.40168025708304504493;
+ static const double C23 = .66666666666666666666;
+ static const double C13 = .33333333333333333333;
+ static const double ONEEPS = 1.0000001;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_mbtfpp_spheroid : public base_t_fi<base_mbtfpp_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_mbtfpp_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_mbtfpp_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_mbtfpp_spheroid(const PAR& par)
+ : base_t_fi<base_mbtfpp_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ lp_lat = asin(CS * sin(lp_lat));
+ xy_x = FXC * lp_lon * (2. * cos(C23 * lp_lat) - 1.);
+ xy_y = FYC * sin(C13 * lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y / FYC;
+ if (fabs(lp_lat) >= 1.) {
+ if (fabs(lp_lat) > ONEEPS) throw proj_exception();
+ else lp_lat = (lp_lat < 0.) ? -HALFPI : HALFPI;
+ } else
+ lp_lat = asin(lp_lat);
+ lp_lon = xy_x / ( FXC * (2. * cos(C23 * (lp_lat *= 3.)) - 1.) );
+ if (fabs(lp_lat = sin(lp_lat) / CS) >= 1.) {
+ if (fabs(lp_lat) > ONEEPS) throw proj_exception();
+ else lp_lat = (lp_lat < 0.) ? -HALFPI : HALFPI;
+ } else
+ lp_lat = asin(lp_lat);
+ }
+ };
+
+ // McBride-Thomas Flat-Polar Parabolic
+ template <typename PAR>
+ void setup_mbtfpp(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace mbtfpp
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief McBride-Thomas Flat-Polar Parabolic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ \par Example
+ \image html ex_mbtfpp.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct mbtfpp_spheroid : public impl::mbtfpp::base_mbtfpp_spheroid<LL, XY, PAR>
+ {
+ inline mbtfpp_spheroid(const PAR& par) : impl::mbtfpp::base_mbtfpp_spheroid<LL, XY, PAR>(par)
+ {
+ impl::mbtfpp::setup_mbtfpp(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class mbtfpp_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<mbtfpp_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void mbtfpp_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("mbtfpp", new mbtfpp_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_MBTFPP_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/mbtfpq.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/mbtfpq.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,170 @@
+#ifndef _PROJECTIONS_MBTFPQ_HPP
+#define _PROJECTIONS_MBTFPQ_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace mbtfpq
+ {
+ static const int NITER = 20;
+ static const double EPS = 1e-7;
+ static const double ONETOL = 1.000001;
+ static const double C = 1.70710678118654752440;
+ static const double RC = 0.58578643762690495119;
+ static const double FYC = 1.87475828462269495505;
+ static const double RYC = 0.53340209679417701685;
+ static const double FXC = 0.31245971410378249250;
+ static const double RXC = 3.20041258076506210122;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_mbtfpq_spheroid : public base_t_fi<base_mbtfpq_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_mbtfpq_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_mbtfpq_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_mbtfpq_spheroid(const PAR& par)
+ : base_t_fi<base_mbtfpq_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double th1, c;
+ int i;
+
+ c = C * sin(lp_lat);
+ for (i = NITER; i; --i) {
+ lp_lat -= th1 = (sin(.5*lp_lat) + sin(lp_lat) - c) /
+ (.5*cos(.5*lp_lat) + cos(lp_lat));
+ if (fabs(th1) < EPS) break;
+ }
+ xy_x = FXC * lp_lon * (1.0 + 2. * cos(lp_lat)/cos(0.5 * lp_lat));
+ xy_y = FYC * sin(0.5 * lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double t;
+
+ lp_lat = RYC * xy_y;
+ if (fabs(lp_lat) > 1.) {
+ if (fabs(lp_lat) > ONETOL) throw proj_exception();
+ else if (lp_lat < 0.) { t = -1.; lp_lat = -PI; }
+ else { t = 1.; lp_lat = PI; }
+ } else
+ lp_lat = 2. * asin(t = lp_lat);
+ lp_lon = RXC * xy_x / (1. + 2. * cos(lp_lat)/cos(0.5 * lp_lat));
+ lp_lat = RC * (t + sin(lp_lat));
+ if (fabs(lp_lat) > 1.)
+ if (fabs(lp_lat) > ONETOL) throw proj_exception();
+ else lp_lat = lp_lat < 0. ? -HALFPI : HALFPI;
+ else
+ lp_lat = asin(lp_lat);
+ }
+ };
+
+ // McBryde-Thomas Flat-Polar Quartic
+ template <typename PAR>
+ void setup_mbtfpq(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace mbtfpq
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief McBryde-Thomas Flat-Polar Quartic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ \par Example
+ \image html ex_mbtfpq.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct mbtfpq_spheroid : public impl::mbtfpq::base_mbtfpq_spheroid<LL, XY, PAR>
+ {
+ inline mbtfpq_spheroid(const PAR& par) : impl::mbtfpq::base_mbtfpq_spheroid<LL, XY, PAR>(par)
+ {
+ impl::mbtfpq::setup_mbtfpq(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class mbtfpq_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<mbtfpq_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void mbtfpq_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("mbtfpq", new mbtfpq_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_MBTFPQ_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/merc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/merc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,211 @@
+#ifndef _PROJECTIONS_MERC_HPP
+#define _PROJECTIONS_MERC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_msfn.hpp>
+#include <geometry/projections/impl/pj_tsfn.hpp>
+#include <geometry/projections/impl/pj_phi2.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace merc
+ {
+ static const double EPS10 = 1.e-10;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_merc_ellipsoid : public base_t_fi<base_merc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_merc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_merc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_merc_ellipsoid(const PAR& par)
+ : base_t_fi<base_merc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if (fabs(fabs(lp_lat) - HALFPI) <= EPS10) throw proj_exception();;
+ xy_x = this->m_par.k0 * lp_lon;
+ xy_y = - this->m_par.k0 * log(pj_tsfn(lp_lat, sin(lp_lat), this->m_par.e));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ if ((lp_lat = pj_phi2(exp(- xy_y / this->m_par.k0), this->m_par.e)) == HUGE_VAL) throw proj_exception();;
+ lp_lon = xy_x / this->m_par.k0;
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_merc_spheroid : public base_t_fi<base_merc_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_merc_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_merc_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_merc_spheroid(const PAR& par)
+ : base_t_fi<base_merc_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if (fabs(fabs(lp_lat) - HALFPI) <= EPS10) throw proj_exception();;
+ xy_x = this->m_par.k0 * lp_lon;
+ xy_y = this->m_par.k0 * log(tan(FORTPI + .5 * lp_lat));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = HALFPI - 2. * atan(exp(-xy_y / this->m_par.k0));
+ lp_lon = xy_x / this->m_par.k0;
+ }
+ };
+
+ // Mercator
+ template <typename PAR>
+ void setup_merc(PAR& par)
+ {
+ double phits=0.0;
+ int is_phits;
+ if( (is_phits = pj_param(par.params, "tlat_ts").i) ) {
+ phits = fabs(pj_param(par.params, "rlat_ts").f);
+ if (phits >= HALFPI) throw proj_exception(-24);
+ }
+ if (par.es) { /* ellipsoid */
+ if (is_phits)
+ par.k0 = pj_msfn(sin(phits), cos(phits), par.es);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else { /* sphere */
+ if (is_phits)
+ par.k0 = cos(phits);
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+ } // namespace merc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Mercator projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ - lat_ts=
+ \par Example
+ \image html ex_merc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct merc_ellipsoid : public impl::merc::base_merc_ellipsoid<LL, XY, PAR>
+ {
+ inline merc_ellipsoid(const PAR& par) : impl::merc::base_merc_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::merc::setup_merc(this->m_par);
+ }
+ };
+
+ /*!
+ \brief Mercator projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ - lat_ts=
+ \par Example
+ \image html ex_merc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct merc_spheroid : public impl::merc::base_merc_spheroid<LL, XY, PAR>
+ {
+ inline merc_spheroid(const PAR& par) : impl::merc::base_merc_spheroid<LL, XY, PAR>(par)
+ {
+ impl::merc::setup_merc(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class merc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<merc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<merc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void merc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("merc", new merc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_MERC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/mill.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/mill.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,138 @@
+#ifndef _PROJECTIONS_MILL_HPP
+#define _PROJECTIONS_MILL_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace mill
+ {
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_mill_spheroid : public base_t_fi<base_mill_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_mill_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_mill_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_mill_spheroid(const PAR& par)
+ : base_t_fi<base_mill_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = lp_lon;
+ xy_y = log(tan(FORTPI + lp_lat * .4)) * 1.25;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lon = xy_x;
+ lp_lat = 2.5 * (atan(exp(.8 * xy_y)) - FORTPI);
+ }
+ };
+
+ // Miller Cylindrical
+ template <typename PAR>
+ void setup_mill(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace mill
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Miller Cylindrical projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ \par Example
+ \image html ex_mill.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct mill_spheroid : public impl::mill::base_mill_spheroid<LL, XY, PAR>
+ {
+ inline mill_spheroid(const PAR& par) : impl::mill::base_mill_spheroid<LL, XY, PAR>(par)
+ {
+ impl::mill::setup_mill(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class mill_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<mill_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void mill_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("mill", new mill_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_MILL_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/mod_ster.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/mod_ster.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,471 @@
+#ifndef _PROJECTIONS_MOD_STER_HPP
+#define _PROJECTIONS_MOD_STER_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_zpoly1.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace mod_ster
+ {
+ static const double EPSLN = 1e-10;
+
+ struct par_mod_ster
+ {
+ COMPLEX *zcoeff;
+ double cchio, schio;
+ int n;
+ };
+ /* based upon Snyder and Linck, USGS-NMD */
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_mod_ster_ellipsoid : public base_t_fi<base_mod_ster_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_mod_ster_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_mod_ster_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_mod_ster m_proj_parm;
+
+ inline base_mod_ster_ellipsoid(const PAR& par)
+ : base_t_fi<base_mod_ster_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double sinlon, coslon, esphi, chi, schi, cchi, s;
+ COMPLEX p;
+
+ sinlon = sin(lp_lon);
+ coslon = cos(lp_lon);
+ esphi = this->m_par.e * sin(lp_lat);
+ chi = 2. * atan(tan((HALFPI + lp_lat) * .5) *
+ pow((1. - esphi) / (1. + esphi), this->m_par.e * .5)) - HALFPI;
+ schi = sin(chi);
+ cchi = cos(chi);
+ s = 2. / (1. + this->m_proj_parm.schio * schi + this->m_proj_parm.cchio * cchi * coslon);
+ p.r = s * cchi * sinlon;
+ p.i = s * (this->m_proj_parm.cchio * schi - this->m_proj_parm.schio * cchi * coslon);
+ p = pj_zpoly1(p, this->m_proj_parm.zcoeff, this->m_proj_parm.n);
+ xy_x = p.r;
+ xy_y = p.i;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ int nn;
+ COMPLEX p, fxy, fpxy, dp;
+ double den, rh, z, sinz, cosz, chi, phi, dphi, esphi;
+
+ p.r = xy_x;
+ p.i = xy_y;
+ for (nn = 20; nn ;--nn) {
+ fxy = pj_zpolyd1(p, this->m_proj_parm.zcoeff, this->m_proj_parm.n, &fpxy);
+ fxy.r -= xy_x;
+ fxy.i -= xy_y;
+ den = fpxy.r * fpxy.r + fpxy.i * fpxy.i;
+ dp.r = -(fxy.r * fpxy.r + fxy.i * fpxy.i) / den;
+ dp.i = -(fxy.i * fpxy.r - fxy.r * fpxy.i) / den;
+ p.r += dp.r;
+ p.i += dp.i;
+ if ((fabs(dp.r) + fabs(dp.i)) <= EPSLN)
+ break;
+ }
+ if (nn) {
+ rh = hypot(p.r, p.i);
+ z = 2. * atan(.5 * rh);
+ sinz = sin(z);
+ cosz = cos(z);
+ lp_lon = this->m_par.lam0;
+ if (fabs(rh) <= EPSLN) {
+ lp_lat = this->m_par.phi0;
+ return;
+ }
+ chi = aasin(cosz * this->m_proj_parm.schio + p.i * sinz * this->m_proj_parm.cchio / rh);
+ phi = chi;
+ for (nn = 20; nn ;--nn) {
+ esphi = this->m_par.e * sin(phi);
+ dphi = 2. * atan(tan((HALFPI + chi) * .5) *
+ pow((1. + esphi) / (1. - esphi), this->m_par.e * .5)) - HALFPI - phi;
+ phi += dphi;
+ if (fabs(dphi) <= EPSLN)
+ break;
+ }
+ }
+ if (nn) {
+ lp_lat = phi;
+ lp_lon = atan2(p.r * sinz, rh * this->m_proj_parm.cchio * cosz - p.i *
+ this->m_proj_parm.schio * sinz);
+ } else
+ lp_lon = lp_lat = HUGE_VAL;
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_mod_ster& proj_parm) /* general initialization */
+ {
+ double esphi, chio;
+ if (par.es) {
+ esphi = par.e * sin(par.phi0);
+ chio = 2. * atan(tan((HALFPI + par.phi0) * .5) *
+ pow((1. - esphi) / (1. + esphi), par.e * .5)) - HALFPI;
+ } else
+ chio = par.phi0;
+ proj_parm.schio = sin(chio);
+ proj_parm.cchio = cos(chio);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+
+ // Miller Oblated Stereographic
+ template <typename PAR>
+ void setup_mil_os(PAR& par, par_mod_ster& proj_parm)
+ {
+ static COMPLEX /* Miller Oblated Stereographic */
+ AB[] = {
+ {0.924500, 0.},
+ {0., 0.},
+ {0.019430, 0.}
+ };
+ proj_parm.n = 2;
+ par.lam0 = DEG_TO_RAD * 20.;
+ par.phi0 = DEG_TO_RAD * 18.;
+ proj_parm.zcoeff = AB;
+ par.es = 0.;
+ setup(par, proj_parm);
+ }
+
+ // Lee Oblated Stereographic
+ template <typename PAR>
+ void setup_lee_os(PAR& par, par_mod_ster& proj_parm)
+ {
+ static COMPLEX /* Lee Oblated Stereographic */
+ AB[] = {
+ {0.721316, 0.},
+ {0., 0.},
+ {-0.0088162, -0.00617325}
+ };
+ proj_parm.n = 2;
+ par.lam0 = DEG_TO_RAD * -165.;
+ par.phi0 = DEG_TO_RAD * -10.;
+ proj_parm.zcoeff = AB;
+ par.es = 0.;
+ setup(par, proj_parm);
+ }
+
+ // Mod. Stererographics of 48 U.S.
+ template <typename PAR>
+ void setup_gs48(PAR& par, par_mod_ster& proj_parm)
+ {
+ static COMPLEX /* 48 United States */
+ AB[] = {
+ {0.98879, 0.},
+ {0., 0.},
+ {-0.050909, 0.},
+ {0., 0.},
+ {0.075528, 0.}
+ };
+ proj_parm.n = 4;
+ par.lam0 = DEG_TO_RAD * -96.;
+ par.phi0 = DEG_TO_RAD * -39.;
+ proj_parm.zcoeff = AB;
+ par.es = 0.;
+ par.a = 6370997.;
+ setup(par, proj_parm);
+ }
+
+ // Mod. Stererographics of Alaska
+ template <typename PAR>
+ void setup_alsk(PAR& par, par_mod_ster& proj_parm)
+ {
+ static COMPLEX
+ ABe[] = { /* Alaska ellipsoid */
+ {.9945303, 0.},
+ {.0052083, -.0027404},
+ {.0072721, .0048181},
+ {-.0151089, -.1932526},
+ {.0642675, -.1381226},
+ {.3582802, -.2884586}},
+ ABs[] = { /* Alaska sphere */
+ {.9972523, 0.},
+ {.0052513, -.0041175},
+ {.0074606, .0048125},
+ {-.0153783, -.1968253},
+ {.0636871, -.1408027},
+ {.3660976, -.2937382}
+ };
+ proj_parm.n = 5;
+ par.lam0 = DEG_TO_RAD * -152.;
+ par.phi0 = DEG_TO_RAD * 64.;
+ if (par.es) { /* fixed ellipsoid/sphere */
+ proj_parm.zcoeff = ABe;
+ par.a = 6378206.4;
+ par.e = sqrt(par.es = 0.00676866);
+ } else {
+ proj_parm.zcoeff = ABs;
+ par.a = 6370997.;
+ }
+ setup(par, proj_parm);
+ }
+
+ // Mod. Stererographics of 50 U.S.
+ template <typename PAR>
+ void setup_gs50(PAR& par, par_mod_ster& proj_parm)
+ {
+ static COMPLEX
+ ABe[] = { /* GS50 ellipsoid */
+ {.9827497, 0.},
+ {.0210669, .0053804},
+ {-.1031415, -.0571664},
+ {-.0323337, -.0322847},
+ {.0502303, .1211983},
+ {.0251805, .0895678},
+ {-.0012315, -.1416121},
+ {.0072202, -.1317091},
+ {-.0194029, .0759677},
+ {-.0210072, .0834037}
+ },
+ ABs[] = { /* GS50 sphere */
+ {.9842990, 0.},
+ {.0211642, .0037608},
+ {-.1036018, -.0575102},
+ {-.0329095, -.0320119},
+ {.0499471, .1223335},
+ {.0260460, .0899805},
+ {.0007388, -.1435792},
+ {.0075848, -.1334108},
+ {-.0216473, .0776645},
+ {-.0225161, .0853673}
+ };
+ proj_parm.n = 9;
+ par.lam0 = DEG_TO_RAD * -120.;
+ par.phi0 = DEG_TO_RAD * 45.;
+ if (par.es) { /* fixed ellipsoid/sphere */
+ proj_parm.zcoeff = ABe;
+ par.a = 6378206.4;
+ par.e = sqrt(par.es = 0.00676866);
+ } else {
+ proj_parm.zcoeff = ABs;
+ par.a = 6370997.;
+ }
+ setup(par, proj_parm);
+ }
+
+ } // namespace mod_ster
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Miller Oblated Stereographic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azi(mod)
+ \par Example
+ \image html ex_mil_os.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct mil_os_ellipsoid : public impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>
+ {
+ inline mil_os_ellipsoid(const PAR& par) : impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::mod_ster::setup_mil_os(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Lee Oblated Stereographic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azi(mod)
+ \par Example
+ \image html ex_lee_os.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct lee_os_ellipsoid : public impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>
+ {
+ inline lee_os_ellipsoid(const PAR& par) : impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::mod_ster::setup_lee_os(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Mod. Stererographics of 48 U.S. projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azi(mod)
+ \par Example
+ \image html ex_gs48.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct gs48_ellipsoid : public impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>
+ {
+ inline gs48_ellipsoid(const PAR& par) : impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::mod_ster::setup_gs48(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Mod. Stererographics of Alaska projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azi(mod)
+ \par Example
+ \image html ex_alsk.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct alsk_ellipsoid : public impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>
+ {
+ inline alsk_ellipsoid(const PAR& par) : impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::mod_ster::setup_alsk(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Mod. Stererographics of 50 U.S. projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azi(mod)
+ \par Example
+ \image html ex_gs50.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct gs50_ellipsoid : public impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>
+ {
+ inline gs50_ellipsoid(const PAR& par) : impl::mod_ster::base_mod_ster_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::mod_ster::setup_gs50(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class mil_os_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<mil_os_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class lee_os_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<lee_os_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class gs48_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<gs48_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class alsk_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<alsk_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class gs50_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<gs50_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void mod_ster_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("mil_os", new mil_os_entry<LL, XY, PAR>);
+ factory.add_to_factory("lee_os", new lee_os_entry<LL, XY, PAR>);
+ factory.add_to_factory("gs48", new gs48_entry<LL, XY, PAR>);
+ factory.add_to_factory("alsk", new alsk_entry<LL, XY, PAR>);
+ factory.add_to_factory("gs50", new gs50_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_MOD_STER_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/moll.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/moll.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,259 @@
+#ifndef _PROJECTIONS_MOLL_HPP
+#define _PROJECTIONS_MOLL_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace moll
+ {
+ static const int MAX_ITER = 10;
+ static const double LOOP_TOL = 1e-7;
+
+ struct par_moll
+ {
+ double C_x, C_y, C_p;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_moll_spheroid : public base_t_fi<base_moll_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_moll_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_moll_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_moll m_proj_parm;
+
+ inline base_moll_spheroid(const PAR& par)
+ : base_t_fi<base_moll_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double k, V;
+ int i;
+
+ k = this->m_proj_parm.C_p * sin(lp_lat);
+ for (i = MAX_ITER; i ; --i) {
+ lp_lat -= V = (lp_lat + sin(lp_lat) - k) /
+ (1. + cos(lp_lat));
+ if (fabs(V) < LOOP_TOL)
+ break;
+ }
+ if (!i)
+ lp_lat = (lp_lat < 0.) ? -HALFPI : HALFPI;
+ else
+ lp_lat *= 0.5;
+ xy_x = this->m_proj_parm.C_x * lp_lon * cos(lp_lat);
+ xy_y = this->m_proj_parm.C_y * sin(lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double th, s;
+
+ lp_lat = aasin(xy_y / this->m_proj_parm.C_y);
+ lp_lon = xy_x / (this->m_proj_parm.C_x * cos(lp_lat));
+ lp_lat += lp_lat;
+ lp_lat = aasin((lp_lat + sin(lp_lat)) / this->m_proj_parm.C_p);
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_moll& proj_parm, double p)
+ {
+ double r, sp, p2 = p + p;
+ par.es = 0;
+ sp = sin(p);
+ r = sqrt(TWOPI * sp / (p2 + sin(p2)));
+ proj_parm.C_x = 2. * r / PI;
+ proj_parm.C_y = r / sp;
+ proj_parm.C_p = p2 + sin(p2);
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // Mollweide
+ template <typename PAR>
+ void setup_moll(PAR& par, par_moll& proj_parm)
+ {
+ setup(par, proj_parm, HALFPI);
+ }
+
+ // Wagner IV
+ template <typename PAR>
+ void setup_wag4(PAR& par, par_moll& proj_parm)
+ {
+ setup(par, proj_parm, PI/3.);
+ }
+
+ // Wagner V
+ template <typename PAR>
+ void setup_wag5(PAR& par, par_moll& proj_parm)
+ {
+ par.es = 0;
+ proj_parm.C_x = 0.90977;
+ proj_parm.C_y = 1.65014;
+ proj_parm.C_p = 3.00896;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace moll
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Mollweide projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_moll.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct moll_spheroid : public impl::moll::base_moll_spheroid<LL, XY, PAR>
+ {
+ inline moll_spheroid(const PAR& par) : impl::moll::base_moll_spheroid<LL, XY, PAR>(par)
+ {
+ impl::moll::setup_moll(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Wagner IV projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_wag4.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wag4_spheroid : public impl::moll::base_moll_spheroid<LL, XY, PAR>
+ {
+ inline wag4_spheroid(const PAR& par) : impl::moll::base_moll_spheroid<LL, XY, PAR>(par)
+ {
+ impl::moll::setup_wag4(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Wagner V projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_wag5.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wag5_spheroid : public impl::moll::base_moll_spheroid<LL, XY, PAR>
+ {
+ inline wag5_spheroid(const PAR& par) : impl::moll::base_moll_spheroid<LL, XY, PAR>(par)
+ {
+ impl::moll::setup_wag5(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class moll_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<moll_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class wag4_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<wag4_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class wag5_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<wag5_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void moll_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("moll", new moll_entry<LL, XY, PAR>);
+ factory.add_to_factory("wag4", new wag4_entry<LL, XY, PAR>);
+ factory.add_to_factory("wag5", new wag5_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_MOLL_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/nell.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/nell.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,154 @@
+#ifndef _PROJECTIONS_NELL_HPP
+#define _PROJECTIONS_NELL_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace nell
+ {
+ static const int MAX_ITER = 10;
+ static const double LOOP_TOL = 1e-7;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_nell_spheroid : public base_t_fi<base_nell_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_nell_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_nell_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_nell_spheroid(const PAR& par)
+ : base_t_fi<base_nell_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double k, V;
+ int i;
+
+ k = 2. * sin(lp_lat);
+ V = lp_lat * lp_lat;
+ lp_lat *= 1.00371 + V * (-0.0935382 + V * -0.011412);
+ for (i = MAX_ITER; i ; --i) {
+ lp_lat -= V = (lp_lat + sin(lp_lat) - k) /
+ (1. + cos(lp_lat));
+ if (fabs(V) < LOOP_TOL)
+ break;
+ }
+ xy_x = 0.5 * lp_lon * (1. + cos(lp_lat));
+ xy_y = lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double th, s;
+
+ lp_lon = 2. * xy_x / (1. + cos(xy_y));
+ lp_lat = aasin(0.5 * (xy_y + sin(xy_y)));
+ }
+ };
+
+ // Nell
+ template <typename PAR>
+ void setup_nell(PAR& par)
+ {
+ par.es = 0;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace nell
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Nell projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_nell.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct nell_spheroid : public impl::nell::base_nell_spheroid<LL, XY, PAR>
+ {
+ inline nell_spheroid(const PAR& par) : impl::nell::base_nell_spheroid<LL, XY, PAR>(par)
+ {
+ impl::nell::setup_nell(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class nell_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<nell_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void nell_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("nell", new nell_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_NELL_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/nell_h.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/nell_h.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,153 @@
+#ifndef _PROJECTIONS_NELL_H_HPP
+#define _PROJECTIONS_NELL_H_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace nell_h
+ {
+ static const int NITER = 9;
+ static const double EPS = 1e-7;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_nell_h_spheroid : public base_t_fi<base_nell_h_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_nell_h_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_nell_h_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_nell_h_spheroid(const PAR& par)
+ : base_t_fi<base_nell_h_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = 0.5 * lp_lon * (1. + cos(lp_lat));
+ xy_y = 2.0 * (lp_lat - tan(0.5 *lp_lat));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double V, c, p;
+ int i;
+
+ p = 0.5 * xy_y;
+ for (i = NITER; i ; --i) {
+ c = cos(0.5 * lp_lat);
+ lp_lat -= V = (lp_lat - tan(lp_lat/2) - p)/(1. - 0.5/(c*c));
+ if (fabs(V) < EPS)
+ break;
+ }
+ if (!i) {
+ lp_lat = p < 0. ? -HALFPI : HALFPI;
+ lp_lon = 2. * xy_x;
+ } else
+ lp_lon = 2. * xy_x / (1. + cos(lp_lat));
+ }
+ };
+
+ // Nell-Hammer
+ template <typename PAR>
+ void setup_nell_h(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace nell_h
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Nell-Hammer projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_nell_h.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct nell_h_spheroid : public impl::nell_h::base_nell_h_spheroid<LL, XY, PAR>
+ {
+ inline nell_h_spheroid(const PAR& par) : impl::nell_h::base_nell_h_spheroid<LL, XY, PAR>(par)
+ {
+ impl::nell_h::setup_nell_h(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class nell_h_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<nell_h_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void nell_h_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("nell_h", new nell_h_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_NELL_H_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/nocol.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/nocol.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,160 @@
+#ifndef _PROJECTIONS_NOCOL_HPP
+#define _PROJECTIONS_NOCOL_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace nocol
+ {
+ static const double EPS = 1e-10;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_nocol_spheroid : public base_t_f<base_nocol_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_nocol_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_nocol_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_nocol_spheroid(const PAR& par)
+ : base_t_f<base_nocol_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ if (fabs(lp_lon) < EPS) {
+ xy_x = 0;
+ xy_y = lp_lat;
+ } else if (fabs(lp_lat) < EPS) {
+ xy_x = lp_lon;
+ xy_y = 0.;
+ } else if (fabs(fabs(lp_lon) - HALFPI) < EPS) {
+ xy_x = lp_lon * cos(lp_lat);
+ xy_y = HALFPI * sin(lp_lat);
+ } else if (fabs(fabs(lp_lat) - HALFPI) < EPS) {
+ xy_x = 0;
+ xy_y = lp_lat;
+ } else {
+ double tb, c, d, m, n, r2, sp;
+
+ tb = HALFPI / lp_lon - lp_lon / HALFPI;
+ c = lp_lat / HALFPI;
+ d = (1 - c * c)/((sp = sin(lp_lat)) - c);
+ r2 = tb / d;
+ r2 *= r2;
+ m = (tb * sp / d - 0.5 * tb)/(1. + r2);
+ n = (sp / r2 + 0.5 * d)/(1. + 1./r2);
+ xy_x = cos(lp_lat);
+ xy_x = sqrt(m * m + xy_x * xy_x / (1. + r2));
+ xy_x = HALFPI * ( m + (lp_lon < 0. ? -xy_x : xy_x));
+ xy_y = sqrt(n * n - (sp * sp / r2 + d * sp - 1.) /
+ (1. + 1./r2));
+ xy_y = HALFPI * ( n + (lp_lat < 0. ? xy_y : -xy_y ));
+ }
+ }
+ };
+
+ // Nicolosi Globular
+ template <typename PAR>
+ void setup_nicol(PAR& par)
+ {
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace nocol
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Nicolosi Globular projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_nicol.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct nicol_spheroid : public impl::nocol::base_nocol_spheroid<LL, XY, PAR>
+ {
+ inline nicol_spheroid(const PAR& par) : impl::nocol::base_nocol_spheroid<LL, XY, PAR>(par)
+ {
+ impl::nocol::setup_nicol(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class nicol_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<nicol_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void nocol_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("nicol", new nicol_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_NOCOL_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/nsper.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/nsper.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,314 @@
+#ifndef _PROJECTIONS_NSPER_HPP
+#define _PROJECTIONS_NSPER_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace nsper
+ {
+ static const double EPS10 = 1.e-10;
+ static const int N_POLE = 0;
+ static const int S_POLE = 1;
+ static const int EQUIT = 2;
+ static const int OBLIQ = 3;
+
+ struct par_nsper
+ {
+ double height;
+ double sinph0;
+ double cosph0;
+ double p;
+ double rp;
+ double pn1;
+ double pfact;
+ double h;
+ double cg;
+ double sg;
+ double sw;
+ double cw;
+ int mode;
+ int tilt;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_nsper_spheroid : public base_t_fi<base_nsper_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_nsper_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_nsper_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_nsper m_proj_parm;
+
+ inline base_nsper_spheroid(const PAR& par)
+ : base_t_fi<base_nsper_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, cosphi, sinphi;
+
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ coslam = cos(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ xy_y = this->m_proj_parm.sinph0 * sinphi + this->m_proj_parm.cosph0 * cosphi * coslam;
+ break;
+ case EQUIT:
+ xy_y = cosphi * coslam;
+ break;
+ case S_POLE:
+ xy_y = - sinphi;
+ break;
+ case N_POLE:
+ xy_y = sinphi;
+ break;
+ }
+ if (xy_y < this->m_proj_parm.rp) throw proj_exception();;
+ xy_y = this->m_proj_parm.pn1 / (this->m_proj_parm.p - xy_y);
+ xy_x = xy_y * cosphi * sin(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ xy_y *= (this->m_proj_parm.cosph0 * sinphi -
+ this->m_proj_parm.sinph0 * cosphi * coslam);
+ break;
+ case EQUIT:
+ xy_y *= sinphi;
+ break;
+ case N_POLE:
+ coslam = - coslam;
+ case S_POLE:
+ xy_y *= cosphi * coslam;
+ break;
+ }
+ if (this->m_proj_parm.tilt) {
+ double yt, ba;
+
+ yt = xy_y * this->m_proj_parm.cg + xy_x * this->m_proj_parm.sg;
+ ba = 1. / (yt * this->m_proj_parm.sw * this->m_proj_parm.h + this->m_proj_parm.cw);
+ xy_x = (xy_x * this->m_proj_parm.cg - xy_y * this->m_proj_parm.sg) * this->m_proj_parm.cw * ba;
+ xy_y = yt * ba;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double rh, cosz, sinz;
+
+ if (this->m_proj_parm.tilt) {
+ double bm, bq, yt;
+
+ yt = 1./(this->m_proj_parm.pn1 - xy_y * this->m_proj_parm.sw);
+ bm = this->m_proj_parm.pn1 * xy_x * yt;
+ bq = this->m_proj_parm.pn1 * xy_y * this->m_proj_parm.cw * yt;
+ xy_x = bm * this->m_proj_parm.cg + bq * this->m_proj_parm.sg;
+ xy_y = bq * this->m_proj_parm.cg - bm * this->m_proj_parm.sg;
+ }
+ rh = hypot(xy_x, xy_y);
+ if ((sinz = 1. - rh * rh * this->m_proj_parm.pfact) < 0.) throw proj_exception();;
+ sinz = (this->m_proj_parm.p - sqrt(sinz)) / (this->m_proj_parm.pn1 / rh + rh / this->m_proj_parm.pn1);
+ cosz = sqrt(1. - sinz * sinz);
+ if (fabs(rh) <= EPS10) {
+ lp_lon = 0.;
+ lp_lat = this->m_par.phi0;
+ } else {
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ lp_lat = asin(cosz * this->m_proj_parm.sinph0 + xy_y * sinz * this->m_proj_parm.cosph0 / rh);
+ xy_y = (cosz - this->m_proj_parm.sinph0 * sin(lp_lat)) * rh;
+ xy_x *= sinz * this->m_proj_parm.cosph0;
+ break;
+ case EQUIT:
+ lp_lat = asin(xy_y * sinz / rh);
+ xy_y = cosz * rh;
+ xy_x *= sinz;
+ break;
+ case N_POLE:
+ lp_lat = asin(cosz);
+ xy_y = -xy_y;
+ break;
+ case S_POLE:
+ lp_lat = - asin(cosz);
+ break;
+ }
+ lp_lon = atan2(xy_x, xy_y);
+ }
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_nsper& proj_parm)
+ {
+ if ((proj_parm.height = pj_param(par.params, "dh").f) <= 0.) throw proj_exception(-30);
+ if (fabs(fabs(par.phi0) - HALFPI) < EPS10)
+ proj_parm.mode = par.phi0 < 0. ? S_POLE : N_POLE;
+ else if (fabs(par.phi0) < EPS10)
+ proj_parm.mode = EQUIT;
+ else {
+ proj_parm.mode = OBLIQ;
+ proj_parm.sinph0 = sin(par.phi0);
+ proj_parm.cosph0 = cos(par.phi0);
+ }
+ proj_parm.pn1 = proj_parm.height / par.a;
+ /* normalize by radius */
+ proj_parm.p = 1. + proj_parm.pn1;
+ proj_parm.rp = 1. / proj_parm.p;
+ proj_parm.h = 1. / proj_parm.pn1;
+ proj_parm.pfact = (proj_parm.p + 1.) * proj_parm.h;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+
+ // Near-sided perspective
+ template <typename PAR>
+ void setup_nsper(PAR& par, par_nsper& proj_parm)
+ {
+ proj_parm.tilt = 0;
+ setup(par, proj_parm);
+ }
+
+ // Tilted perspective
+ template <typename PAR>
+ void setup_tpers(PAR& par, par_nsper& proj_parm)
+ {
+ double omega, gamma;
+ omega = pj_param(par.params, "dtilt").f * DEG_TO_RAD;
+ gamma = pj_param(par.params, "dazi").f * DEG_TO_RAD;
+ proj_parm.tilt = 1;
+ proj_parm.cg = cos(gamma);
+ proj_parm.sg = sin(gamma);
+ proj_parm.cw = cos(omega);
+ proj_parm.sw = sin(omega);
+ setup(par, proj_parm);
+ }
+
+ } // namespace nsper
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Near-sided perspective projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - h=
+ \par Example
+ \image html ex_nsper.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct nsper_spheroid : public impl::nsper::base_nsper_spheroid<LL, XY, PAR>
+ {
+ inline nsper_spheroid(const PAR& par) : impl::nsper::base_nsper_spheroid<LL, XY, PAR>(par)
+ {
+ impl::nsper::setup_nsper(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Tilted perspective projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - tilt= azi= h=
+ \par Example
+ \image html ex_tpers.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct tpers_spheroid : public impl::nsper::base_nsper_spheroid<LL, XY, PAR>
+ {
+ inline tpers_spheroid(const PAR& par) : impl::nsper::base_nsper_spheroid<LL, XY, PAR>(par)
+ {
+ impl::nsper::setup_tpers(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class nsper_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<nsper_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class tpers_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<tpers_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void nsper_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("nsper", new nsper_entry<LL, XY, PAR>);
+ factory.add_to_factory("tpers", new tpers_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_NSPER_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/nzmg.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/nzmg.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,197 @@
+#ifndef _PROJECTIONS_NZMG_HPP
+#define _PROJECTIONS_NZMG_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace nzmg
+ {
+ static const double EPSLN = 1e-10;
+ static const double SEC5_TO_RAD = 0.4848136811095359935899141023;
+ static const double RAD_TO_SEC5 = 2.062648062470963551564733573;
+ static const int Nbf = 5;
+ static const int Ntpsi = 9;
+ static const int Ntphi = 8;
+
+
+ /* */
+
+
+
+ static COMPLEX
+ bf[] = {
+ {.7557853228, 0.0},
+ {.249204646, .003371507},
+ {-.001541739, .041058560},
+ {-.10162907, .01727609},
+ {-.26623489, -.36249218},
+ {-.6870983, -1.1651967} };
+ static double
+ tphi[] = { 1.5627014243, .5185406398, -.03333098, -.1052906, -.0368594,
+ .007317, .01220, .00394, -.0013 },
+ tpsi[] = { .6399175073, -.1358797613, .063294409, -.02526853, .0117879,
+ -.0055161, .0026906, -.001333, .00067, -.00034 };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_nzmg_ellipsoid : public base_t_fi<base_nzmg_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_nzmg_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_nzmg_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_nzmg_ellipsoid(const PAR& par)
+ : base_t_fi<base_nzmg_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ COMPLEX p;
+ double *C;
+ int i;
+
+ lp_lat = (lp_lat - this->m_par.phi0) * RAD_TO_SEC5;
+ for (p.r = *(C = tpsi + (i = Ntpsi)); i ; --i)
+ p.r = *--C + lp_lat * p.r;
+ p.r *= lp_lat;
+ p.i = lp_lon;
+ p = pj_zpoly1(p, bf, Nbf);
+ xy_x = p.i;
+ xy_y = p.r;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ int nn, i;
+ COMPLEX p, f, fp, dp;
+ double den, *C;
+
+ p.r = xy_y;
+ p.i = xy_x;
+ for (nn = 20; nn ;--nn) {
+ f = pj_zpolyd1(p, bf, Nbf, &fp);
+ f.r -= xy_y;
+ f.i -= xy_x;
+ den = fp.r * fp.r + fp.i * fp.i;
+ p.r += dp.r = -(f.r * fp.r + f.i * fp.i) / den;
+ p.i += dp.i = -(f.i * fp.r - f.r * fp.i) / den;
+ if ((fabs(dp.r) + fabs(dp.i)) <= EPSLN)
+ break;
+ }
+ if (nn) {
+ lp_lon = p.i;
+ for (lp_lat = *(C = tphi + (i = Ntphi)); i ; --i)
+ lp_lat = *--C + p.r * lp_lat;
+ lp_lat = this->m_par.phi0 + p.r * lp_lat * SEC5_TO_RAD;
+ } else
+ lp_lon = lp_lat = HUGE_VAL;
+ }
+ };
+
+ // New Zealand Map Grid
+ template <typename PAR>
+ void setup_nzmg(PAR& par)
+ {
+ /* force to International major axis */
+ par.ra = 1. / (par.a = 6378388.0);
+ par.lam0 = DEG_TO_RAD * 173.;
+ par.phi0 = DEG_TO_RAD * -41.;
+ par.x0 = 2510000.;
+ par.y0 = 6023150.;
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+ } // namespace nzmg
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief New Zealand Map Grid projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - fixed Earth
+ \par Example
+ \image html ex_nzmg.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct nzmg_ellipsoid : public impl::nzmg::base_nzmg_ellipsoid<LL, XY, PAR>
+ {
+ inline nzmg_ellipsoid(const PAR& par) : impl::nzmg::base_nzmg_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::nzmg::setup_nzmg(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class nzmg_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<nzmg_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void nzmg_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("nzmg", new nzmg_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_NZMG_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/ob_tran.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/ob_tran.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,315 @@
+#ifndef _PROJECTIONS_OB_TRAN_HPP
+#define _PROJECTIONS_OB_TRAN_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace projection
+{
+
+ template <typename LL, typename XY, typename PAR> class factory;
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace ob_tran
+ {
+ static const double TOL = 1e-10;
+
+ template <typename LL, typename XY>
+ struct par_ob_tran
+ {
+ boost::shared_ptr<projection<LL, XY> > link;
+ double lamp;
+ double cphip, sphip;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_ob_tran_oblique : public base_t_fi<base_ob_tran_oblique<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_ob_tran_oblique<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_ob_tran_oblique<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_ob_tran<LL, XY> m_proj_parm;
+
+ inline base_ob_tran_oblique(const PAR& par)
+ : base_t_fi<base_ob_tran_oblique<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, sinphi, cosphi;
+
+
+
+ coslam = cos(lp_lon);
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ lp_lon = adjlon(aatan2(cosphi * sin(lp_lon), this->m_proj_parm.sphip * cosphi * coslam +
+ this->m_proj_parm.cphip * sinphi) + this->m_proj_parm.lamp);
+ lp_lat = aasin(this->m_proj_parm.sphip * sinphi - this->m_proj_parm.cphip * cosphi * coslam);
+ m_proj_parm.link->fwd(lp_lon, lp_lat, xy_x, xy_y);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double coslam, sinphi, cosphi;
+
+ m_proj_parm.link->inv(xy_x, xy_y, lp_lon, lp_lat);
+ if (lp_lon != HUGE_VAL) {
+ coslam = cos(lp_lon -= this->m_proj_parm.lamp);
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ lp_lat = aasin(this->m_proj_parm.sphip * sinphi + this->m_proj_parm.cphip * cosphi * coslam);
+ lp_lon = aatan2(cosphi * sin(lp_lon), this->m_proj_parm.sphip * cosphi * coslam -
+ this->m_proj_parm.cphip * sinphi);
+ }
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_ob_tran_transverse : public base_t_fi<base_ob_tran_transverse<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_ob_tran_transverse<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_ob_tran_transverse<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_ob_tran<LL, XY> m_proj_parm;
+
+ inline base_ob_tran_transverse(const PAR& par)
+ : base_t_fi<base_ob_tran_transverse<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double cosphi, coslam;
+
+
+
+ cosphi = cos(lp_lat);
+ coslam = cos(lp_lon);
+ lp_lon = adjlon(aatan2(cosphi * sin(lp_lon), sin(lp_lat)) + this->m_proj_parm.lamp);
+ lp_lat = aasin(- cosphi * coslam);
+ m_proj_parm.link->fwd(lp_lon, lp_lat, xy_x, xy_y);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double cosphi, t;
+
+ m_proj_parm.link->inv(xy_x, xy_y, lp_lon, lp_lat);
+ if (lp_lon != HUGE_VAL) {
+ cosphi = cos(lp_lat);
+ t = lp_lon - this->m_proj_parm.lamp;
+ lp_lon = aatan2(cosphi * sin(t), - sin(lp_lat));
+ lp_lat = aasin(cosphi * cos(t));
+ }
+ }
+ };
+
+ // General Oblique Transformation
+ template <typename LL, typename XY, typename PAR>
+ double setup_ob_tran(PAR& par, par_ob_tran<LL, XY>& proj_parm, bool create = true)
+ {
+ int i;
+ double phip;
+
+
+ PAR pj;
+ /* copy existing header into new */
+ par.es = 0.;
+ /* force to spherical */
+ pj.params = par.params;
+ pj.over = par.over;
+ pj.geoc = par.geoc;
+ pj.a = par.a;
+ pj.es = par.es;
+ pj.ra = par.ra;
+ pj.lam0 = par.lam0;
+ pj.phi0 = par.phi0;
+ pj.x0 = par.x0;
+ pj.y0 = par.y0;
+ pj.k0 = par.k0;
+ /* force spherical earth */
+ pj.one_es = pj.rone_es = 1.;
+ pj.es = pj.e = 0.;
+ pj.name = pj_param(par.params, "so_proj").s;
+
+ factory<LL, XY, PAR> fac;
+ if (create)
+ {
+ proj_parm.link.reset(fac.create_new(pj));
+ if (! proj_parm.link.get()) throw proj_exception(-26);
+ }
+ if (pj_param(par.params, "to_alpha").i) {
+ double lamc, phic, alpha;
+ lamc = pj_param(par.params, "ro_lon_c").f;
+ phic = pj_param(par.params, "ro_lat_c").f;
+ alpha = pj_param(par.params, "ro_alpha").f;
+ /*
+ if (fabs(phic) <= TOL ||
+ fabs(fabs(phic) - HALFPI) <= TOL ||
+ fabs(fabs(alpha) - HALFPI) <= TOL)
+ */
+ if (fabs(fabs(phic) - HALFPI) <= TOL)
+ throw proj_exception(-32);
+ proj_parm.lamp = lamc + aatan2(-cos(alpha), -sin(alpha) * sin(phic));
+ phip = aasin(cos(phic) * sin(alpha));
+ } else if (pj_param(par.params, "to_lat_p").i) { /* specified new pole */
+ proj_parm.lamp = pj_param(par.params, "ro_lon_p").f;
+ phip = pj_param(par.params, "ro_lat_p").f;
+ } else { /* specified new "equator" points */
+ double lam1, lam2, phi1, phi2, con;
+ lam1 = pj_param(par.params, "ro_lon_1").f;
+ phi1 = pj_param(par.params, "ro_lat_1").f;
+ lam2 = pj_param(par.params, "ro_lon_2").f;
+ phi2 = pj_param(par.params, "ro_lat_2").f;
+ if (fabs(phi1 - phi2) <= TOL ||
+ (con = fabs(phi1)) <= TOL ||
+ fabs(con - HALFPI) <= TOL ||
+ fabs(fabs(phi2) - HALFPI) <= TOL) throw proj_exception(-33);
+ proj_parm.lamp = atan2(cos(phi1) * sin(phi2) * cos(lam1) -
+ sin(phi1) * cos(phi2) * cos(lam2),
+ sin(phi1) * cos(phi2) * sin(lam2) -
+ cos(phi1) * sin(phi2) * sin(lam1));
+ phip = atan(-cos(proj_parm.lamp - lam1) / tan(phi1));
+ }
+ if (fabs(phip) > TOL) { /* oblique */
+ proj_parm.cphip = cos(phip);
+ proj_parm.sphip = sin(phip);
+ // par.fwd = o_forward;
+ // par.inv = pj.inv ? o_inverse : 0;
+ } else { /* transverse */
+ // par.fwd = t_forward;
+ // par.inv = pj.inv ? t_inverse : 0;
+ }
+ // return phip to choose model
+ return phip;
+ }
+
+ } // namespace ob_tran
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief General Oblique Transformation projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - o_proj= plus parameters for projection
+ - o_lat_p= o_lon_p= (new pole) or
+ - o_alpha= o_lon_c= o_lat_c= or
+ - o_lon_1= o_lat_1= o_lon_2= o_lat_2=
+ \par Example
+ \image html ex_ob_tran.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct ob_tran_oblique : public impl::ob_tran::base_ob_tran_oblique<LL, XY, PAR>
+ {
+ inline ob_tran_oblique(const PAR& par) : impl::ob_tran::base_ob_tran_oblique<LL, XY, PAR>(par)
+ {
+ impl::ob_tran::setup_ob_tran(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief General Oblique Transformation projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - o_proj= plus parameters for projection
+ - o_lat_p= o_lon_p= (new pole) or
+ - o_alpha= o_lon_c= o_lat_c= or
+ - o_lon_1= o_lat_1= o_lon_2= o_lat_2=
+ \par Example
+ \image html ex_ob_tran.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct ob_tran_transverse : public impl::ob_tran::base_ob_tran_transverse<LL, XY, PAR>
+ {
+ inline ob_tran_transverse(const PAR& par) : impl::ob_tran::base_ob_tran_transverse<LL, XY, PAR>(par)
+ {
+ impl::ob_tran::setup_ob_tran(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class ob_tran_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ impl::ob_tran::par_ob_tran<LL, XY> proj_parm;
+ PAR p = par;
+ double phip = setup_ob_tran(p, proj_parm, false);
+ if (fabs(phip) > impl::ob_tran::TOL)
+ return new base_v_fi<ob_tran_oblique<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<ob_tran_transverse<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void ob_tran_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("ob_tran", new ob_tran_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_OB_TRAN_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/ocea.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/ocea.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,189 @@
+#ifndef _PROJECTIONS_OCEA_HPP
+#define _PROJECTIONS_OCEA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace ocea
+ {
+
+ struct par_ocea
+ {
+ double rok;
+ double rtk;
+ double sinphi;
+ double cosphi;
+ double singam;
+ double cosgam;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_ocea_spheroid : public base_t_fi<base_ocea_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_ocea_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_ocea_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_ocea m_proj_parm;
+
+ inline base_ocea_spheroid(const PAR& par)
+ : base_t_fi<base_ocea_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double t;
+
+ xy_y = sin(lp_lon);
+ /*
+ xy_x = atan2((tan(lp_lat) * this->m_proj_parm.cosphi + this->m_proj_parm.sinphi * xy_y) , cos(lp_lon));
+ */
+ t = cos(lp_lon);
+ xy_x = atan((tan(lp_lat) * this->m_proj_parm.cosphi + this->m_proj_parm.sinphi * xy_y) / t);
+ if (t < 0.)
+ xy_x += PI;
+ xy_x *= this->m_proj_parm.rtk;
+ xy_y = this->m_proj_parm.rok * (this->m_proj_parm.sinphi * sin(lp_lat) - this->m_proj_parm.cosphi * cos(lp_lat) * xy_y);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double t, s;
+
+ xy_y /= this->m_proj_parm.rok;
+ xy_x /= this->m_proj_parm.rtk;
+ t = sqrt(1. - xy_y * xy_y);
+ lp_lat = asin(xy_y * this->m_proj_parm.sinphi + t * this->m_proj_parm.cosphi * (s = sin(xy_x)));
+ lp_lon = atan2(t * this->m_proj_parm.sinphi * s - xy_y * this->m_proj_parm.cosphi,
+ t * cos(xy_x));
+ }
+ };
+
+ // Oblique Cylindrical Equal Area
+ template <typename PAR>
+ void setup_ocea(PAR& par, par_ocea& proj_parm)
+ {
+ double phi_0=0.0, phi_1, phi_2, lam_1, lam_2, lonz, alpha;
+ proj_parm.rok = par.a / par.k0;
+ proj_parm.rtk = par.a * par.k0;
+ if ( pj_param(par.params, "talpha").i) {
+ alpha = pj_param(par.params, "ralpha").f;
+ lonz = pj_param(par.params, "rlonc").f;
+ proj_parm.singam = atan(-cos(alpha)/(-sin(phi_0) * sin(alpha))) + lonz;
+ proj_parm.sinphi = asin(cos(phi_0) * sin(alpha));
+ } else {
+ phi_1 = pj_param(par.params, "rlat_1").f;
+ phi_2 = pj_param(par.params, "rlat_2").f;
+ lam_1 = pj_param(par.params, "rlon_1").f;
+ lam_2 = pj_param(par.params, "rlon_2").f;
+ proj_parm.singam = atan2(cos(phi_1) * sin(phi_2) * cos(lam_1) -
+ sin(phi_1) * cos(phi_2) * cos(lam_2),
+ sin(phi_1) * cos(phi_2) * sin(lam_2) -
+ cos(phi_1) * sin(phi_2) * sin(lam_1) );
+ proj_parm.sinphi = atan(-cos(proj_parm.singam - lam_1) / tan(phi_1));
+ }
+ par.lam0 = proj_parm.singam + HALFPI;
+ proj_parm.cosphi = cos(proj_parm.sinphi);
+ proj_parm.sinphi = sin(proj_parm.sinphi);
+ proj_parm.cosgam = cos(proj_parm.singam);
+ proj_parm.singam = sin(proj_parm.singam);
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace ocea
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Oblique Cylindrical Equal Area projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Sph lonc= alpha= or
+ - lat_1= lat_2= lon_1= lon_2=
+ \par Example
+ \image html ex_ocea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct ocea_spheroid : public impl::ocea::base_ocea_spheroid<LL, XY, PAR>
+ {
+ inline ocea_spheroid(const PAR& par) : impl::ocea::base_ocea_spheroid<LL, XY, PAR>(par)
+ {
+ impl::ocea::setup_ocea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class ocea_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<ocea_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void ocea_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("ocea", new ocea_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_OCEA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/oea.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/oea.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,181 @@
+#ifndef _PROJECTIONS_OEA_HPP
+#define _PROJECTIONS_OEA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace oea
+ {
+
+ struct par_oea
+ {
+ double theta;
+ double m, n;
+ double two_r_m, two_r_n, rm, rn, hm, hn;
+ double cp0, sp0;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_oea_spheroid : public base_t_fi<base_oea_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_oea_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_oea_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_oea m_proj_parm;
+
+ inline base_oea_spheroid(const PAR& par)
+ : base_t_fi<base_oea_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double Az, M, N, cp, sp, cl, shz;
+
+ cp = cos(lp_lat);
+ sp = sin(lp_lat);
+ cl = cos(lp_lon);
+ Az = aatan2(cp * sin(lp_lon), this->m_proj_parm.cp0 * sp - this->m_proj_parm.sp0 * cp * cl) + this->m_proj_parm.theta;
+ shz = sin(0.5 * aacos(this->m_proj_parm.sp0 * sp + this->m_proj_parm.cp0 * cp * cl));
+ M = aasin(shz * sin(Az));
+ N = aasin(shz * cos(Az) * cos(M) / cos(M * this->m_proj_parm.two_r_m));
+ xy_y = this->m_proj_parm.n * sin(N * this->m_proj_parm.two_r_n);
+ xy_x = this->m_proj_parm.m * sin(M * this->m_proj_parm.two_r_m) * cos(N) / cos(N * this->m_proj_parm.two_r_n);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double N, M, xp, yp, z, Az, cz, sz, cAz;
+
+ N = this->m_proj_parm.hn * aasin(xy_y * this->m_proj_parm.rn);
+ M = this->m_proj_parm.hm * aasin(xy_x * this->m_proj_parm.rm * cos(N * this->m_proj_parm.two_r_n) / cos(N));
+ xp = 2. * sin(M);
+ yp = 2. * sin(N) * cos(M * this->m_proj_parm.two_r_m) / cos(M);
+ cAz = cos(Az = aatan2(xp, yp) - this->m_proj_parm.theta);
+ z = 2. * aasin(0.5 * hypot(xp, yp));
+ sz = sin(z);
+ cz = cos(z);
+ lp_lat = aasin(this->m_proj_parm.sp0 * cz + this->m_proj_parm.cp0 * sz * cAz);
+ lp_lon = aatan2(sz * sin(Az),
+ this->m_proj_parm.cp0 * cz - this->m_proj_parm.sp0 * sz * cAz);
+ }
+ };
+
+ // Oblated Equal Area
+ template <typename PAR>
+ void setup_oea(PAR& par, par_oea& proj_parm)
+ {
+ if (((proj_parm.n = pj_param(par.params, "dn").f) <= 0.) ||
+ ((proj_parm.m = pj_param(par.params, "dm").f) <= 0.))
+ throw proj_exception(-39);
+ else {
+ proj_parm.theta = pj_param(par.params, "rtheta").f;
+ proj_parm.sp0 = sin(par.phi0);
+ proj_parm.cp0 = cos(par.phi0);
+ proj_parm.rn = 1./ proj_parm.n;
+ proj_parm.rm = 1./ proj_parm.m;
+ proj_parm.two_r_n = 2. * proj_parm.rn;
+ proj_parm.two_r_m = 2. * proj_parm.rm;
+ proj_parm.hm = 0.5 * proj_parm.m;
+ proj_parm.hn = 0.5 * proj_parm.n;
+ // par.fwd = s_forward;
+ // par.inv = s_inverse;
+ par.es = 0.;
+ }
+ }
+
+ } // namespace oea
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Oblated Equal Area projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - n= m= theta=
+ \par Example
+ \image html ex_oea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct oea_spheroid : public impl::oea::base_oea_spheroid<LL, XY, PAR>
+ {
+ inline oea_spheroid(const PAR& par) : impl::oea::base_oea_spheroid<LL, XY, PAR>(par)
+ {
+ impl::oea::setup_oea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class oea_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<oea_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void oea_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("oea", new oea_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_OEA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/omerc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/omerc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,294 @@
+#ifndef _PROJECTIONS_OMERC_HPP
+#define _PROJECTIONS_OMERC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_tsfn.hpp>
+#include <geometry/projections/impl/pj_phi2.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace omerc
+ {
+ static const double TOL = 1.e-7;
+ static const double EPS = 1.e-10;
+
+ inline double TSFN0(double x)
+ {return tan(.5 * (HALFPI - (x))); }
+
+
+ struct par_omerc
+ {
+ double alpha, lamc, lam1, phi1, lam2, phi2, Gamma, al, bl, el,
+ singam, cosgam, sinrot, cosrot, u_0;
+ int ellips, rot;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_omerc_ellipsoid : public base_t_fi<base_omerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_omerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_omerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_omerc m_proj_parm;
+
+ inline base_omerc_ellipsoid(const PAR& par)
+ : base_t_fi<base_omerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double con, q, s, ul, us, vl, vs;
+
+ vl = sin(this->m_proj_parm.bl * lp_lon);
+ if (fabs(fabs(lp_lat) - HALFPI) <= EPS) {
+ ul = lp_lat < 0. ? -this->m_proj_parm.singam : this->m_proj_parm.singam;
+ us = this->m_proj_parm.al * lp_lat / this->m_proj_parm.bl;
+ } else {
+ q = this->m_proj_parm.el / (this->m_proj_parm.ellips ? pow(pj_tsfn(lp_lat, sin(lp_lat), this->m_par.e), this->m_proj_parm.bl)
+ : TSFN0(lp_lat));
+ s = .5 * (q - 1. / q);
+ ul = 2. * (s * this->m_proj_parm.singam - vl * this->m_proj_parm.cosgam) / (q + 1. / q);
+ con = cos(this->m_proj_parm.bl * lp_lon);
+ if (fabs(con) >= TOL) {
+ us = this->m_proj_parm.al * atan((s * this->m_proj_parm.cosgam + vl * this->m_proj_parm.singam) / con) / this->m_proj_parm.bl;
+ if (con < 0.)
+ us += PI * this->m_proj_parm.al / this->m_proj_parm.bl;
+ } else
+ us = this->m_proj_parm.al * this->m_proj_parm.bl * lp_lon;
+ }
+ if (fabs(fabs(ul) - 1.) <= EPS) throw proj_exception();;
+ vs = .5 * this->m_proj_parm.al * log((1. - ul) / (1. + ul)) / this->m_proj_parm.bl;
+ us -= this->m_proj_parm.u_0;
+ if (! this->m_proj_parm.rot) {
+ xy_x = us;
+ xy_y = vs;
+ } else {
+ xy_x = vs * this->m_proj_parm.cosrot + us * this->m_proj_parm.sinrot;
+ xy_y = us * this->m_proj_parm.cosrot - vs * this->m_proj_parm.sinrot;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double q, s, ul, us, vl, vs;
+
+ if (! this->m_proj_parm.rot) {
+ us = xy_x;
+ vs = xy_y;
+ } else {
+ vs = xy_x * this->m_proj_parm.cosrot - xy_y * this->m_proj_parm.sinrot;
+ us = xy_y * this->m_proj_parm.cosrot + xy_x * this->m_proj_parm.sinrot;
+ }
+ us += this->m_proj_parm.u_0;
+ q = exp(- this->m_proj_parm.bl * vs / this->m_proj_parm.al);
+ s = .5 * (q - 1. / q);
+ vl = sin(this->m_proj_parm.bl * us / this->m_proj_parm.al);
+ ul = 2. * (vl * this->m_proj_parm.cosgam + s * this->m_proj_parm.singam) / (q + 1. / q);
+ if (fabs(fabs(ul) - 1.) < EPS) {
+ lp_lon = 0.;
+ lp_lat = ul < 0. ? -HALFPI : HALFPI;
+ } else {
+ lp_lat = this->m_proj_parm.el / sqrt((1. + ul) / (1. - ul));
+ if (this->m_proj_parm.ellips) {
+ if ((lp_lat = pj_phi2(pow(lp_lat, 1. / this->m_proj_parm.bl), this->m_par.e)) == HUGE_VAL)
+ throw proj_exception();;
+ } else
+ lp_lat = HALFPI - 2. * atan(lp_lat);
+ lp_lon = - atan2((s * this->m_proj_parm.cosgam -
+ vl * this->m_proj_parm.singam), cos(this->m_proj_parm.bl * us / this->m_proj_parm.al)) / this->m_proj_parm.bl;
+ }
+ }
+ };
+
+ // Oblique Mercator
+ template <typename PAR>
+ void setup_omerc(PAR& par, par_omerc& proj_parm)
+ {
+ double con, com, cosph0, d, f, h, l, sinph0, p, j;
+ int azi;
+ proj_parm.rot = pj_param(par.params, "bno_rot").i == 0;
+ if( (azi = pj_param(par.params, "talpha").i) != 0.0) {
+ proj_parm.lamc = pj_param(par.params, "rlonc").f;
+ proj_parm.alpha = pj_param(par.params, "ralpha").f;
+ if ( fabs(proj_parm.alpha) <= TOL ||
+ fabs(fabs(par.phi0) - HALFPI) <= TOL ||
+ fabs(fabs(proj_parm.alpha) - HALFPI) <= TOL)
+ throw proj_exception(-32);
+ } else {
+ proj_parm.lam1 = pj_param(par.params, "rlon_1").f;
+ proj_parm.phi1 = pj_param(par.params, "rlat_1").f;
+ proj_parm.lam2 = pj_param(par.params, "rlon_2").f;
+ proj_parm.phi2 = pj_param(par.params, "rlat_2").f;
+ if (fabs(proj_parm.phi1 - proj_parm.phi2) <= TOL ||
+ (con = fabs(proj_parm.phi1)) <= TOL ||
+ fabs(con - HALFPI) <= TOL ||
+ fabs(fabs(par.phi0) - HALFPI) <= TOL ||
+ fabs(fabs(proj_parm.phi2) - HALFPI) <= TOL) throw proj_exception(-33);
+ }
+ com = (proj_parm.ellips = par.es > 0.) ? sqrt(par.one_es) : 1.;
+ if (fabs(par.phi0) > EPS) {
+ sinph0 = sin(par.phi0);
+ cosph0 = cos(par.phi0);
+ if (proj_parm.ellips) {
+ con = 1. - par.es * sinph0 * sinph0;
+ proj_parm.bl = cosph0 * cosph0;
+ proj_parm.bl = sqrt(1. + par.es * proj_parm.bl * proj_parm.bl / par.one_es);
+ proj_parm.al = proj_parm.bl * par.k0 * com / con;
+ d = proj_parm.bl * com / (cosph0 * sqrt(con));
+ } else {
+ proj_parm.bl = 1.;
+ proj_parm.al = par.k0;
+ d = 1. / cosph0;
+ }
+ if ((f = d * d - 1.) <= 0.)
+ f = 0.;
+ else {
+ f = sqrt(f);
+ if (par.phi0 < 0.)
+ f = -f;
+ }
+ proj_parm.el = f += d;
+ if (proj_parm.ellips) proj_parm.el *= pow(pj_tsfn(par.phi0, sinph0, par.e), proj_parm.bl);
+ else proj_parm.el *= TSFN0(par.phi0);
+ } else {
+ proj_parm.bl = 1. / com;
+ proj_parm.al = par.k0;
+ proj_parm.el = d = f = 1.;
+ }
+ if (azi) {
+ proj_parm.Gamma = asin(sin(proj_parm.alpha) / d);
+ par.lam0 = proj_parm.lamc - asin((.5 * (f - 1. / f)) *
+ tan(proj_parm.Gamma)) / proj_parm.bl;
+ } else {
+ if (proj_parm.ellips) {
+ h = pow(pj_tsfn(proj_parm.phi1, sin(proj_parm.phi1), par.e), proj_parm.bl);
+ l = pow(pj_tsfn(proj_parm.phi2, sin(proj_parm.phi2), par.e), proj_parm.bl);
+ } else {
+ h = TSFN0(proj_parm.phi1);
+ l = TSFN0(proj_parm.phi2);
+ }
+ f = proj_parm.el / h;
+ p = (l - h) / (l + h);
+ j = proj_parm.el * proj_parm.el;
+ j = (j - l * h) / (j + l * h);
+ if ((con = proj_parm.lam1 - proj_parm.lam2) < -PI)
+ proj_parm.lam2 -= TWOPI;
+ else if (con > PI)
+ proj_parm.lam2 += TWOPI;
+ par.lam0 = adjlon(.5 * (proj_parm.lam1 + proj_parm.lam2) - atan(
+ j * tan(.5 * proj_parm.bl * (proj_parm.lam1 - proj_parm.lam2)) / p) / proj_parm.bl);
+ proj_parm.Gamma = atan(2. * sin(proj_parm.bl * adjlon(proj_parm.lam1 - par.lam0)) /
+ (f - 1. / f));
+ proj_parm.alpha = asin(d * sin(proj_parm.Gamma));
+ }
+ proj_parm.singam = sin(proj_parm.Gamma);
+ proj_parm.cosgam = cos(proj_parm.Gamma);
+ f = pj_param(par.params, "brot_conv").i ? proj_parm.Gamma : proj_parm.alpha;
+ proj_parm.sinrot = sin(f);
+ proj_parm.cosrot = cos(f);
+ proj_parm.u_0 = pj_param(par.params, "bno_uoff").i ? 0. :
+ fabs(proj_parm.al * atan(sqrt(d * d - 1.) / proj_parm.cosrot) / proj_parm.bl);
+ if (par.phi0 < 0.)
+ proj_parm.u_0 = - proj_parm.u_0;
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+ } // namespace omerc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Oblique Mercator projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ - no_rot rot_conv no_uoff and
+ - alpha= lonc= or
+ - lon_1= lat_1= lon_2= lat_2=
+ \par Example
+ \image html ex_omerc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct omerc_ellipsoid : public impl::omerc::base_omerc_ellipsoid<LL, XY, PAR>
+ {
+ inline omerc_ellipsoid(const PAR& par) : impl::omerc::base_omerc_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::omerc::setup_omerc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class omerc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<omerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void omerc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("omerc", new omerc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_OMERC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/ortho.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/ortho.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,219 @@
+#ifndef _PROJECTIONS_ORTHO_HPP
+#define _PROJECTIONS_ORTHO_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace ortho
+ {
+ static const double EPS10 = 1.e-10;
+ static const int N_POLE = 0;
+ static const int S_POLE = 1;
+ static const int EQUIT = 2;
+ static const int OBLIQ = 3;
+
+ struct par_ortho
+ {
+ double sinph0;
+ double cosph0;
+ int mode;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_ortho_spheroid : public base_t_fi<base_ortho_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_ortho_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_ortho_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_ortho m_proj_parm;
+
+ inline base_ortho_spheroid(const PAR& par)
+ : base_t_fi<base_ortho_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, cosphi, sinphi;
+
+ cosphi = cos(lp_lat);
+ coslam = cos(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ if (cosphi * coslam < - EPS10) throw proj_exception();;
+ xy_y = sin(lp_lat);
+ break;
+ case OBLIQ:
+ if (this->m_proj_parm.sinph0 * (sinphi = sin(lp_lat)) +
+ this->m_proj_parm.cosph0 * cosphi * coslam < - EPS10) throw proj_exception();;
+ xy_y = this->m_proj_parm.cosph0 * sinphi - this->m_proj_parm.sinph0 * cosphi * coslam;
+ break;
+ case N_POLE:
+ coslam = - coslam;
+ case S_POLE:
+ if (fabs(lp_lat - this->m_par.phi0) - EPS10 > HALFPI) throw proj_exception();;
+ xy_y = cosphi * coslam;
+ break;
+ }
+ xy_x = cosphi * sin(lp_lon);
+ return;
+ }
+
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double rh, cosc, sinc;
+
+ if ((sinc = (rh = hypot(xy_x, xy_y))) > 1.) {
+ if ((sinc - 1.) > EPS10) throw proj_exception();;
+ sinc = 1.;
+ }
+ cosc = sqrt(1. - sinc * sinc); /* in this range OK */
+ if (fabs(rh) <= EPS10) {
+ lp_lat = this->m_par.phi0;
+ lp_lon = 0.0;
+ } else {
+ switch (this->m_proj_parm.mode) {
+ case N_POLE:
+ xy_y = -xy_y;
+ lp_lat = acos(sinc);
+ break;
+ case S_POLE:
+ lp_lat = - acos(sinc);
+ break;
+ case EQUIT:
+ lp_lat = xy_y * sinc / rh;
+ xy_x *= sinc;
+ xy_y = cosc * rh;
+ goto sinchk;
+ case OBLIQ:
+ lp_lat = cosc * this->m_proj_parm.sinph0 + xy_y * sinc * this->m_proj_parm.cosph0 /rh;
+ xy_y = (cosc - this->m_proj_parm.sinph0 * lp_lat) * rh;
+ xy_x *= sinc * this->m_proj_parm.cosph0;
+ sinchk:
+ if (fabs(lp_lat) >= 1.)
+ lp_lat = lp_lat < 0. ? -HALFPI : HALFPI;
+ else
+ lp_lat = asin(lp_lat);
+ break;
+ }
+ lp_lon = (xy_y == 0. && (this->m_proj_parm.mode == OBLIQ || this->m_proj_parm.mode == EQUIT))
+ ? (xy_x == 0. ? 0. : xy_x < 0. ? -HALFPI : HALFPI)
+ : atan2(xy_x, xy_y);
+ }
+ return;
+ }
+
+ };
+
+ // Orthographic
+ template <typename PAR>
+ void setup_ortho(PAR& par, par_ortho& proj_parm)
+ {
+ if (fabs(fabs(par.phi0) - HALFPI) <= EPS10)
+ proj_parm.mode = par.phi0 < 0. ? S_POLE : N_POLE;
+ else if (fabs(par.phi0) > EPS10) {
+ proj_parm.mode = OBLIQ;
+ proj_parm.sinph0 = sin(par.phi0);
+ proj_parm.cosph0 = cos(par.phi0);
+ } else
+ proj_parm.mode = EQUIT;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace ortho
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Orthographic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ \par Example
+ \image html ex_ortho.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct ortho_spheroid : public impl::ortho::base_ortho_spheroid<LL, XY, PAR>
+ {
+ inline ortho_spheroid(const PAR& par) : impl::ortho::base_ortho_spheroid<LL, XY, PAR>(par)
+ {
+ impl::ortho::setup_ortho(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class ortho_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<ortho_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void ortho_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("ortho", new ortho_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ORTHO_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/poly.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/poly.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,264 @@
+#ifndef _PROJECTIONS_POLY_HPP
+#define _PROJECTIONS_POLY_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_msfn.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace poly
+ {
+ static const double TOL = 1e-10;
+ static const double CONV = 1e-10;
+ static const int N_ITER = 10;
+ static const int I_ITER = 20;
+ static const double ITOL = 1.e-12;
+
+ struct par_poly
+ {
+ double ml0;
+ double en[EN_SIZE];
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_poly_ellipsoid : public base_t_fi<base_poly_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_poly_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_poly_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_poly m_proj_parm;
+
+ inline base_poly_ellipsoid(const PAR& par)
+ : base_t_fi<base_poly_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double ms, sp, cp;
+
+ if (fabs(lp_lat) <= TOL) { xy_x = lp_lon; xy_y = -this->m_proj_parm.ml0; }
+ else {
+ sp = sin(lp_lat);
+ ms = fabs(cp = cos(lp_lat)) > TOL ? pj_msfn(sp, cp, this->m_par.es) / sp : 0.;
+ xy_x = ms * sin(lp_lon *= sp);
+ xy_y = (pj_mlfn(lp_lat, sp, cp, this->m_proj_parm.en) - this->m_proj_parm.ml0) + ms * (1. - cos(lp_lon));
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ xy_y += this->m_proj_parm.ml0;
+ if (fabs(xy_y) <= TOL) { lp_lon = xy_x; lp_lat = 0.; }
+ else {
+ double r, c, sp, cp, s2ph, ml, mlb, mlp, dPhi;
+ int i;
+
+ r = xy_y * xy_y + xy_x * xy_x;
+ for (lp_lat = xy_y, i = I_ITER; i ; --i) {
+ sp = sin(lp_lat);
+ s2ph = sp * ( cp = cos(lp_lat));
+ if (fabs(cp) < ITOL)
+ throw proj_exception();;
+ c = sp * (mlp = sqrt(1. - this->m_par.es * sp * sp)) / cp;
+ ml = pj_mlfn(lp_lat, sp, cp, this->m_proj_parm.en);
+ mlb = ml * ml + r;
+ mlp = this->m_par.one_es / (mlp * mlp * mlp);
+ lp_lat += ( dPhi =
+ ( ml + ml + c * mlb - 2. * xy_y * (c * ml + 1.) ) / (
+ this->m_par.es * s2ph * (mlb - 2. * xy_y * ml) / c +
+ 2.* (xy_y - ml) * (c * mlp - 1. / s2ph) - mlp - mlp ));
+ if (fabs(dPhi) <= ITOL)
+ break;
+ }
+ if (!i)
+ throw proj_exception();;
+ c = sin(lp_lat);
+ lp_lon = asin(xy_x * tan(lp_lat) * sqrt(1. - this->m_par.es * c * c)) / sin(lp_lat);
+ }
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_poly_spheroid : public base_t_fi<base_poly_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_poly_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_poly_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_poly m_proj_parm;
+
+ inline base_poly_spheroid(const PAR& par)
+ : base_t_fi<base_poly_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double cot, E;
+
+ if (fabs(lp_lat) <= TOL) { xy_x = lp_lon; xy_y = this->m_proj_parm.ml0; }
+ else {
+ cot = 1. / tan(lp_lat);
+ xy_x = sin(E = lp_lon * sin(lp_lat)) * cot;
+ xy_y = lp_lat - this->m_par.phi0 + cot * (1. - cos(E));
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double B, dphi, tp;
+ int i;
+
+ if (fabs(xy_y = this->m_par.phi0 + xy_y) <= TOL) { lp_lon = xy_x; lp_lat = 0.; }
+ else {
+ lp_lat = xy_y;
+ B = xy_x * xy_x + xy_y * xy_y;
+ i = N_ITER;
+ do {
+ tp = tan(lp_lat);
+ lp_lat -= (dphi = (xy_y * (lp_lat * tp + 1.) - lp_lat -
+ .5 * ( lp_lat * lp_lat + B) * tp) /
+ ((lp_lat - xy_y) / tp - 1.));
+ } while (fabs(dphi) > CONV && --i);
+ if (! i) throw proj_exception();;
+ lp_lon = asin(xy_x * tan(lp_lat)) / sin(lp_lat);
+ }
+ }
+ };
+
+ // Polyconic (American)
+ template <typename PAR>
+ void setup_poly(PAR& par, par_poly& proj_parm)
+ {
+ if (par.es) {
+ pj_enfn(par.es, proj_parm.en);
+ proj_parm.ml0 = pj_mlfn(par.phi0, sin(par.phi0), cos(par.phi0), proj_parm.en);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ proj_parm.ml0 = -par.phi0;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+ } // namespace poly
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Polyconic (American) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_poly.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct poly_ellipsoid : public impl::poly::base_poly_ellipsoid<LL, XY, PAR>
+ {
+ inline poly_ellipsoid(const PAR& par) : impl::poly::base_poly_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::poly::setup_poly(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Polyconic (American) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_poly.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct poly_spheroid : public impl::poly::base_poly_spheroid<LL, XY, PAR>
+ {
+ inline poly_spheroid(const PAR& par) : impl::poly::base_poly_spheroid<LL, XY, PAR>(par)
+ {
+ impl::poly::setup_poly(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class poly_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<poly_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<poly_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void poly_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("poly", new poly_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_POLY_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/putp2.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/putp2.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,163 @@
+#ifndef _PROJECTIONS_PUTP2_HPP
+#define _PROJECTIONS_PUTP2_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace putp2
+ {
+ static const double C_x = 1.89490;
+ static const double C_y = 1.71848;
+ static const double C_p = 0.6141848493043784;
+ static const double EPS = 1e-10;
+ static const int NITER = 10;
+ static const double PI_DIV_3 = 1.0471975511965977;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_putp2_spheroid : public base_t_fi<base_putp2_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_putp2_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_putp2_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_putp2_spheroid(const PAR& par)
+ : base_t_fi<base_putp2_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double p, c, s, V;
+ int i;
+
+ p = C_p * sin(lp_lat);
+ s = lp_lat * lp_lat;
+ lp_lat *= 0.615709 + s * ( 0.00909953 + s * 0.0046292 );
+ for (i = NITER; i ; --i) {
+ c = cos(lp_lat);
+ s = sin(lp_lat);
+ lp_lat -= V = (lp_lat + s * (c - 1.) - p) /
+ (1. + c * (c - 1.) - s * s);
+ if (fabs(V) < EPS)
+ break;
+ }
+ if (!i)
+ lp_lat = lp_lat < 0 ? - PI_DIV_3 : PI_DIV_3;
+ xy_x = C_x * lp_lon * (cos(lp_lat) - 0.5);
+ xy_y = C_y * sin(lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double c;
+
+ lp_lat = aasin(xy_y / C_y);
+ lp_lon = xy_x / (C_x * ((c = cos(lp_lat)) - 0.5));
+ lp_lat = aasin((lp_lat + sin(lp_lat) * (c - 1.)) / C_p);
+ }
+ };
+
+ // Putnins P2
+ template <typename PAR>
+ void setup_putp2(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace putp2
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Putnins P2 projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp2.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp2_spheroid : public impl::putp2::base_putp2_spheroid<LL, XY, PAR>
+ {
+ inline putp2_spheroid(const PAR& par) : impl::putp2::base_putp2_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp2::setup_putp2(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class putp2_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp2_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void putp2_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("putp2", new putp2_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_PUTP2_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/putp3.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/putp3.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,194 @@
+#ifndef _PROJECTIONS_PUTP3_HPP
+#define _PROJECTIONS_PUTP3_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace putp3
+ {
+ static const double C = 0.79788456;
+ static const double RPISQ = 0.1013211836;
+
+ struct par_putp3
+ {
+ double A;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_putp3_spheroid : public base_t_fi<base_putp3_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_putp3_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_putp3_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_putp3 m_proj_parm;
+
+ inline base_putp3_spheroid(const PAR& par)
+ : base_t_fi<base_putp3_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = C * lp_lon * (1. - this->m_proj_parm.A * lp_lat * lp_lat);
+ xy_y = C * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y / C;
+ lp_lon = xy_x / (C * (1. - this->m_proj_parm.A * lp_lat * lp_lat));
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_putp3& proj_parm)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // Putnins P3
+ template <typename PAR>
+ void setup_putp3(PAR& par, par_putp3& proj_parm)
+ {
+ proj_parm.A = 4. * RPISQ;
+ setup(par, proj_parm);
+ }
+
+ // Putnins P3'
+ template <typename PAR>
+ void setup_putp3p(PAR& par, par_putp3& proj_parm)
+ {
+ proj_parm.A = 2. * RPISQ;
+ setup(par, proj_parm);
+ }
+
+ } // namespace putp3
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Putnins P3 projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp3.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp3_spheroid : public impl::putp3::base_putp3_spheroid<LL, XY, PAR>
+ {
+ inline putp3_spheroid(const PAR& par) : impl::putp3::base_putp3_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp3::setup_putp3(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Putnins P3' projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - no inverse
+ - Spheroid
+ \par Example
+ \image html ex_putp3p.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp3p_spheroid : public impl::putp3::base_putp3_spheroid<LL, XY, PAR>
+ {
+ inline putp3p_spheroid(const PAR& par) : impl::putp3::base_putp3_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp3::setup_putp3p(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class putp3_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp3_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class putp3p_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp3p_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void putp3_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("putp3", new putp3_entry<LL, XY, PAR>);
+ factory.add_to_factory("putp3p", new putp3p_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_PUTP3_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/putp4p.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/putp4p.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,198 @@
+#ifndef _PROJECTIONS_PUTP4P_HPP
+#define _PROJECTIONS_PUTP4P_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace putp4p
+ {
+
+ struct par_putp4p
+ {
+ double C_x, C_y;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_putp4p_spheroid : public base_t_fi<base_putp4p_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_putp4p_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_putp4p_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_putp4p m_proj_parm;
+
+ inline base_putp4p_spheroid(const PAR& par)
+ : base_t_fi<base_putp4p_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ lp_lat = aasin(0.883883476 * sin(lp_lat));
+ xy_x = this->m_proj_parm.C_x * lp_lon * cos(lp_lat);
+ xy_x /= cos(lp_lat *= 0.333333333333333);
+ xy_y = this->m_proj_parm.C_y * sin(lp_lat);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = aasin(xy_y / this->m_proj_parm.C_y);
+ lp_lon = xy_x * cos(lp_lat) / this->m_proj_parm.C_x;
+ lp_lat *= 3.;
+ lp_lon /= cos(lp_lat);
+ lp_lat = aasin(1.13137085 * sin(lp_lat));
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_putp4p& proj_parm)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // Putnins P4'
+ template <typename PAR>
+ void setup_putp4p(PAR& par, par_putp4p& proj_parm)
+ {
+ proj_parm.C_x = 0.874038744;
+ proj_parm.C_y = 3.883251825;
+ setup(par, proj_parm);
+ }
+
+ // Werenskiold I
+ template <typename PAR>
+ void setup_weren(PAR& par, par_putp4p& proj_parm)
+ {
+ proj_parm.C_x = 1.;
+ proj_parm.C_y = 4.442882938;
+ setup(par, proj_parm);
+ }
+
+ } // namespace putp4p
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Putnins P4' projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp4p.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp4p_spheroid : public impl::putp4p::base_putp4p_spheroid<LL, XY, PAR>
+ {
+ inline putp4p_spheroid(const PAR& par) : impl::putp4p::base_putp4p_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp4p::setup_putp4p(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Werenskiold I projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_weren.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct weren_spheroid : public impl::putp4p::base_putp4p_spheroid<LL, XY, PAR>
+ {
+ inline weren_spheroid(const PAR& par) : impl::putp4p::base_putp4p_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp4p::setup_weren(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class putp4p_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp4p_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class weren_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<weren_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void putp4p_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("putp4p", new putp4p_entry<LL, XY, PAR>);
+ factory.add_to_factory("weren", new weren_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_PUTP4P_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/putp5.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/putp5.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,195 @@
+#ifndef _PROJECTIONS_PUTP5_HPP
+#define _PROJECTIONS_PUTP5_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace putp5
+ {
+ static const double C = 1.01346;
+ static const double D = 1.2158542;
+
+ struct par_putp5
+ {
+ double A, B;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_putp5_spheroid : public base_t_fi<base_putp5_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_putp5_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_putp5_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_putp5 m_proj_parm;
+
+ inline base_putp5_spheroid(const PAR& par)
+ : base_t_fi<base_putp5_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = C * lp_lon * (this->m_proj_parm.A - this->m_proj_parm.B * sqrt(1. + D * lp_lat * lp_lat));
+ xy_y = C * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y / C;
+ lp_lon = xy_x / (C * (this->m_proj_parm.A - this->m_proj_parm.B * sqrt(1. + D * lp_lat * lp_lat)));
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_putp5& proj_parm)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // Putnins P5
+ template <typename PAR>
+ void setup_putp5(PAR& par, par_putp5& proj_parm)
+ {
+ proj_parm.A = 2.;
+ proj_parm.B = 1.;
+ setup(par, proj_parm);
+ }
+
+ // Putnins P5'
+ template <typename PAR>
+ void setup_putp5p(PAR& par, par_putp5& proj_parm)
+ {
+ proj_parm.A = 1.5;
+ proj_parm.B = 0.5;
+ setup(par, proj_parm);
+ }
+
+ } // namespace putp5
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Putnins P5 projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp5.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp5_spheroid : public impl::putp5::base_putp5_spheroid<LL, XY, PAR>
+ {
+ inline putp5_spheroid(const PAR& par) : impl::putp5::base_putp5_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp5::setup_putp5(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Putnins P5' projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp5p.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp5p_spheroid : public impl::putp5::base_putp5_spheroid<LL, XY, PAR>
+ {
+ inline putp5p_spheroid(const PAR& par) : impl::putp5::base_putp5_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp5::setup_putp5p(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class putp5_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp5_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class putp5p_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp5p_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void putp5_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("putp5", new putp5_entry<LL, XY, PAR>);
+ factory.add_to_factory("putp5p", new putp5p_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_PUTP5_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/putp6.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/putp6.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,220 @@
+#ifndef _PROJECTIONS_PUTP6_HPP
+#define _PROJECTIONS_PUTP6_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace putp6
+ {
+ static const double EPS = 1e-10;
+ static const int NITER = 10;
+ static const double CON_POLE = 1.732050807568877;
+
+ struct par_putp6
+ {
+ double C_x, C_y, A, B, D;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_putp6_spheroid : public base_t_fi<base_putp6_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_putp6_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_putp6_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_putp6 m_proj_parm;
+
+ inline base_putp6_spheroid(const PAR& par)
+ : base_t_fi<base_putp6_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double p, r, V;
+ int i;
+
+ p = this->m_proj_parm.B * sin(lp_lat);
+ lp_lat *= 1.10265779;
+ for (i = NITER; i ; --i) {
+ r = sqrt(1. + lp_lat * lp_lat);
+ lp_lat -= V = ( (this->m_proj_parm.A - r) * lp_lat - log(lp_lat + r) - p ) /
+ (this->m_proj_parm.A - 2. * r);
+ if (fabs(V) < EPS)
+ break;
+ }
+ if (!i)
+ lp_lat = p < 0. ? -CON_POLE : CON_POLE;
+ xy_x = this->m_proj_parm.C_x * lp_lon * (this->m_proj_parm.D - sqrt(1. + lp_lat * lp_lat));
+ xy_y = this->m_proj_parm.C_y * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double r;
+
+ lp_lat = xy_y / this->m_proj_parm.C_y;
+ r = sqrt(1. + lp_lat * lp_lat);
+ lp_lon = xy_x / (this->m_proj_parm.C_x * (this->m_proj_parm.D - r));
+ lp_lat = aasin( ( (this->m_proj_parm.A - r) * lp_lat - log(lp_lat + r) ) / this->m_proj_parm.B);
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_putp6& proj_parm)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // Putnins P6
+ template <typename PAR>
+ void setup_putp6(PAR& par, par_putp6& proj_parm)
+ {
+ proj_parm.C_x = 1.01346;
+ proj_parm.C_y = 0.91910;
+ proj_parm.A = 4.;
+ proj_parm.B = 2.1471437182129378784;
+ proj_parm.D = 2.;
+ setup(par, proj_parm);
+ }
+
+ // Putnins P6'
+ template <typename PAR>
+ void setup_putp6p(PAR& par, par_putp6& proj_parm)
+ {
+ proj_parm.C_x = 0.44329;
+ proj_parm.C_y = 0.80404;
+ proj_parm.A = 6.;
+ proj_parm.B = 5.61125;
+ proj_parm.D = 3.;
+ setup(par, proj_parm);
+ }
+
+ } // namespace putp6
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Putnins P6 projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp6.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp6_spheroid : public impl::putp6::base_putp6_spheroid<LL, XY, PAR>
+ {
+ inline putp6_spheroid(const PAR& par) : impl::putp6::base_putp6_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp6::setup_putp6(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Putnins P6' projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_putp6p.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct putp6p_spheroid : public impl::putp6::base_putp6_spheroid<LL, XY, PAR>
+ {
+ inline putp6p_spheroid(const PAR& par) : impl::putp6::base_putp6_spheroid<LL, XY, PAR>(par)
+ {
+ impl::putp6::setup_putp6p(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class putp6_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp6_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class putp6p_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<putp6p_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void putp6_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("putp6", new putp6_entry<LL, XY, PAR>);
+ factory.add_to_factory("putp6p", new putp6p_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_PUTP6_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/robin.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/robin.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,232 @@
+#ifndef _PROJECTIONS_ROBIN_HPP
+#define _PROJECTIONS_ROBIN_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/function_overloads.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace robin
+ {
+ static const double FXC = 0.8487;
+ static const double FYC = 1.3523;
+ static const double C1 = 11.45915590261646417544;
+ static const double RC1 = 0.08726646259971647884;
+ static const int NODES = 18;
+ static const double ONEEPS = 1.000001;
+ static const double EPS = 1e-8;
+
+ /* note: following terms based upon 5 deg. intervals in degrees. */
+ static struct COEFS {
+ float c0, c1, c2, c3;
+ } X[] = {
+ 1, -5.67239e-12, -7.15511e-05, 3.11028e-06,
+ 0.9986, -0.000482241, -2.4897e-05, -1.33094e-06,
+ 0.9954, -0.000831031, -4.4861e-05, -9.86588e-07,
+ 0.99, -0.00135363, -5.96598e-05, 3.67749e-06,
+ 0.9822, -0.00167442, -4.4975e-06, -5.72394e-06,
+ 0.973, -0.00214869, -9.03565e-05, 1.88767e-08,
+ 0.96, -0.00305084, -9.00732e-05, 1.64869e-06,
+ 0.9427, -0.00382792, -6.53428e-05, -2.61493e-06,
+ 0.9216, -0.00467747, -0.000104566, 4.8122e-06,
+ 0.8962, -0.00536222, -3.23834e-05, -5.43445e-06,
+ 0.8679, -0.00609364, -0.0001139, 3.32521e-06,
+ 0.835, -0.00698325, -6.40219e-05, 9.34582e-07,
+ 0.7986, -0.00755337, -5.00038e-05, 9.35532e-07,
+ 0.7597, -0.00798325, -3.59716e-05, -2.27604e-06,
+ 0.7186, -0.00851366, -7.0112e-05, -8.63072e-06,
+ 0.6732, -0.00986209, -0.000199572, 1.91978e-05,
+ 0.6213, -0.010418, 8.83948e-05, 6.24031e-06,
+ 0.5722, -0.00906601, 0.000181999, 6.24033e-06,
+ 0.5322, 0.,0.,0. },
+ Y[] = {
+ 0, 0.0124, 3.72529e-10, 1.15484e-09,
+ 0.062, 0.0124001, 1.76951e-08, -5.92321e-09,
+ 0.124, 0.0123998, -7.09668e-08, 2.25753e-08,
+ 0.186, 0.0124008, 2.66917e-07, -8.44523e-08,
+ 0.248, 0.0123971, -9.99682e-07, 3.15569e-07,
+ 0.31, 0.0124108, 3.73349e-06, -1.1779e-06,
+ 0.372, 0.0123598, -1.3935e-05, 4.39588e-06,
+ 0.434, 0.0125501, 5.20034e-05, -1.00051e-05,
+ 0.4968, 0.0123198, -9.80735e-05, 9.22397e-06,
+ 0.5571, 0.0120308, 4.02857e-05, -5.2901e-06,
+ 0.6176, 0.0120369, -3.90662e-05, 7.36117e-07,
+ 0.6769, 0.0117015, -2.80246e-05, -8.54283e-07,
+ 0.7346, 0.0113572, -4.08389e-05, -5.18524e-07,
+ 0.7903, 0.0109099, -4.86169e-05, -1.0718e-06,
+ 0.8435, 0.0103433, -6.46934e-05, 5.36384e-09,
+ 0.8936, 0.00969679, -6.46129e-05, -8.54894e-06,
+ 0.9394, 0.00840949, -0.000192847, -4.21023e-06,
+ 0.9761, 0.00616525, -0.000256001, -4.21021e-06,
+ 1., 0.,0.,0 };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_robin_spheroid : public base_t_fi<base_robin_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_robin_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_robin_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_robin_spheroid(const PAR& par)
+ : base_t_fi<base_robin_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline double V(const COEFS& C, double z) const
+ { return (C.c0 + z * (C.c1 + z * (C.c2 + z * C.c3))); }
+ inline double DV(const COEFS& C, double z) const
+ { return (C.c1 + z * (C.c2 + C.c2 + z * 3. * C.c3)); }
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ int i;
+ double dphi;
+
+ i = int_floor((dphi = fabs(lp_lat)) * C1);
+ if (i >= NODES) i = NODES - 1;
+ dphi = RAD_TO_DEG * (dphi - RC1 * i);
+ xy_x = V(X[i], dphi) * FXC * lp_lon;
+ xy_y = V(Y[i], dphi) * FYC;
+ if (lp_lat < 0.) xy_y = -xy_y;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ int i;
+ double t, t1;
+ struct COEFS T;
+
+ lp_lon = xy_x / FXC;
+ lp_lat = fabs(xy_y / FYC);
+ if (lp_lat >= 1.) { /* simple pathologic cases */
+ if (lp_lat > ONEEPS) throw proj_exception();
+ else {
+ lp_lat = xy_y < 0. ? -HALFPI : HALFPI;
+ lp_lon /= X[NODES].c0;
+ }
+ } else { /* general problem */
+ /* in Y space, reduce to table interval */
+ for (i = int_floor(lp_lat * NODES);;) {
+ if (Y[i].c0 > lp_lat) --i;
+ else if (Y[i+1].c0 <= lp_lat) ++i;
+ else break;
+ }
+ T = Y[i];
+ /* first guess, linear interp */
+ t = 5. * (lp_lat - T.c0)/(Y[i+1].c0 - T.c0);
+ /* make into root */
+ T.c0 -= lp_lat;
+ for (;;) { /* Newton-Raphson reduction */
+ t -= t1 = V(T,t) / DV(T,t);
+ if (fabs(t1) < EPS)
+ break;
+ }
+ lp_lat = (5 * i + t) * DEG_TO_RAD;
+ if (xy_y < 0.) lp_lat = -lp_lat;
+ lp_lon /= V(X[i], t);
+ }
+ }
+ };
+
+ // Robinson
+ template <typename PAR>
+ void setup_robin(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace robin
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Robinson projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_robin.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct robin_spheroid : public impl::robin::base_robin_spheroid<LL, XY, PAR>
+ {
+ inline robin_spheroid(const PAR& par) : impl::robin::base_robin_spheroid<LL, XY, PAR>(par)
+ {
+ impl::robin::setup_robin(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class robin_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<robin_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void robin_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("robin", new robin_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ROBIN_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/rouss.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/rouss.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,211 @@
+#ifndef _PROJECTIONS_ROUSS_HPP
+#define _PROJECTIONS_ROUSS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/proj_mdist.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace rouss
+ {
+
+ struct par_rouss
+ {
+ double s0;
+ double A1, A2, A3, A4, A5, A6;
+ double B1, B2, B3, B4, B5, B6, B7, B8;
+ double C1, C2, C3, C4, C5, C6, C7, C8;
+ double D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11;
+ MDIST en;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_rouss_ellipsoid : public base_t_fi<base_rouss_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_rouss_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_rouss_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_rouss m_proj_parm;
+
+ inline base_rouss_ellipsoid(const PAR& par)
+ : base_t_fi<base_rouss_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double s, al, cp, sp, al2, s2;
+
+ cp = cos(lp_lat);
+ sp = sin(lp_lat);
+ s = proj_mdist(lp_lat, sp, cp, this->m_proj_parm.en) - this->m_proj_parm.s0;
+ s2 = s * s;
+ al = lp_lon * cp / sqrt(1. - this->m_par.es * sp * sp);
+ al2 = al * al;
+ xy_x = this->m_par.k0 * al*(1.+s2*(this->m_proj_parm.A1+s2*this->m_proj_parm.A4)-al2*(this->m_proj_parm.A2+s*this->m_proj_parm.A3+s2*this->m_proj_parm.A5
+ +al2*this->m_proj_parm.A6));
+ xy_y = this->m_par.k0 * (al2*(this->m_proj_parm.B1+al2*this->m_proj_parm.B4)+
+ s*(1.+al2*(this->m_proj_parm.B3-al2*this->m_proj_parm.B6)+s2*(this->m_proj_parm.B2+s2*this->m_proj_parm.B8)+
+ s*al2*(this->m_proj_parm.B5+s*this->m_proj_parm.B7)));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double s, al, x = xy_x / this->m_par.k0, y = xy_y / this->m_par.k0, x2, y2;;
+
+ x2 = x * x;
+ y2 = y * y;
+ al = x*(1.-this->m_proj_parm.C1*y2+x2*(this->m_proj_parm.C2+this->m_proj_parm.C3*y-this->m_proj_parm.C4*x2+this->m_proj_parm.C5*y2-this->m_proj_parm.C7*x2*y)
+ +y2*(this->m_proj_parm.C6*y2-this->m_proj_parm.C8*x2*y));
+ s = this->m_proj_parm.s0 + y*(1.+y2*(-this->m_proj_parm.D2+this->m_proj_parm.D8*y2))+
+ x2*(-this->m_proj_parm.D1+y*(-this->m_proj_parm.D3+y*(-this->m_proj_parm.D5+y*(-this->m_proj_parm.D7+y*this->m_proj_parm.D11)))+
+ x2*(this->m_proj_parm.D4+y*(this->m_proj_parm.D6+y*this->m_proj_parm.D10)-x2*this->m_proj_parm.D9));
+ lp_lat=proj_inv_mdist(s, this->m_proj_parm.en);
+ s = sin(lp_lat);
+ lp_lon=al * sqrt(1. - this->m_par.es * s * s)/cos(lp_lat);
+ }
+ };
+
+ // Roussilhe Stereographic
+ template <typename PAR>
+ void setup_rouss(PAR& par, par_rouss& proj_parm)
+ {
+ double N0, es2, t, t2, R_R0_2, R_R0_4;
+ proj_mdist_ini(par.es, proj_parm.en);
+
+ es2 = sin(par.phi0);
+ proj_parm.s0 = proj_mdist(par.phi0, es2, cos(par.phi0), proj_parm.en);
+ t = 1. - (es2 = par.es * es2 * es2);
+ N0 = 1./sqrt(t);
+ R_R0_2 = t * t / par.one_es;
+ R_R0_4 = R_R0_2 * R_R0_2;
+ t = tan(par.phi0);
+ t2 = t * t;
+ proj_parm.C1 = proj_parm.A1 = R_R0_2 / 4.;
+ proj_parm.C2 = proj_parm.A2 = R_R0_2 * (2 * t2 - 1. - 2. * es2) / 12.;
+ proj_parm.A3 = R_R0_2 * t * (1. + 4. * t2)/ ( 12. * N0);
+ proj_parm.A4 = R_R0_4 / 24.;
+ proj_parm.A5 = R_R0_4 * ( -1. + t2 * (11. + 12. * t2))/24.;
+ proj_parm.A6 = R_R0_4 * ( -2. + t2 * (11. - 2. * t2))/240.;
+ proj_parm.B1 = t / (2. * N0);
+ proj_parm.B2 = R_R0_2 / 12.;
+ proj_parm.B3 = R_R0_2 * (1. + 2. * t2 - 2. * es2)/4.;
+ proj_parm.B4 = R_R0_2 * t * (2. - t2)/(24. * N0);
+ proj_parm.B5 = R_R0_2 * t * (5. + 4.* t2)/(8. * N0);
+ proj_parm.B6 = R_R0_4 * (-2. + t2 * (-5. + 6. * t2))/48.;
+ proj_parm.B7 = R_R0_4 * (5. + t2 * (19. + 12. * t2))/24.;
+ proj_parm.B8 = R_R0_4 / 120.;
+ proj_parm.C3 = R_R0_2 * t * (1. + t2)/(3. * N0);
+ proj_parm.C4 = R_R0_4 * (-3. + t2 * (34. + 22. * t2))/240.;
+ proj_parm.C5 = R_R0_4 * (4. + t2 * (13. + 12. * t2))/24.;
+ proj_parm.C6 = R_R0_4 / 16.;
+ proj_parm.C7 = R_R0_4 * t * (11. + t2 * (33. + t2 * 16.))/(48. * N0);
+ proj_parm.C8 = R_R0_4 * t * (1. + t2 * 4.)/(36. * N0);
+ proj_parm.D1 = t / (2. * N0);
+ proj_parm.D2 = R_R0_2 / 12.;
+ proj_parm.D3 = R_R0_2 * (2 * t2 + 1. - 2. * es2) / 4.;
+ proj_parm.D4 = R_R0_2 * t * (1. + t2)/(8. * N0);
+ proj_parm.D5 = R_R0_2 * t * (1. + t2 * 2.)/(4. * N0);
+ proj_parm.D6 = R_R0_4 * (1. + t2 * (6. + t2 * 6.))/16.;
+ proj_parm.D7 = R_R0_4 * t2 * (3. + t2 * 4.)/8.;
+ proj_parm.D8 = R_R0_4 / 80.;
+ proj_parm.D9 = R_R0_4 * t * (-21. + t2 * (178. - t2 * 26.))/720.;
+ proj_parm.D10 = R_R0_4 * t * (29. + t2 * (86. + t2 * 48.))/(96. * N0);
+ proj_parm.D11 = R_R0_4 * t * (37. + t2 * 44.)/(96. * N0);
+ // par.fwd = e_forward;
+ // par.inv = e_inverse;
+ }
+
+ } // namespace rouss
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Roussilhe Stereographic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Ellps
+ \par Example
+ \image html ex_rouss.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct rouss_ellipsoid : public impl::rouss::base_rouss_ellipsoid<LL, XY, PAR>
+ {
+ inline rouss_ellipsoid(const PAR& par) : impl::rouss::base_rouss_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::rouss::setup_rouss(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class rouss_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<rouss_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void rouss_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("rouss", new rouss_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_ROUSS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/rpoly.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/rpoly.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,158 @@
+#ifndef _PROJECTIONS_RPOLY_HPP
+#define _PROJECTIONS_RPOLY_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace rpoly
+ {
+ static const double EPS = 1e-9;
+
+ struct par_rpoly
+ {
+ double phi1;
+ double fxa;
+ double fxb;
+ int mode;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_rpoly_spheroid : public base_t_f<base_rpoly_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_rpoly_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_rpoly_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_rpoly m_proj_parm;
+
+ inline base_rpoly_spheroid(const PAR& par)
+ : base_t_f<base_rpoly_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double fa;
+
+ if (this->m_proj_parm.mode)
+ fa = tan(lp_lon * this->m_proj_parm.fxb) * this->m_proj_parm.fxa;
+ else
+ fa = 0.5 * lp_lon;
+ if (fabs(lp_lat) < EPS) {
+ xy_x = fa + fa;
+ xy_y = - this->m_par.phi0;
+ } else {
+ xy_y = 1. / tan(lp_lat);
+ xy_x = sin(fa = 2. * atan(fa * sin(lp_lat))) * xy_y;
+ xy_y = lp_lat - this->m_par.phi0 + (1. - cos(fa)) * xy_y;
+ }
+ }
+ };
+
+ // Rectangular Polyconic
+ template <typename PAR>
+ void setup_rpoly(PAR& par, par_rpoly& proj_parm)
+ {
+ if ((proj_parm.mode = (proj_parm.phi1 = fabs(pj_param(par.params, "rlat_ts").f)) > EPS)) {
+ proj_parm.fxb = 0.5 * sin(proj_parm.phi1);
+ proj_parm.fxa = 0.5 / proj_parm.fxb;
+ }
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace rpoly
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Rectangular Polyconic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - no inverse
+ - lat_ts=
+ \par Example
+ \image html ex_rpoly.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct rpoly_spheroid : public impl::rpoly::base_rpoly_spheroid<LL, XY, PAR>
+ {
+ inline rpoly_spheroid(const PAR& par) : impl::rpoly::base_rpoly_spheroid<LL, XY, PAR>(par)
+ {
+ impl::rpoly::setup_rpoly(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class rpoly_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<rpoly_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void rpoly_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("rpoly", new rpoly_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_RPOLY_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/sconics.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/sconics.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,509 @@
+#ifndef _PROJECTIONS_SCONICS_HPP
+#define _PROJECTIONS_SCONICS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace sconics
+ {
+ static const int EULER = 0;
+ static const int MURD1 = 1;
+ static const int MURD2 = 2;
+ static const int MURD3 = 3;
+ static const int PCONIC = 4;
+ static const int TISSOT = 5;
+ static const int VITK1 = 6;
+ static const double EPS10 = 1.e-10;
+ static const double EPS = 1e-10;
+
+ struct par_sconics
+ {
+ double n;
+ double rho_c;
+ double rho_0;
+ double sig;
+ double c1, c2;
+ int type;
+ };
+ /* get common factors for simple conics */
+ template <typename PAR>
+ inline int
+ phi12(PAR& par, par_sconics& proj_parm, double *del) {
+ double p1, p2;
+ int err = 0;
+
+ if (!pj_param(par.params, "tlat_1").i ||
+ !pj_param(par.params, "tlat_2").i) {
+ err = -41;
+ } else {
+ p1 = pj_param(par.params, "rlat_1").f;
+ p2 = pj_param(par.params, "rlat_2").f;
+ *del = 0.5 * (p2 - p1);
+ proj_parm.sig = 0.5 * (p2 + p1);
+ err = (fabs(*del) < EPS || fabs(proj_parm.sig) < EPS) ? -42 : 0;
+ *del = *del;
+ }
+ return err;
+ }
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_sconics_spheroid : public base_t_fi<base_sconics_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_sconics_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_sconics_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_sconics m_proj_parm;
+
+ inline base_sconics_spheroid(const PAR& par)
+ : base_t_fi<base_sconics_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double rho;
+
+ switch (this->m_proj_parm.type) {
+ case MURD2:
+ rho = this->m_proj_parm.rho_c + tan(this->m_proj_parm.sig - lp_lat);
+ break;
+ case PCONIC:
+ rho = this->m_proj_parm.c2 * (this->m_proj_parm.c1 - tan(lp_lat));
+ break;
+ default:
+ rho = this->m_proj_parm.rho_c - lp_lat;
+ break;
+ }
+ xy_x = rho * sin( lp_lon *= this->m_proj_parm.n );
+ xy_y = this->m_proj_parm.rho_0 - rho * cos(lp_lon);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double rho;
+
+ rho = hypot(xy_x, xy_y = this->m_proj_parm.rho_0 - xy_y);
+ if (this->m_proj_parm.n < 0.) {
+ rho = - rho;
+ xy_x = - xy_x;
+ xy_y = - xy_y;
+ }
+ lp_lon = atan2(xy_x, xy_y) / this->m_proj_parm.n;
+ switch (this->m_proj_parm.type) {
+ case PCONIC:
+ lp_lat = atan(this->m_proj_parm.c1 - rho / this->m_proj_parm.c2) + this->m_proj_parm.sig;
+ break;
+ case MURD2:
+ lp_lat = this->m_proj_parm.sig - atan(rho - this->m_proj_parm.rho_c);
+ break;
+ default:
+ lp_lat = this->m_proj_parm.rho_c - rho;
+ }
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_sconics& proj_parm)
+ {
+ double del, cs;
+ int i;
+ if( (i = phi12(par, proj_parm, &del)) )
+ throw proj_exception(i);
+ switch (proj_parm.type) {
+ case TISSOT:
+ proj_parm.n = sin(proj_parm.sig);
+ cs = cos(del);
+ proj_parm.rho_c = proj_parm.n / cs + cs / proj_parm.n;
+ proj_parm.rho_0 = sqrt((proj_parm.rho_c - 2 * sin(par.phi0))/proj_parm.n);
+ break;
+ case MURD1:
+ proj_parm.rho_c = sin(del)/(del * tan(proj_parm.sig)) + proj_parm.sig;
+ proj_parm.rho_0 = proj_parm.rho_c - par.phi0;
+ proj_parm.n = sin(proj_parm.sig);
+ break;
+ case MURD2:
+ proj_parm.rho_c = (cs = sqrt(cos(del))) / tan(proj_parm.sig);
+ proj_parm.rho_0 = proj_parm.rho_c + tan(proj_parm.sig - par.phi0);
+ proj_parm.n = sin(proj_parm.sig) * cs;
+ break;
+ case MURD3:
+ proj_parm.rho_c = del / (tan(proj_parm.sig) * tan(del)) + proj_parm.sig;
+ proj_parm.rho_0 = proj_parm.rho_c - par.phi0;
+ proj_parm.n = sin(proj_parm.sig) * sin(del) * tan(del) / (del * del);
+ break;
+ case EULER:
+ proj_parm.n = sin(proj_parm.sig) * sin(del) / del;
+ del *= 0.5;
+ proj_parm.rho_c = del / (tan(del) * tan(proj_parm.sig)) + proj_parm.sig;
+
+ proj_parm.rho_0 = proj_parm.rho_c - par.phi0;
+ break;
+ case PCONIC:
+ proj_parm.n = sin(proj_parm.sig);
+ proj_parm.c2 = cos(del);
+ proj_parm.c1 = 1./tan(proj_parm.sig);
+ if (fabs(del = par.phi0 - proj_parm.sig) - EPS10 >= HALFPI)
+ throw proj_exception(-43);
+ proj_parm.rho_0 = proj_parm.c2 * (proj_parm.c1 - tan(del));
+ break;
+ case VITK1:
+ proj_parm.n = (cs = tan(del)) * sin(proj_parm.sig) / del;
+ proj_parm.rho_c = del / (cs * tan(proj_parm.sig)) + proj_parm.sig;
+ proj_parm.rho_0 = proj_parm.rho_c - par.phi0;
+ break;
+ }
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0;
+ }
+
+
+ // Tissot
+ template <typename PAR>
+ void setup_tissot(PAR& par, par_sconics& proj_parm)
+ {
+ proj_parm.type = TISSOT;
+ setup(par, proj_parm);
+ }
+
+ // Murdoch I
+ template <typename PAR>
+ void setup_murd1(PAR& par, par_sconics& proj_parm)
+ {
+ proj_parm.type = MURD1;
+ setup(par, proj_parm);
+ }
+
+ // Murdoch II
+ template <typename PAR>
+ void setup_murd2(PAR& par, par_sconics& proj_parm)
+ {
+ proj_parm.type = MURD2;
+ setup(par, proj_parm);
+ }
+
+ // Murdoch III
+ template <typename PAR>
+ void setup_murd3(PAR& par, par_sconics& proj_parm)
+ {
+ proj_parm.type = MURD3;
+ setup(par, proj_parm);
+ }
+
+ // Euler
+ template <typename PAR>
+ void setup_euler(PAR& par, par_sconics& proj_parm)
+ {
+ proj_parm.type = EULER;
+ setup(par, proj_parm);
+ }
+
+ // Perspective Conic
+ template <typename PAR>
+ void setup_pconic(PAR& par, par_sconics& proj_parm)
+ {
+ proj_parm.type = PCONIC;
+ setup(par, proj_parm);
+ }
+
+ // Vitkovsky I
+ template <typename PAR>
+ void setup_vitk1(PAR& par, par_sconics& proj_parm)
+ {
+ proj_parm.type = VITK1;
+ setup(par, proj_parm);
+ }
+
+ } // namespace sconics
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Tissot projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - lat_1= and lat_2=
+ \par Example
+ \image html ex_tissot.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct tissot_spheroid : public impl::sconics::base_sconics_spheroid<LL, XY, PAR>
+ {
+ inline tissot_spheroid(const PAR& par) : impl::sconics::base_sconics_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sconics::setup_tissot(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Murdoch I projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - lat_1= and lat_2=
+ \par Example
+ \image html ex_murd1.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct murd1_spheroid : public impl::sconics::base_sconics_spheroid<LL, XY, PAR>
+ {
+ inline murd1_spheroid(const PAR& par) : impl::sconics::base_sconics_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sconics::setup_murd1(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Murdoch II projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - lat_1= and lat_2=
+ \par Example
+ \image html ex_murd2.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct murd2_spheroid : public impl::sconics::base_sconics_spheroid<LL, XY, PAR>
+ {
+ inline murd2_spheroid(const PAR& par) : impl::sconics::base_sconics_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sconics::setup_murd2(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Murdoch III projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - lat_1= and lat_2=
+ \par Example
+ \image html ex_murd3.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct murd3_spheroid : public impl::sconics::base_sconics_spheroid<LL, XY, PAR>
+ {
+ inline murd3_spheroid(const PAR& par) : impl::sconics::base_sconics_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sconics::setup_murd3(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Euler projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - lat_1= and lat_2=
+ \par Example
+ \image html ex_euler.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct euler_spheroid : public impl::sconics::base_sconics_spheroid<LL, XY, PAR>
+ {
+ inline euler_spheroid(const PAR& par) : impl::sconics::base_sconics_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sconics::setup_euler(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Perspective Conic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - lat_1= and lat_2=
+ \par Example
+ \image html ex_pconic.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct pconic_spheroid : public impl::sconics::base_sconics_spheroid<LL, XY, PAR>
+ {
+ inline pconic_spheroid(const PAR& par) : impl::sconics::base_sconics_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sconics::setup_pconic(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Vitkovsky I projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Conic
+ - Spheroid
+ - lat_1= and lat_2=
+ \par Example
+ \image html ex_vitk1.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct vitk1_spheroid : public impl::sconics::base_sconics_spheroid<LL, XY, PAR>
+ {
+ inline vitk1_spheroid(const PAR& par) : impl::sconics::base_sconics_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sconics::setup_vitk1(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class tissot_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<tissot_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class murd1_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<murd1_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class murd2_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<murd2_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class murd3_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<murd3_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class euler_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<euler_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class pconic_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<pconic_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class vitk1_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<vitk1_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void sconics_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("tissot", new tissot_entry<LL, XY, PAR>);
+ factory.add_to_factory("murd1", new murd1_entry<LL, XY, PAR>);
+ factory.add_to_factory("murd2", new murd2_entry<LL, XY, PAR>);
+ factory.add_to_factory("murd3", new murd3_entry<LL, XY, PAR>);
+ factory.add_to_factory("euler", new euler_entry<LL, XY, PAR>);
+ factory.add_to_factory("pconic", new pconic_entry<LL, XY, PAR>);
+ factory.add_to_factory("vitk1", new vitk1_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_SCONICS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/somerc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/somerc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,188 @@
+#ifndef _PROJECTIONS_SOMERC_HPP
+#define _PROJECTIONS_SOMERC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace somerc
+ {
+ static const double EPS = 1.e-10;
+ static const int NITER = 6;
+
+ struct par_somerc
+ {
+ double K, c, hlf_e, kR, cosp0, sinp0;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_somerc_ellipsoid : public base_t_fi<base_somerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_somerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_somerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_somerc m_proj_parm;
+
+ inline base_somerc_ellipsoid(const PAR& par)
+ : base_t_fi<base_somerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double phip, lamp, phipp, lampp, sp, cp;
+
+ sp = this->m_par.e * sin(lp_lat);
+ phip = 2.* atan( exp( this->m_proj_parm.c * (
+ log(tan(FORTPI + 0.5 * lp_lat)) - this->m_proj_parm.hlf_e * log((1. + sp)/(1. - sp)))
+ + this->m_proj_parm.K)) - HALFPI;
+ lamp = this->m_proj_parm.c * lp_lon;
+ cp = cos(phip);
+ phipp = aasin(this->m_proj_parm.cosp0 * sin(phip) - this->m_proj_parm.sinp0 * cp * cos(lamp));
+ lampp = aasin(cp * sin(lamp) / cos(phipp));
+ xy_x = this->m_proj_parm.kR * lampp;
+ xy_y = this->m_proj_parm.kR * log(tan(FORTPI + 0.5 * phipp));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double phip, lamp, phipp, lampp, cp, esp, con, delp;
+ int i;
+
+ phipp = 2. * (atan(exp(xy_y / this->m_proj_parm.kR)) - FORTPI);
+ lampp = xy_x / this->m_proj_parm.kR;
+ cp = cos(phipp);
+ phip = aasin(this->m_proj_parm.cosp0 * sin(phipp) + this->m_proj_parm.sinp0 * cp * cos(lampp));
+ lamp = aasin(cp * sin(lampp) / cos(phip));
+ con = (this->m_proj_parm.K - log(tan(FORTPI + 0.5 * phip)))/this->m_proj_parm.c;
+ for (i = NITER; i ; --i) {
+ esp = this->m_par.e * sin(phip);
+ delp = (con + log(tan(FORTPI + 0.5 * phip)) - this->m_proj_parm.hlf_e *
+ log((1. + esp)/(1. - esp)) ) *
+ (1. - esp * esp) * cos(phip) * this->m_par.rone_es;
+ phip -= delp;
+ if (fabs(delp) < EPS)
+ break;
+ }
+ if (i) {
+ lp_lat = phip;
+ lp_lon = lamp / this->m_proj_parm.c;
+ } else
+ throw proj_exception();
+ }
+ };
+
+ // Swiss. Obl. Mercator
+ template <typename PAR>
+ void setup_somerc(PAR& par, par_somerc& proj_parm)
+ {
+ double cp, phip0, sp;
+ proj_parm.hlf_e = 0.5 * par.e;
+ cp = cos(par.phi0);
+ cp *= cp;
+ proj_parm.c = sqrt(1 + par.es * cp * cp * par.rone_es);
+ sp = sin(par.phi0);
+ proj_parm.cosp0 = cos( phip0 = aasin(proj_parm.sinp0 = sp / proj_parm.c) );
+ sp *= par.e;
+ proj_parm.K = log(tan(FORTPI + 0.5 * phip0)) - proj_parm.c * (
+ log(tan(FORTPI + 0.5 * par.phi0)) - proj_parm.hlf_e *
+ log((1. + sp) / (1. - sp)));
+ proj_parm.kR = par.k0 * sqrt(par.one_es) / (1. - sp * sp);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+ } // namespace somerc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Swiss. Obl. Mercator projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Ellipsoid
+ - For CH1903
+ \par Example
+ \image html ex_somerc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct somerc_ellipsoid : public impl::somerc::base_somerc_ellipsoid<LL, XY, PAR>
+ {
+ inline somerc_ellipsoid(const PAR& par) : impl::somerc::base_somerc_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::somerc::setup_somerc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class somerc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<somerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void somerc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("somerc", new somerc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_SOMERC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/stere.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/stere.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,446 @@
+#ifndef _PROJECTIONS_STERE_HPP
+#define _PROJECTIONS_STERE_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_tsfn.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace stere
+ {
+ static const double EPS10 = 1.e-10;
+ static const double TOL = 1.e-8;
+ static const int NITER = 8;
+ static const double CONV = 1.e-10;
+ static const int S_POLE = 0;
+ static const int N_POLE = 1;
+ static const int OBLIQ = 2;
+ static const int EQUIT = 3;
+
+ struct par_stere
+ {
+ double phits;
+ double sinX1;
+ double cosX1;
+ double akm1;
+ int mode;
+ };
+ inline double
+ ssfn_(double phit, double sinphi, double eccen) {
+ sinphi *= eccen;
+ return (tan (.5 * (HALFPI + phit)) *
+ pow((1. - sinphi) / (1. + sinphi), .5 * eccen));
+ }
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_stere_ellipsoid : public base_t_fi<base_stere_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_stere_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_stere_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_stere m_proj_parm;
+
+ inline base_stere_ellipsoid(const PAR& par)
+ : base_t_fi<base_stere_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double coslam, sinlam, sinX=0.0, cosX=0.0, X, A, sinphi;
+
+ coslam = cos(lp_lon);
+ sinlam = sin(lp_lon);
+ sinphi = sin(lp_lat);
+ if (this->m_proj_parm.mode == OBLIQ || this->m_proj_parm.mode == EQUIT) {
+ sinX = sin(X = 2. * atan(ssfn_(lp_lat, sinphi, this->m_par.e)) - HALFPI);
+ cosX = cos(X);
+ }
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ A = this->m_proj_parm.akm1 / (this->m_proj_parm.cosX1 * (1. + this->m_proj_parm.sinX1 * sinX +
+ this->m_proj_parm.cosX1 * cosX * coslam));
+ xy_y = A * (this->m_proj_parm.cosX1 * sinX - this->m_proj_parm.sinX1 * cosX * coslam);
+ goto xmul;
+ case EQUIT:
+ A = 2. * this->m_proj_parm.akm1 / (1. + cosX * coslam);
+ xy_y = A * sinX;
+ xmul:
+ xy_x = A * cosX;
+ break;
+ case S_POLE:
+ lp_lat = -lp_lat;
+ coslam = - coslam;
+ sinphi = -sinphi;
+ case N_POLE:
+ xy_x = this->m_proj_parm.akm1 * pj_tsfn(lp_lat, sinphi, this->m_par.e);
+ xy_y = - xy_x * coslam;
+ break;
+ }
+ xy_x = xy_x * sinlam;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double cosphi, sinphi, tp=0.0, phi_l=0.0, rho, halfe=0.0, halfpi=0.0;
+ int i;
+
+ rho = hypot(xy_x, xy_y);
+ switch (this->m_proj_parm.mode) {
+ case OBLIQ:
+ case EQUIT:
+ cosphi = cos( tp = 2. * atan2(rho * this->m_proj_parm.cosX1 , this->m_proj_parm.akm1) );
+ sinphi = sin(tp);
+ if( rho == 0.0 )
+ phi_l = asin(cosphi * this->m_proj_parm.sinX1);
+ else
+ phi_l = asin(cosphi * this->m_proj_parm.sinX1 + (xy_y * sinphi * this->m_proj_parm.cosX1 / rho));
+
+ tp = tan(.5 * (HALFPI + phi_l));
+ xy_x *= sinphi;
+ xy_y = rho * this->m_proj_parm.cosX1 * cosphi - xy_y * this->m_proj_parm.sinX1* sinphi;
+ halfpi = HALFPI;
+ halfe = .5 * this->m_par.e;
+ break;
+ case N_POLE:
+ xy_y = -xy_y;
+ case S_POLE:
+ phi_l = HALFPI - 2. * atan(tp = - rho / this->m_proj_parm.akm1);
+ halfpi = -HALFPI;
+ halfe = -.5 * this->m_par.e;
+ break;
+ }
+ for (i = NITER; i--; phi_l = lp_lat) {
+ sinphi = this->m_par.e * sin(phi_l);
+ lp_lat = 2. * atan(tp * pow((1.+sinphi)/(1.-sinphi),
+ halfe)) - halfpi;
+ if (fabs(phi_l - lp_lat) < CONV) {
+ if (this->m_proj_parm.mode == S_POLE)
+ lp_lat = -lp_lat;
+ lp_lon = (xy_x == 0. && xy_y == 0.) ? 0. : atan2(xy_x, xy_y);
+ return;
+ }
+ }
+ throw proj_exception();;
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_stere_spheroid : public base_t_fi<base_stere_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_stere_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_stere_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_stere m_proj_parm;
+
+ inline base_stere_spheroid(const PAR& par)
+ : base_t_fi<base_stere_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double sinphi, cosphi, coslam, sinlam;
+
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ coslam = cos(lp_lon);
+ sinlam = sin(lp_lon);
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ xy_y = 1. + cosphi * coslam;
+ goto oblcon;
+ case OBLIQ:
+ xy_y = 1. + this->m_proj_parm.sinX1 * sinphi + this->m_proj_parm.cosX1 * cosphi * coslam;
+ oblcon:
+ if (xy_y <= EPS10) throw proj_exception();;
+ xy_x = (xy_y = this->m_proj_parm.akm1 / xy_y) * cosphi * sinlam;
+ xy_y *= (this->m_proj_parm.mode == EQUIT) ? sinphi :
+ this->m_proj_parm.cosX1 * sinphi - this->m_proj_parm.sinX1 * cosphi * coslam;
+ break;
+ case N_POLE:
+ coslam = - coslam;
+ lp_lat = - lp_lat;
+ case S_POLE:
+ if (fabs(lp_lat - HALFPI) < TOL) throw proj_exception();;
+ xy_x = sinlam * ( xy_y = this->m_proj_parm.akm1 * tan(FORTPI + .5 * lp_lat) );
+ xy_y *= coslam;
+ break;
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double c, rh, sinc, cosc;
+
+ sinc = sin(c = 2. * atan((rh = hypot(xy_x, xy_y)) / this->m_proj_parm.akm1));
+ cosc = cos(c);
+ lp_lon = 0.;
+ switch (this->m_proj_parm.mode) {
+ case EQUIT:
+ if (fabs(rh) <= EPS10)
+ lp_lat = 0.;
+ else
+ lp_lat = asin(xy_y * sinc / rh);
+ if (cosc != 0. || xy_x != 0.)
+ lp_lon = atan2(xy_x * sinc, cosc * rh);
+ break;
+ case OBLIQ:
+ if (fabs(rh) <= EPS10)
+ lp_lat = this->m_par.phi0;
+ else
+ lp_lat = asin(cosc * this->m_proj_parm.sinX1 + xy_y * sinc * this->m_proj_parm.cosX1 / rh);
+ if ((c = cosc - this->m_proj_parm.sinX1 * sin(lp_lat)) != 0. || xy_x != 0.)
+ lp_lon = atan2(xy_x * sinc * this->m_proj_parm.cosX1, c * rh);
+ break;
+ case N_POLE:
+ xy_y = -xy_y;
+ case S_POLE:
+ if (fabs(rh) <= EPS10)
+ lp_lat = this->m_par.phi0;
+ else
+ lp_lat = asin(this->m_proj_parm.mode == S_POLE ? - cosc : cosc);
+ lp_lon = (xy_x == 0. && xy_y == 0.) ? 0. : atan2(xy_x, xy_y);
+ break;
+ }
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_stere& proj_parm) /* general initialization */
+ {
+ double t;
+ if (fabs((t = fabs(par.phi0)) - HALFPI) < EPS10)
+ proj_parm.mode = par.phi0 < 0. ? S_POLE : N_POLE;
+ else
+ proj_parm.mode = t > EPS10 ? OBLIQ : EQUIT;
+ proj_parm.phits = fabs(proj_parm.phits);
+ if (par.es) {
+ double X;
+ switch (proj_parm.mode) {
+ case N_POLE:
+ case S_POLE:
+ if (fabs(proj_parm.phits - HALFPI) < EPS10)
+ proj_parm.akm1 = 2. * par.k0 /
+ sqrt(pow(1+par.e,1+par.e)*pow(1-par.e,1-par.e));
+ else {
+ proj_parm.akm1 = cos(proj_parm.phits) /
+ pj_tsfn(proj_parm.phits, t = sin(proj_parm.phits), par.e);
+ t *= par.e;
+ proj_parm.akm1 /= sqrt(1. - t * t);
+ }
+ break;
+ case EQUIT:
+ proj_parm.akm1 = 2. * par.k0;
+ break;
+ case OBLIQ:
+ t = sin(par.phi0);
+ X = 2. * atan(ssfn_(par.phi0, t, par.e)) - HALFPI;
+ t *= par.e;
+ proj_parm.akm1 = 2. * par.k0 * cos(par.phi0) / sqrt(1. - t * t);
+ proj_parm.sinX1 = sin(X);
+ proj_parm.cosX1 = cos(X);
+ break;
+ }
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ switch (proj_parm.mode) {
+ case OBLIQ:
+ proj_parm.sinX1 = sin(par.phi0);
+ proj_parm.cosX1 = cos(par.phi0);
+ case EQUIT:
+ proj_parm.akm1 = 2. * par.k0;
+ break;
+ case S_POLE:
+ case N_POLE:
+ proj_parm.akm1 = fabs(proj_parm.phits - HALFPI) >= EPS10 ?
+ cos(proj_parm.phits) / tan(FORTPI - .5 * proj_parm.phits) :
+ 2. * par.k0 ;
+ break;
+ }
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+
+ // Stereographic
+ template <typename PAR>
+ void setup_stere(PAR& par, par_stere& proj_parm)
+ {
+ proj_parm.phits = pj_param(par.params, "tlat_ts").i ?
+ proj_parm.phits = pj_param(par.params, "rlat_ts").f : HALFPI;
+ setup(par, proj_parm);
+ }
+
+ // Universal Polar Stereographic
+ template <typename PAR>
+ void setup_ups(PAR& par, par_stere& proj_parm)
+ {
+ /* International Ellipsoid */
+ par.phi0 = pj_param(par.params, "bsouth").i ? - HALFPI: HALFPI;
+ if (!par.es) throw proj_exception(-34);
+ par.k0 = .994;
+ par.x0 = 2000000.;
+ par.y0 = 2000000.;
+ proj_parm.phits = HALFPI;
+ par.lam0 = 0.;
+ setup(par, proj_parm);
+ }
+
+ } // namespace stere
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Stereographic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - lat_ts=
+ \par Example
+ \image html ex_stere.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct stere_ellipsoid : public impl::stere::base_stere_ellipsoid<LL, XY, PAR>
+ {
+ inline stere_ellipsoid(const PAR& par) : impl::stere::base_stere_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::stere::setup_stere(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Universal Polar Stereographic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - south
+ \par Example
+ \image html ex_ups.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct ups_ellipsoid : public impl::stere::base_stere_ellipsoid<LL, XY, PAR>
+ {
+ inline ups_ellipsoid(const PAR& par) : impl::stere::base_stere_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::stere::setup_ups(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Stereographic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ - lat_ts=
+ \par Example
+ \image html ex_stere.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct stere_spheroid : public impl::stere::base_stere_spheroid<LL, XY, PAR>
+ {
+ inline stere_spheroid(const PAR& par) : impl::stere::base_stere_spheroid<LL, XY, PAR>(par)
+ {
+ impl::stere::setup_stere(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class stere_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<stere_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<stere_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class ups_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<ups_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void stere_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("stere", new stere_entry<LL, XY, PAR>);
+ factory.add_to_factory("ups", new ups_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_STERE_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/sterea.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/sterea.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,381 @@
+#ifndef _PROJECTIONS_STEREA_HPP
+#define _PROJECTIONS_STEREA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/pj_gauss.hpp>
+
+#include <geometry/projections/epsg_traits.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace sterea
+ {
+ static const double DEL_TOL = 1.e-14;
+ static const int MAX_ITER = 10;
+
+ struct par_sterea
+ {
+ double phic0;
+ double cosc0, sinc0;
+ double R2;
+ gauss::GAUSS en;
+ };
+
+
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_sterea_ellipsoid : public base_t_fi<base_sterea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_sterea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_sterea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_sterea m_proj_parm;
+
+ inline base_sterea_ellipsoid(const PAR& par)
+ : base_t_fi<base_sterea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double cosc, sinc, cosl, k;
+
+ impl::gauss::gauss(m_proj_parm.en, lp_lon, lp_lat);
+ sinc = sin(lp_lat);
+ cosc = cos(lp_lat);
+ cosl = cos(lp_lon);
+ k = this->m_par.k0 * this->m_proj_parm.R2 / (1. + this->m_proj_parm.sinc0 * sinc + this->m_proj_parm.cosc0 * cosc * cosl);
+ xy_x = k * cosc * sin(lp_lon);
+ xy_y = k * (this->m_proj_parm.cosc0 * sinc - this->m_proj_parm.sinc0 * cosc * cosl);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double rho, c, sinc, cosc;
+
+ xy_x /= this->m_par.k0;
+ xy_y /= this->m_par.k0;
+ if((rho = hypot(xy_x, xy_y))) {
+ c = 2. * atan2(rho, this->m_proj_parm.R2);
+ sinc = sin(c);
+ cosc = cos(c);
+ lp_lat = asin(cosc * this->m_proj_parm.sinc0 + xy_y * sinc * this->m_proj_parm.cosc0 / rho);
+ lp_lon = atan2(xy_x * sinc, rho * this->m_proj_parm.cosc0 * cosc -
+ xy_y * this->m_proj_parm.sinc0 * sinc);
+ } else {
+ lp_lat = this->m_proj_parm.phic0;
+ lp_lon = 0.;
+ }
+ impl::gauss::inv_gauss(m_proj_parm.en, lp_lon, lp_lat);
+ }
+ };
+
+ // Oblique Stereographic Alternative
+ template <typename PAR>
+ void setup_sterea(PAR& par, par_sterea& proj_parm)
+ {
+ double R;
+ proj_parm.en = impl::gauss::gauss_ini(par.e, par.phi0, proj_parm.phic0, R);
+ proj_parm.sinc0 = sin(proj_parm.phic0);
+ proj_parm.cosc0 = cos(proj_parm.phic0);
+ proj_parm.R2 = 2. * R;
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ }
+
+ } // namespace sterea
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Oblique Stereographic Alternative projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Azimuthal
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_sterea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct sterea_ellipsoid : public impl::sterea::base_sterea_ellipsoid<LL, XY, PAR>
+ {
+ inline sterea_ellipsoid(const PAR& par) : impl::sterea::base_sterea_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::sterea::setup_sterea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class sterea_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<sterea_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void sterea_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("sterea", new sterea_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ // Create EPSG specializations
+ // (Proof of Concept, only for some)
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2036, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2171, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0.9998 +x_0=4637000 +y_0=5647000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2172, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=53.00194444444445 +lon_0=21.50277777777778 +k=0.9998 +x_0=4603000 +y_0=5806000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2173, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=53.58333333333334 +lon_0=17.00833333333333 +k=0.9998 +x_0=3501000 +y_0=5999000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2174, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=51.67083333333333 +lon_0=16.67222222222222 +k=0.9998 +x_0=3703000 +y_0=5627000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2200, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=300000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2290, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=700000 +y_0=400000 +a=6378135 +b=6356750.304921594 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2291, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2292, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2953, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2954, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=400000 +y_0=800000 +ellps=GRS80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3120, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0.9998 +x_0=4637000 +y_0=5467000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<3328, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=52.16666666666666 +lon_0=19.16666666666667 +k=0.999714 +x_0=500000 +y_0=500000 +ellps=krass +towgs84=33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<22780, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=34.2 +lon_0=39.15 +k=0.9995341 +x_0=0 +y_0=0 +a=6378249.2 +b=6356515 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<28991, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=0 +y_0=0 +ellps=bessel +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<28992, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<31600, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=45.9 +lon_0=25.39246588888889 +k=0.9996667 +x_0=500000 +y_0=500000 +ellps=intl +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<31700, LLR, XY, PAR>
+ {
+ typedef sterea_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000 +ellps=krass +units=m";
+ }
+ };
+
+
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_STEREA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/sts.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/sts.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,291 @@
+#ifndef _PROJECTIONS_STS_HPP
+#define _PROJECTIONS_STS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace sts
+ {
+
+ struct par_sts
+ {
+ double C_x, C_y, C_p;
+ int tan_mode;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_sts_spheroid : public base_t_fi<base_sts_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_sts_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_sts_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_sts m_proj_parm;
+
+ inline base_sts_spheroid(const PAR& par)
+ : base_t_fi<base_sts_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double c;
+
+ xy_x = this->m_proj_parm.C_x * lp_lon * cos(lp_lat);
+ xy_y = this->m_proj_parm.C_y;
+ lp_lat *= this->m_proj_parm.C_p;
+ c = cos(lp_lat);
+ if (this->m_proj_parm.tan_mode) {
+ xy_x *= c * c;
+ xy_y *= tan(lp_lat);
+ } else {
+ xy_x /= c;
+ xy_y *= sin(lp_lat);
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double c;
+
+ xy_y /= this->m_proj_parm.C_y;
+ c = cos(lp_lat = this->m_proj_parm.tan_mode ? atan(xy_y) : aasin(xy_y));
+ lp_lat /= this->m_proj_parm.C_p;
+ lp_lon = xy_x / (this->m_proj_parm.C_x * cos(lp_lat /= this->m_proj_parm.C_p));
+ if (this->m_proj_parm.tan_mode)
+ lp_lon /= c * c;
+ else
+ lp_lon *= c;
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_sts& proj_parm, double p, double q, int mode)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ proj_parm.C_x = q / p;
+ proj_parm.C_y = p;
+ proj_parm.C_p = 1/ q;
+ proj_parm.tan_mode = mode;
+ }
+
+
+ // Kavraisky V
+ template <typename PAR>
+ void setup_kav5(PAR& par, par_sts& proj_parm)
+ {
+ setup(par, proj_parm, 1.50488, 1.35439, 0);
+ }
+
+ // Quartic Authalic
+ template <typename PAR>
+ void setup_qua_aut(PAR& par, par_sts& proj_parm)
+ {
+ setup(par, proj_parm, 2., 2., 0);
+ }
+
+ // McBryde-Thomas Flat-Polar Sine (No. 1)
+ template <typename PAR>
+ void setup_mbt_s(PAR& par, par_sts& proj_parm)
+ {
+ setup(par, proj_parm, 1.48875, 1.36509, 0);
+ }
+
+ // Foucaut
+ template <typename PAR>
+ void setup_fouc(PAR& par, par_sts& proj_parm)
+ {
+ setup(par, proj_parm, 2., 2., 1);
+ }
+
+ } // namespace sts
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Kavraisky V projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_kav5.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct kav5_spheroid : public impl::sts::base_sts_spheroid<LL, XY, PAR>
+ {
+ inline kav5_spheroid(const PAR& par) : impl::sts::base_sts_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sts::setup_kav5(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Quartic Authalic projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_qua_aut.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct qua_aut_spheroid : public impl::sts::base_sts_spheroid<LL, XY, PAR>
+ {
+ inline qua_aut_spheroid(const PAR& par) : impl::sts::base_sts_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sts::setup_qua_aut(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief McBryde-Thomas Flat-Polar Sine (No. 1) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_mbt_s.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct mbt_s_spheroid : public impl::sts::base_sts_spheroid<LL, XY, PAR>
+ {
+ inline mbt_s_spheroid(const PAR& par) : impl::sts::base_sts_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sts::setup_mbt_s(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Foucaut projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_fouc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct fouc_spheroid : public impl::sts::base_sts_spheroid<LL, XY, PAR>
+ {
+ inline fouc_spheroid(const PAR& par) : impl::sts::base_sts_spheroid<LL, XY, PAR>(par)
+ {
+ impl::sts::setup_fouc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class kav5_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<kav5_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class qua_aut_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<qua_aut_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class mbt_s_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<mbt_s_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class fouc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<fouc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void sts_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("kav5", new kav5_entry<LL, XY, PAR>);
+ factory.add_to_factory("qua_aut", new qua_aut_entry<LL, XY, PAR>);
+ factory.add_to_factory("mbt_s", new mbt_s_entry<LL, XY, PAR>);
+ factory.add_to_factory("fouc", new fouc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_STS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/tcc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/tcc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,142 @@
+#ifndef _PROJECTIONS_TCC_HPP
+#define _PROJECTIONS_TCC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace tcc
+ {
+ static const double EPS10 = 1.e-10;
+
+ struct par_tcc
+ {
+ double ap;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_tcc_spheroid : public base_t_f<base_tcc_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_tcc_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_tcc_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_tcc m_proj_parm;
+
+ inline base_tcc_spheroid(const PAR& par)
+ : base_t_f<base_tcc_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double b, bt;
+
+ b = cos(lp_lat) * sin(lp_lon);
+ if ((bt = 1. - b * b) < EPS10) throw proj_exception();;
+ xy_x = b / sqrt(bt);
+ xy_y = atan2(tan(lp_lat) , cos(lp_lon));
+ }
+ };
+
+ // Transverse Central Cylindrical
+ template <typename PAR>
+ void setup_tcc(PAR& par, par_tcc& proj_parm)
+ {
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace tcc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Transverse Central Cylindrical projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_tcc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct tcc_spheroid : public impl::tcc::base_tcc_spheroid<LL, XY, PAR>
+ {
+ inline tcc_spheroid(const PAR& par) : impl::tcc::base_tcc_spheroid<LL, XY, PAR>(par)
+ {
+ impl::tcc::setup_tcc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class tcc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<tcc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void tcc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("tcc", new tcc_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_TCC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/tcea.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/tcea.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,149 @@
+#ifndef _PROJECTIONS_TCEA_HPP
+#define _PROJECTIONS_TCEA_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace tcea
+ {
+
+ struct par_tcea
+ {
+ double rk0;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_tcea_spheroid : public base_t_fi<base_tcea_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_tcea_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_tcea_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_tcea m_proj_parm;
+
+ inline base_tcea_spheroid(const PAR& par)
+ : base_t_fi<base_tcea_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = this->m_proj_parm.rk0 * cos(lp_lat) * sin(lp_lon);
+ xy_y = this->m_par.k0 * (atan2(tan(lp_lat), cos(lp_lon)) - this->m_par.phi0);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double t;
+
+ xy_y = xy_y * this->m_proj_parm.rk0 + this->m_par.phi0;
+ xy_x *= this->m_par.k0;
+ t = sqrt(1. - xy_x * xy_x);
+ lp_lat = asin(t * sin(xy_y));
+ lp_lon = atan2(xy_x, t * cos(xy_y));
+ }
+ };
+
+ // Transverse Cylindrical Equal Area
+ template <typename PAR>
+ void setup_tcea(PAR& par, par_tcea& proj_parm)
+ {
+ proj_parm.rk0 = 1 / par.k0;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace tcea
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Transverse Cylindrical Equal Area projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ \par Example
+ \image html ex_tcea.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct tcea_spheroid : public impl::tcea::base_tcea_spheroid<LL, XY, PAR>
+ {
+ inline tcea_spheroid(const PAR& par) : impl::tcea::base_tcea_spheroid<LL, XY, PAR>(par)
+ {
+ impl::tcea::setup_tcea(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class tcea_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<tcea_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void tcea_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("tcea", new tcea_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_TCEA_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/tmerc.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/tmerc.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,453 @@
+#ifndef _PROJECTIONS_TMERC_HPP
+#define _PROJECTIONS_TMERC_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+#include <geometry/projections/impl/function_overloads.hpp>
+#include <geometry/projections/impl/pj_mlfn.hpp>
+
+#include <geometry/projections/epsg_traits.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace tmerc
+ {
+ static const double EPS10 = 1.e-10;
+ static const double FC1 = 1.;
+ static const double FC2 = .5;
+ static const double FC3 = .16666666666666666666;
+ static const double FC4 = .08333333333333333333;
+ static const double FC5 = .05;
+ static const double FC6 = .03333333333333333333;
+ static const double FC7 = .02380952380952380952;
+ static const double FC8 = .01785714285714285714;
+
+ struct par_tmerc
+ {
+ double esp;
+ double ml0;
+ double en[EN_SIZE];
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_tmerc_ellipsoid : public base_t_fi<base_tmerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_tmerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_tmerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_tmerc m_proj_parm;
+
+ inline base_tmerc_ellipsoid(const PAR& par)
+ : base_t_fi<base_tmerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double al, als, n, cosphi, sinphi, t;
+
+ /*
+ * Fail if our longitude is more than 90 degrees from the
+ * central meridian since the results are essentially garbage.
+ * Is error -20 really an appropriate return value?
+ *
+ * http://trac.osgeo.org/proj/ticket/5
+ */
+ if( lp_lon < -HALFPI || lp_lon > HALFPI )
+ {
+ xy_x = HUGE_VAL;
+ xy_y = HUGE_VAL;
+ throw proj_exception( -14);
+ return;
+ }
+
+ sinphi = sin(lp_lat); cosphi = cos(lp_lat);
+ t = fabs(cosphi) > 1e-10 ? sinphi/cosphi : 0.;
+ t *= t;
+ al = cosphi * lp_lon;
+ als = al * al;
+ al /= sqrt(1. - this->m_par.es * sinphi * sinphi);
+ n = this->m_proj_parm.esp * cosphi * cosphi;
+ xy_x = this->m_par.k0 * al * (FC1 +
+ FC3 * als * (1. - t + n +
+ FC5 * als * (5. + t * (t - 18.) + n * (14. - 58. * t)
+ + FC7 * als * (61. + t * ( t * (179. - t) - 479. ) )
+ )));
+ xy_y = this->m_par.k0 * (pj_mlfn(lp_lat, sinphi, cosphi, this->m_proj_parm.en) - this->m_proj_parm.ml0 +
+ sinphi * al * lp_lon * FC2 * ( 1. +
+ FC4 * als * (5. - t + n * (9. + 4. * n) +
+ FC6 * als * (61. + t * (t - 58.) + n * (270. - 330 * t)
+ + FC8 * als * (1385. + t * ( t * (543. - t) - 3111.) )
+ ))));
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double n, con, cosphi, d, ds, sinphi, t;
+
+ lp_lat = pj_inv_mlfn(this->m_proj_parm.ml0 + xy_y / this->m_par.k0, this->m_par.es, this->m_proj_parm.en);
+ if (fabs(lp_lat) >= HALFPI) {
+ lp_lat = xy_y < 0. ? -HALFPI : HALFPI;
+ lp_lon = 0.;
+ } else {
+ sinphi = sin(lp_lat);
+ cosphi = cos(lp_lat);
+ t = fabs(cosphi) > 1e-10 ? sinphi/cosphi : 0.;
+ n = this->m_proj_parm.esp * cosphi * cosphi;
+ d = xy_x * sqrt(con = 1. - this->m_par.es * sinphi * sinphi) / this->m_par.k0;
+ con *= t;
+ t *= t;
+ ds = d * d;
+ lp_lat -= (con * ds / (1.-this->m_par.es)) * FC2 * (1. -
+ ds * FC4 * (5. + t * (3. - 9. * n) + n * (1. - 4 * n) -
+ ds * FC6 * (61. + t * (90. - 252. * n +
+ 45. * t) + 46. * n
+ - ds * FC8 * (1385. + t * (3633. + t * (4095. + 1574. * t)) )
+ )));
+ lp_lon = d*(FC1 -
+ ds*FC3*( 1. + 2.*t + n -
+ ds*FC5*(5. + t*(28. + 24.*t + 8.*n) + 6.*n
+ - ds * FC7 * (61. + t * (662. + t * (1320. + 720. * t)) )
+ ))) / cosphi;
+ }
+ }
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_tmerc_spheroid : public base_t_fi<base_tmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_tmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_tmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_tmerc m_proj_parm;
+
+ inline base_tmerc_spheroid(const PAR& par)
+ : base_t_fi<base_tmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double b, cosphi;
+
+ /*
+ * Fail if our longitude is more than 90 degrees from the
+ * central meridian since the results are essentially garbage.
+ * Is error -20 really an appropriate return value?
+ *
+ * http://trac.osgeo.org/proj/ticket/5
+ */
+ if( lp_lon < -HALFPI || lp_lon > HALFPI )
+ {
+ xy_x = HUGE_VAL;
+ xy_y = HUGE_VAL;
+ throw proj_exception( -14);
+ return;
+ }
+
+ b = (cosphi = cos(lp_lat)) * sin(lp_lon);
+ if (fabs(fabs(b) - 1.) <= EPS10) throw proj_exception();;
+ xy_x = this->m_proj_parm.ml0 * log((1. + b) / (1. - b));
+ if ((b = fabs( xy_y = cosphi * cos(lp_lon) / sqrt(1. - b * b) )) >= 1.) {
+ if ((b - 1.) > EPS10) throw proj_exception();
+ else xy_y = 0.;
+ } else
+ xy_y = acos(xy_y);
+ if (lp_lat < 0.) xy_y = -xy_y;
+ xy_y = this->m_proj_parm.esp * (xy_y - this->m_par.phi0);
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double h, g;
+
+ h = exp(xy_x / this->m_proj_parm.esp);
+ g = .5 * (h - 1. / h);
+ h = cos(this->m_par.phi0 + xy_y / this->m_proj_parm.esp);
+ lp_lat = asin(sqrt((1. - h * h) / (1. + g * g)));
+ if (xy_y < 0.) lp_lat = -lp_lat;
+ lp_lon = (g || h) ? atan2(g, h) : 0.;
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_tmerc& proj_parm) /* general initialization */
+ {
+ if (par.es) {
+ pj_enfn(par.es, proj_parm.en);
+
+ proj_parm.ml0 = pj_mlfn(par.phi0, sin(par.phi0), cos(par.phi0), proj_parm.en);
+ proj_parm.esp = par.es / (1. - par.es);
+ // par.inv = e_inverse;
+ // par.fwd = e_forward;
+ } else {
+ proj_parm.esp = par.k0;
+ proj_parm.ml0 = .5 * proj_parm.esp;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+ }
+
+
+ // Transverse Mercator
+ template <typename PAR>
+ void setup_tmerc(PAR& par, par_tmerc& proj_parm)
+ {
+ setup(par, proj_parm);
+ }
+
+ // Universal Transverse Mercator (UTM)
+ template <typename PAR>
+ void setup_utm(PAR& par, par_tmerc& proj_parm)
+ {
+ int zone;
+ if (!par.es) throw proj_exception(-34);
+ par.y0 = pj_param(par.params, "bsouth").i ? 10000000. : 0.;
+ par.x0 = 500000.;
+ if (pj_param(par.params, "tzone").i) /* zone input ? */
+ if ((zone = pj_param(par.params, "izone").i) > 0 && zone <= 60)
+ --zone;
+ else
+ throw proj_exception(-35);
+ else /* nearest central meridian input */
+ if ((zone = int_floor((adjlon(par.lam0) + PI) * 30. / PI)) < 0)
+ zone = 0;
+ else if (zone >= 60)
+ zone = 59;
+ par.lam0 = (zone + .5) * PI / 30. - PI;
+ par.k0 = 0.9996;
+ par.phi0 = 0.;
+ setup(par, proj_parm);
+ }
+
+ } // namespace tmerc
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Transverse Mercator projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_tmerc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct tmerc_ellipsoid : public impl::tmerc::base_tmerc_ellipsoid<LL, XY, PAR>
+ {
+ inline tmerc_ellipsoid(const PAR& par) : impl::tmerc::base_tmerc_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::tmerc::setup_tmerc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Universal Transverse Mercator (UTM) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - zone= south
+ \par Example
+ \image html ex_utm.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct utm_ellipsoid : public impl::tmerc::base_tmerc_ellipsoid<LL, XY, PAR>
+ {
+ inline utm_ellipsoid(const PAR& par) : impl::tmerc::base_tmerc_ellipsoid<LL, XY, PAR>(par)
+ {
+ impl::tmerc::setup_utm(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Transverse Mercator projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Cylindrical
+ - Spheroid
+ - Ellipsoid
+ \par Example
+ \image html ex_tmerc.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct tmerc_spheroid : public impl::tmerc::base_tmerc_spheroid<LL, XY, PAR>
+ {
+ inline tmerc_spheroid(const PAR& par) : impl::tmerc::base_tmerc_spheroid<LL, XY, PAR>(par)
+ {
+ impl::tmerc::setup_tmerc(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class tmerc_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ if (par.es)
+ return new base_v_fi<tmerc_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ else
+ return new base_v_fi<tmerc_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class utm_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<utm_ellipsoid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void tmerc_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("tmerc", new tmerc_entry<LL, XY, PAR>);
+ factory.add_to_factory("utm", new utm_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ // Create EPSG specializations
+ // (Proof of Concept, only for some)
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2000, LLR, XY, PAR>
+ {
+ typedef tmerc_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2001, LLR, XY, PAR>
+ {
+ typedef tmerc_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2002, LLR, XY, PAR>
+ {
+ typedef tmerc_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=725,685,536,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2003, LLR, XY, PAR>
+ {
+ typedef tmerc_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<2039, LLR, XY, PAR>
+ {
+ typedef tmerc_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +towgs84=-48,55,52,0,0,0,0 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<29118, LLR, XY, PAR>
+ {
+ typedef utm_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=utm +zone=18 +ellps=GRS67 +units=m";
+ }
+ };
+
+
+ template<typename LLR, typename XY, typename PAR>
+ struct epsg_traits<29119, LLR, XY, PAR>
+ {
+ typedef utm_ellipsoid<LLR, XY, PAR> type;
+ static inline std::string par()
+ {
+ return "+proj=utm +zone=19 +ellps=GRS67 +units=m";
+ }
+ };
+
+
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_TMERC_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/tpeqd.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/tpeqd.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,198 @@
+#ifndef _PROJECTIONS_TPEQD_HPP
+#define _PROJECTIONS_TPEQD_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace tpeqd
+ {
+
+ struct par_tpeqd
+ {
+ double cp1, sp1, cp2, sp2, ccs, cs, sc, r2z0, z02, dlam2;
+ double hz0, thz0, rhshz0, ca, sa, lp, lamc;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_tpeqd_spheroid : public base_t_fi<base_tpeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_tpeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_tpeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_tpeqd m_proj_parm;
+
+ inline base_tpeqd_spheroid(const PAR& par)
+ : base_t_fi<base_tpeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double t, z1, z2, dl1, dl2, sp, cp;
+
+ sp = sin(lp_lat);
+ cp = cos(lp_lat);
+ z1 = aacos(this->m_proj_parm.sp1 * sp + this->m_proj_parm.cp1 * cp * cos(dl1 = lp_lon + this->m_proj_parm.dlam2));
+ z2 = aacos(this->m_proj_parm.sp2 * sp + this->m_proj_parm.cp2 * cp * cos(dl2 = lp_lon - this->m_proj_parm.dlam2));
+ z1 *= z1;
+ z2 *= z2;
+ xy_x = this->m_proj_parm.r2z0 * (t = z1 - z2);
+ t = this->m_proj_parm.z02 - t;
+ xy_y = this->m_proj_parm.r2z0 * asqrt(4. * this->m_proj_parm.z02 * z2 - t * t);
+ if ((this->m_proj_parm.ccs * sp - cp * (this->m_proj_parm.cs * sin(dl1) - this->m_proj_parm.sc * sin(dl2))) < 0.)
+ xy_y = -xy_y;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double cz1, cz2, s, d, cp, sp;
+
+ cz1 = cos(hypot(xy_y, xy_x + this->m_proj_parm.hz0));
+ cz2 = cos(hypot(xy_y, xy_x - this->m_proj_parm.hz0));
+ s = cz1 + cz2;
+ d = cz1 - cz2;
+ lp_lon = - atan2(d, (s * this->m_proj_parm.thz0));
+ lp_lat = aacos(hypot(this->m_proj_parm.thz0 * s, d) * this->m_proj_parm.rhshz0);
+ if ( xy_y < 0. )
+ lp_lat = - lp_lat;
+ /* lam--phi now in system relative to P1--P2 base equator */
+ sp = sin(lp_lat);
+ cp = cos(lp_lat);
+ lp_lat = aasin(this->m_proj_parm.sa * sp + this->m_proj_parm.ca * cp * (s = cos(lp_lon -= this->m_proj_parm.lp)));
+ lp_lon = atan2(cp * sin(lp_lon), this->m_proj_parm.sa * cp * s - this->m_proj_parm.ca * sp) + this->m_proj_parm.lamc;
+ }
+ };
+
+ // Two Point Equidistant
+ template <typename PAR>
+ void setup_tpeqd(PAR& par, par_tpeqd& proj_parm)
+ {
+ double lam_1, lam_2, phi_1, phi_2, A12, pp;
+ /* get control point locations */
+ phi_1 = pj_param(par.params, "rlat_1").f;
+ lam_1 = pj_param(par.params, "rlon_1").f;
+ phi_2 = pj_param(par.params, "rlat_2").f;
+ lam_2 = pj_param(par.params, "rlon_2").f;
+ if (phi_1 == phi_2 && lam_1 == lam_2) throw proj_exception(-25);
+ par.lam0 = adjlon(0.5 * (lam_1 + lam_2));
+ proj_parm.dlam2 = adjlon(lam_2 - lam_1);
+ proj_parm.cp1 = cos(phi_1);
+ proj_parm.cp2 = cos(phi_2);
+ proj_parm.sp1 = sin(phi_1);
+ proj_parm.sp2 = sin(phi_2);
+ proj_parm.cs = proj_parm.cp1 * proj_parm.sp2;
+ proj_parm.sc = proj_parm.sp1 * proj_parm.cp2;
+ proj_parm.ccs = proj_parm.cp1 * proj_parm.cp2 * sin(proj_parm.dlam2);
+ proj_parm.z02 = aacos(proj_parm.sp1 * proj_parm.sp2 + proj_parm.cp1 * proj_parm.cp2 * cos(proj_parm.dlam2));
+ proj_parm.hz0 = .5 * proj_parm.z02;
+ A12 = atan2(proj_parm.cp2 * sin(proj_parm.dlam2),
+ proj_parm.cp1 * proj_parm.sp2 - proj_parm.sp1 * proj_parm.cp2 * cos(proj_parm.dlam2));
+ proj_parm.ca = cos(pp = aasin(proj_parm.cp1 * sin(A12)));
+ proj_parm.sa = sin(pp);
+ proj_parm.lp = adjlon(atan2(proj_parm.cp1 * cos(A12), proj_parm.sp1) - proj_parm.hz0);
+ proj_parm.dlam2 *= .5;
+ proj_parm.lamc = HALFPI - atan2(sin(A12) * proj_parm.sp1, cos(A12)) - proj_parm.dlam2;
+ proj_parm.thz0 = tan(proj_parm.hz0);
+ proj_parm.rhshz0 = .5 / sin(proj_parm.hz0);
+ proj_parm.r2z0 = 0.5 / proj_parm.z02;
+ proj_parm.z02 *= proj_parm.z02;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ par.es = 0.;
+ }
+
+ } // namespace tpeqd
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Two Point Equidistant projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - lat_1= lon_1= lat_2= lon_2=
+ \par Example
+ \image html ex_tpeqd.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct tpeqd_spheroid : public impl::tpeqd::base_tpeqd_spheroid<LL, XY, PAR>
+ {
+ inline tpeqd_spheroid(const PAR& par) : impl::tpeqd::base_tpeqd_spheroid<LL, XY, PAR>(par)
+ {
+ impl::tpeqd::setup_tpeqd(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class tpeqd_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<tpeqd_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void tpeqd_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("tpeqd", new tpeqd_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_TPEQD_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/urm5.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/urm5.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,149 @@
+#ifndef _PROJECTIONS_URM5_HPP
+#define _PROJECTIONS_URM5_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace urm5
+ {
+
+ struct par_urm5
+ {
+ double m, rmn, q3, n;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_urm5_spheroid : public base_t_f<base_urm5_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_urm5_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_urm5_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_urm5 m_proj_parm;
+
+ inline base_urm5_spheroid(const PAR& par)
+ : base_t_f<base_urm5_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double t;
+
+ t = lp_lat = aasin(this->m_proj_parm.n * sin(lp_lat));
+ xy_x = this->m_proj_parm.m * lp_lon * cos(lp_lat);
+ t *= t;
+ xy_y = lp_lat * (1. + t * this->m_proj_parm.q3) * this->m_proj_parm.rmn;
+ }
+ };
+
+ // Urmaev V
+ template <typename PAR>
+ void setup_urm5(PAR& par, par_urm5& proj_parm)
+ {
+ double alpha, t;
+ proj_parm.n = pj_param(par.params, "dn").f;
+ proj_parm.q3 = pj_param(par.params, "dq").f / 3.;
+ alpha = pj_param(par.params, "ralpha").f;
+ t = proj_parm.n * sin(alpha);
+ proj_parm.m = cos(alpha) / sqrt(1. - t * t);
+ proj_parm.rmn = 1. / (proj_parm.m * proj_parm.n);
+ par.es = 0.;
+ // par.inv = 0;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace urm5
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Urmaev V projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - n= q= alphi=
+ \par Example
+ \image html ex_urm5.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct urm5_spheroid : public impl::urm5::base_urm5_spheroid<LL, XY, PAR>
+ {
+ inline urm5_spheroid(const PAR& par) : impl::urm5::base_urm5_spheroid<LL, XY, PAR>(par)
+ {
+ impl::urm5::setup_urm5(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class urm5_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<urm5_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void urm5_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("urm5", new urm5_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_URM5_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/urmfps.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/urmfps.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,202 @@
+#ifndef _PROJECTIONS_URMFPS_HPP
+#define _PROJECTIONS_URMFPS_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace urmfps
+ {
+ static const double C_x = 0.8773826753;
+ static const double Cy = 1.139753528477;
+
+ struct par_urmfps
+ {
+ double n, C_y;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_urmfps_spheroid : public base_t_fi<base_urmfps_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_urmfps_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_urmfps_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_urmfps m_proj_parm;
+
+ inline base_urmfps_spheroid(const PAR& par)
+ : base_t_fi<base_urmfps_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ lp_lat = aasin(this->m_proj_parm.n * sin(lp_lat));
+ xy_x = C_x * lp_lon * cos(lp_lat);
+ xy_y = this->m_proj_parm.C_y * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ xy_y /= this->m_proj_parm.C_y;
+ lp_lat = aasin(sin(xy_y) / this->m_proj_parm.n);
+ lp_lon = xy_x / (C_x * cos(xy_y));
+ }
+ };
+
+ template <typename PAR>
+ void setup(PAR& par, par_urmfps& proj_parm)
+ {
+ proj_parm.C_y = Cy / proj_parm.n;
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+
+ // Urmaev Flat-Polar Sinusoidal
+ template <typename PAR>
+ void setup_urmfps(PAR& par, par_urmfps& proj_parm)
+ {
+ if (pj_param(par.params, "tn").i) {
+ proj_parm.n = pj_param(par.params, "dn").f;
+ if (proj_parm.n <= 0. || proj_parm.n > 1.)
+ throw proj_exception(-40);
+ } else
+ throw proj_exception(-40);
+ setup(par, proj_parm);
+ }
+
+ // Wagner I (Kavraisky VI)
+ template <typename PAR>
+ void setup_wag1(PAR& par, par_urmfps& proj_parm)
+ {
+ proj_parm.n = 0.8660254037844386467637231707;
+ setup(par, proj_parm);
+ }
+
+ } // namespace urmfps
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Urmaev Flat-Polar Sinusoidal projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - n=
+ \par Example
+ \image html ex_urmfps.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct urmfps_spheroid : public impl::urmfps::base_urmfps_spheroid<LL, XY, PAR>
+ {
+ inline urmfps_spheroid(const PAR& par) : impl::urmfps::base_urmfps_spheroid<LL, XY, PAR>(par)
+ {
+ impl::urmfps::setup_urmfps(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief Wagner I (Kavraisky VI) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_wag1.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wag1_spheroid : public impl::urmfps::base_urmfps_spheroid<LL, XY, PAR>
+ {
+ inline wag1_spheroid(const PAR& par) : impl::urmfps::base_urmfps_spheroid<LL, XY, PAR>(par)
+ {
+ impl::urmfps::setup_wag1(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class urmfps_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<urmfps_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class wag1_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<wag1_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void urmfps_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("urmfps", new urmfps_entry<LL, XY, PAR>);
+ factory.add_to_factory("wag1", new wag1_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_URMFPS_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/vandg.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/vandg.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,201 @@
+#ifndef _PROJECTIONS_VANDG_HPP
+#define _PROJECTIONS_VANDG_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace vandg
+ {
+ static const double TOL = 1.e-10;
+ static const double THIRD = .33333333333333333333;
+ static const double TWO_THRD = .66666666666666666666;
+ static const double C2_27 = .07407407407407407407;
+ static const double PI4_3 = 4.18879020478639098458;
+ static const double PISQ = 9.86960440108935861869;
+ static const double TPISQ = 19.73920880217871723738;
+ static const double HPISQ = 4.93480220054467930934;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_vandg_spheroid : public base_t_fi<base_vandg_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_vandg_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_vandg_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_vandg_spheroid(const PAR& par)
+ : base_t_fi<base_vandg_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double al, al2, g, g2, p2;
+
+ p2 = fabs(lp_lat / HALFPI);
+ if ((p2 - TOL) > 1.) throw proj_exception();;
+ if (p2 > 1.)
+ p2 = 1.;
+ if (fabs(lp_lat) <= TOL) {
+ xy_x = lp_lon;
+ xy_y = 0.;
+ } else if (fabs(lp_lon) <= TOL || fabs(p2 - 1.) < TOL) {
+ xy_x = 0.;
+ xy_y = PI * tan(.5 * asin(p2));
+ if (lp_lat < 0.) xy_y = -xy_y;
+ } else {
+ al = .5 * fabs(PI / lp_lon - lp_lon / PI);
+ al2 = al * al;
+ g = sqrt(1. - p2 * p2);
+ g = g / (p2 + g - 1.);
+ g2 = g * g;
+ p2 = g * (2. / p2 - 1.);
+ p2 = p2 * p2;
+ xy_x = g - p2; g = p2 + al2;
+ xy_x = PI * (al * xy_x + sqrt(al2 * xy_x * xy_x - g * (g2 - p2))) / g;
+ if (lp_lon < 0.) xy_x = -xy_x;
+ xy_y = fabs(xy_x / PI);
+ xy_y = 1. - xy_y * (xy_y + 2. * al);
+ if (xy_y < -TOL) throw proj_exception();;
+ if (xy_y < 0.) xy_y = 0.;
+ else xy_y = sqrt(xy_y) * (lp_lat < 0. ? -PI : PI);
+ }
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ double t, c0, c1, c2, c3, al, r2, r, m, d, ay, x2, y2;
+
+ x2 = xy_x * xy_x;
+ if ((ay = fabs(xy_y)) < TOL) {
+ lp_lat = 0.;
+ t = x2 * x2 + TPISQ * (x2 + HPISQ);
+ lp_lon = fabs(xy_x) <= TOL ? 0. :
+ .5 * (x2 - PISQ + sqrt(t)) / xy_x;
+ return;
+ }
+ y2 = xy_y * xy_y;
+ r = x2 + y2; r2 = r * r;
+ c1 = - PI * ay * (r + PISQ);
+ c3 = r2 + TWOPI * (ay * r + PI * (y2 + PI * (ay + HALFPI)));
+ c2 = c1 + PISQ * (r - 3. * y2);
+ c0 = PI * ay;
+ c2 /= c3;
+ al = c1 / c3 - THIRD * c2 * c2;
+ m = 2. * sqrt(-THIRD * al);
+ d = C2_27 * c2 * c2 * c2 + (c0 * c0 - THIRD * c2 * c1) / c3;
+ if (((t = fabs(d = 3. * d / (al * m))) - TOL) <= 1.) {
+ d = t > 1. ? (d > 0. ? 0. : PI) : acos(d);
+ lp_lat = PI * (m * cos(d * THIRD + PI4_3) - THIRD * c2);
+ if (xy_y < 0.) lp_lat = -lp_lat;
+ t = r2 + TPISQ * (x2 - y2 + HPISQ);
+ lp_lon = fabs(xy_x) <= TOL ? 0. :
+ .5 * (r - PISQ + (t <= 0. ? 0. : sqrt(t))) / xy_x;
+ } else
+ throw proj_exception();;
+ }
+ };
+
+ // van der Grinten (I)
+ template <typename PAR>
+ void setup_vandg(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace vandg
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief van der Grinten (I) projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ \par Example
+ \image html ex_vandg.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct vandg_spheroid : public impl::vandg::base_vandg_spheroid<LL, XY, PAR>
+ {
+ inline vandg_spheroid(const PAR& par) : impl::vandg::base_vandg_spheroid<LL, XY, PAR>(par)
+ {
+ impl::vandg::setup_vandg(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class vandg_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<vandg_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void vandg_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("vandg", new vandg_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_VANDG_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/vandg2.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/vandg2.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,205 @@
+#ifndef _PROJECTIONS_VANDG2_HPP
+#define _PROJECTIONS_VANDG2_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace vandg2
+ {
+ static const double TOL = 1e-10;
+ static const double TWORPI = 0.63661977236758134308;
+
+ struct par_vandg2
+ {
+ int vdg3;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_vandg2_spheroid : public base_t_f<base_vandg2_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_vandg2_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_vandg2_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_vandg2 m_proj_parm;
+
+ inline base_vandg2_spheroid(const PAR& par)
+ : base_t_f<base_vandg2_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double x1, at, bt, ct;
+
+ bt = fabs(TWORPI * lp_lat);
+ if ((ct = 1. - bt * bt) < 0.)
+ ct = 0.;
+ else
+ ct = sqrt(ct);
+ if (fabs(lp_lon) < TOL) {
+ xy_x = 0.;
+ xy_y = PI * (lp_lat < 0. ? -bt : bt) / (1. + ct);
+ } else {
+ at = 0.5 * fabs(PI / lp_lon - lp_lon / PI);
+ if (this->m_proj_parm.vdg3) {
+ x1 = bt / (1. + ct);
+ xy_x = PI * (sqrt(at * at + 1. - x1 * x1) - at);
+ xy_y = PI * x1;
+ } else {
+ x1 = (ct * sqrt(1. + at * at) - at * ct * ct) /
+ (1. + at * at * bt * bt);
+ xy_x = PI * x1;
+ xy_y = PI * sqrt(1. - x1 * (x1 + 2. * at) + TOL);
+ }
+ if ( lp_lon < 0.) xy_x = -xy_x;
+ if ( lp_lat < 0.) xy_y = -xy_y;
+ }
+ }
+ };
+
+ // van der Grinten II
+ template <typename PAR>
+ void setup_vandg2(PAR& par, par_vandg2& proj_parm)
+ {
+ proj_parm.vdg3 = 0;
+ // par.inv = 0;
+ // par.fwd = s_forward;
+ }
+
+ // van der Grinten III
+ template <typename PAR>
+ void setup_vandg3(PAR& par, par_vandg2& proj_parm)
+ {
+ proj_parm.vdg3 = 1;
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace vandg2
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief van der Grinten II projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_vandg2.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct vandg2_spheroid : public impl::vandg2::base_vandg2_spheroid<LL, XY, PAR>
+ {
+ inline vandg2_spheroid(const PAR& par) : impl::vandg2::base_vandg2_spheroid<LL, XY, PAR>(par)
+ {
+ impl::vandg2::setup_vandg2(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ /*!
+ \brief van der Grinten III projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_vandg3.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct vandg3_spheroid : public impl::vandg2::base_vandg2_spheroid<LL, XY, PAR>
+ {
+ inline vandg3_spheroid(const PAR& par) : impl::vandg2::base_vandg2_spheroid<LL, XY, PAR>(par)
+ {
+ impl::vandg2::setup_vandg3(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class vandg2_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<vandg2_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ class vandg3_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<vandg3_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void vandg2_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("vandg2", new vandg2_entry<LL, XY, PAR>);
+ factory.add_to_factory("vandg3", new vandg3_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_VANDG2_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/vandg4.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/vandg4.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,163 @@
+#ifndef _PROJECTIONS_VANDG4_HPP
+#define _PROJECTIONS_VANDG4_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace vandg4
+ {
+ static const double TOL = 1e-10;
+ static const double TWORPI = 0.63661977236758134308;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_vandg4_spheroid : public base_t_f<base_vandg4_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_vandg4_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_vandg4_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_vandg4_spheroid(const PAR& par)
+ : base_t_f<base_vandg4_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double x1, t, bt, ct, ft, bt2, ct2, dt, dt2;
+
+ if (fabs(lp_lat) < TOL) {
+ xy_x = lp_lon;
+ xy_y = 0.;
+ } else if (fabs(lp_lon) < TOL || fabs(fabs(lp_lat) - HALFPI) < TOL) {
+ xy_x = 0.;
+ xy_y = lp_lat;
+ } else {
+ bt = fabs(TWORPI * lp_lat);
+ bt2 = bt * bt;
+ ct = 0.5 * (bt * (8. - bt * (2. + bt2)) - 5.)
+ / (bt2 * (bt - 1.));
+ ct2 = ct * ct;
+ dt = TWORPI * lp_lon;
+ dt = dt + 1. / dt;
+ dt = sqrt(dt * dt - 4.);
+ if ((fabs(lp_lon) - HALFPI) < 0.) dt = -dt;
+ dt2 = dt * dt;
+ x1 = bt + ct; x1 *= x1;
+ t = bt + 3.*ct;
+ ft = x1 * (bt2 + ct2 * dt2 - 1.) + (1.-bt2) * (
+ bt2 * (t * t + 4. * ct2) +
+ ct2 * (12. * bt * ct + 4. * ct2) );
+ x1 = (dt*(x1 + ct2 - 1.) + 2.*sqrt(ft)) /
+ (4.* x1 + dt2);
+ xy_x = HALFPI * x1;
+ xy_y = HALFPI * sqrt(1. + dt * fabs(x1) - x1 * x1);
+ if (lp_lon < 0.) xy_x = -xy_x;
+ if (lp_lat < 0.) xy_y = -xy_y;
+ }
+ }
+ };
+
+ // van der Grinten IV
+ template <typename PAR>
+ void setup_vandg4(PAR& par)
+ {
+ par.es = 0.;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace vandg4
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief van der Grinten IV projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_vandg4.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct vandg4_spheroid : public impl::vandg4::base_vandg4_spheroid<LL, XY, PAR>
+ {
+ inline vandg4_spheroid(const PAR& par) : impl::vandg4::base_vandg4_spheroid<LL, XY, PAR>(par)
+ {
+ impl::vandg4::setup_vandg4(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class vandg4_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<vandg4_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void vandg4_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("vandg4", new vandg4_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_VANDG4_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/wag2.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/wag2.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,144 @@
+#ifndef _PROJECTIONS_WAG2_HPP
+#define _PROJECTIONS_WAG2_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace wag2
+ {
+ static const double C_x = 0.92483;
+ static const double C_y = 1.38725;
+ static const double C_p1 = 0.88022;
+ static const double C_p2 = 0.88550;
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_wag2_spheroid : public base_t_fi<base_wag2_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_wag2_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_wag2_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_wag2_spheroid(const PAR& par)
+ : base_t_fi<base_wag2_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ lp_lat = aasin(C_p1 * sin(C_p2 * lp_lat));
+ xy_x = C_x * lp_lon * cos(lp_lat);
+ xy_y = C_y * lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y / C_y;
+ lp_lon = xy_x / (C_x * cos(lp_lat));
+ lp_lat = aasin(sin(lp_lat) / C_p1) / C_p2;
+ }
+ };
+
+ // Wagner II
+ template <typename PAR>
+ void setup_wag2(PAR& par)
+ {
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace wag2
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Wagner II projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ \par Example
+ \image html ex_wag2.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wag2_spheroid : public impl::wag2::base_wag2_spheroid<LL, XY, PAR>
+ {
+ inline wag2_spheroid(const PAR& par) : impl::wag2::base_wag2_spheroid<LL, XY, PAR>(par)
+ {
+ impl::wag2::setup_wag2(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class wag2_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<wag2_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void wag2_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("wag2", new wag2_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_WAG2_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/wag3.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/wag3.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,148 @@
+#ifndef _PROJECTIONS_WAG3_HPP
+#define _PROJECTIONS_WAG3_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace wag3
+ {
+ static const double TWOTHIRD = 0.6666666666666666666667;
+
+ struct par_wag3
+ {
+ double C_x;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_wag3_spheroid : public base_t_fi<base_wag3_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_wag3_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_wag3_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_wag3 m_proj_parm;
+
+ inline base_wag3_spheroid(const PAR& par)
+ : base_t_fi<base_wag3_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = this->m_proj_parm.C_x * lp_lon * cos(TWOTHIRD * lp_lat);
+ xy_y = lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y;
+ lp_lon = xy_x / (this->m_proj_parm.C_x * cos(TWOTHIRD * lp_lat));
+ }
+ };
+
+ // Wagner III
+ template <typename PAR>
+ void setup_wag3(PAR& par, par_wag3& proj_parm)
+ {
+ double ts;
+ ts = pj_param(par.params, "rlat_ts").f;
+ proj_parm.C_x = cos(ts) / cos(2.*ts/3.);
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace wag3
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Wagner III projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - lat_ts=
+ \par Example
+ \image html ex_wag3.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wag3_spheroid : public impl::wag3::base_wag3_spheroid<LL, XY, PAR>
+ {
+ inline wag3_spheroid(const PAR& par) : impl::wag3::base_wag3_spheroid<LL, XY, PAR>(par)
+ {
+ impl::wag3::setup_wag3(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class wag3_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<wag3_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void wag3_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("wag3", new wag3_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_WAG3_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/wag7.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/wag7.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,137 @@
+#ifndef _PROJECTIONS_WAG7_HPP
+#define _PROJECTIONS_WAG7_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace wag7
+ {
+
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_wag7_spheroid : public base_t_f<base_wag7_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_wag7_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_wag7_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+
+ inline base_wag7_spheroid(const PAR& par)
+ : base_t_f<base_wag7_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double theta, ct, D;
+
+ theta = asin(xy_y = 0.90630778703664996 * sin(lp_lat));
+ xy_x = 2.66723 * (ct = cos(theta)) * sin(lp_lon /= 3.);
+ xy_y *= 1.24104 * (D = 1/(sqrt(0.5 * (1 + ct * cos(lp_lon)))));
+ xy_x *= D;
+ }
+ };
+
+ // Wagner VII
+ template <typename PAR>
+ void setup_wag7(PAR& par)
+ {
+ // par.fwd = s_forward;
+ // par.inv = 0;
+ par.es = 0.;
+ }
+
+ } // namespace wag7
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Wagner VII projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Miscellaneous
+ - Spheroid
+ - no inverse
+ \par Example
+ \image html ex_wag7.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wag7_spheroid : public impl::wag7::base_wag7_spheroid<LL, XY, PAR>
+ {
+ inline wag7_spheroid(const PAR& par) : impl::wag7::base_wag7_spheroid<LL, XY, PAR>(par)
+ {
+ impl::wag7::setup_wag7(this->m_par);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class wag7_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<wag7_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void wag7_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("wag7", new wag7_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_WAG7_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/wink1.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/wink1.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,145 @@
+#ifndef _PROJECTIONS_WINK1_HPP
+#define _PROJECTIONS_WINK1_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace wink1
+ {
+
+ struct par_wink1
+ {
+ double cosphi1;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_wink1_spheroid : public base_t_fi<base_wink1_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_fi<base_wink1_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_fi<base_wink1_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_wink1 m_proj_parm;
+
+ inline base_wink1_spheroid(const PAR& par)
+ : base_t_fi<base_wink1_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ xy_x = .5 * lp_lon * (this->m_proj_parm.cosphi1 + cos(lp_lat));
+ xy_y = lp_lat;
+ }
+
+ inline void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const
+ {
+ lp_lat = xy_y;
+ lp_lon = 2. * xy_x / (this->m_proj_parm.cosphi1 + cos(lp_lat));
+ }
+ };
+
+ // Winkel I
+ template <typename PAR>
+ void setup_wink1(PAR& par, par_wink1& proj_parm)
+ {
+ proj_parm.cosphi1 = cos(pj_param(par.params, "rlat_ts").f);
+ par.es = 0.;
+ // par.inv = s_inverse;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace wink1
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Winkel I projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - lat_ts=
+ \par Example
+ \image html ex_wink1.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wink1_spheroid : public impl::wink1::base_wink1_spheroid<LL, XY, PAR>
+ {
+ inline wink1_spheroid(const PAR& par) : impl::wink1::base_wink1_spheroid<LL, XY, PAR>(par)
+ {
+ impl::wink1::setup_wink1(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class wink1_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_fi<wink1_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void wink1_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("wink1", new wink1_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_WINK1_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/proj/wink2.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/proj/wink2.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,159 @@
+#ifndef _PROJECTIONS_WINK2_HPP
+#define _PROJECTIONS_WINK2_HPP
+
+// Generic Geometry Library - projections (based on PROJ4)
+// This file is automatically generated. DO NOT EDIT.
+
+// Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande (2008-2009)
+// 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 file is converted from PROJ4, http://trac.osgeo.org/proj
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <geometry/projections/impl/base_static.hpp>
+#include <geometry/projections/impl/base_dynamic.hpp>
+#include <geometry/projections/impl/projects.hpp>
+#include <geometry/projections/impl/factory_entry.hpp>
+
+namespace projection
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace wink2
+ {
+ static const int MAX_ITER = 10;
+ static const double LOOP_TOL = 1e-7;
+ static const double TWO_D_PI = 0.636619772367581343;
+
+ struct par_wink2
+ {
+ double cosphi1;
+ };
+
+ // template class, using CRTP to implement forward/inverse
+ template <typename LL, typename XY, typename PAR>
+ struct base_wink2_spheroid : public base_t_f<base_wink2_spheroid<LL, XY, PAR>, LL, XY, PAR>
+ {
+
+ typedef typename base_t_f<base_wink2_spheroid<LL, XY, PAR>, LL, XY, PAR>::LL_T LL_T;
+ typedef typename base_t_f<base_wink2_spheroid<LL, XY, PAR>, LL, XY, PAR>::XY_T XY_T;
+
+ par_wink2 m_proj_parm;
+
+ inline base_wink2_spheroid(const PAR& par)
+ : base_t_f<base_wink2_spheroid<LL, XY, PAR>, LL, XY, PAR>(*this, par) {}
+
+ inline void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const
+ {
+ double k, V;
+ int i;
+
+ xy_y = lp_lat * TWO_D_PI;
+ k = PI * sin(lp_lat);
+ lp_lat *= 1.8;
+ for (i = MAX_ITER; i ; --i) {
+ lp_lat -= V = (lp_lat + sin(lp_lat) - k) /
+ (1. + cos(lp_lat));
+ if (fabs(V) < LOOP_TOL)
+ break;
+ }
+ if (!i)
+ lp_lat = (lp_lat < 0.) ? -HALFPI : HALFPI;
+ else
+ lp_lat *= 0.5;
+ xy_x = 0.5 * lp_lon * (cos(lp_lat) + this->m_proj_parm.cosphi1);
+ xy_y = FORTPI * (sin(lp_lat) + xy_y);
+ }
+ };
+
+ // Winkel II
+ template <typename PAR>
+ void setup_wink2(PAR& par, par_wink2& proj_parm)
+ {
+ proj_parm.cosphi1 = cos(pj_param(par.params, "rlat_1").f);
+ par.es = 0.;
+ // par.inv = 0;
+ // par.fwd = s_forward;
+ }
+
+ } // namespace wink2
+ } //namespaces impl
+ #endif // doxygen
+
+ /*!
+ \brief Winkel II projection
+ \ingroup projections
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ \tparam PAR parameter type
+ \par Projection characteristics
+ - Pseudocylindrical
+ - Spheroid
+ - no inverse
+ - lat_1=
+ \par Example
+ \image html ex_wink2.gif
+ */
+ template <typename LL, typename XY, typename PAR = parameters>
+ struct wink2_spheroid : public impl::wink2::base_wink2_spheroid<LL, XY, PAR>
+ {
+ inline wink2_spheroid(const PAR& par) : impl::wink2::base_wink2_spheroid<LL, XY, PAR>(par)
+ {
+ impl::wink2::setup_wink2(this->m_par, this->m_proj_parm);
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ // Factory entry(s)
+ template <typename LL, typename XY, typename PAR>
+ class wink2_entry : public impl::factory_entry<LL, XY, PAR>
+ {
+ public :
+ virtual projection<LL, XY>* create_new(const PAR& par) const
+ {
+ return new base_v_f<wink2_spheroid<LL, XY, PAR>, LL, XY, PAR>(par);
+ }
+ };
+
+ template <typename LL, typename XY, typename PAR>
+ inline void wink2_init(impl::base_factory<LL, XY, PAR>& factory)
+ {
+ factory.add_to_factory("wink2", new wink2_entry<LL, XY, PAR>);
+ }
+
+ } // namespace impl
+ #endif // doxygen
+
+}
+
+#endif // _PROJECTIONS_WINK2_HPP
+

Added: sandbox/ggl/boost/ggl/geometry/projections/project_transformer.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/project_transformer.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,53 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_PROJECT_TRANSFORMER_HPP
+#define _GEOMETRY_STRATEGY_PROJECT_TRANSFORMER_HPP
+
+
+#include <geometry/projections/factory.hpp>
+#include <geometry/projections/parameters.hpp>
+
+#include <boost/shared_ptr.hpp>
+
+
+namespace projection
+{
+ /*!
+ \brief Transformation strategy to do transform using a Map Projection
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename LL, typename XY>
+ struct project_transformer
+ {
+ typedef projection<LL, XY> PRJ;
+
+ boost::shared_ptr<PRJ> m_prj;
+
+ inline project_transformer(PRJ* prj)
+ : m_prj(prj)
+ {}
+
+ inline project_transformer(const std::string& par)
+ {
+ factory<LL, XY, parameters> fac;
+ m_prj.reset(fac.create_new(init(par)));
+ }
+
+ inline bool operator()(const LL& p1, XY& p2) const
+ {
+ return m_prj->forward(p1, p2);
+ }
+
+ };
+}
+
+
+#endif // _GEOMETRY_STRATEGY_PROJECT_TRANSFORMER_HPP

Added: sandbox/ggl/boost/ggl/geometry/projections/projection.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/projections/projection.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,62 @@
+#ifndef _PROJECTIONS_PROJECTION_HPP
+#define _PROJECTIONS_PROJECTION_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 <string>
+
+
+namespace projection
+{
+
+ /*!
+ \brief projection virtual base class
+ \details class containing virtual methods
+ \ingroup projection
+ \tparam LL latlong point type
+ \tparam XY xy point type
+ */
+
+ template <typename LL, typename XY>
+ class projection
+ {
+ protected :
+ // see comment above
+ //typedef typename geometry::coordinate_type<LL>::type LL_T;
+ //typedef typename geometry::coordinate_type<XY>::type XY_T;
+ typedef double LL_T;
+ typedef double XY_T;
+
+ public :
+ /// Forward projection, from Latitude-Longitude to Cartesian
+ virtual bool forward(const LL& lp, XY& xy) const = 0;
+
+ /// Inverse projection, from Cartesian to Latitude-Longitude
+ virtual bool inverse(const XY& xy, LL& lp) const = 0;
+
+ /// Forward projection using lon / lat and x / y separately
+ virtual void fwd(LL_T& lp_lon, LL_T& lp_lat, XY_T& xy_x, XY_T& xy_y) const = 0;
+
+ /// Inverse projection using x / y and lon / lat
+ virtual void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const = 0;
+
+ /// Returns name of projection
+ virtual std::string name() const = 0;
+
+ virtual ~projection() {}
+
+ };
+
+}
+
+
+
+#endif
+

Added: sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_convex_hull.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_convex_hull.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,232 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_AGNOSTIC_CONVEX_HULL_HPP
+#define _GEOMETRY_STRATEGY_AGNOSTIC_CONVEX_HULL_HPP
+
+#include <vector>
+#include <boost/range/functions.hpp>
+
+#include <geometry/core/cs.hpp>
+
+#include <geometry/strategies/strategy_traits.hpp>
+
+
+
+// Temporary, comparing tests
+#if defined(GGL_USE_SMOOTH_SORT)
+# include "SmoothSort.hpp"
+#elif defined(GGL_USE_MERGE_SORT)
+# include "MergeSort.hpp"
+#else
+
+#include <algorithm>
+
+#endif
+
+
+#include <boost/range/functions.hpp>
+
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace convex_hull
+ {
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename R, typename RIT, typename SS>
+ static inline void get_extremes(const R& range, RIT& min_it, RIT& max_it,
+ const SS& strategy)
+ {
+ min_it = boost::begin(range);
+ max_it = boost::begin(range);
+ for (RIT it = boost::begin(range) + 1; it != boost::end(range); it++)
+ {
+ if (strategy.smaller(*it, *min_it))
+ {
+ min_it = it;
+ }
+ if (strategy.larger(*it, *max_it))
+ {
+ max_it = it;
+ }
+ }
+ }
+
+
+ template <typename R>
+ static inline void sort(R& range)
+ {
+ #if defined(USE_SMOOTH_SORT)
+ smoothsort::sort(boost::begin(range), boost::end(range));
+ #elif defined(USE_MERGE_SORT)
+ comparing::merge_sort<thread_count>(boost::begin(range), boost::end(range), std::less<P>());
+ #else
+
+ std::sort(boost::begin(range), boost::end(range));
+
+ #endif
+ }
+
+ }
+ #endif
+
+
+ // Completely reworked version from this source: http://marknelson.us/2007/08/22/convex
+ template <typename P>
+ class graham
+ {
+ private :
+
+ typedef typename cs_tag<P>::type PTAG;
+ typedef typename std::vector<P> CONTAINER;
+ typedef typename std::vector<P>::const_iterator CIT;
+ typedef typename std::vector<P>::const_reverse_iterator CRIT;
+
+ CONTAINER m_lower_hull;
+ CONTAINER m_upper_hull;
+
+ public :
+ // Constructor with a range
+ template <typename R>
+ inline graham(const R& range)
+ {
+ typedef typename boost::range_const_iterator<R>::type RIT;
+
+ // Polygons with three corners, or closed with 4 points, are always convex
+ if (boost::size(range) <= 3)
+ {
+ for (RIT it = boost::begin(range); it != boost::end(range); it++)
+ {
+ m_upper_hull.push_back(*it);
+ }
+ return;
+ }
+
+ // Get min/max (in most cases left / right) points
+ RIT left_it, right_it;
+ typename strategy_compare<PTAG, P, 0>::type comparing;
+ impl::get_extremes(range, left_it, right_it, comparing);
+
+ // Bounding left/right points
+ CONTAINER upper_points;
+ CONTAINER lower_points;
+
+ typename strategy_side<PTAG, P>::type side;
+
+ // Now put the remaining points in one of the two output sequences
+ for (RIT it = boost::begin(range); it != boost::end(range); it++)
+ {
+ if (it != left_it && it != right_it)
+ {
+ int dir = side.side(*left_it, *right_it, *it);
+ if ( dir < 0 )
+ {
+ upper_points.push_back(*it);
+ }
+ else
+ {
+ lower_points.push_back(*it);
+ }
+ }
+ }
+
+ impl::sort(lower_points);
+ impl::sort(upper_points);
+
+ build_half_hull<1>(lower_points, m_lower_hull, *left_it, *right_it);
+ build_half_hull<-1>(upper_points, m_upper_hull, *left_it, *right_it);
+ }
+
+
+ template <int F>
+ inline void build_half_hull(const CONTAINER& input, CONTAINER& output,
+ const P& left, const P& right)
+ {
+ output.push_back(left);
+ for(CIT it = input.begin(); it != input.end(); it++)
+ {
+ add_to_hull<F>(*it, output);
+ }
+ add_to_hull<F>(right, output);
+ }
+
+ template <int F>
+ inline void add_to_hull(const P& p, CONTAINER& output)
+ {
+ typename strategy_side<PTAG, P>::type side;
+
+ output.push_back(p);
+ register size_t output_size = output.size();
+ while (output_size >= 3)
+ {
+ CRIT rit = output.rbegin();
+ const P& last = *rit++;
+ const P& last2 = *rit++;
+
+ if (F * side.side(*rit, last, last2) <= 0)
+ {
+ // Remove last two points from stack, and add last again
+ // This is much faster then erasing the one but last.
+ output.pop_back();
+ output.pop_back();
+ output.push_back(last);
+ output_size--;
+ }
+ else
+ {
+ return;
+ }
+ }
+ }
+
+
+ template <typename O_IT>
+ inline void get(O_IT out)
+ {
+ for (CIT it = m_upper_hull.begin(); it != m_upper_hull.end(); it++, out++)
+ {
+ *out = *it;
+ }
+
+ // STL Port does not accept iterating from rbegin+1 to rend
+ size_t size = m_lower_hull.size();
+ if (size > 0)
+ {
+ CRIT it = m_lower_hull.rbegin() + 1;
+ for (unsigned int i = 1; i < size; i++, it++, out++)
+ {
+ *out = *it;
+ }
+ }
+ }
+ }; // graham
+
+ } // namespace convex_hull
+ } // namespace strategy
+
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P>
+ struct strategy_convex_hull<cartesian_tag, P>
+ {
+ typedef strategy::convex_hull::graham<P> type;
+ };
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_AGNOSTIC_CONVEX_HULL_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_simplify.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_simplify.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,195 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_AGNOSTIC_SIMPLIFY_HPP
+#define _GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_HPP
+
+#include <boost/range/functions.hpp>
+
+#include <geometry/core/cs.hpp>
+
+
+//#define GL_DEBUG_SIMPLIFY
+
+#ifdef GL_DEBUG_SIMPLIFY
+#include <geometry/io/wkt/aswkt.hpp>
+#include <iostream>
+#endif
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace simplify
+ {
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ /*!
+ \brief Small wrapper around a point, with an extra member "included"
+ \details
+ - We could implement a complete point as well but that is not necessary
+ - We could derive from geometry::point but we need the original later on, including extra members;
+ besides that it is not necessary to copy points during the algorithm
+ \tparam the enclosed point type
+ */
+ template<typename P>
+ struct douglas_peucker_point
+ {
+ const P& p;
+ bool included;
+
+ inline douglas_peucker_point(const P& ap)
+ : p(ap)
+ , included(false)
+ {}
+
+ inline douglas_peucker_point<P> operator=(const douglas_peucker_point<P>& other)
+ {
+ return douglas_peucker_point<P>(*this);
+ }
+ };
+ }
+ #endif // DOXYGEN_NO_IMPL
+
+
+ /*!
+ \brief Implements the simplify algorithm.
+ \ingroup simplify
+ \details The douglas_peucker strategy simplifies a linestring, ring or vector of points
+ using the well-known Douglas-Peucker algorithm. For the algorithm, see for example:
+ \see http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
+ \see http://www2.dcs.hull.ac.uk/CISRG/projects/Royal-Inst/demos/dp.html
+ \tparam R boost range
+ \tparam O_IT output iterator
+ \tparam PSDS point-segment distance strategy to be used
+ \note This strategy uses itself a point-segment-distance strategy which can be specified
+ \author Barend and Maarten, 1995/1996
+ \author Barend, revised for Generic Geometry Library, 2008
+ */
+ template<typename R, typename O_IT, typename PSDS>
+ class douglas_peucker
+ {
+ typedef typename point_type<R>::type P;
+ typedef impl::douglas_peucker_point<P> DP;
+ typedef typename std::vector<DP>::iterator DIT;
+
+ typedef typename PSDS::return_type RET;
+
+ inline void consider(DIT begin, DIT end, const RET& max_dist, int& n,
+ const PSDS& ps_distance_strategy) const
+ {
+ size_t size = end - begin;
+ // size must be at least 3 here: we want to consider a candidate point between begin and end
+ if (size <= 2)
+ {
+#ifdef GL_DEBUG_SIMPLIFY
+ if (begin != end)
+ {
+ std::cout << "ignore between " << begin->p << " and " << (end - 1)->p << " size=" << size << std::endl;
+ }
+ std::cout << "return because size=" << size << std::endl;
+#endif
+ return;
+ }
+
+ DIT last = end - 1;
+
+#ifdef GL_DEBUG_SIMPLIFY
+ std::cout << "find between " << begin->p << " and " << last->p << " size=" << size << std::endl;
+#endif
+
+
+ // Find most distance point, compare to the current segment
+ geometry::segment<const P> s(begin->p, last->p);
+ RET md(-1.0); // any value < 0
+ DIT candidate;
+ for(DIT it = begin + 1; it != last; it++)
+ {
+ RET dist = ps_distance_strategy(it->p, s);
+
+#ifdef GL_DEBUG_SIMPLIFY
+ std::cout << "consider " << it->p << " at " << dist.value() << (dist.value() > max_dist.value() ? " maybe" : " no") << std::endl;
+#endif
+ if (dist > md)
+ {
+ md = dist;
+ candidate = it;
+ }
+ }
+
+ // If a point is found, set the include flag and handle segments in between recursively
+ if (md > max_dist)
+ {
+#ifdef GL_DEBUG_SIMPLIFY
+ std::cout << "use " << candidate->p << std::endl;
+#endif
+
+ candidate->included = true;
+ n++;
+
+ consider(begin, candidate + 1, max_dist, n, ps_distance_strategy);
+ consider(candidate, end, max_dist, n, ps_distance_strategy);
+ }
+ }
+
+
+ public :
+
+ typedef PSDS distance_strategy_type;
+
+ /*!
+ \brief Call simplification on an iterator pair
+ */
+ inline void simplify(const R& range, O_IT out, double max_distance) const
+ {
+ PSDS strategy;
+ // Init the output, a vector of references to all points
+
+ // Note Geometry Algorithms suggest here
+ // http://geometryalgorithms.com/Archive/algorithm_0205/algorithm_0205.htm
+ // to "STAGE 1: Vertex Reduction within max_distance of prior vertex cluster"
+ // However, that is not correct: a vertex within the specified distance might be
+ // excluded here, but might be a better candidate for final inclusion than the point before.
+
+ std::vector<DP> ref_candidates(boost::begin(range), boost::end(range));
+
+ // Include first and last point of line, they are always part of the line
+ int n = 2;
+ ref_candidates.front().included = true;
+ ref_candidates.back().included = true;
+
+ // Get points, recursively, including them if they are further away than the specified distance
+ typedef typename PSDS::return_type RET;
+
+ consider(boost::begin(ref_candidates), boost::end(ref_candidates),
+ make_distance_result<RET>(max_distance), n, strategy);
+
+ // Copy included elements to the output (might be changed using copy_if)
+ for(typename std::vector<DP>::const_iterator it = boost::begin(ref_candidates);
+ it != boost::end(ref_candidates); it++)
+ {
+ if (it->included)
+ {
+ *out = it->p;
+ out++;
+ }
+ }
+ }
+
+ };
+
+ }
+ }
+
+
+} // namespace geometry
+
+#endif // _GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_within.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/agnostic/agn_within.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,139 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_AGNOSTIC_WITHIN_HPP
+#define _GEOMETRY_STRATEGY_AGNOSTIC_WITHIN_HPP
+
+
+
+#include <geometry/geometries/segment.hpp>
+
+#include <geometry/strategies/strategy_traits.hpp>
+
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace within
+ {
+
+ /*!
+ \brief Within detection using winding rule
+ \tparam P point type of point to examine
+ \tparam PS point type of segments, defaults to P
+ \author The implementation is inspired by terralib http://www.terralib.org (LGPL)
+ and http://geometryalgorithms.com/Archive/algorithm_0103/algorithm_0103.htm
+ \note Added the horizontal case, for "completely within"
+ \note Is tested for points ON border, more tests have to be done.
+ \note More efficient (less comparisons and no divison) than the cross count algorithm
+ \note Only dependant on "side", -> agnostic, suitable for latlong
+ */
+ template<typename P, typename PS = P>
+ class winding
+ {
+ private :
+ /*! subclass to keep state */
+ struct windings
+ {
+ int count;
+ bool touches;
+ const P& p;
+ explicit windings(const P& ap)
+ : count(0)
+ , touches(false)
+ , p(ap)
+ {}
+ bool within() const
+ {
+ return ! touches && count != 0;
+ }
+ };
+
+ public :
+
+ typedef windings state_type;
+
+ inline bool operator()(const segment<const PS>& s, state_type& state) const
+ {
+ bool up = false;
+ bool down = false;
+
+ if (equals(get<0, 1>(s), get<1>(state.p)) && equals(get<0, 1>(s), get<1, 1>(s)))
+ {
+ // Horizontal case
+ if (get<0, 0>(s) <= get<0>(state.p) && get<1, 0>(s) > get<0>(state.p))
+ {
+ up = true; // "up" means from left to right here
+ }
+ else if (get<1, 0>(s) < get<0>(state.p) && get<0, 0>(s) >= get<0>(state.p))
+ {
+ down = true; // from right to left
+ }
+ }
+ else if (get<0, 1>(s) <= get<1>(state.p) && get<1, 1>(s) > get<1>(state.p))
+ {
+ up = true;
+ }
+ else if (get<1, 1>(s) < get<1>(state.p) && get<0, 1>(s) >= get<1>(state.p))
+ {
+ down = true;
+ }
+
+ if (up || down)
+ {
+ typedef typename select_coordinate_type<P, PS>::type T;
+
+ typedef typename strategy_side<typename cs_tag<P>::type, P, PS>::type SS;
+
+ T side = SS::side(s, state.p);
+
+ if (equals<T>(side, 0))
+ {
+ state.touches = true;
+ return false;
+ }
+ else if (up && side > 0)
+ {
+ state.count++;
+ }
+ else if (down && side < 0)
+ {
+ state.count--;
+ }
+ }
+ return true;
+ }
+
+ };
+
+ } // namespace within
+
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P, typename PS>
+ struct strategy_within<cartesian_tag, cartesian_tag, P, PS>
+ {
+ typedef strategy::within::winding<P, PS> type;
+ };
+
+ template <typename P, typename PS>
+ struct strategy_within<geographic_tag, geographic_tag, P, PS>
+ {
+ typedef strategy::within::winding<P, PS> type;
+ };
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_AGNOSTIC_WITHIN_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_area.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_area.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,75 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_CARTESIAN_AREA_HPP
+#define _GEOMETRY_STRATEGY_CARTESIAN_AREA_HPP
+
+
+#include <geometry/geometries/point_xy.hpp>
+#include <geometry/geometries/segment.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace area
+ {
+
+ /*!
+ \brief Strategy functor for area calculation on point_xy points
+ \details Calculates area using well-known triangulation algorithm
+ \tparam PS point type of segments
+ \par Concepts for PS:
+ - specialized point_traits class
+ */
+ template<typename PS>
+ class by_triangles
+ {
+ private :
+ struct summation
+ {
+ typedef typename coordinate_type<PS>::type T;
+ T sum;
+ inline summation() : sum(T())
+ {
+ // Currently only 2D areas are supported
+ assert_dimension<PS, 2>();
+ }
+ inline double area() const { return 0.5 * double(sum); }
+ };
+
+ public :
+ typedef summation state_type;
+
+ inline bool operator()(const segment<const PS>& s, state_type& state) const
+ {
+ // SUM += x2 * y1 - x1 * y2;
+ state.sum += get<1, 0>(s) * get<0, 1>(s)
+ - get<0, 0>(s) * get<1, 1>(s);
+ return true;
+ }
+
+ };
+
+ } // namespace area
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P>
+ struct strategy_area<cartesian_tag, P>
+ {
+ typedef strategy::area::by_triangles<P> type;
+ };
+ #endif
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_CARTESIAN_AREA_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_centroid.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_centroid.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,238 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_CARTESIAN_CENTROID_HPP
+#define _GEOMETRY_STRATEGY_CARTESIAN_CENTROID_HPP
+
+
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/geometries/point_xy.hpp>
+#include <geometry/geometries/segment.hpp>
+
+#include <geometry/algorithms/assign.hpp>
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace centroid
+ {
+ /*!
+ \brief Centroid calculation
+ \details Geolib original version,
+ \par Template parameters and concepts: see bashein_detmer
+ \author Barend and Maarten, 1995/1996
+ \author Revised for templatized library, Barend Gehrels, 2007
+ \note The results are slightly different from Bashein/Detmer, so probably slightly wrong.
+ */
+
+ template<typename PC, typename PS = PC>
+ class geolib1995
+ {
+ private :
+ typedef typename coordinate_type<PS>::type T;
+
+ /*! subclass to keep state */
+ struct sums
+ {
+ PC sum_ms, sum_m;
+
+ sums()
+ {
+ assign_point(sum_m, T());
+ assign_point(sum_ms, T());
+ }
+ void centroid(PC& point)
+ {
+ point = sum_ms;
+
+ if (get<0>(sum_m) != 0 && get<1>(sum_m) != 0)
+ {
+ multiply_value(point, 0.5);
+ divide_point(point, sum_m);
+ }
+ else
+ {
+ // exception?
+ }
+ }
+ };
+
+ public :
+ typedef sums state_type;
+ inline bool operator()(const segment<const PS>& s, state_type& state) const
+ {
+ /* Algorithm:
+ For each segment:
+ begin
+ dx = x2 - x1;
+ dy = y2 - y1;
+ sx = x2 + x1;
+ sy = y2 + y1;
+ mx = dx * sy;
+ my = sx * dy;
+
+ sum_mx += mx;
+ sum_my += my;
+ sum_msx += mx * sx;
+ sum_msy += my * sy;
+ end;
+ return POINT(0.5 * sum_msx / sum_mx, 0.5 * sum_msy / sum_my);
+ */
+
+ PS diff = s.second, sum = s.second;
+ subtract_point(diff, s.first);
+ add_point(sum, s.first);
+
+ // We might create an arithmatic operation for this.
+ PS m;
+ get<0>(m) = get<0>(diff) * get<1>(sum);
+ get<1>(m) = get<0>(sum) * get<1>(diff);
+
+ add_point(state.sum_m, m);
+ multiply_point(m, sum);
+ add_point(state.sum_ms, m);
+
+ return true;
+ }
+
+ };
+
+
+ /*!
+ \brief Centroid calculation using algorith Bashein / Detmer
+ \details Calculates centroid using triangulation method published by Bashein / Detmer
+ \tparam PC point type of centroid to calculate
+ \tparam PS point type of segments, defaults to PC
+ \par Concepts for PC and PS:
+ - specialized point_traits class
+ \author Adapted from "Centroid of a Polygon" by Gerard Bashein and Paul R. Detmer<em>,
+ in "Graphics Gems IV", Academic Press, 1994</em>
+ \par Research notes
+ The algorithm gives the same results as Oracle and PostgreSQL but differs from MySQL
+ (tried 5.0.21 / 5.0.45 / 5.0.51a / 5.1.23).
+
+ Without holes:
+ - this: POINT(4.06923 1.65056)
+ - geolib: POINT(4.07254 1.66819)
+ - MySQL: 'POINT(3.6636363636364 1.6272727272727)'
+ - PostgreSQL: "POINT(4.06923363095238 1.65055803571429)"
+ - Oracle: 4.06923363095238, 1.65055803571429
+
+ Statements:
+ - \b MySQL/PostgreSQL: select AsText(Centroid(GeomFromText('POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2
+ ,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))')))
+ - \b Oracle: select sdo_geom.sdo_centroid(sdo_geometry(2003, null, null,
+ sdo_elem_info_array(1, 1003, 1), sdo_ordinate_array(2,1.3,2.4,1.7,2.8,1.8
+ ,3.4,1.2,3.7,1.6,3.4,2,4.1,3,5.3,2.6,5.4,1.2,4.9,0.8,2.9,0.7,2,1.3))
+ , mdsys.sdo_dim_array(mdsys.sdo_dim_element('x',0,10,.00000005)
+ ,mdsys.sdo_dim_element('y',0,10,.00000005)))
+ from dual
+
+ With holes:
+ - this: POINT(4.04663 1.6349)
+ - geolib: POINT(4.04675 1.65735)
+ - MySQL: 'POINT(3.6090580503834 1.607573932092)'
+ - PostgresSQL: "POINT(4.0466265060241 1.63489959839357)"
+ - Oracle: 4.0466265060241, 1.63489959839357
+
+ Statements:
+ - \b MySQL/PostgreSQL: select AsText(Centroid(GeomFromText('POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2
+ ,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3)
+ ,(4 2,4.2 1.4,4.8 1.9,4.4 2.2,4 2))')));
+ - \b Oracle: select sdo_geom.sdo_centroid(sdo_geometry(2003, null, null
+ , sdo_elem_info_array(1, 1003, 1, 25, 2003, 1)
+ , sdo_ordinate_array(2,1.3,2.4,1.7,2.8,1.8,3.4,1.2,3.7,1.6,3.4,2,4.1,3,5.3
+ ,2.6,5.4,1.2,4.9,0.8,2.9,0.7,2,1.3,4,2, 4.2,1.4, 4.8,1.9, 4.4,2.2, 4,2))
+ , mdsys.sdo_dim_array(mdsys.sdo_dim_element('x',0,10,.00000005)
+ ,mdsys.sdo_dim_element('y',0,10,.00000005)))
+ from dual
+ */
+ template<typename PC, typename PS = PC>
+ class bashein_detmer
+ {
+ private :
+ typedef typename select_coordinate_type<PC, PS>::type T;
+
+
+ /*! subclass to keep state */
+ struct sums
+ {
+ T sum_a2;
+ PC sum;
+ sums()
+ : sum_a2(T())
+ {
+ impl::assign::assign_value(sum, T());
+ }
+
+ void centroid(PC& point)
+ {
+ typedef typename coordinate_type<PC>::type TPC;
+ point = sum;
+ if (sum_a2 != 0)
+ {
+ divide_value(point, boost::numeric_cast<TPC>(3.0 * sum_a2));
+ }
+ else
+ {
+ // exception?
+ }
+ }
+
+ };
+
+ public :
+ typedef sums state_type;
+
+ inline bool operator()(const segment<const PS>& s, state_type& state) const
+ {
+ /* Algorithm:
+ For each segment:
+ begin
+ ai = x1 * y2 - x2 * y1;
+ sum_a2 += ai;
+ sum_x += ai * (x1 + x2);
+ sum_y += ai * (y1 + y2);
+ end
+ return POINT(sum_x / (3 * sum_a2), sum_y / (3 * sum_a2) )
+ */
+
+ T ai = get<0, 0>(s) * get<1, 1>(s) - get<1, 0>(s) * get<0, 1>(s);
+ state.sum_a2 += ai;
+
+ PC p;
+ typedef typename coordinate_type<PC>::type PT;
+
+ copy_coordinates(s.first, p);
+ add_point(p, s.second);
+ multiply_value(p, boost::numeric_cast<PT>(ai));
+ add_point(state.sum, p);
+
+ return true;
+ }
+
+ };
+ } // namespace centroid
+
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P, typename PS>
+ struct strategy_centroid<cartesian_tag, P, PS>
+ {
+ typedef strategy::centroid::bashein_detmer<P, PS> type;
+ };
+ #endif
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_CARTESIAN_CENTROID_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_compare.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_compare.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,66 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_CARTESIAN_COMPARE_HPP
+#define _GEOMETRY_STRATEGY_CARTESIAN_COMPARE_HPP
+
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/access.hpp>
+
+
+#include <geometry/strategies/strategy_traits.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace compare
+ {
+
+
+ /*!
+ \brief Compare (in one direction) strategy for cartesian coordinates
+ \ingroup util
+ \tparam P point-type
+ \tparam D dimension
+ */
+ template <typename P, size_t D>
+ struct euclidian
+ {
+ static inline bool smaller(const P& p1, const P& p2)
+ {
+ return get<D>(p1) < get<D>(p2);
+ }
+
+ static inline bool larger(const P& p1, const P& p2)
+ {
+ return get<D>(p1) > get<D>(p2);
+ }
+
+ };
+ } // namespace compare
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+
+ template <typename P, size_t D>
+ struct strategy_compare<cartesian_tag, P, D>
+ {
+ typedef strategy::compare::euclidian<P, D> type;
+ };
+
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_CARTESIAN_COMPARE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_distance.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_distance.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,195 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_CARTESIAN_DISTANCE_HPP
+#define _GEOMETRY_STRATEGY_CARTESIAN_DISTANCE_HPP
+
+
+
+#include <boost/type_traits/remove_const.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/point_type.hpp>
+
+#include <geometry/arithmetic/arithmetic.hpp>
+#include <geometry/arithmetic/dot_product.hpp>
+
+#include <geometry/strategies/strategy_traits.hpp>
+#include <geometry/strategies/distance_result.hpp>
+
+#include <geometry/util/promotion_traits.hpp>
+
+
+// Helper geometry
+#include <geometry/geometries/segment.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+
+ namespace distance
+ {
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename P1, typename P2, size_t I, typename T>
+ struct compute_pythagoras
+ {
+ static T result(const P1& p1, const P2& p2)
+ {
+ T d = get<I-1>(p2) - get<I-1>(p1);
+ return d*d + compute_pythagoras<P1, P2, I-1, T>::result(p1, p2);
+ }
+ };
+
+ template <typename P1, typename P2, typename T>
+ struct compute_pythagoras<P1, P2, 0, T>
+ {
+ static T result(const P1&, const P2&)
+ {
+ return 0;
+ }
+ };
+ }
+ #endif
+
+ /*!
+ \brief Strategy for distance point to point: pythagoras
+ \ingroup distance
+ \tparam P1 first point type
+ \tparam P2 optional, second point type, defaults to first point type
+ \par Concepts for P1 and P2:
+ - specialized point_traits class
+ */
+ template <typename P1, typename P2 = P1>
+ struct pythagoras
+ {
+ typedef typename select_coordinate_type<P1, P2>::type T;
+ typedef cartesian_distance return_type;
+
+
+ inline BOOST_CONCEPT_REQUIRES(((ConstPoint<P1>)) ((ConstPoint<P2>)), (cartesian_distance))
+ operator()(const P1& p1, const P2& p2) const
+ {
+ // Calculate distance using Pythagoras
+ // (Leave comment above for Doxygen)
+
+ assert_dimension_equal<P1, P2>();
+
+ return cartesian_distance(impl::compute_pythagoras<P1,
+ P2, dimension<P1>::value, T>::result(p1, p2));
+ }
+ };
+
+
+ /*!
+ \brief Strategy for distance point to segment
+ \ingroup distance
+ \details Calculates distance using projected-point method, and (optionally) Pythagoras
+ \author Adapted from: http://geometryalgorithms.com/Archive/algorithm_0102/algorithm_0102.htm
+ \tparam P point type
+ \tparam SEG segment type
+ \tparam S strategy, optional, defaults to pythagoras
+ \par Concepts for S:
+ - cartesian_distance operator(P,P)
+ */
+ template <typename P, typename SEG, typename STRATEGY = pythagoras<P, typename point_type<SEG>::type> >
+ struct xy_point_segment
+ {
+ typedef typename select_coordinate_type<P, SEG>::type T;
+ typedef cartesian_distance return_type;
+ typedef STRATEGY distance_strategy_type;
+
+
+ inline cartesian_distance operator()(const P& p, const SEG& s) const
+ {
+ assert_dimension_equal<P, SEG>();
+
+ /* Algorithm
+ POINT v(x2 - x1, y2 - y1);
+ POINT w(px - x1, py - y1);
+ c1 = w . v
+ c2 = v . v
+ b = c1 / c2
+ RETURN POINT(x1 + b * vx, y1 + b * vy);
+ */
+
+ typedef typename boost::remove_const<typename point_type<SEG>::type>::type PS;
+ PS v, w;
+
+ // TODO
+ // ASSUMPTION: segment
+ // SOLVE THIS USING OTHER FUNCTIONS using get<,>
+ copy_coordinates(s.second, v);
+ copy_coordinates(p, w);
+ subtract_point(v, s.first);
+ subtract_point(w, s.first);
+
+ STRATEGY strategy;
+
+ T c1 = dot_product(w, v);
+ if (c1 <= 0)
+ {
+ return strategy(p, s.first);
+ }
+ T c2 = dot_product(v, v);
+ if (c2 <= c1)
+ {
+ return strategy(p, s.second);
+ }
+
+ // Even in case of char's, we have to turn to a point<double/float>
+ // because of the division.
+ T b = c1 / c2;
+
+ // Note that distances with integer coordinates do NOT work because
+ // - the project point is integer
+ // - if we solve that, the used distance_strategy cannot handle double points
+ PS projected;
+ copy_coordinates(s.first, projected);
+ multiply_value(v, b);
+ add_point(projected, v);
+
+ return strategy(p, projected);
+
+ }
+ };
+
+ } // namespace distance
+
+
+
+
+
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P1, typename P2>
+ struct strategy_distance<cartesian_tag, cartesian_tag, P1, P2>
+ {
+ typedef strategy::distance::pythagoras<P1, P2> type;
+ };
+
+ template <typename P, typename S>
+ struct strategy_distance_segment<cartesian_tag, cartesian_tag, P, S>
+ {
+ typedef typename point_type<S>::type PS;
+ typedef strategy::distance::xy_point_segment<P, S,
+ typename strategy_distance<cartesian_tag, cartesian_tag, P, PS>::type
+ > type;
+ };
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_CARTESIAN_DISTANCE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_envelope.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_envelope.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,64 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_CARTESIAN_ENVELOPE_HPP
+#define _GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_HPP
+
+
+
+#include <geometry/geometries/point_xy.hpp>
+#include <geometry/geometries/segment.hpp>
+
+#include <geometry/algorithms/combine.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace envelope
+ {
+ // envelope calculation strategy for xy-points
+ template <typename P, typename B>
+ struct combine_xy
+ {
+ struct state
+ {
+ B& m_box;
+ state(B& box) : m_box(box)
+ {
+ assign_inverse(m_box);
+ }
+ };
+
+ typedef state state_type;
+
+ void operator()(const P& p, state_type& s) const
+ {
+ geometry::combine(s.m_box, p);
+ }
+ };
+ } // namespace envelope
+
+ } // namespace strategy
+
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P, typename B>
+ struct strategy_envelope<cartesian_tag, cartesian_tag, P, B>
+ {
+ typedef strategy::envelope::combine_xy<P, B> type;
+ };
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_side.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_side.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,71 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_CARTESIAN_SIDE_HPP
+#define _GEOMETRY_STRATEGY_CARTESIAN_SIDE_HPP
+
+
+
+#include <geometry/geometries/point_xy.hpp>
+#include <geometry/geometries/segment.hpp>
+
+#include <geometry/util/promotion_traits.hpp>
+
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace side
+ {
+
+ template <typename P, typename PS>
+ struct xy_side
+ {
+
+ // Check at which side of a segment a point lies:
+ // left of segment (> 0), right of segment (< 0), on segment (0)
+ // In fact this is twice the area of a triangle
+ static inline typename select_coordinate_type<P, PS>::type
+ side(const segment<const PS>& s, const P& p)
+ {
+ typedef typename select_coordinate_type<P, PS>::type T;
+
+ // Todo: might be changed to subtract_point
+ T dx = get<1, 0>(s) - get<0, 0>(s);
+ T dy = get<1, 1>(s) - get<0, 1>(s);
+ T dpx = get<0>(p) - get<0, 0>(s);
+ T dpy = get<1>(p) - get<0, 1>(s);
+ return dx * dpy - dy * dpx;
+ }
+
+
+ static inline int side(const P& p0, const P& p1, const P& p2)
+ {
+ typename coordinate_type<P>::type s = side(segment<const P>(p0, p1), p2);
+ return s > 0 ? 1 : s < 0 ? -1 : 0;
+ }
+ };
+
+ } // namespace side
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P, typename PS>
+ struct strategy_side<cartesian_tag, P, PS>
+ {
+ typedef strategy::side::xy_side<P, PS> type;
+ };
+ #endif
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_CARTESIAN_SIDE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_within.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/cartesian/cart_within.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,100 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_CARTESIAN_WITHIN_HPP
+#define _GEOMETRY_STRATEGY_CARTESIAN_WITHIN_HPP
+
+
+
+#include <geometry/geometries/segment.hpp>
+
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace within
+ {
+ /*!
+ \brief Within detection using cross counting
+
+ \author adapted from Randolph Franklin algorithm
+ \author Barend and Maarten, 1995
+ \author Revised for templatized library, Barend Gehrels, 2007
+ \return true if point is in ring, works for closed rings in both directions
+ \note Does NOT work correctly for point ON border
+ */
+
+ template<typename P, typename PS = P>
+ struct franklin
+ {
+ private :
+ /*! subclass to keep state */
+ struct crossings
+ {
+ P p;
+ bool crosses;
+ explicit crossings(const P& ap)
+ : p(ap)
+ , crosses(false)
+ {}
+ bool within() const
+ {
+ return crosses;
+ }
+ };
+
+ public :
+
+ typedef crossings state_type;
+
+ inline bool operator()(const segment<const PS>& s, state_type& state) const
+ {
+ /* Algorithm:
+ if (
+ ( (y2 <= py && py < y1)
+ || (y1 <= py && py < y2) )
+ && (px < (x1 - x2)
+ * (py - y2)
+ / (y1 - y2) + x2)
+ )
+ crosses = ! crosses
+ */
+
+
+ if (
+ ((get<1, 1>(s) <= get<1>(state.p) && get<1>(state.p) < get<0, 1>(s))
+ || (get<0, 1>(s) <= get<1>(state.p) && get<1>(state.p) < get<1, 1>(s)))
+ && (get<0>(state.p) < (get<0, 0>(s) - get<1, 0>(s))
+ * (get<1>(state.p) - get<1, 1>(s))
+ / (get<0, 1>(s) - get<1, 1>(s)) + get<1, 0>(s))
+ )
+ {
+ state.crosses = ! state.crosses;
+ }
+ return true;
+ }
+ };
+
+
+
+ } // namespace within
+
+
+
+ } // namespace strategy
+
+
+
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_CARTESIAN_WITHIN_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/distance_result.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/distance_result.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,219 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_DISTANCE_RESULT_HPP
+#define _GEOMETRY_DISTANCE_RESULT_HPP
+
+#include <utility>
+#include <cmath>
+#include <limits>
+#include <iostream>
+
+namespace geometry
+{
+
+ /*!
+ \brief Encapsulate the results of distance calculation
+ \ingroup distance
+ \details Distance calculation for xy points or xyz points is done by taking the square
+ root. However, for distance comparison drawing the square root is not necessary.
+ Therefore the distance strategies are allowed to return the squares of the distance.
+ This structure contains the distance, and a boolean to indicate if it is squared.
+ It has an automatic conversion to a double value, which does the square root if necessary.
+ \note Thanks to Phil Endecott for his suggestion to change the pair to the double-convertable
+ http://article.gmane.org/gmane.comp.lib.boost.devel/172709/match=greatcircle_distance
+ \note It might be templatized with a T
+ */
+ struct cartesian_distance
+ {
+ private :
+ typedef double T;
+ T m_squared_distance;
+
+ public :
+
+
+ /// Constructor with a value
+ explicit cartesian_distance(const T& v) : m_squared_distance(v) {}
+
+ /// Automatic conversion to double, taking squareroot if necessary
+ inline operator double() const
+ {
+ return sqrt(m_squared_distance);
+ }
+
+ // Compare squared values
+ inline bool operator<(const cartesian_distance& other) const
+ {
+ return this->m_squared_distance < other.m_squared_distance;
+ }
+ inline bool operator>(const cartesian_distance& other) const
+ {
+ return this->m_squared_distance > other.m_squared_distance;
+ }
+ inline bool operator==(const cartesian_distance& other) const
+ {
+ return this->m_squared_distance == other.m_squared_distance;
+ }
+
+ // Compare just with a corresponding POD value
+ inline bool operator<(const T& value) const
+ {
+ return this->m_squared_distance < (value * value);
+ }
+ inline bool operator>(const T& value) const
+ {
+ return this->m_squared_distance > (value * value);
+ }
+ inline bool operator==(const T& value) const
+ {
+ return this->m_squared_distance == (value * value);
+ }
+
+ // Utility method to compare without SQRT, but not with method above because for epsilon that
+ // makes no sense...
+ inline bool very_small() const
+ {
+ return m_squared_distance <= std::numeric_limits<T>::epsilon();
+ }
+
+ /// The "value" method returns the internal value, here: the squared value
+ /// inline T value() const { return m_squared_distance; }
+
+
+ /// Make streamable to enable std::cout << geometry::distance( )
+ template <typename CH, typename TR>
+ inline friend std::basic_ostream<CH, TR>& operator<<(std::basic_ostream<CH, TR>& os,
+ const cartesian_distance& d)
+ {
+ os << sqrt(d.m_squared_distance);
+ return os;
+ }
+
+ };
+
+
+
+ /*
+
+ From Phil Endecott, on the list:
+
+ You can go further. If I'm searching through a long list of points to
+ find the closest to P then I'll avoid the squaring (and conversion to
+ double if my co-ordinates are integers) whenever possible. You can
+ achieve this with a more complex distance proxy:
+
+ class distance_proxy {
+ double dx;
+ double dy;
+ distance_proxy(double dx_, double dy_): dx(dx_), dy(dy_) {}
+ friend pythag_distance(point,point);
+ public:
+ operator double() { return sqrt(dx*dx+dy*dy); }
+ bool operator>(double d) {
+ return dx>d
+ || dy>d
+ || (dx*dx+dy*dy > d*d);
+ }
+ };
+
+ So this is convertible to double, but can be compared to a distance
+ without any need for sqrt() and only multiplication in some cases.
+ Further refinement is possible.
+
+
+ Barend:
+ feasable, needs to be templatized by the number of dimensions. For distance it
+ results in a nice "delayed calculation".
+ For searching you might take another approach, first calculate dx, if OK then dy,
+ if OK then the sqrs. So as above but than distance does not need to be calculated.
+ So it is in fact another strategy.
+
+
+ */
+
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace distance
+ {
+ template <typename R, typename T>
+ struct distance_result_maker
+ {
+ };
+
+ template <typename T>
+ struct distance_result_maker<cartesian_distance, T>
+ {
+ static inline cartesian_distance make(const T& value)
+ {
+ return cartesian_distance(value * value);
+ }
+ };
+
+ template <typename T>
+ struct distance_result_maker<double, T>
+ {
+ static inline double make(const T& value)
+ {
+ return value;
+ }
+ };
+
+ }
+ }
+ #endif
+
+
+ /*!
+ \brief Object generator to create instance which can be compared
+ \ingroup distance
+ \details If distance results have to be compared to a certain value it makes sense to use
+ this function to generate a distance result of a certain value, and compare the distance
+ result with this instance. SQRT calculations are then avoided
+ \tparam R distance result type
+ \tparam T arithmetic type, e.g. double
+ \param value the distance to compare with
+ \return the distance result
+ */
+ template <typename R, typename T>
+ inline R make_distance_result(const T& value)
+ {
+ return impl::distance::distance_result_maker<R, T>::make(value);
+ }
+
+
+ /*!
+ \brief Utility function to check if a distance is very small
+ \ingroup distance
+ \details Depending on the "distance result" type it checks if it is smaller than epsilon,
+ or (for Cartesian distances) if the square is smaller than epsilon
+ \tparam R the distance result type, either arithmetic or cartesian distance
+ \param value the distance result to check
+ */
+ template <typename R>
+ inline bool close_to_zero(const R& value)
+ {
+ return value <= std::numeric_limits<R>::epsilon();
+ }
+
+ // Specialization to do not take the square
+ #ifndef DOXYGEN_NO_SPECIALIZATIONS
+ template <>
+ inline bool close_to_zero<cartesian_distance>(const cartesian_distance& value)
+ {
+ return value.very_small();
+ }
+ #endif
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_DISTANCE_RESULT_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/geographic/geo_distance.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/geographic/geo_distance.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,254 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_GEOGRAPHIC_DISTANCE_HPP
+#define _GEOMETRY_STRATEGY_GEOGRAPHIC_DISTANCE_HPP
+
+
+#include <geometry/strategies/strategy_traits.hpp>
+#include <geometry/strategies/distance_result.hpp>
+#include <geometry/core/radian_access.hpp>
+
+namespace geometry
+{
+ namespace strategy
+ {
+
+ namespace distance
+ {
+
+
+ /*!
+ \brief Defines ellipsoid values for use in distance calculations
+ \details They have a constructor with the earth radius
+ \tparam P1 first point type
+ \tparam P2 optional second point type
+ \note Will be moved / merged with projections
+ \todo Optionally specify earth model, defaulting to WGS84
+ - See http://en.wikipedia.org/wiki/Figure_of_the_Earth
+ - and http://en.wikipedia.org/wiki/World_Geodetic_System#A_new_World_Geodetic_System:_WGS84
+ \note
+ */
+ class ellipsoid
+ {
+ public :
+ ellipsoid(double a, double b)
+ : m_a(a)
+ , m_b(b)
+ , m_f((a - b) / a)
+ {}
+ ellipsoid()
+ : m_a(6378137.0)
+ , m_b(6356752.314245)
+ , m_f((m_a - m_b) / m_a)
+ {}
+ // Unit sphere
+ ellipsoid(double f)
+ : m_a(1.0)
+ , m_f(f)
+ {}
+
+ double a() const { return m_a; }
+ double b() const { return m_b; }
+ double f() const { return m_f; }
+
+ private :
+ double m_a, m_b, m_f; // equatorial radius, polar radius, flattening
+ };
+
+
+ /*!
+ \brief Point-point distance approximation taking flattening into account
+ \ingroup distance
+ \tparam P1 first point type
+ \tparam P2 optional second point type
+ \author After Andoyer, 19xx, republished 1950, republished by Meeus, 1999
+ \note Although not so well-known, the approximation is very good: in all cases the results
+ are about the same as Vincenty. In my (Barend's) testcases the results didn't differ more than 6 m
+ \see http://nacc.upc.es/tierra/node16.html
+ \see http://sci.tech-archive.net/Archive/sci.geo.satellite-nav/2004-12/2724.html
+ \see http://home.att.net/~srschmitt/great_circle_route.html (implementation)
+ \see http://www.codeguru.com/Cpp/Cpp/algorithms/article.php/c5115 (implementation)
+ \see http://futureboy.homeip.net/frinksamp/navigation.frink (implementation)
+ \see http://www.voidware.com/earthdist.htm (implementation)
+ */
+ template <typename P1, typename P2 = P1>
+ class andoyer
+ {
+ public :
+ //typedef spherical_distance return_type;
+ typedef double return_type;
+
+ andoyer()
+ : m_ellipsoid()
+ {}
+ andoyer(double f)
+ : m_ellipsoid(f)
+ {}
+
+ inline return_type operator()(const P1& p1, const P2& p2) const
+ {
+ return calc(get_as_radian<0>(p1), get_as_radian<1>(p1),
+ get_as_radian<0>(p2), get_as_radian<1>(p2));
+ }
+
+
+ private :
+ typedef typename coordinate_type<P1>::type T1;
+ typedef typename coordinate_type<P2>::type T2;
+ ellipsoid m_ellipsoid;
+
+ inline return_type calc(const T1& lon1, const T1& lat1, const T2& lon2, const T2& lat2) const
+ {
+ double F = (lat1 + lat2) / 2.0;
+ double G = (lat1 - lat2) / 2.0;
+ double lambda = (lon1 - lon2) / 2.0;
+
+ double sinG2 = math::sqr(sin(G));
+ double cosG2 = math::sqr(cos(G));
+ double sinF2 = math::sqr(sin(F));
+ double cosF2 = math::sqr(cos(F));
+ double sinL2 = math::sqr(sin(lambda));
+ double cosL2 = math::sqr(cos(lambda));
+
+ double S = sinG2 * cosL2 + cosF2 * sinL2;
+ double C = cosG2 * cosL2 + sinF2 * sinL2;
+
+ double omega = atan(sqrt(S / C));
+ double r = sqrt(S * C) / omega; // not sure if this is r or greek nu
+
+ double D = 2.0 * omega * m_ellipsoid.a();
+ double H1 = (3 * r - 1.0) / (2.0 * C);
+ double H2 = (3 * r + 1.0) / (2.0 * S);
+
+ return return_type(D
+ * (1.0 + m_ellipsoid.f() * H1 * sinF2 * cosG2
+ - m_ellipsoid.f() * H2 * cosF2 * sinG2));
+ }
+ };
+
+
+ /*!
+ \brief Distance calculation formulae on latlong coordinates, after Vincenty, 1975
+ \ingroup distance
+ \tparam P1 first point type
+ \tparam P2 optional second point type
+ \author See http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
+ \author Adapted from various implementations to get it close to the original document
+ - http://www.movable-type.co.uk/scripts/LatLongVincenty.html
+ - http://exogen.case.edu/projects/geopy/source/geopy.distance.html
+ - http://futureboy.homeip.net/fsp/colorize.fsp?fileName=navigation.frink
+
+ */
+ template <typename P1, typename P2 = P1>
+ class vincenty
+ {
+ public :
+ //typedef spherical_distance return_type;
+ typedef double return_type;
+
+ inline return_type operator()(const P1& p1, const P2& p2) const
+ {
+ return calc(get_as_radian<0>(p1), get_as_radian<1>(p1),
+ get_as_radian<0>(p2), get_as_radian<1>(p2));
+ }
+
+ private :
+ typedef typename coordinate_type<P1>::type T1;
+ typedef typename coordinate_type<P2>::type T2;
+ ellipsoid m_ellipsoid;
+
+ inline return_type calc(const T1& lon1, const T1& lat1, const T2& lon2, const T2& lat2) const
+ {
+ // lambda: difference in longitude on an auxiliary sphere
+ double L = lon2 - lon1;
+ double lambda = L;
+
+ if (L < -math::pi) L += math::two_pi;
+ if (L > math::pi) L -= math::two_pi;
+
+ if (lat1 == lat2 && lon1 == lon2)
+ {
+ return return_type(0);
+ }
+
+ // U: reduced latitude, defined by tan U = (1-f) tan phi
+ double U1 = atan((1-m_ellipsoid.f()) * tan(lat1)); // above (1)
+ double U2 = atan((1-m_ellipsoid.f()) * tan(lat2)); // above (1)
+
+ double cos_U1 = cos(U1);
+ double cos_U2 = cos(U2);
+ double sin_U1 = sin(U1);
+ double sin_U2 = sin(U2);
+
+ // alpha: azimuth of the geodesic at the equator
+ double cos2_alpha;
+ double sin_alpha;
+
+ // sigma: angular distance p1,p2 on the sphere
+ // sigma1: angular distance on the sphere from the equator to p1
+ // sigma_m: angular distance on the sphere from the equator to the midpoint of the line
+ double sigma;
+ double sin_sigma;
+ double cos2_sigma_m;
+
+ double previous_lambda;
+
+ do
+ {
+ previous_lambda = lambda; // (13)
+ double sin_lambda = sin(lambda);
+ double cos_lambda = cos(lambda);
+ sin_sigma = sqrt(math::sqr(cos_U2 * sin_lambda) + math::sqr(cos_U1 * sin_U2 - sin_U1 * cos_U2 * cos_lambda)); // (14)
+ double cos_sigma = sin_U1 * sin_U2 + cos_U1 * cos_U2 * cos_lambda; // (15)
+ sin_alpha = cos_U1 * cos_U2 * sin_lambda / sin_sigma; // (17)
+ cos2_alpha = 1.0 - math::sqr(sin_alpha);
+ cos2_sigma_m = cos2_alpha == 0 ? 0 : cos_sigma - 2.0 * sin_U1 * sin_U2 / cos2_alpha; // (18)
+
+ double C = m_ellipsoid.f()/16.0 * cos2_alpha * (4.0 + m_ellipsoid.f() * (4.0 - 3.0 * cos2_alpha)); // (10)
+ sigma = atan2(sin_sigma, cos_sigma); // (16)
+ lambda = L + (1.0 - C) * m_ellipsoid.f() * sin_alpha *
+ (sigma + C * sin_sigma * ( cos2_sigma_m + C * cos_sigma * (-1.0 + 2.0 * math::sqr(cos2_sigma_m)))); // (11)
+
+ } while (fabs(previous_lambda - lambda) > 1e-12 && fabs(lambda) < math::pi);
+
+ double sqr_u = cos2_alpha * (math::sqr(m_ellipsoid.a()) - math::sqr(m_ellipsoid.b())) / math::sqr(m_ellipsoid.b()); // above (1)
+
+ double A = 1.0 + sqr_u/16384.0 * (4096 + sqr_u * (-768.0 + sqr_u * (320.0 - 175.0 * sqr_u))); // (3)
+ double B = sqr_u/1024.0 * (256.0 + sqr_u * ( -128.0 + sqr_u * (74.0 - 47.0 * sqr_u))); // (4)
+ double delta_sigma = B * sin_sigma * ( cos2_sigma_m + (B/4.0) * (cos(sigma)* (-1.0 + 2.0 * cos2_sigma_m)
+ - (B/6.0) * cos2_sigma_m * (-3.0 + 4.0 * math::sqr(sin_sigma)) * (-3.0 + 4.0 * cos2_sigma_m))); // (6)
+
+ double dist = m_ellipsoid.b() * A * (sigma - delta_sigma); // (19)
+
+ return return_type(dist);
+ }
+ };
+
+
+ // We might add a vincenty-like strategy also for point-segment distance, but to calculate the projected point is not trivial
+
+ } // namespace distance
+
+
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P1, typename P2>
+ struct strategy_distance<geographic_tag, geographic_tag, P1, P2>
+ {
+ typedef strategy::distance::andoyer<P1, P2> type;
+ };
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_GEOGRAPHIC_DISTANCE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/geographic/geo_parse.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/geographic/geo_parse.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,266 @@
+// Generic Geometry Library
+
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_GEO_PARSE_HPP
+#define _GEOMETRY_GEO_PARSE_HPP
+
+// This file is totally revised from PROJ4 dmstor.c
+
+// PROJ4 is originally written by Gerald Evenden (then of the USGS)
+// PROJ4 is maintained by Frank Warmerdam
+// PROJ4 is converted to Geometry Library by Barend Gehrels (Geodan, Amsterdam)
+
+// Original copyright notice:
+
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+#include <string>
+
+#include <boost/static_assert.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string.hpp>
+
+#include <geometry/strategies/strategy_traits.hpp>
+
+#include <geometry/util/math.hpp>
+
+namespace geometry
+{
+
+
+ struct dms_result
+ {
+ enum axis_selector {axis_lat = 1, axis_lon = 0};
+
+ private :
+ typedef double T;
+ T m_angle;
+ axis_selector m_axis;
+
+ public :
+
+ explicit dms_result(const T& v, axis_selector ax)
+ : m_angle(v)
+ , m_axis(ax)
+ {}
+
+ inline axis_selector axis() const { return m_axis; }
+
+ inline operator double() const { return m_angle; }
+
+ template <typename CH, typename TR>
+ inline friend std::basic_ostream<CH, TR>& operator<<(std::basic_ostream<CH, TR>& os,
+ const dms_result& d)
+ {
+ os << d.m_angle;
+ return os;
+ }
+
+ };
+
+
+ namespace strategy
+ {
+
+ template <bool as_radian = true
+ , char N = 'N', char E = 'E', char S = 'S', char W = 'W' // translatable
+ , char MIN = '\'', char SEC = '"' // other char's possible
+ , char D = 'D', char R = 'R' // degree sign might be small o
+ >
+ struct dms_parser
+ {
+
+
+ // Question from Barend: can we compile-time select that it is case-sensitive/case-insensitive?
+ // We have to change the switch then -> specializations
+
+ // For now: make it (compile-time) case sensitive
+ static const int diff = 'a' - 'A';
+#ifndef __GNUC__
+ BOOST_STATIC_ASSERT((diff > 0)); // make sure we've the right assumption. GCC does not accept this here.
+#endif
+ static const char n_alter = N <= 'Z' ? N + diff : N - diff;
+ static const char e_alter = E <= 'Z' ? E + diff : E - diff;
+ static const char s_alter = S <= 'Z' ? S + diff : S - diff;
+ static const char w_alter = W <= 'Z' ? W + diff : W - diff;
+
+ static const char r_alter = R <= 'Z' ? R + diff : R - diff;
+
+ // degree is normally D (proj4) but might be superscript o
+ // Note d_alter is not correct then, so map it to NULL now, guarded by the while
+ static const char d_alter =
+ ((D >= 'A' && D <= 'Z') || (D >= 'a' && D <= 'z')) ? (D <= 'Z' ? D + diff : D - diff) : '\0';
+
+
+ struct dms_value
+ {
+ double dms[3];
+ bool has_dms[3];
+
+ dms_value()
+ {
+ memset(this, 0, sizeof(dms_value));
+ }
+ };
+
+
+ template <size_t I>
+ static inline void assign_dms(dms_value& dms, std::string& value, bool& has_value)
+ {
+ dms.dms[I] = boost::lexical_cast<double>(value.c_str());
+ dms.has_dms[I] = true;
+ has_value = false;
+ value.clear();
+ }
+
+ static inline void process(dms_value& dms, std::string& value, bool& has_value)
+ {
+ if (has_value)
+ {
+ // Assign last one, sequentially
+ if (! dms.has_dms[0]) assign_dms<0>(dms, value, has_value);
+ else if (! dms.has_dms[1]) assign_dms<1>(dms, value, has_value);
+ else if (! dms.has_dms[2]) assign_dms<2>(dms, value, has_value);
+ }
+ }
+
+
+ dms_result operator()(const char* is) const
+ {
+ dms_value dms;
+ bool has_value = false;
+ std::string value;
+
+ double factor = 1.0; // + denotes N/E values, -1 denotes S/W values
+ dms_result::axis_selector axis = dms_result::axis_lon; // true denotes N/S values
+ bool in_radian = false; // true denotes values as "0.1R"
+
+ while(*is)
+ {
+ switch(*is)
+ {
+ case '-' :
+ if (! has_value && ! dms.has_dms[0])
+ {
+ factor = -factor;
+ }
+ break;
+ case N :
+ case n_alter :
+ axis = dms_result::axis_lat;
+ break;
+ case S :
+ case s_alter :
+ axis = dms_result::axis_lat;
+ factor = -factor;
+ break;
+ case E :
+ case e_alter :
+ axis = dms_result::axis_lon;
+ break;
+ case W :
+ case w_alter :
+ axis = dms_result::axis_lon;
+ factor = -factor;
+ break;
+ case D :
+ case d_alter :
+ if (! dms.has_dms[0] && has_value)
+ {
+ assign_dms<0>(dms, value, has_value);
+ }
+ break;
+ case R :
+ case r_alter :
+ if (! dms.has_dms[0] && has_value)
+ {
+ // specified value is in radian!
+ in_radian = true;
+ assign_dms<0>(dms, value, has_value);
+ }
+ break;
+ case MIN:
+ if (! dms.has_dms[1] && has_value)
+ {
+ assign_dms<1>(dms, value, has_value);
+ }
+ break;
+ case SEC :
+ if (! dms.has_dms[2] && has_value)
+ {
+ assign_dms<2>(dms, value, has_value);
+ }
+ break;
+ case ' ' :
+ case '\t' :
+ case '\n' :
+ process(dms, value, has_value);
+ break;
+ default :
+ value += *is;
+ has_value = true;
+ break;
+ }
+ is++;
+ }
+
+ // Assign last one, if any
+ process(dms, value, has_value);
+
+ return dms_result(factor *
+ (in_radian && as_radian
+ ? dms.dms[0]
+ : in_radian && ! as_radian
+ ? dms.dms[0] * math::r2d
+ : ! in_radian && as_radian
+ ? dms.dms[0] * math::d2r + dms.dms[1] * math::d2r / 60.0 + dms.dms[2] * math::d2r / 3600.0
+ : dms.dms[0] + dms.dms[1] / 60.0 + dms.dms[2] / 3600.0)
+ , axis);
+ }
+ };
+
+ }
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+
+ template <template<typename> class CS>
+ struct strategy_parse<geographic_tag, CS<degree> >
+ {
+ typedef strategy::dms_parser<false> type;
+ };
+
+
+ template <template<typename> class CS>
+ struct strategy_parse<geographic_tag, CS<radian> >
+ {
+ typedef strategy::dms_parser<true> type;
+ };
+
+ #endif
+
+
+} // namespace geometry
+
+#endif // _GEOMETRY_GEO_PARSE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_area.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_area.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,134 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_SPHERICAL_AREA_HPP
+#define _GEOMETRY_STRATEGY_SPHERICAL_AREA_HPP
+
+
+#include <geometry/strategies/spherical/sph_distance.hpp>
+
+#include <geometry/geometries/segment.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace area
+ {
+ /*!
+ \brief Area calculation by spherical excess
+ \tparam P type of points of rings/polygons
+ \author Barend Gehrels. Adapted from:
+ - http://www.soe.ucsc.edu/~pang/160/f98/Gems/GemsIV/sph_poly.c
+ - http://williams.best.vwh.net/avform.htm
+ \note The version in Gems didn't account for polygons crossing the 180 meridian.
+ \note This version works for convex and non-convex polygons, for 180 meridian
+ crossing polygons and for polygons with holes. However, some cases (especially
+ 180 meridian cases) must still be checked.
+ \note The version which sums angles, which is often seen, doesn't handle non-convex
+ polygons correctly.
+ \note The version which sums longitudes, see
+ http://trs-new.jpl.nasa.gov/dspace/bitstream/2014/40409/1/07-03.pdf, is simple
+ and works well in most cases but not in 180 meridian crossing cases. This probably
+ could be solved.
+ */
+ template<typename P>
+ class by_spherical_excess
+ {
+ private :
+ struct excess_sum
+ {
+ double sum;
+ inline excess_sum() : sum(0) {}
+ inline double area() const
+ {
+ return - sum * constants::average_earth_radius * constants::average_earth_radius;
+ }
+ };
+
+ // Distances are calculated on unit sphere here
+ strategy::distance::haversine<P, P> m_unit_sphere;
+
+ public :
+ typedef excess_sum state_type;
+
+ by_spherical_excess()
+ : m_unit_sphere(1)
+ {}
+
+ inline bool operator()(const segment<const P>& segment, state_type& state) const
+ {
+ if (get<0>(segment.first) != get<0>(segment.second))
+ {
+ typedef point_ll<typename coordinate_type<P>::type, cs::geographic<radian> > PR;
+ PR p1, p2;
+
+ // Select transformation strategy and transform to radians (if necessary)
+ typename strategy_transform<
+ typename cs_tag<P>::type,
+ typename cs_tag<PR>::type,
+ typename coordinate_system<P>::type,
+ typename coordinate_system<PR>::type,
+ dimension<P>::value,
+ dimension<PR>::value,
+ P, PR>::type transform_strategy;
+
+ transform_strategy(segment.first, p1);
+ transform_strategy(segment.second, p2);
+
+ // Distance p1 p2
+ double a = m_unit_sphere(segment.first, segment.second);
+ // Sides on unit sphere to south pole
+ double b = 0.5 * math::pi - p2.lat();
+ double c = 0.5 * math::pi - p1.lat();
+ // Semi parameter
+ double s = 0.5 * (a + b + c);
+
+ // E: spherical excess, using l'Huiller's formula
+ // [tg(e / 4)]2 = tg[s / 2] tg[(s-a) / 2] tg[(s-b) / 2] tg[(s-c) / 2]
+ double E = 4.0 * atan(sqrt(fabs(tan(s / 2) * tan((s - a) / 2) * tan((s - b) / 2) * tan((s - c) / 2))));
+
+ E = fabs(E);
+
+ // In right direction: positive, add area. In left direction: negative, subtract area.
+ // Longitude comparisons are not so obvious. If one is negative, other is positive,
+ // we have to take the date into account.
+ // TODO: check this / enhance this, should be more robust. See also the "grow" for ll
+ // TODO: use minmax or "smaller"/"compare" strategy for this
+ double lon1 = p1.lon() < 0 ? p1.lon() + math::two_pi : p1.lon();
+ double lon2 = p2.lon() < 0 ? p2.lon() + math::two_pi : p2.lon();
+
+ if (lon2 < lon1)
+ {
+ E= -E;
+ }
+
+ state.sum += E;
+ }
+ return true;
+ }
+ };
+
+ } // namespace area
+
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename LL>
+ struct strategy_area<geographic_tag, LL>
+ {
+ typedef strategy::area::by_spherical_excess<LL> type;
+ };
+ #endif
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_SPHERICAL_AREA_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_distance.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_distance.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,227 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_SPHERICAL_DISTANCE_HPP
+#define _GEOMETRY_STRATEGY_SPHERICAL_DISTANCE_HPP
+
+
+#include <geometry/core/cs.hpp>
+#include <geometry/core/concepts/point_concept.hpp>
+#include <geometry/core/access.hpp>
+#include <geometry/core/radian_access.hpp>
+
+
+#include <geometry/strategies/strategy_traits.hpp>
+
+
+#include <geometry/strategies/distance_result.hpp>
+
+// Helper geometry
+#include <geometry/geometries/point_ll.hpp> // to be resolved
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+
+ namespace distance
+ {
+
+ /*!
+ \brief Distance calculation for spherical coordinates on a perfect sphere using haversine
+ \ingroup distance
+ \tparam P1 first point type
+ \tparam P2 optional second point type
+ \author Adapted from: http://williams.best.vwh.net/avform.htm
+ \see http://en.wikipedia.org/wiki/Great-circle_distance
+ \note It says: <em>The great circle distance d between two points with coordinates {lat1,lon1} and {lat2,lon2} is given by:
+ d=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2))
+ A mathematically equivalent formula, which is less subject to rounding error for short distances is:
+ d=2*asin(sqrt((sin((lat1-lat2)/2))^2 + cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2))^2))</em>
+ */
+ template <typename P1, typename P2 = P1>
+ class haversine
+ {
+ public :
+ //typedef spherical_distance return_type;
+ typedef double return_type;
+
+ inline haversine(double r = constants::average_earth_radius)
+ : m_radius(r)
+ {}
+
+ inline return_type operator()(const P1& p1, const P2& p2) const
+ {
+ return calc(get_as_radian<0>(p1), get_as_radian<1>(p1),
+ get_as_radian<0>(p2), get_as_radian<1>(p2));
+ }
+
+ private :
+ double m_radius;
+ typedef typename coordinate_type<P1>::type T1;
+ typedef typename coordinate_type<P2>::type T2;
+
+ inline return_type calc(const T1& lon1, const T1& lat1, const T2& lon2, const T2& lat2) const
+ {
+ double a = math::hav(lat2 - lat1) + cos(lat1) * cos(lat2) * math::hav(lon2 - lon1);
+ double c = 2.0 * asin(sqrt(a));
+ return return_type(m_radius * c);
+ }
+ };
+
+
+
+ /*!
+ \brief Strategy functor for distance point to segment calculation
+ \ingroup distance
+ \details Class which calculates the distance of a point to a segment, using latlong points
+ \tparam P point type
+ \tparam S segment type
+ */
+ template <typename P, typename S>
+ class ll_point_segment
+ {
+ public :
+ typedef double return_type;
+
+ inline ll_point_segment(double r = constants::average_earth_radius) : m_radius(r)
+ {}
+
+ inline return_type operator()(const P& p, const S& s) const
+ {
+ // Because PR is a type defined in our own library, it's safe to assume
+ // that there is a default constructor available
+ PR pr, ps1, ps2;
+
+ // Select transformation strategy and transform to radians (if necessary)
+ typename strategy_transform<
+ typename cs_tag<P>::type,
+ typename cs_tag<PR>::type,
+ typename coordinate_system<P>::type,
+ typename coordinate_system<PR>::type,
+ dimension<P>::value,
+ dimension<PR>::value,
+ P, PR>::type transform_strategy;
+
+
+ // TODO
+ // ASSUMPTION: segment
+ // SOLVE THIS USING OTHER FUNCTIONS using get<,>
+ transform_strategy(p, pr);
+ transform_strategy(s.first, ps1);
+ transform_strategy(s.second, ps2);
+ return calc(pr, ps1, ps2);
+ }
+
+ private :
+ typedef point_ll<typename coordinate_type<P>::type, cs::geographic<radian> > PR;
+ double m_radius;
+
+ /// Calculate course (bearing) between two points. Might be moved to a "course formula" ...
+ inline double course(const PR& p1, const PR& p2) const
+ {
+ /***
+ Course between points
+
+ We obtain the initial course, tc1, (at point 1) from point 1 to point 2 by the following. The formula fails if the initial point is a pole. We can special case this with:
+
+ IF (cos(lat1) < EPS) // EPS a small number ~ machine precision
+ IF (lat1 > 0): tc1= pi // starting from N pole
+ ELSE: tc1= 2*pi // starting from S pole
+ ENDIF
+ ENDIF
+
+ For starting points other than the poles:
+ IF sin(lon2-lon1)<0: tc1=acos((sin(lat2)-sin(lat1)*cos(d))/(sin(d)*cos(lat1)))
+ ELSE: tc1=2*pi-acos((sin(lat2)-sin(lat1)*cos(d))/(sin(d)*cos(lat1)))
+ ENDIF
+
+ An alternative formula, not requiring the pre-computation of d, the distance between the points, is:
+ tc1=mod(atan2(sin(lon1-lon2)*cos(lat2),
+ cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(lon1-lon2))
+ , 2*pi)
+ ***/
+ double dlon = get<0>(p2) - get<0>(p1);
+ double cos_p2lat = cos(get<1>(p2));
+ return atan2(sin(dlon) * cos_p2lat, cos(get<1>(p1)) * sin(get<1>(p2)) - sin(get<1>(p1)) * cos_p2lat * cos(dlon));
+ }
+
+ inline return_type calc(const PR& p, const PR& sp1, const PR& sp2) const
+ {
+ /***
+ Cross track error:
+ Suppose you are proceeding on a great circle route from A to B (course =crs_AB) and end up at D, perhaps off course.
+ (We presume that A is ot a pole!) You can calculate the course from A to D (crs_AD) and the distance from A to D (dist_AD)
+ using the formulae above. In shifteds of these the cross track error, XTD, (distance off course) is given by
+
+ XTD =asin(sin(dist_AD)*sin(crs_AD-crs_AB))
+
+ (positive XTD means right of course, negative means left)
+ (If the point A is the N. or S. Pole replace crs_AD-crs_AB with
+ lon_D-lon_B or lon_B-lon_D, respectively.)
+ ***/
+
+ // Calculate distances, in radians, on the unit sphere
+ // It seems not useful to let this strategy be templatized, it should be in radians and on the unit sphere
+ strategy::distance::haversine<PR, PR> strategy(1.0);
+ double d1 = strategy(sp1, p);
+
+ // Actually, calculation of d2 not necessary if we know that the projected point is on the great circle...
+ double d2 = strategy(sp2, p);
+
+
+ double crs_AD = course(sp1, p);
+ double crs_AB = course(sp1, sp2);
+ double XTD = fabs(asin(sin(d1) * sin(crs_AD - crs_AB)));
+
+ // Return shortest distance, either to projected point on segment sp1-sp2, or to sp1, or to sp2
+ return return_type(m_radius * std::min(std::min(d1, d2), XTD));
+ }
+ };
+
+
+
+
+
+ } // namespace distance
+
+
+
+
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P1, typename P2>
+ struct strategy_distance<spherical_tag, spherical_tag, P1, P2>
+ {
+ typedef strategy::distance::haversine<P1, P2> type;
+ };
+
+
+ template <typename P, typename PS>
+ struct strategy_distance_segment<spherical_tag, spherical_tag, P, PS>
+ {
+ typedef strategy::distance::ll_point_segment<P, PS> type;
+ };
+
+
+ // Use this point-segment for geographic as well. For point-point Andoyer is used there, see file "geo_distance.hpp"
+ template <typename P, typename PS>
+ struct strategy_distance_segment<geographic_tag, geographic_tag, P, PS>
+ {
+ typedef strategy::distance::ll_point_segment<P, PS> type;
+ };
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_SPHERICAL_DISTANCE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_envelope.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/spherical/sph_envelope.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_SPHERICAL_ENVELOPE_HPP
+#define _GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_HPP
+
+
+#include <boost/numeric/conversion/cast.hpp>
+
+// NOTE: maybe evaluate/rework this using new "compare" strategy
+// - implement "compare" for latlong (e.g. return true if distance-difference < 90 deg, so 170 < -170 but 90 > -180)
+
+#include <geometry/strategies/spherical/sph_distance.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace envelope
+ {
+ // envelope calculation strategy for latlong-points
+ namespace shift
+ {
+ template <typename D>
+ struct shifted
+ {
+ };
+
+ template<>
+ struct shifted<radian>
+ {
+ inline static double shift() { return math::two_pi; }
+ };
+ template<>
+ struct shifted<degree>
+ {
+ inline static double shift() { return 360.0; }
+ };
+
+ }
+
+ /*!
+ \par Algorithm:
+ The envelope of latlong-points cannot be implemented as for xy-points. Suppose the
+ envelope of the Aleutian Islands must be calculated. The span from 170E to 170W, from -170 to 170.
+ Of course the real envelope is not -170..170 but 170..-170.
+ On the other hand, there might be geometries that indeed span from -170 to 170. If there are
+ two points, it is not known. If there are points in between, we probably should take the shorter
+ range. So we do that for the moment.
+ We shift coordinates and do as if we live in a world with longitude coordinates from 0 - 360,
+ where 0 is still at Greenwich. Longitude ranges are then calculated twice: one for real world,
+ one for the shifted world.
+ The shortest range is taken for the bounding box. This might have coordinates > 180
+ */
+
+ template <typename P, typename B>
+ struct grow_ll
+ {
+
+ struct state
+ {
+ typedef typename coordinate_type<B>::type T;
+ bool has_west;
+ T min_lat, max_lat;
+ T min_lon1, min_lon2, max_lon1, max_lon2;
+ B& mbr;
+
+ state(B& b)
+ : mbr(b)
+ , has_west(false)
+ , min_lat(boost::numeric::bounds<T>::highest())
+ , min_lon1(boost::numeric::bounds<T>::highest())
+ , min_lon2(boost::numeric::bounds<T>::highest())
+ , max_lat(boost::numeric::bounds<T>::lowest())
+ , max_lon1(boost::numeric::bounds<T>::lowest())
+ , max_lon2(boost::numeric::bounds<T>::lowest())
+ {}
+
+ template <typename T>
+ void take_minmax(const T& value, T& min_value, T& max_value)
+ {
+ if (value < min_value)
+ {
+ min_value = value;
+ }
+ if (value > max_value)
+ {
+ max_value = value;
+ }
+ }
+
+ void grow(const P& p)
+ {
+ // For latitude, we can take the min/max
+ take_minmax(get<1>(p), min_lat, max_lat);
+
+
+ // For longitude, we do the same...
+ take_minmax(get<0>(p), min_lon1, max_lon1);
+
+ // But we also add 360 (2pi) if it is negative
+ T value = get<0>(p);
+ while(value < 0)
+ {
+ has_west = true;
+ value += shift::shifted<typename coordinate_system<P>::type::units>::shift();
+ }
+ while (value > math::two_pi)
+ {
+ value -= shift::shifted<typename coordinate_system<P>::type::units>::shift();
+ }
+ take_minmax(value, min_lon2, max_lon2);
+ }
+
+ ~state()
+ //void envelope(box<PB>& mbr)
+ {
+ // For latitude it is easy
+ set<min_corner, 1>(mbr, min_lat);
+ set<max_corner, 1>(mbr, max_lat);
+
+ if (! has_west)
+ {
+ set<min_corner, 0>(mbr, min_lon1);
+ set<max_corner, 0>(mbr, max_lon1);
+ }
+ else
+ {
+ // Get both ranges
+ T diff1 = max_lon1 - min_lon1;
+ T diff2 = max_lon2 - min_lon2;
+
+ //std::cout << "range 1: " << min_lon1 * math::r2d << ".." << max_lon1 * math::r2d << std::endl;
+ //std::cout << "range 2: " << min_lon2 * math::r2d << ".." << max_lon2 * math::r2d << std::endl;
+
+ if (diff1 <= diff2)
+ {
+ set<min_corner, 0>(mbr, min_lon1);
+ set<max_corner, 0>(mbr, max_lon1);
+ }
+ else
+ {
+ set<min_corner, 0>(mbr, min_lon2);
+ set<max_corner, 0>(mbr, max_lon2);
+ }
+ }
+ }
+ };
+
+ typedef state state_type;
+
+ void operator()(const P& p, state_type& s) const
+ {
+ s.grow(p);
+ }
+ };
+ } // namespace envelope
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+ template <typename P, typename B>
+ struct strategy_envelope<geographic_tag, geographic_tag, P, B>
+ {
+ typedef strategy::envelope::grow_ll<P, B> type;
+ };
+ #endif
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/strategies.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/strategies.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,41 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGIES_HPP
+#define _GEOMETRY_STRATEGIES_HPP
+
+
+#include <geometry/strategies/strategy_traits.hpp>
+
+#include <geometry/strategies/cartesian/cart_area.hpp>
+#include <geometry/strategies/cartesian/cart_centroid.hpp>
+#include <geometry/strategies/cartesian/cart_compare.hpp>
+#include <geometry/strategies/cartesian/cart_distance.hpp>
+#include <geometry/strategies/cartesian/cart_envelope.hpp>
+#include <geometry/strategies/cartesian/cart_side.hpp>
+#include <geometry/strategies/cartesian/cart_within.hpp>
+
+#include <geometry/strategies/spherical/sph_area.hpp>
+#include <geometry/strategies/spherical/sph_distance.hpp>
+#include <geometry/strategies/spherical/sph_envelope.hpp>
+
+#include <geometry/strategies/geographic/geo_distance.hpp>
+#include <geometry/strategies/geographic/geo_parse.hpp>
+
+#include <geometry/strategies/agnostic/agn_convex_hull.hpp>
+#include <geometry/strategies/agnostic/agn_simplify.hpp>
+#include <geometry/strategies/agnostic/agn_within.hpp>
+
+#include <geometry/strategies/strategy_transform.hpp>
+
+#include <geometry/strategies/transform/matrix_transformers.hpp>
+#include <geometry/strategies/transform/map_transformer.hpp>
+#include <geometry/strategies/transform/inverse_transformer.hpp>
+
+
+#endif // _GEOMETRY_STRATEGIES_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/strategy_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/strategy_traits.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,225 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_TRAITS_HPP
+#define _GEOMETRY_STRATEGY_TRAITS_HPP
+
+
+#include <geometry/core/cs.hpp>
+#include <geometry/strategies/distance_result.hpp>
+
+
+// File containing strategy traits classes, to be specialized in other files
+// (This file might be splitted resulting into several small files)
+
+namespace geometry
+{
+
+ namespace strategy
+ {
+ /*!
+ \brief Indicate compiler/library user that strategy is not implemented.
+ \details The strategy_traits class define strategies for point types or for point type
+ combinations. If there is no implementation for that specific point type, or point type
+ combination, the calculation cannot be done. To indicate this, this not_implemented
+ class is used as a typedef stub.
+
+ */
+ struct not_implemented {};
+ }
+
+
+ /*!
+ \brief Traits class binding an area strategy to a coordinate system
+ \ingroup area
+ \tparam T tag of coordinate system
+ \tparam P point-type
+ */
+ template <typename T, typename P>
+ struct strategy_area
+ {
+ typedef strategy::not_implemented type;
+ };
+
+ /*!
+ \brief Traits class binding a distance strategy to a (possibly two) coordinate system(s)
+ \ingroup distance
+ \tparam T1 tag of coordinate system of first point type
+ \tparam T2 tag of coordinate system of second point type
+ \tparam P1 first point-type
+ \tparam P2 second point-type
+ */
+ template <typename T1, typename T2, typename P1, typename P2>
+ struct strategy_distance
+ {
+ typedef strategy::not_implemented type;
+ };
+
+ /*!
+ \brief Traits class binding a distance-to-segment strategy to a (possibly two) coordinate system(s)
+ \ingroup distance
+ \tparam T1 tag of coordinate system of point type
+ \tparam T2 tag of coordinate system of segment type, usually same as T1
+ \tparam P1 point-type
+ \tparam P2 segment point-type
+ */
+ template <typename T1, typename T2, typename P, typename S>
+ struct strategy_distance_segment
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+ /*!
+ \brief Traits class binding a centroid calculation strategy to a coordinate system
+ \ingroup centroid
+ \tparam T tag of coordinate system
+ \tparam P point-type
+ \tparam PS segment point-type
+ */
+ template <typename T, typename P, typename PS>
+ struct strategy_centroid
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+ /*!
+ \brief Traits class binding envelope strategy to a coordinate system
+ \ingroup envelope
+ \tparam TP tag of coordinate system of point
+ \tparam TB tag of coordinate system of box, usually same as TP
+ \tparam P point-type
+ \tparam B box-type
+ */
+ template <typename TP, typename TB, typename P, typename B>
+ struct strategy_envelope
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+ /*!
+ \brief Traits class binding a convex hull calculation strategy to a coordinate system
+ \ingroup convex_hull
+ \tparam T tag of coordinate system
+ \tparam P point-type of input points
+ */
+ template <typename T, typename P>
+ struct strategy_convex_hull
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+ /*!
+ \brief Traits class binding a within determination strategy to a coordinate system
+ \ingroup within
+ \tparam TP tag of coordinate system of point-type
+ \tparam TS tag of coordinate system of segment-type
+ \tparam P point-type of input points
+ \tparam PS point-type of input segment-points
+ */
+ template <typename TP, typename TS, typename P, typename PS>
+ struct strategy_within
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+ /*!
+ \brief Traits class binding a side determination strategy to a coordinate system
+ \ingroup util
+ \tparam T tag of coordinate system of point-type
+ \tparam P point-type of input points
+ \tparam PS point-type of input points
+ */
+ template <typename T, typename P, typename PS = P>
+ struct strategy_side
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+
+ /*!
+ \brief Traits class binding a comparing strategy to a coordinate system
+ \ingroup util
+ \tparam T tag of coordinate system of point-type
+ \tparam P point-type
+ \tparam D dimension to compare
+ */
+ template <typename T, typename P, size_t D>
+ struct strategy_compare
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+ /*!
+ \brief Traits class binding a transformation strategy to a coordinate system
+ \ingroup transform
+ \details Can be specialized
+ - per coordinate system family (tag)
+ - per coordinate system (or groups of them)
+ - per dimension
+ - per point type
+ \tparam CS_TAG 1,2 coordinate system tags
+ \tparam CS 1,2 coordinate system
+ \tparam D 1, 2 dimension
+ \tparam P 1, 2 point type
+ */
+ template <typename CS_TAG1, typename CS_TAG2,
+ typename CS1, typename CS2,
+ size_t D1, size_t D2,
+ typename P1, typename P2>
+ struct strategy_transform
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+ /*!
+ \brief Traits class binding a parsing strategy to a coordinate system
+ \ingroup parse
+ \tparam T tag of coordinate system of point-type
+ \tparam CS coordinate system
+ */
+ template <typename T, typename CS>
+ struct strategy_parse
+ {
+ typedef strategy::not_implemented type;
+ };
+
+
+
+
+ /*!
+ \brief Shortcut to define return type of distance strategy
+ \ingroup distance
+ \tparam G1 first geometry
+ \tparam G2 second geometry
+ */
+ template <typename G1, typename G2>
+ struct distance_result
+ {
+ typedef typename point_type<G1>::type P1;
+ typedef typename point_type<G2>::type P2;
+ typedef typename strategy_distance<
+ typename cs_tag<P1>::type,
+ typename cs_tag<P2>::type, P1, P2>::type S;
+ typedef typename S::return_type type;
+ };
+
+
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_TRAITS_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/strategy_transform.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/strategy_transform.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,335 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_TRANSFORM_HPP
+#define _GEOMETRY_STRATEGY_TRANSFORM_HPP
+
+#include <functional>
+
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/core/coordinate_dimension.hpp>
+#include <geometry/core/concepts/point_concept.hpp>
+
+#include <geometry/arithmetic/arithmetic.hpp>
+#include <geometry/util/copy.hpp>
+#include <geometry/util/math.hpp>
+#include <geometry/util/promotion_traits.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+
+ namespace transform
+ {
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename PS, typename PD, size_t D, size_t N, template <typename> class F>
+ struct transform_coordinates
+ {
+ static inline void transform(const PS& source, PD& dest, double value)
+ {
+ typedef typename select_coordinate_type<PS, PD>::type T;
+ F<T> function;
+ set<D>(dest, boost::numeric_cast<T>(function(get<D>(source), value)));
+ transform_coordinates<PS, PD, D + 1, N, F>::transform(source, dest, value);
+ }
+ };
+
+ template <typename PS, typename PD, size_t N, template <typename> class F>
+ struct transform_coordinates<PS, PD, N, N, F>
+ {
+ static inline void transform(const PS& source, PD& dest, double value)
+ {}
+ };
+ } // namespace impl
+ #endif
+
+
+
+ /*!
+ \brief Transformation strategy to copy one point to another using assignment operator
+ \ingroup transform
+ \tparam P point type
+ */
+ template <typename P>
+ struct copy_direct
+ {
+ inline bool operator()(const P& p1, P& p2) const
+ {
+ p2 = p1;
+ return true;
+ }
+ };
+
+ /*!
+ \brief Transformation strategy to do copy a point, copying per coordinate.
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ struct copy_per_coordinate
+ {
+ inline bool operator()(const P1& p1, P2& p2) const
+ {
+ // Defensive check, dimensions are equal, selected by specialization
+ assert_dimension_equal<P1, P2>();
+
+ copy_coordinates(p1, p2);
+ return true;
+ }
+ };
+
+
+ /*!
+ \brief Transformation strategy to go from degree to radian and back
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ \tparam F additional functor to divide or multiply with d2r
+ */
+ template <typename P1, typename P2, template <typename> class F>
+ struct degree_radian_vv
+ {
+ inline bool operator()(const P1& p1, P2& p2) const
+ {
+ // Spherical coordinates always have 2 coordinates measured in angles
+ // The optional third one is distance/height, provided in another strategy
+ // Polar coordinates having one angle, will be also in another strategy
+ assert_dimension<P1, 2>();
+ assert_dimension<P2, 2>();
+
+ impl::transform_coordinates<P1, P2, 0, 2, F>::transform(p1, p2, math::d2r);
+ return true;
+ }
+ };
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+
+ /// Helper function for conversion, phi/theta are in radians
+ template <typename P>
+ inline void spherical_to_cartesian(double phi, double theta, double r, P& p)
+ {
+ assert_dimension<P, 3>();
+
+ // http://en.wikipedia.org/wiki/List_of_canonical_coordinate_transformations#From_spherical_coordinates
+ // Phi = first, theta is second, r is third, see documentation on cs::spherical
+ double sin_theta = sin(theta);
+ set<0>(p, r * sin_theta * cos(phi));
+ set<1>(p, r * sin_theta * sin(phi));
+ set<2>(p, r * cos(theta));
+ }
+
+
+ /// Helper function for conversion
+ template <typename P>
+ inline bool cartesian_to_spherical2(double x, double y, double z, P& p)
+ {
+ assert_dimension<P, 2>();
+
+ // http://en.wikipedia.org/wiki/List_of_canonical_coordinate_transformations#From_Cartesian_coordinates
+
+ // TODO: MAYBE ONLY IF TO BE CHECKED?
+ double r = sqrt(x * x + y * y + z * z);
+
+ // Unit sphere, r should be 1
+ typedef typename coordinate_type<P>::type T;
+ if (std::abs(r - 1.0) > std::numeric_limits<T>::epsilon())
+ {
+ return false;
+ }
+ // end todo
+
+ set_from_radian<0>(p, atan2(y, x));
+ set_from_radian<1>(p, acos(z));
+ return true;
+ }
+
+ template <typename P>
+ inline bool cartesian_to_spherical3(double x, double y, double z, P& p)
+ {
+ assert_dimension<P, 3>();
+
+ // http://en.wikipedia.org/wiki/List_of_canonical_coordinate_transformations#From_Cartesian_coordinates
+ double r = sqrt(x * x + y * y + z * z);
+ set<2>(p, r);
+ set_from_radian<0>(p, atan2(y, x));
+ if (r > 0.0)
+ {
+ set_from_radian<1>(p, acos(z / r));
+ return true;
+ }
+ return false;
+ }
+
+
+ } // namespace impl
+ #endif
+
+
+ /*!
+ \brief Transformation strategy for 2D spherical (phi,theta) to 3D cartesian (x,y,z)
+ \details on Unit sphere
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ struct from_spherical_2_to_cartesian_3
+ {
+ inline bool operator()(const P1& p1, P2& p2) const
+ {
+ assert_dimension<P1, 2>();
+ impl::spherical_to_cartesian(get_as_radian<0>(p1), get_as_radian<1>(p1), 1.0, p2);
+ return true;
+ }
+ };
+
+ /*!
+ \brief Transformation strategy for 3D spherical (phi,theta,r) to 3D cartesian (x,y,z)
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ struct from_spherical_3_to_cartesian_3
+ {
+ inline bool operator()(const P1& p1, P2& p2) const
+ {
+ assert_dimension<P1, 3>();
+ impl::spherical_to_cartesian(
+ get_as_radian<0>(p1), get_as_radian<1>(p1), get<2>(p1), p2);
+ return true;
+ }
+ };
+
+ /*!
+ \brief Transformation strategy for 3D cartesian (x,y,z) to 2D spherical (phi,theta)
+ \details on Unit sphere
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ \note If x,y,z point is not lying on unit sphere, transformation will return false
+ */
+ template <typename P1, typename P2>
+ struct from_cartesian_3_to_spherical_2
+ {
+ inline bool operator()(const P1& p1, P2& p2) const
+ {
+ assert_dimension<P1, 3>();
+ return impl::cartesian_to_spherical2(get<0>(p1), get<1>(p1), get<2>(p1), p2);
+ }
+ };
+
+
+ /*!
+ \brief Transformation strategy for 3D cartesian (x,y,z) to 3D spherical (phi,theta,r)
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ struct from_cartesian_3_to_spherical_3
+ {
+ inline bool operator()(const P1& p1, P2& p2) const
+ {
+ assert_dimension<P1, 3>();
+ return impl::cartesian_to_spherical3(get<0>(p1), get<1>(p1), get<2>(p1), p2);
+ }
+ };
+
+
+ } // namespace transform
+
+
+
+
+
+ } // namespace strategy
+
+
+ #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+
+ /// Specialization for same coordinate system family, same system, same dimension, same point type, can be copied
+ template <typename CS_TAG, typename CS, size_t D, typename P>
+ struct strategy_transform<CS_TAG, CS_TAG, CS, CS, D, D, P, P>
+ {
+ typedef strategy::transform::copy_direct<P> type;
+ };
+
+ /// Specialization for same coordinate system family and system, same dimension, different point type, copy per coordinate
+ template <typename CS_TAG, typename CS, size_t D, typename P1, typename P2>
+ struct strategy_transform<CS_TAG, CS_TAG, CS, CS, D, D, P1, P2>
+ {
+ typedef strategy::transform::copy_per_coordinate<P1, P2> type;
+ };
+
+ /// Specialization to convert from degree to radian for any coordinate system / point type combination
+ template <typename CS_TAG, template<typename> class CS, typename P1, typename P2>
+ struct strategy_transform<CS_TAG, CS_TAG, CS<degree>, CS<radian>, 2, 2, P1, P2>
+ {
+ typedef strategy::transform::degree_radian_vv<P1, P2, std::multiplies> type;
+ };
+
+
+ /// Specialization to convert from radian to degree for any coordinate system / point type combination
+ template <typename CS_TAG, template<typename> class CS, typename P1, typename P2>
+ struct strategy_transform<CS_TAG, CS_TAG, CS<radian>, CS<degree>, 2, 2, P1, P2>
+ {
+ typedef strategy::transform::degree_radian_vv<P1, P2, std::divides> type;
+ };
+
+
+
+ /// Specialization to convert from unit sphere(phi,theta) to XYZ
+ template <typename CS1, typename CS2, typename P1, typename P2>
+ struct strategy_transform<spherical_tag, cartesian_tag, CS1, CS2, 2, 3, P1, P2>
+ {
+ typedef strategy::transform::from_spherical_2_to_cartesian_3<P1, P2> type;
+ };
+
+
+
+ /// Specialization to convert from sphere(phi,theta,r) to XYZ
+ template <typename CS1, typename CS2, typename P1, typename P2>
+ struct strategy_transform<spherical_tag, cartesian_tag, CS1, CS2, 3, 3, P1, P2>
+ {
+ typedef strategy::transform::from_spherical_3_to_cartesian_3<P1, P2> type;
+ };
+
+ /// Specialization to convert from XYZ to unit sphere(phi,theta)
+ template <typename CS1, typename CS2, typename P1, typename P2>
+ struct strategy_transform<cartesian_tag, spherical_tag, CS1, CS2, 3, 2, P1, P2>
+ {
+ typedef strategy::transform::from_cartesian_3_to_spherical_2<P1, P2> type;
+ };
+
+
+ /// Specialization to convert from XYZ to sphere(phi,theta,r)
+ template <typename CS1, typename CS2, typename P1, typename P2>
+ struct strategy_transform<cartesian_tag, spherical_tag, CS1, CS2, 3, 3, P1, P2>
+ {
+ typedef strategy::transform::from_cartesian_3_to_spherical_3<P1, P2> type;
+ };
+
+
+ #endif
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_TRANSFORM_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/transform/inverse_transformer.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/transform/inverse_transformer.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,73 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_INVERSE_TRANSFORMER_HPP
+#define _GEOMETRY_STRATEGY_INVERSE_TRANSFORMER_HPP
+
+
+#include <geometry/strategies/transform/matrix_transformers.hpp>
+
+
+
+#include <boost/numeric/ublas/lu.hpp>
+#include <boost/numeric/ublas/io.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace transform
+ {
+
+ /*!
+ \brief Transformation strategy to do an inverse ransformation in Cartesian system
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ struct inverse_transformer : ublas_transformer<P1, P2>
+ {
+ typedef typename select_coordinate_type<P1, P2>::type T;
+
+ template <typename MT>
+ inline inverse_transformer(const MT& input)
+ {
+ typedef boost::numeric::ublas::matrix<double> M;
+ // create a working copy of the input
+ M copy(input.matrix());
+
+ // create a permutation matrix for the LU-factorization
+ typedef boost::numeric::ublas::permutation_matrix<> PM;
+ PM pm(copy.size1());
+
+ // perform LU-factorization
+ int res = boost::numeric::ublas::lu_factorize<M>(copy, pm);
+ if( res == 0 )
+ {
+ // create identity matrix
+ this->m_matrix.assign(boost::numeric::ublas::identity_matrix<T>(copy.size1()));
+
+ // backsubstitute to get the inverse
+ boost::numeric::ublas::lu_substitute(copy, pm, this->m_matrix);
+ }
+ }
+
+
+ };
+
+
+ } // namespace transform
+
+ } // namespace strategy
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_INVERSE_TRANSFORMER_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/transform/map_transformer.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/transform/map_transformer.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,141 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_MAP_TRANSFORMER_HPP
+#define _GEOMETRY_STRATEGY_MAP_TRANSFORMER_HPP
+
+
+#include <geometry/strategies/transform/matrix_transformers.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace transform
+ {
+
+ /*!
+ \brief Transformation strategy to do map from one to another Cartesian system
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2, bool MIRROR>
+ struct map_transformer : ublas_transformer<P1, P2>
+ {
+ typedef typename select_coordinate_type<P1, P2>::type T;
+ typedef boost::numeric::ublas::matrix<T> M;
+
+ template <typename B, typename D>
+ explicit inline map_transformer(const B& box, const D& width, const D& height)
+ {
+ set_transformation(
+ get<min_corner, 0>(box), get<min_corner, 1>(box),
+ get<max_corner, 0>(box), get<max_corner, 1>(box),
+ width, height);
+ }
+
+ template <typename W, typename D>
+ explicit inline map_transformer(const W& wx1, const W& wy1, const W& wx2, const W& wy2,
+ const D& width, const D& height)
+ {
+ set_transformation(wx1, wy1, wx2, wy2, width, height);
+ }
+
+
+
+
+ private :
+ void set_transformation_point(double wx, double wy, double px, double py, double scale)
+ {
+
+ // Translate to a coordinate system centered on world coordinates (-wx, -wy)
+ M t1(3,3);
+ t1(0,0) = 1; t1(0,1) = 0; t1(0,2) = -wx;
+ t1(1,0) = 0; t1(1,1) = 1; t1(1,2) = -wy;
+ t1(2,0) = 0; t1(2,1) = 0; t1(2,2) = 1;
+
+ // Scale the map
+ M s(3,3);
+ s(0,0) = scale; s(0,1) = 0; s(0,2) = 0;
+ s(1,0) = 0; s(1,1) = scale; s(1,2) = 0;
+ s(2,0) = 0; s(2,1) = 0; s(2,2) = 1;
+
+ // Translate to a coordinate system centered on the specified pixels (+px, +py)
+ M t2(3, 3);
+ t2(0,0) = 1; t2(0,1) = 0; t2(0,2) = px;
+ t2(1,0) = 0; t2(1,1) = 1; t2(1,2) = py;
+ t2(2,0) = 0; t2(2,1) = 0; t2(2,2) = 1;
+
+ // Calculate combination matrix in two steps
+ this->m_matrix = boost::numeric::ublas::prod(s, t1);
+ this->m_matrix = boost::numeric::ublas::prod(t2, this->m_matrix);
+ }
+
+
+ template <typename W, typename D>
+ void set_transformation(const W& wx1, const W& wy1, const W& wx2, const W& wy2,
+ const D& width, const D& height)
+ {
+ D px1 = 0;
+ D py1 = 0;
+ D px2 = width;
+ D py2 = height;
+
+
+ // Calculate appropriate scale, take min because whole box must fit
+ // Scale is in PIXELS/MAPUNITS (meters)
+ double s1 = (px2 - px1) / (wx2 - wx1);
+ double s2 = (py2 - py1) / (wy2 - wy1);
+
+// TEMP, undefine MS "min" macro, todo: solve this better
+#undef min
+ double scale = std::min(s1, s2);
+
+ // Calculate centerpoints
+ double wmx = (wx1 + wx2) / 2.0;
+ double wmy = (wy1 + wy2) / 2.0;
+ double pmx = (px1 + px2) / 2.0;
+ double pmy = (py1 + py2) / 2.0;
+
+ set_transformation_point(wmx, wmy, pmx, pmy, scale);
+
+ if (MIRROR)
+ {
+ // Mirror in y-direction
+ M m(3,3);
+ m(0,0) = 1; m(0,1) = 0; m(0,2) = 0;
+ m(1,0) = 0; m(1,1) = -1; m(1,2) = 0;
+ m(2,0) = 0; m(2,1) = 0; m(2,2) = 1;
+
+ // Translate in y-direction such that it fits again
+ M y(3, 3);
+ y(0,0) = 1; y(0,1) = 0; y(0,2) = 0;
+ y(1,0) = 0; y(1,1) = 1; y(1,2) = height;
+ y(2,0) = 0; y(2,1) = 0; y(2,2) = 1;
+
+ // Calculate combination matrix in two steps
+ this->m_matrix = boost::numeric::ublas::prod(m, this->m_matrix);
+ this->m_matrix = boost::numeric::ublas::prod(y, this->m_matrix);
+ }
+ }
+
+ };
+
+
+ } // namespace transform
+
+
+ } // namespace strategy
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_MAP_TRANSFORMER_HPP

Added: sandbox/ggl/boost/ggl/geometry/strategies/transform/matrix_transformers.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/strategies/transform/matrix_transformers.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,190 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_STRATEGY_MATRIX_TRANSFORMERS_HPP
+#define _GEOMETRY_STRATEGY_MATRIX_TRANSFORMERS_HPP
+
+
+// Remove the ublas checking, otherwise the inverse might fail (while nothing seems to be wrong)
+#define BOOST_UBLAS_TYPE_CHECK 0
+
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+
+#include <boost/numeric/conversion/cast.hpp>
+
+
+namespace geometry
+{
+ namespace strategy
+ {
+ namespace transform
+ {
+
+
+ /*!
+ \brief Transformation strategy to do an affine matrix transformation in Cartesian system
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ class ublas_transformer
+ {
+ protected :
+ typedef typename select_coordinate_type<P1, P2>::type T;
+ typedef boost::numeric::ublas::matrix<T> M;
+ M m_matrix;
+
+ inline ublas_transformer(
+ const T& m_0_0, const T& m_0_1, const T& m_0_2,
+ const T& m_1_0, const T& m_1_1, const T& m_1_2,
+ const T& m_2_0, const T& m_2_1, const T& m_2_2)
+ : m_matrix(3, 3)
+ {
+ m_matrix(0,0) = m_0_0; m_matrix(0,1) = m_0_1; m_matrix(0,2) = m_0_2;
+ m_matrix(1,0) = m_1_0; m_matrix(1,1) = m_1_1; m_matrix(1,2) = m_1_2;
+ m_matrix(2,0) = m_2_0; m_matrix(2,1) = m_2_1; m_matrix(2,2) = m_2_2;
+ }
+
+ inline ublas_transformer()
+ : m_matrix(3, 3)
+ {
+ }
+
+
+ public :
+
+
+ inline bool operator()(const P1& p1, P2& p2) const
+ {
+ assert_dimension<P1, 2>();
+ assert_dimension<P2, 2>();
+
+ const T& c1 = get<0>(p1);
+ const T& c2 = get<1>(p1);
+
+ typedef typename coordinate_type<P2>::type TP;
+
+ set<0>(p2, boost::numeric_cast<TP>(c1 * m_matrix(0,0) + c2 * m_matrix(0,1) + m_matrix(0,2)));
+ set<1>(p2, boost::numeric_cast<TP>(c1 * m_matrix(1,0) + c2 * m_matrix(1,1) + m_matrix(1,2)));
+ return true;
+ }
+
+ const M& matrix() const { return m_matrix; }
+ };
+
+
+ /*!
+ \brief Transformation strategy to translate in Cartesian system
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ struct translate_transformer : ublas_transformer<P1, P2>
+ {
+ typedef typename select_coordinate_type<P1, P2>::type T;
+
+ inline translate_transformer(const T& translate_x, const T& translate_y)
+ : ublas_transformer<P1, P2>(
+ 1, 0, translate_x,
+ 0, 1, translate_y,
+ 0, 0, 1)
+ {}
+ };
+
+
+ /*!
+ \brief Transformation strategy to scale in Cartesian system
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ */
+ template <typename P1, typename P2>
+ struct scale_transformer : ublas_transformer<P1, P2>
+ {
+ typedef typename select_coordinate_type<P1, P2>::type T;
+
+ inline scale_transformer(const T& scale_x, const T& scale_y)
+ : ublas_transformer<P1, P2>(
+ scale_x, 0, 0,
+ 0, scale_y, 0,
+ 0, 0, 1)
+ {}
+ };
+
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename DR>
+ struct as_radian {};
+
+ template <>
+ struct as_radian<radian>
+ {
+ static inline double get(const double& value)
+ {
+ return value;
+ }
+ };
+
+ template <>
+ struct as_radian<degree>
+ {
+ static inline double get(const double& value)
+ {
+ return value * math::d2r;
+ }
+
+ };
+
+
+ template <typename P1, typename P2>
+ struct rad_rotate_transformer : ublas_transformer<P1, P2>
+ {
+ inline rad_rotate_transformer(const double& angle)
+ : ublas_transformer<P1, P2>(
+ cos(angle), sin(angle), 0,
+ -sin(angle), cos(angle), 0,
+ 0, 0, 1)
+ {}
+ };
+
+ }
+ #endif
+
+
+ /*!
+ \brief Transformation strategy to rotate in Cartesian system
+ \ingroup transform
+ \tparam P1 first point type
+ \tparam P2 second point type
+ \tparam DR degree/or/radian, type of rotation angle specification
+ */
+ template <typename P1, typename P2, typename DR>
+ struct rotate_transformer : impl::rad_rotate_transformer<P1, P2>
+ {
+ inline rotate_transformer(const double& angle)
+ : impl::rad_rotate_transformer<P1, P2>(impl::as_radian<DR>::get(angle))
+ {}
+
+ };
+
+
+ } // namespace transform
+
+ } // namespace strategy
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_STRATEGY_MATRIX_TRANSFORMERS_HPP

Added: sandbox/ggl/boost/ggl/geometry/util/assign_box_corner.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/util/assign_box_corner.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,60 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_ASSIGN_BOX_CORNER_HPP
+#define _GEOMETRY_ASSIGN_BOX_CORNER_HPP
+
+
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/core/coordinate_dimension.hpp>
+
+// TODO: merge with "assign"
+
+
+namespace geometry
+{
+
+ /*!
+ \brief Assign one point of a 2D box
+ \ingroup assign
+ \todo will be merged with assign
+ */
+ template <size_t C1, size_t C2, typename B, typename P>
+ inline void assign_box_corner(const B& box, P& point)
+ {
+ // Be sure both are 2-Dimensional
+ assert_dimension<B, 2>();
+ assert_dimension<P, 2>();
+
+ // Copy coordinates
+ typedef typename coordinate_type<P>::type T;
+ set<0>(point, boost::numeric_cast<T>(get<C1, 0>(box)));
+ set<1>(point, boost::numeric_cast<T>(get<C2, 1>(box)));
+ }
+
+ /*!
+ \brief Assign the 4 points of a 2D box
+ \ingroup assign
+ \todo will be merged with assign
+ \note The order can be crucial. Most logical is LOWER, UPPER and sub-order LEFT, RIGHT
+ */
+ template <typename B, typename P>
+ inline void assign_box_corners(const B& box, P& lower_left, P& lower_right, P& upper_left, P& upper_right)
+ {
+ assign_box_corner<min_corner, min_corner>(box, lower_left);
+ assign_box_corner<max_corner, min_corner>(box, lower_right);
+ assign_box_corner<min_corner, max_corner>(box, upper_left);
+ assign_box_corner<max_corner, max_corner>(box, upper_right);
+ }
+
+
+} // namespace
+
+
+#endif //_GEOMETRY_ASSIGN_BOX_CORNER_HPP

Added: sandbox/ggl/boost/ggl/geometry/util/copy.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/util/copy.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,71 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_COPY_HPP
+#define _GEOMETRY_COPY_HPP
+
+#include <boost/concept/requires.hpp>
+#include <boost/numeric/conversion/cast.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+// TODO: merge with "assign"
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ namespace copy
+ {
+ template <typename PS, typename PD, size_t D, size_t N>
+ struct copy_coordinates
+ {
+ static inline void copy(const PS& source, PD& dest)
+ {
+ typedef typename coordinate_type<PD>::type T;
+ set<D>(dest, boost::numeric_cast<T>(get<D>(source)));
+ copy_coordinates<PS, PD, D + 1, N>::copy(source, dest);
+ }
+ };
+
+ template <typename PS, typename PD, size_t N>
+ struct copy_coordinates<PS, PD, N, N>
+ {
+ static inline void copy(const PS& source, PD& dest)
+ {}
+ };
+
+ } // namespace copy
+
+ } // namespace impl
+ #endif
+
+
+ /*!
+ \brief Copies coordinates from source to destination point
+ \ingroup assign
+ \details The function copy_coordinates copies coordinates from one point to another point.
+ Source point and destination point might be of different types.
+ \param source Source point
+ \param dest Destination point
+ \note If destination type differs from source type, they must have the same coordinate count
+ */
+ template <typename PS, typename PD>
+ BOOST_CONCEPT_REQUIRES(((ConstPoint<PS>)) ((Point<PD>)),
+ (void)) copy_coordinates(const PS& source, PD& dest)
+ {
+ //assert_dimension_equal<PD, PS>();
+ impl::copy::copy_coordinates<PS, PD, 0, dimension<PS>::value>::copy(source, dest);
+ }
+
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_COPY_HPP

Added: sandbox/ggl/boost/ggl/geometry/util/for_each_coordinate.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/util/for_each_coordinate.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,58 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_FOR_EACH_COORDINATE_HPP
+#define _GEOMETRY_FOR_EACH_COORDINATE_HPP
+
+
+#include <boost/concept/requires.hpp>
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+namespace geometry
+{
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ template <typename P, int I, int N>
+ struct coordinates_scanner
+ {
+ template <typename Op>
+ static void apply(P& point, Op operation)
+ {
+ operation.template run<P, I>(point);
+ coordinates_scanner<P, I+1, N>::apply(point, operation);
+ }
+ };
+
+ template <typename P, int N>
+ struct coordinates_scanner<P, N, N>
+ {
+ template <typename Op>
+ static void apply(P&, Op)
+ {}
+ };
+
+ } // namespace impl
+ #endif
+
+
+ template <typename P, typename Op>
+ BOOST_CONCEPT_REQUIRES(((Point<P>)),
+ (void)) for_each_coordinate(P& point, Op operation)
+ {
+ impl::coordinates_scanner<
+ P, 0, dimension<P>::value
+ >::apply(point, operation);
+ }
+
+} // namespace geometry
+
+
+#endif

Added: sandbox/ggl/boost/ggl/geometry/util/graticule.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/util/graticule.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,195 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_GRATICULE_HPP
+#define _GEOMETRY_GRATICULE_HPP
+
+#include <string>
+#include <sstream>
+
+#include <boost/numeric/conversion/cast.hpp>
+
+
+
+namespace geometry
+{
+
+ /*!
+ \brief Cardinal directions.
+ \ingroup cs
+ \details They are used in the dms-class. When specified by the library user,
+ north/east/south/west is, in general, enough. When parsed or received by an algorithm,
+ the user knows it it is lat/long but not more
+ */
+ enum cd_selector {/*cd_none, */ north, east, south, west, cd_lat, cd_lon};
+
+ /*!
+ \brief Utility class to assign poinst with degree,minute,second
+ \ingroup cs
+ \note Normally combined with latitude and longitude classes
+ \tparam CD selects if it is north/south/west/east
+ \tparam coordinate value, double/float
+ \par Example:
+ Example showing how to use the dms class
+ \dontinclude doxygen_examples.cpp
+ \skip example_dms
+ \line {
+ \until }
+ */
+ template <cd_selector CD, typename T = double>
+ class dms
+ {
+ public :
+ /// Constructs with a value
+ inline explicit dms(T v)
+ : m_value(v)
+ {}
+ /// Constructs with a degree, minute, optional second
+ inline explicit dms(int d, int m, T s = 0.0)
+ {
+ double v = ((CD == west || CD == south) ? -1.0 : 1.0)
+ * (double(d) + (m / 60.0) + (s / 3600.0));
+
+ m_value = boost::numeric_cast<T>(v);
+
+ }
+
+ // Prohibit automatic conversion to T
+ // because this would enable lon(dms<south>)
+ // inline operator T() const { return m_value; }
+
+ /// Explicit conversion to T (double/float)
+ inline const T& as_value() const
+ {
+ return m_value;
+ }
+
+ /// Get degrees as integer, minutes as integer, seconds as double.
+ inline void get_dms(int& d, int& m, double& s,
+ bool& positive, char& cardinal) const
+ {
+ double value = m_value;
+
+ // Set to normal earth latlong coordinates
+ while (value < -180)
+ {
+ value += 360;
+ }
+ while (value > 180)
+ {
+ value -= 360;
+ }
+ // Make positive and indicate this
+ positive = value > 0;
+
+ // Todo: we might implment template/specializations here
+ // Todo: if it is "west" and "positive", make east? or keep minus sign then?
+
+ cardinal = ((CD == cd_lat && positive) ? 'N'
+ : (CD == cd_lat && !positive) ? 'S'
+ : (CD == cd_lon && positive) ? 'E'
+ : (CD == cd_lon && !positive) ? 'W'
+ : (CD == east) ? 'E'
+ : (CD == west) ? 'W'
+ : (CD == north) ? 'N'
+ : (CD == south) ? 'S'
+ : ' ');
+
+ value = fabs(value);
+
+ // Calculate the values
+ double fraction, integer;
+ fraction = modf(value, &integer);
+ d = int(integer);
+ s = 60.0 * modf(fraction * 60.0, &integer);
+ m = int(integer);
+ }
+
+ /// Get degrees, minutes, seconds as a string, separators can be specified optionally
+ inline std::string get_dms(const std::string& ds = " ",
+ const std::string& ms = "'",
+ const std::string& ss = "\"") const
+ {
+ double s;
+ int d, m;
+ bool positive;
+ char cardinal;
+ get_dms(d, m, s, positive, cardinal);
+ std::ostringstream out;
+ out << d << ds << m << ms << s << ss << " " << cardinal;
+
+
+ return out.str();
+ }
+
+ private :
+ T m_value;
+ };
+
+
+ #ifndef DOXYGEN_NO_IMPL
+ namespace impl
+ {
+ /*!
+ \brief internal base class for latitude and longitude classes
+ \details The latitude longitude classes define different types for lat and lon. This is convenient
+ to construct latlong class without ambiguity.
+ \note It is called graticule, after <em>"This latitude/longitude "webbing" is known as the common
+ graticule" (http://en.wikipedia.org/wiki/Geographic_coordinate_system)</em>
+ \tparam S latitude/longitude
+ \tparam T coordinate type, double float or int
+ */
+ template <typename T>
+ class graticule
+ {
+ public :
+ inline explicit graticule(T v) : m_v(v) {}
+ inline operator T() const { return m_v; }
+ private :
+ T m_v;
+ };
+ }
+ #endif
+
+ /*!
+ \brief Utility class to assign points with latitude value (north/south)
+ \ingroup cs
+ \tparam T coordinate type, double / float
+ \note Often combined with dms class
+ */
+ template <typename T = double> class latitude : public impl::graticule<T>
+ {
+ public :
+ /// Can be constructed with a value
+ inline explicit latitude(T v) : impl::graticule<T>(v) {}
+ /// Can be constructed with a NORTH dms-class
+ inline explicit latitude(const dms<north,T>& v) : impl::graticule<T>(v.as_value()) {}
+ /// Can be constructed with a SOUTH dms-class
+ inline explicit latitude(const dms<south,T>& v) : impl::graticule<T>(v.as_value()) {}
+ };
+ /*!
+ \brief Utility class to assign points with longitude value (west/east)
+ \ingroup cs
+ \tparam T coordinate type, double / float
+ \note Often combined with dms class
+ */
+ template <typename T = double> class longitude : public impl::graticule<T>
+ {
+ public :
+ /// Can be constructed with a value
+ inline explicit longitude(T v) : impl::graticule<T>(v) {}
+ /// Can be constructed with a WEST dms-class
+ inline explicit longitude(const dms<west, T>& v) : impl::graticule<T>(v.as_value()) {}
+ /// Can be constructed with an EAST dms-class
+ inline explicit longitude(const dms<east, T>& v) : impl::graticule<T>(v.as_value()) {}
+ };
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_GRATICULE_HPP

Added: sandbox/ggl/boost/ggl/geometry/util/loop.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/util/loop.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,88 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_LOOP_HPP
+#define _GEOMETRY_LOOP_HPP
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <geometry/geometries/segment.hpp>
+
+
+namespace geometry
+{
+
+
+
+ /*!
+ \brief Loops through segments of a container and call specified functor for all segments.
+ \ingroup loop
+ \details for_each like implementation to:
+ - walk over const segments of a linestring/polygon
+ - be able to break out the loop (if the functor returns false)
+ - have a const functor and keep state in separate state-object
+ - we still keep the "functor" here so it might be a function or an object, at this place
+ - in most algorithms the typename F::state_type is used; in those places it must be an object
+
+ \tparam R range type, for example a vector, linestring, linear_ring
+ \tparam F functor type, class or function, not modified by the algorithm
+ \tparam S state type, might be modified
+ \param range range (linestring iterator pair,vector,list,deque) containing points
+ \param functor functor which is called at each const segment
+ \param state state, specified separately from the strategy functor
+ \return false if the functor returns false, otherwise true
+ \par Concepts
+ - \a V
+ - const_iterator begin()
+ - const_iterator end()
+ - value_type
+ - \a F
+ - <em>if it is a function functor</em>: bool \b function (const segment&, state&)
+ - <em>if it is a class functor</em>: bool operator()(const segment&, state&) const
+ - \a S
+ - no specific requirements here, requirments given by F
+ \note Some algorithms from the Geometry Library, for example within, centroid,
+ use this method.
+ \par Examples:
+ First example, using a class functor
+ \dontinclude doxygen_examples.cpp
+ \skip example_loop1
+ \line {
+ \until //:\\
+ Second example, using a function functor and latlong coordinates
+ \dontinclude doxygen_examples.cpp
+ \skip example_loop2
+ \line {
+ \until //:\\
+ */
+ template<typename R, typename F, typename S>
+ inline bool loop(const R& range, const F& functor, S& state)
+ {
+ typedef typename boost::range_const_iterator<R>::type IT;
+ IT it = boost::begin(range);
+ if (it != boost::end(range))
+ {
+ IT previous = it++;
+ while(it != boost::end(range))
+ {
+ segment<const typename boost::range_value<R>::type> s(*previous, *it);
+ if (! functor(s, state))
+ {
+ return false;
+ }
+ previous = it++;
+ }
+ }
+ return true;
+ }
+
+} // namespace geometry
+
+
+#endif // _GEOMETRY_LOOP_HPP

Added: sandbox/ggl/boost/ggl/geometry/util/math.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/util/math.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,84 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_MATH_HPP
+#define _GEOMETRY_MATH_HPP
+
+#include <limits>
+#include <cmath>
+#include <geometry/util/promotion_traits.hpp>
+
+namespace geometry
+{
+ // Maybe replace this by boost equals or boost ublas numeric equals or so
+
+ /*!
+ \brief returns true if both arguments are equal.
+
+ equals returns true if both arguments are equal.
+ \param a first argument
+ \param b second argument
+ \return true if a == b
+ \note If both a and b are of an integral type, comparison is done by ==. If one of the types
+ is floating point, comparison is done by abs and comparing with epsilon.
+ */
+ template <typename T1, typename T2>
+ inline bool equals(const T1& a, const T2& b)
+ {
+ typedef typename select_type_traits<T1, T2>::type T;
+ if (std::numeric_limits<T>::is_exact)
+ {
+ return a == b;
+ }
+ else
+ {
+ return std::abs(a - b) < std::numeric_limits<T>::epsilon();
+ }
+ }
+
+
+ namespace math
+ {
+ // From boost/.../normal_distribution.hpp : "Can we have a boost::mathconst please?"
+ static double const pi = 2.0 * acos(0.0);
+ static const double two_pi = 2.0 * pi;
+ static const double d2r = pi / 180.0;
+ static const double r2d = 1.0 / d2r;
+
+ /*!
+ \brief Calculates the haversine of an angle
+ \note See http://en.wikipedia.org/wiki/Haversine_formula
+ haversin(alpha) = sin2(alpha/2)
+ */
+ inline double hav(double theta)
+ {
+ double sn = sin(0.5 * theta);
+ return sn * sn;
+ }
+
+ /*!
+ \brief Short utility to return the square
+
+ \param value Value to calculate the square from
+ \return The squared value
+ */
+ inline double sqr(double value) { return value * value; }
+
+ }
+
+
+ // To be moved somewhere.
+ namespace constants
+ {
+ static const double average_earth_radius = 6372795.0;
+ }
+
+
+} // namespace geometry
+
+#endif // _GEOMETRY_MATH_HPP

Added: sandbox/ggl/boost/ggl/geometry/util/promotion_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/boost/ggl/geometry/util/promotion_traits.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,77 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_PROMOTION_TRAITS_HPP
+#define _GEOMETRY_PROMOTION_TRAITS_HPP
+
+#include <geometry/core/coordinate_type.hpp>
+
+
+/*!
+\defgroup utility utility: utilities
+*/
+
+
+
+namespace geometry
+{
+ /*!
+ \brief Traits class to select, of two types, the most accurate type for calculations
+ \ingroup utility
+ \details The promotion traits classes, base class and specializations, compares two types on compile time.
+ For example, if an addition must be done with a double and an integer, the result must be a double.
+ If both types are integer, the results can be an integer.
+ The select_type_traits class and its specializations define the appropriate type in the member type <em>type</em>.
+ \note Might be replaced by the new promotion_traits class of boost.
+ */
+ template<typename T1, typename T2>
+ struct select_type_traits
+ {
+ typedef T1 type;
+ };
+
+
+ #ifndef DOXYGEN_NO_SPECIALIZATIONS
+ // (Partial) specializations
+
+ // Any combination with double will define a double
+ template<typename T> struct select_type_traits<double, T> { typedef double type; };
+ template<typename T> struct select_type_traits<T, double> { typedef double type; };
+ // Avoid ambiguity for the double/double case
+ template<> struct select_type_traits<double, double> { typedef double type; };
+
+ // List other cases
+ template<> struct select_type_traits<int, float> { typedef float type; };
+ template<> struct select_type_traits<float, int> { typedef float type; };
+
+
+ // to be extended
+
+ #endif
+
+
+
+
+ /*!
+ \brief Utility selecting the most appropriate coordinate type.
+ \ingroup utility
+ */
+ template <typename PC1, typename PC2>
+ struct select_coordinate_type
+ {
+ typedef typename select_type_traits<
+ typename coordinate_type<PC1>::type,
+ typename coordinate_type<PC2>::type
+ >::type type;
+ };
+
+
+
+}
+
+#endif // _GEOMETRY_PROMOTION_TRAITS_HPP

Added: sandbox/ggl/libs/ggl/example/01_point_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/01_point_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,73 @@
+// Generic Geometry Library
+// Point Example - showing Cartesian points
+
+#include <geometry/geometry.hpp>
+
+#include <geometry/geometries/cartesian2d.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+int main()
+{
+ using namespace geometry;
+
+ point_2d world(1, 2);
+ std::cout << "Hello " << world << std::endl;
+ std::cout << "Hello (" << world.x() << "," << world.y() << ")" << std::endl;
+
+ // Construct two points using constructor with two values
+ point_2d a(1, 2);
+ point_2d b(5, 6);
+
+ // The distance between them can be calculated
+ std::cout << "distance a-b is " << distance(a,b) << std::endl;
+
+ // Cartesian points have .x() and .y() for getting and setting coordinate values
+ a.x(3);
+ a.y(4);
+ b.x(7);
+ b.y(8);
+ std::cout << "a:" << world.x() << " " << world.y() << std::endl;
+ std::cout << "distance a-b is " << distance(a,b) << std::endl;
+
+ // Several ways of construction:
+ // 1: default constructor, required for every point
+ point_2d c1;
+
+ // 2: for Cartesian points: constructor with two values
+ point_2d c2(1,1);
+
+ // Until here, we assumed Cartesian points, having x,y coordinates. However, the Geometry Library
+ // uses a coordinate agnostic approach. This means that internally there is never referred
+ // to the name of coordinate axes. Points might also have more than 2 dimensions. Spherical
+ // points (which normally have theta/phi) and geographic points (which are referred to by
+ // latitude/longitude) are also possible.
+
+ // Below we do not show all kind of points, but we show the coordinate agnostic ways of
+ // constructing points, assigning values and retrieving values without .x/.y
+ // Developers using Cartesian points can of course still use .x() and .y(), which is more readable.
+
+ // 3: for any point, and other geometry objects: the "make" object generator
+ // (this one requires to specify the point-type). We say this is coordinate agnostic
+ point_2d c3 = make<point_2d>(1,1);
+
+ // 4: there is also an assign algorithm, in the same way as make, but not returning
+ point_2d c4;
+ assign(c4, 1, 1);
+
+ // 5: there is also a parse algorithm which takes strings (not so useful here, but
+ // convenient for geographic points using "32N", "18E" etc).
+ //point_2d c5 = parse<point_2d>("1", "1");
+
+ // The coordinate agnostic way of getting and setting
+ // without referring to .x() and .y()
+ set<0>(a, 2); // set first coordinate to 2
+ set<1>(a, 3); // set second coordinate to 3
+ std::cout << get<0>(a) << "," << get<1>(a) << std::endl;
+
+ // set<2>(a, 4); try to set third coordinate, this won't compile for a 2D point
+
+ // Other examples show other types of points, geometries and more algorithms
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/01_point_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/01_point_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="01_point_example"
+ ProjectGUID="{E7BFC111-F0E5-420F-869C-1FC3212270B5}"
+ RootNamespace="01_point_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\01_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\01_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\01_point_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/02_point_ll_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/02_point_ll_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,70 @@
+// Generic Geometry Library
+// Point Example - showing geographic (latitude longitude) points
+
+#include <geometry/geometry.hpp>
+
+#include <geometry/geometries/latlong.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+int main()
+{
+ using namespace geometry;
+
+ // Declare a latlong point, using doubles and degrees (= default)
+ point_ll_deg paris;
+
+ // Assign coordinates to the latlong point, using the methods lat and lon
+ // Paris 48° 52' 0" N, 2° 19' 59" E
+ paris.lat(dms<north>(48, 52, 0));
+ paris.lon(dms<east>(2, 19, 59));
+
+ std::cout << "Paris: " << paris << std::endl;
+
+ // Constructor using explicit latitude/longitude
+ // Lima 12° 2' 36" S, 77° 1' 42" W
+ point_ll_deg lima(
+ latitude<>(dms<south>(12, 2, 36)),
+ longitude<>(dms<west>(77, 1, 42)));
+
+ std::cout << "Lima: " << lima << std::endl;
+
+ // Construction with parse utiity
+ point_ll_deg amsterdam = parse<point_ll_deg>("52 22'23\"N", "4 53'32\"E");
+ std::cout << "Amsterdam: " << amsterdam << std::endl;
+
+
+ // Calculate the distance using the default strategy (Andoyer), and Vincenty
+ std::cout << "Distance Paris-Lima, Andoyer (default) "
+ << 0.001 * distance(paris, lima)
+ << " km" << std::endl;
+
+ std::cout << "Distance Paris-Lima, Vincenty "
+ << 0.001 * distance(paris, lima,
+ strategy::distance::vincenty<point_ll_deg>())
+ << " km" << std::endl;
+
+ // Using great circle (=haversine), this is less precise because earth is not a sphere
+ std::cout << "Distance Paris-Lima, great circle "
+ << 0.001 * distance(paris, lima,
+ strategy::distance::haversine<point_ll_deg>())
+ << " km" << std::endl;
+
+
+ // Convert a latlong point to radians. This might be convenient, although algorithms
+ // are transparent on degree/radians
+ point_ll_rad paris_rad;
+ transform(paris, paris_rad);
+ std::cout << "Paris in radians: " << paris_rad.lon() << " " << paris_rad.lat() << std::endl;
+
+ point_ll_rad amsterdam_rad;
+ transform(amsterdam, amsterdam_rad);
+ std::cout << "Amsterdam in radians: " << amsterdam_rad.lon() << " " << amsterdam_rad.lat() << std::endl;
+
+ std::cout << "Distance Paris-Amsterdam, (degree) " << 0.001 * distance(paris, amsterdam) << " km" << std::endl;
+ std::cout << "Distance Paris-Amsterdam, (radian) " << 0.001 * distance(paris_rad, amsterdam_rad) << " km" << std::endl;
+ std::cout << "Distance Paris-Amsterdam, (mixed) " << 0.001 * distance(paris, amsterdam_rad) << " km" << std::endl;
+
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/02_point_ll_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/02_point_ll_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="02_point_ll_example"
+ ProjectGUID="{EE76F202-C916-4432-9629-E043098742E0}"
+ RootNamespace="02_point_ll_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\02_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\02_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\02_point_ll_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/03_linestring_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/03_linestring_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,192 @@
+// Generic Geometry Library
+// Linestring Example
+
+#include <algorithm> // for reverse, unique
+
+#include <geometry/geometry.hpp>
+#include <geometry/geometries/cartesian2d.hpp>
+
+// Optional includes to handle c-arrays as points, std::vectors as linestrings
+#include <geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <geometry/geometries/adapted/std_as_linestring.hpp>
+
+// Optional include to stream as WKT
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+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)
+{
+ using namespace geometry;
+
+ // Define a linestring, which is a vector of points, and add some points
+ // (we add them deliberately in different ways)
+ linestring_2d ls;
+
+ // points can be created using "make" and added to a linestring using the std:: "push_back"
+ ls.push_back(make<point_2d>(1.1, 1.1));
+
+ // points can also be assigned using "assign" and added to a linestring using "append"
+ point_2d lp;
+ assign(lp, 2.5, 2.1);
+ append(ls, lp);
+
+
+ // Lines can be streamed as Well Known Text (OGC WKT)
+ std::cout << ls << std::endl;
+
+ // The bounding box of linestrings can be calculated
+ box_2d b;
+ envelope(ls, b);
+ std::cout << b << std::endl;
+
+ // The length of the line can be calulated
+ std::cout << "length: " << length(ls) << std::endl;
+
+ // All things from std::vector can be called, because a linestring is a vector
+ std::cout << "number of points 1: " << ls.size() << std::endl;
+
+ // All things from boost ranges can be called because a linestring is considered as a range
+ std::cout << "number of points 2: " << boost::size(ls) << std::endl;
+
+ // Generic function from geometry/OGC delivers the same value
+ std::cout << "number of points 3: " << num_points(ls) << std::endl;
+
+ // The distance from a point to a linestring can be calculated
+ point_2d p(1.9, 1.2);
+ std::cout << "distance of " << p << " to line: " << 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.
+ double d = distance(p, segment<point_2d >(ls.front(), ls.back()));
+
+ // Add some three points more, let's do it using a classic array.
+ // (See documentation for picture of this linestring)
+ const double c[][2] = { {3.1, 3.1}, {4.9, 1.1}, {3.1, 1.9} };
+ append(ls, c);
+ std::cout << "appended: " << ls << std::endl;
+
+ // Output as iterator-pair on a vector
+ {
+ std::vector<point_2d> v;
+ std::copy(ls.begin(), ls.end(), std::back_inserter(v));
+ std::cout
+ << "as it-pair via make-wkt: "
+ << make_wkt(std::make_pair(v.begin(), v.end()))
+ << std::endl;
+
+ std::cout
+ << "as vector: "
+ << v
+ << std::endl;
+
+ std::cout
+ << "as it-pair: "
+ << std::make_pair(v.begin(), v.end())
+ << 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(boost::begin(ls), boost::end(ls));
+
+ // The other way, using a vector instead of a linestring, is also possible
+ std::vector<point_2d> pv(ls.begin(), ls.end());
+ std::cout << "length: " << length(pv) << 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, last point=double: " << ls << std::endl;
+
+ {
+ linestring_2d 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
+ linestring_2d ls_simplified;
+ simplify(ls, std::back_inserter(ls_simplified), 0.5);
+ std::cout << "simplified: " << ls_simplified << std::endl;
+
+
+ // Lines can be read from Well-Known Text (WKT)
+ linestring_2d wline;
+ from_wkt("LINESTRING(1 1,2 2, 3 3)", wline);
+
+ // for_each:
+ // 1) Lines can be visited with std::for_each
+ // 2) for_each_point is also defined for all geometries
+ // 3) for_each_segment is defined for all geometries to all segments
+ // 4) loop is defined for geometries to visit segments
+ // with state apart, and to be able to break out (not shown here)
+ {
+ linestring_2d lscopy = ls;
+ std::for_each(lscopy.begin(), lscopy.end(), translate_function<point_2d>);
+ for_each_point(lscopy, scale_functor<point_2d>());
+ for_each_point(lscopy, translate_function<point_2d>);
+ std::cout << "modified line: " << lscopy << std::endl;
+ }
+
+ // Lines can be clipped using a clipping box. Clipped lines are added to the output iterator
+ box_2d cb(point_2d(1.5, 1.5), point_2d(4.5, 2.5));
+
+ std::vector<linestring_2d> clipped;
+ intersection(cb, ls, std::back_inserter(clipped));
+
+ // Also possible: clip-output to a vector of vectors
+ std::vector<std::vector<point_2d> > vector_out;
+ intersection(cb, ls, std::back_inserter(vector_out));
+
+ std::cout << "clipped output as vector:" << std::endl;
+ for (size_t i = 0; i < vector_out.size(); i++)
+ {
+ std::copy(vector_out[i].begin(), vector_out[i].end(),
+ std::ostream_iterator<point_2d>(std::cout, " "));
+ std::cout << std::endl;
+ }
+
+ // Calculate the convex hull of the linestring
+ polygon_2d hull;
+ convex_hull(ls, std::back_inserter(hull.outer()));
+ std::cout << "Convex hull:" << hull << std::endl;
+
+ // All the above assumed 2d Cartesian linestrings. There is more.
+ // Let's define a 3d float point ourselves
+ typedef point<float, 3, cs::cartesian> P;
+ typedef linestring<P> L;
+ L line3d;
+ line3d.push_back(make<P>(1,2,3));
+ line3d.push_back(make<P>(4,5,6));
+ line3d.push_back(make<P>(7,8,9));
+
+ // Not all algorithms work on 3d lines. For example convex hull does NOT.
+ // But for example length, distance, simplify, envelope and stream do.
+ std::cout << length(line3d) << " " << line3d << std::endl;
+
+ // There are also lines in latlong, linestring_deg and linestring_rad
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/03_linestring_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/03_linestring_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="03_linestring_example"
+ ProjectGUID="{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}"
+ RootNamespace="03_linestring_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\03_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\03_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\03_linestring_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/04_polygon_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/04_polygon_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,144 @@
+// Generic Geometry Library
+// Polygon Example
+
+#include <algorithm> // for reverse, unique
+
+#include <geometry/geometry.hpp>
+#include <geometry/geometries/cartesian2d.hpp>
+
+#include <geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+
+std::string boolstr(bool v)
+{
+ return v ? "true" : "false";
+}
+
+
+
+int main(void)
+{
+ using namespace geometry;
+
+ // Define a polygon and fill the outer ring.
+ // In most cases you will read it from a file or database
+
+
+
+
+ polygon_2d 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
+ };
+ assign(poly, coor);
+ }
+
+ // Polygons should be closed, and directed clockwise. If you're not sure if that is the case,
+ // call the correct algorithm
+ 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
+ box_2d b;
+ envelope(poly, b);
+ std::cout << b << std::endl;
+
+
+ // The area of the polygon can be calulated
+ std::cout << "area: " << area(poly) << std::endl;
+
+ // And the centroid, which is the center of gravity
+ point_2d cent;
+ centroid(poly, cent);
+ std::cout << "centroid: " << cent << 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: ";
+ label_info<0>(poly, , std::ostream_iterator<point_2d>(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);
+ linear_ring<point_2d>& 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} };
+ assign(inner, coor);
+ }
+
+ 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: " << area(poly) << std::endl;
+ centroid(poly, cent);
+ std::cout << "new centroid: " << cent << std::endl;
+
+ // You can test whether points are within a polygon
+ std::cout << "point in polygon:"
+ << " p1: " << boolstr(within(make<point_2d>(3.0, 2.0), poly))
+ << " p2: " << boolstr(within(make<point_2d>(3.7, 2.0), poly))
+ << " p3: " << boolstr(within(make<point_2d>(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
+ //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.
+
+ // Clip the polygon using a bounding box
+ box_2d cb(make<point_2d>(1.5, 1.5), make<point_2d>(4.5, 2.5));
+ typedef std::vector<polygon_2d > PV;
+ PV v;
+
+ intersection(cb, poly, std::back_inserter(v));
+ std::cout << "Clipped output polygons" << std::endl;
+ for (PV::const_iterator it = v.begin(); it != v.end(); it++)
+ {
+ std::cout << *it << std::endl;
+ }
+
+
+ polygon_2d hull;
+ convex_hull(poly, std::back_inserter(hull.outer()));
+ std::cout << "Convex hull:" << hull << std::endl;
+
+
+ // If you really want:
+ // You don't have to use a vector, you can define a polygon with a deque
+ // You can specify the container for the points and for the inner rings independantly
+
+ typedef polygon<point_2d, std::vector, std::deque> POLY;
+ POLY poly2;
+ ring_type<POLY>::type& ring = exterior_ring(poly2);
+ append(ring, make<point_2d>(2.8, 1.9));
+ append(ring, make<point_2d>(2.9, 2.4));
+ append(ring, make<point_2d>(3.3, 2.2));
+ append(ring, make<point_2d>(3.2, 1.8));
+ append(ring, make<point_2d>(2.8, 1.9));
+ std::cout << poly2 << std::endl;
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/04_polygon_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/04_polygon_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="04_polygon_example"
+ ProjectGUID="{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}"
+ RootNamespace="04_polygon_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\04_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib stlportd_static.lib $(NOINHERIT)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\04_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\04_polygon_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/05_distance_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/05_distance_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,129 @@
+// Generic Geometry Library
+// Distance Example
+
+
+/***
+ 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/geometries/cartesian2d.hpp>
+#include <geometry/geometries/latlong.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#ifndef NO_PROJECTION
+# include <geometry/projections/proj/sterea.hpp>
+# include <geometry/projections/parameters.hpp>
+#endif
+
+
+
+
+int main()
+{
+ using namespace geometry;
+
+ point_ll_deg 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
+ point_ll_deg r(latitude<>(dms<north>(51, 55, 51)), longitude<>(dms<east>(4, 28, 45)));
+
+ // The hague: 52° 4' 48" N, 4° 18' 0" E
+ point_ll_deg h(longitude<>(dms<east>(4, 18, 0)), latitude<>(dms<north>(52, 4, 48)));
+
+ point_ll_rad a_rad, r_rad, h_rad;
+ transform(a, a_rad);
+ transform(r, r_rad);
+ transform(h, h_rad);
+
+#ifndef NO_PROJECTION
+ projection::sterea_ellipsoid<point_ll_rad, point_2d> proj(projection::init("+lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m"));
+
+ point_2d a_rd, r_rd, h_rd;
+ proj.forward(a_rad, a_rd);
+ proj.forward(h_rad, h_rd);
+ proj.forward(r_rad, r_rd);
+#else
+ point_2d a_rd(121267, 487245);
+ point_2d r_rd(92526.2, 438324);
+ point_2d h_rd(80454.2, 455086);
+#endif
+
+
+ // ------------------------------------------------------------------------------------------
+ // 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<point_ll_deg>(6371.0) ) << " km" << std::endl;
+ std::cout << "andoyer: " << 0.001 * distance(a, r, strategy::distance::andoyer<point_ll_deg>() ) << " km" << std::endl;
+ std::cout << "vincenty: " << 0.001 * distance(a, r, strategy::distance::vincenty<point_ll_deg>() ) << " km" << std::endl;
+ std::cout << "vincenty rad: " << 0.001 * distance(a_rad, r_rad, strategy::distance::vincenty<point_ll_rad>() ) << " 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;
+
+ segment_2d ar_xy(a_rd, r_rd);
+
+ double dr = distance(h_rd, ar_xy);
+ std::cout << "in RD: " << 0.001 * dr << std::endl;
+
+ dr = distance(h, segment_ll_deg(a, r));
+ std::cout << "in LL: " << 0.001 * dr << std::endl;
+
+ std::cout << std::endl << "Rotterdam - line Amsterdam,the Hague" << std::endl;
+ dr = distance(r_rd, segment_2d(a_rd, h_rd));
+ std::cout << "in RD: " << 0.001 * dr << std::endl;
+ dr = distance(r, segment_ll_deg(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
+ //point_ll_rad a_rad2 = a;
+
+ // Next line does not compile because you cannot assign latlong to xy
+ // point_2d 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.
+
+ linestring_ll_deg line1;
+ append(line1, a);
+ append(line1, r);
+ std::cout << "length: " << length(line1) << std::endl;
+ std::cout << "length using Vincenty: " << length(line1, strategy::distance::vincenty<point_ll_deg>()) << std::endl;
+
+ linestring_2d line2;
+ append(line2, a_rd);
+ append(line2, r_rd);
+ std::cout << "length: " << length(line2) << std::endl;
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/05_distance_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/05_distance_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="05_distance_example"
+ ProjectGUID="{1D50082A-6BE8-493D-80F5-45CBB46CC593}"
+ RootNamespace="05_distance_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\05_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\05_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\05_distance_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/06_transformation_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/06_transformation_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,38 @@
+// Generic Geometry Library
+// Transformation Example
+
+#include <geometry/geometry.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include <geometry/geometries/cartesian2d.hpp>
+
+
+
+int main()
+{
+ using namespace geometry;
+
+ point_2d p(1, 1);
+ point_2d p2;
+
+ // Example: translate a point over (5,5)
+ strategy::transform::translate_transformer<point_2d, point_2d> translate(5, 5);
+
+ transform(p, p2, translate);
+ std::cout << "transformed point " << p2 << std::endl;
+
+ // Transform a polygon
+ polygon_2d poly, poly2;
+ from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+ transform(poly, poly2, translate);
+
+ std::cout << "transformed polygon " << poly2 << std::endl;
+
+ // Many more transformations are possible:
+ // - from Cartesian to Spherical coordinate systems and back
+ // - from Cartesian to Cartesian (mapping, affine transformations) and back (inverse)
+ // - Map Projections
+ // - from Degree to Radian and back in spherical or geographic coordinate systems
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/06_transformation_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/06_transformation_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="06_transformation_example"
+ ProjectGUID="{34346EC5-1EE8-49D5-AF24-D915B4D7D144}"
+ RootNamespace="06_transformation_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\06_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\06_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\06_transformation_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/c01_custom_point_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c01_custom_point_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,125 @@
+// Generic Geometry Library
+// Custom point Example
+
+#include <geometry/algorithms/distance.hpp>
+#include <geometry/algorithms/make.hpp>
+#include <geometry/geometries/register/register_point.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+// Sample point, defining three color values
+struct my_color_point
+{
+ double red, green, blue;
+};
+
+
+// Sample point, having an int array defined
+struct my_array_point
+{
+ int c[3];
+};
+
+
+// Sample point, having x/y
+struct my_2d
+{
+ float x,y;
+};
+
+// Sample class, protected and construction-time-only x/y,
+// Can (of course) only used in algorithms which take const& points
+class my_class_ro
+{
+ public :
+ my_class_ro(double x, double y) : _x(x), _y(y) {}
+ double x() const { return _x; }
+ double y() const { return _y; }
+ private :
+ double _x, _y;
+};
+
+
+// Sample class using references for read/write
+class my_class_rw
+{
+ public :
+ const double& x() const { return _x; }
+ const double& y() const { return _y; }
+ double& x() { return _x; }
+ double& y() { return _y; }
+ private :
+ double _x, _y;
+};
+
+// Sample class using getters / setters
+class my_class_gs
+{
+ public :
+ const double get_x() const { return _x; }
+ const double get_y() const { return _y; }
+ void set_x(double v) { _x = v; }
+ void set_y(double v) { _y = v; }
+ private :
+ double _x, _y;
+};
+
+
+
+
+GEOMETRY_REGISTER_POINT_3D(my_color_point, double, cs::cartesian, red, green, blue)
+
+GEOMETRY_REGISTER_POINT_3D(my_array_point, int, cs::cartesian, c[0], c[1], c[2])
+
+GEOMETRY_REGISTER_POINT_2D(my_2d, float, cs::cartesian, x, y)
+
+GEOMETRY_REGISTER_POINT_2D_CONST(my_class_ro, double, cs::cartesian, x(), y())
+
+GEOMETRY_REGISTER_POINT_2D(my_class_rw, double, cs::cartesian, x(), y())
+
+GEOMETRY_REGISTER_POINT_2D_GET_SET(my_class_gs, double, cs::cartesian, get_x, get_y, set_x, set_y)
+
+
+
+
+int main()
+{
+ // Create 2 instances of our custom color point
+ my_color_point c1 = geometry::make<my_color_point>(255, 3, 233);
+ my_color_point c2 = geometry::make<my_color_point>(0, 50, 200);
+
+ // The distance between them can be calculated using the cartesian method (=pythagoras)
+ // provided with the library, configured by the coordinate_system type of the point
+ std::cout << "color distance " << c1 << " to " << c2 << " is " << geometry::distance(c1,c2) << std::endl;
+
+ my_array_point a1 = {0};
+ my_array_point a2 = {0};
+ geometry::assign(a1, 1, 2, 3);
+ geometry::assign(a2, 3, 2, 1);
+
+ std::cout << "color distance " << a1 << " to " << a2 << " is " << geometry::distance(a1,a2) << std::endl;
+
+ my_2d p1 = {1, 5};
+ my_2d p2 = {3, 4};
+ std::cout << "float distance " << p1 << " to " << p2 << " is " << geometry::distance(p1,p2) << std::endl;
+
+
+ my_class_ro cro1(1, 2);
+ my_class_ro cro2(3, 4);
+ std::cout << "class ro distance " << cro1 << " to " << cro2 << " is " << geometry::distance(cro1,cro2) << std::endl;
+
+ my_class_rw crw1;
+ my_class_rw crw2;
+ geometry::assign(crw1, 1, 2);
+ geometry::assign(crw2, 3, 4);
+ std::cout << "class r/w distance " << crw1 << " to " << crw2 << " is " << geometry::distance(crw1,crw2) << std::endl;
+
+ my_class_gs cgs1;
+ my_class_gs cgs2;
+ geometry::assign(cgs1, 1, 2);
+ geometry::assign(cgs2, 3, 4);
+ std::cout << "class g/s distance " << crw1 << " to " << crw2 << " is " << geometry::distance(cgs1,cgs2) << std::endl;
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/c01_custom_point_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c01_custom_point_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c01_custom_point_example"
+ ProjectGUID="{B368C99D-8464-493C-A05B-904F53909046}"
+ RootNamespace="c01_custom_point_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c01_custom_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c01_custom_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\c01_custom_point_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/c02_custom_box_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c02_custom_box_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,72 @@
+// Generic Geometry Library
+// Custom point Example
+
+#include <geometry/algorithms/make.hpp>
+#include <geometry/algorithms/within.hpp>
+#include <geometry/geometries/register/register_point.hpp>
+#include <geometry/geometries/register/register_box.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+struct my_point
+{
+ double x, y;
+};
+
+struct my_int_point
+{
+ int x, y;
+};
+
+
+struct my_box
+{
+ my_point ll, ur;
+};
+
+struct my_box_ltrb
+{
+ int left, top, right, bottom;
+};
+
+struct my_box_4
+{
+ double coors[4];
+};
+
+
+template <typename P>
+struct my_box_t
+{
+ P ll, ur;
+};
+
+
+GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y)
+GEOMETRY_REGISTER_POINT_2D(my_int_point, int, cs::cartesian, x, y)
+
+GEOMETRY_REGISTER_BOX(my_box, my_point, ll, ur)
+
+GEOMETRY_REGISTER_BOX_TEMPLATIZED(my_box_t, P, ll, ur)
+
+GEOMETRY_REGISTER_BOX_2D_4VALUES(my_box_ltrb, my_int_point, left, top, right, bottom)
+
+GEOMETRY_REGISTER_BOX_2D_4VALUES(my_box_4, my_point, coors[0], coors[1], coors[2], coors[3])
+
+
+int main()
+{
+ my_point p = geometry::make<my_point>(3.5, 3.5);
+ my_box b = geometry::make<my_box>(0, 0, 2, 2);
+ my_box_ltrb b1 = geometry::make<my_box_ltrb>(0, 0, 3, 3);
+ my_box_4 b4 = geometry::make<my_box_4>(0, 0, 4, 4);
+ my_box_t<my_point> bt = geometry::make<my_box_t<my_point> >(0, 0, 5, 5);
+
+ std::cout << p << " IN " << b << " : " << int(geometry::within(p, b)) << std::endl;
+ std::cout << p << " IN " << b1 << " : " << int(geometry::within(p, b1)) << std::endl;
+ std::cout << p << " IN " << b4 << " : " << int(geometry::within(p, b4)) << std::endl;
+ std::cout << p << " IN " << bt << " : " << int(geometry::within(p, bt)) << std::endl;
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/c02_custom_box_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c02_custom_box_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c02_custom_box_example"
+ ProjectGUID="{1A68AD9E-7C1A-4340-A8C9-D5362609B0C1}"
+ RootNamespace="c02_custom_box_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c02_custom_box_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c02_custom_box_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\c02_custom_box_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/c03_custom_linestring_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c03_custom_linestring_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,81 @@
+// Generic Geometry Library
+// Custom Linestring Example
+
+#include <geometry/geometry.hpp>
+
+#include <geometry/geometries/register/register_point.hpp>
+
+
+// Define a GPS point with coordinates in latitude/longitude and some additional values
+struct gps_point
+{
+ double latitude, longitude, height;
+ double speed;
+ // Date/time, heading, etc could be added
+
+
+ // The default constructor is required if being used in a vector
+ gps_point() {}
+
+ // Define a constructor to create the point in one line. Order of latitude/longitude
+ // does not matter as long as "E", "N", etc are included
+ gps_point(const std::string& c1, const std::string& c2, double h, double s)
+ : height(h)
+ , speed(s)
+ {
+ geometry::parse(*this, c1, c2);
+ }
+};
+
+
+// Register this point as being a recognizable point by the GGL
+GEOMETRY_REGISTER_POINT_2D(gps_point, double, cs::geographic<degree>, longitude, latitude)
+
+
+// Declare a custom linestring which will have the GPS points
+struct gps_track : std::vector<gps_point>
+{
+ std::string owner;
+ int route_identifier;
+ // etc
+
+ gps_track(int i, const std::string& o)
+ : owner(o)
+ , route_identifier(i)
+ {}
+};
+
+
+// Register the track as well, as being a "linestring" (there is no (not yet) a macro for this)
+namespace geometry
+{
+ namespace traits
+ {
+ template <> struct tag<gps_track> { typedef linestring_tag type; };
+ }
+}
+
+
+
+int main()
+{
+ // Declare a "GPS Track" and add some GPS points
+ gps_track track(23, "Mister G");
+ track.push_back(gps_point("52 22 23 N", "4 53 32 E", 50, 180));
+ track.push_back(gps_point("52 10 00 N", "4 59 59 E", 110, 170));
+ track.push_back(gps_point("52 5 20 N", "5 6 56 E", 0, 90));
+
+ std::cout
+ << "track: " << track.route_identifier << std::endl
+ << "from: " << track.owner << std::endl
+ << "as wkt: " << geometry::make_wkt(track) << std::endl
+ << "length: " << geometry::length(track)/1000.0 << " km" << std::endl;
+
+ // Above gives the idea, shows that custom linestrings can be useful.
+ // We could of course do anything with this track which the library can handle, e.g.:
+ // - simplify it
+ // - calculate distance of point-to-line
+ // - project it to UTM, then transform it to a GIF image (see p03_example)
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/c03_custom_linestring_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c03_custom_linestring_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c03_custom_linestring_example"
+ ProjectGUID="{D24F5517-E2B5-4933-B6E7-47A2F8A08911}"
+ RootNamespace="c03_custom_linestring_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c03_custom_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c03_custom_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\c03_custom_linestring_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/c04_a_custom_triangle_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c04_a_custom_triangle_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,74 @@
+// Generic Geometry Library
+// Custom Triangle Example
+
+
+#include <iostream>
+
+#include <boost/array.hpp>
+
+
+#include <geometry/algorithms/area.hpp>
+#include <geometry/algorithms/centroid.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+struct triangle : public boost::array<geometry::point_xy<double>, 4>
+{
+ inline void close()
+ {
+ (*this)[3] = (*this)[0];
+ }
+};
+
+
+namespace geometry
+{
+ namespace traits
+ {
+ // specialization to register the triangle as being a ring
+ template <>
+ struct tag<triangle>
+ {
+ typedef ring_tag type;
+ };
+ }
+
+
+ // Specializations of algorithms, where useful. If not specialized the default ones
+ // (for linear rings) will be used for triangle. Which is OK as long as the triangle is closed,
+ // that means, has 4 points (the last one being the first)
+ template<>
+ inline double area<triangle>(const triangle& t)
+ {
+ return 0.5 * (
+ (t[1].x() - t[0].x()) * (t[2].y() - t[0].y())
+ - (t[2].x() - t[0].x()) * (t[1].y() - t[0].y())
+ );
+ }
+};
+
+
+
+int main()
+{
+ triangle t;
+
+ t[0].x(0);
+ t[0].y(0);
+ t[1].x(5);
+ t[1].y(0);
+ t[2].x(2.5);
+ t[2].y(2.5);
+
+ t.close();
+
+ std::cout << "Triangle: " << t << std::endl;
+ std::cout << "Area: " << geometry::area(t) << std::endl;
+
+ geometry::point_xy<double> c;
+ geometry::centroid(t, c);
+ std::cout << "Centroid: " << c.x() << "," << c.y() << std::endl;
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/c04_a_custom_triangle_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c04_a_custom_triangle_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c04_a_custom_triangle_example"
+ ProjectGUID="{5E12A414-E180-4E5F-A575-CC98B449B278}"
+ RootNamespace="c04_a_custom_triangle_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c04_a_custom_triangle_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c04_a_custom_triangle_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\c04_a_custom_triangle_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/c04_b_custom_triangle_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c04_b_custom_triangle_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,76 @@
+// Generic Geometry Library
+// Custom triangle template Example
+
+
+#include <boost/array.hpp>
+#include <boost/tuple/tuple.hpp>
+
+#include <geometry/algorithms/area.hpp>
+#include <geometry/algorithms/centroid.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include <geometry/geometries/adapted/tuple.hpp>
+#include <geometry/geometries/adapted/tuple_cartesian.hpp>
+
+
+template <typename P>
+struct triangle : public boost::array<P, 3>
+{
+};
+
+
+namespace geometry
+{
+ namespace traits
+ {
+
+ // specialization to register the triangle as being a ring
+ template <typename P>
+ struct tag<triangle<P> >
+ {
+ typedef ring_tag type;
+ };
+ }
+
+
+ // Specializations of area algorithm
+ namespace dispatch
+ {
+ template<typename P>
+ struct area<ring_tag, triangle<P> >
+ {
+ static inline double calculate(const triangle<P>& t)
+ {
+ return 0.5 * (
+ (get<0>(t[1]) - get<0>(t[0])) * (get<1>(t[2]) - get<1>(t[0]))
+ - (get<0>(t[2]) - get<0>(t[0])) * (get<1>(t[1]) - get<1>(t[0]))
+ );
+ }
+ };
+ }
+
+};
+
+
+
+
+int main()
+{
+ //triangle<geometry::point_xy<double> > t;
+ triangle<boost::tuple<double, double> > t;
+ t[0] = boost::make_tuple(0, 0);
+ t[1] = boost::make_tuple(5, 0);
+ t[2] = boost::make_tuple(2.5, 2.5);
+
+ std::cout << "Triangle: " << t << std::endl;
+ std::cout << "Area: " << geometry::area(t) << std::endl;
+
+ //geometry::point_xy<double> c;
+ boost::tuple<double, double> c;
+ geometry::centroid(t, c);
+ std::cout << "Centroid: " << c << std::endl;
+
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/c04_b_custom_triangle_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/c04_b_custom_triangle_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c04_b_custom_triangle_example"
+ ProjectGUID="{D005D88D-50BD-4D80-8C3B-72F81B1B9719}"
+ RootNamespace="c04_b_custom_triangle_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c04_b_custom_triangle_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\c04_b_custom_triangle_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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\c04_b_custom_triangle_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/contrib/readme.txt
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/contrib/readme.txt 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,3 @@
+To compile the samples x01, x02 and p03:
+- create a folder shapelib-1.2.10 and fill with shapelib from http://shapelib.maptools.org
+- create a folder gd-2.0.35 and fill with gdlib from http://www.libgd.org

Added: sandbox/ggl/libs/ggl/example/doxygen_2.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/doxygen_2.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,150 @@
+// Generic Geometry Library
+// Doxygen Examples, referred to from the sources
+
+#include <boost/tuple/tuple.hpp>
+
+#if defined(_MSC_VER)
+// We deliberately mix float/double's here so turn off warning
+//#pragma warning( disable : 4244 )
+#endif // defined(_MSC_VER)
+
+#include <geometry/geometry.hpp>
+#include <geometry/algorithms/overlaps.hpp>
+#include <geometry/geometries/geometries.hpp>
+#include <geometry/geometries/cartesian2d.hpp>
+#include <geometry/geometries/latlong.hpp>
+#include <geometry/geometries/register/register_point.hpp>
+#include <geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <geometry/geometries/adapted/std_as_linestring.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+// Small QRect simulations following http://doc.trolltech.com/4.4/qrect.html
+// Todo: once work the traits out further, would be nice if there is a real example of this.
+// However for the example it makes no difference, it will work any way.
+struct QPoint
+{
+ int x, y;
+ // In Qt these are methods but for example below it makes no difference
+};
+
+struct QRect
+{
+ int x, y, width, height;
+ QRect(int _x, int _y, int w, int h)
+ : x(_x), y(_y), width(w), height(h)
+ {}
+ // In Qt these are methods but that will work as well, requires changing traits below
+};
+
+
+// Would be get/set with x(),y(),setX(),setY()
+GEOMETRY_REGISTER_POINT_2D(QPoint, int, cs::cartesian, x, y)
+
+
+// Register the QT rectangle. The macro(s) does not offer (yet) enough flexibility to do this in one line,
+// but the traits classes do their job perfectly.
+namespace geometry
+{
+ namespace traits
+ {
+
+ template <> struct tag<QRect> { typedef box_tag type; };
+ template <> struct point_type<QRect> { typedef QPoint type; };
+
+ template <size_t C, size_t D>
+ struct indexed_access<QRect, C, D>
+ {
+ static inline int get(const QRect& qr)
+ {
+ // Would be: x(), y(), width(), height()
+ return C == min_corner && D == 0 ? qr.x
+ : C == min_corner && D == 1 ? qr.y
+ : C == max_corner && D == 0 ? qr.x + qr.width
+ : C == max_corner && D == 1 ? qr.y + qr.height
+ : 0;
+ }
+
+ static inline void set(QRect& qr, const int& value)
+ {
+ // Would be: setX, setY, setWidth, setHeight
+ if (C == min_corner && D == 0) qr.x = value;
+ else if (C == min_corner && D == 1) qr.y = value;
+ else if (C == max_corner && D == 0) qr.width = value - qr.x;
+ else if (C == max_corner && D == 1) qr.height = value - qr.y;
+ }
+ };
+
+ }
+}
+
+
+void example_for_main_page()
+{
+ using namespace geometry;
+
+ int a[2] = {1,1};
+ int b[2] = {2,3};
+ double d = distance(a, b);
+ std::cout << "Distance a-b is:" << d << std::endl;
+
+ ring_2d poly;
+ double points[][2] = {{2.0, 1.3}, {4.1, 3.0}, {5.3, 2.6}, {2.9, 0.7}, {2.0, 1.3}};
+ append(poly, points);
+ boost::tuple<double, double> p = boost::make_tuple(3.7, 2.0);
+ std::cout << "Point p is in polygon? " << (within(p, poly) ? "YES" : "NO") << std::endl;
+
+ std::cout << "Area: " << area(poly) << std::endl;
+
+ double d2 = distance(a, p);
+ std::cout << "Distance a-p is:" << d2 << std::endl;
+
+ point_ll_deg amsterdam, paris;
+ parse(amsterdam, "52 22 23 N", "4 53 32 E");
+ parse(paris, "48 52 0 N", "2 19 59 E");
+ std::cout << "Distance A'dam-Paris: " << distance(amsterdam, paris) / 1000.0 << " kilometers " << std::endl;
+
+ QRect r1(100, 200, 15, 15);
+ QRect r2(110, 210, 20, 20);
+ if (overlaps(r1, r2))
+ {
+ assign(r2, 200, 300, 220, 320);
+ }
+}
+
+
+void example_for_transform()
+{
+ using namespace geometry;
+
+ typedef point<double, 3, cs::cartesian> XYZ;
+ typedef point<double, 3, cs::spherical<degree> > SPH;
+ XYZ p;
+
+ SPH sph1, sph2;
+ assign(sph1, 12.5, 41.90, 1.0);
+ // Go from spherical to Cartesian-3D:
+ transform(sph1, p);
+ // Go back from Cartesian 3D to spherical:
+ transform(p, sph2);
+
+ std::cout << make_wkt(p) << " <-> " << make_wkt(sph2) << std::endl;
+
+ typedef point_xy<double> XY;
+ typedef point_xy<int> PIXEL;
+ XY xy(50, 50);
+ strategy::transform::map_transformer<XY, PIXEL, false> map(0, 0, 100, 100, 1024, 768);
+ PIXEL pix;
+ transform(xy, pix, map);
+ std::cout << pix.x() << "," << pix.y() << std::endl;
+
+}
+
+
+int main(void)
+{
+ example_for_main_page();
+ example_for_transform();
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/doxygen_2.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/doxygen_2.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="doxygen_2"
+ ProjectGUID="{6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}"
+ RootNamespace="doxygen_2"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\doxygen_2"
+ 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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\doxygen_2"
+ 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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </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_2.cpp"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/doxygen_examples.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/doxygen_examples.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,642 @@
+// Generic Geometry Library
+// Doxygen Examples, referred to from the sources
+
+#include <boost/tuple/tuple.hpp>
+
+#if defined(_MSC_VER)
+// We deliberately mix float/double's here so turn off warning
+#pragma warning( disable : 4244 )
+#endif // defined(_MSC_VER)
+
+#include <geometry/geometry.hpp>
+#include <geometry/geometries/geometries.hpp>
+#include <geometry/geometries/adapted/std_as_linestring.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+
+// 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<float, geometry::cs::geographic<geometry::degree> > > 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::wkt<P>(p) << std::endl;
+
+ // or like this:
+ std::cout << geometry::make_wkt(p) << std::endl;
+
+ // or, including streamwkt, like this:
+ std::cout << p << std::endl;
+}
+
+void example_as_wkt_vector()
+{
+ 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 << geometry::make_wkt(std::make_pair(v.begin(), v.end())) << 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);
+ // Center of polygon might have different type then points of polygon
+ 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<double, geometry::cs::geographic<geometry::degree> > 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<double, geometry::cs::geographic<geometry::degree> > 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<double, geometry::cs::geographic<geometry::degree> > deg(geometry::latitude<>(33.0), geometry::longitude<>(-118.0));
+ geometry::point_ll<double, geometry::cs::geographic<geometry::radian> > rad;
+ geometry::transform(deg, rad);
+
+ 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_linestring2()
+{
+ typedef geometry::point_xy<double> P;
+ std::vector<P> vector_in;
+ 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(vector_in));
+
+ geometry::box<P> cb(P(1.5, 1.5), P(4.5, 2.5));
+ typedef std::vector<std::vector<P> > VV;
+ VV vector_out;
+ geometry::intersection(cb, vector_in, std::back_inserter(vector_out));
+
+ std::cout << "Clipped vector(s) " << std::endl;
+ for (VV::const_iterator it = vector_out.begin(); it != vector_out.end(); it++)
+ {
+ std::copy(it->begin(), it->end(), std::ostream_iterator<P>(std::cout, " "));
+ std::cout << std::endl;
+ }
+}
+
+
+
+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: " << int(r.is_type) << std::endl;
+}
+
+
+void example_intersection_polygon1()
+{
+ typedef geometry::point_xy<double> P;
+ typedef std::vector<geometry::polygon<P> > PV;
+
+ geometry::box<P> cb(P(1.5, 1.5), P(4.5, 2.5));
+ geometry::polygon<P> poly;
+ geometry::from_wkt("POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3)"
+ ",(4 2,4.2 1.4,4.8 1.9,4.4 2.2,4 2))", poly);
+
+ PV v;
+ geometry::intersection(cb, poly, std::back_inserter(v));
+
+ std::cout << "Clipped polygon(s) " << std::endl;
+ for (PV::const_iterator it = v.begin(); it != v.end(); it++)
+ {
+ std::cout << *it << 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, std::back_inserter(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 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);
+
+ typedef geometry::strategy::distance::xy_point_segment<P, geometry::segment<const P> > DS;
+ typedef std::ostream_iterator<P> OUT;
+ typedef geometry::strategy::simplify::douglas_peucker<L, OUT, DS> simplification;
+ geometry::simplify(line, OUT(std::cout, "\n"), 0.5, simplification());
+}
+
+
+
+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<float, geometry::cs::geographic<geometry::degree> > 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)
+ << " 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)
+ << " units" << std::endl;
+}
+
+void example_length_linestring_iterators3()
+{
+ using namespace geometry;
+ typedef point_ll<float, geometry::cs::geographic<geometry::degree> > 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, geometry::strategy::distance::vincenty<LL>())
+ << " kilometers" << std::endl;
+}
+
+
+void example_length_linestring_strategy()
+{
+ using namespace geometry;
+ typedef point_ll<float, geometry::cs::geographic<geometry::degree> > 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 << "envelope is " << box << std::endl;
+}
+
+void example_envelope_polygon()
+{
+ using namespace geometry;
+ typedef point_ll<double, geometry::cs::geographic<geometry::degree> > 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_corner().lat());
+ dms<cd_lon> minlon(box.min_corner().lon());
+
+ dms<cd_lat> maxlat(box.max_corner().lat());
+ dms<cd_lon> maxlon(box.max_corner().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<double, geometry::cs::geographic<geometry::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<double, geometry::cs::geographic<geometry::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 P>
+ struct perimeter
+ {
+ struct summation
+ {
+ double sum;
+ summation() : sum(0) {}
+ };
+
+ bool operator()(const geometry::segment<const P>& 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;
+ geometry::polygon<P> poly;
+ geometry::from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+ perimeter<P>::summation peri;
+ geometry::loop(poly.outer(), perimeter<P>(), peri);
+ std::cout << "Perimeter: " << peri.sum << std::endl;
+ }
+} //:\\
+
+
+namespace example_loop2
+{
+ struct summation
+ {
+ double sum;
+ summation() : sum(0) {}
+ };
+
+ // Function functor
+ template <typename P>
+ bool perimeter(const geometry::segment<const P>& 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<double, geometry::cs::geographic<geometry::degree> > P;
+ 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<P>, peri);
+ std::cout << "Perimeter: " << peri.sum/1000.0 << " km" << std::endl;
+ }
+} //:\\
+
+
+
+struct example_point_1
+{
+ // Example point, for example a legacy point defining somewhere an x and an y coordinate
+ double x, y;
+};
+
+
+namespace geometry
+{
+ namespace traits
+ {
+ template <int I> struct accessor;
+
+ template <> struct accessor<0>
+ {
+ inline static double get(const example_point_1& p) { return p.x; }
+ inline static void set(example_point_1& p, const double& value) { p.x = value; }
+ };
+
+ template <> struct accessor<1>
+ {
+ inline static double get(const example_point_1& p) { return p.y; }
+ inline static void set(example_point_1& p, const double& value) { p.y = value; }
+ };
+
+ // For legacy points, define the necessary structs coordinate (with typedef),
+ // dimension (with value) and access (with get function).
+ // Be sure to define them within the namespace geometry::traits
+ template <> struct tag<example_point_1> { typedef point_tag type; };
+ template <> struct coordinate_type<example_point_1> { typedef double type; };
+ template <> struct coordinate_system<example_point_1> { typedef cs::cartesian type; };
+ template <> struct dimension<example_point_1>: boost::mpl::int_<2> {};
+ template <> struct access<example_point_1>
+ {
+ template <int I>
+ static double get(const example_point_1& p)
+ { return accessor<I>::get(p); }
+
+ template <int I>
+ static void set(example_point_1& p, const double& value)
+ { accessor<I>::set(p, value); }
+ };
+ }
+}
+
+namespace example_own_point1
+{
+ // The first way to check a concept at compile time: checking if the input is parameter
+ // or return type is OK.
+ template <typename P>
+ BOOST_CONCEPT_REQUIRES(((geometry::Point<P>)), (void))
+ test1(P& p)
+ {
+ }
+
+ // The second way to check a concept at compile time: checking if the provided type,
+ // inside the function, if OK
+ template <typename P>
+ void test2(P& p)
+ {
+ BOOST_CONCEPT_ASSERT((geometry::Point<P>));
+ }
+
+
+ void example()
+ {
+ example_point_1 p;
+ test1(p);
+ test2(p);
+ }
+} //:\\
+
+
+
+namespace example_own_point2
+{
+ struct example_point_2: boost::tuple<float, float>
+ {
+ example_point_2(float x, float y)
+ {
+ get<0>() = x;
+ get<1>() = y;
+ }
+ };
+}
+
+// WILL BE CONVERTED TO MACRO
+namespace geometry
+{
+ namespace traits
+ {
+ using namespace example_own_point2;
+
+ template <> struct tag<example_point_2 > { typedef point_tag type; };
+ template <> struct coordinate_type<example_point_2 > { typedef float type; };
+ template <> struct coordinate_system<example_point_2 > { typedef geometry::cs::cartesian type; };
+ template <> struct dimension<example_point_2 > : boost::mpl::int_<2> {};
+ template <> struct access<example_point_2 >
+ {
+ template <int I>
+ static inline float get(const example_point_2& p) { return p.get<I>(); }
+
+ template <int I>
+ static inline void set(example_point_2& p, const float& value) { p.get<I>() = value; }
+ };
+
+ // The library user has
+ // 1) either to specify the coordinate system
+ // 2) or include <geometry/geometries/adapted/tuple__at_.hpp> where @=cartesian,geographic,...
+ }
+}
+
+
+namespace example_own_point2
+{
+
+
+ template <typename P>
+ BOOST_CONCEPT_REQUIRES(((geometry::ConstPoint<P>)), (float))
+ test3(P& p)
+ {
+ return geometry::get<0>(p);
+ }
+
+ void example()
+ {
+ example_point_2 p(1,2);
+ test3(p);
+ }
+} //:\\
+
+
+
+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_linestring2();
+ example_intersection_polygon1();
+ example_intersection_segment1();
+
+ example_simplify_linestring1();
+ example_simplify_linestring2();
+
+ 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();
+ example_own_point1::example();
+ example_own_point2::example();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/doxygen_examples.sln
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/doxygen_examples.sln 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,25 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_examples", "doxygen_examples.vcproj", "{861F130D-2849-4B50-B240-049DBD9D3F18}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_2", "doxygen_2.vcproj", "{6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {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
+ {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Debug|Win32.Build.0 = Debug|Win32
+ {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Release|Win32.ActiveCfg = Release|Win32
+ {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/ggl/libs/ggl/example/doxygen_examples.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/doxygen_examples.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="doxygen_examples"
+ ProjectGUID="{861F130D-2849-4B50-B240-049DBD9D3F18}"
+ RootNamespace="doxygen_examples"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="cd ../doc&#x0D;&#x0A;doxygen&#x0D;&#x0A;"
+ />
+ </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="../../../boost/ggl;.;..;../..;../../../../contrib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="cd ../doc&#x0D;&#x0A;doxygen&#x0D;&#x0A;"
+ />
+ </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>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/geometry_examples.sln
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/geometry_examples.sln 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,109 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01_point_example", "01_point_example.vcproj", "{E7BFC111-F0E5-420F-869C-1FC3212270B5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03_linestring_example", "03_linestring_example.vcproj", "{D5CE1A26-1EB7-44A4-84F9-526CFA8C2B74}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04_polygon_example", "04_polygon_example.vcproj", "{1E299DA7-CFD1-4586-B0B0-1ABF2A32ED5B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05_distance_example", "05_distance_example.vcproj", "{1D50082A-6BE8-493D-80F5-45CBB46CC593}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02_point_ll_example", "02_point_ll_example.vcproj", "{EE76F202-C916-4432-9629-E043098742E0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06_transformation_example", "06_transformation_example.vcproj", "{34346EC5-1EE8-49D5-AF24-D915B4D7D144}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c01_custom_point_example", "c01_custom_point_example.vcproj", "{B368C99D-8464-493C-A05B-904F53909046}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x01_shapelib_example", "x01_shapelib_example.vcproj", "{92ECE1AC-1A5D-4554-A8AD-690AC266210D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x02_gd_example", "x02_gd_example.vcproj", "{A73F21AC-6F32-41A9-A86C-53BD4DC84B05}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "p03_example", "p03_example.vcproj", "{130DA4D1-E7E6-4E51-9D97-FC048995FEAC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "p01_example", "p01_example.vcproj", "{697F1239-C3A8-4EB8-9887-D25895FC1D2A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "p02_example", "p02_example.vcproj", "{E521033E-25D0-4E6B-B9E8-C07197606E43}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c04_a_custom_triangle_example", "c04_a_custom_triangle_example.vcproj", "{5E12A414-E180-4E5F-A575-CC98B449B278}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c04_b_custom_triangle_example", "c04_b_custom_triangle_example.vcproj", "{D005D88D-50BD-4D80-8C3B-72F81B1B9719}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c02_custom_box_example", "c02_custom_box_example.vcproj", "{1A68AD9E-7C1A-4340-A8C9-D5362609B0C1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c03_custom_linestring_example", "c03_custom_linestring_example.vcproj", "{D24F5517-E2B5-4933-B6E7-47A2F8A08911}"
+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
+ {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
+ {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Debug|Win32.Build.0 = Debug|Win32
+ {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Release|Win32.ActiveCfg = Release|Win32
+ {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Release|Win32.Build.0 = Release|Win32
+ {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Debug|Win32.Build.0 = Debug|Win32
+ {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Release|Win32.ActiveCfg = Release|Win32
+ {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Release|Win32.Build.0 = Release|Win32
+ {130DA4D1-E7E6-4E51-9D97-FC048995FEAC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {130DA4D1-E7E6-4E51-9D97-FC048995FEAC}.Debug|Win32.Build.0 = Debug|Win32
+ {130DA4D1-E7E6-4E51-9D97-FC048995FEAC}.Release|Win32.ActiveCfg = Release|Win32
+ {130DA4D1-E7E6-4E51-9D97-FC048995FEAC}.Release|Win32.Build.0 = Release|Win32
+ {697F1239-C3A8-4EB8-9887-D25895FC1D2A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {697F1239-C3A8-4EB8-9887-D25895FC1D2A}.Debug|Win32.Build.0 = Debug|Win32
+ {697F1239-C3A8-4EB8-9887-D25895FC1D2A}.Release|Win32.ActiveCfg = Release|Win32
+ {697F1239-C3A8-4EB8-9887-D25895FC1D2A}.Release|Win32.Build.0 = Release|Win32
+ {E521033E-25D0-4E6B-B9E8-C07197606E43}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E521033E-25D0-4E6B-B9E8-C07197606E43}.Debug|Win32.Build.0 = Debug|Win32
+ {E521033E-25D0-4E6B-B9E8-C07197606E43}.Release|Win32.ActiveCfg = Release|Win32
+ {E521033E-25D0-4E6B-B9E8-C07197606E43}.Release|Win32.Build.0 = Release|Win32
+ {5E12A414-E180-4E5F-A575-CC98B449B278}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5E12A414-E180-4E5F-A575-CC98B449B278}.Debug|Win32.Build.0 = Debug|Win32
+ {5E12A414-E180-4E5F-A575-CC98B449B278}.Release|Win32.ActiveCfg = Release|Win32
+ {5E12A414-E180-4E5F-A575-CC98B449B278}.Release|Win32.Build.0 = Release|Win32
+ {D005D88D-50BD-4D80-8C3B-72F81B1B9719}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D005D88D-50BD-4D80-8C3B-72F81B1B9719}.Debug|Win32.Build.0 = Debug|Win32
+ {D005D88D-50BD-4D80-8C3B-72F81B1B9719}.Release|Win32.ActiveCfg = Release|Win32
+ {D005D88D-50BD-4D80-8C3B-72F81B1B9719}.Release|Win32.Build.0 = Release|Win32
+ {1A68AD9E-7C1A-4340-A8C9-D5362609B0C1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1A68AD9E-7C1A-4340-A8C9-D5362609B0C1}.Debug|Win32.Build.0 = Debug|Win32
+ {1A68AD9E-7C1A-4340-A8C9-D5362609B0C1}.Release|Win32.ActiveCfg = Release|Win32
+ {1A68AD9E-7C1A-4340-A8C9-D5362609B0C1}.Release|Win32.Build.0 = Release|Win32
+ {D24F5517-E2B5-4933-B6E7-47A2F8A08911}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D24F5517-E2B5-4933-B6E7-47A2F8A08911}.Debug|Win32.Build.0 = Debug|Win32
+ {D24F5517-E2B5-4933-B6E7-47A2F8A08911}.Release|Win32.ActiveCfg = Release|Win32
+ {D24F5517-E2B5-4933-B6E7-47A2F8A08911}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/ggl/libs/ggl/example/p01_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/p01_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="p01_example"
+ ProjectGUID="{697F1239-C3A8-4EB8-9887-D25895FC1D2A}"
+ RootNamespace="p01_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\p01_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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\p01_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"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ RuntimeLibrary="0"
+ EnableEnhancedInstructionSet="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\p01_projection_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/p01_projection_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/p01_projection_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,57 @@
+// Generic Geometry Library
+// Projection example 1, direct
+
+
+#include <geometry/geometry.hpp>
+
+#include <geometry/geometries/cartesian2d.hpp>
+#include <geometry/geometries/latlong.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include <geometry/projections/parameters.hpp>
+#include <geometry/projections/proj/robin.hpp>
+
+
+int main()
+{
+ using namespace geometry;
+
+ // Initialize projection parameters
+ projection::parameters par = projection::init("+ellps=WGS84 +units=m");
+
+ // Construct a Robinson projection, using specified point types
+ // (This delivers a projection without virtual methods. Note that in p02 example
+ // the projection is created using a factory, which delivers a projection with virtual methods)
+ projection::robin_spheroid<point_ll_deg, point_2d> prj(par);
+
+ // Define Amsterdam / Barcelona in decimal degrees / degrees/minutes
+ point_ll_deg amsterdam = parse<point_ll_deg>("52.4N", "5.9E");
+ point_ll_deg barcelona = parse<point_ll_deg>("41 23'N", "2 11'E");
+
+ point_2d pa, pb;
+
+ // Now do the projection. "Forward" means from latlong to meters.
+ // (Note that a map projection might fail. This is not 'exceptional'.
+ // Therefore the forward function does not throw but returns false)
+ if (prj.forward(amsterdam, pa) && prj.forward(barcelona, pb))
+ {
+ std::cout << "Amsterdam: " << pa << std::endl << "Barcelona: " << pb << std::endl;
+
+ std::cout << "Distance (unprojected):" << distance(amsterdam, barcelona) / 1000.0 << " km" << std::endl;
+ std::cout << "Distance ( projected):" << distance(pa, pb) / 1000.0 << " km" << std::endl;
+
+ // Do the inverse projection. "Inverse" means from meters to latlong
+ // It also might fail or might not exist, not all projections
+ // have their inverse implemented
+ point_ll_deg a1;
+ if (prj.inverse(pa, a1))
+ {
+ std::cout << "Amsterdam (original): " << amsterdam << std::endl
+ << "Amsterdam (projected, and back):" << a1 << std::endl;
+ std::cout << "Distance a-a': " << distance(amsterdam, a1) << " meter" << std::endl;
+ }
+ }
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/p02_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/p02_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="p02_example"
+ ProjectGUID="{E521033E-25D0-4E6B-B9E8-C07197606E43}"
+ RootNamespace="p02_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\p02_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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\p02_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"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ RuntimeLibrary="0"
+ EnableEnhancedInstructionSet="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\p02_projfactory_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/p02_projfactory_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/p02_projfactory_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,62 @@
+// Generic Geometry Library
+// Projection example 2, using factory
+
+
+#include <geometry/geometry.hpp>
+
+#include <geometry/geometries/cartesian2d.hpp>
+#include <geometry/geometries/latlong.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include <geometry/projections/parameters.hpp>
+#include <geometry/projections/factory.hpp>
+
+#include <boost/shared_ptr.hpp>
+
+int main()
+{
+ using namespace geometry;
+
+
+ // Initialize projection parameters. For construction using a factory the projection name is required.
+ projection::parameters par = projection::init("+proj=robin +ellps=WGS84 +units=m");
+
+ // Construct the specified projection, using specified point types
+ // Note that this is the only difference from p01_projection_example. It constructs a projection
+ // with virtual methods, which can be used polymorphically. Therefore it is a pointer. For
+ // convenience we use a boost shared pointer here.
+ projection::factory<point_ll_deg, point_2d> fac;
+ boost::shared_ptr<projection::projection<point_ll_deg, point_2d> > prj(fac.create_new(par));
+
+
+ // Define Amsterdam / Barcelona in decimal degrees / degrees/minutes
+ point_ll_deg amsterdam(longitude<>(5.9), latitude<>(52.4));
+ point_ll_deg barcelona(
+ latitude<>(dms<north>(41, 23)),
+ longitude<>(dms<east>(2, 11))
+ );
+
+
+ point_2d pa, pb;
+
+ // Do the forward projection
+ if (prj->forward(amsterdam, pa) && prj->forward(barcelona, pb))
+ {
+ std::cout << "Amsterdam: " << pa << std::endl << "Barcelona: " << pb << std::endl;
+
+ std::cout << "Distance (unprojected):" << distance(amsterdam, barcelona) / 1000.0 << " km" << std::endl;
+ std::cout << "Distance ( projected):" << distance(pa, pb) / 1000.0 << " km" << std::endl;
+
+ // Get the inverse
+ point_ll_deg a1;
+ if (prj->inverse(pa, a1))
+ {
+ std::cout << "Amsterdam (original): " << amsterdam << std::endl
+ << "Amsterdam (projected, and back):" << a1 << std::endl;
+ std::cout << "Distance a-a': " << distance(amsterdam, a1) << " meter" << std::endl;
+ }
+ }
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/p03_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/p03_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="p03_example"
+ ProjectGUID="{130DA4D1-E7E6-4E51-9D97-FC048995FEAC}"
+ RootNamespace="p03_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\p03_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="../../../boost/ggl;.;..;../..;../../../../contrib;./contrib/shapelib-1.2.10;./contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NONDLL"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\p03_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"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../..;../../../../contrib;./contrib/shapelib-1.2.10;./contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NONDLL"
+ GeneratePreprocessedFile="0"
+ RuntimeLibrary="0"
+ EnableEnhancedInstructionSet="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="GD"
+ >
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_gd.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_gif_out.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io_dp.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io_file.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io_ss.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_security.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_topal.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gdhelpers.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gdtables.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="SHAPELIB"
+ >
+ <File
+ RelativePath=".\contrib\shapelib-1.2.10\shpopen.cpp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\p03_projmap_example.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\readme.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/p03_projmap_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/p03_projmap_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,145 @@
+// Generic Geometry Library
+// Projection example 3, combined with shapelib and GD
+
+
+
+#include "shapefil.h"
+#include "gd.h"
+
+#include <geometry/geometry.hpp>
+
+#include <geometry/geometries/cartesian2d.hpp>
+#include <geometry/geometries/latlong.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include <geometry/geometries/adapted/std_as_ring.hpp>
+
+#include <geometry/geometries/register/register_point.hpp>
+
+#include <projections/project_transformer.hpp>
+
+
+#include "example/shapelib_common.hpp"
+
+
+
+// Register a GD gdPoint such that it is recognized by the geometry library
+// and can therefore be used in transformations
+GEOMETRY_REGISTER_POINT_2D(gdPoint, int, cs::cartesian, x, y)
+
+
+
+
+
+int main(int argc, char** argv)
+{
+ using namespace geometry;
+
+ try
+ {
+ std::string filename("c:/data/spatial/shape/world_free/world.shp");
+
+
+ // All our latlong rings will be collected in a vector
+ std::vector<ring_ll_deg> ll_rings;
+
+
+ // Open a shapefile, for example world countries. This is worked out in example x01
+ read_shapefile(filename, ll_rings);
+
+
+ // Our latlong ring collection will be projected into this vector
+ // (Of course it is also possible to do this while reading and have one vector)
+ std::vector<ring_2d> xy_rings;
+
+
+ // We will use the Mollweide projection by default, in the command line other choices are possible
+ std::string par("+proj=moll +ellps=clrk66");
+ if (argc > 1)
+ {
+ par = argv[1];
+ }
+
+ // Declare transformation strategy which contains a projection
+ projection::project_transformer<point_ll_deg, point_2d> project(par);
+
+ // Project the rings, and at the same time get the bounding box (in xy)
+ // Note that there is, or will be, library utilities to project a geometry
+ box_2d bbox;
+ assign_inverse(bbox);
+ for (std::vector<ring_ll_deg>::const_iterator it = ll_rings.begin(); it != ll_rings.end(); it++)
+ {
+ ring_2d xy_ring;
+
+ if (transform(*it, xy_ring, project))
+ {
+ // Update bbox with box of this projected ring
+ combine(bbox, make_envelope<box_2d>(xy_ring));
+
+ // Add projected ring
+ xy_rings.push_back(xy_ring);
+ }
+ }
+
+ // Create a GD image.
+ gdImagePtr im = gdImageCreateTrueColor(720, 360);
+
+ // Use a transformation matrix which maps from world coordinates (bbox) to the GD Image (width,height)
+ // while also indicating that the GD Image is mirrored in y-direction, coordinates are downwards
+ // (i.e. 0 is top, height = bottom, while in GIS coordinates are upwards)
+ strategy::transform::map_transformer<point_2d, gdPoint, true> matrix(bbox, im->sx, im->sy);
+
+ // Allocate three colors
+ int blue = gdImageColorResolve(im, 0, 0, 255);
+ int green = gdImageColorResolve(im, 0, 255, 0);
+ int black = gdImageColorResolve(im, 0, 0, 0);
+
+ // Paint background
+ gdImageFilledRectangle(im, 0, 0, im->sx, im->sy, blue);
+
+ // Paint all rings
+ for (std::vector<ring_2d>::const_iterator it = xy_rings.begin(); it != xy_rings.end(); it++)
+ {
+ const ring_2d& ring = *it;
+
+ int n = num_points(ring);
+ gdPoint* points = new gdPoint[n];
+
+ for (int i = 0; i < n; i++)
+ {
+ geometry::transform(ring[i], points[i], matrix);
+ }
+
+ // Draw the polygon and the outline...
+ gdImageFilledPolygon(im, points, n, green);
+ gdImagePolygon(im, points, n, black);
+
+ delete[] points;
+ }
+
+
+ // Use GD to create a GIF file
+ FILE* out = fopen("p03_example.gif", "wb");
+ if (out != NULL)
+ {
+ gdImageGif(im, out);
+ fclose(out);
+ }
+
+ gdImageDestroy(im);
+
+ }
+ catch(const std::exception& e)
+ {
+ std::cout << "Exception: " << e.what() << std::endl;
+ return 1;
+ }
+ catch(const std::string& s)
+ {
+ std::cout << "Exception: " << s << std::endl;
+ return 1;
+ }
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/shapelib_common.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/shapelib_common.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,61 @@
+#ifndef __SHAPELIB_COMMON_HPP
+#define __SHAPELIB_COMMON_HPP
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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 "shapefil.h"
+#include <string>
+#include <vector>
+
+// A slightly different implementation of reading shapefile with shapelib.
+// See also 08_shapefile_example
+template <typename T>
+void read_shapefile(const std::string& filename, std::vector<T>& rings)
+{
+ typedef typename geometry::point_type<T>::type P;
+
+ SHPHandle handle = SHPOpen(filename.c_str(), "rb");
+ if (handle <= 0)
+ {
+ throw std::string("File " + filename + " not found");
+ }
+
+ int nShapeType, nEntities;
+ double adfMinBound[4], adfMaxBound[4];
+ SHPGetInfo(handle, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+
+ for (int i = 0; i < nEntities; i++)
+ {
+ SHPObject* psShape = SHPReadObject(handle, i );
+
+ if (psShape->nSHPType == SHPT_POLYGON)
+ {
+ // Read all polygon parts. Holes are ignored, handled as normal parts. Add them as rings
+ int v = 0;
+ for (int p = 0; p < psShape->nParts && v < psShape->nVertices; p++)
+ {
+ T ring;
+ int n = p == psShape->nParts - 1 ?psShape->nVertices : psShape->panPartStart[p + 1];
+ while(v < n)
+ {
+ P point;
+ geometry::assign(point, psShape->padfX[v], psShape->padfY[v]);
+ ring.push_back(point);
+ v++;
+ }
+ rings.push_back(ring);
+ }
+ }
+
+ SHPDestroyObject( psShape );
+ }
+ SHPClose(handle);
+}
+
+#endif

Added: sandbox/ggl/libs/ggl/example/x01_shapelib_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/x01_shapelib_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,110 @@
+// Generic Geometry Library
+// SHAPELIB example
+
+// Shapelib is a well-known and often used library to read (and write) shapefiles by Frank Warmerdam
+
+// To build and run this example:
+// 1) download shapelib from http://shapelib.maptools.org/
+// 2) extract and put the source "shpopen.cpp" in project or makefile
+// 3) download a shapefile, for example world countries from http://aprsworld.net/gisdata/world
+
+
+
+#include "shapefil.h"
+
+#include <geometry/geometry.hpp>
+#include <geometry/geometries/cartesian2d.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+using namespace geometry;
+
+template <typename T, typename F>
+void read_shapefile(const std::string& filename, std::vector<T>& polygons, F functor)
+{
+ try
+ {
+ SHPHandle handle = SHPOpen(filename.c_str(), "rb");
+ if (handle <= 0)
+ {
+ throw std::string("File " + filename + " not found");
+ }
+
+ int nShapeType, nEntities;
+ double adfMinBound[4], adfMaxBound[4];
+ SHPGetInfo(handle, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+
+ for (int i = 0; i < nEntities; i++)
+ {
+ SHPObject* psShape = SHPReadObject(handle, i );
+
+ // Read only polygons, and only those without holes
+ if (psShape->nSHPType == SHPT_POLYGON && psShape->nParts == 1)
+ {
+ T polygon;
+ functor(psShape, polygon);
+ polygons.push_back(polygon);
+ }
+ SHPDestroyObject( psShape );
+ }
+ SHPClose(handle);
+ }
+ catch(const std::string& s)
+ {
+ throw s;
+ }
+ catch(...)
+ {
+ throw std::string("Other exception");
+ }
+}
+
+
+template <typename T>
+void convert(SHPObject* psShape, T& polygon)
+{
+ double* x = psShape->padfX;
+ double* y = psShape->padfY;
+ for (int v = 0; v < psShape->nVertices; v++)
+ {
+ typename point_type<T>::type point;
+ assign(point, x[v], y[v]);
+ append(polygon, point);
+ }
+}
+
+
+int main()
+{
+ std::string filename = "c:/data/spatial/shape/world_free/world.shp";
+
+ std::vector<polygon_2d> polygons;
+
+ try
+ {
+ read_shapefile(filename, polygons, convert<polygon_2d>);
+ }
+ catch(const std::string& s)
+ {
+ std::cout << s << std::endl;
+ return 1;
+ }
+
+ // Do something with the polygons, for example simplify them
+ for (std::vector<polygon_2d>::iterator it = polygons.begin(); it != polygons.end(); it++)
+ {
+ polygon_2d p;
+ simplify(*it, p, 0.01);
+ std::cout << it->outer().size() << "," << p.outer().size() << std::endl;
+ *it = p;
+ }
+ std::cout << "Simplified " << polygons.size() << std::endl;
+
+ double sum = 0;
+ for (std::vector<polygon_2d>::const_iterator it = polygons.begin(); it != polygons.end(); it++)
+ {
+ sum += area(*it);
+ }
+ std::cout << "Total area of " << polygons.size() << " polygons, total: " << sum << std::endl;
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/x01_shapelib_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/x01_shapelib_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="x01_shapelib_example"
+ ProjectGUID="{92ECE1AC-1A5D-4554-A8AD-690AC266210D}"
+ RootNamespace="shapelib"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\shapelib"
+ 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="../../../boost/ggl;.;..;../..;../../../../contrib;./contrib/shapelib-1.2.10;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\shapelib"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../..;../../../../contrib;./contrib/shapelib-1.2.10;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="SHAPELIB"
+ >
+ <File
+ RelativePath=".\contrib\shapelib-1.2.10\shpopen.cpp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\contrib\readme.txt"
+ >
+ </File>
+ <File
+ RelativePath=".\x01_shapelib_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/example/x02_gd_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/x02_gd_example.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,103 @@
+// Generic Geometry Library
+// GD example
+
+// GD is a well-known and often used graphic library to write GIF (and other formats)
+
+// To build and run this example:
+// 1) This example uses also shapelib, see 08_shapelib_example for necessary proceudre
+// 2) download GD from http://www.libgd.org
+// 3) add 11 files mentionded below to the project or makefile
+// 4) for windows, add define NONDLL to indicate GD is not used as a DLL
+
+// GD FILES necessary: gd.c, gd_gd.c, gd_gif_out.c, gd_io*.c, gd_security.c, gd_topal.c, gdhelpers.c, gdtables.c
+
+
+#include "gd.h"
+
+#include <vector>
+
+#include <geometry/geometry.hpp>
+#include <geometry/geometries/cartesian2d.hpp>
+#include <geometry/geometries/latlong.hpp>
+
+#include "example/shapelib_common.hpp"
+
+using namespace geometry;
+
+int main()
+{
+ std::string filename = "c:/data/spatial/shape/world_free/world.shp";
+
+ // The world is measured in latlong (degrees), so latlong (point_ll_deg, ring_ll_deg) is appropriate.
+ // (It is possible to change this in point_xy)
+ // We ignore holes in this sample.
+ // So declare a ring_ll_deg (= closed ring, polygon without holes)
+ std::vector<ring_ll_deg> rings;
+
+ // Open a shapefile, for example world countries
+ try
+ {
+ read_shapefile(filename, rings);
+ }
+ catch(const std::string& s)
+ {
+ std::cout << s << std::endl;
+ return 1;
+ }
+
+
+ // Create a GD image.
+ // A world map, as world.shp, is usually mapped in latitude-longitude (-180..180 and -90..90)
+ // For this sample we use a very simple "transformation"
+ // mapping to 0..720 and 0..360
+ double factor = 2.0;
+ gdImagePtr im = gdImageCreateTrueColor(int(360 * factor), int(180 * factor));
+
+ // Allocate three colors
+ int blue = gdImageColorResolve(im, 0, 52, 255);
+ int green = gdImageColorResolve(im, 0, 255, 0);
+ int black = gdImageColorResolve(im, 0, 0, 0);
+
+ // Paint background
+ gdImageFilledRectangle(im, 0, 0, im->sx, im->sy, blue);
+
+ // Paint all rings
+ for (std::vector<ring_ll_deg>::const_iterator it = rings.begin(); it != rings.end(); it++)
+ {
+ const ring_ll_deg& ring = *it;
+
+ // If wished, suppress too small polygons.
+ // (Note that even in latlong, area is calculated in square meters)
+ if (fabs(area(ring)) > 5000.0e6)
+ {
+ int n = ring.size();
+ gdPoint* points = new gdPoint[n];
+
+ for (int i = 0; i < n; i++)
+ {
+ // Translate lon/lat or x/y to GD x/y points
+ points[i].x = int(factor * (get<0>(ring[i]) + 180.0));
+ points[i].y = im->sy - int(factor * (get<1>(ring[i]) + 90.0));
+ }
+
+ // Draw the polygon...
+ gdImageFilledPolygon(im, points, n, green);
+ // .. and the outline...
+ gdImagePolygon(im, points, n, black);
+
+ delete[] points;
+ }
+ }
+
+ // Use GD to create a GIF file
+ FILE* out = fopen("world.gif", "wb");
+ if (out != NULL)
+ {
+ gdImageGif(im, out);
+ fclose(out);
+ }
+
+ gdImageDestroy(im);
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/example/x02_gd_example.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/example/x02_gd_example.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="x02_gd_example"
+ ProjectGUID="{A73F21AC-6F32-41A9-A86C-53BD4DC84B05}"
+ RootNamespace="x02_gd_example"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\x02_gd_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="../../../boost/ggl;.;..;../..;../../../../contrib;./contrib/shapelib-1.2.10;./contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NONDLL"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\x02_gd_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"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../..;../../../../contrib;./contrib/shapelib-1.2.10;./contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NONDLL"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="GD"
+ >
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_gd.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_gif_out.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io_dp.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io_file.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_io_ss.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_security.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gd_topal.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gdhelpers.c"
+ >
+ </File>
+ <File
+ RelativePath=".\contrib\gd-2.0.35\gdtables.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="SHAPELIB"
+ >
+ <File
+ RelativePath=".\contrib\shapelib-1.2.10\shpopen.cpp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\contrib\readme.txt"
+ >
+ </File>
+ <File
+ RelativePath=".\x02_gd_example.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/access.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/access.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,113 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/algorithms/make.hpp>
+#include <geometry/geometries/geometries.hpp>
+
+#include "common.hpp"
+
+template <typename G>
+void test_get_set()
+{
+ typedef typename geometry::coordinate_type<G>::type T;
+
+ G g;
+ geometry::set<0>(g, T(1));
+ geometry::set<1>(g, T(2));
+
+ T x = geometry::get<0>(g);
+ T y = geometry::get<1>(g);
+
+ BOOST_CHECK_CLOSE(double(x), 1.0, 0.0001);
+ BOOST_CHECK_CLOSE(double(y), 2.0, 0.0001);
+}
+
+
+template <typename G>
+void test_indexed_get_set(G& g)
+{
+ geometry::set<0, 0>(g, 1);
+ geometry::set<0, 1>(g, 2);
+ geometry::set<1, 0>(g, 3);
+ geometry::set<1, 1>(g, 4);
+
+ typedef typename geometry::coordinate_type<G>::type T;
+ T x1 = geometry::get<0, 0>(g);
+ T y1 = geometry::get<0, 1>(g);
+ T x2 = geometry::get<1, 0>(g);
+ T y2 = geometry::get<1, 1>(g);
+
+ BOOST_CHECK_CLOSE(double(x1), 1.0, 0.0001);
+ BOOST_CHECK_CLOSE(double(y1), 2.0, 0.0001);
+ BOOST_CHECK_CLOSE(double(x2), 3.0, 0.0001);
+ BOOST_CHECK_CLOSE(double(y2), 4.0, 0.0001);
+}
+
+template <typename G, typename T>
+void test_indexed_get(const G& g, T a, T b, T c, T d)
+{
+ T x1 = geometry::get<0, 0>(g);
+ T y1 = geometry::get<0, 1>(g);
+ T x2 = geometry::get<1, 0>(g);
+ T y2 = geometry::get<1, 1>(g);
+
+ BOOST_CHECK_CLOSE(double(x1), double(a), 0.0001);
+ BOOST_CHECK_CLOSE(double(y1), double(b), 0.0001);
+ BOOST_CHECK_CLOSE(double(x2), double(c), 0.0001);
+ BOOST_CHECK_CLOSE(double(y2), double(d), 0.0001);
+}
+
+template <typename P>
+void test_all()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ // POINT, setting coordinate
+ test_get_set<P>();
+
+ // N-SPHERE, setting sphere center
+ test_get_set<geometry::nsphere<P, double> >();
+
+ // BOX, setting left/right/top/bottom
+ geometry::box<P> b;
+ test_indexed_get_set(b);
+
+ // SEGMENT (in GGL not having default constructor; however that is not a requirement)
+ P p1 = geometry::make_zero<P>(), p2 = geometry::make_zero<P>();
+ geometry::segment<P> s(p1, p2);
+ test_indexed_get_set(s);
+
+ // CONST SEGMENT
+ geometry::set<0>(p1, 1); // we don't use assign because dim in {2,3}
+ geometry::set<1>(p1, 2);
+ geometry::set<0>(p2, 3);
+ geometry::set<1>(p2, 4);
+ geometry::segment<const P> cs(p1, p2);
+ test_indexed_get(cs, T(1), T(2), T(3), T(4));
+
+ // TODO, linestring, linear_ring, polygon
+}
+
+
+
+int test_main(int, char* [])
+{
+ test_get_set<int[2]>();
+ test_get_set<float[2]>();
+ test_get_set<double[2]>();
+
+ //test_all<test_point>();
+ test_all<geometry::point<int, 2, geometry::cs::cartesian> >();
+ test_all<geometry::point<float, 2, geometry::cs::cartesian> >();
+ test_all<geometry::point<double, 2, geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/access.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/access.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="access"
+ ProjectGUID="{5542B963-D229-4393-968F-E62DDCE4B87B}"
+ RootNamespace="access"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\access"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\access"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\access.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/append.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/append.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,71 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <boost/concept/requires.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/algorithms/make.hpp>
+
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/append.hpp>
+#include <geometry/algorithms/num_points.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+#include <geometry/geometries/adapted/std_as_linestring.hpp>
+#include <geometry/geometries/adapted/boost_array_as_linestring.hpp>
+
+#include <geometry/core/concepts/linestring_concept.hpp>
+
+
+#include "common.hpp"
+
+
+
+template <typename G>
+void test_geometry()
+{
+ //BOOST_CONCEPT_ASSERT((geometry::Linestring<G>));
+ //BOOST_CONCEPT_ASSERT((geometry::ConstLinestring<G>));
+
+ G geometry;
+ typedef typename geometry::point_type<G>::type P;
+
+ geometry::append(geometry, geometry::make_zero<P>());
+ BOOST_CHECK_EQUAL(geometry::num_points(geometry), 1);
+
+ geometry::clear(geometry);
+ BOOST_CHECK_EQUAL(geometry::num_points(geometry), 0);
+ //P p = boost::range::front(geometry);
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<geometry::linestring<P> >();
+ test_geometry<geometry::linear_ring<P> >();
+ test_geometry<geometry::polygon<P> >();
+
+ test_geometry<std::vector<P> >();
+ test_geometry<std::deque<P> >();
+ //test_geometry<std::list<P> >();
+}
+
+
+
+int test_main(int, char* [])
+{
+ test_all<test_point>();
+ test_all<geometry::point<int, 2, geometry::cs::cartesian> >();
+ test_all<geometry::point<float, 2, geometry::cs::cartesian> >();
+ test_all<geometry::point<double, 2, geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/append.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/append.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="append"
+ ProjectGUID="{774F6471-D8A0-481C-9B0A-4903EED25C70}"
+ RootNamespace="append"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\append"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\append"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\append.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/area.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/area.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,219 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/algorithms/area.hpp>
+#include <geometry/algorithms/transform.hpp>
+#include <geometry/io/wkt/fromwkt.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include <geometry/projections/epsg.hpp>
+#include <geometry/projections/parameters.hpp>
+#include <geometry/projections/proj/sterea.hpp>
+
+#include "common.hpp"
+
+using namespace geometry;
+
+
+template <typename P>
+void test_area_box()
+{
+
+ P min, max;
+ set<0>(min, 0);
+ set<1>(min, 0);
+ set<0>(max, 2);
+ set<1>(max, 2);
+
+ box<P> b(min, max);
+
+ double d = area(b);
+ BOOST_CHECK_CLOSE(d, 4.0, 0.001);
+}
+
+
+template <typename P, typename T>
+void test_area_circle()
+{
+ nsphere<P, T> c;
+
+ set<0>(c.center(), 0);
+ set<1>(c.center(), 0);
+ c.radius(2);
+
+ double d = area(c);
+ BOOST_CHECK_CLOSE(d, 4 * 3.1415926535897932384626433832795, 0.001);
+}
+
+
+template <typename P>
+void test_area_polygon()
+{
+ // without holes
+ polygon<P> poly;
+ from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
+ double d = area(poly);
+ BOOST_CHECK_CLOSE(d, 16.0, 0.001);
+
+ // with holes
+ from_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0), (1 1,2 1,2 2,1 2,1 1))", poly);
+ d = area(poly);
+ BOOST_CHECK_CLOSE(d, 15.0, 0.001);
+}
+
+template <typename PRJ, typename XY, typename LL>
+void add_to_ring(const PRJ& prj, const LL& ll,
+ geometry::linear_ring<LL>& ring_ll,
+ geometry::linear_ring<XY>& ring_xy)
+{
+ ring_ll.push_back(ll);
+
+ XY xy;
+ prj.forward(ll, xy);
+ ring_xy.push_back(xy);
+}
+
+template <typename XY, typename LL>
+void test_area_polygon_ll(bool concave, bool hole)
+{
+ BOOST_ASSERT(! (concave && hole) );
+
+ typedef typename coordinate_type<LL>::type T;
+
+ LL a, r, h, u; // Amsterdam, Rotterdam, The Hague, Utrecht, these cities together are the city group "Randstad"
+ // Amsterdam 52°22'23"N 4°53'32"E
+ a.lat(dms<north, T>(52, 22, 23));
+ a.lon(dms<east, T>(4, 53, 32));
+
+ // Rotterdam 51°55'51"N 4°28'45"E
+ r.lat(dms<north, T>(51, 55, 51));
+ r.lon(dms<east, T>(4, 28, 45));
+
+ // The hague: 52° 4' 48" N, 4° 18' 0" E
+ h.lat(dms<north, T>(52, 4, 48));
+ h.lon(dms<east, T>(4, 18, 0));
+
+ // Utrecht
+ u.lat(dms<north, T>(52, 5, 36));
+ u.lon(dms<east, T>(5, 7, 10));
+
+
+ // Use the Dutch projection (RD), this is EPSG code 28992
+ projection::sterea_ellipsoid<LL, XY> dutch_prj(projection::init(28992));
+
+ // Concave case
+ polygon<LL> randstad;
+ polygon<XY> randstad_xy;
+ add_to_ring(dutch_prj, a, randstad.outer(), randstad_xy.outer());
+ add_to_ring(dutch_prj, u, randstad.outer(), randstad_xy.outer());
+ if (concave)
+ {
+ // Add the city "Alphen" to create a convex case
+ // Alphen 52° 7' 48" N, 4° 39' 0" E
+ LL alphen(latitude<T>(dms<north, T>(52, 7, 48)), longitude<T>(dms<east, T>(4, 39)));
+ add_to_ring(dutch_prj, alphen, randstad.outer(), randstad_xy.outer());
+ }
+ add_to_ring(dutch_prj, r, randstad.outer(), randstad_xy.outer());
+ add_to_ring(dutch_prj, h, randstad.outer(), randstad_xy.outer());
+ add_to_ring(dutch_prj, a, randstad.outer(), randstad_xy.outer());
+
+ // Hole case
+ if (hole)
+ {
+ // Gouda 52° 1' 12" N, 4° 42' 0" E
+ LL gouda(latitude<T>(dms<north, T>(52, 1, 12)), longitude<T>(dms<east, T>(4, 42)));
+ // Alphen 52° 7' 48" N, 4° 39' 0" E
+ LL alphen(latitude<T>(dms<north, T>(52, 7, 48)), longitude<T>(dms<east, T>(4, 39)));
+ // Uithoorn 52° 13' 48" N, 4° 49' 48" E
+ LL uithoorn(latitude<T>(dms<north, T>(52, 13, 48)), longitude<T>(dms<east, T>(4, 49, 48)));
+ // Woerden 52° 5' 9" N, 4° 53' 0" E
+ LL woerden(latitude<T>(dms<north, T>(52, 5, 9)), longitude<T>(dms<east, T>(4, 53, 0)));
+
+ randstad.inners().resize(1);
+ randstad_xy.inners().resize(1);
+
+ typename polygon<LL>::ring_type& ring = randstad.inners()[0];
+ typename polygon<XY>::ring_type& ring_xy = randstad_xy.inners()[0];
+
+ add_to_ring(dutch_prj, gouda, ring, ring_xy);
+ add_to_ring(dutch_prj, alphen, ring, ring_xy);
+ add_to_ring(dutch_prj, uithoorn, ring, ring_xy);
+ add_to_ring(dutch_prj, woerden, ring, ring_xy);
+ add_to_ring(dutch_prj, gouda, ring, ring_xy);
+ }
+
+
+ // Check the area in square KM
+ static const double KM2 = 1.0e6;
+ double d_ll = area(randstad) / KM2;
+ double d_xy = area(randstad_xy) / KM2;
+
+ BOOST_CHECK_CLOSE(d_ll, d_xy, 1.0);
+ if (hole)
+ {
+ BOOST_CHECK_CLOSE(d_ll, 1148.210, 0.01);
+ BOOST_CHECK_CLOSE(d_xy, 1151.573, 0.01);
+ }
+ else
+ {
+ BOOST_CHECK_CLOSE(d_ll, concave ? 977.786 : 1356.168, 0.01);
+ BOOST_CHECK_CLOSE(d_xy, concave ? 980.658 : 1360.140, 0.01);
+
+ // No hole: area of outer should be equal to area of ring
+ double r_ll = area(randstad.outer()) / KM2;
+ double r_xy = area(randstad.outer()) / KM2;
+
+ BOOST_CHECK_CLOSE(d_ll, r_ll, 0.01);
+ BOOST_CHECK_CLOSE(d_ll, r_xy, 0.01);
+ }
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_area_box<P>();
+ test_area_circle<P, double>();
+ test_area_polygon<P>();
+}
+
+template <typename T>
+void test_latlong()
+{
+ test_area_polygon_ll<point_xy<T>, point_ll<T, cs::geographic<degree> > >(false, false);
+ test_area_polygon_ll<point_xy<T>, point_ll<T, cs::geographic<degree> > >(true, false);
+
+ // with holes
+ test_area_polygon_ll<point_xy<T>, point_ll<T, cs::geographic<degree> > >(false, true);
+
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ //test_all<float[2]>(); not yet because cannot be copied, for polygon
+ //test_all<double[2]>();
+ // test_all<test_point >(); does not apply because is defined 3D
+
+ test_all<point_xy<int> >();
+ test_all<point_xy<float> >();
+ test_all<point_xy<double> >();
+
+ test_latlong<double>();
+ test_latlong<float>();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/area.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/area.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="area"
+ ProjectGUID="{E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}"
+ RootNamespace="area"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ >
+ <File
+ RelativePath="..\algorithms\area.hpp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\area.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/arithmetic.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/arithmetic.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,116 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/arithmetic/arithmetic.hpp>
+
+#include <geometry/algorithms/assign.hpp>
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+
+template <typename P>
+void test_addition()
+{
+ P p1;
+ geometry::assign(p1, 1, 2, 3);
+ geometry::add_value(p1, 10);
+ BOOST_CHECK(get<0>(p1) == 11);
+ BOOST_CHECK(get<1>(p1) == 12);
+ BOOST_CHECK(get<2>(p1) == 13);
+
+ P p2;
+ geometry::assign(p2, 4, 5, 6);
+ geometry::add_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == 15);
+ BOOST_CHECK(get<1>(p1) == 17);
+ BOOST_CHECK(get<2>(p1) == 19);
+}
+
+template <typename P>
+void test_subtraction()
+{
+ P p1;
+ geometry::assign(p1, 1, 2, 3);
+ geometry::subtract_value(p1, 10);
+ BOOST_CHECK(get<0>(p1) == -9);
+ BOOST_CHECK(get<1>(p1) == -8);
+ BOOST_CHECK(get<2>(p1) == -7);
+
+ P p2;
+ geometry::assign(p2, 4, 6, 8);
+ geometry::subtract_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == -13);
+ BOOST_CHECK(get<1>(p1) == -14);
+ BOOST_CHECK(get<2>(p1) == -15);
+}
+
+template <typename P>
+void test_multiplication()
+{
+ P p1;
+ geometry::assign(p1, 1, 2, 3);
+ geometry::multiply_value(p1, 5);
+ BOOST_CHECK(get<0>(p1) == 5);
+ BOOST_CHECK(get<1>(p1) == 10);
+ BOOST_CHECK(get<2>(p1) == 15);
+
+ P p2;
+ geometry::assign(p2, 4, 5, 6);
+ geometry::multiply_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == 20);
+ BOOST_CHECK(get<1>(p1) == 50);
+ BOOST_CHECK(get<2>(p1) == 90);
+}
+
+template <typename P>
+void test_division()
+{
+ P p1;
+ geometry::assign(p1, 50, 100, 150);
+ geometry::divide_value(p1, 5);
+ BOOST_CHECK(get<0>(p1) == 10);
+ BOOST_CHECK(get<1>(p1) == 20);
+ BOOST_CHECK(get<2>(p1) == 30);
+
+ P p2;
+ geometry::assign(p2, 2, 4, 6);
+ geometry::divide_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == 5);
+ BOOST_CHECK(get<1>(p1) == 5);
+ BOOST_CHECK(get<2>(p1) == 5);
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_addition<P>();
+ test_subtraction<P>();
+ test_multiplication<P>();
+ test_division<P>();
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, geometry::cs::cartesian> >();
+ test_all<point<float, 3, geometry::cs::cartesian> >();
+ test_all<point<double, 3, geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/arithmetic.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/arithmetic.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="arithmetic"
+ ProjectGUID="{4D447233-54DC-4C1B-B8DF-4689590ACF56}"
+ RootNamespace="arithmetic"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\arithmetic"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\arithmetic"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\arithmetic.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/assign.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/assign.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,169 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/algorithms/assign.hpp>
+#include <geometry/algorithms/num_points.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+template <typename L>
+void check_linestring_2d(const L& line)
+{
+ BOOST_CHECK((boost::size(line) == 3));
+ BOOST_CHECK((geometry::num_points(line) == 3));
+
+ typedef typename point_type<L>::type P;
+ const P& p0 = line[0];
+ BOOST_CHECK(get<0>(p0) == 1);
+ BOOST_CHECK(get<1>(p0) == 2);
+
+ const P& p1 = line[1];
+ BOOST_CHECK(get<0>(p1) == 3);
+ BOOST_CHECK(get<1>(p1) == 4);
+
+ const P& p2 = line[2];
+ BOOST_CHECK(get<0>(p2) == 5);
+ BOOST_CHECK(get<1>(p2) == 6);
+}
+
+
+template <typename P>
+void test_assign_linestring_2d()
+{
+ geometry::linestring<P> line;
+
+ // Test assignment of plain array (note that this is only possible if adapted c-array is included!
+ const double coors[3][2] = { {1, 2}, {3, 4}, {5, 6} };
+ geometry::assign(line, coors);
+ check_linestring_2d(line);
+
+ // Test assignment of point array
+ P points[3];
+ geometry::assign(points[0], 1, 2);
+ geometry::assign(points[1], 3, 4);
+ geometry::assign(points[2], 5, 6);
+ geometry::assign(line, points);
+ check_linestring_2d(line);
+
+ // Test assignment of array with different point-type
+ boost::tuple<float, float> tuples[3];
+ tuples[0] = boost::make_tuple(1, 2);
+ tuples[1] = boost::make_tuple(3, 4);
+ tuples[2] = boost::make_tuple(5, 6);
+ geometry::assign(line, tuples);
+ check_linestring_2d(line);
+}
+
+template <typename P>
+void test_assign_box_2d()
+{
+
+ typedef box<P> B;
+ B b;
+ geometry::assign(b, 1, 2, 3, 4);
+ BOOST_CHECK((get<min_corner, 0>(b) == 1));
+ BOOST_CHECK((get<min_corner, 1>(b) == 2));
+ BOOST_CHECK((get<max_corner, 0>(b) == 3));
+ BOOST_CHECK((get<max_corner, 1>(b) == 4));
+
+ geometry::assign_zero(b);
+ BOOST_CHECK((get<min_corner, 0>(b) == 0));
+ BOOST_CHECK((get<min_corner, 1>(b) == 0));
+ BOOST_CHECK((get<max_corner, 0>(b) == 0));
+ BOOST_CHECK((get<max_corner, 1>(b) == 0));
+
+ geometry::assign_inverse(b);
+ BOOST_CHECK((get<min_corner, 0>(b) > 9999));
+ BOOST_CHECK((get<min_corner, 1>(b) > 9999));
+ BOOST_CHECK((get<max_corner, 0>(b) < 9999));
+ BOOST_CHECK((get<max_corner, 1>(b) < 9999));
+
+}
+
+
+
+
+template <typename P>
+void test_assign_point_3d()
+{
+ P p;
+ geometry::assign(p, 1, 2, 3);
+ BOOST_CHECK(get<0>(p) == 1);
+ BOOST_CHECK(get<1>(p) == 2);
+ BOOST_CHECK(get<2>(p) == 3);
+
+ geometry::impl::assign::assign_value(p, 123);
+ BOOST_CHECK(get<0>(p) == 123);
+ BOOST_CHECK(get<1>(p) == 123);
+ BOOST_CHECK(get<2>(p) == 123);
+
+ geometry::assign_zero(p);
+ BOOST_CHECK(get<0>(p) == 0);
+ BOOST_CHECK(get<1>(p) == 0);
+ BOOST_CHECK(get<2>(p) == 0);
+
+}
+
+
+template <typename P>
+void test_assign_point_2d()
+{
+ P p;
+ geometry::assign(p, 1, 2);
+ BOOST_CHECK(get<0>(p) == 1);
+ BOOST_CHECK(get<1>(p) == 2);
+
+ geometry::impl::assign::assign_value(p, 123);
+ BOOST_CHECK(get<0>(p) == 123);
+ BOOST_CHECK(get<1>(p) == 123);
+
+ geometry::assign_zero(p);
+ BOOST_CHECK(get<0>(p) == 0);
+ BOOST_CHECK(get<1>(p) == 0);
+}
+
+
+int test_main(int, char* [])
+{
+ test_assign_point_3d<int[3]>();
+ test_assign_point_3d<float[3]>();
+ test_assign_point_3d<double[3]>();
+ test_assign_point_3d<test_point>();
+ test_assign_point_3d<point<int, 3, geometry::cs::cartesian> >();
+ test_assign_point_3d<point<float, 3, geometry::cs::cartesian> >();
+ test_assign_point_3d<point<double, 3, geometry::cs::cartesian> >();
+
+ test_assign_point_2d<int[2]>();
+ test_assign_point_2d<float[2]>();
+ test_assign_point_2d<double[2]>();
+ test_assign_point_2d<point<int, 2, geometry::cs::cartesian> >();
+ test_assign_point_2d<point<float, 2, geometry::cs::cartesian> >();
+ test_assign_point_2d<point<double, 2, geometry::cs::cartesian> >();
+
+ test_assign_box_2d<int[2]>();
+ test_assign_box_2d<float[2]>();
+ test_assign_box_2d<double[2]>();
+ test_assign_box_2d<point<int, 2, geometry::cs::cartesian> >();
+ test_assign_box_2d<point<float, 2, geometry::cs::cartesian> >();
+ test_assign_box_2d<point<double, 2, geometry::cs::cartesian> >();
+
+ test_assign_linestring_2d<point<int, 2, geometry::cs::cartesian> >();
+ test_assign_linestring_2d<point<float, 2, geometry::cs::cartesian> >();
+ test_assign_linestring_2d<point<double, 2, geometry::cs::cartesian> >();
+
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/assign.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/assign.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="assign"
+ ProjectGUID="{94BC6547-67C1-44DB-903D-526537A91E23}"
+ RootNamespace="assign"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\assign"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\assign"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\assign.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/box.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/box.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,98 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/geometries/box.hpp>
+
+#include <geometry/algorithms/make.hpp>
+
+#include "common.hpp"
+
+using namespace geometry;
+
+
+template <typename P>
+box<P> create_box()
+{
+ P p1;
+ P p2;
+ assign(p1, 1, 2, 5);
+ assign(p2, 3, 4, 6);
+ return box<P>(p1, p2);
+}
+
+template <typename B, typename T>
+void check_box(B& to_check,
+ T min_x, T min_y, T min_z,
+ T max_x, T max_y, T max_z)
+{
+ BOOST_CHECK_EQUAL(get<0>(to_check.min_corner()), min_x);
+ BOOST_CHECK_EQUAL(get<1>(to_check.min_corner()), min_y);
+ BOOST_CHECK_EQUAL(get<2>(to_check.min_corner()), min_z);
+ BOOST_CHECK_EQUAL(get<0>(to_check.max_corner()), max_x);
+ BOOST_CHECK_EQUAL(get<1>(to_check.max_corner()), max_y);
+ BOOST_CHECK_EQUAL(get<2>(to_check.max_corner()), max_z);
+}
+
+
+template <typename P>
+void test_construction()
+{
+ typedef typename coordinate_type<P>::type T;
+
+ box<P> b1 = make_zero<box<P> >();
+ check_box(b1, T(),T(),T(),T(),T(),T());
+
+ box<P> b2(create_box<P>());
+ check_box(b2, 1,2,5,3,4,6);
+
+ box<P> b3 = make_inverse<box<P> >();
+ check_box(b3, boost::numeric::bounds<T>::highest(),
+ boost::numeric::bounds<T>::highest(),
+ boost::numeric::bounds<T>::highest(),
+ boost::numeric::bounds<T>::lowest(),
+ boost::numeric::bounds<T>::lowest(),
+ boost::numeric::bounds<T>::lowest());
+}
+
+template <typename P>
+void test_assignment()
+{
+ box<P> b(create_box<P>());
+ set<0>(b.min_corner(), 10);
+ set<1>(b.min_corner(), 20);
+ set<2>(b.min_corner(), 30);
+ set<0>(b.max_corner(), 40);
+ set<1>(b.max_corner(), 50);
+ set<2>(b.max_corner(), 60);
+ check_box(b, 10,20,30,40,50,60);
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_construction<P>();
+ test_assignment<P>();
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/box.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/box.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="box"
+ ProjectGUID="{EB7B69C6-2D62-43BC-BA18-D15BEB998665}"
+ RootNamespace="box"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\box"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\box"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\box.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/circle.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/circle.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,136 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/geometries/nsphere.hpp>
+#include <geometry/core/concepts/nsphere_concept.hpp>
+
+#include "common.hpp"
+
+using namespace geometry;
+
+
+// define a custom circle
+struct custom_circle { float x,y; int r; };
+
+// adapt custom circle using traits
+namespace geometry
+{
+ namespace traits
+ {
+ template<> struct tag<custom_circle> { typedef nsphere_tag type; };
+ template<> struct point_type<custom_circle> { typedef point<double, 2, cs::cartesian> type; };
+ template<> struct radius_type<custom_circle> { typedef int type; };
+
+ template<> struct access<custom_circle>
+ {
+ template <int I>
+ static inline const float& get(const custom_circle& c) { return I == 0 ? c.x : c.y; }
+
+ template <int I>
+ static inline void set(custom_circle& c, const float& value)
+ { switch (I) { case 0 : c.x = value; break; case 1 : c.y = value; break; } }
+ };
+
+ template<> struct radius_access<custom_circle, int, 0>
+ {
+ static inline int get(const custom_circle& c) { return c.r; }
+ static inline void set(custom_circle& c, const int& radius) { c.r = radius; }
+ };
+}
+};
+
+
+
+template <typename S, typename RT, typename CT>
+void check_nsphere(S& to_check,
+ RT radius, CT center_x, CT center_y, CT center_z)
+{
+ BOOST_CONCEPT_ASSERT((ConstNsphere<S>));
+ BOOST_CONCEPT_ASSERT((Nsphere<S>));
+
+
+ BOOST_CHECK_EQUAL(get_radius<0>(to_check), radius);
+
+ BOOST_CHECK_EQUAL(get<0>(to_check), center_x);
+ BOOST_CHECK_EQUAL(get<1>(to_check), center_y);
+ if (dimension<S>::value >= 3)
+ {
+ BOOST_CHECK_EQUAL(get<2>(to_check), center_z);
+ }
+}
+
+
+template <typename P, typename T>
+void test_construction()
+{
+ typedef typename coordinate_type<P>::type ctype;
+
+ nsphere<P, T> c1;
+ check_nsphere(c1, 0, 0,0,0);
+
+ P center;
+ geometry::assign(center, 1, 2, 3);
+ nsphere<P, T> c2(center, 4);
+ check_nsphere(c2, 4, 1,2,3);
+}
+
+template <typename C>
+void test_assignment()
+{
+ C c;
+
+ // by hand
+ set<0>(c, 5);
+ set<1>(c, 50);
+ set<2>(c, 500);
+
+ set_radius<0>(c, 5000);
+ check_nsphere(c, 5000, 5,50,500);
+
+ // using assign
+ if (dimension<C>::value >= 3)
+ {
+ assign(c, 6, 60, 600);
+ check_nsphere(c, 5000, 6,60,600);
+ }
+}
+
+
+template <typename P, typename T>
+void test_all()
+{
+ test_construction<P, T>();
+ test_assignment<nsphere<P, T> >();
+ test_assignment<custom_circle>();
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_all<P, int>();
+ test_all<P, float>();
+ test_all<P, double>();
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<int[3]>();
+ //test_all<float[3]>();
+ //test_all<double[3]>();
+ //test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/circle.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/circle.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="circle"
+ ProjectGUID="{E19B65F6-FAF0-47FD-84A2-3BAE1B703967}"
+ RootNamespace="circle"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\circle"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\circle"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\circle.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/combine.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/combine.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,164 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/algorithms/buffer.hpp>
+#include <geometry/algorithms/combine.hpp>
+
+#include <geometry/core/concepts/box_concept.hpp>
+
+#include <geometry/geometries/box.hpp>
+
+#include "common.hpp"
+
+using namespace geometry;
+
+
+template <typename P>
+box<P> create_box()
+{
+ P p1;
+ P p2;
+ geometry::assign(p1, 1, 2, 5);
+ geometry::assign(p2, 3, 4, 6);
+ return box<P>(p1, p2);
+}
+
+template <typename B, typename T>
+void check_box(B& to_check,
+ T min_x, T min_y, T min_z,
+ T max_x, T max_y, T max_z)
+{
+ BOOST_CHECK_EQUAL((geometry::get<geometry::min_corner, 0>(to_check)), min_x);
+ BOOST_CHECK_EQUAL((geometry::get<geometry::min_corner, 1>(to_check)), min_y);
+ BOOST_CHECK_EQUAL((geometry::get<geometry::min_corner, 2>(to_check)), min_z);
+ BOOST_CHECK_EQUAL((geometry::get<geometry::max_corner, 0>(to_check)), max_x);
+ BOOST_CHECK_EQUAL((geometry::get<geometry::max_corner, 1>(to_check)), max_y);
+ BOOST_CHECK_EQUAL((geometry::get<geometry::max_corner, 2>(to_check)), max_z);
+}
+
+template <typename P, typename T>
+void combine_point_and_check(box<P>& to_grow,
+ T grow_x, T grow_y, T grow_z,
+ T result_min_x, T result_min_y, T result_min_z,
+ T result_max_x, T result_max_y, T result_max_z)
+{
+ P p;
+ geometry::assign(p, grow_x, grow_y, grow_z);
+ combine(to_grow, p);
+
+ check_box(to_grow,
+ result_min_x, result_min_y, result_min_z,
+ result_max_x, result_max_y, result_max_z
+ );
+}
+
+template <typename P, typename T>
+void combine_box_and_check(box<P>& to_grow,
+ T grow_min_x, T grow_min_y, T grow_min_z,
+ T grow_max_x, T grow_max_y, T grow_max_z,
+ T result_min_x, T result_min_y, T result_min_z,
+ T result_max_x, T result_max_y, T result_max_z)
+{
+ P p1, p2;
+ geometry::assign(p1, grow_min_x, grow_min_y, grow_min_z);
+ geometry::assign(p2, grow_max_x, grow_max_y, grow_max_z);
+ box<P> grow_box(p1, p2);
+ combine(to_grow, grow_box);
+
+ check_box(to_grow,
+ result_min_x, result_min_y, result_min_z,
+ result_max_x, result_max_y, result_max_z);
+}
+
+template <typename P, typename T>
+void buffer_box_and_check(box<P>& to_grow, T factor,
+ T result_min_x, T result_min_y, T result_min_z,
+ T result_max_x, T result_max_y, T result_max_z)
+{
+ box<P> out;
+ buffer(to_grow, out, factor);
+ to_grow = out;
+
+ check_box(to_grow,
+ result_min_x, result_min_y, result_min_z,
+ result_max_x, result_max_y, result_max_z);
+
+ // Compile test:
+ box<P> out2 = make_buffer<box<P> >(out, factor);
+}
+
+
+template <typename P>
+void test_combine_point()
+{
+ box<P> b(create_box<P>());
+ combine_point_and_check(b, 4,4,5, 1,2,5,4,4,6);
+ combine_point_and_check(b, 4,5,5, 1,2,5,4,5,6);
+ combine_point_and_check(b, 10,10,4, 1,2,4,10,10,6);
+ combine_point_and_check(b, 9,9,4, 1,2,4,10,10,6);
+
+ combine_point_and_check(b, 0,2,7, 0,2,4,10,10,7);
+ combine_point_and_check(b, 0,0,7, 0,0,4,10,10,7);
+ combine_point_and_check(b, -1,-1,5, -1,-1,4,10,10,7);
+ combine_point_and_check(b, 0,0,5, -1,-1,4,10,10,7);
+
+ combine_point_and_check(b, 15,-1,0, -1,-1,0,15,10,7);
+ combine_point_and_check(b, -1,15,10, -1,-1,0,15,15,10);
+}
+
+template <typename P>
+void test_combine_box()
+{
+ box<P> b(create_box<P>());
+
+ combine_box_and_check(b, 0,2,5,4,4,6, 0,2,5,4,4,6);
+ combine_box_and_check(b, 0,1,5,4,6,6, 0,1,5,4,6,6);
+ combine_box_and_check(b, -1,-1,6,10,10,5, -1,-1,5,10,10,6);
+ combine_box_and_check(b, 3,3,6,3,3,5, -1,-1,5,10,10,6);
+
+ combine_box_and_check(b, 3,15,7,-1,3,4, -1,-1,4,10,15,7);
+ combine_box_and_check(b, -15,3,7,3,20,4, -15,-1,4,10,20,7);
+ combine_box_and_check(b, 3,-20,8,3,20,3, -15,-20,3,10,20,8);
+ combine_box_and_check(b, -20,3,8,20,3,3, -20,-20,3,20,20,8);
+}
+
+template <typename P>
+void test_buffer_box()
+{
+ box<P> b(create_box<P>());
+
+ buffer_box_and_check(b, 5, -4,-3,0,8,9,11);
+ buffer_box_and_check(b, -2, -2,-1,2,6,7,9);
+ buffer_box_and_check(b, -100, 98,99,102,-94,-93,-91);
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_combine_point<P>();
+ test_combine_box<P>();
+ test_buffer_box<P>();
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/combine.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/combine.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="combine"
+ ProjectGUID="{5330DAB1-DF27-44FC-971B-3C5094F82FA3}"
+ RootNamespace="combine"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\combine"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\combine"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\combine.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/common.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/common.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,71 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_TEST_COMMON_HPP
+#define _GEOMETRY_TEST_COMMON_HPP
+
+
+#include <geometry/geometries/point.hpp>
+#include <geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <geometry/geometries/adapted/tuple_cartesian.hpp>
+
+
+// Test point class
+
+struct test_point
+{
+ float c1, c2, c3;
+};
+
+
+// Struct set of metafunctions to read/write coordinates above, specialized per dimension
+template <int I> struct accessor {};
+
+template<> struct accessor<0>
+{
+ static inline const float& get(const test_point& p) { return p.c1; }
+ static inline void set(test_point& p, const float& value) { p.c1 = value; }
+};
+
+template<> struct accessor<1>
+{
+ static inline const float& get(const test_point& p) { return p.c2; }
+ static inline void set(test_point& p, const float& value) { p.c2 = value; }
+};
+
+template <> struct accessor<2>
+{
+ static inline const float& get(const test_point& p) { return p.c3; }
+ static inline void set(test_point& p, const float& value) { p.c3 = value; }
+};
+
+
+namespace geometry
+{
+ namespace traits
+ {
+ template<> struct tag<test_point> { typedef point_tag type; };
+ template<> struct coordinate_type<test_point> { typedef float type; };
+ template<> struct coordinate_system<test_point> { typedef cs::cartesian type; };
+ template<> struct dimension<test_point>: boost::mpl::int_<3> {};
+
+ template<> struct access<test_point>
+ {
+ template <int I>
+ static inline const float& get(const test_point& p) { return accessor<I>::get(p); }
+
+ template <int I>
+ static inline void set(test_point& p, const float& value) { accessor<I>::set(p, value); }
+ };
+ }
+};
+
+
+
+#endif

Added: sandbox/ggl/libs/ggl/test/compile_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/compile_test.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,221 @@
+// OLD!
+
+
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels, Geodan 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 <list>
+
+
+#include <string>
+
+#include <limits>
+
+#include <iostream>
+#include <sstream>
+
+#include <geometry/algorithms/area.hpp>
+//#include <geometry/astext.hpp>
+#include <geometry/geometries/box.hpp>
+#include <geometry/algorithms/centroid.hpp>
+#include <geometry/geometries/circle.hpp>
+#include <geometry/algorithms/correct.hpp>
+#include <geometry/algorithms/distance.hpp>
+#include <geometry/algorithms/envelope.hpp>
+#include <geometry/algorithms/foreach.hpp>
+#include <geometry/algorithms/intersection.hpp>
+#include <geometry/algorithms/length.hpp>
+#include <geometry/overlaps.hpp>
+#include <geometry/algorithms/simplify.hpp>
+#include <geometry/algorithms/within.hpp>
+#include <geometry/util/side.hpp>
+
+
+template<typename P>
+struct modifying_functor
+{
+ double sum;
+ modifying_functor() : sum(0)
+ {}
+ inline void operator()(P& p)
+ {
+ p.x(1);
+ }
+
+ inline void operator()(geometry::segment<P>& s)
+ {
+ s.first.x(1);
+ }
+};
+
+template<typename P>
+struct const_functor
+{
+ double sum;
+ const_functor() : sum(0)
+ {}
+ inline void operator()(const P& p)
+ {
+ sum += p.x();
+ }
+
+ inline void operator()(const geometry::const_segment<P>& s)
+ {
+ sum += s.first.x() - s.second.x();
+ }
+};
+
+
+template <typename T, template<typename,typename> class V>
+void check_linestring()
+{
+ typedef geometry::point<T> P;
+ typedef geometry::linestring<P, V, std::allocator> L;
+ L line;
+ line.push_back(P(0,0));
+ line.push_back(P(1,1));
+
+ typedef geometry::multi_linestring<L, V, std::allocator> ML;
+ ML multi;
+ multi.push_back(line);
+
+ double len = geometry::length(line);
+ len = geometry::length(multi);
+ double d = geometry::distance(P(0,1), line);
+ //d = geometry::distance(P(0,1), multi); not defined yet!
+
+ L simp;
+ geometry::simplify(line, simp, 3);
+ ML simpm;
+ geometry::simplify(multi, simpm, 3);
+
+ typedef geometry::box<P> B;
+ B b = geometry::envelope(line);
+ b = geometry::envelope(multi);
+
+ std::stringstream out;
+ out << line << std::endl;
+ //out << multi << std::endl;
+
+ // For each, const
+ const_functor<P> cf;
+ std::for_each(line.begin(), line.end(), cf);
+
+ const L& cl = line;
+ const ML& cm = multi;
+
+ geometry::for_each_point(cl, cf);
+ geometry::for_each_point(cm, cf);
+ geometry::for_each_segment(cl, cf);
+ geometry::for_each_segment(cm, cf);
+
+ // For each, modifying
+ modifying_functor<P> mf;
+ L& ml = line;
+ ML& mm = multi;
+ std::for_each(line.begin(), line.end(), mf);
+ geometry::for_each_point(ml, mf);
+ geometry::for_each_point(mm, mf);
+ geometry::for_each_segment(ml, mf);
+ geometry::for_each_segment(mm, mf);
+}
+
+
+template <typename T, template<typename,typename> class VP,
+ template<typename,typename> class VR>
+void check_polygon()
+{
+ typedef geometry::point<T> P;
+ typedef geometry::polygon<P, VP, VR, std::allocator, std::allocator> Y;
+ Y poly;
+ poly.outer().push_back(P(0,0));
+ poly.outer().push_back(P(2,0));
+ poly.outer().push_back(P(2,2));
+ poly.outer().push_back(P(0,2));
+
+ geometry::correct(poly);
+
+ // multi
+ typedef geometry::multi_polygon<Y, VP, std::allocator> MY;
+ MY multi;
+ multi.push_back(poly);
+
+ double a = geometry::area(poly);
+ a = geometry::area(multi);
+
+ //double d = geometry::distance(P(0,1), poly);
+
+ Y simp;
+ geometry::simplify(poly, simp, 3);
+ MY msimp;
+ geometry::simplify(multi, msimp, 3);
+
+ typedef geometry::box<P> B;
+ B b = geometry::envelope(poly);
+ b = geometry::envelope(multi);
+ P ctr = geometry::centroid(poly);
+
+ // within
+ typedef geometry::circle<P, T> C;
+ C circ(P(10,10), 10);
+
+ bool w = geometry::within(P(1, 1), poly);
+ w = geometry::within(poly, circ);
+ //w = geometry::within(poly, b); tbd
+ w = geometry::within(P(1, 1), multi);
+ w = geometry::within(multi, circ);
+ //w = geometry::within(multi, b); tbd
+
+ // For each, const
+ const_functor<P> cf;
+ std::for_each(poly.outer().begin(), poly.outer().end(), cf);
+
+ const Y& cp = poly;
+ const MY& cm = multi;
+
+ geometry::for_each_point(cp, cf);
+ geometry::for_each_point(cm, cf);
+ geometry::for_each_segment(cp, cf);
+ geometry::for_each_segment(cm, cf);
+
+ // For each, modifying
+ modifying_functor<P> mf;
+ Y& mp = poly;
+ MY& mm = multi;
+ std::for_each(poly.outer().begin(), poly.outer().end(), mf);
+ geometry::for_each_point(mp, mf);
+ geometry::for_each_point(mm, mf);
+ geometry::for_each_segment(mp, mf);
+ geometry::for_each_segment(mm, mf);
+}
+
+
+int main()
+{
+ check_linestring<double, std::vector>();
+ check_linestring<float, std::vector>();
+ check_linestring<int, std::vector>();
+ check_linestring<char, std::vector>();
+
+ check_linestring<double, std::list>();
+ check_linestring<double, std::deque>();
+
+ check_polygon<double, std::vector, std::vector>();
+ check_polygon<float, std::vector, std::vector>();
+ check_polygon<int, std::vector, std::vector>();
+ check_polygon<char, std::vector, std::vector>();
+
+ check_polygon<double, std::list, std::vector>();
+ check_polygon<double, std::deque, std::vector>();
+ check_polygon<double, std::list, std::list>();
+ check_polygon<double, std::deque, std::deque>();
+
+ return 0;
+}
+

Added: sandbox/ggl/libs/ggl/test/compile_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/compile_test.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,313 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="compile_test"
+ ProjectGUID="{618D4B05-A06E-443B-87C0-94964CEA7164}"
+ RootNamespace="compile_test"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\compile_test"
+ 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="../../../boost/ggl;.;..;../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+
+
+ 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)\compile_test"
+ 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="../../../boost/ggl;.;..;../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+
+
+ 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=".\small_test_ko.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\algorithms\area.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\astext.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\box.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\centroid.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\circle.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\envelope.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\foreach.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometry.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\grow.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_polygon.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_segment.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\length.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\normalize.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\overlaps.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\segment.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\simplify.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\within.hpp"
+ >
+ </File>
+ <Filter
+ Name="util"
+ >
+ <File
+ RelativePath="..\util\equals.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\reserve.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\selecttypetraits.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>
+ <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/ggl/libs/ggl/test/convert.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/convert.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,94 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include <geometry/algorithms/convert.hpp>
+#include <geometry/algorithms/assign.hpp>
+#include <geometry/algorithms/make.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include "common.hpp"
+
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef geometry::box<P> B;
+
+ P p;
+ geometry::assign(p, 1, 2);
+
+ B b;
+ geometry::convert(p, b);
+
+ BOOST_CHECK_CLOSE(double(geometry::get<0, 0>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<0, 1>(b)), 2.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1, 0>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1, 1>(b)), 2.0, 0.001);
+}
+
+
+
+template <typename P>
+void test_std()
+{
+ test_all<P>();
+
+ typedef geometry::box<P> B;
+ typedef geometry::linear_ring<P> R;
+ B b;
+ geometry::set<geometry::min_corner, 0>(b, 1);
+ geometry::set<geometry::min_corner, 1>(b, 2);
+ geometry::set<geometry::max_corner, 0>(b, 3);
+ geometry::set<geometry::max_corner, 1>(b, 4);
+
+ R ring;
+ geometry::convert(b, ring);
+
+ std::cout << b << std::endl;
+ std::cout << ring << std::endl;
+
+ typename boost::range_const_iterator<R>::type it = ring.begin();
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(*it)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(*it)), 2.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(*it)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(*it)), 4.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(*it)), 3.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(*it)), 4.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(*it)), 3.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(*it)), 2.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(*it)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(*it)), 2.0, 0.001);
+
+ BOOST_CHECK_EQUAL(ring.size(), 5);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ //test_all<test_point>();
+ test_std<geometry::point<int, 2, geometry::cs::cartesian> >();
+ test_std<geometry::point<float, 2, geometry::cs::cartesian> >();
+ test_std<geometry::point<double, 2, geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/convert.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/convert.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="convert"
+ ProjectGUID="{FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}"
+ RootNamespace="convert"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convert"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convert"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\convert.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/convex_hull.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/convex_hull.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,104 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/io/wkt/fromwkt.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include <geometry/algorithms/area.hpp>
+#include <geometry/algorithms/correct.hpp>
+#include <geometry/algorithms/convex_hull.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include "common.hpp"
+
+
+
+template <typename P>
+void test_check_polygon(const std::string& wkt, int size_original, int size_hull,
+ double area_original, double area_hull)
+{
+ geometry::polygon<P> poly;
+ geometry::from_wkt(wkt, poly);
+
+ geometry::polygon<P> hull;
+ convex_hull(poly, std::back_inserter(hull.outer()));
+
+ BOOST_CHECK(poly.outer().size() == size_original);
+ BOOST_CHECK(hull.outer().size() == size_hull);
+
+ double a = area(poly);
+ double ah = area(hull);
+
+ BOOST_CHECK_CLOSE(a, area_original, 0.001);
+ BOOST_CHECK_CLOSE(ah, area_hull, 0.001);
+}
+
+template <typename P>
+void test_check_linestring(const std::string& wkt, int size_original, int size_hull,
+ double area_hull)
+{
+ geometry::linestring<P> ls;
+ geometry::from_wkt(wkt, ls);
+
+ geometry::polygon<P> hull;
+ convex_hull(ls, std::back_inserter(hull.outer()));
+
+ BOOST_CHECK(ls.size() == size_original);
+ BOOST_CHECK(hull.outer().size() == size_hull);
+
+ double ah = area(hull);
+
+ BOOST_CHECK_CLOSE(ah, area_hull, 0.001);
+}
+
+
+
+
+template <typename P>
+void test_convex_hull_polygon()
+{
+ // rectangular, with concavity
+ test_check_polygon<P>("polygon((1 1, 5 1, 5 4, 4 4, 4 3, 3 3, 3 4, 1 4, 1 1))",
+ 9, 5, 11.0, 12.0);
+ // from sample polygon, with concavity
+ test_check_polygon<P>("polygon((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))",
+ 12, 8, 4.48, 5.245);
+}
+
+
+template <typename P>
+void test_convex_hull_linestring()
+{
+ // from sample linestring, with concavity
+ test_check_linestring<P>("linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", 5, 4, 3.8);
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_convex_hull_linestring<P>();
+ test_convex_hull_polygon<P>();
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<geometry::point_xy<int> >();
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/convex_hull.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/convex_hull.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="convex_hull"
+ ProjectGUID="{0AFF7A85-63A7-4178-92A5-CC692B09F5B9}"
+ RootNamespace="convex_hull"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convex_hull"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convex_hull"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\convex_hull.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/copy.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/copy.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,45 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/util/copy.hpp>
+#include <geometry/algorithms/assign.hpp>
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+
+template <typename P>
+void test_all()
+{
+ P p1;
+ geometry::assign(p1, 1, 22, 333);
+ P p2;
+ copy_coordinates(p1, p2);
+ BOOST_CHECK(get<0>(p2) == 1);
+ BOOST_CHECK(get<1>(p2) == 22);
+ BOOST_CHECK(get<2>(p2) == 333);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/copy.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/copy.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="copy"
+ ProjectGUID="{58B7C340-54BC-4B74-BA10-C289E14B2FFB}"
+ RootNamespace="copy"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\copy"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\copy"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\copy.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/core.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/core.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,82 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <boost/concept/assert.hpp>
+
+#include <geometry/core/topological_dimension.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+#include "common.hpp"
+
+template <typename G, size_t D, size_t TOPDIM>
+void test_geometry()
+{
+
+ // metafunctions which are there for all types
+ typedef typename geometry::tag<G>::type tag;
+ typedef typename geometry::coordinate_type<G>::type ctype;
+ typedef typename geometry::coordinate_system<G>::type csystem;
+ typedef typename geometry::point_type<G>::type ptype;
+ static const int dim = geometry::dimension<G>::value;
+ static const int topdim = geometry::topological_dimension<G>::value;
+
+ //std::cout << sizeof(ctype) << std::endl;
+
+ // Get the coordinate system tag
+ typedef typename geometry::cs_tag<G>::type ctag;
+
+ BOOST_CHECK_EQUAL(dim, D);
+ BOOST_CHECK_EQUAL(topdim, TOPDIM);
+
+ BOOST_STATIC_ASSERT((boost::mpl::equal_to<
+ geometry::dimension<G>,
+ boost::mpl::int_<D> >::type::value));
+
+ BOOST_CONCEPT_ASSERT(( geometry::ConstPoint<ptype> ));
+}
+
+
+template <typename P, size_t D>
+void test_all()
+{
+ test_geometry<P, D, 0>();
+ test_geometry<geometry::linestring<P> , D, 1>();
+ test_geometry<geometry::linear_ring<P> , D, 2>();
+ test_geometry<geometry::polygon<P> , D, 2>();
+ test_geometry<geometry::box<P> , D, 2>();
+ test_geometry<geometry::segment<P> , D, 1>();
+ test_geometry<geometry::segment<const P> , D, 1>();
+ test_geometry<geometry::nsphere<P, double> , D, 2>();
+}
+
+
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], 2, 0>();
+ test_geometry<float[2], 2, 0>();
+ test_geometry<double[2], 2, 0>();
+
+ test_geometry<int[3], 3, 0>();
+ test_geometry<float[3], 3, 0>();
+ test_geometry<double[3], 3, 0>();
+
+ test_all<test_point, 3>();
+ test_all<geometry::point<int, 2, geometry::cs::cartesian>, 2 >();
+ test_all<geometry::point<float, 2, geometry::cs::cartesian>, 2 >();
+ test_all<geometry::point<double, 2, geometry::cs::cartesian>, 2 >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/core.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/core.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="core"
+ ProjectGUID="{21D4C4EC-0F48-49F0-89D9-38F541928284}"
+ RootNamespace="core"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\core"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\core"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\core.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/custom_linestring.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/custom_linestring.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,136 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <boost/concept/requires.hpp>
+
+#include <geometry/core/access.hpp>
+#include <geometry/algorithms/make.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+#include <geometry/geometries/adapted/std_as_linestring.hpp>
+#include <geometry/geometries/adapted/boost_array_as_linestring.hpp>
+
+#include <geometry/algorithms/clear.hpp>
+#include <geometry/algorithms/append.hpp>
+
+
+#include <geometry/core/concepts/linestring_concept.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+#include "common.hpp"
+
+
+// ----------------------------------------------------------------------------
+// First custom linestring, requires ONLY one traits: to register itself as a linestring
+template <typename P>
+struct custom_linestring1 : std::vector<P> {};
+
+
+namespace geometry { namespace traits {
+ template <typename P>
+ struct tag< custom_linestring1<P> > { typedef linestring_tag type; };
+}}
+
+
+// ----------------------------------------------------------------------------
+// Second custom linestring, decides to implement all edit operations itself
+// by specializing the "use_std" traits to false.
+// It should therefore implement the traits:: clear / append_point
+template <typename P>
+struct custom_linestring2 : std::deque<P> {};
+
+namespace geometry { namespace traits {
+ template <typename P>
+ struct tag< custom_linestring2<P> > { typedef linestring_tag type; };
+
+ template <typename P>
+ struct use_std< custom_linestring2<P> >
+ {
+ static const bool value = false;
+ };
+
+ template <typename P>
+ struct clear< custom_linestring2<P> >
+ {
+ static inline void run(custom_linestring2<P>& ls) { ls.resize(0); }
+ };
+
+ template <typename P>
+ struct append_point< custom_linestring2<P>, P>
+ {
+ static inline void run(custom_linestring2<P>& geometry,
+ const P& point, int ring_index, int multi_index)
+ {
+ // does not use push-back but something else.
+ geometry.insert(geometry.end(), point);
+ }
+ };
+}}
+
+// ----------------------------------------------------------------------------
+
+
+template <typename G>
+void test_linestring()
+{
+ BOOST_CONCEPT_ASSERT((geometry::Linestring<G>));
+ BOOST_CONCEPT_ASSERT((geometry::ConstLinestring<G>));
+
+ G geometry;
+ typedef typename geometry::point_type<G>::type P;
+
+ geometry::clear(geometry);
+ BOOST_CHECK_EQUAL(boost::size(geometry), 0);
+
+ geometry::append(geometry, geometry::make_zero<P>());
+ BOOST_CHECK_EQUAL(boost::size(geometry), 1);
+
+ //std::cout << geometry << std::endl;
+
+ geometry::clear(geometry);
+ BOOST_CHECK_EQUAL(boost::size(geometry), 0);
+
+
+ //P p = boost::range::front(geometry);
+}
+
+
+
+
+template <typename P>
+void test_all()
+{
+ test_linestring<geometry::linestring<P> >();
+ test_linestring<geometry::linestring<P, std::vector> >();
+ test_linestring<geometry::linestring<P, std::deque> >();
+
+ test_linestring<custom_linestring1<P> >();
+ test_linestring<custom_linestring2<P> >();
+
+ test_linestring<std::vector<P> >();
+ test_linestring<std::deque<P> >();
+ //test_linestring<std::list<P> >();
+}
+
+
+
+int test_main(int, char* [])
+{
+ test_all<test_point>();
+ test_all<boost::tuple<float, float> >();
+ test_all<geometry::point<int, 2, geometry::cs::cartesian> >();
+ test_all<geometry::point<float, 2, geometry::cs::cartesian> >();
+ test_all<geometry::point<double, 2, geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/custom_linestring.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/custom_linestring.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="custom_linestring"
+ ProjectGUID="{CA8D5E44-7D8F-44A1-900C-35C28890299B}"
+ RootNamespace="custom_linestring"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\custom_linestring"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\custom_linestring"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\custom_linestring.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/custom_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/custom_tests.sln 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,35 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point", "point_concept_tests\well_formed_point.vcproj", "{B63710DE-960E-4C00-B79A-7C8F80D6BC15}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point_traits", "point_concept_tests\well_formed_point_traits.vcproj", "{4F767915-5FC0-4BEB-8948-F371896BBD59}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_array_point", "point_concept_tests\array_point.vcproj", "{436E02F5-A4E6-40F8-8E41-57560875D67F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_point_with_incorrect_coord_count", "point_concept_tests\point_with_incorrect_coord_count.vcproj", "{B696EDCA-4602-4962-8A1C-043B3F44B978}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_linestring", "custom_linestring.vcproj", "{CA8D5E44-7D8F-44A1-900C-35C28890299B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Release|Win32.ActiveCfg = Release|Win32
+ {4F767915-5FC0-4BEB-8948-F371896BBD59}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4F767915-5FC0-4BEB-8948-F371896BBD59}.Release|Win32.ActiveCfg = Release|Win32
+ {436E02F5-A4E6-40F8-8E41-57560875D67F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {436E02F5-A4E6-40F8-8E41-57560875D67F}.Release|Win32.ActiveCfg = Release|Win32
+ {B696EDCA-4602-4962-8A1C-043B3F44B978}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B696EDCA-4602-4962-8A1C-043B3F44B978}.Release|Win32.ActiveCfg = Release|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/ggl/libs/ggl/test/distance.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/distance.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,202 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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)
+
+
+//#define TEST_ARRAY
+
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/algorithms/distance.hpp>
+
+#ifndef TEST_ARRAY
+#include <geometry/algorithms/make.hpp>
+#endif
+
+#include <geometry/geometries/geometries.hpp>
+#include <geometry/geometries/adapted/boost_array_as_linestring.hpp>
+
+#include "common.hpp"
+
+
+template <typename P>
+void test_distance_result()
+{
+ typedef typename geometry::distance_result<P, P>::type RET;
+
+#ifndef TEST_ARRAY
+ P p1 = geometry::make<P>(0, 0);
+ P p2 = geometry::make<P>(3, 0);
+ P p3 = geometry::make<P>(0, 4);
+#else
+ P p1, p2, p3;
+ geometry::set<0>(p1, 0); geometry::set<1>(p1, 0);
+ geometry::set<0>(p2, 3); geometry::set<1>(p2, 0);
+ geometry::set<0>(p3, 0); geometry::set<1>(p3, 4);
+#endif
+
+ RET dr12 = geometry::distance(p1, p2);
+ RET dr13 = geometry::distance(p1, p3);
+ RET dr23 = geometry::distance(p2, p3);
+
+ BOOST_CHECK_CLOSE(double(dr12), 3.000, 0.001);
+ BOOST_CHECK_CLOSE(double(dr13), 4.000, 0.001);
+ BOOST_CHECK_CLOSE(double(dr23), 5.000, 0.001);
+
+ // COMPILATION TESTS
+ RET comparable = geometry::make_distance_result<RET>(3);
+ //BOOST_CHECK_CLOSE(comparable.value(), 9.000, 0.001);
+
+
+ // Question: how to check if the implemented operator is used, and not the auto-conversion to double?
+ if (comparable == dr12);
+ if (comparable < dr12);
+ if (comparable > dr12);
+
+ // Check streamability
+ std::ostringstream s;
+ s << comparable;
+
+ // Check comparisons with plain double
+ double d = 3.0;
+ if (dr12 == d);
+ if (dr12 < d);
+ if (dr12 > d);
+
+}
+
+
+template <typename P>
+void test_distance_point()
+{
+ P p1;
+ geometry::set<0>(p1, 1);
+ geometry::set<1>(p1, 1);
+
+ P p2;
+ geometry::set<0>(p2, 2);
+ geometry::set<1>(p2, 2);
+
+ double d = geometry::distance(p1, p2);
+ BOOST_CHECK_CLOSE(d, 1.4142135, 0.001);
+}
+
+
+template <typename P>
+void test_distance_segment()
+{
+ P s1; geometry::set<0>(s1, 2); geometry::set<1>(s1, 2);
+ P s2; geometry::set<0>(s2, 3); geometry::set<1>(s2, 3);
+
+ // Check points left, right, projected-left, projected-right, on segment
+ P p1; geometry::set<0>(p1, 0); geometry::set<1>(p1, 0);
+ P p2; geometry::set<0>(p2, 4); geometry::set<1>(p2, 4);
+ P p3; geometry::set<0>(p3, 2.4); geometry::set<1>(p3, 2.6);
+ P p4; geometry::set<0>(p4, 2.6); geometry::set<1>(p4, 2.4);
+ P p5; geometry::set<0>(p5, 2.5); geometry::set<1>(p5, 2.5);
+
+ const geometry::segment<const P> seg(s1, s2);
+
+ double d1 = geometry::distance(p1, seg); BOOST_CHECK_CLOSE(d1, 2.8284271, 0.001);
+ double d2 = geometry::distance(p2, seg); BOOST_CHECK_CLOSE(d2, 1.4142135, 0.001);
+ double d3 = geometry::distance(p3, seg); BOOST_CHECK_CLOSE(d3, 0.141421, 0.001);
+ double d4 = geometry::distance(p4, seg); BOOST_CHECK_CLOSE(d4, 0.141421, 0.001);
+ double d5 = geometry::distance(p5, seg); BOOST_CHECK_CLOSE(d5, 0.0, 0.001);
+
+ // check other way round
+ double dr1 = geometry::distance(seg, p1); BOOST_CHECK_CLOSE(dr1, d1, 0.001);
+ double dr2 = geometry::distance(seg, p2); BOOST_CHECK_CLOSE(dr2, d2, 0.001);
+}
+
+template <typename P>
+void test_distance_linestring()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ boost::array<P, 2> points;
+ geometry::set<0>(points[0], 1);
+ geometry::set<1>(points[0], 1);
+ geometry::set<0>(points[1], 3);
+ geometry::set<1>(points[1], 3);
+
+#ifndef TEST_ARRAY
+ P p = geometry::make<P>(2, 1);
+#else
+ P p;
+ geometry::set<0>(p, 2); geometry::set<1>(p, 1);
+#endif
+
+ double d = geometry::distance(p, points);
+ BOOST_CHECK_CLOSE(d, 0.70710678, 0.001);
+
+#ifndef TEST_ARRAY
+ p = geometry::make<P>(5, 5);
+#else
+ geometry::set<0>(p, 5); geometry::set<1>(p, 5);
+#endif
+ d = geometry::distance(p, points);
+ BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+
+
+ geometry::linestring<P> line;
+#ifndef TEST_ARRAY
+ line.push_back(geometry::make<P>(1,1));
+ line.push_back(geometry::make<P>(2,2));
+ line.push_back(geometry::make<P>(3,3));
+#else
+ {
+ P lp;
+ geometry::set<0>(lp, 1); geometry::set<1>(lp, 1); line.push_back(lp);
+ geometry::set<0>(lp, 2); geometry::set<1>(lp, 2); line.push_back(lp);
+ geometry::set<0>(lp, 3); geometry::set<1>(lp, 3); line.push_back(lp);
+ }
+#endif
+
+#ifndef TEST_ARRAY
+ p = geometry::make<P>(5, 5);
+#else
+ geometry::set<0>(p, 5); geometry::set<1>(p, 5);
+#endif
+
+ d = geometry::distance(p, line);
+ BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_distance_result<P>();
+ test_distance_point<P>();
+ test_distance_segment<P>();
+#ifndef TEST_ARRAY
+ test_distance_linestring<P>();
+#endif
+}
+
+
+
+int test_main(int, char* [])
+{
+#ifdef TEST_ARRAY
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test_point>(); // located here because of 3D
+#endif
+
+ //test_all<geometry::point_xy<int> >();
+ test_all<boost::tuple<float, float> >();
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/distance.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/distance.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="distance"
+ ProjectGUID="{347D08A4-22E9-45B1-A55B-AE84AA2EAA53}"
+ RootNamespace="distance"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\distance"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\distance"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\distance.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/dot_product.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/dot_product.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,44 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/arithmetic/dot_product.hpp>
+
+#include <geometry/algorithms/assign.hpp>
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+
+template <typename P>
+void test_all()
+{
+ P p1;
+ geometry::assign(p1, 1, 2, 3);
+ P p2;
+ geometry::assign(p2, 4, 5, 6);
+ BOOST_CHECK(geometry::dot_product(p1, p2) == 1*4 + 2*5 + 3*6);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, geometry::cs::cartesian> >();
+ test_all<point<float, 3, geometry::cs::cartesian> >();
+ test_all<point<double, 3, geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/dot_product.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/dot_product.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="dot_product"
+ ProjectGUID="{C9CD2A98-3327-4560-A979-4BF506F777A8}"
+ RootNamespace="dot_product"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\dot_product"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\dot_product"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\dot_product.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/envelope.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/envelope.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,144 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/algorithms/envelope.hpp>
+#include <geometry/algorithms/assign.hpp>
+#include <geometry/algorithms/make.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include "common.hpp"
+
+
+
+
+template <typename T, typename B>
+void check_result(const B& b, const T& x1, const T& y1, const T& x2, const T& y2)
+{
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::min_corner, 0>(b)), (double)x1, 0.001);
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::min_corner, 1>(b)), (double)y1, 0.001);
+
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::max_corner, 0>(b)), (double)x2, 0.001);
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::max_corner, 1>(b)), (double)y2, 0.001);
+}
+
+
+template <typename P>
+void test_envelope_point()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ P p;
+ geometry::assign(p, 1, 1);
+
+ geometry::box<P> b;
+
+ geometry::envelope(p, b);
+ check_result<T>(b, 1, 1, 1, 1);
+}
+
+
+template <typename P>
+void test_envelope_linestring()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+ typedef geometry::box<P> B;
+
+ geometry::linestring<P> line;
+ line.push_back(geometry::make<P>(1,1));
+ line.push_back(geometry::make<P>(2,2));
+
+ // Check envelope detection by return value and by reference
+ check_result<T>(geometry::make_envelope<B>(line), 1, 1, 2, 2);
+
+ B b;
+ geometry::envelope(line, b);
+ check_result<T>(b, 1, 1, 2, 2);
+}
+
+
+template <typename P>
+void test_envelope_polygon()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+ typedef geometry::box<P> B;
+
+ geometry::polygon<P> poly;
+
+ poly.outer().push_back(geometry::make<P>(1,1));
+ poly.outer().push_back(geometry::make<P>(1,3));
+ poly.outer().push_back(geometry::make<P>(3,3));
+ poly.outer().push_back(geometry::make<P>(3,3));
+ poly.outer().push_back(geometry::make<P>(1,3));
+
+ check_result<T>(geometry::make_envelope<B>(poly.outer()), 1, 1, 3, 3);
+ check_result<T>(geometry::make_envelope<B>(poly), 1, 1, 3, 3);
+
+ B b;
+
+ // Check called by polygon
+ geometry::envelope(poly, b);
+ check_result<T>(b, 1, 1, 3, 3);
+
+ // Check called by ring
+ geometry::envelope(poly.outer(), b);
+ check_result<T>(b, 1, 1, 3, 3);
+}
+
+
+
+template <typename P>
+void test_all()
+{
+ test_envelope_point<P>();
+ test_envelope_linestring<P>();
+ test_envelope_polygon<P>();
+}
+
+template <typename P>
+void test_3d()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ P p;
+ geometry::assign(p, 1, 1, 1);
+
+ geometry::box<P> b;
+ geometry::assign_zero(b);
+
+ geometry::envelope(p, b);
+
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::min_corner, 0>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::min_corner, 1>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::min_corner, 2>(b)), 1.0, 0.001);
+
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::max_corner, 0>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::max_corner, 1>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(((double)geometry::get<geometry::max_corner, 2>(b)), 1.0, 0.001);
+}
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ //test_all<float[2]>();
+ //test_all<double[2]>();
+ test_all<boost::tuple<float, float> >();
+ test_all<geometry::point_xy<int> >();
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+
+ test_3d<test_point>();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/envelope.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/envelope.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="envelope"
+ ProjectGUID="{26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}"
+ RootNamespace="envelope"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\envelope"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\envelope"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\envelope.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/for_each_coordinate.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/for_each_coordinate.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,52 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/util/for_each_coordinate.hpp>
+#include <geometry/algorithms/assign.hpp>
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+
+struct test_operation
+{
+ template <typename P, int I>
+ static void run(P& p)
+ { set<I>(p, get<I>(p)*10); }
+};
+
+
+template <typename P>
+void test_all()
+{
+ P p;
+ geometry::assign(p, 1, 2, 3);
+ geometry::for_each_coordinate(p, test_operation());
+ BOOST_CHECK(get<0>(p) == 10);
+ BOOST_CHECK(get<1>(p) == 20);
+ BOOST_CHECK(get<2>(p) == 30);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/for_each_coordinate.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/for_each_coordinate.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="for_each_coordinate"
+ ProjectGUID="{900CD32E-1B78-40E3-887F-9BCCC0A1041E}"
+ RootNamespace="for_each_coordinate"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\for_each_coordinate"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\for_each_coordinate"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\for_each_coordinate.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/geometry_tests.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/geometry_tests.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,212 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels, Geodan 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 <string>
+#include <deque>
+#include <list>
+#include <limits>
+
+#include <cmath>
+
+#include <geometry/geometries/box.hpp>
+#include <geometry/geometries/circle.hpp>
+#include <geometry/algorithms/envelope.hpp>
+#include <geometry/algorithms/within.hpp>
+#include <geometry/algorithms/area.hpp>
+#include <geometry/algorithms/distance.hpp>
+#include <geometry/algorithms/length.hpp>
+#include <geometry/overlaps.hpp>
+#include <geometry/algorithms/correct.hpp>
+#include <geometry/algorithms/centroid.hpp>
+
+#include <geometry/algorithms/intersection_segment.hpp>
+#include <geometry/algorithms/intersection_linestring.hpp>
+#include <geometry/algorithms/intersection_polygon.hpp>
+
+#include <geometry/astext.hpp>
+#include <geometry/point_on_line.hpp>
+
+
+void test_equals()
+{
+ geometry::point<double> p1(1, 1), p2(1,1 + std::numeric_limits<double>::epsilon() * 2.0);
+ geometry::point<int> p3(1,1), p4(1,1);
+
+ std::cout << (p1 == p2 ? "true" : "false" ) << std::endl;
+ std::cout << (p3 == p4 ? "true" : "false" ) << std::endl;
+}
+
+
+
+
+void test(double x1, double y1, double x2, double y2)
+{
+ //geometry::box<geometry::point<double> > e(70,60, 230,150);
+ geometry::box<geometry::point<double> > e(0.30, 0.30, 0.70, 0.70);
+ geometry::point<double> p1(x1, y1);
+ geometry::point<double> p2(x2, y2);
+
+ bool c1, c2;
+ geometry::segment<geometry::point<double> >s(p1, p2);
+ if (geometry::_clip_segment_liang_barsky(e, s, c1, c2))
+ {
+ if (c1) std::cout << "p1 clipped ";
+ if (c2) std::cout << "p2 clipped ";
+ std::cout
+ << p1.x() << ", "
+ << p1.y() << ", "
+ << p2.x() << ", "
+ << p2.y() << std::endl;
+ }
+ else
+ {
+ std::cout << "not visible" << std::endl;
+ }
+ std::cout << std::endl;
+}
+
+void test_line(const geometry::linestring<geometry::point<double> >& line)
+{
+ //geometry::box<geometry::point<double> > e(70,60, 230,150);
+ geometry::box<geometry::point<double> > e(0.30, 0.30, 0.70, 0.70);
+
+ geometry::multi_linestring<geometry::linestring<geometry::point<double> >> out;
+
+ geometry::clip_linestring(e, line, out);
+ for (int i = 0; i < out.size(); i++)
+ {
+ const geometry::linestring<geometry::point<double> >& ol = out[i];
+ for (int j = 0; j < ol.size(); j++)
+ {
+ const geometry::point<double>& p = ol[j];
+ std::cout << "("
+ << p.x() << ", "
+ << p.y() << ") " ;
+
+ }
+ std::cout << std::endl;
+ }
+}
+
+void test_ring(const geometry::linear_ring<geometry::point<double> >& linear_ring)
+{
+ std::cout << "linear_ring" << std::endl;
+ // normal: geometry::box<geometry::point<double> > e(0.30, 0.25, 0.70, 0.75); -> 0.01, 0.06
+ // difficult 1: geometry::box<geometry::point<double> > e(0.30, 0.30, 0.70, 0.70); --> 0.05
+ // difficult 2: geometry::box<geometry::point<double> > e(0.50, 0.30, 0.70, 0.70);
+ geometry::box<geometry::point<double> > e(0.50, 0.30, 0.70, 0.70);
+
+ std::cout << "linear_ring: " << linear_ring << std::endl;
+
+ std::vector<geometry::linear_ring<geometry::point<double> >> v;
+ clip_poly_weiler_atherton(e, linear_ring, v);
+
+ for (int i = 0; i < v.size(); i++)
+ {
+ //set_ordered(v[i]);
+ std::cout << "linear_ring " << i+1 << ": " << v[i] << std::endl;
+ }
+}
+
+
+
+void test_side(double x1, double y1, double x2, double y2, double x, double y)
+{
+ typedef geometry::point<double> glp ;
+ typedef geometry::const_segment<glp> gls;
+ glp p1(x1,y1);
+ glp p2(x2,y2);
+ glp p(x,y);
+ double r = geometry::point_side(gls(p1, p2), p);
+ std::cout << r << " " << p1 << "-" << p2 << ": " << p << std::endl;
+}
+
+
+
+
+
+int main1(void)
+{
+ test_equals();
+
+ test_side(0,1, 2,1, 0,0);
+ test_side(0,1, 2,1, 1,0);
+ test_side(0,1, 2,1, 1,2);
+ test_side(0,1, 2,1, 2,1);
+ test_side(0,1, 2,1, 3,1);
+
+/*
+ test_intersection(0,0, 0,2, 0,1, 1,1, 1, 0,1, 0,0);
+ test_intersection(0,1, 1,1, 0,0, 0,2, 1, 0,1, 0,0);
+ test_intersection(0,2, 2,2, 1,1, 1,2, 1, 1,2, 0,0);
+ test_intersection(1,1, 1,2, 0,2, 2,2, 1, 1,2, 0,0);
+ test_intersections();
+ */
+ //return 0;
+
+
+ //geometry::point<double> p1(30,20); geometry::point<double> p2(280,160);
+ //geometry::box<geometry::point<double> > e(0.30, 0.30, 0.70, 0.70);
+ //geometry::point<double> p1(0.052, 0.674); geometry::point<double> p2(0.902, 0.744);
+ //geometry::point<double> p1(0.4, 0.4); geometry::point<double> p2(0.6, 0.6);
+ test(0.4, 0.4, 0.6, 0.6); // inside
+ test(0.052, 0.674, 0.902, 0.744); // both clipped
+ test(0.45, 0.45, 0.15, 0.15); // second clipped
+ test(0.5, 0.8, 0.4, 0.4); // first clipped
+ test(0.0, 0.0, 0.5, 0.5); // first clipped
+
+ geometry::linestring<geometry::point<double> > l;
+ l.push_back(geometry::point<double>(0.0, 0.0));
+ l.push_back(geometry::point<double>(0.5, 0.5));
+ l.push_back(geometry::point<double>(1.0, 0.0));
+ test_line(l);
+
+ l.clear();
+ l.push_back(geometry::point<double>(0.1, 0.0));
+ l.push_back(geometry::point<double>(0.5, 0.8));
+ l.push_back(geometry::point<double>(0.9, 0.0));
+ test_line(l);
+
+ l.clear();
+ l.push_back(geometry::point<double>(0.5, 0.5));
+ l.push_back(geometry::point<double>(0.3, 0.3));
+ l.push_back(geometry::point<double>(0.4, 0.7));
+ l.push_back(geometry::point<double>(0.7, 0.3));
+ test_line(l);
+
+ geometry::linear_ring<geometry::point<double> > r;
+ r.push_back(geometry::point<double>(0.5, 0.5));
+ r.push_back(geometry::point<double>(0.8, 0.71));
+ r.push_back(geometry::point<double>(0.9, 0.6));
+ r.push_back(geometry::point<double>(0.6, 0.2));
+ r.push_back(geometry::point<double>(0.5, 0.5));
+// test_ring(r);
+
+ r.clear();
+ r.push_back(geometry::point<double>(0.5, 0.2));
+ r.push_back(geometry::point<double>(0.5, 0.3));
+ r.push_back(geometry::point<double>(0.8, 0.3));
+ r.push_back(geometry::point<double>(0.8, 0.4));
+ r.push_back(geometry::point<double>(0.5, 0.4));
+ r.push_back(geometry::point<double>(0.5, 0.8));
+ r.push_back(geometry::point<double>(0.9, 0.8));
+
+ // case x
+ r.push_back(geometry::point<double>(0.9, 0.7));
+ r.push_back(geometry::point<double>(0.6, 0.7));
+ r.push_back(geometry::point<double>(0.6, 0.6));
+ r.push_back(geometry::point<double>(0.9, 0.6));
+
+ // end case x
+
+ r.push_back(geometry::point<double>(0.9, 0.2));
+ r.push_back(geometry::point<double>(0.5, 0.2));
+ test_ring(r);
+
+ return 0;
+}
\ No newline at end of file

Added: sandbox/ggl/libs/ggl/test/geometry_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/geometry_tests.sln 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,199 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arithmetic", "arithmetic.vcproj", "{4D447233-54DC-4C1B-B8DF-4689590ACF56}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dot_product", "dot_product.vcproj", "{C9CD2A98-3327-4560-A979-4BF506F777A8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythagoras", "pythagoras.vcproj", "{763CA955-FC01-4AFD-9593-69D36836B3F7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_ll", "point_ll.vcproj", "{8376897F-30E1-43B5-8332-930A1F807BCB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distance", "distance.vcproj", "{347D08A4-22E9-45B1-A55B-AE84AA2EAA53}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "box", "box.vcproj", "{EB7B69C6-2D62-43BC-BA18-D15BEB998665}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "envelope", "envelope.vcproj", "{26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "for_each_coordinate", "for_each_coordinate.vcproj", "{900CD32E-1B78-40E3-887F-9BCCC0A1041E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy", "copy.vcproj", "{58B7C340-54BC-4B74-BA10-C289E14B2FFB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assign", "assign.vcproj", "{94BC6547-67C1-44DB-903D-526537A91E23}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment", "segment.vcproj", "{F995B070-62A2-46FE-A676-79AADB71DBD8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "circle", "circle.vcproj", "{E19B65F6-FAF0-47FD-84A2-3BAE1B703967}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loop", "loop.vcproj", "{02DE0325-2DA2-442F-850F-287EEAFDD822}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simplify", "simplify.vcproj", "{B1760CB8-553B-42AB-B54E-3D0320FF252F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wkt", "wkt.vcproj", "{E6BCAE7F-FD36-4018-B073-BE05F3D6790B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "combine", "combine.vcproj", "{5330DAB1-DF27-44FC-971B-3C5094F82FA3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projections", "projections.vcproj", "{38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "area", "area.vcproj", "{E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make", "make.vcproj", "{BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transform", "transform.vcproj", "{41413E56-08DA-4592-94D2-5311FE90C62B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parse_dms", "parse_dms.vcproj", "{A924B132-C216-4477-85EE-9118255011AA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parse", "parse.vcproj", "{38C7173B-F81D-427D-B236-57611A31656A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convert", "convert.vcproj", "{FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core.vcproj", "{21D4C4EC-0F48-49F0-89D9-38F541928284}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "access", "access.vcproj", "{5542B963-D229-4393-968F-E62DDCE4B87B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "selected", "selected.vcproj", "{22DD12E5-4AAD-4066-9C4F-4C360F7759AA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "append", "append.vcproj", "{774F6471-D8A0-481C-9B0A-4903EED25C70}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projection", "projection.vcproj", "{A46D98E8-88F2-4795-B839-CD3F6082E7B2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projection_epsg", "projection_epsg.vcproj", "{F0990F82-1A44-4671-85D0-B38A81C48A8F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convex_hull", "convex_hull.vcproj", "{0AFF7A85-63A7-4178-92A5-CC692B09F5B9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transformer", "transformer.vcproj", "{9B62EBF7-D444-4D67-BA00-48CAEAF92756}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Debug|Win32.Build.0 = Debug|Win32
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Release|Win32.ActiveCfg = Release|Win32
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Release|Win32.Build.0 = Release|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Debug|Win32.Build.0 = Debug|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Release|Win32.ActiveCfg = Release|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Release|Win32.Build.0 = Release|Win32
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Debug|Win32.Build.0 = Debug|Win32
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Release|Win32.ActiveCfg = Release|Win32
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Release|Win32.Build.0 = Release|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Debug|Win32.Build.0 = Debug|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Release|Win32.ActiveCfg = Release|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Release|Win32.Build.0 = Release|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Debug|Win32.ActiveCfg = Debug|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Debug|Win32.Build.0 = Debug|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Release|Win32.ActiveCfg = Release|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Release|Win32.Build.0 = Release|Win32
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Debug|Win32.Build.0 = Debug|Win32
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Release|Win32.ActiveCfg = Release|Win32
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Release|Win32.Build.0 = Release|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Debug|Win32.Build.0 = Debug|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Release|Win32.ActiveCfg = Release|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Release|Win32.Build.0 = Release|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Debug|Win32.Build.0 = Debug|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Release|Win32.ActiveCfg = Release|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Release|Win32.Build.0 = Release|Win32
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Debug|Win32.Build.0 = Debug|Win32
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Release|Win32.ActiveCfg = Release|Win32
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Release|Win32.Build.0 = Release|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Debug|Win32.ActiveCfg = Debug|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Debug|Win32.Build.0 = Debug|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Release|Win32.ActiveCfg = Release|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Release|Win32.Build.0 = Release|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Debug|Win32.Build.0 = Debug|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Release|Win32.ActiveCfg = Release|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Release|Win32.Build.0 = Release|Win32
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Debug|Win32.Build.0 = Debug|Win32
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Release|Win32.ActiveCfg = Release|Win32
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Release|Win32.Build.0 = Release|Win32
+ {02DE0325-2DA2-442F-850F-287EEAFDD822}.Debug|Win32.ActiveCfg = Debug|Win32
+ {02DE0325-2DA2-442F-850F-287EEAFDD822}.Debug|Win32.Build.0 = Debug|Win32
+ {02DE0325-2DA2-442F-850F-287EEAFDD822}.Release|Win32.ActiveCfg = Release|Win32
+ {02DE0325-2DA2-442F-850F-287EEAFDD822}.Release|Win32.Build.0 = Release|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Debug|Win32.Build.0 = Debug|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Release|Win32.ActiveCfg = Release|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Release|Win32.Build.0 = Release|Win32
+ {E6BCAE7F-FD36-4018-B073-BE05F3D6790B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E6BCAE7F-FD36-4018-B073-BE05F3D6790B}.Debug|Win32.Build.0 = Debug|Win32
+ {E6BCAE7F-FD36-4018-B073-BE05F3D6790B}.Release|Win32.ActiveCfg = Release|Win32
+ {E6BCAE7F-FD36-4018-B073-BE05F3D6790B}.Release|Win32.Build.0 = Release|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Debug|Win32.Build.0 = Debug|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.ActiveCfg = Release|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.Build.0 = Release|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Debug|Win32.Build.0 = Debug|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Release|Win32.ActiveCfg = Release|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Release|Win32.Build.0 = Release|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Debug|Win32.Build.0 = Debug|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Release|Win32.ActiveCfg = Release|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Release|Win32.Build.0 = Release|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Debug|Win32.Build.0 = Debug|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Release|Win32.ActiveCfg = Release|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Release|Win32.Build.0 = Release|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Debug|Win32.Build.0 = Debug|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Release|Win32.ActiveCfg = Release|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Release|Win32.Build.0 = Release|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Debug|Win32.Build.0 = Debug|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Release|Win32.ActiveCfg = Release|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Release|Win32.Build.0 = Release|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Debug|Win32.Build.0 = Debug|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Release|Win32.ActiveCfg = Release|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Release|Win32.Build.0 = Release|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.Build.0 = Debug|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.ActiveCfg = Release|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.Build.0 = Release|Win32
+ {21D4C4EC-0F48-49F0-89D9-38F541928284}.Debug|Win32.ActiveCfg = Debug|Win32
+ {21D4C4EC-0F48-49F0-89D9-38F541928284}.Debug|Win32.Build.0 = Debug|Win32
+ {21D4C4EC-0F48-49F0-89D9-38F541928284}.Release|Win32.ActiveCfg = Release|Win32
+ {21D4C4EC-0F48-49F0-89D9-38F541928284}.Release|Win32.Build.0 = Release|Win32
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Debug|Win32.Build.0 = Debug|Win32
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Release|Win32.ActiveCfg = Release|Win32
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Release|Win32.Build.0 = Release|Win32
+ {22DD12E5-4AAD-4066-9C4F-4C360F7759AA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {22DD12E5-4AAD-4066-9C4F-4C360F7759AA}.Debug|Win32.Build.0 = Debug|Win32
+ {22DD12E5-4AAD-4066-9C4F-4C360F7759AA}.Release|Win32.ActiveCfg = Release|Win32
+ {22DD12E5-4AAD-4066-9C4F-4C360F7759AA}.Release|Win32.Build.0 = Release|Win32
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Debug|Win32.ActiveCfg = Debug|Win32
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Debug|Win32.Build.0 = Debug|Win32
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Release|Win32.ActiveCfg = Release|Win32
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Release|Win32.Build.0 = Release|Win32
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Debug|Win32.Build.0 = Debug|Win32
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Release|Win32.ActiveCfg = Release|Win32
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Release|Win32.Build.0 = Release|Win32
+ {F0990F82-1A44-4671-85D0-B38A81C48A8F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F0990F82-1A44-4671-85D0-B38A81C48A8F}.Debug|Win32.Build.0 = Debug|Win32
+ {F0990F82-1A44-4671-85D0-B38A81C48A8F}.Release|Win32.ActiveCfg = Release|Win32
+ {F0990F82-1A44-4671-85D0-B38A81C48A8F}.Release|Win32.Build.0 = Release|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.Build.0 = Debug|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Release|Win32.ActiveCfg = Release|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Release|Win32.Build.0 = Release|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Debug|Win32.Build.0 = Debug|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Release|Win32.ActiveCfg = Release|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/ggl/libs/ggl/test/geometry_tests.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/geometry_tests.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="geometry_tests"
+ ProjectGUID="{618D4B05-A06E-443B-87C0-94964CEA7164}"
+ RootNamespace="geometry_tests"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+
+
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+
+
+ 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=".\geometry_tests.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\intersection_test.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\within_test.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\algorithms\area.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\astext.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\box.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\centroid.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\circle.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\envelope.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometry.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\grow.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_polygon.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_segment.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\length.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\normalize.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\overlaps.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\point_on_line.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\segment.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\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/ggl/libs/ggl/test/intersection_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/intersection_test.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,129 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <sstream>
+
+#include <geometry/algorithms/within.hpp>
+#include <geometry/algorithms/correct.hpp>
+
+#include <geometry/algorithms/intersection_segment.hpp>
+
+#include <geometry/astext.hpp>
+
+#include <boost/config.hpp>
+#include <boost/test/included/test_exec_monitor.hpp>
+//#include <boost/test/unit_test.hpp>
+
+
+static std::ostream & operator<<(std::ostream &s, const geometry::intersection_result& r)
+{
+ switch(r)
+ {
+ case geometry::is_intersect_no : s << "is_intersect_no"; break;
+ case geometry::is_intersect : s << "is_intersect"; break;
+ case geometry::is_parallel : s << "is_parallel"; break;
+ case geometry::is_collinear_no : s << "is_collinear_no"; break;
+ case geometry::is_collinear_one : s << "is_collinear_one"; break;
+ case geometry::is_collinear_connect : s << "is_collinear_connect"; break;
+ case geometry::is_collinear_overlap : s << "is_collinear_overlap"; break;
+ case geometry::is_collinear_overlap_opposite : s << "is_collinear_overlap_opposite"; break;
+ case geometry::is_collinear_connect_opposite : s << "is_collinear_connect_opposite"; break;
+
+ // detailed connection results:
+ case geometry::is_intersect_connect_s1p1 : s << "is_intersect_connect_s1p1"; break;
+ case geometry::is_intersect_connect_s1p2 : s << "is_intersect_connect_s1p2"; break;
+ case geometry::is_intersect_connect_s2p1 : s << "is_intersect_connect_s2p1"; break;
+ case geometry::is_intersect_connect_s2p2 : s << "is_intersect_connect_s2p2"; break;
+ }
+ return s;
+}
+
+static std::string as_string(const geometry::intersection_result& r)
+{
+ std::stringstream out;
+ out << r;
+ return out.str();
+}
+
+typedef geometry::point<double> P;
+typedef geometry::const_segment<P> S;
+
+
+static void test_intersection(double s1x1, double s1y1, double s1x2, double s1y2,
+ double s2x1, double s2y1, double s2x2, double s2y2,
+ // Expected results
+ geometry::intersection_result expected_result,
+ int exptected_count, const P& exp_p1, const P& exp_p2)
+{
+ S s1(P(s1x1, s1y1), P(s1x2, s1y2));
+ S s2(P(s2x1, s2y1), P(s2x2, s2y2));
+ std::vector<P> ip;
+ double ra, rb;
+ geometry::intersection_result r = geometry::intersection_s(s1, s2, ra, rb, ip);
+ r = geometry::intersection_connect_result(r, ra, rb);
+
+ BOOST_CHECK_EQUAL(ip.size(), exptected_count);
+ BOOST_CHECK_EQUAL(as_string(expected_result), as_string(r));
+
+ if (ip.size() == 2 && ip[0] != exp_p1)
+ {
+ // Swap results, second point is not as expected, swap results, order is not prescribed,
+ // it might be OK.
+ std::reverse(ip.begin(), ip.end());
+ }
+
+ if (ip.size() >= 1)
+ {
+ BOOST_CHECK_EQUAL(ip[0], exp_p1);
+ }
+ if (ip.size() >= 2)
+ {
+ BOOST_CHECK_EQUAL(ip[1], exp_p2);
+ }
+
+
+ /*
+ std::cout << exptected_count << " " << r;
+ if (exptected_count >= 1) std::cout << " " << ip[0];
+ if (exptected_count >= 2) std::cout << " " << ip[1];
+ std::cout << std::endl;
+ */
+}
+
+//BOOST_AUTO_TEST_CASE( test1 )
+int test_main( int , char* [] )
+{
+ // Identical cases
+ test_intersection(0,0, 1,1, 0,0, 1,1, geometry::is_collinear_overlap, 2, P(0,0), P(1,1));
+ test_intersection(1,1, 0,0, 0,0, 1,1, geometry::is_collinear_overlap_opposite, 2, P(1,1), P(0,0));
+ test_intersection(0,1, 0,2, 0,1, 0,2, geometry::is_collinear_overlap, 2, P(0,1), P(0,2)); // Vertical
+ test_intersection(0,2, 0,1, 0,1, 0,2, geometry::is_collinear_overlap_opposite, 2, P(0,2), P(0,1)); // Vertical
+ // Overlap cases
+ test_intersection(0,0, 1,1, -0.5,-0.5, 2,2, geometry::is_collinear_overlap, 2, P(0,0), P(1,1));
+ test_intersection(0,0, 1,1, 0.5,0.5, 1.5,1.5, geometry::is_collinear_overlap, 2, P(0.5,0.5), P(1,1));
+ test_intersection(0,0, 0,1, 0,-10, 0,10, geometry::is_collinear_overlap, 2, P(0,0), P(0,1)); // Vertical
+ test_intersection(0,0, 0,1, 0,10, 0,-10, geometry::is_collinear_overlap_opposite, 2, P(0,0), P(0,1)); // Vertical
+ test_intersection(0,0, 1,1, 1,1, 2,2, geometry::is_collinear_connect, 1, P(1,1), P(0,0)); // Single point
+ // Colinear, non overlap cases
+ test_intersection(0,0, 1,1, 1.5,1.5, 2.5,2.5, geometry::is_collinear_no, 0, P(0,0), P(0,0));
+ test_intersection(0,0, 0,1, 0,5, 0,6, geometry::is_collinear_no, 0, P(0,0), P(0,0)); // Vertical
+ // Parallel cases
+ test_intersection(0,0, 1,1, 1,0, 2,1, geometry::is_parallel, 0, P(0,0), P(0,1));
+ // Intersect cases
+ test_intersection(0,2, 4,2, 3,0, 3,4, geometry::is_intersect, 1, P(3,2), P(0,0));
+ // Non intersect cases
+
+ // Single point cases
+ test_intersection(0,0, 0,0, 1,1, 2,2, geometry::is_collinear_no, 0, P(1,1), P(0,0)); // Colinear/no
+ test_intersection(2,2, 2,2, 1,1, 3,3, geometry::is_collinear_one, 1, P(2,2.01), P(0,0)); // On segment
+ test_intersection(1,1, 3,3, 2,2, 2,2, geometry::is_collinear_one, 1, P(2,2), P(0,0)); // On segment
+ test_intersection(1,1, 3,3, 1,1, 1,1, geometry::is_collinear_one, 1, P(1,1), P(0,0)); // On segment, start
+ test_intersection(1,1, 3,3, 3,3, 3,3, geometry::is_collinear_one, 1, P(3,3), P(0,0)); // On segment, end
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/loop.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/loop.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,95 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/array.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/core/coordinate_type.hpp>
+
+#include <geometry/util/loop.hpp>
+#include <geometry/algorithms/assign.hpp>
+
+
+
+#include "common.hpp"
+
+
+
+using namespace geometry;
+
+
+struct test_operation_1
+{
+ template <typename Segment, typename State>
+ bool operator()(Segment&, State& state) const
+ {
+ state +=1;
+ return true;
+ }
+};
+
+struct test_operation_2
+{
+ template <typename Segment, typename State>
+ bool operator()(Segment& segment, State& state) const
+ {
+ state += get<0>(segment.first)
+ + get<1>(segment.first)
+ + get<2>(segment.first)
+ + get<0>(segment.second)
+ + get<1>(segment.second)
+ + get<2>(segment.second);
+
+ static int count = 0;
+ if (++count == 3)
+ {
+ count = 0;
+ return false;
+ }
+
+ return true;
+ }
+};
+
+
+template <typename P>
+void test_all()
+{
+ boost::array<P, 5> a;
+ geometry::assign(a[0], 1, 2, 3);
+ geometry::assign(a[1], 4, 5, 6);
+ geometry::assign(a[2], 7, 8, 9);
+ geometry::assign(a[3], 10, 11, 12);
+ geometry::assign(a[4], 13, 14, 15);
+ typename coordinate_type<P>::type state;
+
+ state = 0;
+ BOOST_CHECK_EQUAL(loop(a, test_operation_1(), state), true);
+ BOOST_CHECK_EQUAL(state, 4);
+
+ state = 0;
+ BOOST_CHECK_EQUAL(loop(a, test_operation_2(), state), false);
+ BOOST_CHECK_EQUAL(state, 1+2+3+4+5+6 + 4+5+6+7+8+9 + 7+8+9+10+11+12);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, geometry::cs::cartesian> >();
+ test_all<point<float, 3, geometry::cs::cartesian> >();
+ test_all<point<double, 3, geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/loop.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/loop.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="loop"
+ ProjectGUID="{02DE0325-2DA2-442F-850F-287EEAFDD822}"
+ RootNamespace="loop"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\loop"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\loop"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\loop.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/make.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/make.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,132 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/algorithms/make.hpp>
+
+#include <geometry/core/concepts/box_concept.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include <geometry/io/wkt/aswkt.hpp>
+
+
+#include "common.hpp"
+
+using namespace geometry;
+
+template <typename T, typename P>
+void test_point_2d()
+{
+ P p = make<P>((T) 123, (T) 456);
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 123, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 456, 1.0e-6);
+
+}
+
+
+template <typename T, typename P>
+void test_point_3d()
+{
+ P p = make<P>((T) 123, (T) 456, (T) 789);
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 123, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 456, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<2>(p)), (double) 789, 1.0e-6);
+}
+
+
+template <typename T, typename P>
+void test_box_2d()
+{
+ typedef box<P> B;
+ B b = make<B>((T) 123, (T) 456, (T) 789, (T) 1011);
+ BOOST_CHECK_CLOSE( ((double) get<min_corner, 0>(b)), (double) 123, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<min_corner, 1>(b)), (double) 456, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<max_corner, 0>(b)), (double) 789, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<max_corner, 1>(b)), (double) 1011, 1.0e-6);
+
+ b = make_inverse<B>();
+}
+
+
+template <typename T, typename P>
+void test_linestring_2d()
+{
+ typedef linestring<P> L;
+
+ T coors[][2] = {{1,2}, {3,4}};
+
+ L line = make<L>(coors);
+
+ BOOST_CHECK_EQUAL(line.size(), 2);
+}
+
+template <typename T, typename P>
+void test_linestring_3d()
+{
+ typedef linestring<P> L;
+
+ T coors[][3] = {{1,2,3}, {4,5,6}};
+
+ L line = make<L>(coors);
+
+ BOOST_CHECK_EQUAL(line.size(), 2);
+ //std::cout << make_wkt(line) << std::endl;
+
+}
+
+template <typename T, typename P>
+void test_2d_t()
+{
+ test_point_2d<T, P>();
+ test_box_2d<T, P>();
+ test_linestring_2d<T, P>();
+}
+
+
+template <typename P>
+void test_2d()
+{
+ test_2d_t<int, P>();
+ test_2d_t<float, P>();
+ test_2d_t<double, P>();
+}
+
+
+template <typename T, typename P>
+void test_3d_t()
+{
+ test_linestring_3d<T, P>();
+// test_point_3d<T, test_point>();
+}
+
+template <typename P>
+void test_3d()
+{
+ test_3d_t<int, P>();
+ test_3d_t<float, P>();
+ test_3d_t<double, P>();
+}
+
+
+int test_main(int, char* [])
+{
+ //test_2d<int[2]>();
+ //test_2d<float[2]>();
+ //test_2d<double[2]>();
+ test_2d<point<int, 2, cs::cartesian> >();
+ test_2d<point<float, 2, cs::cartesian> >();
+ test_2d<point<double, 2, cs::cartesian> >();
+
+
+ test_3d<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/make.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/make.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="make"
+ ProjectGUID="{BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}"
+ RootNamespace="make"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\make"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\make"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\make.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/parse.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/parse.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,67 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/algorithms/parse.hpp>
+#include <geometry/geometries/point.hpp>
+
+#include <geometry/strategies/geographic/geo_parse.hpp>
+
+
+#include "common.hpp"
+
+using namespace geometry;
+
+
+
+template <typename P>
+void test_2d(double c, bool use_strategy)
+{
+ // normal order, east=x, north=y
+ P p;
+ parse(p, std::string("1dE"), std::string("2N"));
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 1 * c, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 2 * c, 1.0e-6);
+
+ // reversed order, y,x -> should be interpreted correctly
+ parse(p, std::string("1dN"), std::string("2E"));
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 2 * c, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 1 * c, 1.0e-6);
+
+ if (use_strategy)
+ {
+ // DUTCH system NOZW, only for degrees
+ geometry::strategy::dms_parser<false, 'N', 'O', 'Z', 'W'> strategy;
+ parse(p, std::string("1dO"), std::string("2Z"), strategy);
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 1, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) -2, 1.0e-6);
+ }
+
+ // rest of DMS is checked in parse_dms
+}
+
+
+template <typename T, typename P>
+void test_3d()
+{
+}
+
+
+
+int test_main(int, char* [])
+{
+ //test_2d<point<int, 2, cs::geographic<radian> > >();
+ //test_2d<point<float, 2, cs::geographic<radian> > >();
+
+ test_2d<point<double, 2, cs::geographic<degree> > >(1.0, true);
+ test_2d<point<double, 2, cs::geographic<radian> > >(geometry::math::d2r, false);
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/parse.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/parse.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="parse"
+ ProjectGUID="{38C7173B-F81D-427D-B236-57611A31656A}"
+ RootNamespace="parse"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\parse.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/parse_dms.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/parse_dms.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,118 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or parse_dms at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#include <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/strategies/geographic/geo_parse.hpp>
+
+
+
+using namespace geometry;
+
+void check(const geometry::dms_result& r, double v, int axis)
+{
+ double d = r;
+ BOOST_CHECK_CLOSE(d, v, 0.0001);
+ BOOST_CHECK(int(r.axis()) == axis);
+}
+
+template <bool as_radian>
+void test_dms(const std::string& s, double v, int axis)
+{
+ geometry::strategy::dms_parser<as_radian> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+template <bool as_radian>
+void test_dms_french(const std::string& s, double v, int axis)
+{
+ geometry::strategy::dms_parser<as_radian, 'N', 'E', 'S', 'O'> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+template <bool as_radian>
+void test_dms_dutch(const std::string& s, double v, int axis)
+{
+ geometry::strategy::dms_parser<as_radian, 'N', 'O', 'Z', 'W'> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+template <bool as_radian>
+void test_dms_case(const std::string& s, double v, int axis)
+{
+ geometry::strategy::dms_parser<as_radian, 'n', 'e', 's', 'w'> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+
+int test_main(int, char* [])
+{
+ test_dms<false>("5.9E", 5.9, 0);
+ test_dms<false>("5.9W", -5.9, 0);
+ test_dms<false>("5.9N", 5.9, 1);
+ test_dms<false>("5.9S", -5.9, 1);
+
+ // nearly pi -> nearly 180
+ test_dms<false>("3.14RE", 179.90874767107848755314620611629, 0);
+
+ test_dms<false>("5.9dE", 5.9, 0);
+ test_dms<false>("5.9dW", -5.9, 0);
+ test_dms<false>("5.9dN", 5.9, 1);
+ test_dms<false>("5.9dS", -5.9, 1);
+
+ // with minutes
+ test_dms<false>("5d15E", 5.25, 0);
+ test_dms<false>("5d30W", -5.50, 0);
+ test_dms<false>("5d45N", 5.75, 1);
+ test_dms<false>("5d00S", -5.00, 1);
+
+ // with minutes and indicator
+ test_dms<false>("5d15'E", 5.25, 0);
+ test_dms<false>("5d30'W", -5.50, 0);
+ test_dms<false>("5d45'N", 5.75, 1);
+ test_dms<false>("5d00'S", -5.00, 1);
+
+ // with minutes/seconds
+ test_dms<false>("5d10'05E", 5.168055, 0);
+ test_dms<false>("5d20'15W", -5.33750, 0);
+ test_dms<false>("5d30'25N", 5.5069444, 1);
+ test_dms<false>("5d40'35S", -5.676389, 1);
+
+ // with seconds only
+ double f3600 = 1/3600.0;
+ test_dms<false>("5d01\"E", 5 + f3600, 0);
+ test_dms<false>("5d02\"W", -(5 + 2.0 * f3600), 0);
+ test_dms<false>("5d03\"N", 5 + 3.0 * f3600, 1);
+ test_dms<false>("5d04\"S", -(5 + 4.0 * f3600), 1);
+
+ // with spaces, signs, etc etc
+ test_dms<false>("5d 10' 05\" E", 5.168055, 0);
+ test_dms<false>("+5d 10' 05\" E", 5.168055, 0);
+ test_dms<false>("-5d 10' 05\" E", -5.168055, 0);
+
+ // reversed orders and default
+ test_dms<false>("5d 05\" 10' E", 5.168055, 0);
+ test_dms<false>("E5 05\" 10' ", 5.168055, 0);
+ test_dms<false>("5", 5, 0);
+
+ // in radians
+ test_dms<true>("3.14RE", 3.14, 0);
+ test_dms<true>("3.14RW", -3.14, 0);
+
+ // other languages
+ test_dms_french<false>("52O", -52, 0);
+ test_dms_dutch <false>("52O", +52, 0);
+
+ // lower/upper case
+ test_dms<false>("52e", 52, 0);
+ test_dms_case<false>("52e", 52, 0);
+ test_dms_case<false>("52E", 52, 0);
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/parse_dms.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/parse_dms.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="parse_dms"
+ ProjectGUID="{A924B132-C216-4477-85EE-9118255011AA}"
+ RootNamespace="parse_dms"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse_dms"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse_dms"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\parse_dms.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/array_point.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/array_point.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,21 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 "function_requiring_a_point.hpp"
+
+#include "common.hpp"
+
+
+
+int main()
+{
+ float p1[3] = { 0, 0, 0 };
+ const float p2[3] = { 0, 0, 0 };
+ geometry::function_requiring_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/function_asserting_a_point.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/function_asserting_a_point.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,32 @@
+// Generic Geometry Library Point concept unit tests
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_FUNCTION_ASSERTING_A_POINT_HPP
+#define _GEOMETRY_FUNCTION_ASSERTING_A_POINT_HPP
+
+
+#include <boost/concept/requires.hpp>
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+namespace geometry
+{
+ template <typename P, typename CP>
+ void function_asserting_a_point(P& p1, const CP& p2)
+ {
+ BOOST_CONCEPT_ASSERT((Point<P>));
+ BOOST_CONCEPT_ASSERT((ConstPoint<P>));
+
+ get<0>(p1) = get<0>(p2);
+ }
+
+}
+
+
+#endif

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/function_requiring_a_point.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/function_requiring_a_point.hpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,32 @@
+// Generic Geometry Library Point concept unit tests
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 1995-2009, 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_FUNCTION_REQUIRING_A_POINT_HPP
+#define _GEOMETRY_FUNCTION_REQUIRING_A_POINT_HPP
+
+
+#include <boost/concept/requires.hpp>
+#include <geometry/core/concepts/point_concept.hpp>
+
+
+namespace geometry
+{
+ template <typename P, typename CP>
+
+ inline BOOST_CONCEPT_REQUIRES(
+ ((Point<P>)) ((ConstPoint<CP>)),
+ (void))
+ function_requiring_a_point(P& p1, const CP& p2)
+ {
+ set<0>(p1, get<0>(p2));
+ }
+}
+
+
+#endif

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/point_with_incorrect_coord_count.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/point_with_incorrect_coord_count.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,28 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 <boost/tuple/tuple.hpp>
+#include "function_requiring_a_point.hpp"
+#include "function_asserting_a_point.hpp"
+
+
+struct point: public boost::tuple<float, float>
+{
+ typedef float coordinate_type;
+ enum { coordinate_count = 3 };
+};
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ geometry::function_requiring_a_point(p1, p2);
+ geometry::function_asserting_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_coord_count.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_coord_count.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,25 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 <boost/tuple/tuple.hpp>
+#include "function_requiring_a_point.hpp"
+
+
+struct point: public boost::tuple<float, float>
+{
+ typedef float coordinate_type;
+};
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ geometry::function_requiring_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_coord_type.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_coord_type.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,25 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 <boost/tuple/tuple.hpp>
+#include "function_requiring_a_point.hpp"
+
+
+struct point: public boost::tuple<float, float>
+{
+ enum { coordinate_count = 2 };
+};
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ geometry::function_requiring_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_getter.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_getter.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,37 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 <boost/tuple/tuple.hpp>
+#include "function_requiring_a_point.hpp"
+
+
+struct point: private boost::tuple<float, float>
+{
+ typedef float coordinate_type;
+ enum { coordinate_count = 2 };
+
+ template <int I>
+ float& get()
+ { return boost::tuple<float, float>::get<I>(); }
+
+ /*
+ template <int I>
+ const float& get() const
+ { return boost::tuple<float, float>::get<I>(); }
+ */
+
+};
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ geometry::function_requiring_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_setter.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/point_without_setter.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,36 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 <boost/tuple/tuple.hpp>
+#include "function_requiring_a_point.hpp"
+
+
+struct point: private boost::tuple<float, float>
+{
+ typedef float coordinate_type;
+ enum { coordinate_count = 2 };
+
+ /*
+ template <int I>
+ float& get()
+ { return boost::tuple<float, float>::get<I>(); }
+ */
+
+ template <int I>
+ const float& get() const
+ { return boost::tuple<float, float>::get<I>(); }
+};
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ geometry::function_requiring_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/well_formed_point.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/well_formed_point.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,30 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 <boost/tuple/tuple.hpp>
+
+#include <geometry/core/cs.hpp>
+#include <geometry/geometries/register/register_point.hpp>
+
+#include "function_requiring_a_point.hpp"
+
+
+struct point: public boost::tuple<float, float>
+{
+};
+
+GEOMETRY_REGISTER_POINT_2D(point, float, cs::cartesian, get<0>(), get<1>())
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ geometry::function_requiring_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_concept_tests/well_formed_point_traits.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_concept_tests/well_formed_point_traits.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,77 @@
+// Generic Geometry Library Point concept test file
+//
+// Copyright Bruno Lalande 2008
+// Copyright Barend Gehrels, 1995-2009, 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 "function_requiring_a_point.hpp"
+#include <geometry/core/cs.hpp>
+
+struct point
+{
+ point(): x(), y() {}
+ float x, y;
+};
+
+
+template <int I> struct accessor;
+
+template <>
+struct accessor<0>
+{
+ static float get(const point& p) { return p.x; }
+ static void set(point& p, float value) { p.x = value; }
+};
+
+template <>
+struct accessor<1>
+{
+ static float get(const point& p) { return p.y; }
+ static void set(point& p, float value) { p.y = value; }
+};
+
+
+namespace geometry
+{
+ namespace traits
+ {
+ template <>
+ struct tag<point>
+ { typedef point_tag type; };
+
+ template <>
+ struct coordinate_type<point>
+ { typedef float type; };
+
+ template <>
+ struct coordinate_system<point>
+ { typedef geometry::cs::cartesian type; };
+
+ template <>
+ struct dimension<point>
+ { enum { value = 2 }; };
+
+ template <>
+ struct access<point>
+ {
+ template <int I>
+ static float get(const point& p)
+ { return accessor<I>::get(p); }
+
+ template <int I>
+ static void set(point& p, float value)
+ { accessor<I>::set(p, value); }
+ };
+ }
+}
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ geometry::function_requiring_a_point(p1, p2);
+}

Added: sandbox/ggl/libs/ggl/test/point_ll.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_ll.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,78 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/geometries/point_ll.hpp>
+#include <geometry/algorithms/transform.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include "common.hpp"
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ P p1(
+ geometry::latitude<T>(geometry::dms<geometry::south, T>(12, 2, 36)),
+ geometry::longitude<T>(geometry::dms<geometry::west, T>(77, 1, 42)));
+
+ // Check decimal/degree conversion
+ BOOST_CHECK_CLOSE(geometry::get<0>(p1), T(-77.0283), 0.001);
+ BOOST_CHECK_CLOSE(geometry::get<1>(p1), T(-12.0433), 0.001);
+
+ // Check degree/radian conversion
+ geometry::point_ll<T, geometry::cs::geographic<geometry::radian> > p2;
+ geometry::transform(p1, p2);
+
+ BOOST_CHECK_CLOSE(geometry::get<0>(p2), T(-1.3444), 0.001);
+ BOOST_CHECK_CLOSE(geometry::get<1>(p2), T(-0.210196), 0.001);
+
+ // Check degree/radian conversion back
+ P p3;
+ geometry::transform(p2, p3);
+ BOOST_CHECK_CLOSE(geometry::get<0>(p3), T(-77.0283), 0.001);
+ BOOST_CHECK_CLOSE(geometry::get<1>(p3), T(-12.0433), 0.001);
+
+
+ // Check decimal/degree conversion back
+ int d;
+ int m;
+ double s;
+ bool positive;
+ char cardinal;
+
+ geometry::dms<geometry::cd_lat, T> d1(geometry::get<0>(p3));
+ d1.get_dms(d, m, s, positive, cardinal);
+
+ BOOST_CHECK(d == 77);
+ BOOST_CHECK(m == 1);
+ BOOST_CHECK_CLOSE(s, double(42), 0.1);
+ BOOST_CHECK(positive == false);
+ BOOST_CHECK(cardinal == 'S');
+
+ // Check dd conversion as string, back. We cannot do that always because of the precision.
+ // Only double gives correct results
+ //std::string st = d1.get_dms();
+ //std::cout << st << std::endl;
+ //BOOST_CHECK(st == "77 1'42\" S");
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<geometry::point_ll<float> >();
+ test_all<geometry::point_ll<double> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/point_ll.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/point_ll.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="point_ll"
+ ProjectGUID="{8376897F-30E1-43B5-8332-930A1F807BCB}"
+ RootNamespace="point_ll"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\point_ll"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\point_ll"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\point_ll.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/projection.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/projection.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,75 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+
+#include "common.hpp"
+
+#include <geometry/geometries/adapted/c_array.hpp>
+#include <geometry/algorithms/transform.hpp>
+
+#include <geometry/projections/parameters.hpp>
+#include <geometry/projections/proj/aea.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+
+template <typename PRJ, typename LL, typename P>
+void test_one(double lon, double lat,
+ typename geometry::coordinate_type<P>::type x,
+ typename geometry::coordinate_type<P>::type y,
+ const std::string& parameters)
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ LL ll;
+ ll.lon(lon);
+ ll.lat(lat);
+
+ projection::parameters par = projection::impl::pj_init_plus(parameters);
+ PRJ prj(par);
+
+ P xy;
+ prj.forward(ll, xy);
+
+ BOOST_CHECK_CLOSE(geometry::get<0>(xy), x, 0.001);
+ BOOST_CHECK_CLOSE(geometry::get<1>(xy), y, 0.001);
+}
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+ typedef geometry::point_ll<T, geometry::cs::geographic<geometry::degree> > LL;
+
+ /* aea */ test_one<projection::aea_ellipsoid<LL, P>, LL, P>(
+ 4.897000, 52.371000, 334609.583974, 5218502.503686,
+ "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65");
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test_point>();
+ //test_all<geometry::point_xy<int> >();
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+ test_all<geometry::point_xy<long double> >();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/projection.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/projection.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="projection"
+ ProjectGUID="{A46D98E8-88F2-4795-B839-CD3F6082E7B2}"
+ RootNamespace="projection"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\projection.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/projection_epsg.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/projection_epsg.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,82 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+
+#include "common.hpp"
+
+#include <geometry/geometries/adapted/c_array.hpp>
+#include <geometry/algorithms/transform.hpp>
+
+#include <geometry/projections/parameters.hpp>
+#include <geometry/projections/proj/tmerc.hpp>
+#include <geometry/projections/proj/sterea.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+
+template <int EPSG, typename LL, typename P>
+void test_one(double lon, double lat,
+ typename geometry::coordinate_type<P>::type x,
+ typename geometry::coordinate_type<P>::type y)
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ LL ll;
+ ll.lon(lon);
+ ll.lat(lat);
+
+ typedef projection::epsg_traits<EPSG, LL, P> E;
+ projection::parameters par = projection::impl::pj_init_plus(E::par());
+ typedef typename E::type PRJ;
+ PRJ prj(par);
+
+ P xy;
+ prj.forward(ll, xy);
+
+ BOOST_CHECK_CLOSE(geometry::get<0>(xy), x, 0.001);
+ BOOST_CHECK_CLOSE(geometry::get<1>(xy), y, 0.001);
+}
+
+
+template <typename DR, typename P>
+void test_deg_rad(double factor)
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+ typedef geometry::point_ll<T, geometry::cs::geographic<DR> > LL;
+
+ test_one<28992, LL, P>(4.897000 * factor, 52.371000 * factor, 121590.388077, 487013.903377);
+ test_one<29118, LL, P>(4.897000 * factor, 52.371000 * factor, 4852882, 9129373);
+}
+
+template <typename P>
+void test_all()
+{
+ test_deg_rad<geometry::degree, P>(1.0);
+ test_deg_rad<geometry::radian, P>(geometry::math::d2r);
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test_point>();
+ //test_all<geometry::point_xy<int> >();
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+ test_all<geometry::point_xy<long double> >();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/projection_epsg.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/projection_epsg.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="projection_epsg"
+ ProjectGUID="{F0990F82-1A44-4671-85D0-B38A81C48A8F}"
+ RootNamespace="projection_epsg"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection_epsg"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection_epsg"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\projection_epsg.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/projections.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/projections.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,200 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+
+#include "common.hpp"
+
+#include <geometry/geometries/adapted/c_array.hpp>
+#include <geometry/algorithms/transform.hpp>
+
+#include <geometry/projections/factory.hpp>
+#include <geometry/projections/parameters.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+
+template <typename P>
+void test_one(double lon, double lat,
+ typename geometry::coordinate_type<P>::type x,
+ typename geometry::coordinate_type<P>::type y,
+ const std::string& parameters)
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ typedef geometry::point_ll<T, geometry::cs::geographic<geometry::degree> > lola;
+
+ lola ll;
+ ll.lon(lon);
+ ll.lat(lat);
+
+ projection::parameters par = projection::impl::pj_init_plus(parameters);
+ projection::factory<lola, P, projection::parameters> fac;
+
+ boost::shared_ptr<projection::projection<lola, P> > prj(fac.create_new(par));
+
+ P xy;
+ prj->forward(ll, xy);
+
+ BOOST_CHECK_CLOSE(geometry::get<0>(xy), x, 0.001);
+ BOOST_CHECK_CLOSE(geometry::get<1>(xy), y, 0.001);
+}
+
+
+
+template <typename P>
+void test_all()
+{
+ /* aea */ test_one<P>(4.897000, 52.371000, 334609.583974, 5218502.503686, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65");
+ /* aeqd */ test_one<P>(4.897000, 52.371000, 384923.723428, 5809986.497118, "+proj=aeqd +ellps=WGS84 +units=m");
+ /* airy */ test_one<P>(4.897000, 52.371000, 328249.003313, 4987937.101447, "+proj=airy +ellps=WGS84 +units=m");
+ /* aitoff */ test_one<P>(4.897000, 52.371000, 384096.182830, 5831239.274680, "+proj=aitoff +ellps=WGS84 +units=m");
+ /* alsk */ test_one<P>(-84.390000, 33.755000, 7002185.416415, -3700467.546545, "+proj=alsk +ellps=WGS84 +units=m");
+ /* apian */ test_one<P>(4.897000, 52.371000, 360906.947408, 5829913.052335, "+proj=apian +ellps=WGS84 +units=m");
+ /* august */ test_one<P>(4.897000, 52.371000, 472494.816642, 6557137.075680, "+proj=august +ellps=WGS84 +units=m");
+ /* bacon */ test_one<P>(4.897000, 52.371000, 203584.432463, 7934660.138798, "+proj=bacon +ellps=WGS84 +units=m");
+ /* bipc */ test_one<P>(4.897000, 52.371000, 3693973.674143, -8459972.647559, "+proj=bipc +ellps=WGS84 +units=m");
+ /* boggs */ test_one<P>(4.897000, 52.371000, 346620.618258, 5966441.169806, "+proj=boggs +ellps=WGS84 +units=m");
+ /* bonne */ test_one<P>(4.897000, 52.371000, 333291.091896, 274683.016972, "+proj=bonne +ellps=WGS84 +units=m +lat_1=50");
+ /* cass */ test_one<P>(4.897000, 52.371000, 333274.431072, 5815921.803069, "+proj=cass +ellps=WGS84 +units=m");
+ /* cc */ test_one<P>(4.897000, 52.371000, 545131.546415, 8273513.720038, "+proj=cc +ellps=WGS84 +units=m");
+ /* cea */ test_one<P>(4.897000, 52.371000, 545131.546415, 5031644.669407, "+proj=cea +ellps=WGS84 +units=m");
+ /* chamb */ test_one<P>(4.897000, 52.371000, -3221300.532044, 872840.127676, "+proj=chamb +ellps=WGS84 +units=m +lat_1=52 +lon_1=5 +lat_2=30 +lon_2=80 +lat_3=20 +lon_3=-50");
+ /* collg */ test_one<P>(4.897000, 52.371000, 280548.640940, 6148862.475491, "+proj=collg +ellps=WGS84 +units=m");
+ /* crast */ test_one<P>(4.897000, 52.371000, 340944.220871, 5874029.522010, "+proj=crast +ellps=WGS84 +units=m");
+ /* denoy */ test_one<P>(4.897000, 52.371000, 382253.324398, 5829913.052335, "+proj=denoy +ellps=WGS84 +units=m");
+ /* eck1 */ test_one<P>(4.897000, 52.371000, 356112.818167, 5371202.270688, "+proj=eck1 +ellps=WGS84 +units=m");
+ /* eck2 */ test_one<P>(4.897000, 52.371000, 320023.223588, 6697754.654662, "+proj=eck2 +ellps=WGS84 +units=m");
+ /* eck3 */ test_one<P>(4.897000, 52.371000, 417367.858470, 4923223.990430, "+proj=eck3 +ellps=WGS84 +units=m");
+ /* eck4 */ test_one<P>(4.897000, 52.371000, 383678.300021, 6304427.033917, "+proj=eck4 +ellps=WGS84 +units=m");
+ /* eck5 */ test_one<P>(4.897000, 52.371000, 387191.346304, 5142132.228246, "+proj=eck5 +ellps=WGS84 +units=m");
+ /* eck6 */ test_one<P>(4.897000, 52.371000, 342737.885307, 6363364.830847, "+proj=eck6 +ellps=WGS84 +units=m");
+ /* eqc */ test_one<P>(4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=eqc +ellps=WGS84 +units=m");
+ /* eqdc */ test_one<P>(4.897000, 52.371000, 307874.536263, 5810915.646438, "+proj=eqdc +ellps=WGS84 +units=m +lat_1=60 +lat_2=0");
+ /* euler */ test_one<P>(4.897000, 52.371000, 338753.024859, 5836825.984893, "+proj=euler +ellps=WGS84 +units=m +lat_1=60 +lat_2=0");
+ /* fahey */ test_one<P>(4.897000, 52.371000, 388824.354103, 5705638.873094, "+proj=fahey +ellps=WGS84 +units=m");
+ /* fouc */ test_one<P>(4.897000, 52.371000, 268017.369817, 6272855.564674, "+proj=fouc +ellps=WGS84 +units=m");
+ /* fouc_s */ test_one<P>(4.897000, 52.371000, 545131.546415, 5051361.531375, "+proj=fouc_s +ellps=WGS84 +units=m");
+ /* gall */ test_one<P>(4.897000, 52.371000, 385466.213109, 5354217.135929, "+proj=gall +ellps=WGS84 +units=m");
+ /* geocent */ test_one<P>(4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=geocent +ellps=WGS84 +units=m");
+ /* geos */ test_one<P>(4.897000, 52.371000, 313594.638994, 4711397.361812, "+proj=geos +ellps=WGS84 +units=m +h=40000000");
+ /* gins8 */ test_one<P>(4.897000, 52.371000, 409919.989781, 6235811.415629, "+proj=gins8 +ellps=WGS84 +units=m");
+ /* gnom */ test_one<P>(4.897000, 52.371000, 546462.815658, 8303824.612633, "+proj=gnom +ellps=WGS84 +units=m");
+ /* goode */ test_one<P>(4.897000, 52.371000, 360567.451176, 5782693.787691, "+proj=goode +ellps=WGS84 +units=m");
+ /* gs48 */ test_one<P>(-84.390000, 33.755000, 4904886.323054, 12421187.782392, "+proj=gs48 +ellps=WGS84 +units=m");
+ /* gs50 */ test_one<P>(-84.390000, 33.755000, 3190310.148850, -564230.076744, "+proj=gs50 +ellps=WGS84 +units=m");
+ /* gstmerc */ test_one<P>(4.897000, 52.371000, 333173.875017, 5815062.181746, "+proj=gstmerc +ellps=WGS84 +units=m");
+ /* hammer */ test_one<P>(4.897000, 52.371000, 370843.923425, 5630047.232233, "+proj=hammer +ellps=WGS84 +units=m");
+ /* hatano */ test_one<P>(4.897000, 52.371000, 383644.128560, 6290117.704632, "+proj=hatano +ellps=WGS84 +units=m");
+ /* kav5 */ test_one<P>(4.897000, 52.371000, 383646.088858, 5997047.888175, "+proj=kav5 +ellps=WGS84 +units=m");
+ /* kav7 */ test_one<P>(4.897000, 52.371000, 407769.043907, 5829913.052335, "+proj=kav7 +ellps=WGS84 +units=m");
+ /* krovak */ test_one<P>(4.897000, 52.371000, -1343424.322189, -661733.505873, "+proj=krovak +ellps=WGS84 +units=m");
+ /* labrd */ test_one<P>(47.516667, -18.916667, 513667.401013, 797810.774147, "+proj=labrd +ellps=intl +azi=18d54 +lat_0=18d54S +lon_0=46d26'13.95E +k_0=0.9995 +x_0=400000 +y_0=800000");
+ /* laea */ test_one<P>(4.897000, 52.371000, 371541.476735, 5608007.251007, "+proj=laea +ellps=WGS84 +units=m");
+ /* lagrng */ test_one<P>(4.897000, 52.371000, 413379.673720, 6281547.821085, "+proj=lagrng +ellps=WGS84 +units=m +W=1");
+ /* larr */ test_one<P>(4.897000, 52.371000, 485541.716273, 6497324.523196, "+proj=larr +ellps=WGS84 +units=m");
+ /* lask */ test_one<P>(4.897000, 52.371000, 456660.618715, 6141427.377857, "+proj=lask +ellps=WGS84 +units=m");
+ /* latlon */ test_one<P>(4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlon +ellps=WGS84 +units=m");
+ /* latlong */ test_one<P>(4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlong +ellps=WGS84 +units=m");
+ /* lcc */ test_one<P>(4.897000, 52.371000, 319700.820572, 5828852.504871, "+proj=lcc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ /* lcca */ test_one<P>(4.897000, 52.371000, 363514.402883, 2555324.493896, "+proj=lcca +ellps=WGS84 +units=m +lat_0=30n +lat_1=55n +lat_2=60n");
+ /* leac */ test_one<P>(4.897000, 52.371000, 249343.870798, 6909632.226405, "+proj=leac +ellps=WGS84 +units=m");
+ /* lee_os */ test_one<P>(4.897000, 52.371000, 2470789.632346, 31997156.368301, "+proj=lee_os +ellps=WGS84 +units=m");
+ /* longlat */ test_one<P>(4.897000, 52.371000, 0.085469, 0.914046, "+proj=longlat +ellps=WGS84 +units=m");
+ /* lonlat */ test_one<P>(4.897000, 52.371000, 0.085469, 0.914046, "+proj=lonlat +ellps=WGS84 +units=m");
+ /* loxim */ test_one<P>(4.897000, 52.371000, 462770.371742, 5829913.052335, "+proj=loxim +ellps=WGS84 +units=m");
+ /* lsat */ test_one<P>(4.897000, 52.371000, 11994414.545228, 3758147.909029, "+proj=lsat +ellps=WGS84 +units=m +lsat=1 +path=1");
+ /* mbt_fps */ test_one<P>(4.897000, 52.371000, 392815.792409, 6007058.470101, "+proj=mbt_fps +ellps=WGS84 +units=m");
+ /* mbt_s */ test_one<P>(4.897000, 52.371000, 389224.301381, 5893467.204064, "+proj=mbt_s +ellps=WGS84 +units=m");
+ /* mbtfpp */ test_one<P>(4.897000, 52.371000, 345191.582111, 6098551.031494, "+proj=mbtfpp +ellps=WGS84 +units=m");
+ /* mbtfpq */ test_one<P>(4.897000, 52.371000, 371214.469979, 5901319.366034, "+proj=mbtfpq +ellps=WGS84 +units=m");
+ /* mbtfps */ test_one<P>(4.897000, 52.371000, 325952.066750, 6266156.827884, "+proj=mbtfps +ellps=WGS84 +units=m");
+ /* merc */ test_one<P>(4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=merc +ellps=WGS84 +units=m");
+ /* mil_os */ test_one<P>(4.897000, 52.371000, -1017212.552960, 3685935.358004, "+proj=mil_os +ellps=WGS84 +units=m");
+ /* mill */ test_one<P>(4.897000, 52.371000, 545131.546415, 6431916.372717, "+proj=mill +ellps=WGS84 +units=m");
+ /* moll */ test_one<P>(4.897000, 52.371000, 360567.451176, 6119459.421291, "+proj=moll +ellps=WGS84 +units=m");
+ /* murd1 */ test_one<P>(4.897000, 52.371000, 333340.993642, 5839071.944597, "+proj=murd1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ /* murd2 */ test_one<P>(4.897000, 52.371000, 317758.821713, 6759296.097305, "+proj=murd2 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ /* murd3 */ test_one<P>(4.897000, 52.371000, 331696.409000, 5839224.186916, "+proj=murd3 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ /* nell */ test_one<P>(4.897000, 52.371000, 454576.246081, 5355027.851999, "+proj=nell +ellps=WGS84 +units=m");
+ /* nell_h */ test_one<P>(4.897000, 52.371000, 438979.742911, 5386970.539995, "+proj=nell_h +ellps=WGS84 +units=m");
+ /* nicol */ test_one<P>(4.897000, 52.371000, 360493.071000, 5836451.532406, "+proj=nicol +ellps=WGS84 +units=m");
+ /* nsper */ test_one<P>(4.897000, 52.371000, 0.521191, 7.919806, "+proj=nsper +ellps=WGS84 +units=m +a=10 +h=40000000");
+ /* nzmg */ test_one<P>(174.783333, -36.850000, 2669448.884228, 6482177.102194, "+proj=nzmg +ellps=WGS84 +units=m");
+ /* ocea */ test_one<P>(4.897000, 52.371000, 90368744555736.703000, -5887882801731.769500, "+proj=ocea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e");
+ /* oea */ test_one<P>(4.897000, 52.371000, -1236967.015805, 3072499.235056, "+proj=oea +ellps=WGS84 +units=m +n=0.5 +m=0.5");
+ /* omerc */ test_one<P>(4.897000, 52.371000, 1009705.329154, 5829437.254923, "+proj=omerc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e");
+ /* ortel */ test_one<P>(4.897000, 52.371000, 360906.947408, 5829913.052335, "+proj=ortel +ellps=WGS84 +units=m");
+ /* ortho */ test_one<P>(4.897000, 52.371000, 332422.874291, 5051361.531375, "+proj=ortho +ellps=WGS84 +units=m");
+ /* pconic */ test_one<P>(4.897000, 52.371000, -34692.463986, 12802740.378536, "+proj=pconic +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ /* poly */ test_one<P>(4.897000, 52.371000, 333274.269648, 5815908.957562, "+proj=poly +ellps=WGS84 +units=m");
+ /* putp1 */ test_one<P>(4.897000, 52.371000, 375730.931178, 5523551.121434, "+proj=putp1 +ellps=WGS84 +units=m");
+ /* putp2 */ test_one<P>(4.897000, 52.371000, 351480.997939, 5942668.547355, "+proj=putp2 +ellps=WGS84 +units=m");
+ /* putp3 */ test_one<P>(4.897000, 52.371000, 287673.972013, 4651597.610600, "+proj=putp3 +ellps=WGS84 +units=m");
+ /* putp3p */ test_one<P>(4.897000, 52.371000, 361313.008033, 4651597.610600, "+proj=putp3p +ellps=WGS84 +units=m");
+ /* putp4p */ test_one<P>(4.897000, 52.371000, 351947.465829, 6330828.716145, "+proj=putp4p +ellps=WGS84 +units=m");
+ /* putp5 */ test_one<P>(4.897000, 52.371000, 320544.316171, 5908383.682019, "+proj=putp5 +ellps=WGS84 +units=m");
+ /* putp5p */ test_one<P>(4.897000, 52.371000, 436506.666600, 5908383.682019, "+proj=putp5p +ellps=WGS84 +units=m");
+ /* putp6 */ test_one<P>(4.897000, 52.371000, 324931.055842, 5842588.644796, "+proj=putp6 +ellps=WGS84 +units=m");
+ /* putp6p */ test_one<P>(4.897000, 52.371000, 338623.512107, 6396742.919679, "+proj=putp6p +ellps=WGS84 +units=m");
+ /* qua_aut */ test_one<P>(4.897000, 52.371000, 370892.621714, 5629072.862494, "+proj=qua_aut +ellps=WGS84 +units=m");
+ /* robin */ test_one<P>(4.897000, 52.371000, 394576.514058, 5571243.644839, "+proj=robin +ellps=WGS84 +units=m");
+ /* rouss */ test_one<P>(4.897000, 52.371000, 412826.227669, 6248368.849775, "+proj=rouss +ellps=WGS84 +units=m");
+ /* rpoly */ test_one<P>(4.897000, 52.371000, 332447.130797, 5841164.662431, "+proj=rpoly +ellps=WGS84 +units=m");
+ /* sinu */ test_one<P>(4.897000, 52.371000, 333528.909809, 5804625.044313, "+proj=sinu +ellps=WGS84 +units=m");
+ /* somerc */ test_one<P>(4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=somerc +ellps=WGS84 +units=m");
+ /* stere */ test_one<P>(47.516667, -18.916667, 10864784.058711, -5015032.861234, "+proj=stere +ellps=WGS84 +units=m +lat_ts=30n");
+ /* sterea */ test_one<P>(4.897000, 52.371000, 121590.388077, 487013.903377, "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m");
+ /* tcc */ test_one<P>(4.897000, 52.371000, 332875.293370, 5841186.022551, "+proj=tcc +ellps=WGS84 +units=m");
+ /* tcea */ test_one<P>(4.897000, 52.371000, 332422.874291, 5841186.022551, "+proj=tcea +ellps=WGS84 +units=m");
+ /* tissot */ test_one<P>(4.897000, 52.371000, 431443.972539, 3808494.480735, "+proj=tissot +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ /* tmerc */ test_one<P>(4.897000, 52.371000, 333425.492136, 5815921.814396, "+proj=tmerc +ellps=WGS84 +units=m");
+ /* tpeqd */ test_one<P>(4.897000, 52.371000, 998886.128891, 873800.468721, "+proj=tpeqd +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=0 +lon_2=30e");
+ /* tpers */ test_one<P>(4.897000, 52.371000, -1172311.936260, 6263306.090352, "+proj=tpers +ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000");
+ /* ups */ test_one<P>(4.897000, 52.371000, 2369508.503532, -2312783.579527, "+proj=ups +ellps=WGS84 +units=m");
+ /* urm5 */ test_one<P>(4.897000, 52.371000, 522185.854469, 5201544.371625, "+proj=urm5 +ellps=WGS84 +units=m +n=.3 +q=.3 +alpha=10");
+ /* urmfps */ test_one<P>(4.897000, 52.371000, 439191.083465, 5919500.887257, "+proj=urmfps +ellps=WGS84 +units=m +n=0.50");
+ /* utm */ test_one<P>(4.897000, 52.371000, 1037203.568847, 5831704.656129, "+proj=utm +ellps=WGS84 +units=m");
+ /* vandg */ test_one<P>(4.897000, 52.371000, 489005.929978, 6431581.024949, "+proj=vandg +ellps=WGS84 +units=m");
+ /* vandg2 */ test_one<P>(4.897000, 52.371000, 488953.592205, 6434578.861895, "+proj=vandg2 +ellps=WGS84 +units=m");
+ /* vandg3 */ test_one<P>(4.897000, 52.371000, 489028.113123, 6430309.983824, "+proj=vandg3 +ellps=WGS84 +units=m");
+ /* vandg4 */ test_one<P>(4.897000, 52.371000, 360804.549444, 5831531.435618, "+proj=vandg4 +ellps=WGS84 +units=m");
+ /* vitk1 */ test_one<P>(4.897000, 52.371000, 338522.044182, 5839611.656064, "+proj=vitk1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ /* wag1 */ test_one<P>(4.897000, 52.371000, 348059.961742, 6344311.295111, "+proj=wag1 +ellps=WGS84 +units=m");
+ /* wag2 */ test_one<P>(4.897000, 52.371000, 388567.174132, 6112322.636203, "+proj=wag2 +ellps=WGS84 +units=m");
+ /* wag3 */ test_one<P>(4.897000, 52.371000, 447014.436776, 5829913.052335, "+proj=wag3 +ellps=WGS84 +units=m");
+ /* wag4 */ test_one<P>(4.897000, 52.371000, 365021.547713, 6300040.998324, "+proj=wag4 +ellps=WGS84 +units=m");
+ /* wag5 */ test_one<P>(4.897000, 52.371000, 379647.914735, 6771982.379506, "+proj=wag5 +ellps=WGS84 +units=m");
+ /* wag6 */ test_one<P>(4.897000, 52.371000, 446107.907415, 5523551.121434, "+proj=wag6 +ellps=WGS84 +units=m");
+ /* wag7 */ test_one<P>(4.897000, 52.371000, 366407.198644, 6169832.906560, "+proj=wag7 +ellps=WGS84 +units=m");
+ /* weren */ test_one<P>(4.897000, 52.371000, 402668.037596, 7243190.025762, "+proj=weren +ellps=WGS84 +units=m");
+ /* wink1 */ test_one<P>(4.897000, 52.371000, 438979.742911, 5829913.052335, "+proj=wink1 +ellps=WGS84 +units=m");
+ /* wink2 */ test_one<P>(4.897000, 52.371000, 472810.645318, 6313461.757868, "+proj=wink2 +ellps=WGS84 +units=m");
+ /* wintri */ test_one<P>(4.897000, 52.371000, 365568.851909, 5830576.163507, "+proj=wintri +ellps=WGS84 +units=m");
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test_point>();
+ //test_all<geometry::point_xy<int> >();
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+ test_all<geometry::point_xy<long double> >();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/projections.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/projections.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="projections"
+ ProjectGUID="{38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}"
+ RootNamespace="projections"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projections"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projections"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ AdditionalIncludeDirectories="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\projections.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/pythagoras.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/pythagoras.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,96 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/strategies/cartesian/cart_distance.hpp>
+#include <geometry/algorithms/assign.hpp>
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+
+template <typename P1, typename P2>
+void test_null_distance()
+{
+ typename geometry::strategy::distance::pythagoras<P1, P2> pythagoras;
+
+ P1 p1;
+ geometry::assign(p1, 1, 2, 3);
+ P2 p2;
+ geometry::assign(p2, 1, 2, 3);
+ BOOST_CHECK_EQUAL(double(pythagoras(p1, p2)), 0);
+}
+
+template <typename P1, typename P2>
+void test_axis()
+{
+ geometry::strategy::distance::pythagoras<P1, P2> pythagoras;
+
+ P1 p1;
+ geometry::assign(p1, 0, 0, 0);
+
+ P2 p2;
+ geometry::assign(p2, 1, 0, 0);
+ BOOST_CHECK_EQUAL(double(pythagoras(p1, p2)), 1);
+ geometry::assign(p2, 0, 1, 0);
+ BOOST_CHECK_EQUAL(double(pythagoras(p1, p2)), 1);
+ geometry::assign(p2, 0, 0, 1);
+ BOOST_CHECK_EQUAL(double(pythagoras(p1, p2)), 1);
+}
+
+template <typename P1, typename P2>
+void test_arbitrary()
+{
+ geometry::strategy::distance::pythagoras<P1, P2> pythagoras;
+
+ P1 p1;
+ geometry::assign(p1, 1, 2, 3);
+ P2 p2;
+ geometry::assign(p2, 9, 8, 7);
+ BOOST_CHECK_CLOSE((double)pythagoras(p1, p2), sqrt((double)116), 0.001);
+}
+
+
+template <typename P1, typename P2>
+void test_all()
+{
+ test_null_distance<P1, P2>();
+ test_axis<P1, P2>();
+ test_arbitrary<P1, P2>();
+}
+
+template <typename P>
+void test_all()
+{
+ test_all<P, int[3]>();
+ test_all<P, float[3]>();
+ test_all<P, double[3]>();
+ test_all<P, test_point>();
+ test_all<P, point<int, 3, cs::cartesian> >();
+ test_all<P, point<float, 3, cs::cartesian> >();
+ test_all<P, point<double, 3, cs::cartesian> >();
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/pythagoras.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/pythagoras.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="pythagoras"
+ ProjectGUID="{763CA955-FC01-4AFD-9593-69D36836B3F7}"
+ RootNamespace="pythagoras"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\pythagoras"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\pythagoras"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\pythagoras.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/segment.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/segment.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,67 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+
+#include <geometry/core/concepts/segment_concept.hpp>
+#include <geometry/geometries/segment.hpp>
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef segment<P> S;
+
+ P p1;
+ P p2;
+ S s(p1, p2);
+ BOOST_CHECK_EQUAL(&s.first, &p1);
+ BOOST_CHECK_EQUAL(&s.second, &p2);
+
+ // Compilation tests, all things should compile.
+ BOOST_CONCEPT_ASSERT((ConstSegment<S>));
+ BOOST_CONCEPT_ASSERT((Segment<S>));
+
+ typedef typename coordinate_type<S>::type T;
+ typedef typename point_type<S>::type SP;
+
+
+std::cout << sizeof(typename coordinate_type<S>::type) << std::endl;
+
+ typedef segment<const P> CS;
+ //BOOST_CONCEPT_ASSERT((ConstSegment<CS>));
+
+ CS cs(p1, p2);
+
+ typedef typename coordinate_type<CS>::type CT;
+ typedef typename point_type<CS>::type CSP;
+
+
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ //test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/segment.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/segment.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="segment"
+ ProjectGUID="{F995B070-62A2-46FE-A676-79AADB71DBD8}"
+ RootNamespace="segment"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\segment.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/selected.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/selected.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,94 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/io/wkt/fromwkt.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+#include <geometry/algorithms/selected.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include "common.hpp"
+
+
+template <typename G, typename P>
+void test_selected(const G& g, const P& point, bool result, double dist)
+{
+ bool sel = geometry::selected(g, point, dist);
+ BOOST_CHECK_EQUAL(sel, result);
+}
+
+
+template <typename G, typename P>
+void test_selected(const std::string& wkt, const P& point, bool result, double dist)
+{
+ G g;
+ geometry::from_wkt(wkt, g);
+ test_selected(g, point, result, dist);
+}
+
+
+
+
+template <typename P>
+void test_all()
+{
+ test_selected<P>("POINT(1 1)", P(1,1), true, 0.001);
+ test_selected<P>("POINT(1 1)", P(3,3), false, 2);
+ test_selected<P>("POINT(1 1)", P(1,2.00001), false, 1);
+ test_selected<P>("POINT(1 1)", P(1,1.99999), true, 1);
+ test_selected<P>("POINT(1 1)", P(1.99999,1.99999), false, 1);
+
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1,2 2)", P(1,1), true, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1,2 2)", P(2,2), true, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1,2 2)", P(2.01,2.01), false, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1,2 2)", P(1,0.9), false, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1,2 2)", P(1.5,1.5), true, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1,2 2)", P(1.5,1.6), false, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1,2 2,3 0,5 0,5 8)", P(5,5.000001), true, 0.0001);
+
+ // Lines with zero,one points
+ test_selected<geometry::linestring<P> >("LINESTRING( )", P(1,1), false, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 1)", P(1,1), true, 0.0001);
+ test_selected<geometry::linestring<P> >("LINESTRING(1 2)", P(1,1), false, 0.0001);
+
+ // nyi
+ //test_selected<geometry::linear_ring<P> >();
+
+ test_selected<geometry::polygon<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(0.001, 0.001), true, 0.0001);
+ test_selected<geometry::polygon<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(1, 1), true, 0.0001);
+ test_selected<geometry::polygon<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(2, 5), false, 0.0001);
+
+ typedef geometry::box<P> B;
+ test_selected(geometry::make<B>(0,0,4,4), P(2,2), true, 0.001);
+ test_selected(geometry::make<B>(0,0,4,4), P(5,5), false, 0.001);
+ test_selected(geometry::make<B>(0,0,4,4), P(0,0), false, 0.001);
+ test_selected(geometry::make<B>(0,0,4,4), P(4,4), false, 0.001);
+
+ // nyi
+ //test_selected<geometry::segment<P> >();
+ //test_selected<geometry::segment<const P> >();
+ //test_selected<geometry::nsphere<P, double> >();
+}
+
+
+int test_main(int, char* [])
+{
+ // Integer not applicable here, just because of the tests using floating point
+ // test_all<geometry::point_xy<int> >();
+
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/selected.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/selected.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="selected"
+ ProjectGUID="{22DD12E5-4AAD-4066-9C4F-4C360F7759AA}"
+ RootNamespace="selected"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\selected"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\selected"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\selected.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/simplify.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/simplify.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,128 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/io/wkt/fromwkt.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+#include <geometry/algorithms/simplify.hpp>
+
+#include <geometry/geometries/geometries.hpp>
+
+#include "common.hpp"
+
+
+
+
+template <typename P>
+void test_simplify_linestring()
+{
+ typedef typename geometry::coordinate_type<P>::type T;
+
+ geometry::linestring<P> line;
+
+ // Generate linestring using only integer coordinates and obvious results (point 5,5 will be removed)
+ geometry::from_wkt("linestring(0 0, 5 5, 10 10)", line);
+
+ // Check using linestring, TO BE UPDATED
+ /*
+ {
+ geometry::linestring<P> simplified;
+ geometry::simplify(line, simplified, 3.0);
+ BOOST_CHECK(simplified.size() == 2);
+ }
+ */
+
+ // Check using output iterator
+ {
+ geometry::linestring<P> simplified;
+ geometry::simplify(line, std::back_inserter(simplified), 3.0);
+ BOOST_CHECK(simplified.size() == 2);
+ }
+
+ // define strategy
+ typedef typename geometry::cs_tag<P>::type TAG;
+ typedef geometry::strategy::distance::xy_point_segment<P, geometry::segment<const P> > S;
+ typedef geometry::linestring<P> L;
+ typedef geometry::strategy::simplify::douglas_peucker<L, std::back_insert_iterator<L>, S> DOUGLAS;
+
+
+ // Check using iterators and simplify strategy
+ {
+ geometry::linestring<P> simplified;
+ geometry::simplify(line, std::back_inserter(simplified), 3.0, DOUGLAS());
+ BOOST_CHECK(simplified.size() == 2);
+ }
+}
+
+
+
+template <typename P>
+void test_simplify_polygon()
+{
+ {
+ geometry::polygon<P> poly;
+
+ // Generate polygon using only integer coordinates and obvious results
+ // Polygon is a hexagon, having one extra point (2,1) on a line which should be filtered out.
+ geometry::from_wkt("polygon((4 0, 8 2, 8 7, 4 9, 0 7, 0 2, 2 1, 4 0))", poly);
+ BOOST_CHECK(poly.outer().size() == 8);
+
+ geometry::polygon<P> simplified;
+ geometry::simplify(poly, simplified, 1.0);
+
+ //std::cout << poly << std::endl;
+ //std::cout << simplified << std::endl;
+
+ BOOST_CHECK(simplified.outer().size() == 7);
+ }
+
+ {
+ geometry::polygon<P> poly;
+
+ // Same polygon, with a hole (inner ring)
+ geometry::from_wkt("polygon((4 0, 8 2, 8 7, 4 9, 0 7, 0 2, 2 1, 4 0),(7 3, 7 6, 1 6, 1 3, 4 3, 7 3))", poly);
+ BOOST_CHECK(poly.outer().size() == 8);
+ BOOST_CHECK(poly.inners().size() == 1);
+ BOOST_CHECK(poly.inners().front().size() == 6);
+
+ geometry::polygon<P> simplified;
+ geometry::simplify(poly, simplified, 1.0);
+
+ //std::cout << poly << std::endl;
+ //std::cout << simplified << std::endl;
+
+ BOOST_CHECK(simplified.outer().size() == 7);
+ BOOST_CHECK(simplified.inners().size() == 1);
+ BOOST_CHECK(simplified.inners().front().size() == 5);
+ }
+}
+
+
+
+template <typename P>
+void test_all()
+{
+ test_simplify_linestring<P>();
+ test_simplify_polygon<P>();
+}
+
+
+int test_main(int, char* [])
+{
+ // Integer still fails
+ //test_all<geometry::point_xy<int> >();
+ test_all<geometry::point_xy<float> >();
+ test_all<geometry::point_xy<double> >();
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/simplify.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/simplify.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="simplify"
+ ProjectGUID="{B1760CB8-553B-42AB-B54E-3D0320FF252F}"
+ RootNamespace="simplify"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\simplify"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\simplify"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\simplify.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/transform.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/transform.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,128 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/algorithms/transform.hpp>
+#include <geometry/algorithms/make.hpp>
+#include <geometry/geometries/geometries.hpp>
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include "common.hpp"
+
+
+
+template <typename P1, typename P2>
+void test_transform_point(double value)
+{
+ P1 p1;
+ geometry::set<0>(p1, 1);
+ geometry::set<1>(p1, 2);
+ P2 p2;
+ geometry::transform(p1, p2);
+ BOOST_CHECK_CLOSE((double) value * geometry::get<0>(p1), (double) geometry::get<0>(p2), 0.001);
+ BOOST_CHECK_CLOSE((double) value * geometry::get<1>(p1), (double) geometry::get<1>(p2), 0.001);
+}
+
+template <typename P1, typename P2>
+void test_transform_linestring()
+{
+ geometry::linestring<P1> line1;
+ line1.push_back(geometry::make<P1>(1, 1));
+ line1.push_back(geometry::make<P1>(2, 2));
+ geometry::linestring<P2> line2;
+ geometry::transform(line1, line2);
+ BOOST_CHECK_EQUAL(line1.size(), line2.size());
+
+ std::ostringstream out1, out2;
+ out1 << line1;
+ out2 << line2;
+ BOOST_CHECK_EQUAL(out1.str(), out1.str());
+}
+
+
+template <typename P1, typename P2>
+void test_all(double value = 1.0)
+{
+ test_transform_point<P1, P2>(value);
+ test_transform_linestring<P1, P2>();
+}
+
+template <typename T, typename DR>
+void test_transformations(double phi, double theta, double r)
+{
+ using namespace geometry;
+
+ typedef point<T, 3, cs::cartesian> XYZ;
+ XYZ p;
+
+ // 1: using spherical coordinates
+ {
+ typedef point<T, 3, cs::spherical<DR> > SPH;
+ SPH sph1, sph2;
+ assign(sph1, phi, theta, r);
+ transform(sph1, p);
+ transform(p, sph2);
+
+ BOOST_CHECK_CLOSE((double) geometry::get<0>(sph1), (double) geometry::get<0>(sph2), 0.001);
+ BOOST_CHECK_CLOSE((double) geometry::get<1>(sph1), (double) geometry::get<1>(sph2), 0.001);
+
+ //std::cout << make_wkt(p) << std::endl;
+ //std::cout << make_wkt(sph2) << std::endl;
+ }
+
+ // 2: using spherical coordinates on unit sphere
+ {
+ typedef point<T, 2, cs::spherical<DR> > SPH;
+ SPH sph1, sph2;
+ assign(sph1, phi, theta);
+ transform(sph1, p);
+ transform(p, sph2);
+
+ BOOST_CHECK_CLOSE((double) geometry::get<0>(sph1), (double) geometry::get<0>(sph2), 0.001);
+ BOOST_CHECK_CLOSE((double) geometry::get<1>(sph1), (double) geometry::get<1>(sph2), 0.001);
+
+ std::cout << make_wkt(sph1) << " " << make_wkt(p) << " " << make_wkt(sph2) << std::endl;
+ }
+}
+
+int test_main(int, char* [])
+{
+ using namespace geometry;
+ using namespace geometry::cs;
+ using namespace geometry::math;
+ //test_all<int[2]>();
+ //test_all<float[2]>(); not yet because cannot be copied, for polygon
+ //test_all<double[2]>();
+ //test_all<test_point, test_point>();
+
+ typedef geometry::point_xy<double > P;
+ test_all<P, P>();
+ test_all<geometry::point_xy<int>, geometry::point_xy<float> >();
+
+ test_all<geometry::point_ll<double, geographic<degree> >,
+ geometry::point_ll<double, geographic<radian> > >(d2r);
+ test_all<geometry::point_ll<double, geographic<radian> >,
+ geometry::point_ll<double, geographic<degree> > >(r2d);
+
+ test_all<geometry::point_ll<int, geographic<degree> >,
+ geometry::point_ll<float, geographic<radian> > >(d2r);
+
+ test_transformations<float, degree>(4, 52, 1);
+ test_transformations<double, degree>(4, 52, 1);
+
+ test_transformations<float, radian>(3 * d2r, 51 * d2r, 1);
+ test_transformations<double, radian>(3 * d2r, 51 * d2r, 1);
+
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/transform.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/transform.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="transform"
+ ProjectGUID="{41413E56-08DA-4592-94D2-5311FE90C62B}"
+ RootNamespace="transform"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transform"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transform"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ >
+ <File
+ RelativePath="..\algorithms\transform.hpp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\transform.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/transformer.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/transformer.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,111 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <geometry/algorithms/transform.hpp>
+#include <geometry/algorithms/make.hpp>
+#include <geometry/geometries/geometries.hpp>
+
+#include <geometry/strategies/transform/matrix_transformers.hpp>
+#include <geometry/strategies/transform/inverse_transformer.hpp>
+#include <geometry/strategies/transform/map_transformer.hpp>
+
+
+#include "common.hpp"
+
+
+template <typename P, typename TRANS>
+void check_inverse(const P& p, const TRANS& trans)
+{
+ geometry::strategy::transform::inverse_transformer<P, P> inverse(trans);
+
+ P i;
+ geometry::transform(p, i, inverse);
+
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(i)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(i)), 1.0, 0.001);
+}
+
+
+template <typename P>
+void test_all()
+{
+ P p;
+ geometry::assign(p, 1, 1);
+
+ {
+ geometry::strategy::transform::translate_transformer<P, P> trans(1, 1);
+ P tp;
+ geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(tp)), 2.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(tp)), 2.0, 0.001);
+
+ check_inverse(tp, trans);
+ }
+
+ {
+ geometry::strategy::transform::scale_transformer<P, P> trans(10, 10);
+ P tp;
+ geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(tp)), 10.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(tp)), 10.0, 0.001);
+
+ check_inverse(tp, trans);
+ }
+
+ {
+ geometry::strategy::transform::rotate_transformer<P, P, geometry::degree> trans(90.0);
+ P tp;
+ geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(tp)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(tp)), -1.0, 0.001);
+ check_inverse(tp, trans);
+ }
+
+
+ {
+ // Map from 0,0,2,2 to 0,0,500,500
+ geometry::strategy::transform::map_transformer<P, P, false> trans(0.0, 0.0, 2.0, 2.0, 500, 500);
+ P tp;
+ geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(geometry::get<0>(tp)), 250.0, 0.001);
+ BOOST_CHECK_CLOSE(double(geometry::get<1>(tp)), 250.0, 0.001);
+
+ check_inverse(tp, trans);
+ }
+
+
+}
+
+int test_main(int, char* [])
+{
+ using namespace geometry;
+
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+
+ test_all<boost::tuple<float, float> >();
+
+ //test_all<point<int, 2, cs::cartesian> >();
+ test_all<point<float, 2, cs::cartesian> >();
+ test_all<point<double, 2, cs::cartesian> >();
+
+
+
+ return 0;
+}
+
+

Added: sandbox/ggl/libs/ggl/test/transformer.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/transformer.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="transformer"
+ ProjectGUID="{9B62EBF7-D444-4D67-BA00-48CAEAF92756}"
+ RootNamespace="transformer"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transformer"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transformer"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\transformer.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/ggl/libs/ggl/test/within_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/within_test.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,67 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels, Geodan 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/algorithms/within.hpp>
+#include <geometry/normalize.hpp>
+
+#include <boost/config.hpp>
+#include <boost/test/included/test_exec_monitor.hpp>
+
+
+int test_main1( int , char* [] )
+{
+ typedef geometry::point<double> gl_point;
+ typedef geometry::circle<gl_point, double> gl_circle;
+ typedef geometry::box<gl_point> gl_box;
+ typedef geometry::linestring<gl_point> gl_line;
+ typedef geometry::linear_ring<gl_point> gl_ring;
+ typedef geometry::polygon<gl_point> gl_polygon;
+ typedef geometry::multi_polygon<gl_polygon> gl_multi_polygon;
+
+
+ gl_box box(gl_point(0,0), gl_point(2,2));
+ gl_circle circle(gl_point(1, 1), 2.5);
+ gl_line line;
+ line.push_back(gl_point(1,1));
+ line.push_back(gl_point(2,1));
+ line.push_back(gl_point(2,2));
+
+ gl_ring ring;
+ ring.push_back(gl_point(0,0));
+ ring.push_back(gl_point(1,0));
+ ring.push_back(gl_point(1,1));
+ ring.push_back(gl_point(0,1));
+ normalize(ring);
+
+ gl_polygon pol;
+ pol.outer() = ring;
+ gl_multi_polygon multi_polygon;
+ multi_polygon.push_back(pol);
+
+
+ // Point in circle
+ BOOST_CHECK_EQUAL(within(gl_point(2, 1), circle), true);
+ BOOST_CHECK_EQUAL(within(gl_point(12, 1), circle), false);
+
+ // Line in circle
+ BOOST_CHECK_EQUAL(within(line, circle), true);
+
+ line.push_back(gl_point(10,10));
+ BOOST_CHECK_EQUAL(within(line, circle), false);
+
+ // Box/ring/poly/multipoly in circle
+ BOOST_CHECK_EQUAL(within(box, circle), true);
+ BOOST_CHECK_EQUAL(within(ring, circle), true);
+
+ BOOST_CHECK_EQUAL(within(multi_polygon, circle), true);
+
+ // Point in box
+ BOOST_CHECK_EQUAL(within(gl_point(1, 1), box), true);
+ BOOST_CHECK_EQUAL(within(gl_point(12, 1), box), false);
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/wkt.cpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/wkt.cpp 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,117 @@
+// Generic Geometry Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008
+// 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 <sstream>
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/type_traits/is_integral.hpp>
+
+#include <geometry/io/wkt/streamwkt.hpp>
+
+#include <geometry/geometries/box.hpp>
+#include <geometry/geometries/linestring.hpp>
+#include <geometry/geometries/polygon.hpp>
+
+
+#include "common.hpp"
+
+
+using namespace geometry;
+
+
+template <typename P>
+void test_point_wkt()
+{
+ P p;
+ geometry::assign(p, 1, 23, 456);
+ std::ostringstream oss;
+ oss << p;
+ BOOST_CHECK_EQUAL(oss.str(), "POINT(1 23 456)");
+
+ if (!boost::is_integral<typename coordinate_type<P>::type>::type::value)
+ {
+ geometry::assign(p, 0.1f, 2.34f, 5.6789f);
+ std::ostringstream oss;
+ oss << p;
+ BOOST_CHECK_EQUAL(oss.str(), "POINT(0.1 2.34 5.6789)");
+ }
+}
+
+template <typename P>
+void test_linestring()
+{
+ linestring<P> ls;
+ P p;
+
+ geometry::assign(p, 1, 2, 3);
+ ls.push_back(p);
+ geometry::assign(p, 40, 50, 60);
+ ls.push_back(p);
+ geometry::assign(p, 700, 800, 900);
+ ls.push_back(p);
+
+ std::ostringstream oss;
+ oss << ls;
+ BOOST_CHECK_EQUAL(oss.str(), "LINESTRING(1 2 3,40 50 60,700 800 900)");
+}
+
+template <typename P>
+void test_polygon_wkt()
+{
+ polygon<P> p;
+ P pt;
+
+ geometry::assign(pt, 100, 200, 300);
+ p.outer().push_back(pt);
+ geometry::assign(pt, 400, 500, 600);
+ p.outer().push_back(pt);
+ geometry::assign(pt, 700, 800, 900);
+ p.outer().push_back(pt);
+
+ p.inners().resize(2);
+ geometry::assign(pt, 10, 20, 30);
+ p.inners()[0].push_back(pt);
+ geometry::assign(pt, 40, 50, 60);
+ p.inners()[0].push_back(pt);
+ geometry::assign(pt, 70, 80, 90);
+ p.inners()[0].push_back(pt);
+ geometry::assign(pt, 1, 2, 3);
+ p.inners()[1].push_back(pt);
+ geometry::assign(pt, 4, 5, 6);
+ p.inners()[1].push_back(pt);
+ geometry::assign(pt, 7, 8, 9);
+ p.inners()[1].push_back(pt);
+
+ std::ostringstream oss;
+ oss << p;
+ BOOST_CHECK_EQUAL(oss.str(), "POLYGON((100 200 300,400 500 600,700 800 900),(10 20 30,40 50 60,70 80 90),(1 2 3,4 5 6,7 8 9))");
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_point_wkt<P>();
+ test_linestring<P>();
+ test_polygon_wkt<P>();
+}
+
+
+int test_main(int, char* [])
+{
+ test_point_wkt<int[3]>();
+ test_point_wkt<float[3]>();
+ test_point_wkt<double[3]>();
+
+ test_all<test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/ggl/libs/ggl/test/wkt.vcproj
==============================================================================
--- (empty file)
+++ sandbox/ggl/libs/ggl/test/wkt.vcproj 2009-02-17 06:29:42 EST (Tue, 17 Feb 2009)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="wkt"
+ ProjectGUID="{E6BCAE7F-FD36-4018-B073-BE05F3D6790B}"
+ RootNamespace="wkt"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\wkt"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\wkt"
+ 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="../../../boost/ggl;.;..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ 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"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\wkt.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk