diff --git a/include/boost/geometry/extensions/algorithms/midpoints.hpp b/include/boost/geometry/extensions/algorithms/midpoints.hpp new file mode 100644 index 000000000..3e73f3ad9 --- /dev/null +++ b/include/boost/geometry/extensions/algorithms/midpoints.hpp @@ -0,0 +1,136 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_MIDPOINTS_HPP +#define BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_MIDPOINTS_HPP + +// Renamed from "intermediate" to "midpoints" + +#include +#include + +#include +#include + +#include +#include + +/*! +\defgroup midpoints midpoints calculation +The midpoints algorithm calculate points IN BETWEEN of other points +\par Purpose: +- Remove corners in rectangular lines / polygons. Calling them several times will result in smooth lines +- Creating 3D models +*/ + +namespace boost { namespace geometry +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace midpoints { + +template +struct calculate_coordinate +{ + static inline void apply(Src const& p1, Src const& p2, Dst& p) + { + geometry::set(p, + (geometry::get(p1) + geometry::get(p2)) / 2.0); + calculate_coordinate::apply(p1, p2, p); + } +}; + +template +struct calculate_coordinate +{ + static inline void apply(Src const&, Src const&, Dst&) + { + } +}; + +template +struct range_midpoints +{ + static inline void apply(Range const& range, + bool start_and_end, Iterator out) + { + typedef typename point_type::type point_type; + typedef typename boost::range_const_iterator::type iterator_type; + + iterator_type it = boost::begin(range); + + if (start_and_end) + { + *out++ = *it; + } + + iterator_type prev = it++; + for (; it != boost::end(range); prev = it++) + { + point_type p; + calculate_coordinate + < + point_type, + point_type, + 0, + dimension::type::value + >::apply(*prev, *it, p); + *out++ = p; + } + + if (start_and_end) + { + *out++ = *prev; + } + } +}; + +}} // namespace detail::midpoints +#endif // DOXYGEN_NO_DETAIL + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + +template +struct midpoints {}; + +template +struct midpoints + : detail::midpoints::range_midpoints {}; + +template +struct midpoints + : detail::midpoints::range_midpoints {}; + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +/*! + \brief Calculate midpoints of a geometry + \ingroup midpoints + */ +template +inline void midpoints(Geometry const& geometry, + bool start_and_end, Iterator out) +{ + concept::check(); + + dispatch::midpoints + < + typename tag::type, + Geometry, + Iterator + >::apply(geometry, start_and_end, out); +} + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_MIDPOINTS_HPP diff --git a/include/boost/geometry/extensions/algorithms/point_on_line.hpp b/include/boost/geometry/extensions/algorithms/point_on_line.hpp new file mode 100644 index 000000000..9fcec1fb5 --- /dev/null +++ b/include/boost/geometry/extensions/algorithms/point_on_line.hpp @@ -0,0 +1,70 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_ALGORITHMS_POINT_ON_LINE_HPP +#define BOOST_GEOMETRY_ALGORITHMS_POINT_ON_LINE_HPP + + +#include + +namespace boost { namespace geometry +{ + +//---------------------------------------------------------------------- +// Function : point_on_linestring -> rename to alongLine NO, different +//---------------------------------------------------------------------- +// Purpose : Calculates coordinates of a point along a given line +// on a specified distance +// Parameters : const L& : line, +// float position: position to calculate point +// P& point: point to calculate +// Return : true if point lies on line +//---------------------------------------------------------------------- +// Author : Barend, Geodan BV Amsterdam +// Date : spring 1996 +//---------------------------------------------------------------------- +template +bool point_on_linestring(const L& line, const double& position, P& point) +{ + double current_distance = 0.0; + if (line.size() < 2) + { + return false; + } + + typename L::const_iterator vertex = line.begin(); + typename L::const_iterator previous = vertex++; + + while (vertex != line.end()) + { + double const dist = distance(*previous, *vertex); + current_distance += dist; + + if (current_distance > position) + { + // It is not possible that dist == 0 here because otherwise + // the current_distance > position would not become true (current_distance is increased by dist) + double const fraction = 1.0 - ((current_distance - position) / dist); + + // point i is too far, point i-1 to near, add fraction of + // distance in each direction + point.x ( previous->x() + (vertex->x() - previous->x()) * fraction); + point.y ( previous->y() + (vertex->y() - previous->y()) * fraction); + + return true; + } + previous = vertex++; + } + + // point at specified position does not lie on line + return false; +} + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_ALGORITHMS_POINT_ON_LINE_HPP diff --git a/include/boost/geometry/extensions/algorithms/remove_holes_if.hpp b/include/boost/geometry/extensions/algorithms/remove_holes_if.hpp new file mode 100644 index 000000000..8436eb299 --- /dev/null +++ b/include/boost/geometry/extensions/algorithms/remove_holes_if.hpp @@ -0,0 +1,149 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_ALGORITHM_REMOVE_HOLES_IF_HPP +#define BOOST_GEOMETRY_ALGORITHM_REMOVE_HOLES_IF_HPP + +#include + +#include +#include + +#include + +#include + +#include +#include + + +namespace boost { namespace geometry +{ + + + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace remove_holes_if { + + +template +struct polygon_remove_holes_if +{ + static inline void apply(Polygon& poly, Predicate const& predicate) + { + typename interior_type::type& rings = interior_rings(poly); + + // Remove rings using erase-remove-idiom + // http://en.wikipedia.org/wiki/Erase-remove_idiom + rings.erase( + std::remove_if(boost::begin(rings), boost::end(rings), predicate), + boost::end(rings)); + } +}; + +}} // namespace detail::remove_holes_if + + +#endif // DOXYGEN_NO_DETAIL + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch { + +// Default implementation does nothing +template +struct remove_holes_if +{}; + + + +template +struct remove_holes_if + : detail::remove_holes_if::polygon_remove_holes_if +{}; + + +template +struct remove_holes_if + : detail::multi_modify_with_predicate + < + MultiPolygon, + Predicate, + detail::remove_holes_if::polygon_remove_holes_if + < + typename boost::range_value::type, Predicate + > + > +{}; + + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + +/*! + \brief Remove holes from a geometry (polygon, multi-polygon) using a specified condition + */ +template +inline void remove_holes_if(Geometry& geometry, Predicate const& predicate) +{ + concept::check(); + + dispatch::remove_holes_if + < + typename tag::type, + Geometry, + Predicate + >::apply(geometry, predicate); +} + + + + + + + +// CONVENIENT PREDICATES might be moved elsewhere +template +struct elongated_hole +{ + inline elongated_hole(double ratio) + : m_ratio(ratio) + {} + + inline bool operator()(Ring const& ring) const + { + if (ring.size() >= 4) + { + double a = area(ring); + double p = perimeter(ring); + return std::abs(a/p) < m_ratio; + } + // Rings with less then 4 points (including closing) + // are also considered as small and thus removed + return true; + } +private : + double m_ratio; +}; + + +template +struct invalid_hole +{ + inline bool operator()(Ring const& ring) const + { + return ring.size() < 4; + } +}; + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_ALGORITHM_REMOVE_HOLES_IF_HPP diff --git a/include/boost/geometry/extensions/algorithms/selected.hpp b/include/boost/geometry/extensions/algorithms/selected.hpp new file mode 100644 index 000000000..9fd74638b --- /dev/null +++ b/include/boost/geometry/extensions/algorithms/selected.hpp @@ -0,0 +1,287 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_ALGORITHMS_SELECTED_HPP +#define BOOST_GEOMETRY_ALGORITHMS_SELECTED_HPP + +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +/*! +\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 boost { namespace geometry +{ + +/*! + \ingroup impl + */ +#ifndef DOXYGEN_NO_DETAIL +namespace detail { 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 +struct differences_loop +{ + static inline bool apply(P1 const& p1, P2 const& p2, T const& distance, T& sum) + { + typedef typename select_coordinate_type::type coordinate_type; + + coordinate_type const c1 = boost::numeric_cast(get(p1)); + coordinate_type const c2 = boost::numeric_cast(get(p2)); + + T const d = std::abs(c1 - c2); + if (d > distance) + { + return false; + } + sum += d * d; + return differences_loop::apply(p1, p2, distance, sum); + } +}; + +template +struct differences_loop +{ + static inline bool apply(P1 const&, P2 const&, T const&, T&) + { + return true; + } +}; + + + +template +struct outside_loop +{ + static inline bool apply(PS const& seg1, PS const& seg2, P const& point, T const& distance) + { + typedef typename select_coordinate_type::type coordinate_type; + + coordinate_type const v = boost::numeric_cast(get(point)); + coordinate_type const s1 = get(seg1); + coordinate_type const s2 = get(seg2); + + // 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::apply(seg1, seg2, point, distance); + } +}; + +template +struct outside_loop +{ + static inline bool apply(PS const&, PS const&, P const&, T const&) + { + return false; + } +}; + + +template +struct close_to_point +{ + static inline bool apply(P1 const& point, P1 const& selection_point, T const& search_radius) + { + assert_dimension_equal(); + + T sum = 0; + if (differences_loop + < + P1, P2, T, 0, dimension::type::value + >::apply(point, selection_point, search_radius, sum)) + { + return sum <= search_radius * search_radius; + } + + return false; + } +}; + +template +struct close_to_segment +{ + static inline bool apply(PS const& seg1, PS const& seg2, P const& selection_point, T const& search_radius) + { + assert_dimension_equal(); + + if (! outside_loop + < + PS, P, T, 0, dimension

