[mapserver-users] toWKT() method

Steve Lime Steve.Lime at dnr.state.mn.us
Mon Jul 14 10:53:36 PDT 2008


In the GEOS code though I go to great length to create a proper multipolygon geometry
in GEOS by determining which rings are inner or outer. GEOS in turn should generate a 
multipolygon WKT string then if appropriate. That said, this is all done on a shape by 
shape basis with no connection to the source table type. In other words you'll only see
a multipolygon if the geometry truly is one.

If you have a multipolygon that isn't right in wkt then we have a bug to address.

Steve

>>> On 7/14/2008 at 11:39 AM, in message <487B8130.7080806 at pobox.com>, Frank
Warmerdam <warmerdam at pobox.com> wrote:
> Sven Schroeter wrote:
>> Hi all,
>>  
>> I'm using PHP-Mapscript with GEOS (Mapserver 5) to get a WKT-String from 
>> a POSTGIS-Table:
>>  
>> $mywkt = $shpobj->toWKT();
>>  
>> Everything works fine for POLYGON, LINESTRING and POINT - tables.
>> If I try the "toWKT()" Method for MULTIPOLYGON-Tables I get back a 
>> POLYGON WKT-String.
>> What can I do?
> 
> Sven,
> 
> The MapServer internal geometry model does not differentiate between 
> polygons
> and multipolygons so it is very hard to preserve the original multipolygon
> without doing a great deal of processing on the rings held by mapserver to
> determine whether they are really holes in a polygon or distinct polygons
> in a multipolygon.
> 
> Basically, you are out of luck.
> 
> Best regards,




More information about the MapServer-users mailing list