[postgis-users] Decomposing Multiploygon

Ralph Mason ralph.mason at telogis.com
Mon Dec 15 19:58:30 PST 2003

I am new to postgis and spatial data so I apologies in advance if this 
is covered already.  Google didn't turn up anything.

I have a shape file of country outlines, each country is a multipolygon.

I imported this using shp2postgis and created an index on the geometry 
column.  So far so good.

However, as the a search is done on the bounding box of the multi 
polygon I get more than one country returned to many searches.  Eg 
querying in canada will return Canada, USA (because of the alaska , 
mainland box), and Russia.

So - Is there a way to query for records that contain the point in one 
of the polygons in the multipolygon?  Or do I need to decompose the 
multipolygon to a polygons?

Assuming I need to decompose, is there a utility that can do this (I 
guess one could write a postgres function to do it)

Thanks for any help

More information about the postgis-users mailing list