[postgis-users] Re: st_centroid Points not on Polygon

Gmail dassouki at gmail.com
Mon May 4 11:27:49 PDT 2009


I hope that I'm not jumping in on the conversation, but this has yet to fail me:

<code>
insert into layer_centroids(the_geom, polygon_id)
select
	ST_PointOnSurface(ST_Centroid(layer_polygons.the_geom)),
	layer_polygons.polygon_id
from layer_polygons;
</code>

My polygons consist of census boundaries and tracks. 

cheers,
dassouki




More information about the postgis-users mailing list