Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59788 - in sandbox/geometry: boost/geometry/extensions/gis/projections boost/geometry/extensions/gis/projections/proj libs/geometry/test/extensions/gis/projections other/programs/proj4_to_boost_geometry
From: barend.gehrels_at_[hidden]
Date: 2010-02-20 14:09:18


Author: barendgehrels
Date: 2010-02-20 14:09:17 EST (Sat, 20 Feb 2010)
New Revision: 59788
URL: http://svn.boost.org/trac/boost/changeset/59788

Log:
Fix pconic projection (by using proj trunk)
Removed most types from projections for compilation time
Style change in projection factory
Text files modified:
   sandbox/geometry/boost/geometry/extensions/gis/projections/factory.hpp | 19 ++++++++++++++++---
   sandbox/geometry/boost/geometry/extensions/gis/projections/proj/sconics.hpp | 15 +++++++--------
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.cpp | 12 +++++++-----
   sandbox/geometry/other/programs/proj4_to_boost_geometry/convert_proj4.bat | 8 ++++++--
   sandbox/geometry/other/programs/proj4_to_boost_geometry/proj4_to_boost_geometry_copyright_header.txt | 4 ++--
   5 files changed, 38 insertions(+), 20 deletions(-)

Modified: sandbox/geometry/boost/geometry/extensions/gis/projections/factory.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/projections/factory.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/projections/factory.hpp 2010-02-20 14:09:17 EST (Sat, 20 Feb 2010)
@@ -117,7 +117,19 @@
 {
 private:
 
- typedef std::map<std::string, boost::shared_ptr<detail::factory_entry<LatLong, Cartesian, Parameters> > > prj_registry;
+ typedef std::map
+ <
+ std::string,
+ boost::shared_ptr
+ <
+ detail::factory_entry
+ <
+ LatLong,
+ Cartesian,
+ Parameters
+ >
+ >
+ > prj_registry;
     prj_registry m_registry;
 
 public:
@@ -220,12 +232,13 @@
 
     virtual ~factory() {}
 
- virtual void add_to_factory(const std::string& name, detail::factory_entry<LatLong, Cartesian, Parameters>* sub)
+ virtual void add_to_factory(std::string const& name,
+ detail::factory_entry<LatLong, Cartesian, Parameters>* sub)
     {
         m_registry[name].reset(sub);
     }
 
- inline projection<LatLong, Cartesian>* create_new(const Parameters& parameters)
+ inline projection<LatLong, Cartesian>* create_new(Parameters const& parameters)
     {
         typename prj_registry::iterator it = m_registry.find(parameters.name);
         if (it != m_registry.end())

Modified: sandbox/geometry/boost/geometry/extensions/gis/projections/proj/sconics.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/projections/proj/sconics.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/projections/proj/sconics.hpp 2010-02-20 14:09:17 EST (Sat, 20 Feb 2010)
@@ -59,12 +59,12 @@
 
             struct par_sconics
             {
- double n;
- double rho_c;
- double rho_0;
- double sig;
- double c1, c2;
- int type;
+ double n;
+ double rho_c;
+ double rho_0;
+ double sig;
+ double c1, c2;
+ int type;
             };
             /* get common factors for simple conics */
             template <typename Parameters>
@@ -111,7 +111,7 @@
                         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));
+ rho = this->m_proj_parm.c2 * (this->m_proj_parm.c1 - tan(lp_lat - this->m_proj_parm.sig));
                         break;
                     default:
                         rho = this->m_proj_parm.rho_c - lp_lat;
@@ -180,7 +180,6 @@
                     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:

Modified: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.cpp (original)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.cpp 2010-02-20 14:09:17 EST (Sat, 20 Feb 2010)
@@ -346,12 +346,14 @@
 int test_main(int, char* [])
 {
     //test_all<int[2]>();
- test_all<float[2]>();
- test_all<double[2]>();
- test_all<test::test_point>();
+ //test_all<float[2]>();
+ //test_all<double[2]>();
+ //test_all<test::test_point>();
     //test_all<boost::geometry::point_xy<int> >();
- test_all<boost::geometry::point_xy<float> >();
- test_all<boost::geometry::point_xy<double> >();
+ //test_all<boost::geometry::point_xy<float> >();
+ //test_all<boost::geometry::point_xy<double> >();
+
+ // Leave onlye one here, because this divides compilation time with 6 or 7
     test_all<boost::geometry::point_xy<long double> >();
 
     return 0;

Modified: sandbox/geometry/other/programs/proj4_to_boost_geometry/convert_proj4.bat
==============================================================================
--- sandbox/geometry/other/programs/proj4_to_boost_geometry/convert_proj4.bat (original)
+++ sandbox/geometry/other/programs/proj4_to_boost_geometry/convert_proj4.bat 2010-02-20 14:09:17 EST (Sat, 20 Feb 2010)
@@ -1,7 +1,11 @@
 @echo off
 
-:: Set this path to the path were proj lives:
-set proj4=./contrib/proj-4.7.0/src
+:: Set this path to the path were proj4.*/src lives:
+:: set proj4=./contrib/proj-4.7.0/src
+:: Please note that proj-4.7.0 has still an error in pconics, which is
+:: solved in the trunk of proj. So take that trunk somewhere.
+
+set proj4=c:\svn\other\osgeo_proj4\src
 
 :: This is the path where Boost.Geometry extensions gis projections proj lives:
 set bg_proj=../../../boost/geometry/extensions/gis/projections/proj

Modified: sandbox/geometry/other/programs/proj4_to_boost_geometry/proj4_to_boost_geometry_copyright_header.txt
==============================================================================
--- sandbox/geometry/other/programs/proj4_to_boost_geometry/proj4_to_boost_geometry_copyright_header.txt (original)
+++ sandbox/geometry/other/programs/proj4_to_boost_geometry/proj4_to_boost_geometry_copyright_header.txt 2010-02-20 14:09:17 EST (Sat, 20 Feb 2010)
@@ -1,4 +1,4 @@
-// Generic Geometry Library - projections (based on PROJ4)
+// Boost.Geometry - extensions-gis-projections (based on PROJ4)
 // This file is automatically generated. DO NOT EDIT.
 
 // Copyright Barend Gehrels (1995-2009), Geodan Holding B.V. Amsterdam, the Netherlands.
@@ -10,7 +10,7 @@
 // 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)
+// PROJ4 is converted to Boost.Geometry by Barend Gehrels (Geodan, Amsterdam)
 
 // Original copyright notice:
  


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