Hi Mike!<div><br></div><div>Thank you. Your tip about loading numpy data into PostgreSQL will be key for my application (<a href="http://stackoverflow.com/questions/8144002/use-binary-copy-table-from-with-psycopg2">http://stackoverflow.com/questions/8144002/use-binary-copy-table-from-with-psycopg2</a>)</div>

<div><br></div><div>In fact, do you know about the reverse process (loading to numpy arrays)? It seems that Psycopg2 cannot do it but there is a project tackling that problem --- I don't know if this could eventually be incorporated into the mainstream driver (<a href="http://code.google.com/p/pgnumpy/">http://code.google.com/p/pgnumpy/</a> ).</div>

<div><br clear="all">(snip)</div><div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The range type has a whole host of set-style functions and operators,<br>


like union, difference, intersection, etc.:<br>
<a href="http://www.postgresql.org/docs/devel/static/functions-range.html" target="_blank">http://www.postgresql.org/docs/devel/static/functions-range.html</a><br>
<br>
One limitation of the range type that I came across is that there is<br>
no MULTI* equivalent. So you can have a continuous range of [4,10),<br>
but you can't punch a "hole" (6,7] within it (i.e., difference). To<br>
me, this "difference yielding multi" issue is conceptualized as:<br>
    [4,10) - (6,7] = [4,6] _gap_ (7,10)<br>
<br>
.. can't work (throws an error), since there is no way to express a<br>
single range with a discontinuity. But with that thought, you could<br>
turn PostGIS into a similar 1D tool, using the MULTILINESTRING, using<br>
the x coordinate as your dimension, and ignoring all y coordinates.<br>
The above problem is:<br>
<br>
SELECT ST_AsText(ST_Difference(<br>
                        'LINESTRING(4 0, 10 0)',<br>
                        'LINESTRING(6 0,  7 0)'));<br>
               st_astext<br>
---------------------------------------<br>
 MULTILINESTRING((4 0,6 0),(7 0,10 0))<br>
(1 row)</blockquote><div><br></div><div>That is what I was hoping for (only with less overhead from the 2nd, unused coordinate). Is it is possible to build the LINESTRING from the interval type on the fly for these operations (so as to keep the in-disk representation compact and also supportive of the exclude constraint)? </div>

<div><br></div><div>Thanks,</div><div><br></div><div>Álvaro.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
-Mike<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div></div>