[postgis-users] Snap and Dissolve function in PostGIS?

Dane Springmeyer blake at hailmail.net
Mon Oct 6 15:24:58 PDT 2008


Hi John,

Regarding snapping points to lines, postgis does not have a built-in  
function to do that, but this nice post gives you a good guide on how  
to accomplish it: http://blog.cleverelephant.ca/2008/04/snapping-points-in-postgis.html

Regarding how to do a 'Dissolve' in postgis, I assume you are  
referring to the Dissolve command equivalent in ArcGIS where polygons  
with shared boundaries are merged or otherwise turned into  
multipolygons wen they share a common attribute? In postgis this is  
done by the combination of the ST_Union() function on the geometry and  
a Group By on an attribute. Something like:

SELECT ST_Union(the_geom) INTO dissolved_polygons FROM your_table  
GROUP BY your_attribute;

If you want to run that step with a faster function then read the wiki  
post here to learn how to use the new/proposed cascaded union function:

http://postgis.refractions.net/support/wiki/index.php?upgis_cascadeunion

Dane


On Oct 6, 2008, at 1:35 PM, John Zhang wrote:

> Hi there,
>
> I am writing to check how to perform SNAP and DISSOLVE function by  
> PostGIS.
>
> I have a point dataset table and a MultipleLineString dataset table.  
> I need to snap all the points in the dataset to the Line Strings  
> when the distance is within 100 meters.
>
> I also need union some polygon features and dissolve the polygons  
> within a polygon.
>
> Any inputs would be appreciated.
>
> -- 
> Sincerely,
>
>
> John Zhang,   M.Sc., B.Sc., A.Dipl.T.
> email:   JohnZhang06 at gmail.com
> Phone:  604-998-1874
>
> URL:  http://ca.geocities.com/john_z04/JOHN_ZHANG_GIS.html
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20081006/0e35b073/attachment.html>


More information about the postgis-users mailing list