[Mapguide-trac] [mapguide-trac] #2192: MgMultiGeometry::Deserialize doesn't work with MgAgfStream

MapGuide Open Source trac_mapguide at osgeo.org
Fri Nov 30 11:34:10 PST 2012


#2192: MgMultiGeometry::Deserialize doesn't work with MgAgfStream
------------------------------+---------------------------------------------
   Reporter:  waltweltonlair  |       Owner:  waltweltonlair
       Type:  defect          |      Status:  assigned      
   Priority:  high            |   Milestone:  2.5           
  Component:  General         |     Version:  2.4.0         
   Severity:  major           |    Keywords:                
External_id:  1460281.01      |  
------------------------------+---------------------------------------------
Changes (by waltweltonlair):

  * status:  new => assigned
  * external_id:  => 1460281.01


Comment:

 This is a regression introduced with changeset r3502 to fix ticket #788.

 In that submission special code was added to get the geometry type via a
 peek operation.  The peek operation was coded to work with !MgStream, but
 it doesn't work with !MgAgfStream.

 !MgStream inherits from !MgStreamReader / !MgStreamWriter, and the default
 implementations of the Get / Write methods in !MgStreamReader /
 !MgStreamWriter serialize stream header / version / data header fields.
 The peek operation added in r3502 was coded to handle this.

 !MgAgfStream inherits from !MgStream and overrides the Get / Write
 methods.  It does not serialize stream header / version / data header
 fields.

 To fix this we simply need to enhance the code in
 MgMultiGeometry::Deserialize to check the type of the passed-in !MgStream.
 If it's an !MgAgfStream then we need to use the original pre-3502 code for
 doing the peek operation.  If it's a pure !MgStream then we use the code
 added in r3502.

-- 
Ticket URL: <https://trac.osgeo.org/mapguide/ticket/2192#comment:1>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list