[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis-users] massive snap of points of one geometry
From: "Jose C. Martinez-Llario" <jomarlla () cgf ! upv ! es>
Date: 2010-11-16 12:18:12
Message-ID: 4CE27684.1070801 () cgf ! upv ! es
[Download RAW message or body]
Hi all,
JASPA has a ST_SNAP function using JTS function. I guess with GEOS
should be similar.
You can snap the segments and vertex of a geometry to the vertex of
anotther one.
http://jaspa.forge.osor.eu/ST_Snap.html
Anyways, in my opinion this algorithm should be modified a little bit to
use in a spatial database using real cartography.
Some interesting comments from Martin Davis to my question in the jts list.
http://sourceforge.net/mailarchive/forum.php?thread_name=4C534B34.5090003%40cgf.upv.es&forum_name=jts-topo-suite-user
In JASPA 0.2 (maybe around march) a new system with topology rules and I
think a tolerance system will be introduced.
Hope it helps,
Jose
public static Geometry ST_Snap(Geometry geom0, Geometry geom1, double
tolerance) throws JASPAJTSException, JASPAGeomMismatchException {
if (GeomProperties.errorIfDifferentSRIDorCoorDim (geom0,
geom1)) return null;
GeometrySnapper snapper = new GeometrySnapper(geom0);
Geometry res = null;
try {
res = snapper.snapTo(geom1, tolerance);
/*
Geometry[] snapped = GeometrySnapper.snap(geom0, geom1,
tolerance);
if (snapped == null || snapped.length < 2) return null;
Geometry res = snapped[0];
*/
} catch (RuntimeException e) {
//Catch the runtime JTS Exceptions
Core.manageJTSExceptions(e);
}
return res;
}
El 16/11/2010 13:04, Jan Hartmann escribió:
>
>
> On 11/15/10 18:03, strk wrote:
> >
> > The function exists within GEOS, which is a library used by PostGIS.
> > But the specific functionality (snapping) isn't exposed in SQL yet.
> >
> > What you could do is implement or fund implementation of
> > the missing bit (the wrapper).
> >
> I've always found snapping a very important function in all kinds of
> (carto)graphic environments. Could you give an indication how much
> time it would cost to write the PostGIS wrappers? If the algorithm
> already exists in GEOS, exposing it in PostGIS doesn't look like a
> major problem to me.
>
> Jan
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic