- Timestamp:
- Dec 1, 2016 12:47:31 PM (8 years ago)
- Location:
- geovis/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Renderer.cpp
r6647 r6649 794 794 const osg::Vec4f& bgColor, 795 795 const char *profile, 796 double bounds[4]) 796 double bounds[4], 797 const char *boundsSRS) 797 798 { 798 799 TRACE("Restting map with type %d, profile %s", type, profile); … … 814 815 mapOpts.profile()->srsString() = profile; 815 816 } 816 TRACE(" Setting profile bounds: %g %g %g %g",817 bounds[0], bounds[1], bounds[2], bounds[3] );818 if ( 1) {819 osg::ref_ptr<osgEarth::SpatialReference> fromSRS = osgEarth::SpatialReference::create( "wgs84");817 TRACE("Input bounds: %g %g %g %g srs:\"%s\"", 818 bounds[0], bounds[1], bounds[2], bounds[3], boundsSRS); 819 if (boundsSRS != NULL) { 820 osg::ref_ptr<osgEarth::SpatialReference> fromSRS = osgEarth::SpatialReference::create(boundsSRS); 820 821 osg::ref_ptr<osgEarth::SpatialReference> toSRS = osgEarth::SpatialReference::create(mapOpts.profile()->srsString().get()); 821 822 osgEarth::Bounds extents(bounds[0], bounds[1], bounds[2], bounds[3]); … … 828 829 osgEarth::Bounds(bounds[0], bounds[1], bounds[2], bounds[3]); 829 830 } 831 TRACE("Setting profile bounds: %g %g %g %g", 832 bounds[0], bounds[1], bounds[2], bounds[3]); 830 833 } else { 831 834 mapOpts.profile() = osgEarth::ProfileOptions(profile); -
geovis/trunk/Renderer.h
r6647 r6649 200 200 const osg::Vec4f& bgColor = osg::Vec4f(1,1,1,1), 201 201 const char *profile = NULL, 202 double bounds[4] = NULL); 202 double bounds[4] = NULL, 203 const char *boundsSRS = NULL); 203 204 204 205 void clearMap(); -
geovis/trunk/RendererCmd.cpp
r6562 r6649 3103 3103 return TCL_ERROR; 3104 3104 } 3105 if (bounds[0] < -180. || bounds[0] > 180. || 3106 bounds[2] < -180. || bounds[2] > 180. || 3107 bounds[1] < -90. || bounds[1] > 90. || 3108 bounds[3] < -90. || bounds[3] > 90.) { 3109 Tcl_AppendResult(interp, "invalid bounds", (char*)NULL); 3110 return TCL_ERROR; 3111 } 3105 3112 // Note: plate-carre generates same SRS as others, but with 3106 3113 // _is_plate_carre flag set … … 3112 3119 strcmp(profile, "plate-carre") == 0 || 3113 3120 strcmp(profile, "plate-carree") == 0) { 3114 if (bounds[0] < -180. || bounds[0] > 180. ||3115 bounds[2] < -180. || bounds[2] > 180. ||3116 bounds[1] < -90. || bounds[1] > 90. ||3117 bounds[3] < -90. || bounds[3] > 90.) {3118 Tcl_AppendResult(interp, "invalid bounds", (char*)NULL);3119 return TCL_ERROR;3120 }3121 3121 // As of osgearth 2.7, these are not permitted as map profiles. 3122 3122 // Use epsg:32663 instead 3123 3123 Tcl_AppendResult(interp, "Invalid profile: can't use geographic coordinate system as projection. Consider using an equirectangular projection (epsg:32663) instead.", (char*)NULL); 3124 3124 return TCL_ERROR; 3125 } else if (strcmp(profile, "spherical-mercator") == 0 || 3126 strcmp(profile, "epsg:900913") == 0 || 3127 strcmp(profile, "epsg:3785") == 0 || 3128 strcmp(profile, "epsg:3857") == 0 || 3129 strcmp(profile, "epsg:102113") == 0) { 3130 for (int i = 0; i < 4; i++) { 3131 if (bounds[i] < -20037508.34278925 || bounds[i] > 20037508.34278925) { 3132 Tcl_AppendResult(interp, "invalid bounds", (char*)NULL); 3133 return TCL_ERROR; 3134 } 3135 } 3136 } else if (strcmp(profile, "epsg:32662") == 0 || 3137 strcmp(profile, "epsg:32663") == 0) { 3138 // epsg:32662 is deprecated: spherical method applied to ellipsoid WGS84 3139 // Equirectangular projection (WGS84/World Equidistant Cylindrical) 3140 if (bounds[0] < -20037508.34278925 || bounds[0] > 20037508.34278925 || 3141 bounds[2] < -20037508.34278925 || bounds[2] > 20037508.34278925 || 3142 bounds[1] < -10018754.17139463 || bounds[1] > 10018754.17139463 || 3143 bounds[3] < -10018754.17139463 || bounds[3] > 10018754.17139463) { 3144 Tcl_AppendResult(interp, "invalid bounds", (char*)NULL); 3145 return TCL_ERROR; 3146 } 3147 } 3148 g_renderer->resetMap(type, bgColor, profile, bounds); 3125 } 3126 g_renderer->resetMap(type, bgColor, profile, bounds, "wgs84"); 3149 3127 } else { 3150 3128 // If no bounds are given, this must be a named profile with implicit bounds
Note: See TracChangeset
for help on using the changeset viewer.