<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Thanks Josh, but I'd like to avoid digging into the source, it must
    be another way.<br>
    I come out to something like that, but I can't figure out how to use
    my wkt() as a value for ST_geometryfromwkt() ??<br>
    <br>
    <blockquote>CREATE TEMP TABLE x (x text);<br>
      COPY x from '/home/website/SRTM/contours-extracts/france.wkt';<br>
      create function wkt() returns text as $$<br>
          begin<br>
              return (SELECT x from x);<br>
          end;<br>
      $$ LANGUAGE plpgsql;<br>
      <br>
      SELECT
      ST_simplify(intersection(way,ST_GeomFromWKT((wkt(),-1)),0.00005),
      height <br>
       from contours where ST_Intersects(way, ST_GeomFromWKT(wkt(),-1));<br>
    </blockquote>
    Yves<br>
    <br>
    Le 20/02/2012 21:24, yvecai a écrit :
    <blockquote cite="mid:4F42AC0E.8010005@gmail.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hi all,<br>
      It's maybe more a bash question than a Postgis one, but ...<br>
      <br>
      I'm extracting shapefiles from a SRTM contour lines postgis base,
      using WKT multipolygons to cut extract by country.<br>
      This gives something like:<br>
      <blockquote>pgsql2shp -f shp/my_shapefile.shp -u mapnik contour \<br>
        "SELECT
        ST_simplify(intersection(way,GeomFromText('$poly',-1)),0.00005),
        height \<br>
        from contours where \<br>
        ST_Intersects(way, GeomFromText('$poly',-1));"<br>
      </blockquote>
      where $poly is a large WKT (like this one: <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="http://pistes-nordiques.org/download/france.wkt">http://pistes-nordiques.org/download/france.wkt</a>).<br>
      <br>
      I have the following error: /usr/bin/pgsql2shp: Argument list too
      long<br>
      <br>
      I played a little with xargs, but with no success. Is there a way
      to load the wkt from a file with postgres, or something else?<br>
      <br>
      yves<br>
      <br>
      <br>
    </blockquote>
    <br>
  </body>
</html>