23 #include <minizip/unzip.h> 40 static ossimTrace traceDebug(
"ossimKmlSuperOverlayReader:debug");
91 std::vector<ossimRefPtr<ossimXmlNode> > nodes = rootNode->
getChildNodes();
120 vector<ossimGpt> points;
121 points.push_back(
ossimGpt(north, west));
122 points.push_back(
ossimGpt(north, east));
123 points.push_back(
ossimGpt(south, east));
124 points.push_back(
ossimGpt(south, west));
127 std::vector<ossimDpt> rectTmp;
128 rectTmp.resize(points.size());
129 for(std::vector<ossimGpt>::size_type index=0; index < points.size(); ++index)
164 const char* prefix)
const 258 if (nodes[i]->getTag().downcase() ==
"placemark")
263 if (nodes[i]->getTag().downcase() ==
"region" || nodes[i]->getTag().downcase() ==
"networkLink")
280 if (nodes[i]->getTag().downcase() ==
"latlonaltbox")
288 if (latlonNode.
valid())
303 if (!latlonNode.
valid())
308 std::vector<ossimRefPtr<ossimXmlNode> > latlonNodes = latlonNode->
getChildNodes();
309 if (latlonNodes.size() != 4)
318 north = latlonNodes[i]->getText().
toFloat64();
320 else if (str ==
"south")
322 south = latlonNodes[i]->getText().toFloat64();
324 else if (str ==
"east")
326 east = latlonNodes[i]->getText().toFloat64();
328 else if (str ==
"west")
330 west = latlonNodes[i]->getText().toFloat64();
350 ossimGpt origin(centerLat, centerLon, 0.0);
369 unzFile unzipfile = unzOpen(tmpZipfile.
c_str());
374 "Unable to open target zip file..");
380 std::string kmzStringBuffer;
382 if (unzGoToFirstFile(unzipfile) == UNZ_OK)
384 if (unzOpenCurrentFile(unzipfile) == UNZ_OK)
386 unsigned char buffer[4096] = {0};
391 read = unzReadCurrentFile(unzipfile, buffer, 4096);
396 for (
int i = 0; i < bytesRead; ++i)
399 kmzStringBuffer.push_back( static_cast<char>(buffer[i]) );
406 unzCloseCurrentFile(unzipfile);
417 unzCloseCurrentFile(unzipfile);
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
ossimRefPtr< ossimImageGeometry > theImageGeometry
ossimFilename noExtension() const
ossimFilename theImageFile
ossim_float64 width() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
Represents serializable keyword/value map.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const ossimXmlNode::ChildListType & getChildNodes() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual void setUlGpt(const ossimGpt &ulGpt)
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual ossim_uint32 getNumberOfOutputBands() const
virtual ossim_uint32 getImageTileHeight() const
ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossimRefPtr< ossimXmlNode > findLatLonNode(std::vector< ossimRefPtr< ossimXmlNode > >nodes)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
unsigned int ossim_uint32
ossim_float64 toFloat64() const
virtual void setOrigin(const ossimGpt &origin)
static ossimString downcase(const ossimString &aString)
ossim_float64 height() const
ossimMapProjection * createDefaultProj(ossim_float64 north, ossim_float64 south, ossim_float64 east, ossim_float64 west)
ossimKmlSuperOverlayReader()
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
virtual ossim_uint32 getNumberOfInputBands() const
This class defines an abstract Handler which all image handlers(loaders) should derive from...
ossimRefPtr< ossimXmlDocument > m_xmlDocument
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
bool read(std::istream &in)
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
virtual ossim_uint32 getImageTileWidth() const
std::basic_istringstream< char > istringstream
Class for char input memory streams.
ossimRefPtr< ossimXmlNode > getRoot()
virtual ~ossimKmlSuperOverlayReader()
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
bool getCoordinate(std::vector< ossimRefPtr< ossimXmlNode > > nodes, ossim_float64 &north, ossim_float64 &south, ossim_float64 &east, ossim_float64 &west)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
bool rename(const ossimFilename &destFile, bool overwriteDestinationFlag=true) const
virtual void close()
Deletes the overview and clears the valid image vertices.
RTTI_DEF1(ossimKmlSuperOverlayReader, "ossimKmlSuperOverlayReader", ossimImageHandler)
bool isKmlSuperOverlayFile(std::vector< ossimRefPtr< ossimXmlNode > > nodes)
bool getTopLevelKmlFileInfo()