Changeset 6650


Ignore:
Timestamp:
Dec 1, 2016 1:20:45 PM (8 years ago)
Author:
ldelgass
Message:

fix for profile validation

Location:
geovis/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/Renderer.cpp

    r6649 r6650  
    815815                mapOpts.profile()->srsString() = profile;
    816816            }
    817             TRACE("Input bounds: %g %g %g %g srs:\"%s\"",
     817            TRACE("Input bounds: %g %g %g %g srs: \"%s\"",
    818818                  bounds[0], bounds[1], bounds[2], bounds[3], boundsSRS);
    819819            if (boundsSRS != NULL) {
     
    830830            }
    831831            TRACE("Setting profile bounds: %g %g %g %g",
    832                   bounds[0], bounds[1], bounds[2], bounds[3]);
     832                  mapOpts.profile()->bounds()->xMin(),
     833                  mapOpts.profile()->bounds()->yMin(),
     834                  mapOpts.profile()->bounds()->xMax(),
     835                  mapOpts.profile()->bounds()->yMax());
    833836        } else {
    834837            mapOpts.profile() = osgEarth::ProfileOptions(profile);
  • geovis/trunk/RendererCmd.cpp

    r6649 r6650  
    30863086        }
    30873087        char *profile = Tcl_GetString(objv[6]);
     3088        if (strcmp(profile, "global-geodetic") == 0 ||
     3089            strcmp(profile, "geodetic") == 0 ||
     3090            strcmp(profile, "epsg:4326") == 0 ||
     3091            strcmp(profile, "wgs84") == 0 ||
     3092            strcmp(profile, "plate-carre") == 0 ||
     3093            strcmp(profile, "plate-carree") == 0) {
     3094            // As of osgearth 2.7, these are not permitted as map profiles.
     3095            // Use epsg:32663 instead
     3096            Tcl_AppendResult(interp, "Invalid profile: can't use geographic coordinate system as projection.  Consider using an equirectangular projection (epsg:32663) instead.", (char*)NULL);
     3097            return TCL_ERROR;
     3098        }
    30883099        if (objc > 7) {
    30893100            if (objc < 11) {
     
    31083119                bounds[3] < -90. || bounds[3] > 90.) {
    31093120                Tcl_AppendResult(interp, "invalid bounds", (char*)NULL);
    3110                 return TCL_ERROR;
    3111             }
    3112             // Note: plate-carre generates same SRS as others, but with
    3113             // _is_plate_carre flag set
    3114             // In map profile, _is_plate_carre is forced on for
    3115             // geographic+projected SRS
    3116             if (strcmp(profile, "geodetic") == 0 ||
    3117                 strcmp(profile, "epsg:4326") == 0 ||
    3118                 strcmp(profile, "wgs84") == 0 ||
    3119                 strcmp(profile, "plate-carre") == 0 ||
    3120                 strcmp(profile, "plate-carree") == 0) {
    3121                 // As of osgearth 2.7, these are not permitted as map profiles.
    3122                 // Use epsg:32663 instead
    3123                 Tcl_AppendResult(interp, "Invalid profile: can't use geographic coordinate system as projection.  Consider using an equirectangular projection (epsg:32663) instead.", (char*)NULL);
    31243121                return TCL_ERROR;
    31253122            }
Note: See TracChangeset for help on using the changeset viewer.