::type::value + >::apply(seg1, seg2, selection_point, search_radius)) + { + // Not outside, calculate dot product/square distance to segment. + // Call corresponding strategy + typedef typename strategy_distance_segment + < + typename cs_tag

::type, + typename cs_tag::type, + P, + PS + >::type strategy_type; + typedef typename strategy_type::return_type return_type; + + strategy_type strategy; + return_type result = strategy.apply(selection_point, seg1, seg2); + return result < search_radius; + } + + return false; + } +}; + +template +struct close_to_range +{ + static inline bool apply(R const& range, P const& selection_point, T const& search_radius) + { + assert_dimension_equal(); + + std::size_t const n = boost::size(range); + if (n == 0) + { + // Line with zero points, never close + return false; + } + + typedef typename point_type::type point_type; + typedef typename boost::range_const_iterator::type iterator_type; + + iterator_type it = boost::begin(range); + if (n == 1) + { + // Line with one point ==> close to point + return close_to_point::apply(*it, selection_point, search_radius); + } + + iterator_type previous = it++; + while(it != boost::end(range)) + { + //typedef segment segment_type; + //segment_type s(*previous, *it); + if (close_to_segment + < + point_type, P, T + >::apply(*previous, *it, selection_point, search_radius)) + { + return true; + } + previous = it++; + } + + return false; + } +}; + +template +struct use_within +{ + static inline bool apply(G const& geometry, P const& selection_point, T const& search_radius) + { + return geometry::within(selection_point, geometry); + } +}; + +}} // namespace detail::selected +#endif // DOXYGEN_NO_DETAIL + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + +/*! + \tparam TD topological dimension + */ +template +struct selected +{ +}; + +template +struct selected : detail::selected::close_to_point { }; + +// SEGMENT, TODO HERE (close_to_segment) + +template +struct selected : detail::selected::close_to_range { }; + +template +struct selected : detail::selected::use_within { }; + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +/*! + \brief Checks if one geometry is selected by a point lying within or in the neighborhood of that geometry + \ingroup selected + \tparam Geometry type of geometry to check + \tparam Point 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 +inline bool selected(Geometry const& geometry, + Point const& selection_point, + RadiusType const& search_radius) +{ + concept::check(); + concept::check(); + + typedef dispatch::selected + < + typename tag::type, + Geometry, + topological_dimension::value, + Point, + RadiusType + > selector_type; + + return selector_type::apply(geometry, selection_point, search_radius); +} + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_ALGORITHMS_SELECTED_HPP diff --git a/include/boost/geometry/extensions/astronomy/core/cs.hpp b/include/boost/geometry/extensions/astronomy/core/cs.hpp new file mode 100644 index 000000000..226a1a678 --- /dev/null +++ b/include/boost/geometry/extensions/astronomy/core/cs.hpp @@ -0,0 +1,48 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSION_ASTRONOMY_CORE_CS_HPP +#define BOOST_GEOMETRY_EXTENSION_ASTRONOMY_CORE_CS_HPP + +#include +#include + + +namespace boost { namespace geometry +{ + + +namespace cs +{ + + +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 +struct ecliptic +{ + typedef DegreeOrRadian units; +}; + + +} // namespace celestial + +} // namespace cs + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSION_ASTRONOMY_CORE_CS_HPP diff --git a/include/boost/geometry/extensions/gis/geographic/core/cs.hpp b/include/boost/geometry/extensions/gis/geographic/core/cs.hpp new file mode 100644 index 000000000..96a51b3e3 --- /dev/null +++ b/include/boost/geometry/extensions/gis/geographic/core/cs.hpp @@ -0,0 +1,82 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_GIS_GEOGRAPHIC_CORE_CS_HPP +#define BOOST_GEOMETRY_EXTENSIONS_GIS_GEOGRAPHIC_CORE_CS_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 boost { namespace geometry +{ + +namespace cs +{ + +/*! + \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 Code the EPSG code + \todo Maybe derive from boost::mpl::int_ +*/ +template +struct epsg +{ + static const std::size_t epsg_code = Code; +}; + + + +/*! + \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 +{ +}; + + +} // namespace cs + +namespace traits +{ + +#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS + +template<> +struct cs_tag +{ + typedef cartesian_tag type; +}; + +template +struct cs_tag > +{ + typedef cartesian_tag type; +}; + +#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS +} // namespace traits + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_GIS_GEOGRAPHIC_CORE_CS_HPP diff --git a/include/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp b/include/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp new file mode 100644 index 000000000..e020c6e47 --- /dev/null +++ b/include/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp @@ -0,0 +1,284 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2009, Geodan, 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 BOOST_GEOMETRY_IO_VESHAPE_WRITE_VESHAPE_HPP +#define BOOST_GEOMETRY_IO_VESHAPE_WRITE_VESHAPE_HPP + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include + + +/*! +\defgroup veshape veshape: stream VEShape (Virtual Earth shapes for in VE Ajax Control) +\note VE assumes points in LatLong, Lat first +*/ + +namespace boost { namespace geometry +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace veshape { + + +// Define the coordinate streamer, specialized for either 2 or 3 dimensions. +// Any other number of dimensions make no sense for VE, and we have to take care about +// the order lat,long (--> y,x) +template +struct stream_coordinate {}; + + +template +struct stream_coordinate +{ + template + static inline void stream(std::basic_ostream& os, P const& p) + { + os << geometry::get<1>(p) << "," << geometry::get<0>(p); + } +}; + +template +struct stream_coordinate +{ + template + static inline void stream(std::basic_ostream& os, P const& p) + { + stream_coordinate::stream(os, p); + os << "," << geometry::get<2>(p); + } +}; + + +template +struct stream_point +{ + template + static inline void stream(std::basic_ostream& os, P const& p) + { + os << "new VELatLong("; + stream_coordinate::value>::stream(os, p); + os << ")"; + } +}; + + + +struct prefix_point +{ + static inline const char* prefix() + { return "new VEShape(VEShapeType.Pushpin, "; } + + static inline const char* postfix() + { return ")"; } +}; + +struct prefix_linestring +{ + static inline const char* prefix() + { return "new VEShape(VEShapeType.Polyline, "; } + + static inline const char* postfix() + { return ")"; } +}; + + +struct prefix_polygon +{ + static inline const char* prefix() + { return "new VEShape(VEShapeType.Polygon, "; } + + static inline const char* postfix() + { return ")"; } +}; + +/*! +\brief Stream points as \ref VEShape +*/ +template +struct veshape_point +{ + template + static inline void stream(std::basic_ostream& os, P const& p) + { + os << Policy::prefix(); + stream_point

::stream(os, p); + os << Policy::postfix(); + } + + private: + BOOST_CONCEPT_ASSERT( (concept::ConstPoint

) ); +}; + +/*! +\brief Stream ranges as VEShape +\note policy is used to stream prefix/postfix, enabling derived classes to override this +*/ +template +struct veshape_range +{ + template + static inline void stream(std::basic_ostream& os, R const& range) + { + typedef typename boost::range_const_iterator::type iterator; + + bool first = true; + + os << Policy::prefix() << "new Array("; + + for (iterator it = boost::begin(range); it != boost::end(range); ++it) + { + os << (first ? "" : ", "); + stream_point::stream(os, *it); + first = false; + } + + os << ")" << Policy::postfix(); + } + + private: + typedef typename boost::range_value::type point; + BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); +}; + + + +template +struct veshape_poly +{ + template + static inline void stream(std::basic_ostream& os, P const& poly) + { + typedef typename ring_type

::type ring; + typedef typename boost::range_const_iterator< + typename interior_type

::type>::type iterator; + + veshape_range::stream(os, exterior_ring(poly)); + + // For VE shapes: inner rings are not supported or undocumented + /*** + for (iterator it = boost::begin(interior_rings(poly)); + it != boost::end(interior_rings(poly)); it++) + { + os << ","; + veshape_range::stream(os, *it); + } + os << ")"; + ***/ + } + + private: + BOOST_CONCEPT_ASSERT( (concept::ConstPoint::type>) ); +}; + + + +}} // namespace detail::veshape +#endif // DOXYGEN_NO_DETAIL + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch { + +/*! +\brief Dispatching base struct for VEShape streaming, specialized below per geometry type +\details Specializations should implement a static method "stream" to stream a geometry +The static method should have the signature: + +template +static inline void stream(std::basic_ostream& os, G const& geometry) +*/ +template +struct veshape +{}; + + +template +struct veshape + : detail::veshape::veshape_point +{}; + + +template +struct veshape + : detail::veshape::veshape_range +{}; + + +template +struct veshape + : detail::veshape::veshape_range +{}; + + +template +struct veshape + : detail::veshape::veshape_poly +{}; + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +/*! +\brief Generic geometry template manipulator class, takes corresponding output class from traits class +\ingroup veshape +\details Stream manipulator, streams geometry classes as Virtual Earth shape +*/ +template +class veshape_manip +{ +public: + + inline veshape_manip(G const& g) + : m_geometry(g) + {} + + template + inline friend std::basic_ostream& operator<<( + std::basic_ostream& os, veshape_manip const& m) + { + dispatch::veshape::type, G>::stream(os, m.m_geometry); + os.flush(); + return os; + } + +private: + G const& m_geometry; +}; + +/*! +\brief Object generator to conveniently stream objects without including streamveshape +\ingroup veshape +\par Example: +Small example showing how to use the make_veshape helper function +\dontinclude doxygen_1.cpp +\skip example_as_veshape_vector +\line { +\until } +*/ +template +inline veshape_manip veshape(T const& t) +{ + return veshape_manip(t); +} + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_IO_VESHAPE_WRITE_VESHAPE_HPP diff --git a/include/boost/geometry/extensions/gis/latlong/detail/graticule.hpp b/include/boost/geometry/extensions/gis/latlong/detail/graticule.hpp new file mode 100644 index 000000000..7ef1825e9 --- /dev/null +++ b/include/boost/geometry/extensions/gis/latlong/detail/graticule.hpp @@ -0,0 +1,231 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_GIS_LATLONG_DETAIL_GRATICULE_HPP +#define BOOST_GEOMETRY_EXTENSIONS_GIS_LATLONG_DETAIL_GRATICULE_HPP + +#include +#include +#include + +#include + +namespace boost { 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 CardinalDir 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_1.cpp + \skip example_dms + \line { + \until } +*/ +template +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 = ((CardinalDir == west || CardinalDir == south) ? -1.0 : 1.0) + * (double(d) + (m / 60.0) + (s / 3600.0)); + + m_value = boost::numeric_cast(v); + } + + // Prohibit automatic conversion to T + // because this would enable lon(dms) + // 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 implement template/specializations here + // Todo: if it is "west" and "positive", make east? or keep minus sign then? + + cardinal = ((CardinalDir == cd_lat && positive) ? 'N' + : (CardinalDir == cd_lat && !positive) ? 'S' + : (CardinalDir == cd_lon && positive) ? 'E' + : (CardinalDir == cd_lon && !positive) ? 'W' + : (CardinalDir == east) ? 'E' + : (CardinalDir == west) ? 'W' + : (CardinalDir == north) ? 'N' + : (CardinalDir == south) ? 'S' + : ' '); + + value = std::fabs(value); + + // Calculate the values + double fraction = 0; + double integer = 0; + fraction = std::modf(value, &integer); + d = int(integer); + s = 60.0 * std::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 = 0; + int d = 0; + int m = 0; + bool positive = false; + char cardinal = 0; + 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_DETAIL +namespace detail +{ +/*! + \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 "This latitude/longitude "webbing" is known as the common + graticule" (http://en.wikipedia.org/wiki/Geographic_coordinate_system) + \tparam S latitude/longitude + \tparam T coordinate type, double float or int +*/ +template +class graticule +{ +public: + + // TODO: Pass 'v' by const-ref + inline explicit graticule(T v) : m_v(v) {} + inline operator T() const { return m_v; } + +private: + + T m_v; +}; + +} // namespace detail +#endif // DOXYGEN_NO_DETAIL + +/*! + \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 +class latitude : public detail::graticule +{ +public: + + /// Can be constructed with a value + inline explicit latitude(T v) + : detail::graticule(v) + {} + + /// Can be constructed with a NORTH dms-class + inline explicit latitude(const dms& v) + : detail::graticule(v.as_value()) + {} + + /// Can be constructed with a SOUTH dms-class + inline explicit latitude(const dms& v) + : detail::graticule(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 +class longitude : public detail::graticule +{ +public: + + /// Can be constructed with a value + inline explicit longitude(T v) + : detail::graticule(v) + {} + + /// Can be constructed with a WEST dms-class + inline explicit longitude(const dms& v) + : detail::graticule(v.as_value()) + {} + + /// Can be constructed with an EAST dms-class + inline explicit longitude(const dms& v) + : detail::graticule(v.as_value()) + {} +}; + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_GIS_LATLONG_DETAIL_GRATICULE_HPP diff --git a/include/boost/geometry/extensions/gis/latlong/latlong.hpp b/include/boost/geometry/extensions/gis/latlong/latlong.hpp new file mode 100644 index 000000000..1e1f384df --- /dev/null +++ b/include/boost/geometry/extensions/gis/latlong/latlong.hpp @@ -0,0 +1,41 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_LATLONG_HPP +#define BOOST_GEOMETRY_LATLONG_HPP + +// Predeclare common Cartesian 3D points for convenience + +#include +#include + + +#include +#include + +namespace boost { namespace geometry +{ + +typedef point_ll > point_ll_deg; +typedef linestring linestring_ll_deg; +typedef linear_ring ring_ll_deg; +typedef polygon polygon_ll_deg; +typedef box box_ll_deg; +typedef segment segment_ll_deg; + +typedef point_ll > point_ll_rad; +typedef linestring linestring_ll_rad; +typedef linear_ring ring_ll_rad; +typedef polygon polygon_ll_rad; +typedef box box_ll_rad; +typedef segment segment_ll_rad; + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_LATLONG_HPP diff --git a/include/boost/geometry/extensions/gis/latlong/point_ll.hpp b/include/boost/geometry/extensions/gis/latlong/point_ll.hpp new file mode 100644 index 000000000..9f4974a8c --- /dev/null +++ b/include/boost/geometry/extensions/gis/latlong/point_ll.hpp @@ -0,0 +1,192 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_GEOMETRIES_POINT_LL_HPP +#define BOOST_GEOMETRY_GEOMETRIES_POINT_LL_HPP + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +namespace boost { 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 T coordinate type, double (the default) or float + (it might be int as well) + \tparam C coordinate system, optional, should includes degree/radian + indication, defaults to geographic + \tparam D dimensions, optional, defaults to 2 + \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_1.cpp + \skip example_point_ll_construct + \line { + \until } +*/ +template +< + typename T = double, + typename C = cs::geographic, + std::size_t D = 2 +> +class point_ll : public point +{ +public: + + /// Default constructor, does not initialize anything + inline point_ll() : point() {} + + /// Constructor with longitude/latitude + inline point_ll(longitude const& lo, latitude const& la) + : point(lo, la) {} + + /// Constructor with latitude/longitude + inline point_ll(latitude const& la, longitude const& lo) + : point(lo, la) {} + + /// Get longitude + inline T const& lon() const { return this->template get<0>(); } + /// Get latitude + inline T const& lat() const { return this->template get<1>(); } + + /// Set longitude + inline void lon(T const& v) { this->template set<0>(v); } + /// Set latitude + inline void lat(T const& v) { this->template set<1>(v); } + + /// Set longitude using dms class + inline void lon(dms const& v) + { + this->template set<0>(v.as_value()); + } + inline void lon(dms const& v) + { + this->template set<0>(v.as_value()); + } + + inline void lat(dms const& v) + { + this->template set<1>(v.as_value()); + } + inline void lat(dms const& v) + { + this->template set<1>(v.as_value()); + } +}; + +// Adapt the point_ll to the concept +#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS +namespace traits +{ + +template +< + typename CoordinateType, + typename CoordinateSystem, + std::size_t DimensionCount +> +struct tag > +{ + typedef point_tag type; +}; + +template +< + typename CoordinateType, + typename CoordinateSystem, + std::size_t DimensionCount +> +struct coordinate_type + < + point_ll + > +{ + typedef CoordinateType type; +}; + +template +< + typename CoordinateType, + typename CoordinateSystem, + std::size_t DimensionCount +> +struct coordinate_system + < + point_ll + > +{ + typedef CoordinateSystem type; +}; + +template +< + typename CoordinateType, + typename CoordinateSystem, + std::size_t DimensionCount +> +struct dimension + < + point_ll + > + : boost::mpl::int_ +{}; + +template +< + typename CoordinateType, + typename CoordinateSystem, + std::size_t DimensionCount, + std::size_t Dimension +> +struct access + < + point_ll, Dimension + > +{ + static inline CoordinateType get( + point_ll const& p) + { + return p.template get(); + } + + static inline void set( + point_ll& p, + CoordinateType const& value) + { + p.template set(value); + } +}; + +} // namespace traits +#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_GEOMETRIES_POINT_LL_HPP diff --git a/include/boost/geometry/extensions/gis/projections/epsg.hpp b/include/boost/geometry/extensions/gis/projections/epsg.hpp new file mode 100644 index 000000000..c77e9fb66 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/epsg.hpp @@ -0,0 +1,3566 @@ +#ifndef _PROJECTIONS_EPGS_HPP +#define _PROJECTIONS_EPGS_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 +#include + +// This file is OPTIONAL +// Only to be included if EPSG codes are necessary. +// It is not included automatically + +namespace boost { namespace geometry { namespace projection +{ +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ + + inline 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_DETAIL + +// Overloaded function +inline parameters init(int epsg_code) +{ + std::string args = detail::code_to_string(epsg_code); + return detail::pj_init_plus(args, false); +} + +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/epsg_traits.hpp b/include/boost/geometry/extensions/gis/projections/epsg_traits.hpp new file mode 100644 index 000000000..42b5ec80b --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/epsg_traits.hpp @@ -0,0 +1,40 @@ +#ifndef _PROJECTIONS_EPSG_TRAITS_HPP +#define _PROJECTIONS_EPSG_TRAITS_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 + + +namespace boost { namespace geometry { 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 +struct epsg_traits +{ + // Specializations define: + // - type to get projection type + // - function par to get parameters +}; + +}}} // namespace boost::geometry::projection + +#endif + diff --git a/include/boost/geometry/extensions/gis/projections/factory.hpp b/include/boost/geometry/extensions/gis/projections/factory.hpp new file mode 100644 index 000000000..9a3bb3cda --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/factory.hpp @@ -0,0 +1,242 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_PROJECTIONS_FACTORY_HPP +#define BOOST_GEOMETRY_PROJECTIONS_FACTORY_HPP + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // control points XY +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // includes two other projections +#include +#include +#include +#include +#include // xy functions after inverse +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // includes other projection +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + +template +class factory : public detail::base_factory +{ +private: + + typedef std::map > > prj_registry; + prj_registry m_registry; + +public: + + factory() + { + detail::aea_init(*this); + detail::aeqd_init(*this); + detail::airy_init(*this); + detail::aitoff_init(*this); + detail::august_init(*this); + detail::bacon_init(*this); + detail::bipc_init(*this); + detail::boggs_init(*this); + detail::bonne_init(*this); + detail::cass_init(*this); + detail::cc_init(*this); + detail::cea_init(*this); + detail::chamb_init(*this); + detail::collg_init(*this); + detail::crast_init(*this); + detail::denoy_init(*this); + detail::eck1_init(*this); + detail::eck2_init(*this); + detail::eck3_init(*this); + detail::eck4_init(*this); + detail::eck5_init(*this); + detail::eqc_init(*this); + detail::eqdc_init(*this); + detail::fahey_init(*this); + detail::fouc_s_init(*this); + detail::gall_init(*this); + detail::geocent_init(*this); + detail::geos_init(*this); + detail::gins8_init(*this); + detail::gn_sinu_init(*this); + detail::gnom_init(*this); + detail::goode_init(*this); + detail::gstmerc_init(*this); + detail::hammer_init(*this); + detail::hatano_init(*this); + detail::krovak_init(*this); + detail::imw_p_init(*this); + detail::labrd_init(*this); + detail::laea_init(*this); + detail::lagrng_init(*this); + detail::larr_init(*this); + detail::lask_init(*this); + detail::latlong_init(*this); + detail::lcc_init(*this); + detail::lcca_init(*this); + detail::loxim_init(*this); + detail::lsat_init(*this); + detail::mbtfpp_init(*this); + detail::mbtfpq_init(*this); + detail::mbt_fps_init(*this); + detail::merc_init(*this); + detail::mill_init(*this); + detail::mod_ster_init(*this); + detail::moll_init(*this); + detail::nell_init(*this); + detail::nell_h_init(*this); + detail::nocol_init(*this); + detail::nsper_init(*this); + detail::nzmg_init(*this); + detail::ob_tran_init(*this); + detail::ocea_init(*this); + detail::oea_init(*this); + detail::omerc_init(*this); + detail::ortho_init(*this); + detail::poly_init(*this); + detail::putp2_init(*this); + detail::putp3_init(*this); + detail::putp4p_init(*this); + detail::putp5_init(*this); + detail::putp6_init(*this); + detail::robin_init(*this); + detail::rouss_init(*this); + detail::rpoly_init(*this); + detail::sconics_init(*this); + detail::somerc_init(*this); + detail::stere_init(*this); + detail::sterea_init(*this); + detail::sts_init(*this); + detail::tcc_init(*this); + detail::tcea_init(*this); + detail::tmerc_init(*this); + detail::tpeqd_init(*this); + detail::urm5_init(*this); + detail::urmfps_init(*this); + detail::vandg_init(*this); + detail::vandg2_init(*this); + detail::vandg4_init(*this); + detail::wag2_init(*this); + detail::wag3_init(*this); + detail::wag7_init(*this); + detail::wink1_init(*this); + detail::wink2_init(*this); + } + + virtual ~factory() {} + + virtual void add_to_factory(const std::string& name, detail::factory_entry* sub) + { + m_registry[name].reset(sub); + } + + inline projection* create_new(const Parameters& parameters) + { + typename prj_registry::iterator it = m_registry.find(parameters.name); + if (it != m_registry.end()) + { + return it->second->create_new(parameters); + } + + return 0; + } +}; + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_FACTORY_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/aasincos.hpp b/include/boost/geometry/extensions/gis/projections/impl/aasincos.hpp new file mode 100644 index 000000000..81426d985 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/aasincos.hpp @@ -0,0 +1,96 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_AASINCOS_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_AASINCOS_HPP + +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +namespace aasincos +{ + static const double ONE_TOL= 1.00000000000001; + //static const double TOL = 0.000000001; + static const double ATOL = 1e-50; +} + +inline double aasin(double v) +{ + double av = 0; + + if ((av = std::fabs(v)) >= 1.0) + { + if (av > aasincos::ONE_TOL) + { + throw proj_exception(-19); + } + return (v < 0.0 ? -HALFPI : HALFPI); + } + + return std::asin(v); +} + +inline double aacos(double v) +{ + double av = 0; + + if ((av = std::fabs(v)) >= 1.0) + { + if (av > aasincos::ONE_TOL) + { + throw proj_exception(-19); + } + return (v < 0.0 ? PI : 0.0); + } + + return acos(v); +} + +inline double asqrt(double v) +{ + return ((v <= 0) ? 0. : std::sqrt(v)); +} + +inline double aatan2(double n, double d) +{ + return ((std::fabs(n) < aasincos::ATOL && std::fabs(d) < aasincos::ATOL) ? 0.0 : std::atan2(n, d)); +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_AASINCOS_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/adjlon.hpp b/include/boost/geometry/extensions/gis/projections/impl/adjlon.hpp new file mode 100644 index 000000000..8e6fc6c88 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/adjlon.hpp @@ -0,0 +1,68 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_ADJLON_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_ADJLON_HPP + +#include + +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +/* 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 (std::fabs(lon) <= SPI) + { + return lon; + } + + lon += ONEPI; /* adjust to 0..2pi rad */ + lon -= TWOPI * std::floor(lon / TWOPI); /* remove integral # of 'revolutions'*/ + lon -= ONEPI; /* adjust back to -pi..pi rad */ + + return lon; +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_ADJLON_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/base_dynamic.hpp b/include/boost/geometry/extensions/gis/projections/impl/base_dynamic.hpp new file mode 100644 index 000000000..dd74deabd --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/base_dynamic.hpp @@ -0,0 +1,105 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_PROJECTIONS_IMPL_BASE_DYNAMIC_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_BASE_DYNAMIC_HPP + +#include + +#include + +#include + +namespace boost { namespace geometry { namespace projection { + +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ + +// Base-virtual-forward +template +class base_v_f : public projection +{ +protected: + + typedef typename projection::LL_T LL_T; + typedef typename projection::XY_T XY_T; + +public: + + base_v_f(const P& params) : m_proj(params) {} + + virtual P params() const {return m_proj.params();} + + 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 + { + boost::ignore_unused_variable_warning(xy); + boost::ignore_unused_variable_warning(ll); + + // exception? + return false; + } + virtual void inv(XY_T& xy_x, XY_T& xy_y, LL_T& lp_lon, LL_T& lp_lat) const + { + boost::ignore_unused_variable_warning(xy_x); + boost::ignore_unused_variable_warning(xy_y); + boost::ignore_unused_variable_warning(lp_lon); + boost::ignore_unused_variable_warning(lp_lat); + // exception? + } + + virtual std::string name() const + { + return m_proj.name(); + } + +protected: + + C m_proj; +}; + +// Base-virtual-forward/inverse +template +class base_v_fi : public base_v_f +{ +private: + + typedef typename base_v_f::LL_T LL_T; + typedef typename base_v_f::XY_T XY_T; + +public : + + base_v_fi(const P& params) : base_v_f(params) {} + + 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); + } +}; + +} // namespace detail +#endif // DOXYGEN_NO_DETAIL + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_BASE_DYNAMIC_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/base_static.hpp b/include/boost/geometry/extensions/gis/projections/impl/base_static.hpp new file mode 100644 index 000000000..a940b222f --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/base_static.hpp @@ -0,0 +1,108 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_PROJECTIONS_IMPL_BASE_STATIC_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_BASE_STATIC_HPP + +#if defined(_MSC_VER) +// For CRTP, *this is acceptable in constructor -> turn warning off +#pragma warning( disable : 4355 ) +#endif // defined(_MSC_VER) + + +#include + +#include +#include + +namespace boost { namespace geometry { namespace projection { + + + + + + + + +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ + +// Base-template-forward +template +struct base_t_f +{ +public: + + inline base_t_f(const Prj& prj, const P& params) + : m_par(params), m_prj(prj) + {} + + inline P params() const {return m_par;} + + 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; + } + +protected: + + // Some projections do not work with float -> wrong results + // TODO: make traits which select from int/float/double and else selects T + + //typedef typename geometry::coordinate_type::type LL_T; + //typedef typename geometry::coordinate_type::type XY_T; + typedef double LL_T; + typedef double XY_T; + + P m_par; + const Prj& m_prj; +}; + +// Base-template-forward/inverse +template +struct base_t_fi : public base_t_f +{ +public : + inline base_t_fi(const Prj& prj, const P& params) + : base_t_f(prj, params) + {} + + 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; + } + } +}; + +} // namespace detail +#endif // DOXYGEN_NO_DETAIL + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_BASE_STATIC_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/factory_entry.hpp b/include/boost/geometry/extensions/gis/projections/impl/factory_entry.hpp new file mode 100644 index 000000000..bb6c60507 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/factory_entry.hpp @@ -0,0 +1,41 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_PROJECTIONS_IMPL_FACTORY_ENTRY_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_FACTORY_ENTRY_HPP + +#include + +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +template +class factory_entry +{ +public: + + virtual ~factory_entry() {} + virtual projection* create_new(const P& par) const = 0; +}; + +template +class base_factory +{ +public: + + virtual ~base_factory() {} + virtual void add_to_factory(const std::string& name, factory_entry* sub) = 0; +}; + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_FACTORY_ENTRY_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/function_overloads.hpp b/include/boost/geometry/extensions/gis/projections/impl/function_overloads.hpp new file mode 100644 index 000000000..760b11456 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/function_overloads.hpp @@ -0,0 +1,34 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_PROJECTIONS_IMPL_FUNCTION_OVERLOADS_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_FUNCTION_OVERLOADS_HPP + +#include + +namespace boost { namespace geometry { namespace projection { + +// Functions to resolve ambiguity when compiling with coordinates of different types +/*inline double atan2(double a, double b) +{ + return std::atan2(a, b); +} +inline double pow(double a, double b) +{ + return std::pow(a, b); +} +*/ + +inline int int_floor(double f) +{ + return int(std::floor(f)); +} + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_FUNCTION_OVERLOADS_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_auth.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_auth.hpp new file mode 100644 index 000000000..b20bfff03 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_auth.hpp @@ -0,0 +1,85 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_AUTH_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_AUTH_HPP + +#include +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +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) +{ + assert(0 != APA); + + double t = 0; + + // 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) +{ + assert(0 != APA); + + const double t = beta + beta; + + return(beta + APA[0] * std::sin(t) + APA[1] * std::sin(t + t) + APA[2] * std::sin(t + t + t)); +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_AUTH_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_datum_set.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_datum_set.hpp new file mode 100644 index 000000000..34eb5d5a3 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_datum_set.hpp @@ -0,0 +1,167 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_DATUM_SET_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_DATUM_SET_HPP + +#include +#include + +#include + +#include +#include +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + + +/* SEC_TO_RAD = Pi/180/3600 */ +const double SEC_TO_RAD = 4.84813681109535993589914102357e-6; + +/************************************************************************/ +/* pj_datum_set() */ +/************************************************************************/ + +inline void pj_datum_set(std::vector& 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 parm; + boost::split(parm, towgs84, boost::is_any_of(" ,")); + for (std::vector::const_iterator it = parm.begin(); + it != parm.end() && parm_count < n; + ++it) + { + 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 */ + } +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_DATUM_SET_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_datums.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_datums.hpp new file mode 100644 index 000000000..a767f946f --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_datums.hpp @@ -0,0 +1,106 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_DATUMS_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_DATUMS_HPP + +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +/* + * 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. + */ + +static const 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" } +}; + + +static const 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" } +}; + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_DATUMS_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_ell_set.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_ell_set.hpp new file mode 100644 index 000000000..0a9f5f907 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_ell_set.hpp @@ -0,0 +1,153 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELL_SET_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELL_SET_HPP + +#include +#include + +#include +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +/* 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 */ + +/* initialize geographic shape parameters */ +inline void pj_ell_set(std::vector& parameters, double &a, double &es) +{ + int i = 0; + double b = 0.0; + double e = 0.0; + 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); } +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELL_SET_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_ellps.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_ellps.hpp new file mode 100644 index 000000000..f96e780b1 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_ellps.hpp @@ -0,0 +1,93 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELLPS_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELLPS_HPP + +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +static const 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)" } +}; + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELLPS_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_fwd.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_fwd.hpp new file mode 100644 index 000000000..de2d6cd59 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_fwd.hpp @@ -0,0 +1,96 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_FWD_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_FWD_HPP + +#include + +#include +#include + +/* general forward projection */ + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +namespace forwrd +{ + static const double EPS = 1.0e-12; +} + +/* forward projection entry */ +template +inline void pj_fwd(const Prj& prj, const P& par, const LL& ll, XY& xy) +{ + using namespace detail; + + double lp_lon = geometry::get_as_radian<0>(ll); + double lp_lat = geometry::get_as_radian<1>(ll); + const double t = std::fabs(lp_lat) - HALFPI; + + /* check for forward and latitude or longitude overange */ + if (t > forwrd::EPS || std::fabs(lp_lon) > 10.) + { + throw proj_exception(); + } + + if (std::fabs(t) <= forwrd::EPS) + { + lp_lat = lp_lat < 0. ? -HALFPI : HALFPI; + } + else if (par.geoc) + { + lp_lat = std::atan(par.rone_es * std::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; + double 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)); +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_FWD_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_gauss.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_gauss.hpp new file mode 100644 index 000000000..b78b36fb8 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_gauss.hpp @@ -0,0 +1,127 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_GAUSS_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_GAUSS_HPP + + +namespace boost { namespace geometry { namespace projection { + +namespace detail { 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 (std::pow((1.0 - esinp) / (1.0 + esinp), exp)); +} + +inline GAUSS gauss_ini(double e, double phi0, double &chi, double &rc) +{ + using std::asin; + using std::cos; + using std::sin; + using std::sqrt; + using std::tan; + + double sphi = 0; + double cphi = 0; + double es = 0; + + GAUSS en; + es = e * e; + en.e = e; + sphi = sin(phi0); + cphi = cos(phi0); + cphi *= cphi; + + rc = sqrt(1.0 - es) / (1.0 - es * sphi * sphi); + en.C = sqrt(1.0 + es * cphi * cphi / (1.0 - es)); + chi = asin(sphi / en.C); + en.ratexp = 0.5 * en.C * e; + en.K = tan(0.5 * chi + detail::FORTPI) + / (pow(tan(0.5 * phi0 + detail::FORTPI), en.C) * srat(en.e * sphi, en.ratexp)); + + return en; +} + +template +inline void gauss(const GAUSS& en, T& lam, T& phi) +{ + phi = 2.0 * std::atan(en.K * std::pow(std::tan(0.5 * phi + FORTPI), en.C) + * srat(en.e * std::sin(phi), en.ratexp) ) - HALFPI; + + lam *= en.C; +} + +template +inline void inv_gauss(const GAUSS& en, T& lam, T& phi) +{ + lam /= en.C; + const double num = std::pow(std::tan(0.5 * phi + FORTPI) / en.K, 1.0 / en.C); + + int i = 0; + for (i = MAX_ITER; i; --i) + { + const double elp_phi = 2.0 * std::atan(num * srat(en.e * std::sin(phi), - 0.5 * en.e)) - HALFPI; + + if (std::fabs(elp_phi - phi) < DEL_TOL) + { + break; + } + phi = elp_phi; + } + + /* convergence failed */ + if (!i) + { + throw proj_exception(-17); + } +} + +}} // namespace detail::gauss +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_GAUSS_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_init.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_init.hpp new file mode 100644 index 000000000..c053f7d1c --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_init.hpp @@ -0,0 +1,294 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_INIT_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_INIT_HPP + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +/************************************************************************/ +/* 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 +parameters pj_init(const R& arguments, bool use_defaults = true) +{ + parameters pin; + for (std::vector::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 + { + //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 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". */ +/************************************************************************/ + +inline 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 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::iterator it = arguments.begin(); it != arguments.end(); it++) + { + boost::trim(*it); + }*/ + return pj_init(arguments, use_defaults); +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_INIT_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_inv.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_inv.hpp new file mode 100644 index 000000000..4098bc892 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_inv.hpp @@ -0,0 +1,76 @@ +#ifndef _PROJECTIONS_PJ_INV_HPP +#define _PROJECTIONS_PJ_INV_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 +#include + +/* general inverse projection */ + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + +namespace inv +{ + static const double EPS = 1.0e-12; +} + + /* inverse projection entry */ +template +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); +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_mlfn.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_mlfn.hpp new file mode 100644 index 000000000..dd952f5e7 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_mlfn.hpp @@ -0,0 +1,106 @@ +#ifndef _PROJECTIONS_PJ_MLFN_HPP +#define _PROJECTIONS_PJ_MLFN_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 boost { namespace geometry { namespace projection { + +namespace detail { + +/* 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; +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_msfn.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_msfn.hpp new file mode 100644 index 000000000..31621d2be --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_msfn.hpp @@ -0,0 +1,53 @@ +#ifndef _PROJECTIONS_PJ_MSFN_HPP +#define _PROJECTIONS_PJ_MSFN_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 boost { namespace geometry { namespace projection { + +namespace detail { + + +/* determine constant small m */ +inline double pj_msfn(double sinphi, double cosphi, double es) +{ + return (cosphi / sqrt (1. - es * sinphi * sinphi)); +} + + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_param.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_param.hpp new file mode 100644 index 000000000..8c5bb87f7 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_param.hpp @@ -0,0 +1,154 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_PJ_PARAM_HPP +#define BOOST_GEOMETRY_PROJECTIONS_PJ_PARAM_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 +#include + +#include + +#include + + +namespace boost { namespace geometry { namespace projection { + +namespace detail { + + + +/* create pvalue list entry */ +inline 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 */ +/* */ +/************************************************************************/ + +inline pvalue pj_param(const std::vector& pl, std::string opt) +{ + char type = opt[0]; + opt.erase(opt.begin()); + + pvalue value; + + /* simple linear lookup */ + for (std::vector::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 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; +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_phi2.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_phi2.hpp new file mode 100644 index 000000000..ff34fe130 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_phi2.hpp @@ -0,0 +1,70 @@ +#ifndef _PROJECTIONS_PHI2_HPP +#define _PROJECTIONS_PHI2_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 boost { namespace geometry { namespace projection { +namespace detail { + +namespace phi2 +{ + static const double TOL = 1.0e-10; + static const int N_ITER = 15; +} + +inline 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; +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_qsfn.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_qsfn.hpp new file mode 100644 index 000000000..469f8dbfb --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_qsfn.hpp @@ -0,0 +1,83 @@ +#ifndef _PROJECTIONS_PJ_QSFN_HPP +#define _PROJECTIONS_PJ_QSFN_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 boost { namespace geometry { namespace projection +{ namespace detail { + +/* 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); +} + + +#define MAX_C 9 +struct AUTHALIC +{ + double C[MAX_C], CP[MAX_C], CQ[MAX_C]; +}; + +/** + * @brief determine authalic latitude + * @param[in] phi geographic latitude + * @param[in] a initialized structure pointer + * @return authalic latitude + */ +inline double proj_qsfn(double phi, const AUTHALIC& a) +{ + double s, s2, sum; + int i = MAX_C; + + s = sin(phi); + s2 = s * s; + sum = a.CQ[MAX_C - 1]; + while (--i) sum = a.CQ[i] + s2 * sum; + return(s * sum); +} + +} // namespace detail +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_tsfn.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_tsfn.hpp new file mode 100644 index 000000000..1003d5f09 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_tsfn.hpp @@ -0,0 +1,53 @@ +#ifndef _PROJECTIONS_PJ_TSFN_HPP +#define _PROJECTIONS_PJ_TSFN_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 + +namespace boost { namespace geometry { namespace projection { +namespace detail { + + /* 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)); + } + +} // namespace detail +}}} // namespace boost::geometry::projection +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_units.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_units.hpp new file mode 100644 index 000000000..47c818e1e --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_units.hpp @@ -0,0 +1,75 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_UNITS_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_UNITS_HPP + +#include + +namespace boost { namespace geometry { namespace projection { +namespace detail { + +/* 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) */ + +static const 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" } +}; + +} // detail +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_UNITS_HPP diff --git a/include/boost/geometry/extensions/gis/projections/impl/pj_zpoly1.hpp b/include/boost/geometry/extensions/gis/projections/impl/pj_zpoly1.hpp new file mode 100644 index 000000000..9deca4e36 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/pj_zpoly1.hpp @@ -0,0 +1,100 @@ +#ifndef _PROJECTIONS_ZPOLY1_HPP +#define _PROJECTIONS_ZPOLY1_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 + + +namespace boost { namespace geometry { namespace projection { namespace detail { + + /* 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 + */ + inline 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 */ + inline COMPLEX + pj_zpolyd1(COMPLEX z, COMPLEX *C, int n, COMPLEX *der) + { + double t; + bool first = true; + + COMPLEX a = *(C += n); + COMPLEX b = a; + while (n-- > 0) + { + if (first) + { + first = false; + } + 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; + } + +}}}} // namespace boost::geometry::projection::impl + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/proj_mdist.hpp b/include/boost/geometry/extensions/gis/projections/impl/proj_mdist.hpp new file mode 100644 index 000000000..371150c3c --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/proj_mdist.hpp @@ -0,0 +1,133 @@ +#ifndef _PROJECTIONS_PROJ_MDIST_HPP +#define _PROJECTIONS_PROJ_MDIST_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 + +// Copyright Barend Gehrels 2007-2009, Geodan, 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 boost { namespace geometry { namespace projection +{ +namespace detail +{ + static const int MDIST_MAX_ITER = 20; + + struct MDIST + { + int nb; + double es; + double E; + double b[MDIST_MAX_ITER]; + }; + + inline 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); + } +} // namespace detail + +}}} // namespace boost::geometry::projection + +#endif diff --git a/include/boost/geometry/extensions/gis/projections/impl/projects.hpp b/include/boost/geometry/extensions/gis/projections/impl/projects.hpp new file mode 100644 index 000000000..724cf829d --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/impl/projects.hpp @@ -0,0 +1,184 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) - projections (based on PROJ4) +// This file is manually converted from PROJ4 (projects.h) + +// Copyright Barend Gehrels 2007-2009, Geodan, 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. + +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PROJECTS_HPP +#define BOOST_GEOMETRY_PROJECTIONS_IMPL_PROJECTS_HPP + +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ + +/* 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() + { + std::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 */ +}; + +} // namespace detail +#endif // DOXYGEN_NO_DETAIL + +/*! + \brief parameters, projection parameters + \details This structure initializes all projections + \ingroup projection +*/ +struct parameters : public detail::pj_const_pod +{ + std::string name; + std::vector params; +}; + +// TODO: derived from boost::exception / make more for forward/inverse/init/setup +class proj_exception +{ +public: + + proj_exception(int code = 0) + { + boost::ignore_unused_variable_warning(code); + } +}; + +}}} // namespace boost::geometry::projection +#endif // BOOST_GEOMETRY_PROJECTIONS_IMPL_PROJECTS_HPP diff --git a/include/boost/geometry/extensions/gis/projections/parameters.hpp b/include/boost/geometry/extensions/gis/projections/parameters.hpp new file mode 100644 index 000000000..fc1dee3fe --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/parameters.hpp @@ -0,0 +1,65 @@ +#ifndef _PROJECTIONS_PARAMETERS_HPP +#define _PROJECTIONS_PARAMETERS_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 +#include + + +#include +#include + + +namespace boost { namespace geometry { namespace projection { + +template +inline parameters init(const R& arguments) +{ + return detail::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 + +proj=labrd +ellps=intl +lon_0=46d26'13.95E +lat_0=18d54S +azi=18d54 +k_0=.9995 +x_0=400000 +y_0=800000 + for the Madagascar projection. +\note Parameters are described in the group +*/ +inline parameters init(const std::string& arguments) +{ + return detail::pj_init_plus(arguments); +} + +/*! +\ingroup projection +\brief Overload using a const char* +*/ +inline parameters init(const char* arguments) +{ + return detail::pj_init_plus(arguments); +} + + +// todo: +/* +parameters init(const std::map& arguments) +{ + return detail::pj_init_plus(arguments); +} +*/ + + + +}}} // namespace boost::geometry::projection +#endif diff --git a/include/boost/geometry/extensions/gis/projections/proj/aea.hpp b/include/boost/geometry/extensions/gis/projections/proj/aea.hpp new file mode 100644 index 000000000..ff79fcebd --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/aea.hpp @@ -0,0 +1,525 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_AEA_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_aea_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + mutable par_aea m_proj_parm; + + inline base_aea_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + if( (this->m_proj_parm.rho = boost::math::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 + void setup(Parameters& par, par_aea& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(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 + void setup_aea(Parameters& 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 + void setup_leac(Parameters& 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 detail::aea + #endif // doxygen + + /*! + \brief Albers Equal Area projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + - lat_1= lat_2= + \par Example + \image html ex_aea.gif + */ + template + struct aea_ellipsoid : public detail::aea::base_aea_ellipsoid + { + inline aea_ellipsoid(const Parameters& par) : detail::aea::base_aea_ellipsoid(par) + { + detail::aea::setup_aea(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Lambert Equal Area Conic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + - lat_1= south + \par Example + \image html ex_leac.gif + */ + template + struct leac_ellipsoid : public detail::aea::base_aea_ellipsoid + { + inline leac_ellipsoid(const Parameters& par) : detail::aea::base_aea_ellipsoid(par) + { + detail::aea::setup_leac(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class aea_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class leac_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void aea_init(detail::base_factory& factory) + { + factory.add_to_factory("aea", new aea_entry); + factory.add_to_factory("leac", new leac_entry); + } + + } // namespace detail + // Create EPSG specializations + // (Proof of Concept, only for some) + + template + struct epsg_traits<2964, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3005, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3083, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3085, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3086, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3087, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3153, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3174, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3175, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3309, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3310, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3311, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3338, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3467, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3488, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3513, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3577, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3578, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3579, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + struct epsg_traits<3665, LatLongRadian, Cartesian, Parameters> + { + typedef aea_ellipsoid 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 + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_AEA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/aeqd.hpp b/include/boost/geometry/extensions/gis/projections/proj/aeqd.hpp new file mode 100644 index 000000000..e3c83bfa3 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/aeqd.hpp @@ -0,0 +1,454 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_AEQD_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_aeqd_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_aeqd m_proj_parm; + + inline base_aeqd_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double c, Az, cosAz, A, B, D, E, F, psi, t; + + if ((c = boost::math::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 + struct base_aeqd_guam : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_aeqd m_proj_parm; + + inline base_aeqd_guam(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + struct base_aeqd_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_aeqd m_proj_parm; + + inline base_aeqd_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double cosc, c_rh, sinc; + + if ((c_rh = boost::math::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 + void setup_aeqd(Parameters& 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 detail::aeqd + #endif // doxygen + + /*! + \brief Azimuthal Equidistant projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - lat_0 guam + \par Example + \image html ex_aeqd.gif + */ + template + struct aeqd_ellipsoid : public detail::aeqd::base_aeqd_ellipsoid + { + inline aeqd_ellipsoid(const Parameters& par) : detail::aeqd::base_aeqd_ellipsoid(par) + { + detail::aeqd::setup_aeqd(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Azimuthal Equidistant projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - lat_0 guam + \par Example + \image html ex_aeqd.gif + */ + template + struct aeqd_guam : public detail::aeqd::base_aeqd_guam + { + inline aeqd_guam(const Parameters& par) : detail::aeqd::base_aeqd_guam(par) + { + detail::aeqd::setup_aeqd(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Azimuthal Equidistant projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - lat_0 guam + \par Example + \image html ex_aeqd.gif + */ + template + struct aeqd_spheroid : public detail::aeqd::base_aeqd_spheroid + { + inline aeqd_spheroid(const Parameters& par) : detail::aeqd::base_aeqd_spheroid(par) + { + detail::aeqd::setup_aeqd(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class aeqd_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (! par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else if (pj_param(par.params, "bguam").i) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void aeqd_init(detail::base_factory& factory) + { + factory.add_to_factory("aeqd", new aeqd_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_AEQD_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/airy.hpp b/include/boost/geometry/extensions/gis/projections/proj/airy.hpp new file mode 100644 index 000000000..7c09739b6 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/airy.hpp @@ -0,0 +1,217 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_AIRY_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_airy_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_airy m_proj_parm; + + inline base_airy_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_airy(Parameters& 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 detail::airy + #endif // doxygen + + /*! + \brief Airy projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + - no_cut lat_b= + \par Example + \image html ex_airy.gif + */ + template + struct airy_spheroid : public detail::airy::base_airy_spheroid + { + inline airy_spheroid(const Parameters& par) : detail::airy::base_airy_spheroid(par) + { + detail::airy::setup_airy(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class airy_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void airy_init(detail::base_factory& factory) + { + factory.add_to_factory("airy", new airy_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_AIRY_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/aitoff.hpp b/include/boost/geometry/extensions/gis/projections/proj/aitoff.hpp new file mode 100644 index 000000000..98b6b6173 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/aitoff.hpp @@ -0,0 +1,210 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_AITOFF_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace aitoff{ + + struct par_aitoff + { + double cosphi1; + int mode; + }; + + + + + + // template class, using CRTP to implement forward/inverse + template + struct base_aitoff_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_aitoff m_proj_parm; + + inline base_aitoff_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup(Parameters& par, par_aitoff& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + // par.inv = 0; + // par.fwd = s_forward; + par.es = 0.; + } + + + // Aitoff + template + void setup_aitoff(Parameters& par, par_aitoff& proj_parm) + { + proj_parm.mode = 0; + setup(par, proj_parm); + } + + // Winkel Tripel + template + void setup_wintri(Parameters& 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 detail::aitoff + #endif // doxygen + + /*! + \brief Aitoff projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + \par Example + \image html ex_aitoff.gif + */ + template + struct aitoff_spheroid : public detail::aitoff::base_aitoff_spheroid + { + inline aitoff_spheroid(const Parameters& par) : detail::aitoff::base_aitoff_spheroid(par) + { + detail::aitoff::setup_aitoff(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Winkel Tripel projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - lat_1 + \par Example + \image html ex_wintri.gif + */ + template + struct wintri_spheroid : public detail::aitoff::base_aitoff_spheroid + { + inline wintri_spheroid(const Parameters& par) : detail::aitoff::base_aitoff_spheroid(par) + { + detail::aitoff::setup_wintri(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class aitoff_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class wintri_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void aitoff_init(detail::base_factory& factory) + { + factory.add_to_factory("aitoff", new aitoff_entry); + factory.add_to_factory("wintri", new wintri_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_AITOFF_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/august.hpp b/include/boost/geometry/extensions/gis/projections/proj/august.hpp new file mode 100644 index 000000000..e0c1df5df --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/august.hpp @@ -0,0 +1,141 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_AUGUST_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace august{ + static const double M = 1.333333333333333; + + + // template class, using CRTP to implement forward/inverse + template + struct base_august_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_august_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_august(Parameters& par) + { + // par.inv = 0; + // par.fwd = s_forward; + par.es = 0.; + } + + }} // namespace detail::august + #endif // doxygen + + /*! + \brief August Epicycloidal projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_august.gif + */ + template + struct august_spheroid : public detail::august::base_august_spheroid + { + inline august_spheroid(const Parameters& par) : detail::august::base_august_spheroid(par) + { + detail::august::setup_august(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class august_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void august_init(detail::base_factory& factory) + { + factory.add_to_factory("august", new august_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_AUGUST_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/bacon.hpp b/include/boost/geometry/extensions/gis/projections/proj/bacon.hpp new file mode 100644 index 000000000..e1c48c231 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/bacon.hpp @@ -0,0 +1,238 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_BACON_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_bacon_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_bacon m_proj_parm; + + inline base_bacon_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_apian(Parameters& par, par_bacon& proj_parm) + { + proj_parm.bacn = proj_parm.ortl = 0; + par.es = 0.; + // par.fwd = s_forward; + } + + // Ortelius Oval + template + void setup_ortel(Parameters& par, par_bacon& proj_parm) + { + proj_parm.bacn = 0; + proj_parm.ortl = 1; + par.es = 0.; + // par.fwd = s_forward; + } + + // Bacon Globular + template + void setup_bacon(Parameters& par, par_bacon& proj_parm) + { + proj_parm.bacn = 1; + proj_parm.ortl = 0; + par.es = 0.; + // par.fwd = s_forward; + } + + }} // namespace detail::bacon + #endif // doxygen + + /*! + \brief Apian Globular I projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_apian.gif + */ + template + struct apian_spheroid : public detail::bacon::base_bacon_spheroid + { + inline apian_spheroid(const Parameters& par) : detail::bacon::base_bacon_spheroid(par) + { + detail::bacon::setup_apian(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Ortelius Oval projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_ortel.gif + */ + template + struct ortel_spheroid : public detail::bacon::base_bacon_spheroid + { + inline ortel_spheroid(const Parameters& par) : detail::bacon::base_bacon_spheroid(par) + { + detail::bacon::setup_ortel(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Bacon Globular projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_bacon.gif + */ + template + struct bacon_spheroid : public detail::bacon::base_bacon_spheroid + { + inline bacon_spheroid(const Parameters& par) : detail::bacon::base_bacon_spheroid(par) + { + detail::bacon::setup_bacon(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class apian_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class ortel_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class bacon_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void bacon_init(detail::base_factory& factory) + { + factory.add_to_factory("apian", new apian_entry); + factory.add_to_factory("ortel", new ortel_entry); + factory.add_to_factory("bacon", new bacon_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_BACON_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/bipc.hpp b/include/boost/geometry/extensions/gis/projections/proj/bipc.hpp new file mode 100644 index 000000000..62c10f640 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/bipc.hpp @@ -0,0 +1,253 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_BIPC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_bipc_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_bipc m_proj_parm; + + inline base_bipc_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 = boost::math::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 + void setup_bipc(Parameters& 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 detail::bipc + #endif // doxygen + + /*! + \brief Bipolar conic of western hemisphere projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + \par Example + \image html ex_bipc.gif + */ + template + struct bipc_spheroid : public detail::bipc::base_bipc_spheroid + { + inline bipc_spheroid(const Parameters& par) : detail::bipc::base_bipc_spheroid(par) + { + detail::bipc::setup_bipc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class bipc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void bipc_init(detail::base_factory& factory) + { + factory.add_to_factory("bipc", new bipc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_BIPC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/boggs.hpp b/include/boost/geometry/extensions/gis/projections/proj/boggs.hpp new file mode 100644 index 000000000..f7d15cc07 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/boggs.hpp @@ -0,0 +1,154 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_BOGGS_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_boggs_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_boggs_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_boggs(Parameters& par) + { + par.es = 0.; + // par.fwd = s_forward; + } + + }} // namespace detail::boggs + #endif // doxygen + + /*! + \brief Boggs Eumorphic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - no inverse + - Spheroid + \par Example + \image html ex_boggs.gif + */ + template + struct boggs_spheroid : public detail::boggs::base_boggs_spheroid + { + inline boggs_spheroid(const Parameters& par) : detail::boggs::base_boggs_spheroid(par) + { + detail::boggs::setup_boggs(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class boggs_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void boggs_init(detail::base_factory& factory) + { + factory.add_to_factory("boggs", new boggs_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_BOGGS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/bonne.hpp b/include/boost/geometry/extensions/gis/projections/proj/bonne.hpp new file mode 100644 index 000000000..9dafeafb7 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/bonne.hpp @@ -0,0 +1,246 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_BONNE_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_bonne_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_bonne m_proj_parm; + + inline base_bonne_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double s, rh; + + rh = boost::math::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 + struct base_bonne_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_bonne m_proj_parm; + + inline base_bonne_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double rh; + + rh = boost::math::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 + void setup_bonne(Parameters& 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 detail::bonne + #endif // doxygen + + /*! + \brief Bonne (Werner lat_1=90) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + - lat_1= + \par Example + \image html ex_bonne.gif + */ + template + struct bonne_ellipsoid : public detail::bonne::base_bonne_ellipsoid + { + inline bonne_ellipsoid(const Parameters& par) : detail::bonne::base_bonne_ellipsoid(par) + { + detail::bonne::setup_bonne(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Bonne (Werner lat_1=90) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + - lat_1= + \par Example + \image html ex_bonne.gif + */ + template + struct bonne_spheroid : public detail::bonne::base_bonne_spheroid + { + inline bonne_spheroid(const Parameters& par) : detail::bonne::base_bonne_spheroid(par) + { + detail::bonne::setup_bonne(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class bonne_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void bonne_init(detail::base_factory& factory) + { + factory.add_to_factory("bonne", new bonne_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_BONNE_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/cass.hpp b/include/boost/geometry/extensions/gis/projections/proj/cass.hpp new file mode 100644 index 000000000..ce0775450 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/cass.hpp @@ -0,0 +1,465 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_CASS_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_cass_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + mutable par_cass m_proj_parm; + + inline base_cass_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + struct base_cass_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + mutable par_cass m_proj_parm; + + inline base_cass_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_cass(Parameters& 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 detail::cass + #endif // doxygen + + /*! + \brief Cassini projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + \par Example + \image html ex_cass.gif + */ + template + struct cass_ellipsoid : public detail::cass::base_cass_ellipsoid + { + inline cass_ellipsoid(const Parameters& par) : detail::cass::base_cass_ellipsoid(par) + { + detail::cass::setup_cass(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Cassini projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + \par Example + \image html ex_cass.gif + */ + template + struct cass_spheroid : public detail::cass::base_cass_spheroid + { + inline cass_spheroid(const Parameters& par) : detail::cass::base_cass_spheroid(par) + { + detail::cass::setup_cass(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class cass_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void cass_init(detail::base_factory& factory) + { + factory.add_to_factory("cass", new cass_entry); + } + + } // namespace detail + // Create EPSG specializations + // (Proof of Concept, only for some) + + template + struct epsg_traits<2066, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<2099, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<2314, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3068, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3140, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3366, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3377, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3378, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3379, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3380, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3381, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3382, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3383, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3384, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3385, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<3407, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<24500, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<28191, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<28193, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + struct epsg_traits<30200, LatLongRadian, Cartesian, Parameters> + { + typedef cass_ellipsoid 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 + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_CASS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/cc.hpp b/include/boost/geometry/extensions/gis/projections/proj/cc.hpp new file mode 100644 index 000000000..76b6981fb --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/cc.hpp @@ -0,0 +1,145 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_CC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace cc{ + static const double EPS10 = 1.e-10; + + struct par_cc + { + double ap; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_cc_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_cc m_proj_parm; + + inline base_cc_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lat = atan(xy_y); + lp_lon = xy_x; + } + }; + + // Central Cylindrical + template + void setup_cc(Parameters& par, par_cc& proj_parm) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::cc + #endif // doxygen + + /*! + \brief Central Cylindrical projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + \par Example + \image html ex_cc.gif + */ + template + struct cc_spheroid : public detail::cc::base_cc_spheroid + { + inline cc_spheroid(const Parameters& par) : detail::cc::base_cc_spheroid(par) + { + detail::cc::setup_cc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class cc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void cc_init(detail::base_factory& factory) + { + factory.add_to_factory("cc", new cc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_CC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/cea.hpp b/include/boost/geometry/extensions/gis/projections/proj/cea.hpp new file mode 100644 index 000000000..dd51af416 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/cea.hpp @@ -0,0 +1,224 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_CEA_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_cea_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_cea m_proj_parm; + + inline base_cea_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + struct base_cea_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_cea m_proj_parm; + + inline base_cea_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = this->m_par.k0 * lp_lon; + xy_y = sin(lp_lat) / this->m_par.k0; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_cea(Parameters& 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 detail::cea + #endif // doxygen + + /*! + \brief Equal Area Cylindrical projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + - lat_ts= + \par Example + \image html ex_cea.gif + */ + template + struct cea_ellipsoid : public detail::cea::base_cea_ellipsoid + { + inline cea_ellipsoid(const Parameters& par) : detail::cea::base_cea_ellipsoid(par) + { + detail::cea::setup_cea(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Equal Area Cylindrical projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + - lat_ts= + \par Example + \image html ex_cea.gif + */ + template + struct cea_spheroid : public detail::cea::base_cea_spheroid + { + inline cea_spheroid(const Parameters& par) : detail::cea::base_cea_spheroid(par) + { + detail::cea::setup_cea(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class cea_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void cea_init(detail::base_factory& factory) + { + factory.add_to_factory("cea", new cea_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_CEA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/chamb.hpp b/include/boost/geometry/extensions/gis/projections/proj/chamb.hpp new file mode 100644 index 000000000..2ca949ec9 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/chamb.hpp @@ -0,0 +1,242 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_CHAMB_HPP +#define BOOST_GEOMETRY_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 + +#include + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_chamb_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_chamb m_proj_parm; + + inline base_chamb_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_chamb(Parameters& 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 detail::chamb + #endif // doxygen + + /*! + \brief Chamberlin Trimetric projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters 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 + struct chamb_spheroid : public detail::chamb::base_chamb_spheroid + { + inline chamb_spheroid(const Parameters& par) : detail::chamb::base_chamb_spheroid(par) + { + detail::chamb::setup_chamb(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class chamb_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void chamb_init(detail::base_factory& factory) + { + factory.add_to_factory("chamb", new chamb_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_CHAMB_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/collg.hpp b/include/boost/geometry/extensions/gis/projections/proj/collg.hpp new file mode 100644 index 000000000..50a26c612 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/collg.hpp @@ -0,0 +1,152 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_COLLG_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_collg_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_collg_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_collg(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::collg + #endif // doxygen + + /*! + \brief Collignon projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_collg.gif + */ + template + struct collg_spheroid : public detail::collg::base_collg_spheroid + { + inline collg_spheroid(const Parameters& par) : detail::collg::base_collg_spheroid(par) + { + detail::collg::setup_collg(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class collg_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void collg_init(detail::base_factory& factory) + { + factory.add_to_factory("collg", new collg_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_COLLG_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/crast.hpp b/include/boost/geometry/extensions/gis/projections/proj/crast.hpp new file mode 100644 index 000000000..0172a73d9 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/crast.hpp @@ -0,0 +1,144 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_CRAST_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_crast_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_crast_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_crast(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::crast + #endif // doxygen + + /*! + \brief Craster Parabolic (Putnins P4) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_crast.gif + */ + template + struct crast_spheroid : public detail::crast::base_crast_spheroid + { + inline crast_spheroid(const Parameters& par) : detail::crast::base_crast_spheroid(par) + { + detail::crast::setup_crast(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class crast_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void crast_init(detail::base_factory& factory) + { + factory.add_to_factory("crast", new crast_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_CRAST_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/denoy.hpp b/include/boost/geometry/extensions/gis/projections/proj/denoy.hpp new file mode 100644 index 000000000..10ca8135b --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/denoy.hpp @@ -0,0 +1,140 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_DENOY_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_denoy_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_denoy_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_denoy(Parameters& par) + { + par.es = 0.; + // par.fwd = s_forward; + } + + }} // namespace detail::denoy + #endif // doxygen + + /*! + \brief Denoyer Semi-Elliptical projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - no inverse + - Spheroid + \par Example + \image html ex_denoy.gif + */ + template + struct denoy_spheroid : public detail::denoy::base_denoy_spheroid + { + inline denoy_spheroid(const Parameters& par) : detail::denoy::base_denoy_spheroid(par) + { + detail::denoy::setup_denoy(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class denoy_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void denoy_init(detail::base_factory& factory) + { + factory.add_to_factory("denoy", new denoy_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_DENOY_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/eck1.hpp b/include/boost/geometry/extensions/gis/projections/proj/eck1.hpp new file mode 100644 index 000000000..46b9e53b9 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/eck1.hpp @@ -0,0 +1,140 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ECK1_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace eck1{ + static const double FC = .92131773192356127802; + static const double RP = .31830988618379067154; + + + // template class, using CRTP to implement forward/inverse + template + struct base_eck1_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_eck1_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = FC * lp_lon * (1. - RP * fabs(lp_lat)); + xy_y = FC * lp_lat; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lat = xy_y / FC; + lp_lon = xy_x / (FC * (1. - RP * fabs(lp_lat))); + } + }; + + // Eckert I + template + void setup_eck1(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::eck1 + #endif // doxygen + + /*! + \brief Eckert I projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_eck1.gif + */ + template + struct eck1_spheroid : public detail::eck1::base_eck1_spheroid + { + inline eck1_spheroid(const Parameters& par) : detail::eck1::base_eck1_spheroid(par) + { + detail::eck1::setup_eck1(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class eck1_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void eck1_init(detail::base_factory& factory) + { + factory.add_to_factory("eck1", new eck1_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ECK1_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/eck2.hpp b/include/boost/geometry/extensions/gis/projections/proj/eck2.hpp new file mode 100644 index 000000000..f939def77 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/eck2.hpp @@ -0,0 +1,151 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ECK2_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_eck2_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_eck2_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_eck2(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::eck2 + #endif // doxygen + + /*! + \brief Eckert II projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_eck2.gif + */ + template + struct eck2_spheroid : public detail::eck2::base_eck2_spheroid + { + inline eck2_spheroid(const Parameters& par) : detail::eck2::base_eck2_spheroid(par) + { + detail::eck2::setup_eck2(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class eck2_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void eck2_init(detail::base_factory& factory) + { + factory.add_to_factory("eck2", new eck2_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ECK2_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/eck3.hpp b/include/boost/geometry/extensions/gis/projections/proj/eck3.hpp new file mode 100644 index 000000000..13c95e2c1 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/eck3.hpp @@ -0,0 +1,286 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ECK3_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace eck3{ + + struct par_eck3 + { + double C_x, C_y, A, B; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_eck3_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_eck3 m_proj_parm; + + inline base_eck3_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup(Parameters& par, par_eck3& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + + // Eckert III + template + void setup_eck3(Parameters& 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 + void setup_putp1(Parameters& 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 + void setup_wag6(Parameters& 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 + void setup_kav7(Parameters& 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 detail::eck3 + #endif // doxygen + + /*! + \brief Eckert III projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_eck3.gif + */ + template + struct eck3_spheroid : public detail::eck3::base_eck3_spheroid + { + inline eck3_spheroid(const Parameters& par) : detail::eck3::base_eck3_spheroid(par) + { + detail::eck3::setup_eck3(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Putnins P1 projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp1.gif + */ + template + struct putp1_spheroid : public detail::eck3::base_eck3_spheroid + { + inline putp1_spheroid(const Parameters& par) : detail::eck3::base_eck3_spheroid(par) + { + detail::eck3::setup_putp1(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Wagner VI projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_wag6.gif + */ + template + struct wag6_spheroid : public detail::eck3::base_eck3_spheroid + { + inline wag6_spheroid(const Parameters& par) : detail::eck3::base_eck3_spheroid(par) + { + detail::eck3::setup_wag6(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Kavraisky VII projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_kav7.gif + */ + template + struct kav7_spheroid : public detail::eck3::base_eck3_spheroid + { + inline kav7_spheroid(const Parameters& par) : detail::eck3::base_eck3_spheroid(par) + { + detail::eck3::setup_kav7(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class eck3_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class putp1_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class wag6_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class kav7_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void eck3_init(detail::base_factory& factory) + { + factory.add_to_factory("eck3", new eck3_entry); + factory.add_to_factory("putp1", new putp1_entry); + factory.add_to_factory("wag6", new wag6_entry); + factory.add_to_factory("kav7", new kav7_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ECK3_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/eck4.hpp b/include/boost/geometry/extensions/gis/projections/proj/eck4.hpp new file mode 100644 index 000000000..cc4e11890 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/eck4.hpp @@ -0,0 +1,167 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ECK4_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_eck4_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_eck4_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_eck4(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::eck4 + #endif // doxygen + + /*! + \brief Eckert IV projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_eck4.gif + */ + template + struct eck4_spheroid : public detail::eck4::base_eck4_spheroid + { + inline eck4_spheroid(const Parameters& par) : detail::eck4::base_eck4_spheroid(par) + { + detail::eck4::setup_eck4(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class eck4_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void eck4_init(detail::base_factory& factory) + { + factory.add_to_factory("eck4", new eck4_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ECK4_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/eck5.hpp b/include/boost/geometry/extensions/gis/projections/proj/eck5.hpp new file mode 100644 index 000000000..3db67b55f --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/eck5.hpp @@ -0,0 +1,141 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ECK5_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_eck5_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_eck5_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = XF * (1. + cos(lp_lat)) * lp_lon; + xy_y = YF * lp_lat; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lon = RXF * xy_x / (1. + cos( lp_lat = RYF * xy_y)); + } + }; + + // Eckert V + template + void setup_eck5(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::eck5 + #endif // doxygen + + /*! + \brief Eckert V projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_eck5.gif + */ + template + struct eck5_spheroid : public detail::eck5::base_eck5_spheroid + { + inline eck5_spheroid(const Parameters& par) : detail::eck5::base_eck5_spheroid(par) + { + detail::eck5::setup_eck5(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class eck5_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void eck5_init(detail::base_factory& factory) + { + factory.add_to_factory("eck5", new eck5_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ECK5_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/eqc.hpp b/include/boost/geometry/extensions/gis/projections/proj/eqc.hpp new file mode 100644 index 000000000..396bb9218 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/eqc.hpp @@ -0,0 +1,146 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_EQC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace eqc{ + + struct par_eqc + { + double rc; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_eqc_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_eqc m_proj_parm; + + inline base_eqc_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = this->m_proj_parm.rc * lp_lon; + xy_y = lp_lat - this->m_par.phi0; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_eqc(Parameters& 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 detail::eqc + #endif // doxygen + + /*! + \brief Equidistant Cylindrical (Plate Caree) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - lat_ts=[ + - lat_0=0] + \par Example + \image html ex_eqc.gif + */ + template + struct eqc_spheroid : public detail::eqc::base_eqc_spheroid + { + inline eqc_spheroid(const Parameters& par) : detail::eqc::base_eqc_spheroid(par) + { + detail::eqc::setup_eqc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class eqc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void eqc_init(detail::base_factory& factory) + { + factory.add_to_factory("eqc", new eqc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_EQC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/eqdc.hpp b/include/boost/geometry/extensions/gis/projections/proj/eqdc.hpp new file mode 100644 index 000000000..c746ddeb6 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/eqdc.hpp @@ -0,0 +1,212 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_EQDC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_eqdc_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + mutable par_eqdc m_proj_parm; + + inline base_eqdc_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + if ((this->m_proj_parm.rho = boost::math::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(Geographic 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 + void setup_eqdc(Parameters& 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 detail::eqdc + #endif // doxygen + + /*! + \brief Equidistant Conic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + - lat_1= lat_2= + \par Example + \image html ex_eqdc.gif + */ + template + struct eqdc_ellipsoid : public detail::eqdc::base_eqdc_ellipsoid + { + inline eqdc_ellipsoid(const Parameters& par) : detail::eqdc::base_eqdc_ellipsoid(par) + { + detail::eqdc::setup_eqdc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class eqdc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void eqdc_init(detail::base_factory& factory) + { + factory.add_to_factory("eqdc", new eqdc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_EQDC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/fahey.hpp b/include/boost/geometry/extensions/gis/projections/proj/fahey.hpp new file mode 100644 index 000000000..f48076083 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/fahey.hpp @@ -0,0 +1,140 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_FAHEY_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace fahey{ + static const double TOL = 1e-6; + + + // template class, using CRTP to implement forward/inverse + template + struct base_fahey_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_fahey_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_fahey(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::fahey + #endif // doxygen + + /*! + \brief Fahey projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_fahey.gif + */ + template + struct fahey_spheroid : public detail::fahey::base_fahey_spheroid + { + inline fahey_spheroid(const Parameters& par) : detail::fahey::base_fahey_spheroid(par) + { + detail::fahey::setup_fahey(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class fahey_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void fahey_init(detail::base_factory& factory) + { + factory.add_to_factory("fahey", new fahey_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_FAHEY_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/fouc_s.hpp b/include/boost/geometry/extensions/gis/projections/proj/fouc_s.hpp new file mode 100644 index 000000000..379795d3a --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/fouc_s.hpp @@ -0,0 +1,167 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_FOUC_S_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_fouc_s_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_fouc_s m_proj_parm; + + inline base_fouc_s_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_fouc_s(Parameters& 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 detail::fouc_s + #endif // doxygen + + /*! + \brief Foucaut Sinusoidal projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_fouc_s.gif + */ + template + struct fouc_s_spheroid : public detail::fouc_s::base_fouc_s_spheroid + { + inline fouc_s_spheroid(const Parameters& par) : detail::fouc_s::base_fouc_s_spheroid(par) + { + detail::fouc_s::setup_fouc_s(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class fouc_s_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void fouc_s_init(detail::base_factory& factory) + { + factory.add_to_factory("fouc_s", new fouc_s_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_FOUC_S_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/gall.hpp b/include/boost/geometry/extensions/gis/projections/proj/gall.hpp new file mode 100644 index 000000000..0238f8d76 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/gall.hpp @@ -0,0 +1,142 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GALL_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_gall_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_gall_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = XF * lp_lon; + xy_y = YF * tan(.5 * lp_lat); + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lon = RXF * xy_x; + lp_lat = 2. * atan(xy_y * RYF); + } + }; + + // Gall (Gall Stereographic) + template + void setup_gall(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::gall + #endif // doxygen + + /*! + \brief Gall (Gall Stereographic) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + \par Example + \image html ex_gall.gif + */ + template + struct gall_spheroid : public detail::gall::base_gall_spheroid + { + inline gall_spheroid(const Parameters& par) : detail::gall::base_gall_spheroid(par) + { + detail::gall::setup_gall(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class gall_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void gall_init(detail::base_factory& factory) + { + factory.add_to_factory("gall", new gall_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GALL_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/geocent.hpp b/include/boost/geometry/extensions/gis/projections/proj/geocent.hpp new file mode 100644 index 000000000..16b1c7a2a --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/geocent.hpp @@ -0,0 +1,143 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GEOCENT_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace geocent{ + + + + + + + // template class, using CRTP to implement forward/inverse + template + struct base_geocent_other : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_geocent_other(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = lp_lon; + xy_y = lp_lat; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lat = xy_y; + lp_lon = xy_x; + } + }; + + // Geocentric + template + void setup_geocent(Parameters& par) + { + par.is_geocent = 1; + + par.x0 = 0.0; + par.y0 = 0.0; + // par.inv = inverse; + // par.fwd = forward; + } + + }} // namespace detail::geocent + #endif // doxygen + + /*! + \brief Geocentric projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + \par Example + \image html ex_geocent.gif + */ + template + struct geocent_other : public detail::geocent::base_geocent_other + { + inline geocent_other(const Parameters& par) : detail::geocent::base_geocent_other(par) + { + detail::geocent::setup_geocent(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class geocent_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void geocent_init(detail::base_factory& factory) + { + factory.add_to_factory("geocent", new geocent_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GEOCENT_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/geos.hpp b/include/boost/geometry/extensions/gis/projections/proj/geos.hpp new file mode 100644 index 000000000..c9584be90 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/geos.hpp @@ -0,0 +1,280 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GEOS_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_geos_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_geos m_proj_parm; + + inline base_geos_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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) / boost::math::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 / boost::math::hypot (Vy, tmp)); + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double Vx, Vy, Vz, a, b, 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) * boost::math::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 + struct base_geos_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_geos m_proj_parm; + + inline base_geos_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 / boost::math::hypot(Vy, tmp)); + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double Vx, Vy, Vz, a, b, 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 + void setup_geos(Parameters& 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 detail::geos + #endif // doxygen + + /*! + \brief Geostationary Satellite View projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - h= + \par Example + \image html ex_geos.gif + */ + template + struct geos_ellipsoid : public detail::geos::base_geos_ellipsoid + { + inline geos_ellipsoid(const Parameters& par) : detail::geos::base_geos_ellipsoid(par) + { + detail::geos::setup_geos(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Geostationary Satellite View projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - h= + \par Example + \image html ex_geos.gif + */ + template + struct geos_spheroid : public detail::geos::base_geos_spheroid + { + inline geos_spheroid(const Parameters& par) : detail::geos::base_geos_spheroid(par) + { + detail::geos::setup_geos(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class geos_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void geos_init(detail::base_factory& factory) + { + factory.add_to_factory("geos", new geos_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GEOS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/gins8.hpp b/include/boost/geometry/extensions/gis/projections/proj/gins8.hpp new file mode 100644 index 000000000..fffd16f9c --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/gins8.hpp @@ -0,0 +1,140 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GINS8_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_gins8_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_gins8_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_gins8(Parameters& par) + { + par.es = 0.; + // par.inv = 0; + // par.fwd = s_forward; + } + + }} // namespace detail::gins8 + #endif // doxygen + + /*! + \brief Ginsburg VIII (TsNIIGAiK) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - no inverse + \par Example + \image html ex_gins8.gif + */ + template + struct gins8_spheroid : public detail::gins8::base_gins8_spheroid + { + inline gins8_spheroid(const Parameters& par) : detail::gins8::base_gins8_spheroid(par) + { + detail::gins8::setup_gins8(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class gins8_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void gins8_init(detail::base_factory& factory) + { + factory.add_to_factory("gins8", new gins8_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GINS8_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/gn_sinu.hpp b/include/boost/geometry/extensions/gis/projections/proj/gn_sinu.hpp new file mode 100644 index 000000000..b71c9383b --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/gn_sinu.hpp @@ -0,0 +1,380 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GN_SINU_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_gn_sinu_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_gn_sinu m_proj_parm; + + inline base_gn_sinu_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double s; boost::ignore_unused_variable_warning(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 + struct base_gn_sinu_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_gn_sinu m_proj_parm; + + inline base_gn_sinu_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double s; boost::ignore_unused_variable_warning(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 + void setup(Parameters& par, par_gn_sinu& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(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 + void setup_gn_sinu(Parameters& 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 + void setup_sinu(Parameters& 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 + void setup_eck6(Parameters& 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 + void setup_mbtfps(Parameters& par, par_gn_sinu& proj_parm) + { + proj_parm.m = 0.5; + proj_parm.n = 1.785398163397448309615660845; + setup(par, proj_parm); + } + + }} // namespace detail::gn_sinu + #endif // doxygen + + /*! + \brief Sinusoidal (Sanson-Flamsteed) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - Ellipsoid + \par Example + \image html ex_sinu.gif + */ + template + struct sinu_ellipsoid : public detail::gn_sinu::base_gn_sinu_ellipsoid + { + inline sinu_ellipsoid(const Parameters& par) : detail::gn_sinu::base_gn_sinu_ellipsoid(par) + { + detail::gn_sinu::setup_sinu(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief General Sinusoidal Series projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - m= n= + \par Example + \image html ex_gn_sinu.gif + */ + template + struct gn_sinu_spheroid : public detail::gn_sinu::base_gn_sinu_spheroid + { + inline gn_sinu_spheroid(const Parameters& par) : detail::gn_sinu::base_gn_sinu_spheroid(par) + { + detail::gn_sinu::setup_gn_sinu(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Sinusoidal (Sanson-Flamsteed) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - Ellipsoid + \par Example + \image html ex_sinu.gif + */ + template + struct sinu_spheroid : public detail::gn_sinu::base_gn_sinu_spheroid + { + inline sinu_spheroid(const Parameters& par) : detail::gn_sinu::base_gn_sinu_spheroid(par) + { + detail::gn_sinu::setup_sinu(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Eckert VI projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_eck6.gif + */ + template + struct eck6_spheroid : public detail::gn_sinu::base_gn_sinu_spheroid + { + inline eck6_spheroid(const Parameters& par) : detail::gn_sinu::base_gn_sinu_spheroid(par) + { + detail::gn_sinu::setup_eck6(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief McBryde-Thomas Flat-Polar Sinusoidal projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_mbtfps.gif + */ + template + struct mbtfps_spheroid : public detail::gn_sinu::base_gn_sinu_spheroid + { + inline mbtfps_spheroid(const Parameters& par) : detail::gn_sinu::base_gn_sinu_spheroid(par) + { + detail::gn_sinu::setup_mbtfps(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class gn_sinu_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class sinu_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class eck6_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class mbtfps_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void gn_sinu_init(detail::base_factory& factory) + { + factory.add_to_factory("gn_sinu", new gn_sinu_entry); + factory.add_to_factory("sinu", new sinu_entry); + factory.add_to_factory("eck6", new eck6_entry); + factory.add_to_factory("mbtfps", new mbtfps_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GN_SINU_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/gnom.hpp b/include/boost/geometry/extensions/gis/projections/proj/gnom.hpp new file mode 100644 index 000000000..45ce68741 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/gnom.hpp @@ -0,0 +1,227 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GNOM_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_gnom_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_gnom m_proj_parm; + + inline base_gnom_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double rh, cosz, sinz; + + rh = boost::math::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 + void setup_gnom(Parameters& 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 detail::gnom + #endif // doxygen + + /*! + \brief Gnomonic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + \par Example + \image html ex_gnom.gif + */ + template + struct gnom_spheroid : public detail::gnom::base_gnom_spheroid + { + inline gnom_spheroid(const Parameters& par) : detail::gnom::base_gnom_spheroid(par) + { + detail::gnom::setup_gnom(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class gnom_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void gnom_init(detail::base_factory& factory) + { + factory.add_to_factory("gnom", new gnom_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GNOM_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/goode.hpp b/include/boost/geometry/extensions/gis/projections/proj/goode.hpp new file mode 100644 index 000000000..b0b6f4636 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/goode.hpp @@ -0,0 +1,160 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GOODE_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace goode{ + static const double Y_COR = 0.05280; + static const double PHI_LIM = .71093078197902358062; + + template + struct par_goode + { + sinu_ellipsoid sinu; + moll_spheroid moll; + + par_goode(const Parameters& par) : sinu(par), moll(par) {} + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_goode_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_goode m_proj_parm; + + inline base_goode_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par), m_proj_parm(par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_goode(Parameters& par, par_goode& proj_parm) + { + par.es = 0.; + // par.fwd = s_forward; + // par.inv = s_inverse; + } + + }} // namespace detail::goode + #endif // doxygen + + /*! + \brief Goode Homolosine projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_goode.gif + */ + template + struct goode_spheroid : public detail::goode::base_goode_spheroid + { + inline goode_spheroid(const Parameters& par) : detail::goode::base_goode_spheroid(par) + { + detail::goode::setup_goode(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class goode_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void goode_init(detail::base_factory& factory) + { + factory.add_to_factory("goode", new goode_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GOODE_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/gstmerc.hpp b/include/boost/geometry/extensions/gis/projections/proj/gstmerc.hpp new file mode 100644 index 000000000..8ca2aa152 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/gstmerc.hpp @@ -0,0 +1,176 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_GSTMERC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_gstmerc_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_gstmerc m_proj_parm; + + inline base_gstmerc_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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; + /*fprintf(stderr,"fwd:\nL =%16.13f\nLs =%16.13f\nLs1 =%16.13f\nLP(%16.13f,%16.13f)=XY(%16.4f,%16.4f)\n",L,Ls,Ls1,lp_lon+this->m_par.lam0,lp_lat,(xy_x*this->m_par.a + this->m_par.x0)*this->m_par.to_meter,(xy_y*this->m_par.a + this->m_par.y0)*this->m_par.to_meter);*/ + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double L, LC, sinC; + L= atan(sinh((xy_x*this->m_par.a - this->m_proj_parm.XS)/this->m_proj_parm.n2)/cos((xy_y*this->m_par.a - this->m_proj_parm.YS)/this->m_proj_parm.n2)); + sinC= sin((xy_y*this->m_par.a - this->m_proj_parm.YS)/this->m_proj_parm.n2)/cosh((xy_x*this->m_par.a - this->m_proj_parm.XS)/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); + /*fprintf(stderr,"inv:\nL =%16.13f\nsinC =%16.13f\nLC =%16.13f\nXY(%16.4f,%16.4f)=LP(%16.13f,%16.13f)\n",L,sinC,LC,((xy_x/this->m_par.ra)+this->m_par.x0)/this->m_par.to_meter,((xy_y/this->m_par.ra)+this->m_par.y0)/this->m_par.to_meter,lp_lon+this->m_par.lam0,lp_lat);*/ + } + }; + + // Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion) + template + void setup_gstmerc(Parameters& par, par_gstmerc& proj_parm) + { + proj_parm.lamc= par.lam0; + 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; + /* -par.x0 */ + proj_parm.YS= -1.0*proj_parm.n2*proj_parm.phic; + /* -par.y0 */ + // par.inv= s_inverse; + // par.fwd= s_forward; + /*fprintf(stderr,"a (m) =%16.4f\ne =%16.13f\nl0(rad)=%16.13f\np0(rad)=%16.13f\nk0 =%16.4f\nX0 (m)=%16.4f\nY0 (m)=%16.4f\n\nlC(rad)=%16.13f\npC(rad)=%16.13f\nc =%16.13f\nn1 =%16.13f\nn2 (m) =%16.4f\nXS (m) =%16.4f\nYS (m) =%16.4f\n", par.a, par.e, par.lam0, par.phi0, par.k0, par.x0, par.y0, proj_parm.lamc, proj_parm.phic, proj_parm.c, proj_parm.n1, proj_parm.n2, proj_parm.XS +par.x0, proj_parm.YS + par.y0); + */ + } + + }} // namespace detail::gstmerc + #endif // doxygen + + /*! + \brief Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + - lat_0= lon_0= k_0= + \par Example + \image html ex_gstmerc.gif + */ + template + struct gstmerc_spheroid : public detail::gstmerc::base_gstmerc_spheroid + { + inline gstmerc_spheroid(const Parameters& par) : detail::gstmerc::base_gstmerc_spheroid(par) + { + detail::gstmerc::setup_gstmerc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class gstmerc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void gstmerc_init(detail::base_factory& factory) + { + factory.add_to_factory("gstmerc", new gstmerc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_GSTMERC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/hammer.hpp b/include/boost/geometry/extensions/gis/projections/proj/hammer.hpp new file mode 100644 index 000000000..d4cc1551a --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/hammer.hpp @@ -0,0 +1,152 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_HAMMER_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace hammer{ + + struct par_hammer + { + double w; + double m, rm; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_hammer_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_hammer m_proj_parm; + + inline base_hammer_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_hammer(Parameters& 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 detail::hammer + #endif // doxygen + + /*! + \brief Hammer & Eckert-Greifendorff projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + - W= M= + \par Example + \image html ex_hammer.gif + */ + template + struct hammer_spheroid : public detail::hammer::base_hammer_spheroid + { + inline hammer_spheroid(const Parameters& par) : detail::hammer::base_hammer_spheroid(par) + { + detail::hammer::setup_hammer(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class hammer_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void hammer_init(detail::base_factory& factory) + { + factory.add_to_factory("hammer", new hammer_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_HAMMER_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/hatano.hpp b/include/boost/geometry/extensions/gis/projections/proj/hatano.hpp new file mode 100644 index 000000000..3d6e746f5 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/hatano.hpp @@ -0,0 +1,173 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_HATANO_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_hatano_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_hatano_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_hatano(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::hatano + #endif // doxygen + + /*! + \brief Hatano Asymmetrical Equal Area projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_hatano.gif + */ + template + struct hatano_spheroid : public detail::hatano::base_hatano_spheroid + { + inline hatano_spheroid(const Parameters& par) : detail::hatano::base_hatano_spheroid(par) + { + detail::hatano::setup_hatano(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class hatano_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void hatano_init(detail::base_factory& factory) + { + factory.add_to_factory("hatano", new hatano_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_HATANO_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/imw_p.hpp b/include/boost/geometry/extensions/gis/projections/proj/imw_p.hpp new file mode 100644 index 000000000..cf3ffc7a4 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/imw_p.hpp @@ -0,0 +1,281 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_IMW_P_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + inline int + phi12(Parameters& 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 + inline PXY + loc_for(double const& lp_lam, double const& lp_phi, const Parameters& par, par_imw_p const& proj_parm, double *yc) { + PXY xy; + + if (! lp_phi) { + xy.x = lp_lam; + xy.y = 0.; + } else { + double xa, ya, xb, yb, xc, 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 + inline void + xy(Parameters& 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 + struct base_imw_p_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_imw_p m_proj_parm; + + inline base_imw_p_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + double yc = 0; + 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + PXY t; + double yc = 0; + + 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 + void setup_imw_p(Parameters& 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 detail::imw_p + #endif // doxygen + + /*! + \brief International Map of the World Polyconic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Mod Polyconic + - Ellipsoid + - lat_1= and lat_2= [lon_1=] + \par Example + \image html ex_imw_p.gif + */ + template + struct imw_p_ellipsoid : public detail::imw_p::base_imw_p_ellipsoid + { + inline imw_p_ellipsoid(const Parameters& par) : detail::imw_p::base_imw_p_ellipsoid(par) + { + detail::imw_p::setup_imw_p(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class imw_p_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void imw_p_init(detail::base_factory& factory) + { + factory.add_to_factory("imw_p", new imw_p_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_IMW_P_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/krovak.hpp b/include/boost/geometry/extensions/gis/projections/proj/krovak.hpp new file mode 100644 index 000000000..4754ef414 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/krovak.hpp @@ -0,0 +1,338 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_KROVAK_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_krovak_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_krovak m_proj_parm; + + inline base_krovak_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + /* calculate xy from lat/lon */ + + + + + /* 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, deltav, s, d, eps, ro; + + + s45 = 0.785398163397448; /* 45 DEG */ + s90 = 2 * s45; + fi0 = this->m_par.phi0; /* Latitude of projection centre 49 DEG 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 DEG 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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, deltav, s, d, eps, ro, fi1, xy0; + int ok; + + s45 = 0.785398163397448; /* 45 DEG */ + s90 = 2 * s45; + fi0 = this->m_par.phi0; /* Latitude of projection centre 49 DEG 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 DEG 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 + void setup_krovak(Parameters& 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 detail::krovak + #endif // doxygen + + /*! + \brief Krovak projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Ellps + \par Example + \image html ex_krovak.gif + */ + template + struct krovak_ellipsoid : public detail::krovak::base_krovak_ellipsoid + { + inline krovak_ellipsoid(const Parameters& par) : detail::krovak::base_krovak_ellipsoid(par) + { + detail::krovak::setup_krovak(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class krovak_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void krovak_init(detail::base_factory& factory) + { + factory.add_to_factory("krovak", new krovak_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_KROVAK_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/labrd.hpp b/include/boost/geometry/extensions/gis/projections/proj/labrd.hpp new file mode 100644 index 000000000..732d4a25f --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/labrd.hpp @@ -0,0 +1,231 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LABRD_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_labrd_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_labrd m_proj_parm; + + inline base_labrd_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_labrd(Parameters& 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 detail::labrd + #endif // doxygen + + /*! + \brief Laborde projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Special for Madagascar + \par Example + \image html ex_labrd.gif + */ + template + struct labrd_ellipsoid : public detail::labrd::base_labrd_ellipsoid + { + inline labrd_ellipsoid(const Parameters& par) : detail::labrd::base_labrd_ellipsoid(par) + { + detail::labrd::setup_labrd(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class labrd_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void labrd_init(detail::base_factory& factory) + { + factory.add_to_factory("labrd", new labrd_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LABRD_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/laea.hpp b/include/boost/geometry/extensions/gis/projections/proj/laea.hpp new file mode 100644 index 000000000..4370d052c --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/laea.hpp @@ -0,0 +1,391 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LAEA_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_laea_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_laea m_proj_parm; + + inline base_laea_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double cCe, sCe, q, rho, ab=0.0; + + switch (this->m_proj_parm.mode) { + case EQUIT: + case OBLIQ: + if ((rho = boost::math::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 + struct base_laea_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_laea m_proj_parm; + + inline base_laea_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double cosz=0.0, rh, sinz=0.0; + + rh = boost::math::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 + void setup_laea(Parameters& 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 detail::laea + #endif // doxygen + + /*! + \brief Lambert Azimuthal Equal Area projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + \par Example + \image html ex_laea.gif + */ + template + struct laea_ellipsoid : public detail::laea::base_laea_ellipsoid + { + inline laea_ellipsoid(const Parameters& par) : detail::laea::base_laea_ellipsoid(par) + { + detail::laea::setup_laea(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Lambert Azimuthal Equal Area projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + \par Example + \image html ex_laea.gif + */ + template + struct laea_spheroid : public detail::laea::base_laea_spheroid + { + inline laea_spheroid(const Parameters& par) : detail::laea::base_laea_spheroid(par) + { + detail::laea::setup_laea(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class laea_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void laea_init(detail::base_factory& factory) + { + factory.add_to_factory("laea", new laea_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LAEA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/lagrng.hpp b/include/boost/geometry/extensions/gis/projections/proj/lagrng.hpp new file mode 100644 index 000000000..a40433a7a --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/lagrng.hpp @@ -0,0 +1,158 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LAGRNG_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_lagrng_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_lagrng m_proj_parm; + + inline base_lagrng_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_lagrng(Parameters& 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 detail::lagrng + #endif // doxygen + + /*! + \brief Lagrange projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + - W= + \par Example + \image html ex_lagrng.gif + */ + template + struct lagrng_spheroid : public detail::lagrng::base_lagrng_spheroid + { + inline lagrng_spheroid(const Parameters& par) : detail::lagrng::base_lagrng_spheroid(par) + { + detail::lagrng::setup_lagrng(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class lagrng_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void lagrng_init(detail::base_factory& factory) + { + factory.add_to_factory("lagrng", new lagrng_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LAGRNG_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/larr.hpp b/include/boost/geometry/extensions/gis/projections/proj/larr.hpp new file mode 100644 index 000000000..94989481d --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/larr.hpp @@ -0,0 +1,134 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LARR_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace larr{ + static const double SIXTH = .16666666666666666; + + + // template class, using CRTP to implement forward/inverse + template + struct base_larr_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_larr_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_larr(Parameters& par) + { + // par.fwd = s_forward; + // par.inv = 0; + par.es = 0.; + } + + }} // namespace detail::larr + #endif // doxygen + + /*! + \brief Larrivee projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_larr.gif + */ + template + struct larr_spheroid : public detail::larr::base_larr_spheroid + { + inline larr_spheroid(const Parameters& par) : detail::larr::base_larr_spheroid(par) + { + detail::larr::setup_larr(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class larr_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void larr_init(detail::base_factory& factory) + { + factory.add_to_factory("larr", new larr_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LARR_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/lask.hpp b/include/boost/geometry/extensions/gis/projections/proj/lask.hpp new file mode 100644 index 000000000..06853cb89 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/lask.hpp @@ -0,0 +1,148 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LASK_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_lask_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_lask_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_lask(Parameters& par) + { + // par.fwd = s_forward; + // par.inv = 0; + par.es = 0.; + } + + }} // namespace detail::lask + #endif // doxygen + + /*! + \brief Laskowski projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_lask.gif + */ + template + struct lask_spheroid : public detail::lask::base_lask_spheroid + { + inline lask_spheroid(const Parameters& par) : detail::lask::base_lask_spheroid(par) + { + detail::lask::setup_lask(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class lask_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void lask_init(detail::base_factory& factory) + { + factory.add_to_factory("lask", new lask_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LASK_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/latlong.hpp b/include/boost/geometry/extensions/gis/projections/proj/latlong.hpp new file mode 100644 index 000000000..dc908f63e --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/latlong.hpp @@ -0,0 +1,282 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LATLONG_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace latlong{ + + + /* very loosely based upon DMA code by Bradford W. Drew */ + + + // template class, using CRTP to implement forward/inverse + template + struct base_latlong_other : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_latlong_other(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + + xy_x = lp_lon / this->m_par.a; + xy_y = lp_lat / this->m_par.a; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + + lp_lat = xy_y * this->m_par.a; + lp_lon = xy_x * this->m_par.a; + } + }; + + // Lat/long (Geodetic) + template + void setup_lonlat(Parameters& par) + { + par.is_latlong = 1; + par.x0 = 0.0; + par.y0 = 0.0; + // par.inv = inverse; + // par.fwd = forward; + } + + // Lat/long (Geodetic alias) + template + void setup_latlon(Parameters& par) + { + par.is_latlong = 1; + par.x0 = 0.0; + par.y0 = 0.0; + // par.inv = inverse; + // par.fwd = forward; + } + + // Lat/long (Geodetic alias) + template + void setup_latlong(Parameters& par) + { + par.is_latlong = 1; + par.x0 = 0.0; + par.y0 = 0.0; + // par.inv = inverse; + // par.fwd = forward; + } + + // Lat/long (Geodetic alias) + template + void setup_longlat(Parameters& par) + { + par.is_latlong = 1; + par.x0 = 0.0; + par.y0 = 0.0; + // par.inv = inverse; + // par.fwd = forward; + } + + }} // namespace detail::latlong + #endif // doxygen + + /*! + \brief Lat/long (Geodetic) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + \par Example + \image html ex_lonlat.gif + */ + template + struct lonlat_other : public detail::latlong::base_latlong_other + { + inline lonlat_other(const Parameters& par) : detail::latlong::base_latlong_other(par) + { + detail::latlong::setup_lonlat(this->m_par); + } + }; + + /*! + \brief Lat/long (Geodetic alias) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + \par Example + \image html ex_latlon.gif + */ + template + struct latlon_other : public detail::latlong::base_latlong_other + { + inline latlon_other(const Parameters& par) : detail::latlong::base_latlong_other(par) + { + detail::latlong::setup_latlon(this->m_par); + } + }; + + /*! + \brief Lat/long (Geodetic alias) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + \par Example + \image html ex_latlong.gif + */ + template + struct latlong_other : public detail::latlong::base_latlong_other + { + inline latlong_other(const Parameters& par) : detail::latlong::base_latlong_other(par) + { + detail::latlong::setup_latlong(this->m_par); + } + }; + + /*! + \brief Lat/long (Geodetic alias) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + \par Example + \image html ex_longlat.gif + */ + template + struct longlat_other : public detail::latlong::base_latlong_other + { + inline longlat_other(const Parameters& par) : detail::latlong::base_latlong_other(par) + { + detail::latlong::setup_longlat(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class lonlat_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class latlon_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class latlong_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class longlat_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void latlong_init(detail::base_factory& factory) + { + factory.add_to_factory("lonlat", new lonlat_entry); + factory.add_to_factory("latlon", new latlon_entry); + factory.add_to_factory("latlong", new latlong_entry); + factory.add_to_factory("longlat", new longlat_entry); + } + + } // namespace detail + // Create EPSG specializations + // (Proof of Concept, only for some) + + template + struct epsg_traits<4326, LatLongRadian, Cartesian, Parameters> + { + typedef longlat_other type; + static inline std::string par() + { + return "+proj=longlat +ellps=WGS84 +datum=WGS84"; + } + }; + + + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LATLONG_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/lcc.hpp b/include/boost/geometry/extensions/gis/projections/proj/lcc.hpp new file mode 100644 index 000000000..b592cbe3e --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/lcc.hpp @@ -0,0 +1,249 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LCC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace lcc{ + static const double EPS10 = 1.e-10; + + struct par_lcc + { + double phi1; + double phi2; + double n; + double rho0; + double c; + int ellips; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_lcc_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + mutable par_lcc m_proj_parm; + + inline base_lcc_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + double rho; + if (fabs(fabs(lp_lat) - HALFPI) < EPS10) { + if ((lp_lat * this->m_proj_parm.n) <= 0.) throw proj_exception();; + rho = 0.; + } + else + 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 * (rho * sin( lp_lon *= this->m_proj_parm.n ) ); + xy_y = this->m_par.k0 * (this->m_proj_parm.rho0 - rho * cos(lp_lon) ); + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double rho; + xy_x /= this->m_par.k0; + xy_y /= this->m_par.k0; + if( (rho = boost::math::hypot(xy_x, xy_y = this->m_proj_parm.rho0 - xy_y)) != 0.0) { + if (this->m_proj_parm.n < 0.) { + rho = -rho; + xy_x = -xy_x; + xy_y = -xy_y; + } + if (this->m_proj_parm.ellips) { + if ((lp_lat = pj_phi2(pow(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 / 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(Geographic lp, Factors &fac) const + { + double rho; + if (fabs(fabs(lp_lat) - HALFPI) < EPS10) { + if ((lp_lat * this->m_proj_parm.n) <= 0.) return; + rho = 0.; + } else + 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 * 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 + void setup_lcc(Parameters& 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 detail::lcc + #endif // doxygen + + /*! + \brief Lambert Conformal Conic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + - lat_1= and lat_2= or lat_0 + \par Example + \image html ex_lcc.gif + */ + template + struct lcc_ellipsoid : public detail::lcc::base_lcc_ellipsoid + { + inline lcc_ellipsoid(const Parameters& par) : detail::lcc::base_lcc_ellipsoid(par) + { + detail::lcc::setup_lcc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class lcc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void lcc_init(detail::base_factory& factory) + { + factory.add_to_factory("lcc", new lcc_entry); + } + + } // namespace detail + // Create EPSG specializations + // (Proof of Concept, only for some) + + template + struct epsg_traits<2805, LatLongRadian, Cartesian, Parameters> + { + typedef lcc_ellipsoid 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 + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LCC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/lcca.hpp b/include/boost/geometry/extensions/gis/projections/proj/lcca.hpp new file mode 100644 index 000000000..831fc4351 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/lcca.hpp @@ -0,0 +1,191 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LCCA_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_lcca_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_lcca m_proj_parm; + + inline base_lcca_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + double S, 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_lcca(Parameters& 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 detail::lcca + #endif // doxygen + + /*! + \brief Lambert Conformal Conic Alternative projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + - lat_0= + \par Example + \image html ex_lcca.gif + */ + template + struct lcca_ellipsoid : public detail::lcca::base_lcca_ellipsoid + { + inline lcca_ellipsoid(const Parameters& par) : detail::lcca::base_lcca_ellipsoid(par) + { + detail::lcca::setup_lcca(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class lcca_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void lcca_init(detail::base_factory& factory) + { + factory.add_to_factory("lcca", new lcca_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LCCA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/loxim.hpp b/include/boost/geometry/extensions/gis/projections/proj/loxim.hpp new file mode 100644 index 000000000..2f5fa5da0 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/loxim.hpp @@ -0,0 +1,164 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LOXIM_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_loxim_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_loxim m_proj_parm; + + inline base_loxim_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_loxim(Parameters& 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 detail::loxim + #endif // doxygen + + /*! + \brief Loximuthal projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_loxim.gif + */ + template + struct loxim_spheroid : public detail::loxim::base_loxim_spheroid + { + inline loxim_spheroid(const Parameters& par) : detail::loxim::base_loxim_spheroid(par) + { + detail::loxim::setup_loxim(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class loxim_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void loxim_init(detail::base_factory& factory) + { + factory.add_to_factory("loxim", new loxim_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LOXIM_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/lsat.hpp b/include/boost/geometry/extensions/gis/projections/proj/lsat.hpp new file mode 100644 index 000000000..f8e25a9dc --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/lsat.hpp @@ -0,0 +1,299 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_LSAT_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + inline void + seraz0(double lam, double mult, Parameters& 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 + struct base_lsat_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_lsat m_proj_parm; + + inline base_lsat_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_lsat(Parameters& 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 detail::lsat + #endif // doxygen + + /*! + \brief Space oblique for LANDSAT projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + - lsat= path= + \par Example + \image html ex_lsat.gif + */ + template + struct lsat_ellipsoid : public detail::lsat::base_lsat_ellipsoid + { + inline lsat_ellipsoid(const Parameters& par) : detail::lsat::base_lsat_ellipsoid(par) + { + detail::lsat::setup_lsat(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class lsat_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void lsat_init(detail::base_factory& factory) + { + factory.add_to_factory("lsat", new lsat_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_LSAT_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/mbt_fps.hpp b/include/boost/geometry/extensions/gis/projections/proj/mbt_fps.hpp new file mode 100644 index 000000000..a3c8d7b64 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/mbt_fps.hpp @@ -0,0 +1,161 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_MBT_FPS_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_mbt_fps_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_mbt_fps_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double t; + + 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 + void setup_mbt_fps(Parameters& par) + { + par.es = 0; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::mbt_fps + #endif // doxygen + + /*! + \brief McBryde-Thomas Flat-Pole Sine (No. 2) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + \par Example + \image html ex_mbt_fps.gif + */ + template + struct mbt_fps_spheroid : public detail::mbt_fps::base_mbt_fps_spheroid + { + inline mbt_fps_spheroid(const Parameters& par) : detail::mbt_fps::base_mbt_fps_spheroid(par) + { + detail::mbt_fps::setup_mbt_fps(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class mbt_fps_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void mbt_fps_init(detail::base_factory& factory) + { + factory.add_to_factory("mbt_fps", new mbt_fps_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_MBT_FPS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/mbtfpp.hpp b/include/boost/geometry/extensions/gis/projections/proj/mbtfpp.hpp new file mode 100644 index 000000000..9df874949 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/mbtfpp.hpp @@ -0,0 +1,155 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_MBTFPP_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_mbtfpp_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_mbtfpp_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_mbtfpp(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::mbtfpp + #endif // doxygen + + /*! + \brief McBride-Thomas Flat-Polar Parabolic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + \par Example + \image html ex_mbtfpp.gif + */ + template + struct mbtfpp_spheroid : public detail::mbtfpp::base_mbtfpp_spheroid + { + inline mbtfpp_spheroid(const Parameters& par) : detail::mbtfpp::base_mbtfpp_spheroid(par) + { + detail::mbtfpp::setup_mbtfpp(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class mbtfpp_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void mbtfpp_init(detail::base_factory& factory) + { + factory.add_to_factory("mbtfpp", new mbtfpp_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_MBTFPP_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/mbtfpq.hpp b/include/boost/geometry/extensions/gis/projections/proj/mbtfpq.hpp new file mode 100644 index 000000000..00e1c43a7 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/mbtfpq.hpp @@ -0,0 +1,170 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_MBTFPQ_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_mbtfpq_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_mbtfpq_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_mbtfpq(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::mbtfpq + #endif // doxygen + + /*! + \brief McBryde-Thomas Flat-Polar Quartic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + \par Example + \image html ex_mbtfpq.gif + */ + template + struct mbtfpq_spheroid : public detail::mbtfpq::base_mbtfpq_spheroid + { + inline mbtfpq_spheroid(const Parameters& par) : detail::mbtfpq::base_mbtfpq_spheroid(par) + { + detail::mbtfpq::setup_mbtfpq(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class mbtfpq_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void mbtfpq_init(detail::base_factory& factory) + { + factory.add_to_factory("mbtfpq", new mbtfpq_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_MBTFPQ_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/merc.hpp b/include/boost/geometry/extensions/gis/projections/proj/merc.hpp new file mode 100644 index 000000000..c1c2f7711 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/merc.hpp @@ -0,0 +1,213 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_MERC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace merc{ + static const double EPS10 = 1.e-10; + + + // template class, using CRTP to implement forward/inverse + template + struct base_merc_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_merc_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + struct base_merc_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_merc_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_merc(Parameters& 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 detail::merc + #endif // doxygen + + /*! + \brief Mercator projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + - lat_ts= + \par Example + \image html ex_merc.gif + */ + template + struct merc_ellipsoid : public detail::merc::base_merc_ellipsoid + { + inline merc_ellipsoid(const Parameters& par) : detail::merc::base_merc_ellipsoid(par) + { + detail::merc::setup_merc(this->m_par); + } + }; + + /*! + \brief Mercator projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + - lat_ts= + \par Example + \image html ex_merc.gif + */ + template + struct merc_spheroid : public detail::merc::base_merc_spheroid + { + inline merc_spheroid(const Parameters& par) : detail::merc::base_merc_spheroid(par) + { + detail::merc::setup_merc(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class merc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void merc_init(detail::base_factory& factory) + { + factory.add_to_factory("merc", new merc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_MERC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/mill.hpp b/include/boost/geometry/extensions/gis/projections/proj/mill.hpp new file mode 100644 index 000000000..014c3e046 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/mill.hpp @@ -0,0 +1,138 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_MILL_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace mill{ + + + // template class, using CRTP to implement forward/inverse + template + struct base_mill_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_mill_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = lp_lon; + xy_y = log(tan(FORTPI + lp_lat * .4)) * 1.25; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lon = xy_x; + lp_lat = 2.5 * (atan(exp(.8 * xy_y)) - FORTPI); + } + }; + + // Miller Cylindrical + template + void setup_mill(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::mill + #endif // doxygen + + /*! + \brief Miller Cylindrical projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + \par Example + \image html ex_mill.gif + */ + template + struct mill_spheroid : public detail::mill::base_mill_spheroid + { + inline mill_spheroid(const Parameters& par) : detail::mill::base_mill_spheroid(par) + { + detail::mill::setup_mill(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class mill_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void mill_init(detail::base_factory& factory) + { + factory.add_to_factory("mill", new mill_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_MILL_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/mod_ster.hpp b/include/boost/geometry/extensions/gis/projections/proj/mod_ster.hpp new file mode 100644 index 000000000..d99ab2eb5 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/mod_ster.hpp @@ -0,0 +1,474 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_MOD_STER_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_mod_ster_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_mod_ster m_proj_parm; + + inline base_mod_ster_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + int nn; + COMPLEX p, fxy, fpxy, dp; + double den, rh = 0, z, sinz = 0, cosz = 0, chi, phi = 0, 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 = boost::math::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 + void setup(Parameters& par, par_mod_ster& proj_parm) /* general initialization */ + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + 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 + void setup_mil_os(Parameters& 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 + void setup_lee_os(Parameters& 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 + void setup_gs48(Parameters& 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 + void setup_alsk(Parameters& 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 + void setup_gs50(Parameters& 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 detail::mod_ster + #endif // doxygen + + /*! + \brief Miller Oblated Stereographic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azi(mod) + \par Example + \image html ex_mil_os.gif + */ + template + struct mil_os_ellipsoid : public detail::mod_ster::base_mod_ster_ellipsoid + { + inline mil_os_ellipsoid(const Parameters& par) : detail::mod_ster::base_mod_ster_ellipsoid(par) + { + detail::mod_ster::setup_mil_os(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Lee Oblated Stereographic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azi(mod) + \par Example + \image html ex_lee_os.gif + */ + template + struct lee_os_ellipsoid : public detail::mod_ster::base_mod_ster_ellipsoid + { + inline lee_os_ellipsoid(const Parameters& par) : detail::mod_ster::base_mod_ster_ellipsoid(par) + { + detail::mod_ster::setup_lee_os(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Mod. Stererographics of 48 U.S. projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azi(mod) + \par Example + \image html ex_gs48.gif + */ + template + struct gs48_ellipsoid : public detail::mod_ster::base_mod_ster_ellipsoid + { + inline gs48_ellipsoid(const Parameters& par) : detail::mod_ster::base_mod_ster_ellipsoid(par) + { + detail::mod_ster::setup_gs48(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Mod. Stererographics of Alaska projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azi(mod) + \par Example + \image html ex_alsk.gif + */ + template + struct alsk_ellipsoid : public detail::mod_ster::base_mod_ster_ellipsoid + { + inline alsk_ellipsoid(const Parameters& par) : detail::mod_ster::base_mod_ster_ellipsoid(par) + { + detail::mod_ster::setup_alsk(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Mod. Stererographics of 50 U.S. projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azi(mod) + \par Example + \image html ex_gs50.gif + */ + template + struct gs50_ellipsoid : public detail::mod_ster::base_mod_ster_ellipsoid + { + inline gs50_ellipsoid(const Parameters& par) : detail::mod_ster::base_mod_ster_ellipsoid(par) + { + detail::mod_ster::setup_gs50(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class mil_os_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class lee_os_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class gs48_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class alsk_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class gs50_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void mod_ster_init(detail::base_factory& factory) + { + factory.add_to_factory("mil_os", new mil_os_entry); + factory.add_to_factory("lee_os", new lee_os_entry); + factory.add_to_factory("gs48", new gs48_entry); + factory.add_to_factory("alsk", new alsk_entry); + factory.add_to_factory("gs50", new gs50_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_MOD_STER_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/moll.hpp b/include/boost/geometry/extensions/gis/projections/proj/moll.hpp new file mode 100644 index 000000000..66a55edb0 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/moll.hpp @@ -0,0 +1,262 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_MOLL_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_moll_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_moll m_proj_parm; + + inline base_moll_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + + + 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 + void setup(Parameters& par, par_moll& proj_parm, double p) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + 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 + void setup_moll(Parameters& par, par_moll& proj_parm) + { + setup(par, proj_parm, HALFPI); + } + + // Wagner IV + template + void setup_wag4(Parameters& par, par_moll& proj_parm) + { + setup(par, proj_parm, PI/3.); + } + + // Wagner V + template + void setup_wag5(Parameters& 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 detail::moll + #endif // doxygen + + /*! + \brief Mollweide projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_moll.gif + */ + template + struct moll_spheroid : public detail::moll::base_moll_spheroid + { + inline moll_spheroid(const Parameters& par) : detail::moll::base_moll_spheroid(par) + { + detail::moll::setup_moll(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Wagner IV projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_wag4.gif + */ + template + struct wag4_spheroid : public detail::moll::base_moll_spheroid + { + inline wag4_spheroid(const Parameters& par) : detail::moll::base_moll_spheroid(par) + { + detail::moll::setup_wag4(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Wagner V projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_wag5.gif + */ + template + struct wag5_spheroid : public detail::moll::base_moll_spheroid + { + inline wag5_spheroid(const Parameters& par) : detail::moll::base_moll_spheroid(par) + { + detail::moll::setup_wag5(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class moll_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class wag4_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class wag5_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void moll_init(detail::base_factory& factory) + { + factory.add_to_factory("moll", new moll_entry); + factory.add_to_factory("wag4", new wag4_entry); + factory.add_to_factory("wag5", new wag5_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_MOLL_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/nell.hpp b/include/boost/geometry/extensions/gis/projections/proj/nell.hpp new file mode 100644 index 000000000..91a39b06d --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/nell.hpp @@ -0,0 +1,154 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_NELL_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace nell{ + static const int MAX_ITER = 10; + static const double LOOP_TOL = 1e-7; + + + // template class, using CRTP to implement forward/inverse + template + struct base_nell_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_nell_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + + + lp_lon = 2. * xy_x / (1. + cos(xy_y)); + lp_lat = aasin(0.5 * (xy_y + sin(xy_y))); + } + }; + + // Nell + template + void setup_nell(Parameters& par) + { + par.es = 0; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::nell + #endif // doxygen + + /*! + \brief Nell projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_nell.gif + */ + template + struct nell_spheroid : public detail::nell::base_nell_spheroid + { + inline nell_spheroid(const Parameters& par) : detail::nell::base_nell_spheroid(par) + { + detail::nell::setup_nell(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class nell_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void nell_init(detail::base_factory& factory) + { + factory.add_to_factory("nell", new nell_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_NELL_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/nell_h.hpp b/include/boost/geometry/extensions/gis/projections/proj/nell_h.hpp new file mode 100644 index 000000000..c694c4df1 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/nell_h.hpp @@ -0,0 +1,153 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_NELL_H_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace nell_h{ + static const int NITER = 9; + static const double EPS = 1e-7; + + + // template class, using CRTP to implement forward/inverse + template + struct base_nell_h_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_nell_h_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_nell_h(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::nell_h + #endif // doxygen + + /*! + \brief Nell-Hammer projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_nell_h.gif + */ + template + struct nell_h_spheroid : public detail::nell_h::base_nell_h_spheroid + { + inline nell_h_spheroid(const Parameters& par) : detail::nell_h::base_nell_h_spheroid(par) + { + detail::nell_h::setup_nell_h(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class nell_h_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void nell_h_init(detail::base_factory& factory) + { + factory.add_to_factory("nell_h", new nell_h_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_NELL_H_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/nocol.hpp b/include/boost/geometry/extensions/gis/projections/proj/nocol.hpp new file mode 100644 index 000000000..e17c2d1e8 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/nocol.hpp @@ -0,0 +1,160 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_NOCOL_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace nocol{ + static const double EPS = 1e-10; + + + // template class, using CRTP to implement forward/inverse + template + struct base_nocol_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_nocol_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_nicol(Parameters& par) + { + par.es = 0.; + // par.fwd = s_forward; + } + + }} // namespace detail::nocol + #endif // doxygen + + /*! + \brief Nicolosi Globular projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_nicol.gif + */ + template + struct nicol_spheroid : public detail::nocol::base_nocol_spheroid + { + inline nicol_spheroid(const Parameters& par) : detail::nocol::base_nocol_spheroid(par) + { + detail::nocol::setup_nicol(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class nicol_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void nocol_init(detail::base_factory& factory) + { + factory.add_to_factory("nicol", new nicol_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_NOCOL_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/nsper.hpp b/include/boost/geometry/extensions/gis/projections/proj/nsper.hpp new file mode 100644 index 000000000..46e05e0ac --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/nsper.hpp @@ -0,0 +1,317 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_NSPER_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_nsper_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_nsper m_proj_parm; + + inline base_nsper_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 = boost::math::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 + void setup(Parameters& par, par_nsper& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(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 + void setup_nsper(Parameters& par, par_nsper& proj_parm) + { + proj_parm.tilt = 0; + setup(par, proj_parm); + } + + // Tilted perspective + template + void setup_tpers(Parameters& 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 detail::nsper + #endif // doxygen + + /*! + \brief Near-sided perspective projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - h= + \par Example + \image html ex_nsper.gif + */ + template + struct nsper_spheroid : public detail::nsper::base_nsper_spheroid + { + inline nsper_spheroid(const Parameters& par) : detail::nsper::base_nsper_spheroid(par) + { + detail::nsper::setup_nsper(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Tilted perspective projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - tilt= azi= h= + \par Example + \image html ex_tpers.gif + */ + template + struct tpers_spheroid : public detail::nsper::base_nsper_spheroid + { + inline tpers_spheroid(const Parameters& par) : detail::nsper::base_nsper_spheroid(par) + { + detail::nsper::setup_tpers(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class nsper_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class tpers_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void nsper_init(detail::base_factory& factory) + { + factory.add_to_factory("nsper", new nsper_entry); + factory.add_to_factory("tpers", new tpers_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_NSPER_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/nzmg.hpp b/include/boost/geometry/extensions/gis/projections/proj/nzmg.hpp new file mode 100644 index 000000000..cf2861afb --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/nzmg.hpp @@ -0,0 +1,196 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_NZMG_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_nzmg_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_nzmg_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_nzmg(Parameters& 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 detail::nzmg + #endif // doxygen + + /*! + \brief New Zealand Map Grid projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - fixed Earth + \par Example + \image html ex_nzmg.gif + */ + template + struct nzmg_ellipsoid : public detail::nzmg::base_nzmg_ellipsoid + { + inline nzmg_ellipsoid(const Parameters& par) : detail::nzmg::base_nzmg_ellipsoid(par) + { + detail::nzmg::setup_nzmg(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class nzmg_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void nzmg_init(detail::base_factory& factory) + { + factory.add_to_factory("nzmg", new nzmg_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_NZMG_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/ob_tran.hpp b/include/boost/geometry/extensions/gis/projections/proj/ob_tran.hpp new file mode 100644 index 000000000..1c1120c02 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/ob_tran.hpp @@ -0,0 +1,318 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_OB_TRAN_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + + template class factory; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace ob_tran{ + static const double TOL = 1e-10; + + template + struct par_ob_tran + { + boost::shared_ptr > link; + double lamp; + double cphip, sphip; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_ob_tran_oblique : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_ob_tran m_proj_parm; + + inline base_ob_tran_oblique(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + struct base_ob_tran_transverse : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_ob_tran m_proj_parm; + + inline base_ob_tran_transverse(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + double setup_ob_tran(Parameters& par, par_ob_tran& proj_parm, bool create = true) + { + int i; + double phip; + + + Parameters 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 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; + } + boost::ignore_unused_variable_warning(i); + // return phip to choose model + return phip; + } + + }} // namespace detail::ob_tran + #endif // doxygen + + /*! + \brief General Oblique Transformation projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters 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 + struct ob_tran_oblique : public detail::ob_tran::base_ob_tran_oblique + { + inline ob_tran_oblique(const Parameters& par) : detail::ob_tran::base_ob_tran_oblique(par) + { + detail::ob_tran::setup_ob_tran(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief General Oblique Transformation projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters 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 + struct ob_tran_transverse : public detail::ob_tran::base_ob_tran_transverse + { + inline ob_tran_transverse(const Parameters& par) : detail::ob_tran::base_ob_tran_transverse(par) + { + detail::ob_tran::setup_ob_tran(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class ob_tran_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + detail::ob_tran::par_ob_tran proj_parm; + Parameters p = par; + double phip = setup_ob_tran(p, proj_parm, false); + if (fabs(phip) > detail::ob_tran::TOL) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void ob_tran_init(detail::base_factory& factory) + { + factory.add_to_factory("ob_tran", new ob_tran_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_OB_TRAN_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/ocea.hpp b/include/boost/geometry/extensions/gis/projections/proj/ocea.hpp new file mode 100644 index 000000000..10b7fe456 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/ocea.hpp @@ -0,0 +1,189 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_OCEA_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_ocea_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_ocea m_proj_parm; + + inline base_ocea_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_ocea(Parameters& 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 detail::ocea + #endif // doxygen + + /*! + \brief Oblique Cylindrical Equal Area projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters 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 + struct ocea_spheroid : public detail::ocea::base_ocea_spheroid + { + inline ocea_spheroid(const Parameters& par) : detail::ocea::base_ocea_spheroid(par) + { + detail::ocea::setup_ocea(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class ocea_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void ocea_init(detail::base_factory& factory) + { + factory.add_to_factory("ocea", new ocea_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_OCEA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/oea.hpp b/include/boost/geometry/extensions/gis/projections/proj/oea.hpp new file mode 100644 index 000000000..ed3403f46 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/oea.hpp @@ -0,0 +1,181 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_OEA_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_oea_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_oea m_proj_parm; + + inline base_oea_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 * boost::math::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 + void setup_oea(Parameters& 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 detail::oea + #endif // doxygen + + /*! + \brief Oblated Equal Area projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - n= m= theta= + \par Example + \image html ex_oea.gif + */ + template + struct oea_spheroid : public detail::oea::base_oea_spheroid + { + inline oea_spheroid(const Parameters& par) : detail::oea::base_oea_spheroid(par) + { + detail::oea::setup_oea(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class oea_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void oea_init(detail::base_factory& factory) + { + factory.add_to_factory("oea", new oea_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_OEA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/omerc.hpp b/include/boost/geometry/extensions/gis/projections/proj/omerc.hpp new file mode 100644 index 000000000..f7526dfba --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/omerc.hpp @@ -0,0 +1,294 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_OMERC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_omerc_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_omerc m_proj_parm; + + inline base_omerc_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_omerc(Parameters& 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 detail::omerc + #endif // doxygen + + /*! + \brief Oblique Mercator projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters 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 + struct omerc_ellipsoid : public detail::omerc::base_omerc_ellipsoid + { + inline omerc_ellipsoid(const Parameters& par) : detail::omerc::base_omerc_ellipsoid(par) + { + detail::omerc::setup_omerc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class omerc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void omerc_init(detail::base_factory& factory) + { + factory.add_to_factory("omerc", new omerc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_OMERC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/ortho.hpp b/include/boost/geometry/extensions/gis/projections/proj/ortho.hpp new file mode 100644 index 000000000..3f7439e86 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/ortho.hpp @@ -0,0 +1,219 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ORTHO_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_ortho_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_ortho m_proj_parm; + + inline base_ortho_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double rh, cosc, sinc; + + if ((sinc = (rh = boost::math::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 + void setup_ortho(Parameters& 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 detail::ortho + #endif // doxygen + + /*! + \brief Orthographic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + \par Example + \image html ex_ortho.gif + */ + template + struct ortho_spheroid : public detail::ortho::base_ortho_spheroid + { + inline ortho_spheroid(const Parameters& par) : detail::ortho::base_ortho_spheroid(par) + { + detail::ortho::setup_ortho(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class ortho_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void ortho_init(detail::base_factory& factory) + { + factory.add_to_factory("ortho", new ortho_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ORTHO_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/poly.hpp b/include/boost/geometry/extensions/gis/projections/proj/poly.hpp new file mode 100644 index 000000000..78a4f8365 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/poly.hpp @@ -0,0 +1,266 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_POLY_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_poly_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_poly m_proj_parm; + + inline base_poly_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + struct base_poly_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_poly m_proj_parm; + + inline base_poly_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_poly(Parameters& 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 detail::poly + #endif // doxygen + + /*! + \brief Polyconic (American) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + \par Example + \image html ex_poly.gif + */ + template + struct poly_ellipsoid : public detail::poly::base_poly_ellipsoid + { + inline poly_ellipsoid(const Parameters& par) : detail::poly::base_poly_ellipsoid(par) + { + detail::poly::setup_poly(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Polyconic (American) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - Ellipsoid + \par Example + \image html ex_poly.gif + */ + template + struct poly_spheroid : public detail::poly::base_poly_spheroid + { + inline poly_spheroid(const Parameters& par) : detail::poly::base_poly_spheroid(par) + { + detail::poly::setup_poly(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class poly_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void poly_init(detail::base_factory& factory) + { + factory.add_to_factory("poly", new poly_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_POLY_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/putp2.hpp b/include/boost/geometry/extensions/gis/projections/proj/putp2.hpp new file mode 100644 index 000000000..1b2c12d8f --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/putp2.hpp @@ -0,0 +1,163 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_PUTP2_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_putp2_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_putp2_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_putp2(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::putp2 + #endif // doxygen + + /*! + \brief Putnins P2 projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp2.gif + */ + template + struct putp2_spheroid : public detail::putp2::base_putp2_spheroid + { + inline putp2_spheroid(const Parameters& par) : detail::putp2::base_putp2_spheroid(par) + { + detail::putp2::setup_putp2(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class putp2_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void putp2_init(detail::base_factory& factory) + { + factory.add_to_factory("putp2", new putp2_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_PUTP2_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/putp3.hpp b/include/boost/geometry/extensions/gis/projections/proj/putp3.hpp new file mode 100644 index 000000000..f8e45dcab --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/putp3.hpp @@ -0,0 +1,197 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_PUTP3_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_putp3_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_putp3 m_proj_parm; + + inline base_putp3_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lat = xy_y / C; + lp_lon = xy_x / (C * (1. - this->m_proj_parm.A * lp_lat * lp_lat)); + } + }; + + template + void setup(Parameters& par, par_putp3& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + + // Putnins P3 + template + void setup_putp3(Parameters& par, par_putp3& proj_parm) + { + proj_parm.A = 4. * RPISQ; + setup(par, proj_parm); + } + + // Putnins P3' + template + void setup_putp3p(Parameters& par, par_putp3& proj_parm) + { + proj_parm.A = 2. * RPISQ; + setup(par, proj_parm); + } + + }} // namespace detail::putp3 + #endif // doxygen + + /*! + \brief Putnins P3 projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp3.gif + */ + template + struct putp3_spheroid : public detail::putp3::base_putp3_spheroid + { + inline putp3_spheroid(const Parameters& par) : detail::putp3::base_putp3_spheroid(par) + { + detail::putp3::setup_putp3(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Putnins P3' projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - no inverse + - Spheroid + \par Example + \image html ex_putp3p.gif + */ + template + struct putp3p_spheroid : public detail::putp3::base_putp3_spheroid + { + inline putp3p_spheroid(const Parameters& par) : detail::putp3::base_putp3_spheroid(par) + { + detail::putp3::setup_putp3p(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class putp3_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class putp3p_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void putp3_init(detail::base_factory& factory) + { + factory.add_to_factory("putp3", new putp3_entry); + factory.add_to_factory("putp3p", new putp3p_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_PUTP3_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/putp4p.hpp b/include/boost/geometry/extensions/gis/projections/proj/putp4p.hpp new file mode 100644 index 000000000..e2876deb0 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/putp4p.hpp @@ -0,0 +1,201 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_PUTP4P_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace putp4p{ + + struct par_putp4p + { + double C_x, C_y; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_putp4p_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_putp4p m_proj_parm; + + inline base_putp4p_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup(Parameters& par, par_putp4p& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + + // Putnins P4' + template + void setup_putp4p(Parameters& par, par_putp4p& proj_parm) + { + proj_parm.C_x = 0.874038744; + proj_parm.C_y = 3.883251825; + setup(par, proj_parm); + } + + // Werenskiold I + template + void setup_weren(Parameters& par, par_putp4p& proj_parm) + { + proj_parm.C_x = 1.; + proj_parm.C_y = 4.442882938; + setup(par, proj_parm); + } + + }} // namespace detail::putp4p + #endif // doxygen + + /*! + \brief Putnins P4' projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp4p.gif + */ + template + struct putp4p_spheroid : public detail::putp4p::base_putp4p_spheroid + { + inline putp4p_spheroid(const Parameters& par) : detail::putp4p::base_putp4p_spheroid(par) + { + detail::putp4p::setup_putp4p(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Werenskiold I projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_weren.gif + */ + template + struct weren_spheroid : public detail::putp4p::base_putp4p_spheroid + { + inline weren_spheroid(const Parameters& par) : detail::putp4p::base_putp4p_spheroid(par) + { + detail::putp4p::setup_weren(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class putp4p_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class weren_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void putp4p_init(detail::base_factory& factory) + { + factory.add_to_factory("putp4p", new putp4p_entry); + factory.add_to_factory("weren", new weren_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_PUTP4P_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/putp5.hpp b/include/boost/geometry/extensions/gis/projections/proj/putp5.hpp new file mode 100644 index 000000000..ddb8c9974 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/putp5.hpp @@ -0,0 +1,198 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_PUTP5_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_putp5_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_putp5 m_proj_parm; + + inline base_putp5_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup(Parameters& par, par_putp5& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + + // Putnins P5 + template + void setup_putp5(Parameters& par, par_putp5& proj_parm) + { + proj_parm.A = 2.; + proj_parm.B = 1.; + setup(par, proj_parm); + } + + // Putnins P5' + template + void setup_putp5p(Parameters& par, par_putp5& proj_parm) + { + proj_parm.A = 1.5; + proj_parm.B = 0.5; + setup(par, proj_parm); + } + + }} // namespace detail::putp5 + #endif // doxygen + + /*! + \brief Putnins P5 projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp5.gif + */ + template + struct putp5_spheroid : public detail::putp5::base_putp5_spheroid + { + inline putp5_spheroid(const Parameters& par) : detail::putp5::base_putp5_spheroid(par) + { + detail::putp5::setup_putp5(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Putnins P5' projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp5p.gif + */ + template + struct putp5p_spheroid : public detail::putp5::base_putp5_spheroid + { + inline putp5p_spheroid(const Parameters& par) : detail::putp5::base_putp5_spheroid(par) + { + detail::putp5::setup_putp5p(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class putp5_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class putp5p_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void putp5_init(detail::base_factory& factory) + { + factory.add_to_factory("putp5", new putp5_entry); + factory.add_to_factory("putp5p", new putp5p_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_PUTP5_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/putp6.hpp b/include/boost/geometry/extensions/gis/projections/proj/putp6.hpp new file mode 100644 index 000000000..f456c8e99 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/putp6.hpp @@ -0,0 +1,223 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_PUTP6_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_putp6_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_putp6 m_proj_parm; + + inline base_putp6_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup(Parameters& par, par_putp6& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + + // Putnins P6 + template + void setup_putp6(Parameters& 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 + void setup_putp6p(Parameters& 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 detail::putp6 + #endif // doxygen + + /*! + \brief Putnins P6 projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp6.gif + */ + template + struct putp6_spheroid : public detail::putp6::base_putp6_spheroid + { + inline putp6_spheroid(const Parameters& par) : detail::putp6::base_putp6_spheroid(par) + { + detail::putp6::setup_putp6(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Putnins P6' projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_putp6p.gif + */ + template + struct putp6p_spheroid : public detail::putp6::base_putp6_spheroid + { + inline putp6p_spheroid(const Parameters& par) : detail::putp6::base_putp6_spheroid(par) + { + detail::putp6::setup_putp6p(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class putp6_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class putp6p_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void putp6_init(detail::base_factory& factory) + { + factory.add_to_factory("putp6", new putp6_entry); + factory.add_to_factory("putp6p", new putp6p_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_PUTP6_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/robin.hpp b/include/boost/geometry/extensions/gis/projections/proj/robin.hpp new file mode 100644 index 000000000..4b137a7c8 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/robin.hpp @@ -0,0 +1,232 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ROBIN_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 { + double 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 + struct base_robin_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_robin_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline double V(COEFS const& C, double z) const + { return (C.c0 + z * (C.c1 + z * (C.c2 + z * C.c3))); } + inline double DV(COEFS const& C, double z) const + { return (C.c1 + z * (C.c2 + C.c2 + z * 3. * C.c3)); } + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_robin(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::robin + #endif // doxygen + + /*! + \brief Robinson projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_robin.gif + */ + template + struct robin_spheroid : public detail::robin::base_robin_spheroid + { + inline robin_spheroid(const Parameters& par) : detail::robin::base_robin_spheroid(par) + { + detail::robin::setup_robin(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class robin_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void robin_init(detail::base_factory& factory) + { + factory.add_to_factory("robin", new robin_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ROBIN_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/rouss.hpp b/include/boost/geometry/extensions/gis/projections/proj/rouss.hpp new file mode 100644 index 000000000..7120f21cd --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/rouss.hpp @@ -0,0 +1,211 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_ROUSS_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_rouss_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_rouss m_proj_parm; + + inline base_rouss_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_rouss(Parameters& 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 detail::rouss + #endif // doxygen + + /*! + \brief Roussilhe Stereographic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Ellps + \par Example + \image html ex_rouss.gif + */ + template + struct rouss_ellipsoid : public detail::rouss::base_rouss_ellipsoid + { + inline rouss_ellipsoid(const Parameters& par) : detail::rouss::base_rouss_ellipsoid(par) + { + detail::rouss::setup_rouss(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class rouss_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void rouss_init(detail::base_factory& factory) + { + factory.add_to_factory("rouss", new rouss_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_ROUSS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/rpoly.hpp b/include/boost/geometry/extensions/gis/projections/proj/rpoly.hpp new file mode 100644 index 000000000..5f807a0ee --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/rpoly.hpp @@ -0,0 +1,158 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_RPOLY_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_rpoly_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_rpoly m_proj_parm; + + inline base_rpoly_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_rpoly(Parameters& 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 detail::rpoly + #endif // doxygen + + /*! + \brief Rectangular Polyconic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - no inverse + - lat_ts= + \par Example + \image html ex_rpoly.gif + */ + template + struct rpoly_spheroid : public detail::rpoly::base_rpoly_spheroid + { + inline rpoly_spheroid(const Parameters& par) : detail::rpoly::base_rpoly_spheroid(par) + { + detail::rpoly::setup_rpoly(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class rpoly_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void rpoly_init(detail::base_factory& factory) + { + factory.add_to_factory("rpoly", new rpoly_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_RPOLY_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/sconics.hpp b/include/boost/geometry/extensions/gis/projections/proj/sconics.hpp new file mode 100644 index 000000000..7760a39d4 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/sconics.hpp @@ -0,0 +1,512 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_SCONICS_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + inline int + phi12(Parameters& 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 + struct base_sconics_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_sconics m_proj_parm; + + inline base_sconics_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double rho; + + rho = boost::math::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 + void setup(Parameters& par, par_sconics& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(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 + void setup_tissot(Parameters& par, par_sconics& proj_parm) + { + proj_parm.type = TISSOT; + setup(par, proj_parm); + } + + // Murdoch I + template + void setup_murd1(Parameters& par, par_sconics& proj_parm) + { + proj_parm.type = MURD1; + setup(par, proj_parm); + } + + // Murdoch II + template + void setup_murd2(Parameters& par, par_sconics& proj_parm) + { + proj_parm.type = MURD2; + setup(par, proj_parm); + } + + // Murdoch III + template + void setup_murd3(Parameters& par, par_sconics& proj_parm) + { + proj_parm.type = MURD3; + setup(par, proj_parm); + } + + // Euler + template + void setup_euler(Parameters& par, par_sconics& proj_parm) + { + proj_parm.type = EULER; + setup(par, proj_parm); + } + + // Perspective Conic + template + void setup_pconic(Parameters& par, par_sconics& proj_parm) + { + proj_parm.type = PCONIC; + setup(par, proj_parm); + } + + // Vitkovsky I + template + void setup_vitk1(Parameters& par, par_sconics& proj_parm) + { + proj_parm.type = VITK1; + setup(par, proj_parm); + } + + }} // namespace detail::sconics + #endif // doxygen + + /*! + \brief Tissot projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - lat_1= and lat_2= + \par Example + \image html ex_tissot.gif + */ + template + struct tissot_spheroid : public detail::sconics::base_sconics_spheroid + { + inline tissot_spheroid(const Parameters& par) : detail::sconics::base_sconics_spheroid(par) + { + detail::sconics::setup_tissot(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Murdoch I projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - lat_1= and lat_2= + \par Example + \image html ex_murd1.gif + */ + template + struct murd1_spheroid : public detail::sconics::base_sconics_spheroid + { + inline murd1_spheroid(const Parameters& par) : detail::sconics::base_sconics_spheroid(par) + { + detail::sconics::setup_murd1(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Murdoch II projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - lat_1= and lat_2= + \par Example + \image html ex_murd2.gif + */ + template + struct murd2_spheroid : public detail::sconics::base_sconics_spheroid + { + inline murd2_spheroid(const Parameters& par) : detail::sconics::base_sconics_spheroid(par) + { + detail::sconics::setup_murd2(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Murdoch III projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - lat_1= and lat_2= + \par Example + \image html ex_murd3.gif + */ + template + struct murd3_spheroid : public detail::sconics::base_sconics_spheroid + { + inline murd3_spheroid(const Parameters& par) : detail::sconics::base_sconics_spheroid(par) + { + detail::sconics::setup_murd3(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Euler projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - lat_1= and lat_2= + \par Example + \image html ex_euler.gif + */ + template + struct euler_spheroid : public detail::sconics::base_sconics_spheroid + { + inline euler_spheroid(const Parameters& par) : detail::sconics::base_sconics_spheroid(par) + { + detail::sconics::setup_euler(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Perspective Conic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - lat_1= and lat_2= + \par Example + \image html ex_pconic.gif + */ + template + struct pconic_spheroid : public detail::sconics::base_sconics_spheroid + { + inline pconic_spheroid(const Parameters& par) : detail::sconics::base_sconics_spheroid(par) + { + detail::sconics::setup_pconic(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Vitkovsky I projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Conic + - Spheroid + - lat_1= and lat_2= + \par Example + \image html ex_vitk1.gif + */ + template + struct vitk1_spheroid : public detail::sconics::base_sconics_spheroid + { + inline vitk1_spheroid(const Parameters& par) : detail::sconics::base_sconics_spheroid(par) + { + detail::sconics::setup_vitk1(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class tissot_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class murd1_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class murd2_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class murd3_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class euler_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class pconic_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class vitk1_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void sconics_init(detail::base_factory& factory) + { + factory.add_to_factory("tissot", new tissot_entry); + factory.add_to_factory("murd1", new murd1_entry); + factory.add_to_factory("murd2", new murd2_entry); + factory.add_to_factory("murd3", new murd3_entry); + factory.add_to_factory("euler", new euler_entry); + factory.add_to_factory("pconic", new pconic_entry); + factory.add_to_factory("vitk1", new vitk1_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_SCONICS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/somerc.hpp b/include/boost/geometry/extensions/gis/projections/proj/somerc.hpp new file mode 100644 index 000000000..5b5b5da3e --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/somerc.hpp @@ -0,0 +1,188 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_SOMERC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_somerc_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_somerc m_proj_parm; + + inline base_somerc_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_somerc(Parameters& 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 detail::somerc + #endif // doxygen + + /*! + \brief Swiss. Obl. Mercator projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Ellipsoid + - For CH1903 + \par Example + \image html ex_somerc.gif + */ + template + struct somerc_ellipsoid : public detail::somerc::base_somerc_ellipsoid + { + inline somerc_ellipsoid(const Parameters& par) : detail::somerc::base_somerc_ellipsoid(par) + { + detail::somerc::setup_somerc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class somerc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void somerc_init(detail::base_factory& factory) + { + factory.add_to_factory("somerc", new somerc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_SOMERC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/stere.hpp b/include/boost/geometry/extensions/gis/projections/proj/stere.hpp new file mode 100644 index 000000000..bdcfebc97 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/stere.hpp @@ -0,0 +1,451 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_STERE_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_stere_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_stere m_proj_parm; + + inline base_stere_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double cosphi, sinphi, tp=0.0, phi_l=0.0, rho, halfe=0.0, halfpi=0.0; + int i; + + rho = boost::math::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 + struct base_stere_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_stere m_proj_parm; + + inline base_stere_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double c, rh, sinc, cosc; + + sinc = sin(c = 2. * atan((rh = boost::math::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 + void setup(Parameters& par, par_stere& proj_parm) /* general initialization */ + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + 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 + void setup_stere(Parameters& 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 + void setup_ups(Parameters& 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 detail::stere + #endif // doxygen + + /*! + \brief Stereographic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - lat_ts= + \par Example + \image html ex_stere.gif + */ + template + struct stere_ellipsoid : public detail::stere::base_stere_ellipsoid + { + inline stere_ellipsoid(const Parameters& par) : detail::stere::base_stere_ellipsoid(par) + { + detail::stere::setup_stere(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Universal Polar Stereographic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - south + \par Example + \image html ex_ups.gif + */ + template + struct ups_ellipsoid : public detail::stere::base_stere_ellipsoid + { + inline ups_ellipsoid(const Parameters& par) : detail::stere::base_stere_ellipsoid(par) + { + detail::stere::setup_ups(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Stereographic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + - lat_ts= + \par Example + \image html ex_stere.gif + */ + template + struct stere_spheroid : public detail::stere::base_stere_spheroid + { + inline stere_spheroid(const Parameters& par) : detail::stere::base_stere_spheroid(par) + { + detail::stere::setup_stere(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class stere_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class ups_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void stere_init(detail::base_factory& factory) + { + factory.add_to_factory("stere", new stere_entry); + factory.add_to_factory("ups", new ups_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_STERE_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/sterea.hpp b/include/boost/geometry/extensions/gis/projections/proj/sterea.hpp new file mode 100644 index 000000000..68779758c --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/sterea.hpp @@ -0,0 +1,381 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_STEREA_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_sterea_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_sterea m_proj_parm; + + inline base_sterea_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + double cosc, sinc, cosl, k; + + detail::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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double rho, c, sinc, cosc; + + xy_x /= this->m_par.k0; + xy_y /= this->m_par.k0; + if((rho = boost::math::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.; + } + detail::gauss::inv_gauss(m_proj_parm.en, lp_lon, lp_lat); + } + }; + + // Oblique Stereographic Alternative + template + void setup_sterea(Parameters& par, par_sterea& proj_parm) + { + double R; + proj_parm.en = detail::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 detail::sterea + #endif // doxygen + + /*! + \brief Oblique Stereographic Alternative projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Azimuthal + - Spheroid + - Ellipsoid + \par Example + \image html ex_sterea.gif + */ + template + struct sterea_ellipsoid : public detail::sterea::base_sterea_ellipsoid + { + inline sterea_ellipsoid(const Parameters& par) : detail::sterea::base_sterea_ellipsoid(par) + { + detail::sterea::setup_sterea(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class sterea_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void sterea_init(detail::base_factory& factory) + { + factory.add_to_factory("sterea", new sterea_entry); + } + + } // namespace detail + // Create EPSG specializations + // (Proof of Concept, only for some) + + template + struct epsg_traits<2036, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2171, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2172, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2173, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2174, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2200, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2290, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2291, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2292, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2953, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<2954, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<3120, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<3328, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<22780, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<28991, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<28992, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<31600, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + struct epsg_traits<31700, LatLongRadian, Cartesian, Parameters> + { + typedef sterea_ellipsoid 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 + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_STEREA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/sts.hpp b/include/boost/geometry/extensions/gis/projections/proj/sts.hpp new file mode 100644 index 000000000..c6e955724 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/sts.hpp @@ -0,0 +1,294 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_STS_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace sts{ + + struct par_sts + { + double C_x, C_y, C_p; + int tan_mode; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_sts_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_sts m_proj_parm; + + inline base_sts_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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)); + if (this->m_proj_parm.tan_mode) + lp_lon /= c * c; + else + lp_lon *= c; + } + }; + + template + void setup(Parameters& par, par_sts& proj_parm, double p, double q, int mode) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(proj_parm); + 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 + void setup_kav5(Parameters& par, par_sts& proj_parm) + { + setup(par, proj_parm, 1.50488, 1.35439, 0); + } + + // Quartic Authalic + template + void setup_qua_aut(Parameters& par, par_sts& proj_parm) + { + setup(par, proj_parm, 2., 2., 0); + } + + // McBryde-Thomas Flat-Polar Sine (No. 1) + template + void setup_mbt_s(Parameters& par, par_sts& proj_parm) + { + setup(par, proj_parm, 1.48875, 1.36509, 0); + } + + // Foucaut + template + void setup_fouc(Parameters& par, par_sts& proj_parm) + { + setup(par, proj_parm, 2., 2., 1); + } + + }} // namespace detail::sts + #endif // doxygen + + /*! + \brief Kavraisky V projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_kav5.gif + */ + template + struct kav5_spheroid : public detail::sts::base_sts_spheroid + { + inline kav5_spheroid(const Parameters& par) : detail::sts::base_sts_spheroid(par) + { + detail::sts::setup_kav5(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Quartic Authalic projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_qua_aut.gif + */ + template + struct qua_aut_spheroid : public detail::sts::base_sts_spheroid + { + inline qua_aut_spheroid(const Parameters& par) : detail::sts::base_sts_spheroid(par) + { + detail::sts::setup_qua_aut(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief McBryde-Thomas Flat-Polar Sine (No. 1) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_mbt_s.gif + */ + template + struct mbt_s_spheroid : public detail::sts::base_sts_spheroid + { + inline mbt_s_spheroid(const Parameters& par) : detail::sts::base_sts_spheroid(par) + { + detail::sts::setup_mbt_s(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Foucaut projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_fouc.gif + */ + template + struct fouc_spheroid : public detail::sts::base_sts_spheroid + { + inline fouc_spheroid(const Parameters& par) : detail::sts::base_sts_spheroid(par) + { + detail::sts::setup_fouc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class kav5_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class qua_aut_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class mbt_s_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class fouc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void sts_init(detail::base_factory& factory) + { + factory.add_to_factory("kav5", new kav5_entry); + factory.add_to_factory("qua_aut", new qua_aut_entry); + factory.add_to_factory("mbt_s", new mbt_s_entry); + factory.add_to_factory("fouc", new fouc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_STS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/tcc.hpp b/include/boost/geometry/extensions/gis/projections/proj/tcc.hpp new file mode 100644 index 000000000..07a72a927 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/tcc.hpp @@ -0,0 +1,142 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_TCC_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace tcc{ + static const double EPS10 = 1.e-10; + + struct par_tcc + { + double ap; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_tcc_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_tcc m_proj_parm; + + inline base_tcc_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_tcc(Parameters& par, par_tcc& proj_parm) + { + par.es = 0.; + // par.fwd = s_forward; + } + + }} // namespace detail::tcc + #endif // doxygen + + /*! + \brief Transverse Central Cylindrical projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - no inverse + \par Example + \image html ex_tcc.gif + */ + template + struct tcc_spheroid : public detail::tcc::base_tcc_spheroid + { + inline tcc_spheroid(const Parameters& par) : detail::tcc::base_tcc_spheroid(par) + { + detail::tcc::setup_tcc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class tcc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void tcc_init(detail::base_factory& factory) + { + factory.add_to_factory("tcc", new tcc_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_TCC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/tcea.hpp b/include/boost/geometry/extensions/gis/projections/proj/tcea.hpp new file mode 100644 index 000000000..c228a213c --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/tcea.hpp @@ -0,0 +1,149 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_TCEA_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace tcea{ + + struct par_tcea + { + double rk0; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_tcea_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_tcea m_proj_parm; + + inline base_tcea_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_tcea(Parameters& par, par_tcea& proj_parm) + { + proj_parm.rk0 = 1 / par.k0; + // par.inv = s_inverse; + // par.fwd = s_forward; + par.es = 0.; + } + + }} // namespace detail::tcea + #endif // doxygen + + /*! + \brief Transverse Cylindrical Equal Area projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + \par Example + \image html ex_tcea.gif + */ + template + struct tcea_spheroid : public detail::tcea::base_tcea_spheroid + { + inline tcea_spheroid(const Parameters& par) : detail::tcea::base_tcea_spheroid(par) + { + detail::tcea::setup_tcea(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class tcea_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void tcea_init(detail::base_factory& factory) + { + factory.add_to_factory("tcea", new tcea_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_TCEA_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/tmerc.hpp b/include/boost/geometry/extensions/gis/projections/proj/tmerc.hpp new file mode 100644 index 000000000..8b758d1e2 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/tmerc.hpp @@ -0,0 +1,458 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_TMERC_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_tmerc_ellipsoid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_tmerc m_proj_parm; + + inline base_tmerc_ellipsoid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + struct base_tmerc_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_tmerc m_proj_parm; + + inline base_tmerc_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup(Parameters& par, par_tmerc& proj_parm) /* general initialization */ + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(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); + 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 + void setup_tmerc(Parameters& par, par_tmerc& proj_parm) + { + setup(par, proj_parm); + } + + // Universal Transverse Mercator (UTM) + template + void setup_utm(Parameters& 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 detail::tmerc + #endif // doxygen + + /*! + \brief Transverse Mercator projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + \par Example + \image html ex_tmerc.gif + */ + template + struct tmerc_ellipsoid : public detail::tmerc::base_tmerc_ellipsoid + { + inline tmerc_ellipsoid(const Parameters& par) : detail::tmerc::base_tmerc_ellipsoid(par) + { + detail::tmerc::setup_tmerc(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Universal Transverse Mercator (UTM) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - zone= south + \par Example + \image html ex_utm.gif + */ + template + struct utm_ellipsoid : public detail::tmerc::base_tmerc_ellipsoid + { + inline utm_ellipsoid(const Parameters& par) : detail::tmerc::base_tmerc_ellipsoid(par) + { + detail::tmerc::setup_utm(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Transverse Mercator projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Cylindrical + - Spheroid + - Ellipsoid + \par Example + \image html ex_tmerc.gif + */ + template + struct tmerc_spheroid : public detail::tmerc::base_tmerc_spheroid + { + inline tmerc_spheroid(const Parameters& par) : detail::tmerc::base_tmerc_spheroid(par) + { + detail::tmerc::setup_tmerc(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class tmerc_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + if (par.es) + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + else + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class utm_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void tmerc_init(detail::base_factory& factory) + { + factory.add_to_factory("tmerc", new tmerc_entry); + factory.add_to_factory("utm", new utm_entry); + } + + } // namespace detail + // Create EPSG specializations + // (Proof of Concept, only for some) + + template + struct epsg_traits<2000, LatLongRadian, Cartesian, Parameters> + { + typedef tmerc_ellipsoid 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 + struct epsg_traits<2001, LatLongRadian, Cartesian, Parameters> + { + typedef tmerc_ellipsoid 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 + struct epsg_traits<2002, LatLongRadian, Cartesian, Parameters> + { + typedef tmerc_ellipsoid 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 + struct epsg_traits<2003, LatLongRadian, Cartesian, Parameters> + { + typedef tmerc_ellipsoid 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 + struct epsg_traits<2039, LatLongRadian, Cartesian, Parameters> + { + typedef tmerc_ellipsoid 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 + struct epsg_traits<29118, LatLongRadian, Cartesian, Parameters> + { + typedef utm_ellipsoid type; + static inline std::string par() + { + return "+proj=utm +zone=18 +ellps=GRS67 +units=m"; + } + }; + + + template + struct epsg_traits<29119, LatLongRadian, Cartesian, Parameters> + { + typedef utm_ellipsoid type; + static inline std::string par() + { + return "+proj=utm +zone=19 +ellps=GRS67 +units=m"; + } + }; + + + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_TMERC_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/tpeqd.hpp b/include/boost/geometry/extensions/gis/projections/proj/tpeqd.hpp new file mode 100644 index 000000000..c2e8260b7 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/tpeqd.hpp @@ -0,0 +1,198 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_TPEQD_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_tpeqd_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_tpeqd m_proj_parm; + + inline base_tpeqd_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + double cz1, cz2, s, d, cp, sp; + + cz1 = cos(boost::math::hypot(xy_y, xy_x + this->m_proj_parm.hz0)); + cz2 = cos(boost::math::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(boost::math::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 + void setup_tpeqd(Parameters& 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 detail::tpeqd + #endif // doxygen + + /*! + \brief Two Point Equidistant projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - lat_1= lon_1= lat_2= lon_2= + \par Example + \image html ex_tpeqd.gif + */ + template + struct tpeqd_spheroid : public detail::tpeqd::base_tpeqd_spheroid + { + inline tpeqd_spheroid(const Parameters& par) : detail::tpeqd::base_tpeqd_spheroid(par) + { + detail::tpeqd::setup_tpeqd(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class tpeqd_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void tpeqd_init(detail::base_factory& factory) + { + factory.add_to_factory("tpeqd", new tpeqd_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_TPEQD_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/urm5.hpp b/include/boost/geometry/extensions/gis/projections/proj/urm5.hpp new file mode 100644 index 000000000..c7d43d2ac --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/urm5.hpp @@ -0,0 +1,149 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_URM5_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace urm5{ + + struct par_urm5 + { + double m, rmn, q3, n; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_urm5_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_urm5 m_proj_parm; + + inline base_urm5_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_urm5(Parameters& 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 detail::urm5 + #endif // doxygen + + /*! + \brief Urmaev V projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - n= q= alphi= + \par Example + \image html ex_urm5.gif + */ + template + struct urm5_spheroid : public detail::urm5::base_urm5_spheroid + { + inline urm5_spheroid(const Parameters& par) : detail::urm5::base_urm5_spheroid(par) + { + detail::urm5::setup_urm5(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class urm5_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void urm5_init(detail::base_factory& factory) + { + factory.add_to_factory("urm5", new urm5_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_URM5_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/urmfps.hpp b/include/boost/geometry/extensions/gis/projections/proj/urmfps.hpp new file mode 100644 index 000000000..5ded2c75e --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/urmfps.hpp @@ -0,0 +1,205 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_URMFPS_HPP +#define BOOST_GEOMETRY_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 +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_urmfps_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_urmfps m_proj_parm; + + inline base_urmfps_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup(Parameters& par, par_urmfps& proj_parm) + { + boost::ignore_unused_variable_warning(par); + boost::ignore_unused_variable_warning(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 + void setup_urmfps(Parameters& 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 + void setup_wag1(Parameters& par, par_urmfps& proj_parm) + { + proj_parm.n = 0.8660254037844386467637231707; + setup(par, proj_parm); + } + + }} // namespace detail::urmfps + #endif // doxygen + + /*! + \brief Urmaev Flat-Polar Sinusoidal projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - n= + \par Example + \image html ex_urmfps.gif + */ + template + struct urmfps_spheroid : public detail::urmfps::base_urmfps_spheroid + { + inline urmfps_spheroid(const Parameters& par) : detail::urmfps::base_urmfps_spheroid(par) + { + detail::urmfps::setup_urmfps(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief Wagner I (Kavraisky VI) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_wag1.gif + */ + template + struct wag1_spheroid : public detail::urmfps::base_urmfps_spheroid + { + inline wag1_spheroid(const Parameters& par) : detail::urmfps::base_urmfps_spheroid(par) + { + detail::urmfps::setup_wag1(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class urmfps_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class wag1_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void urmfps_init(detail::base_factory& factory) + { + factory.add_to_factory("urmfps", new urmfps_entry); + factory.add_to_factory("wag1", new wag1_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_URMFPS_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/vandg.hpp b/include/boost/geometry/extensions/gis/projections/proj/vandg.hpp new file mode 100644 index 000000000..ffdcc3297 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/vandg.hpp @@ -0,0 +1,201 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_VANDG_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_vandg_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_vandg_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_vandg(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::vandg + #endif // doxygen + + /*! + \brief van der Grinten (I) projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + \par Example + \image html ex_vandg.gif + */ + template + struct vandg_spheroid : public detail::vandg::base_vandg_spheroid + { + inline vandg_spheroid(const Parameters& par) : detail::vandg::base_vandg_spheroid(par) + { + detail::vandg::setup_vandg(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class vandg_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void vandg_init(detail::base_factory& factory) + { + factory.add_to_factory("vandg", new vandg_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_VANDG_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/vandg2.hpp b/include/boost/geometry/extensions/gis/projections/proj/vandg2.hpp new file mode 100644 index 000000000..a67faf291 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/vandg2.hpp @@ -0,0 +1,205 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_VANDG2_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_vandg2_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_vandg2 m_proj_parm; + + inline base_vandg2_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_vandg2(Parameters& par, par_vandg2& proj_parm) + { + proj_parm.vdg3 = 0; + // par.inv = 0; + // par.fwd = s_forward; + } + + // van der Grinten III + template + void setup_vandg3(Parameters& par, par_vandg2& proj_parm) + { + proj_parm.vdg3 = 1; + par.es = 0.; + // par.fwd = s_forward; + } + + }} // namespace detail::vandg2 + #endif // doxygen + + /*! + \brief van der Grinten II projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_vandg2.gif + */ + template + struct vandg2_spheroid : public detail::vandg2::base_vandg2_spheroid + { + inline vandg2_spheroid(const Parameters& par) : detail::vandg2::base_vandg2_spheroid(par) + { + detail::vandg2::setup_vandg2(this->m_par, this->m_proj_parm); + } + }; + + /*! + \brief van der Grinten III projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_vandg3.gif + */ + template + struct vandg3_spheroid : public detail::vandg2::base_vandg2_spheroid + { + inline vandg3_spheroid(const Parameters& par) : detail::vandg2::base_vandg2_spheroid(par) + { + detail::vandg2::setup_vandg3(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class vandg2_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + class vandg3_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void vandg2_init(detail::base_factory& factory) + { + factory.add_to_factory("vandg2", new vandg2_entry); + factory.add_to_factory("vandg3", new vandg3_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_VANDG2_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/vandg4.hpp b/include/boost/geometry/extensions/gis/projections/proj/vandg4.hpp new file mode 100644 index 000000000..981e6a4b6 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/vandg4.hpp @@ -0,0 +1,163 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_VANDG4_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace vandg4{ + static const double TOL = 1e-10; + static const double TWORPI = 0.63661977236758134308; + + + // template class, using CRTP to implement forward/inverse + template + struct base_vandg4_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_vandg4_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_vandg4(Parameters& par) + { + par.es = 0.; + // par.fwd = s_forward; + } + + }} // namespace detail::vandg4 + #endif // doxygen + + /*! + \brief van der Grinten IV projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_vandg4.gif + */ + template + struct vandg4_spheroid : public detail::vandg4::base_vandg4_spheroid + { + inline vandg4_spheroid(const Parameters& par) : detail::vandg4::base_vandg4_spheroid(par) + { + detail::vandg4::setup_vandg4(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class vandg4_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void vandg4_init(detail::base_factory& factory) + { + factory.add_to_factory("vandg4", new vandg4_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_VANDG4_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/wag2.hpp b/include/boost/geometry/extensions/gis/projections/proj/wag2.hpp new file mode 100644 index 000000000..795bbe582 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/wag2.hpp @@ -0,0 +1,144 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_WAG2_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_wag2_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_wag2_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& 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 + void setup_wag2(Parameters& par) + { + par.es = 0.; + // par.inv = s_inverse; + // par.fwd = s_forward; + } + + }} // namespace detail::wag2 + #endif // doxygen + + /*! + \brief Wagner II projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + \par Example + \image html ex_wag2.gif + */ + template + struct wag2_spheroid : public detail::wag2::base_wag2_spheroid + { + inline wag2_spheroid(const Parameters& par) : detail::wag2::base_wag2_spheroid(par) + { + detail::wag2::setup_wag2(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class wag2_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void wag2_init(detail::base_factory& factory) + { + factory.add_to_factory("wag2", new wag2_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_WAG2_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/wag3.hpp b/include/boost/geometry/extensions/gis/projections/proj/wag3.hpp new file mode 100644 index 000000000..3aaad07d9 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/wag3.hpp @@ -0,0 +1,148 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_WAG3_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace wag3{ + static const double TWOTHIRD = 0.6666666666666666666667; + + struct par_wag3 + { + double C_x; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_wag3_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_wag3 m_proj_parm; + + inline base_wag3_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = this->m_proj_parm.C_x * lp_lon * cos(TWOTHIRD * lp_lat); + xy_y = lp_lat; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lat = xy_y; + lp_lon = xy_x / (this->m_proj_parm.C_x * cos(TWOTHIRD * lp_lat)); + } + }; + + // Wagner III + template + void setup_wag3(Parameters& 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 detail::wag3 + #endif // doxygen + + /*! + \brief Wagner III projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - lat_ts= + \par Example + \image html ex_wag3.gif + */ + template + struct wag3_spheroid : public detail::wag3::base_wag3_spheroid + { + inline wag3_spheroid(const Parameters& par) : detail::wag3::base_wag3_spheroid(par) + { + detail::wag3::setup_wag3(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class wag3_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void wag3_init(detail::base_factory& factory) + { + factory.add_to_factory("wag3", new wag3_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_WAG3_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/wag7.hpp b/include/boost/geometry/extensions/gis/projections/proj/wag7.hpp new file mode 100644 index 000000000..2878a275c --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/wag7.hpp @@ -0,0 +1,137 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_WAG7_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace wag7{ + + + // template class, using CRTP to implement forward/inverse + template + struct base_wag7_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + + inline base_wag7_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_wag7(Parameters& par) + { + // par.fwd = s_forward; + // par.inv = 0; + par.es = 0.; + } + + }} // namespace detail::wag7 + #endif // doxygen + + /*! + \brief Wagner VII projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Miscellaneous + - Spheroid + - no inverse + \par Example + \image html ex_wag7.gif + */ + template + struct wag7_spheroid : public detail::wag7::base_wag7_spheroid + { + inline wag7_spheroid(const Parameters& par) : detail::wag7::base_wag7_spheroid(par) + { + detail::wag7::setup_wag7(this->m_par); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class wag7_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void wag7_init(detail::base_factory& factory) + { + factory.add_to_factory("wag7", new wag7_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_WAG7_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/wink1.hpp b/include/boost/geometry/extensions/gis/projections/proj/wink1.hpp new file mode 100644 index 000000000..2c506552b --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/wink1.hpp @@ -0,0 +1,145 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_WINK1_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { namespace wink1{ + + struct par_wink1 + { + double cosphi1; + }; + + // template class, using CRTP to implement forward/inverse + template + struct base_wink1_spheroid : public base_t_fi, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_wink1 m_proj_parm; + + inline base_wink1_spheroid(const Parameters& par) + : base_t_fi, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const + { + xy_x = .5 * lp_lon * (this->m_proj_parm.cosphi1 + cos(lp_lat)); + xy_y = lp_lat; + } + + inline void inv(cartesian_type& xy_x, cartesian_type& xy_y, geographic_type& lp_lon, geographic_type& lp_lat) const + { + lp_lat = xy_y; + lp_lon = 2. * xy_x / (this->m_proj_parm.cosphi1 + cos(lp_lat)); + } + }; + + // Winkel I + template + void setup_wink1(Parameters& 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 detail::wink1 + #endif // doxygen + + /*! + \brief Winkel I projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - lat_ts= + \par Example + \image html ex_wink1.gif + */ + template + struct wink1_spheroid : public detail::wink1::base_wink1_spheroid + { + inline wink1_spheroid(const Parameters& par) : detail::wink1::base_wink1_spheroid(par) + { + detail::wink1::setup_wink1(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class wink1_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_fi, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void wink1_init(detail::base_factory& factory) + { + factory.add_to_factory("wink1", new wink1_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_WINK1_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/proj/wink2.hpp b/include/boost/geometry/extensions/gis/projections/proj/wink2.hpp new file mode 100644 index 000000000..f1c650363 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/proj/wink2.hpp @@ -0,0 +1,159 @@ +#ifndef BOOST_GEOMETRY_PROJECTIONS_WINK2_HPP +#define BOOST_GEOMETRY_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 + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace projection +{ + #ifndef DOXYGEN_NO_DETAIL + namespace detail { 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 + struct base_wink2_spheroid : public base_t_f, + Geographic, Cartesian, Parameters> + { + + typedef double geographic_type; + typedef double cartesian_type; + + par_wink2 m_proj_parm; + + inline base_wink2_spheroid(const Parameters& par) + : base_t_f, + Geographic, Cartesian, Parameters>(*this, par) {} + + inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& 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 + void setup_wink2(Parameters& 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 detail::wink2 + #endif // doxygen + + /*! + \brief Winkel II projection + \ingroup projections + \tparam Geographic latlong point type + \tparam Cartesian xy point type + \tparam Parameters parameter type + \par Projection characteristics + - Pseudocylindrical + - Spheroid + - no inverse + - lat_1= + \par Example + \image html ex_wink2.gif + */ + template + struct wink2_spheroid : public detail::wink2::base_wink2_spheroid + { + inline wink2_spheroid(const Parameters& par) : detail::wink2::base_wink2_spheroid(par) + { + detail::wink2::setup_wink2(this->m_par, this->m_proj_parm); + } + }; + + #ifndef DOXYGEN_NO_DETAIL + namespace detail + { + + // Factory entry(s) + template + class wink2_entry : public detail::factory_entry + { + public : + virtual projection* create_new(const Parameters& par) const + { + return new base_v_f, Geographic, Cartesian, Parameters>(par); + } + }; + + template + inline void wink2_init(detail::base_factory& factory) + { + factory.add_to_factory("wink2", new wink2_entry); + } + + } // namespace detail + #endif // doxygen + +}}} // namespace boost::geometry::projection + +#endif // BOOST_GEOMETRY_PROJECTIONS_WINK2_HPP + diff --git a/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp new file mode 100644 index 000000000..b0d0b5caa --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp @@ -0,0 +1,73 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_STRATEGY_PROJECT_INVERSE_TRANSFORMER_HPP +#define BOOST_GEOMETRY_STRATEGY_PROJECT_INVERSE_TRANSFORMER_HPP + + +#include + +#include +#include +#include +#include + + +namespace boost { namespace geometry { namespace projection +{ + + +/*! + \brief Transformation strategy to do transform using a Map Projection + \ingroup transform + \tparam Cartesian first point type + \tparam LatLong second point type + */ +template +struct project_inverse_transformer +{ + typedef boost::shared_ptr > projection_ptr; + + projection_ptr m_prj; + + /// Constructor using a shared-pointer-to-projection_ptr + inline project_inverse_transformer(projection_ptr& prj) + : m_prj(prj) + {} + + /// Constructor using a string + inline project_inverse_transformer(std::string const& par) + { + factory fac; + m_prj.reset(fac.create_new(init(par))); + } + + /// Constructor using Parameters + template + inline project_inverse_transformer(Parameters const& par) + { + factory fac; + m_prj.reset(fac.create_new(par)); + } + + /// Transform operator + inline bool apply(Cartesian const& p1, LatLong& p2) const + { + // Latlong (LL -> XY) will be projected, rest will be copied. + // So first copy third or higher dimensions + geometry::detail::copy::copy_coordinates::value> ::copy(p1, p2); + return m_prj->inverse(p1, p2); + } + +}; + +}}} // namespace boost::geometry::projection + + +#endif // BOOST_GEOMETRY_STRATEGY_PROJECT_INVERSE_TRANSFORMER_HPP diff --git a/include/boost/geometry/extensions/gis/projections/project_transformer.hpp b/include/boost/geometry/extensions/gis/projections/project_transformer.hpp new file mode 100644 index 000000000..2ca832392 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/project_transformer.hpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_STRATEGY_PROJECT_TRANSFORMER_HPP +#define BOOST_GEOMETRY_STRATEGY_PROJECT_TRANSFORMER_HPP + + +#include + +#include +#include + + + +namespace boost { namespace geometry { namespace projection +{ +/*! + \brief Transformation strategy to do transform using a Map Projection + \ingroup transform + \tparam LatLong first point type + \tparam Cartesian second point type + + See also \link p03_projmap_example.cpp the projmap example \endlink + where this last one plus a transformation using a projection are used. + + */ +template +struct project_transformer +{ + typedef boost::shared_ptr > projection_ptr; + + projection_ptr m_prj; + + inline project_transformer(projection_ptr& prj) + : m_prj(prj) + {} + + inline project_transformer(std::string const& par) + { + factory fac; + m_prj.reset(fac.create_new(init(par))); + } + + inline bool apply(LatLong const& p1, Cartesian& p2) const + { + // Latlong (LatLong -> Cartesian) will be projected, rest will be copied. + // So first copy third or higher dimensions + geometry::detail::copy::copy_coordinates::value> ::copy(p1, p2); + return m_prj->forward(p1, p2); + } + +}; + +}}} // namespace boost::geometry::projection + + +#endif // BOOST_GEOMETRY_STRATEGY_PROJECT_TRANSFORMER_HPP diff --git a/include/boost/geometry/extensions/gis/projections/projection.hpp b/include/boost/geometry/extensions/gis/projections/projection.hpp new file mode 100644 index 000000000..9189ebd41 --- /dev/null +++ b/include/boost/geometry/extensions/gis/projections/projection.hpp @@ -0,0 +1,65 @@ +#ifndef _PROJECTIONS_PROJECTION_HPP +#define _PROJECTIONS_PROJECTION_HPP + +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 +#include + +namespace boost { namespace geometry { 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 +class projection +{ + protected : + // see comment above + //typedef typename geometry::coordinate_type::type LL_T; + //typedef typename geometry::coordinate_type::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; + + /// Returns parameters of projection + virtual parameters params() const = 0; + + virtual ~projection() {} + +}; + +}}} // namespace boost::geometry::projection + + + +#endif + diff --git a/include/boost/geometry/extensions/index/rtree/helpers.hpp b/include/boost/geometry/extensions/index/rtree/helpers.hpp new file mode 100644 index 000000000..e3fe62aaf --- /dev/null +++ b/include/boost/geometry/extensions/index/rtree/helpers.hpp @@ -0,0 +1,68 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Boost.SpatialIndex - geometry helper functions +// +// Copyright 2008 Federico J. Fernandez. +// Use, modification and distribution is subject to the 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 BOOST_GEOMETRY_GGL_INDEX_RTREE_HELPERS_HPP +#define BOOST_GEOMETRY_GGL_INDEX_RTREE_HELPERS_HPP + +#include +#include +#include + +namespace boost { namespace geometry { namespace index { + +/** + * \brief Given two boxes, returns the minimal box that contains them + */ +// TODO: use geometry::combine +template +inline Box enlarge_box(Box const& b1, Box const& b2) +{ + // TODO: mloskot - Refactor to readable form. Fix VC++8.0 min/max warnings: + // warning C4002: too many actual parameters for macro 'min + + typedef typename geometry::point_type::type point_type; + + point_type pmin( + geometry::get(b1) < geometry::get(b2) + ? geometry::get(b1) : geometry::get(b2), + geometry::get(b1) < geometry::get(b2) + ? geometry::get(b1) : geometry::get(b2)); + + point_type pmax( + geometry::get(b1) > geometry::get(b2) + ? geometry::get(b1) : geometry::get(b2), + geometry::get(b1) > geometry::get(b2) + ? geometry::get(b1) : geometry::get(b2)); + + return Box(pmin, pmax); +} + +/** + * \brief Compute the area of the union of b1 and b2 + */ +template +inline typename area_result::type compute_union_area(Box const& b1, Box const& b2) +{ + Box enlarged_box = enlarge_box(b1, b2); + return geometry::area(enlarged_box); +} + +/** + * \brief Checks if boxes intersects + */ +// TODO: move to geometry::intersects +template +inline bool is_overlapping(Box const& b1, Box const& b2) +{ + return ! geometry::disjoint(b1, b2); +} + +}}} // namespace boost::geometry::index + +#endif // BOOST_GEOMETRY_GGL_INDEX_RTREE_HELPERS_HPP diff --git a/include/boost/geometry/extensions/index/rtree/rtree.hpp b/include/boost/geometry/extensions/index/rtree/rtree.hpp new file mode 100644 index 000000000..ae5ab021e --- /dev/null +++ b/include/boost/geometry/extensions/index/rtree/rtree.hpp @@ -0,0 +1,773 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Boost.SpatialIndex - rtree implementation +// +// Copyright 2008 Federico J. Fernandez. +// Use, modification and distribution is subject to the 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 BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_HPP +#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_HPP + +#include +#include // TODO: Remove if print() is removed +#include +#include +#include + +#include +#include + +#include + +#include +#include + +namespace boost { namespace geometry { namespace index { + +template +class rtree +{ +public: + + typedef boost::shared_ptr > node_pointer; + typedef boost::shared_ptr > leaf_pointer; + + /** + * \brief Creates a rtree with 'maximum' elements per node and 'minimum'. + */ + rtree(unsigned int const& maximum, unsigned int const& minimum) + : m_count(0) + , m_min_elems_per_node(minimum) + , m_max_elems_per_node(maximum) + , m_root(new rtree_node(node_pointer(), 1)) + { + } + + /** + * \brief Creates a rtree with maximum elements per node + * and minimum (box is ignored). + */ + rtree(Box const& box, unsigned int const& maximum, unsigned int const& minimum) + : m_count(0) + , m_min_elems_per_node(minimum) + , m_max_elems_per_node(maximum) + , m_root(new rtree_node(node_pointer(), 1)) + { + boost::ignore_unused_variable_warning(box); + } + + /** + * \brief destructor (virtual because we have virtual functions) + */ + virtual ~rtree() {} + + + /** + * \brief Remove elements inside the 'box' + */ + inline void remove(Box const& box) + { + try + { + node_pointer leaf(choose_exact_leaf(box)); + typename rtree_leaf::leaf_map q_leaves; + + leaf->remove(box); + + if (leaf->elements() < m_min_elems_per_node && elements() > m_min_elems_per_node) + { + q_leaves = leaf->get_leaves(); + + // we remove the leaf_node in the parent node because now it's empty + leaf->get_parent()->remove(leaf->get_parent()->get_box(leaf)); + } + + typename rtree_node::node_map q_nodes; + condense_tree(leaf, q_nodes); + + std::vector > s; + for (typename rtree_node::node_map::const_iterator it = q_nodes.begin(); + it != q_nodes.end(); ++it) + { + typename rtree_leaf::leaf_map leaves = it->second->get_leaves(); + + // reinserting leaves from nodes + for (typename rtree_leaf::leaf_map::const_iterator itl = leaves.begin(); + itl != leaves.end(); ++itl) + { + s.push_back(*itl); + } + } + + for (typename std::vector >::const_iterator it = s.begin(); it != s.end(); ++it) + { + m_count--; + insert(it->first, it->second); + } + + // if the root has only one child and the child is not a leaf, + // make it the root + if (m_root->elements() == 1) + { + if (!m_root->first_element()->is_leaf()) + { + m_root = m_root->first_element(); + } + } + // reinserting leaves + for (typename rtree_leaf::leaf_map::const_iterator it = q_leaves.begin(); + it != q_leaves.end(); ++it) + { + m_count--; + insert(it->first, it->second); + } + + m_count--; + } + catch(std::logic_error & e) + { + // TODO: mloskot - replace with Boost.Geometry exception + + // not found + std::cerr << e.what() << std::endl; + return; + } + } + + /** + * \brief Remove element inside the box with value + */ + void remove(Box const& box, Value const& value) + { + try + { + node_pointer leaf; + + // find possible leaves + typedef typename std::vector node_type; + node_type nodes; + m_root->find_leaves(box, nodes); + + // refine the result + for (typename node_type::const_iterator it = nodes.begin(); it != nodes.end(); ++it) + { + leaf = *it; + try + { + leaf->remove(value); + break; + } catch (...) + { + leaf = node_pointer(); + } + } + + if (!leaf) + return; + + typename rtree_leaf < Box, Value >::leaf_map q_leaves; + + if (leaf->elements() < m_min_elems_per_node && elements() > m_min_elems_per_node) + { + q_leaves = leaf->get_leaves(); + + // we remove the leaf_node in the parent node because now it's empty + leaf->get_parent()->remove(leaf->get_parent()->get_box(leaf)); + } + + typename rtree_node::node_map q_nodes; + condense_tree(leaf, q_nodes); + + std::vector > s; + for (typename rtree_node::node_map::const_iterator it = q_nodes.begin(); + it != q_nodes.end(); ++it) + { + typename rtree_leaf::leaf_map leaves = it->second->get_leaves(); + + // reinserting leaves from nodes + for (typename rtree_leaf::leaf_map::const_iterator itl = leaves.begin(); + itl != leaves.end(); ++itl) + { + s.push_back(*itl); + } + } + + for (typename std::vector >::const_iterator it = s.begin(); it != s.end(); ++it) + { + m_count--; + insert(it->first, it->second); + } + + // if the root has only one child and the child is not a leaf, + // make it the root + if (m_root->elements() == 1) + { + if (!m_root->first_element()->is_leaf()) + { + m_root = m_root->first_element(); + } + } + + // reinserting leaves + for (typename rtree_leaf::leaf_map::const_iterator it = q_leaves.begin(); + it != q_leaves.end(); ++it) + { + m_count--; + insert(it->first, it->second); + } + + m_count--; + + } + catch(std::logic_error & e) + { + // TODO: mloskot - ggl exception + + // not found + std::cerr << e.what() << std::endl; + return; + } + } + + /** + * \brief Returns the number of elements. + */ + inline unsigned int elements() const + { + return m_count; + } + + + /** + * \brief Inserts an element with 'box' as key with value. + */ + inline void insert(Box const& box, Value const& value) + { + m_count++; + + node_pointer leaf(choose_corresponding_leaf(box)); + + // check if the selected leaf is full to do the split if necessary + if (leaf->elements() >= m_max_elems_per_node) + { + leaf->insert(box, value); + + // split! + node_pointer n1(new rtree_leaf(leaf->get_parent())); + node_pointer n2(new rtree_leaf(leaf->get_parent())); + + split_node(leaf, n1, n2); + adjust_tree(leaf, n1, n2); + } + else + { + leaf->insert(box, value); + adjust_tree(leaf); + } + } + + + /** + * \brief Returns all the values inside 'box' + */ + inline std::deque find(Box const& box) const + { + std::deque result; + m_root->find(box, result, false); + return result; + } + + /** + * \brief Print Rtree (mainly for debug) + */ + inline void print() + { + std::cerr << "===================================" << std::endl; + std::cerr << " Min/Max: " << m_min_elems_per_node << " / " << m_max_elems_per_node << std::endl; + std::cerr << "Leaves: " << m_root->get_leaves().size() << std::endl; + m_root->print(); + std::cerr << "===================================" << std::endl; + } + +private: + + /// number of elements + unsigned int m_count; + + /// minimum number of elements per node + unsigned int m_min_elems_per_node; + + /// maximum number of elements per node + unsigned int m_max_elems_per_node; + + /// tree root + node_pointer m_root; + + /** + * \brief Reorganize the tree after a removal. It tries to + * join nodes with less elements than m. + */ + void condense_tree(node_pointer const& leaf, + typename rtree_node::node_map& q_nodes) + { + if (leaf.get() == m_root.get()) + { + // if it's the root we are done + return; + } + + node_pointer parent = leaf->get_parent(); + parent->adjust_box(leaf); + + if (parent->elements() < m_min_elems_per_node) + { + if (parent.get() == m_root.get()) + { + // if the parent is underfull and it's the root we just exit + return; + } + + // get the nodes that we should reinsert + typename rtree_node::node_map this_nodes = parent->get_nodes(); + for(typename rtree_node::node_map::const_iterator it = this_nodes.begin(); + it != this_nodes.end(); ++it) + { + q_nodes.push_back(*it); + } + + // we remove the node in the parent node because now it should be + // re inserted + parent->get_parent()->remove(parent->get_parent()->get_box(parent)); + } + + condense_tree(parent, q_nodes); + } + + /** + * \brief After an insertion splits nodes with more than 'maximum' elements. + */ + inline void adjust_tree(node_pointer& node) + { + if (node.get() == m_root.get()) + { + // we finished the adjust + return; + } + + // as there are no splits just adjust the box of the parent and go on + node_pointer parent = node->get_parent(); + parent->adjust_box(node); + adjust_tree(parent); + } + + /** + * \brief After an insertion splits nodes with more than maximum elements + * (recursive step with subtrees 'n1' and 'n2' to be joined). + */ + void adjust_tree(node_pointer& leaf, node_pointer& n1, node_pointer& n2) + { + // check if we are in the root and do the split + if (leaf.get() == m_root.get()) + { + node_pointer new_root(new rtree_node(node_pointer (), leaf->get_level() + 1)); + new_root->add_node(n1->compute_box(), n1); + new_root->add_node(n2->compute_box(), n2); + + n1->set_parent(new_root); + n2->set_parent(new_root); + + n1->update_parent(n1); + n2->update_parent(n2); + + m_root = new_root; + return; + } + + node_pointer parent = leaf->get_parent(); + + parent->replace_node(leaf, n1); + parent->add_node(n2->compute_box(), n2); + + // if parent is full, split and readjust + if (parent->elements() > m_max_elems_per_node) + { + node_pointer p1(new rtree_node(parent->get_parent(), parent->get_level())); + node_pointer p2(new rtree_node(parent->get_parent(), parent->get_level())); + + split_node(parent, p1, p2); + adjust_tree(parent, p1, p2); + } + else + { + adjust_tree(parent); + } + } + + /** + * \brief Splits 'n' in 'n1' and 'n2' + */ + void split_node(node_pointer const& n, node_pointer& n1, node_pointer& n2) const + { + unsigned int seed1 = 0; + unsigned int seed2 = 0; + std::vector boxes = n->get_boxes(); + + n1->set_parent(n->get_parent()); + n2->set_parent(n->get_parent()); + + linear_pick_seeds(n, seed1, seed2); + + if (n->is_leaf()) + { + n1->add_value(boxes[seed1], n->get_value(seed1)); + n2->add_value(boxes[seed2], n->get_value(seed2)); + } + else + { + n1->add_node(boxes[seed1], n->get_node(seed1)); + n2->add_node(boxes[seed2], n->get_node(seed2)); + } + + unsigned int index = 0; + + if (n->is_leaf()) + { + // TODO: mloskot - add assert(node.size() >= 2); or similar + + typename rtree_leaf::leaf_map nodes = n->get_leaves(); + unsigned int remaining = nodes.size() - 2; + + for (typename rtree_leaf::leaf_map::const_iterator it = nodes.begin(); + it != nodes.end(); ++it, index++) + { + if (index != seed1 && index != seed2) + { + if (n1->elements() + remaining == m_min_elems_per_node) + { + n1->add_value(it->first, it->second); + continue; + } + if (n2->elements() + remaining == m_min_elems_per_node) + { + n2->add_value(it->first, it->second); + continue; + } + + remaining--; + + /// current boxes of each group + Box b1, b2; + + /// enlarged boxes of each group + Box eb1, eb2; + b1 = n1->compute_box(); + b2 = n2->compute_box(); + + /// areas + typedef typename coordinate_type::type coordinate_type; + coordinate_type b1_area, b2_area; + coordinate_type eb1_area, eb2_area; + b1_area = geometry::area(b1); + b2_area = geometry::area(b2); + eb1_area = compute_union_area(b1, it->first); + eb2_area = compute_union_area(b2, it->first); + + if (eb1_area - b1_area > eb2_area - b2_area) + { + n2->add_value(it->first, it->second); + } + if (eb1_area - b1_area < eb2_area - b2_area) + { + n1->add_value(it->first, it->second); + } + if (eb1_area - b1_area == eb2_area - b2_area) + { + if (b1_area < b2_area) + { + n1->add_value(it->first, it->second); + } + if (b1_area > b2_area) + { + n2->add_value(it->first, it->second); + } + if (b1_area == b2_area) + { + if (n1->elements() > n2->elements()) + { + n2->add_value(it->first, it->second); + } + else + { + n1->add_value(it->first, it->second); + } + } + } + } + } + } + else + { + // TODO: mloskot - add assert(node.size() >= 2); or similar + + typename rtree_node::node_map nodes = n->get_nodes(); + unsigned int remaining = nodes.size() - 2; + for(typename rtree_node::node_map::const_iterator it = nodes.begin(); + it != nodes.end(); ++it, index++) + { + + if (index != seed1 && index != seed2) + { + + if (n1->elements() + remaining == m_min_elems_per_node) + { + n1->add_node(it->first, it->second); + continue; + } + if (n2->elements() + remaining == m_min_elems_per_node) + { + n2->add_node(it->first, it->second); + continue; + } + + remaining--; + + /// current boxes of each group + Box b1, b2; + + /// enlarged boxes of each group + Box eb1, eb2; + b1 = n1->compute_box(); + b2 = n2->compute_box(); + + /// areas + typedef typename coordinate_type::type coordinate_type; + coordinate_type b1_area, b2_area; + coordinate_type eb1_area, eb2_area; + b1_area = geometry::area(b1); + b2_area = geometry::area(b2); + + eb1_area = compute_union_area(b1, it->first); + eb2_area = compute_union_area(b2, it->first); + + if (eb1_area - b1_area > eb2_area - b2_area) + { + n2->add_node(it->first, it->second); + } + if (eb1_area - b1_area < eb2_area - b2_area) + { + n1->add_node(it->first, it->second); + } + if (eb1_area - b1_area == eb2_area - b2_area) + { + if (b1_area < b2_area) + { + n1->add_node(it->first, it->second); + } + if (b1_area > b2_area) + { + n2->add_node(it->first, it->second); + } + if (b1_area == b2_area) + { + if (n1->elements() > n2->elements()) + { + n2->add_node(it->first, it->second); + } + else + { + n1->add_node(it->first, it->second); + } + } + } + + } + } + } + } + + /** + * \brief Choose initial values for the split algorithm (linear version) + */ + void linear_pick_seeds(node_pointer const& n, unsigned int &seed1, unsigned int &seed2) const + { + // get boxes from the node + std::vectorboxes = n->get_boxes(); + if (boxes.size() == 0) + { + // TODO: mloskot - throw ggl exception + throw std::logic_error("Empty Node trying to Pick Seeds"); + } + + // only two dim for now + // unsigned int dimensions = + // geometry::point_traits::coordinate_count; + + // find the first two elements + typedef typename coordinate_type::type coordinate_type; + coordinate_type separation_x, separation_y; + unsigned int first_x, second_x; + unsigned int first_y, second_y; + find_normalized_separations<0u>(boxes, separation_x, first_x, second_x); + find_normalized_separations<1u>(boxes, separation_y, first_y, second_y); + + if (separation_x > separation_y) + { + seed1 = first_x; + seed2 = second_x; + } + else + { + seed1 = first_y; + seed2 = second_y; + } + } + + /** + * \brief Find distances between possible initial values for the + * pick_seeds algorithm. + */ + template + void find_normalized_separations(const std::vector& boxes, T &separation, + unsigned int &first, unsigned int &second) const + { + if (boxes.size() < 2) + { + throw std::logic_error("At least two boxes needed to split"); + } + + // find the lowest high + typename std::vector::const_iterator it = boxes.begin(); + typedef typename coordinate_type::type coordinate_type; + coordinate_type lowest_high = geometry::get(*it); + unsigned int lowest_high_index = 0; + unsigned int index = 1; + ++it; + for(; it != boxes.end(); ++it) + { + if (geometry::get(*it) < lowest_high) + { + lowest_high = geometry::get(*it); + lowest_high_index = index; + } + index++; + } + + // find the highest low + coordinate_type highest_low = 0; + unsigned int highest_low_index = 0; + if (lowest_high_index == 0) + { + highest_low = geometry::get(boxes[1]); + highest_low_index = 1; + } + else + { + highest_low = geometry::get(boxes[0]); + highest_low_index = 0; + } + + index = 0; + for (typename std::vector::const_iterator it = boxes.begin(); + it != boxes.end(); ++it, index++) + { + if (geometry::get(*it) >= highest_low && index != lowest_high_index) + { + highest_low = geometry::get(*it); + highest_low_index = index; + } + } + + // find the lowest low + it = boxes.begin(); + coordinate_type lowest_low = geometry::get(*it); + ++it; + for(; it != boxes.end(); ++it) + { + if (geometry::get(*it) < lowest_low) + { + lowest_low = geometry::get(*it); + } + } + + // find the highest high + it = boxes.begin(); + coordinate_type highest_high = geometry::get(*it); + ++it; + for(; it != boxes.end(); ++it) + { + if (geometry::get(*it) > highest_high) + { + highest_high = geometry::get(*it); + } + } + + coordinate_type const width = highest_high - lowest_low; + + separation = (highest_low - lowest_high) / width; + first = highest_low_index; + second = lowest_high_index; + } + + /** + * \brief Choose one of the possible leaves to make an insertion + */ + inline node_pointer choose_corresponding_leaf(Box const& e) + { + node_pointer node = m_root; + + // if the tree is empty add an initial leaf + if (m_root->elements() == 0) + { + leaf_pointer new_leaf(new rtree_leaf(m_root)); + m_root->add_leaf_node(Box (), new_leaf); + + return new_leaf; + } + + while (!node->is_leaf()) + { + /// traverse node's map to see which node we should select + node = node->choose_node(e); + } + return node; + } + + /** + * \brief Choose the exact leaf where an insertion should be done + */ + node_pointer choose_exact_leaf(Box const&e) const + { + // find possible leaves + typedef typename std::vector node_type; + node_type nodes; + m_root->find_leaves(e, nodes); + + // refine the result + for (typename node_type::const_iterator it = nodes.begin(); it != nodes.end(); ++it) + { + typedef std::vector > leaves_type; + leaves_type leaves = (*it)->get_leaves(); + + for (typename leaves_type::const_iterator itl = leaves.begin(); + itl != leaves.end(); ++itl) + { + + if (itl->first.max_corner() == e.max_corner() + && itl->first.min_corner() == e.min_corner()) + { + return *it; + } + } + } + + // TODO: mloskot - ggl exception + throw std::logic_error("Leaf not found"); + } +}; + +}}} // namespace boost::geometry::index + +#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_HPP + diff --git a/include/boost/geometry/extensions/index/rtree/rtree_leaf.hpp b/include/boost/geometry/extensions/index/rtree/rtree_leaf.hpp new file mode 100644 index 000000000..d54770a67 --- /dev/null +++ b/include/boost/geometry/extensions/index/rtree/rtree_leaf.hpp @@ -0,0 +1,252 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Boost.SpatialIndex - rtree leaf implementation +// +// Copyright 2008 Federico J. Fernandez. +// Use, modification and distribution is subject to the 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 BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_LEAF_HPP +#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_LEAF_HPP + +#include +#include // TODO: Remove if print() is removed +#include +#include +#include + +#include + +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace index { + +template +class rtree_leaf : public rtree_node +{ +public: + + /// container type for the leaves + typedef boost::shared_ptr > node_pointer; + typedef std::vector > leaf_map; + + /** + * \brief Creates an empty leaf + */ + inline rtree_leaf() + { + } + + /** + * \brief Creates a new leaf, with 'parent' as parent + */ + inline rtree_leaf(node_pointer const& parent) + : rtree_node (parent, 0) + { + } + + /** + * \brief Search for elements in 'box' in the Rtree. Add them to 'result'. + * If exact_match is true only return the elements having as + * key the 'box'. Otherwise return everything inside 'box'. + */ + virtual void find(Box const& box, std::deque& result, const bool exact_match) + { + for (typename leaf_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + if (exact_match) + { + if (geometry::equals(it->first, box)) + { + result.push_back(it->second); + } + } + else + { + if (is_overlapping(it->first, box)) + { + result.push_back(it->second); + } + } + } + } + + /** + * \brief Compute bounding box for this leaf + */ + virtual Box compute_box() const + { + if (m_nodes.empty()) + { + return Box (); + } + + Box r; + geometry::assign_inverse(r); + for(typename leaf_map::const_iterator it = m_nodes.begin(); it != m_nodes.end(); ++it) + { + geometry::combine(r, it->first); + } + return r; + } + + /** + * \brief True if we are a leaf + */ + virtual bool is_leaf() const + { + return true; + } + + /** + * \brief Number of elements in the tree + */ + virtual unsigned int elements() const + { + return m_nodes.size(); + } + + /** + * \brief Insert a new element, with key 'box' and value 'v' + */ + virtual void insert(Box const& box, Value const& v) + { + m_nodes.push_back(std::make_pair(box, v)); + } + + /** + * \brief Proyect leaves of this node. + */ + virtual std::vector< std::pair > get_leaves() const + { + return m_nodes; + } + + /** + * \brief Add a new child (node) to this node + */ + virtual void add_node(Box const&, node_pointer const&) + { + // TODO: mloskot - define & use GGL exception + throw std::logic_error("Can't add node to leaf node."); + } + + /** + * \brief Add a new leaf to this node + */ + virtual void add_value(Box const& box, Value const& v) + { + m_nodes.push_back(std::make_pair(box, v)); + } + + + /** + * \brief Proyect value in position 'index' in the nodes container + */ + virtual Value get_value(unsigned int index) const + { + return m_nodes[index].second; + } + + /** + * \brief Box projector for leaf + */ + virtual Box get_box(unsigned int index) const + { + return m_nodes[index].first; + } + + /** + * \brief Remove value with key 'box' in this leaf + */ + virtual void remove(Box const& box) + { + + for (typename leaf_map::iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + if (geometry::equals(it->first, box)) + { + m_nodes.erase(it); + return; + } + } + + // TODO: mloskot - use GGL exception + throw std::logic_error("Node not found."); + } + + /** + * \brief Remove value in this leaf + */ + virtual void remove(const Value &v) + { + for (typename leaf_map::iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + if (it->second == v) + { + m_nodes.erase(it); + return; + } + } + + // TODO: mloskot - use GGL exception + throw std::logic_error("Node not found."); + } + + /** + * \brief Proyect boxes from this node + */ + virtual std::vector get_boxes() const + { + std::vector result; + for (typename leaf_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + result.push_back(it->first); + } + + return result; + } + + /** + * \brief Print leaf (mainly for debug) + */ + virtual void print() const + { + std::cerr << "\t" << " --> Leaf --------" << std::endl; + std::cerr << "\t" << " Size: " << m_nodes.size() << std::endl; + for (typename leaf_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + std::cerr << "\t" << " | "; + std::cerr << "( " << geometry::get + (it->first) << " , " << geometry::get + (it->first) << " ) x "; + std::cerr << "( " << geometry::get + (it->first) << " , " << geometry::get + (it->first) << " )"; + std::cerr << " -> "; + std::cerr << it->second; + std::cerr << " | " << std::endl;; + } + std::cerr << "\t" << " --< Leaf --------" << std::endl; + } + +private: + + /// leaves of this node + leaf_map m_nodes; +}; + +}}} // namespace boost::geometry::index + +#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_LEAF_HPP + diff --git a/include/boost/geometry/extensions/index/rtree/rtree_node.hpp b/include/boost/geometry/extensions/index/rtree/rtree_node.hpp new file mode 100644 index 000000000..f4175680e --- /dev/null +++ b/include/boost/geometry/extensions/index/rtree/rtree_node.hpp @@ -0,0 +1,492 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Boost.SpatialIndex - rtree node implementation +// +// Copyright 2008 Federico J. Fernandez. +// Use, modification and distribution is subject to the 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 BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_NODE_HPP +#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_NODE_HPP + +#include +#include // TODO: Remove if print() is removed +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +namespace boost { namespace geometry { namespace index { + +/// forward declaration +template +class rtree_leaf; + +template +class rtree_node +{ +public: + + typedef boost::shared_ptr > node_pointer; + typedef boost::shared_ptr > leaf_pointer; + + /// type for the node map + typedef std::vector > node_map; + + /** + * \brief Creates a default node (needed for the containers) + */ + rtree_node() + { + } + + /** + * \brief Creates a node with 'parent' as parent and 'level' as its level + */ + rtree_node(node_pointer const& parent, unsigned int const& level) + : m_parent(parent), m_level(level) + { + } + + /** + * \brief destructor (virtual because we have virtual functions) + */ + virtual ~rtree_node() + { + } + + /** + * \brief Level projector + */ + virtual unsigned int get_level() const + { + return m_level; + } + + /** + * \brief Number of elements in the subtree + */ + virtual unsigned int elements() const + { + return m_nodes.size(); + } + + /** + * \brief Project first element, to replace root in case of condensing + */ + inline node_pointer first_element() const + { + if (0 == m_nodes.size()) + { + // TODO: mloskot - define & use GGL exception + throw std::logic_error("first_element in empty node"); + } + return m_nodes.begin()->second; + } + + /** + * \brief True if it is a leaf node + */ + virtual bool is_leaf() const + { + return false; + } + + /** + * \brief Proyector for the 'i' node + */ + node_pointer get_node(unsigned int index) + { + return m_nodes[index].second; + } + + /** + * \brief Search for elements in 'box' in the Rtree. Add them to 'result'. + * If exact_match is true only return the elements having as + * key the box 'box'. Otherwise return everything inside 'box'. + */ + virtual void find(Box const& box, std::deque& result, bool const exact_match) + { + for (typename node_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + if (is_overlapping(it->first, box)) + { + it->second->find(box, result, exact_match); + } + } + } + + /** + * \brief Return in 'result' all the leaves inside 'box' + */ + void find_leaves(Box const& box, typename std::vector& result) const + { + for (typename node_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + if (is_overlapping(it->first, box)) + { + if (it->second->is_leaf()) + { + result.push_back(it->second); + } + else + { + it->second->find_leaves(box, result); + } + } + } + } + + /** + * \brief Compute bounding box for this node + */ + virtual Box compute_box() const + { + if (m_nodes.empty()) + { + return Box(); + } + + Box result; + geometry::assign_inverse(result); + for(typename node_map::const_iterator it = m_nodes.begin(); it != m_nodes.end(); ++it) + { + geometry::combine(result, it->first); + } + + return result; + } + + /** + * \brief Insert a value (not allowed for a node, only on leaves) + */ + virtual void insert(Box const&, Value const&) + { + // TODO: mloskot - define & use GGL exception + throw std::logic_error("Insert in node!"); + } + + /** + * \brief Get the envelopes of a node + */ + virtual std::vector get_boxes() const + { + std::vector result; + for(typename node_map::const_iterator it = m_nodes.begin(); it != m_nodes.end(); ++it) + { + result.push_back(it->first); + } + return result; + } + + /** + * \brief Recompute the bounding box + */ + void adjust_box(node_pointer const& node) + { + unsigned int index = 0; + for (typename node_map::iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it, index++) + { + if (it->second.get() == node.get()) + { + m_nodes[index] = std::make_pair(node->compute_box(), node); + return; + } + } + } + + /** + * \brief Remove elements inside the 'box' + */ + virtual void remove(Box const& box) + { + for (typename node_map::iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + if (geometry::equals(it->first, box)) + { + m_nodes.erase(it); + return; + } + } + } + + /** + * \brief Remove value in this leaf + */ + virtual void remove(Value const&) + { + // TODO: mloskot - define & use GGL exception + throw std::logic_error("Can't remove a non-leaf node by value."); + } + + /** + * \brief Replace the node in the m_nodes vector and recompute the box + */ + void replace_node(node_pointer const& leaf, node_pointer& new_leaf) + { + unsigned int index = 0; + for(typename node_map::iterator it = m_nodes.begin(); it != m_nodes.end(); ++it, index++) + { + if (it->second.get() == leaf.get()) + { + m_nodes[index] = std::make_pair(new_leaf->compute_box(), new_leaf); + new_leaf->update_parent(new_leaf); + return; + } + } + + // TODO: mloskot - define & use GGL exception + throw std::logic_error("Node not found."); + } + + /** + * \brief Add a child to this node + */ + virtual void add_node(Box const& box, node_pointer const& node) + { + m_nodes.push_back(std::make_pair(box, node)); + node->update_parent(node); + } + + /** + * \brief add a value (not allowed in nodes, only on leaves) + */ + virtual void add_value(Box const&, Value const&) + { + // TODO: mloskot - define & use GGL exception + throw std::logic_error("Can't add value to non-leaf node."); + } + + /** + * \brief Add a child leaf to this node + */ + inline void add_leaf_node(Box const& box, leaf_pointer const& leaf) + { + m_nodes.push_back(std::make_pair(box, leaf)); + } + + /** + * \brief Choose a node suitable for adding 'box' + */ + node_pointer choose_node(Box const& box) + { + if (m_nodes.size() == 0) + { + // TODO: mloskot - define & use GGL exception + throw std::logic_error("Empty node trying to choose the least enlargement node."); + } + + typedef typename coordinate_type::type coordinate_type; + + bool first = true; + coordinate_type min_area = 0; + coordinate_type min_diff_area = 0; + node_pointer chosen_node; + + // check for the least enlargement + for (typename node_map::const_iterator it = m_nodes.begin(); it != m_nodes.end(); ++it) + { + coordinate_type const + diff_area = coordinate_type(compute_union_area(box, it->first)) + - geometry::area(it->first); + + if (first) + { + // it's the first time, we keep the first + min_diff_area = diff_area; + min_area = geometry::area(it->first); + chosen_node = it->second; + + first = false; + } + else + { + if (diff_area < min_diff_area) + { + min_diff_area = diff_area; + min_area = geometry::area(it->first); + chosen_node = it->second; + } + else + { + if (diff_area == min_diff_area) + { + if (geometry::area(it->first) < min_area) + { + min_diff_area = diff_area; + min_area = geometry::area(it->first); + chosen_node = it->second; + } + } + } + } + } + + return chosen_node; + } + + /** + * \brief Empty the node + */ + virtual void empty_nodes() + { + m_nodes.clear(); + } + + /** + * \brief Projector for parent + */ + inline node_pointer get_parent() const + { + return m_parent; + } + + /** + * \brief Update the parent of all the childs + */ + void update_parent(node_pointer const& node) + { + for (typename node_map::iterator it = m_nodes.begin(); it != m_nodes.end(); ++it) + { + it->second->set_parent(node); + } + } + + /** + * \brief Set parent + */ + void set_parent(node_pointer const& node) + { + m_parent = node; + } + + /** + * \brief Value projector for leaf_node (not allowed for non-leaf nodes) + */ + virtual Value get_value(unsigned int) const + { + // TODO: mloskot - define & use GGL exception + throw std::logic_error("No values in a non-leaf node."); + } + + /** + * \brief Box projector for node 'index' + */ + virtual Box get_box(unsigned int index) const + { + return m_nodes[index].first; + } + + /** + * \brief Box projector for node pointed by 'leaf' + */ + virtual Box get_box(node_pointer const& leaf) const + { + for (typename node_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + if (it->second.get() == leaf.get()) + { + return it->first; + } + } + + // TODO: mloskot - define & use GGL exception + throw std::logic_error("Node not found"); + } + + /** + * \brief Children projector + */ + node_map get_nodes() const + { + return m_nodes; + } + + /** + * \brief Get leaves for a node + */ + virtual std::vector > get_leaves() const + { + typedef std::vector > leaf_type; + leaf_type leaf; + + for (typename node_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + leaf_type this_leaves = it->second->get_leaves(); + + for (typename leaf_type::iterator it_leaf = this_leaves.begin(); + it_leaf != this_leaves.end(); ++it_leaf) + { + leaf.push_back(*it_leaf); + } + } + + return leaf; + } + + /** + * \brief Print Rtree subtree (mainly for debug) + */ + virtual void print() const + { + std::cerr << " --> Node --------" << std::endl; + std::cerr << " Address: " << this << std::endl; + std::cerr << " Level: " << m_level << std::endl; + std::cerr << " Size: " << m_nodes.size() << std::endl; + std::cerr << " | "; + for(typename node_map::const_iterator it = m_nodes.begin(); it != m_nodes.end(); ++it) + { + if (this != it->second->get_parent().get()) + { + std::cerr << "ERROR - " << this << " is not " << it->second->get_parent().get() << " "; + } + + std::cerr << "( " << geometry::get(it->first) << " , " + << geometry::get(it->first) << " ) x "; + std::cerr << "( " << geometry::get(it->first) << " , " + << geometry::get(it->first) << " )"; + std::cerr << " | "; + } + std::cerr << std::endl; + std::cerr << " --< Node --------" << std::endl; + + // print child nodes + std::cerr << " Children: " << std::endl; + for (typename node_map::const_iterator it = m_nodes.begin(); + it != m_nodes.end(); ++it) + { + it->second->print(); + } + } + +private: + + /// parent node + node_pointer m_parent; + + /// level of this node + // TODO: mloskot - Why not std::size_t or node_map::size_type, same with member functions? + unsigned int m_level; + + /// child nodes + node_map m_nodes; +}; + +}}} // namespace boost::geometry::index + +#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_NODE_HPP diff --git a/include/boost/geometry/extensions/io/svg/svg_mapper.hpp b/include/boost/geometry/extensions/io/svg/svg_mapper.hpp new file mode 100644 index 000000000..cdc98ef9e --- /dev/null +++ b/include/boost/geometry/extensions/io/svg/svg_mapper.hpp @@ -0,0 +1,240 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) test file +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 GGL_TEST_UTIL_SVG_MAPPER_HPP +#define GGL_TEST_UTIL_SVG_MAPPER_HPP + +#include + +//#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + + + +#include + +#include + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + +template +struct svg_map +{ +}; + + +template +struct svg_map +{ + template + static inline void apply(std::ostream& stream, + std::string const& style, int size, + Point const& point, TransformStrategy const& strategy) + { + boost::geometry::point_xy p; + boost::geometry::transform(point, p, strategy); + stream << boost::geometry::svg(p, style, size) << std::endl; + } +}; + +template +struct svg_map +{ + template + static inline void apply(std::ostream& stream, + std::string const& style, int size, + Box const& box, TransformStrategy const& strategy) + { + + typename boost::geometry::point_type::type p1, p2; + boost::geometry::set<0>(p1, boost::geometry::get(box)); + boost::geometry::set<1>(p1, boost::geometry::get(box)); + boost::geometry::set<0>(p2, boost::geometry::get(box)); + boost::geometry::set<1>(p2, boost::geometry::get(box)); + + boost::geometry::box > ibox; + boost::geometry::transform(box, ibox, strategy); + + stream << boost::geometry::svg(ibox, style, size) << std::endl; + } +}; + + +template +struct svg_map_range +{ + template + static inline void apply(std::ostream& stream, + std::string const& style, int size, + Range1 const& range, TransformStrategy const& strategy) + { + Range2 irange; + boost::geometry::transform(range, irange, strategy); + stream << boost::geometry::svg(irange, style, size) << std::endl; + } +}; + + + +template +struct svg_map + : svg_map_range > > +{}; + +template +struct svg_map + : svg_map_range > > +{}; + + +template +struct svg_map +{ + template + static inline void apply(std::ostream& stream, + std::string const& style, int size, + Polygon const& polygon, TransformStrategy const& strategy) + { + boost::geometry::polygon > ipoly; + boost::geometry::transform(polygon, ipoly, strategy); + stream << boost::geometry::svg(ipoly, style, size) << std::endl; + } +}; + +template +struct svg_map +{ + template + static inline void apply(std::ostream& stream, + std::string const& style, int size, + Multi const& multi, TransformStrategy const& strategy) + { + for (typename boost::range_const_iterator::type it + = boost::begin(multi); + it != boost::end(multi); + ++it) + { + svg_map + < + typename boost::geometry::single_tag::type, + false, + typename boost::range_value::type + >::apply(stream, style, size, *it, strategy); + } + } +}; + + + +} // namespace dispatch +#endif + + + +template +inline void svg_map(std::ostream& stream, + std::string const& style, int size, + Geometry const& geometry, TransformStrategy const& strategy) +{ + dispatch::svg_map + < + typename boost::geometry::tag::type, + boost::geometry::is_multi::type::value, + typename boost::remove_const::type + >::apply(stream, style, size, geometry, strategy); +} + + +template +class svg_mapper +{ + typedef boost::geometry::strategy::transform::map_transformer, true, true> transformer_type; + boost::geometry::box

bbox; + transformer_type* matrix; + std::ostream& stream; + int width, height; + + void init_matrix() + { + if (! matrix) + { + matrix = new transformer_type(bbox, width, height); + + stream << "" << std::endl; + stream << "" << std::endl; + + stream << "" << std::endl; + } + } + +public : + svg_mapper(std::ostream& s, int w, int h) + : matrix(NULL) + , stream(s) + , width(w) + , height(h) + { + boost::geometry::assign_inverse(bbox); + } + + virtual ~svg_mapper() + { + stream << "" << std::endl; + if (matrix) delete matrix; + } + + template + void add(Geometry const& geometry) + { + if (boost::geometry::num_points(geometry) > 0) + { + boost::geometry::combine(bbox, boost::geometry::make_envelope >(geometry)); + } + } + + template + void map(Geometry const& geometry, std::string const& style, int size = -1) + { + init_matrix(); + svg_map(stream, style, size, geometry, *matrix); + } + + template + void text(Point const& point, std::string const& s, std::string const& style, + int offset_x = 0, int offset_y = 0) + { + init_matrix(); + boost::geometry::point_xy p; + boost::geometry::transform(point, p, *matrix); + stream << "(p) + offset_x + << "\" y=\"" << boost::geometry::get<1>(p) + offset_y + << "\" style=\"" << style << "\">" + << s << ""; + + } + +}; + + +#endif // GGL_TEST_UTIL_SVG_MAPPER_HPP diff --git a/include/boost/geometry/extensions/nsphere/algorithms/append.hpp b/include/boost/geometry/extensions/nsphere/algorithms/append.hpp new file mode 100644 index 000000000..60fdc9c78 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/algorithms/append.hpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_APPEND_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_APPEND_HPP + + +#include + +#include + + +namespace boost { namespace geometry +{ + + + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + +template +struct append {}; + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_APPEND_HPP diff --git a/include/boost/geometry/extensions/nsphere/algorithms/area.hpp b/include/boost/geometry/extensions/nsphere/algorithms/area.hpp new file mode 100644 index 000000000..0e2ff54c0 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/algorithms/area.hpp @@ -0,0 +1,74 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_AREA_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_AREA_HPP + + +#include + +#include + + + +namespace boost { namespace geometry +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace area { + +template +struct circle_area +{ + typedef typename coordinate_type::type coordinate_type; + + // Returning the coordinate precision, but if integer, returning a double + typedef typename boost::mpl::if_c + < + boost::is_integral::type::value, + double, + coordinate_type + >::type return_type; + + static inline return_type apply(C const& c, S const&) + { + // Currently only works for Cartesian circles + // Todo: use strategy + // Todo: use concept + assert_dimension(); + + return_type r = get_radius<0>(c); + r *= r * geometry::math::pi; + return r; + } +}; + + + +}} // namespace detail::area + +#endif // DOXYGEN_NO_DETAIL + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch { + + +template +struct area + : detail::area::circle_area +{}; + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_AREA_HPP diff --git a/include/boost/geometry/extensions/nsphere/algorithms/assign.hpp b/include/boost/geometry/extensions/nsphere/algorithms/assign.hpp new file mode 100644 index 000000000..3a3f2cc0b --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/algorithms/assign.hpp @@ -0,0 +1,88 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Bruno Lalande 2008, 2009 +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_ASSIGN_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_ASSIGN_HPP + +#include + +#include +#include + + + +namespace boost { namespace geometry +{ + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + + +template +struct assign +{ + typedef typename coordinate_type::type coordinate_type; + typedef typename radius_type::type radius_type; + + /// 2-value version for an n-sphere is valid for circle and sets the center + template + static inline void apply(S& sphercle, T const& c1, T const& c2) + { + set<0>(sphercle, boost::numeric_cast(c1)); + set<1>(sphercle, boost::numeric_cast(c2)); + } + + template + static inline void apply(S& sphercle, T const& c1, + T const& c2, R const& radius) + { + set<0>(sphercle, boost::numeric_cast(c1)); + set<1>(sphercle, boost::numeric_cast(c2)); + set_radius<0>(sphercle, boost::numeric_cast(radius)); + } +}; + +template +struct assign +{ + typedef typename coordinate_type::type coordinate_type; + typedef typename radius_type::type radius_type; + + /// 4-value version for an n-sphere is valid for a sphere and sets the center and the radius + template + static inline void apply(S& sphercle, T const& c1, T const& c2, T const& c3) + { + set<0>(sphercle, boost::numeric_cast(c1)); + set<1>(sphercle, boost::numeric_cast(c2)); + set<2>(sphercle, boost::numeric_cast(c3)); + } + + /// 4-value version for an n-sphere is valid for a sphere and sets the center and the radius + template + static inline void apply(S& sphercle, T const& c1, + T const& c2, T const& c3, R const& radius) + { + + set<0>(sphercle, boost::numeric_cast(c1)); + set<1>(sphercle, boost::numeric_cast(c2)); + set<2>(sphercle, boost::numeric_cast(c3)); + set_radius<0>(sphercle, boost::numeric_cast(radius)); + } + +}; + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_ASSIGN_HPP diff --git a/include/boost/geometry/extensions/nsphere/algorithms/clear.hpp b/include/boost/geometry/extensions/nsphere/algorithms/clear.hpp new file mode 100644 index 000000000..41cc1e702 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/algorithms/clear.hpp @@ -0,0 +1,42 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_CLEAR_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_CLEAR_HPP + + +#include + +#include + + + +namespace boost { namespace geometry +{ + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + + + +template +struct clear + : detail::clear::no_action +{}; + + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_CLEAR_HPP diff --git a/include/boost/geometry/extensions/nsphere/algorithms/envelope.hpp b/include/boost/geometry/extensions/nsphere/algorithms/envelope.hpp new file mode 100644 index 000000000..b07e8045a --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/algorithms/envelope.hpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_ENVELOPE_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_ENVELOPE_HPP + + +#include + +#include + + +namespace boost { namespace geometry +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace envelope { + +/// Calculate envelope of an n-sphere, circle or sphere (currently only for Cartesian 2D points) +template +struct envelope_nsphere +{ + static inline void apply(Nsphere const& nsphere, Box& mbr, Strategy const&) + { + assert_dimension(); + assert_dimension(); + + typename radius_type::type radius = get_radius<0>(nsphere); + set(mbr, get<0>(nsphere) - radius); + set(mbr, get<1>(nsphere) - radius); + set(mbr, get<0>(nsphere) + radius); + set(mbr, get<1>(nsphere) + radius); + } +}; + + +}} // namespace detail::envelope +#endif // DOXYGEN_NO_DETAIL + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + + +template +struct envelope + : detail::envelope::envelope_nsphere +{}; + + +} // namespace dispatch +#endif + + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_ENVELOPE_HPP diff --git a/include/boost/geometry/extensions/nsphere/algorithms/num_points.hpp b/include/boost/geometry/extensions/nsphere/algorithms/num_points.hpp new file mode 100644 index 000000000..bedf6502c --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/algorithms/num_points.hpp @@ -0,0 +1,41 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_NUM_POINTS_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_NUM_POINTS_HPP + +#include + +#include + + +namespace boost { namespace geometry +{ + + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + + +template +struct num_points + : detail::num_points::other_count +{}; + + + +} // namespace dispatch +#endif + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_NUM_POINTS_HPP diff --git a/include/boost/geometry/extensions/nsphere/algorithms/within.hpp b/include/boost/geometry/extensions/nsphere/algorithms/within.hpp new file mode 100644 index 000000000..33df742bb --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/algorithms/within.hpp @@ -0,0 +1,198 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_WITHIN_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_WITHIN_HPP + + +#include +#include + +#include + +#include +#include +#include + + +namespace boost { namespace geometry +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace within { + + + +//------------------------------------------------------------------------------------------------------- +// 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 +inline bool point_in_circle(P const& p, C const& c) +{ + assert_dimension(); + + typedef typename point_type::type point_type; + typedef typename strategy_distance + < + typename cs_tag

::type, + typename cs_tag::type, + P, + point_type + >::type strategy_type; + typedef typename strategy_type::return_type return_type; + + P const center = geometry::make

(get<0>(c), get<1>(c)); + strategy_type distance; + return_type const r = distance(p, center); + return_type const rad = make_distance_result(get_radius<0>(c)); + + return r < rad; +} +/// 2D version +template +inline bool point_in_circle(const T& c1, const T& c2, C const& c) +{ + typedef typename point_type::type point_type; + + point_type p = geometry::make(c1, c2); + return point_in_circle(p, c); +} + +template +inline bool box_in_circle(B const& b, C const& c) +{ + typedef typename point_type::type point_type; + + // Currently only implemented for 2d geometries + assert_dimension(); + assert_dimension(); + + // 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(b), get(b), c) + && point_in_circle(get(b), get(b), c) + && point_in_circle(get(b), get(b), c) + && point_in_circle(get(b), get(b), c); +} + +// Generic "range-in-circle", true if all points within circle +template +inline bool range_in_circle(R const& range, C const& c) +{ + assert_dimension(); + assert_dimension(); + + for (typename boost::range_const_iterator::type it = boost::begin(range); + it != boost::end(range); ++it) + { + if (! point_in_circle(*it, c)) + { + return false; + } + } + + return true; +} + +template +inline bool polygon_in_circle(Y const& poly, C const& c) +{ + return range_in_circle(exterior_ring(poly), c); +} + + + +template +inline bool multi_polygon_in_circle(const I& m, const C& c) +{ + for (typename I::const_iterator i = m.begin(); i != m.end(); i++) + { + if (! polygon_in_circle(*i, c)) + { + return false; + } + } + return true; +} + + + +}} // namespace detail::within +#endif // DOXYGEN_NO_DETAIL + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + + +template +struct within +{ + static inline bool apply(P const& p, Circle const& c) + { + return detail::within::point_in_circle(p, c); + } +}; + +template +struct within +{ + static inline bool apply(Box const& b, Circle const& c) + { + return detail::within::box_in_circle(b, c); + } +}; + +template +struct within +{ + static inline bool apply(Linestring const& ln, Circle const& c) + { + return detail::within::range_in_circle(ln, c); + } +}; + +template +struct within +{ + static inline bool apply(Ring const& r, Circle const& c) + { + return detail::within::range_in_circle(r, c); + } +}; + +template +struct within +{ + static inline bool apply(Polygon const& poly, Circle const& c) + { + return detail::within::polygon_in_circle(poly, c); + } +}; + +template +struct within +{ + static inline bool apply(const M& m, const C& c) + { + return detail::within::multi_polygon_in_circle(m, c); + } +}; + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_WITHIN_HPP diff --git a/include/boost/geometry/extensions/nsphere/core/access.hpp b/include/boost/geometry/extensions/nsphere/core/access.hpp new file mode 100644 index 000000000..b6b57e4c4 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/core/access.hpp @@ -0,0 +1,47 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Bruno Lalande 2008, 2009 +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_ACCESS_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_ACCESS_HPP + + + +#include + +#include + + +namespace boost { namespace geometry +{ + + +#ifndef DOXYGEN_NO_DISPATCH +namespace core_dispatch +{ + +template +struct access +{ + static inline CoordinateType get(Nsphere const& nsphere) + { + return traits::access::get(nsphere); + } + static inline void set(Nsphere& s, CoordinateType const& value) + { + traits::access::set(s, value); + } +}; + + +} // namespace core_dispatch +#endif // DOXYGEN_NO_DISPATCH + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_ACCESS_HPP diff --git a/include/boost/geometry/extensions/nsphere/core/geometry_id.hpp b/include/boost/geometry/extensions/nsphere/core/geometry_id.hpp new file mode 100644 index 000000000..532b6f4e0 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/core/geometry_id.hpp @@ -0,0 +1,41 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_GEOMETRY_ID_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_GEOMETRY_ID_HPP + + +#include + +#include + + +namespace boost { namespace geometry { + + +#ifndef DOXYGEN_NO_DISPATCH +namespace core_dispatch +{ + + +template <> +struct geometry_id : boost::mpl::int_<91> {}; + + + +} // namespace core_dispatch +#endif + + + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_GEOMETRY_ID_HPP diff --git a/include/boost/geometry/extensions/nsphere/core/radius.hpp b/include/boost/geometry/extensions/nsphere/core/radius.hpp new file mode 100644 index 000000000..8ee12b3a6 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/core/radius.hpp @@ -0,0 +1,153 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Bruno Lalande 2008, 2009 +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_RADIUS_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_RADIUS_HPP + + +#include + + +#include + +#include + +#include + + +namespace boost { 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 +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 +struct radius_type {}; + +} // namespace traits + + +#ifndef DOXYGEN_NO_DISPATCH +namespace core_dispatch +{ + +template +struct radius_type +{ + //typedef core_dispatch_specialization_required type; +}; + +/*! + \brief radius access meta-functions, used by concept n-sphere and upcoming ellipse. +*/ +template +struct radius_access +{ + //static inline T get(const G& ) {} + //static inline void set(G& g, const T& value) {} +}; + +template +struct radius_type +{ + typedef typename traits::radius_type::type type; +}; + +template +struct radius_access +{ + BOOST_STATIC_ASSERT((D == 0)); + static inline T get(const S& s) + { + return traits::radius_access::get(s); + } + static inline void set(S& s, const T& radius) + { + traits::radius_access::set(s, radius); + } +}; + +} // namespace core_dispatch +#endif // DOXYGEN_NO_DISPATCH + + +template +struct radius_type +{ + typedef typename boost::remove_const::type rconst; + typedef typename core_dispatch::radius_type::type, rconst>::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 +inline typename radius_type::type get_radius(const G& geometry) +{ + typedef typename boost::remove_const::type rconst; + + return core_dispatch::radius_access::type, rconst, + typename radius_type::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 +inline void set_radius(G& geometry, const typename radius_type::type& radius) +{ + typedef typename boost::remove_const::type rconst; + + core_dispatch::radius_access::type, G, + typename radius_type::type, I>::set(geometry, radius); +} + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_RADIUS_HPP diff --git a/include/boost/geometry/extensions/nsphere/core/replace_point_type.hpp b/include/boost/geometry/extensions/nsphere/core/replace_point_type.hpp new file mode 100644 index 000000000..da8f3a91c --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/core/replace_point_type.hpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Bruno Lalande 2008, 2009 +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_REPLACE_POINT_TYPE_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_REPLACE_POINT_TYPE_HPP + + +#include + +#include +#include + + + +namespace boost { namespace geometry { + +#ifndef DOXYGEN_NO_DISPATCH +namespace core_dispatch +{ + + +template +struct replace_point_type +{ + typedef typename geometry::coordinate_type::type coortype; + typedef nsphere type; +}; + + +} // namespace core_dispatch +#endif // DOXYGEN_NO_DISPATCH + + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_REPLACE_POINT_TYPE_HPP diff --git a/include/boost/geometry/extensions/nsphere/core/tags.hpp b/include/boost/geometry/extensions/nsphere/core/tags.hpp new file mode 100644 index 000000000..3eb2c4040 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/core/tags.hpp @@ -0,0 +1,24 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_TAGS_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_TAGS_HPP + + +namespace boost { namespace geometry +{ + + +/// Convenience 2D (circle) or 3D (sphere) n-sphere identifying tag +struct nsphere_tag {}; + + + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_TAGS_HPP diff --git a/include/boost/geometry/extensions/nsphere/core/topological_dimension.hpp b/include/boost/geometry/extensions/nsphere/core/topological_dimension.hpp new file mode 100644 index 000000000..2b196adbc --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/core/topological_dimension.hpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_TOPOLOGICAL_DIMENSION_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_TOPOLOGICAL_DIMENSION_HPP + + +#include + +#include + + +namespace boost { namespace geometry { + + +#ifndef DOXYGEN_NO_DISPATCH +namespace core_dispatch { + + + +// nsphere: 2, but there is discussion. Is it CLOSED? Then 2, but +// then it should be called "disk"... +template <> +struct top_dim : boost::mpl::int_<2> {}; + + + + +} // namespace core_dispatch +#endif + + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_TOPOLOGICAL_DIMENSION_HPP diff --git a/include/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp b/include/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp new file mode 100644 index 000000000..fb05d7038 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp @@ -0,0 +1,22 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN2D_HPP +#define BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN2D_HPP + + +#include +#include + +namespace boost { namespace geometry +{ + +typedef nsphere circle; + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN2D_HPP diff --git a/include/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp b/include/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp new file mode 100644 index 000000000..0908be8a8 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp @@ -0,0 +1,22 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSION_NSPHERE_CARTESIAN3D_HPP +#define BOOST_GEOMETRY_EXTENSION_NSPHERE_CARTESIAN3D_HPP + + +#include +#include + +namespace boost { namespace geometry +{ + +typedef nsphere sphere; + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSION_NSPHERE_CARTESIAN3D_HPP diff --git a/include/boost/geometry/extensions/nsphere/geometries/concepts/check.hpp b/include/boost/geometry/extensions/nsphere/geometries/concepts/check.hpp new file mode 100644 index 000000000..6c5c69547 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/geometries/concepts/check.hpp @@ -0,0 +1,36 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_CHECK_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_CHECK_HPP + + +#include + + +namespace boost { namespace geometry { + + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + + + + +} // namespace dispatch +#endif + + + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_CHECK_HPP diff --git a/include/boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp b/include/boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp new file mode 100644 index 000000000..06e71344b --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp @@ -0,0 +1,117 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Bruno Lalande 2008, 2009 +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_NSPHERE_CONCEPT_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_NSPHERE_CONCEPT_HPP + +#include + +#include +#include +#include +#include + +namespace boost { namespace geometry { namespace concept { + +/*! + \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 +class ConstNsphere +{ + typedef typename point_type::type point_type; + typedef typename radius_type::type radius_type; + + + template + struct dimension_checker + { + static void apply() + { + typedef typename coordinate_type::type coordinate_type; + const Geometry* s = 0; + coordinate_type coord(geometry::get(*s)); + boost::ignore_unused_variable_warning(coord); + dimension_checker::apply(); + } + }; + + template + struct dimension_checker + { + static void apply() {} + }; + +public : + + BOOST_CONCEPT_USAGE(ConstNsphere) + { + static const size_t n = dimension::value; + dimension_checker<0, n>::apply(); + dimension_checker<0, n>::apply(); + + // Check radius access + Geometry const* s = 0; + radius_type coord(geometry::get_radius<0>(*s)); + boost::ignore_unused_variable_warning(coord); + } +}; + + +/*! + \brief Checks nsphere concept + \ingroup concepts +*/ +template +class Nsphere +{ + BOOST_CONCEPT_ASSERT( (concept::ConstNsphere) ); + + typedef typename point_type::type point_type; + typedef typename radius_type::type radius_type; + + + template + struct dimension_checker + { + static void apply() + { + Geometry* s; + geometry::set(*s, geometry::get(*s)); + dimension_checker::apply(); + } + }; + + template + struct dimension_checker + { + static void apply() {} + }; + +public : + + BOOST_CONCEPT_USAGE(Nsphere) + { + static const size_t n = dimension::type::value; + dimension_checker<0, n>::apply(); + dimension_checker<0, n>::apply(); + + // Check radius access + Geometry* s = 0; + set_radius<0>(*s, get_radius<0>(*s)); + } +}; + + + +}}} // namespace boost::geometry::concept + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_NSPHERE_CONCEPT_HPP diff --git a/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp b/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp new file mode 100644 index 000000000..5f2afa5a3 --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp @@ -0,0 +1,131 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_NSPHERE_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_NSPHERE_HPP + +#include + +#include +#include +#include + +#include +#include +#include + +namespace boost { 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 +class nsphere +{ + BOOST_CONCEPT_ASSERT( (concept::Point

) ); + +public: + + typedef T radius_type; + typedef typename coordinate_type

