Changeset 5107


Ignore:
Timestamp:
Mar 9, 2015 10:25:52 AM (5 years ago)
Author:
ldelgass
Message:

add colormap driver option

Location:
geovis/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/RendererCmd.cpp

    r5105 r5107  
    10191019        if (driver[0] == 'c' && strcmp(driver, "colorramp") == 0) {
    10201020            osgEarth::Drivers::ColorRampOptions colorRampOpts;
    1021             osgEarth::Drivers::GDALOptions opts;
    1022             opts.url() = url;
    1023             char *profile = Tcl_GetString(objv[8]);
    1024             char *colormap = Tcl_GetString(objv[9]);
    1025             osgEarth::ElevationLayerOptions elevOpts(name, opts);
    1026             if (!cache) {
    1027                 elevOpts.cachePolicy() = osgEarth::CachePolicy(osgEarth::CachePolicy::USAGE_NO_CACHE);
     1021            char *edriver = Tcl_GetString(objv[8]);
     1022            char *profile = Tcl_GetString(objv[9]);
     1023            char *colormap = Tcl_GetString(objv[10]);
     1024            if (edriver[0] == 'g' && strcmp(edriver, "gdal") == 0) {
     1025                osgEarth::Drivers::GDALOptions opts;
     1026                opts.url() = url;
     1027                osgEarth::ElevationLayerOptions elevOpts(name, opts);
     1028                if (!cache) {
     1029                    elevOpts.cachePolicy() = osgEarth::CachePolicy(osgEarth::CachePolicy::USAGE_NO_CACHE);
     1030                }
     1031                if (profile != NULL) {
     1032                    elevOpts.driver()->profile() = osgEarth::ProfileOptions(profile);
     1033                }
     1034                colorRampOpts.elevationLayer() = elevOpts;
     1035            } else if (edriver[0] == 't' && strcmp(edriver, "tms") == 0) {
     1036                osgEarth::Drivers::TMSOptions opts;
     1037                //char *tmsType = Tcl_GetString(objv[8]);
     1038                //char *format = Tcl_GetString(objv[9]);
     1039                opts.url() = url;
     1040                //opts.tmsType() = tmsType;
     1041                //opts.format() = format;
     1042                osgEarth::ElevationLayerOptions elevOpts(name, opts);
     1043                if (!cache) {
     1044                    elevOpts.cachePolicy() = osgEarth::CachePolicy(osgEarth::CachePolicy::USAGE_NO_CACHE);
     1045                }
     1046                if (profile != NULL) {
     1047                    elevOpts.driver()->profile() = osgEarth::ProfileOptions(profile);
     1048                }
     1049                colorRampOpts.elevationLayer() = elevOpts;
    10281050            }
    1029             if (profile != NULL) {
    1030                 //elevOpts.driver()->profile()->srsString() = "epsg:4326";
    1031                 elevOpts.driver()->profile() = osgEarth::ProfileOptions(profile);
    1032             }
    1033             colorRampOpts.elevationLayer() = elevOpts;
    10341051            colorRampOpts.ramp() = g_renderer->getColorMapFilePath(colormap);
    10351052            ret = g_renderer->addImageLayer(name, colorRampOpts, cache, shared, visible, minLOD, maxLOD);
  • geovis/trunk/geovis_protocol.txt

    r5105 r5107  
    130130
    131131General form:
    132 map layer add <type> <driver> <url> ... <layerName>
     132map layer add <layerName> <type> <driver> <url> ...
    133133    <type> = image|elevation|line|point|polygon|text
    134     <driver> = gdal|tms|wms|xyz
     134    <driver> = colorramp|debug|gdal|tms|wms|xyz
    135135
    136136Specific image layer types:
    137 map layer add image gdal <url> <cache> <layerName>
     137map layer add <layerName> image colorramp <url> <cache> <elevdriver> <profile> <colormapName>
     138    Add a colormapped image layer from a file or URL
     139    <url> = URL of source
     140    <cache> = bool indicating if tiles should be cached on disk
     141    <elevdriver> = Elevation driver to read source
     142    <profile> = profile of source
     143    <colormapName> = Name of colormap
     144map layer add <layerName> image gdal <url> <cache>
    138145    Add a GDAL image layer from a file or URL
    139 map layer add image wms <url> <cache> <layers> <format> <transparent> <layerName>
     146map layer add <layerName> image wms <url> <cache> <layers> <format> <transparent>
    140147    Add a WMS image layer from a URL + layer string
    141148    <url> = URL of WMS service
     
    144151    <format> = Image format to return (e.g. 'png')
    145152    <transparent> = bool
    146 map layer add image tms <url> <cache> <layerName>
     153map layer add <layerName> image tms <url> <cache>
    147154    Add a TMS image layer from a URL
    148155    <url> = URL of TMS service
    149156    <cache> = bool indicating if tiles should be cached on disk
    150 map layer add image xyz <urlPattern> <cache> <layerName>
     157map layer add <layerName> image xyz <urlPattern> <cache>
    151158    Add an image layer from a web map using a template URL
    152159    <cache> = bool indicating if tiles should be cached on disk
    153160
    154161Elevation layers:
    155 map layer add elevation <driver> <url> <layerName>
     162map layer add <layerName> elevation <driver> <url>
    156163    Add an elevation image layer from a file or URL
    157164    <driver> = gdal|tms|wms
    158165
    159166Feature/model layers:
    160 map layer add point <url> <r> <g> <b> <size> <layerName>
     167map layer add <layerName> point <url> <r> <g> <b> <size>
    161168    Add a point feature layer from a file or URL
    162 map layer add polygon <url> <r> <g> <b> <width> <layerName>
     169map layer add <layerName> polygon <url> <r> <g> <b> <width>
    163170    Add a polygon feature layer from a file or URL
    164 map layer add line <url> <r> <g> <b> <width> <layerName>
     171map layer add <layerName> line <url> <r> <g> <b> <width>
    165172    Add a line feature layer from a file or URL
    166 map layer add text <url> <layerName>
     173map layer add <layerName> text <url> <content> <priority> <fgR> <fgG> <fgB> <bgR> <bgG> <bgB> <haloWidth> <fontSize> <removeDupes> <declutter> <visibilityRangeMin> <visibilityRangeMax>
    167174    Add a text symbol layer from a file or URL
    168175
     
    185192    <precision> = integer number of digits to display
    186193
    187 map reset <type> <?profile?> <?xmin?> <?ymin?> <?xmax?> <?ymax?>
     194map reset <type> <r> <g> <b> <?profile?> <?xmin?> <?ymin?> <?xmax?> <?ymax?>
    188195    Clear the scene and rebuild a new map from scratch.  When resetting the
    189196    map to geocentric, a profile and extents should be omitted.  When the map
    190197    type is projected, the profile is required and extents are optional.
    191     type = geocentric|projected
    192     profile = Well known profile string, e.g. 'global-geodetic',
     198    <type> = geocentric|projected
     199    <r>,<g>,<b> - Background color red, green and blue components [0,1]
     200    <profile> = Well known profile string, e.g. 'global-geodetic',
    193201    'global-mercator'.  If specifying bounds (i.e. not global), use 'geodetic'
    194202    or 'spherical-mercator' or an SRS init string (such as an EPSG code)
Note: See TracChangeset for help on using the changeset viewer.