[postgis-devel] longitudeWrap (was: ST_ShiftLongitude)

strk strk at keybit.net
Wed Feb 24 02:24:17 PST 2010


If anyone wants to test the interface, here's the code:
http://foo.keybit.net/~strk/tmp/longitudeWrap.sql

If you agree I'd put this in as ST_LongitudeWrap.

ST_shiftLongitude I don't like the automagic-symmetric
hardcoded behaviour and the fact it acts point-by-point
rather than geometry-by-geometry (the latter can produce
badly invalid geometries, with lines spanning the whole world).

--strk;

On Tue, Feb 23, 2010 at 04:29:27PM +0100, strk wrote:
> Another thing... 
> for very good results the "cut" operation should
> really ST_SplitGeometry and "glue" operation should
> ST_Union.
> 
> If we ST_Union w/out ST_Split we'll loose symmetricity
> so I'd avoid that for the moment. One can always
> ST_Union manually later..
> 
> --strk;
> 
> On Tue, Feb 23, 2010 at 04:25:31PM +0100, strk wrote:
> > On Tue, Feb 23, 2010 at 03:08:05PM +0100, strk wrote:
> > 
> > > So, what I think should be paremetrized is:
> > > 	1: X-value for where to cut (longitude)
> > > 	2: Side to move (left to right or right to left)
> > > 	3: range of the whole block
> > > 	   (minx if moving right to left, maxx if moving left to right)
> > 
> > I'm thinking the parameter could be reduced to 2:
> > 
> > 	1: X-value representing the cut-line
> > 	2: shift amount
> > 
> > If shift amount is negative we're moving left
> > if it's positive we're moving right.
> > 
> > The function should check component geometries of a feature
> > to fall *completely* on the left (moving right) or right (moving left)
> > of the given X-value and only move those. Doing so will avoid introducing
> > invalid geometries.
> > 
> > The function would not be symmetric anymore.
> > Going from -180..180 to 0..360 would be done with:
> > 	ST_ShiftLongitude(the_geom, 0, +360)
> > Going from 0..360 to -180..180 would be done with:
> > 	ST_ShiftLongitude(the_geom, 180, -360)
> > 
> > How do you like it ?
> > If we want to keep the same function (would be easier) this
> > would mean taking no args as a default of 0, +360 and loosing
> > the current symmetricity (which again is not documented).
> > 
> > --strk; 
> > 
> >   ()   Free GIS & Flash consultant/developer
> >   /\   http://foo.keybit.net/~strk/services.html
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-devel
> 
> -- 
> 
>   ()   Free GIS & Flash consultant/developer
>   /\   http://foo.keybit.net/~strk/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel

-- 

  ()   Free GIS & Flash consultant/developer
  /\   http://foo.keybit.net/~strk/services.html



More information about the postgis-devel mailing list