::type coordinate_type; + + nsphere() + : m_radius(0) + { + detail::assign::assign_value(m_center, coordinate_type()); + } + + nsphere(P const& center, T const& radius) + : m_radius(radius) + { + copy_coordinates(center, m_center); + } + + inline P const& center() const { return m_center; } + inline T const& radius() const { return m_radius; } + + inline void radius(T const& 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 +struct tag< nsphere > +{ + typedef nsphere_tag type; +}; + +template +struct point_type > +{ + typedef Point type; +}; + +template +struct radius_type > +{ + typedef RadiusType type; +}; + +template +struct access, Dimension> +{ + typedef nsphere nsphere_type; + + static inline CoordinateType get(nsphere_type const& s) + { + return geometry::get(s.center()); + } + + static inline void set(nsphere_type& s, CoordinateType const& value) + { + geometry::set(s.center(), value); + } +}; + +template +struct radius_access, RadiusType, 0> +{ + typedef nsphere nsphere_type; + + static inline RadiusType get(nsphere_type const& s) + { + return s.radius(); + } + + static inline void set(nsphere_type& s, RadiusType const& value) + { + s.radius(value); + } +}; + +} // namespace traits +#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_NSPHERE_HPP diff --git a/include/boost/geometry/extensions/nsphere/nsphere.hpp b/include/boost/geometry/extensions/nsphere/nsphere.hpp new file mode 100644 index 000000000..33b864ede --- /dev/null +++ b/include/boost/geometry/extensions/nsphere/nsphere.hpp @@ -0,0 +1,33 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2007-2009, Geodan, 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 BOOST_GEOMETRY_EXTENSIONS_NSPHERE_HPP +#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_HPP + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#endif // BOOST_GEOMETRY_EXTENSIONS_NSPHERE_HPP