[mapguide-internals] Serializing/Deserializing MgByte (was: are failed gdal connections are removed from the pool?)

Jackie Ng jumpinjackie at gmail.com
Tue Mar 13 00:14:03 EDT 2012


Hi All,

We've discovered a defect with how MgRaster objects are being
serialized/deserialized.

If an MgRaster has a palette assigned to it, it will crash during
serialization and render the applicable FDO connection (let's not beat
around the bush, it's a GDAL FDO connection) invalid and un-usable.

The problem is that palette object itself is an MgByte, which does not
inherit from MgSerializable. During serialization, it is this MgByte that is
being passed to MgStreamWriter::WriteObject(), which then does the illegal
cast to MgSerializable.

There are two solutions I can think of (with no idea about how to
implement):

 * Implement a MgSerializable wrapper for MgByte objects (or does this
already exist?), and pass this to MgStreamWriter::WriteObject()
 * Use methods other than MgStreamWriter::WriteObject() to save the MgByte

The main user action that triggers this series of events is attempting to
view the data of a Raster Feature Class, with the Feature Schema preview web
application. The raster data we were trying to "view" is PNGs with world
files. I would presume any other paletted raster data will cause the same
problem.

There is a corresponding ticket for this problem:
http://trac.osgeo.org/mapguide/ticket/1968

Any ideas on the best viable solution?

- Jackie

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Serializing-Deserializing-MgByte-was-are-failed-gdal-connections-are-removed-from-the-pool-tp4572770p4572770.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.


More information about the mapguide-internals mailing list