Solution for OGR Virtual polygon data

Frank Warmerdam warmerdam at POBOX.COM
Wed Feb 22 15:31:01 PST 2006


Mark Adams wrote:
> Frank et al,
> 
> I've had great success with simple polygons, and with single polygons with
> holes. Everything seems to follow expectations. However, the data I'm
> working with sometimes has multiple polygons, but sometimes doesn't.
> According to the OGC simple features spec 05-134, a MULTIPOLYGON statement
> following the same format as a simple POLYGON statement should work. So, the
> following 2 statements should be equivalent:
> 
> 'POLYGON( ( 56 34, 62 48, 84 48, 84 42, 56 34) )'
> or
> 'MULTIPOLYGON( ( 56 34, 62 48, 84 48, 84 42, 56 34) )'
> 
> In practice, using the latter format failed in mapserver - no geometries
> shown. By adding a 3rd set of brackets the problem is solved:
> 
> 'MULTIPOLYGON( (( 56 34, 62 48, 84 48, 84 42, 56 34)) )'
> 
> I am now ensuring that all text geometries are added in the database with
> that extra set of brackets, so it is no longer a problem for me, but it
> might cause others some pain - seems like a deviation from the spec. 
> 
> (Or I might be reading it wrong).

Mark,

I check the spec (99-049) and it seems clear the above is (with 3 levels
of brackets) is correct according to sections 3.2.5.2 and the example in
3.2.5.3.

> Otherwise, publishing text-based polygon data is working out very well, so
> thanks again for the support.

Great!

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the MapServer-users mailing list