[postgis-users] User Friendly vs Explicit

strk at refractions.net strk at refractions.net
Fri May 6 10:13:25 PDT 2005


I'd like to point out an url I extracted from Frank's site
(thanks Frank). It's "The Law of Leaky Abstractions":

http://www.joelonsoftware.com/articles/LeakyAbstractions.html

Surely we could have two separate functions, but we'd really
be doing a bad service to users, that won't be "educated" in
understanding the problem.

Note that if we start abstracting at this level users would
also start asking why only Buffer and not other functions ?
Like:
 "what's Operation on two geometries with different SRIDs ?"
 "transform them yourself, layer !"

.. and the abstraction leak would grow and grow ..

--strk(open to change my mind);

On Fri, May 06, 2005 at 09:54:16AM -0700, Paul Ramsey wrote:
> So, the whole Buffer('Lat Lon Geometry', planar distance) thing brings 
> this up again: to what extent should PostGIS try to hide SRS issues from 
> users? Hiding them generally means hacking around them, and the hacks 
> could in some occasions give rise to things the users don't want. I am 
> assuming here that we are not going to invest the time to do arbitrary 
> geometric calculations on the spheroid.
> 
> For example, Buffer('Lat Long Geometry', planar distance) would have to:
> 
> - Look up the SRID of the goemetry in spatial_ref_sys
> - Instantiate the proj4 definition, see if it includes a cartographic 
> transformation
> - If not, it's lat/lon so,
> - Create a temporary TransverseMercator (?) projection centered on the 
> geometry
> - Reproject the geometry into that projection
> - Run the buffer
> - Projection the geometry back out into lat lon
> - Return the result
> 
> There are two nastinesses here:
> 
> - the projection needs to be checked all the time now, even when we are 
> already in a projected system, just to make sure we are not in the 
> lat/lon case
> - hidden "magic" is happening, and the magic is somewhat complex, 
> including some assumptions (like doing the buffer in TM)
> 
> Thoughts?
> 
> P
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list