This file is indexed.

/usr/include/osgEarthUtil/TMSPackager is in libosgearth-dev 2.7.0+dfsg-2+b3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2015 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>
*/
#ifndef OSGEARTHUTIL_TMS_PACKAGER_H
#define OSGEARTHUTIL_TMS_PACKAGER_H

#include <osgEarthUtil/Common>
#include <osgEarth/Profile>
#include <osgEarth/Map>
#include <osgEarth/TileHandler>
#include <osgEarth/TileVisitor>

namespace osgEarth { namespace Util
{
    class TMSPackager;

    /**
    * A TileHandler that writes out a tile from a layer in a TMS structure. packages a tile in a TMS structure
    */
    class OSGEARTHUTIL_EXPORT WriteTMSTileHandler : public TileHandler
    {
    public:
        WriteTMSTileHandler(TerrainLayer* layer, Map* map, TMSPackager* packager);

        TerrainLayer* getLayer();

        virtual bool handleTile( const TileKey& key, const TileVisitor& tv );
        virtual bool hasData( const TileKey& key ) const;
        virtual std::string getProcessString() const;

    protected:
        
        std::string getPathForTile( const TileKey &key );

    protected:
        osg::ref_ptr< TerrainLayer > _layer;
        osg::ref_ptr< Map > _map;
        TMSPackager* _packager;
    };

    /**
    * Utility that reads tiles from an ImageLayer or ElevationLayer and stores
    * the resulting data in a disk-based TMS (Tile Map Service) repository.
    *
    * See: http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification
    */
    class OSGEARTHUTIL_EXPORT TMSPackager
    {
    public:
        TMSPackager();      

        /**
         * Gets the destination directory
         */
        const std::string& getDestination() const;

        /**
         * Sets the destination directory
         */
        void setDestination( const std::string& destination);

        /**
         * Gets the extension to write the data with.
         */
        const std::string& getExtension() const;

        /**
         * Sets the extension to write the data with.
         */
        void setExtension( const std::string& extension);

        /**
         * Gets the elevation pixel depth, either 16 or 32.
         */
        unsigned getElevationPixelDepth() const;
        
        /**
         * Sets the elevation pixel depth, either 16 or 32.
         */
        void setElevationPixelDepth(unsigned value);
        

        /**
         * Gets whether to overwrite existing tiles or not.
         */
        bool getOverwrite() const;

        /**
         * Sets whether to overwrite existing tiles or not.
         */
        void setOverwrite(bool overwrite);

        /**
         * Gets whether to keep completely transparent images or not.
         */
        bool getKeepEmpties() const;

        /**
         * Sets whether to keep completely transparent or not.
         */
        void setKeepEmpties(bool keepEmpties);

        /**
         * Gets whether to alpha mask out portions of imagery that aren't contained in the specified bounds.
         */
        bool getApplyAlphaMask() const;

        /**
         * Sets whether to alpha mask out portions of imagery that aren't contained in the specified bounds.
         */
        void setApplyAlphaMask(bool applyAlphaMask);

        /**
         * Gets the image write options.
         */
        osgDB::Options* getOptions() const;

        /**
         * Sets the image write options.
         */
        void setWriteOptions( osgDB::Options* options );        

        /**
         * Gets the layer name to use in the TMS XML.
         */
        const std::string& getLayerName() const;

        /**
         * Sets the layer name to use in the TMS XML.
         */
        void setLayerName( const std::string& name);

        /**
         * Gets the TileVisitor used to traverse the tiles.
         */
        TileVisitor* getTileVisitor() const;

        /**
         * Sets the TileVisitor used to traverse the tiles.
         */
        void setVisitor(TileVisitor* visitor);

        /**
         * Build the tiles for the given layer and map.
         */
        void run( TerrainLayer* layer, Map* map );

        /**
         * Write out the TMS XML for the given layer and map.
         */
        void writeXML( TerrainLayer* layer, Map* map);

    protected:

        std::string _destination;
        std::string _extension;
        unsigned int _elevationPixelDepth;
        std::string _layerName;
        bool _overwrite;
        osg::ref_ptr<osgDB::Options>    _writeOptions;

        unsigned int _width;
        unsigned int _height;

        bool _keepEmpties;

        bool _applyAlphaMask;

        osg::ref_ptr< TileVisitor > _visitor;
        osg::ref_ptr< WriteTMSTileHandler > _handler;

    };

} } // namespace osgEarth::Util

#endif // OSGEARTHUTIL_TMS_PACKAGER_H