[mapguide-users] MgWktReaderWriter merging geometries within GEOMETRYCOLLECTION?

kshippey kshippey at juno.com
Tue Dec 24 02:52:09 PST 2019


I experienced this same GEOMETRYCOLLECTION() problem today, and this post
from years ago was the only relevant reference I could find.

When creating a GEOMETRYCOLLECTION() WKT using numerous POLYGON() strings in
a row, the final outcome is a MgMultiGeometry object that does not separate
the Polygons into sub-geometries, and instead returns 1 when using
$geometry->GetCount(). For example in PHP:



This outputs 1.

However if I punctuate the Polygons with a redundant POINT() geometry, it
separates the Polygons and returns the correct number of sub-geometries:



This outputs 5.

For my immediate purposes I only need the MultiGeometry temporarily to
perform an area calculation, so I can make do with inserting unnecessary
POINT() values. However it seems that one of the MgWktReaderWriter,
MgMultiGeometry, or abstract MgAggregateGeometry is not working as it
should.

Based on the previous user's post, it appears that this occurs with
consecutive LINESTRING() strings also. Consecutive POINT() strings does not
produce this error for me.


Thank you,

Kyel



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html


More information about the mapguide-users mailing list