Grazie innanzitutto per la risposta Riccardo,<br><br>effettivamente mi sto basando su quanto riportato nel link che mi hai postato<br>.<br>Praticamente ho eseguito le operazioni riportate nella risposta di stackoverflow con le modifiche del mio caso specifico (aggiungendo il campo 'Index' allo shp).<br>
Il tuo <quoto: "you have to make the source and destination extents match or
everything is clipped out."> potrebbe essere la risposta...infatti il risultato da me ottenuto non coincide con il DEM target,<br>ma piuttosto con gli extents del layer vettoriale, che passo come nell'esempio da te citato.<br>
<br>Come suggerisci di procedere?<br><br>Maurizio<br>
<br><br><div class="gmail_quote">Il giorno 15 gennaio 2013 15:05,  <span dir="ltr"><<a href="mailto:python-request@lists.python.it" target="_blank">python-request@lists.python.it</a>></span> ha scritto:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Invia le richieste di iscrizione alla lista Python all'indirizzo<br>
        <a href="mailto:python@lists.python.it">python@lists.python.it</a><br>
<br>
Per iscriverti o cancellarti attraverso il web, visita<br>
        <a href="http://lists.python.it/mailman/listinfo/python" target="_blank">http://lists.python.it/mailman/listinfo/python</a><br>
oppure, via email, manda un messaggio con oggetto `help' all'indirizzo<br>
        <a href="mailto:python-request@lists.python.it">python-request@lists.python.it</a><br>
<br>
Puoi contattare la persona che gestisce la lista all'indirizzo<br>
        <a href="mailto:python-owner@lists.python.it">python-owner@lists.python.it</a><br>
<br>
Se rispondi a questo messaggio, per favore edita la linea dell'oggetto<br>
in modo che sia più utile di un semplice "Re: Contenuti del digest<br>
della lista Python..."<br>
<br>
<br>
Argomenti del Giorno:<br>
<br>
   1. Re: Rasterizzare un layer vettoriale usando la libreria   GDAL<br>
      (Riccardo Lemmi)<br>
   2. [OT] Trello (Giovanni Porcari)<br>
   3. [django] max_age cache control dinamico (Andrea Ambu)<br>
   4. Re: [django] max_age cache control dinamico (Marco Beri)<br>
   5. Re: [django] max_age cache control dinamico (Manlio Perillo)<br>
   6. Problema avvio python (Lorenzo Macchiavelli)<br>
   7. Documentazione (Michele Gatti)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 15 Jan 2013 12:11:15 +0100<br>
From: Riccardo Lemmi <<a href="mailto:riccardo@reflab.com">riccardo@reflab.com</a>><br>
To: <a href="mailto:python@lists.python.it">python@lists.python.it</a><br>
Subject: Re: [Python] Rasterizzare un layer vettoriale usando la<br>
        libreria        GDAL<br>
Message-ID: <kd3dgh$m3c$<a href="mailto:1@ger.gmane.org">1@ger.gmane.org</a>><br>
Content-Type: text/plain; charset="UTF-8"<br>
<br>
Maurizio Minissale wrote:<br>
<br>
> Ciao a tutti,<br>
><br>
> quello che sto cercando di fare è ottenere un layer raster partendo da<br>
> un vettoriale.<br>
> Più precisamente ho un vettoriale contenente poligoni e vorrei<br>
> rasterizzare l'informazione di uno specifico campo, ovvero il campo<br>
> 'Index' (che ho aggiunto al layer vettoriale originale) contenente<br>
> valori interi compresi tra 0 e 9.<br>
><br>
> Ho utilizzato l'istruzione:<br>
><br>
> err = gdal.RasterizeLayer(target_ds, (3,2,1), source_layer,<br>
> burn_values=(0,0,0), options=["ATTRIBUTE= Index"])<br>
><br>
> che effettua la rasterizzazione partendo da un DEM (target_ds) target,<br>
> ma mi ritrovo una matrice piena di 0 e non i valori del campo.<br>
><br>
> Qualcuno ha qualche suggerimento in merito?<br>
> Purtroppo la documentazione a riguardo non è molto chiara...<br>
><br>
> Grazie in anticipo,<br>
> Maurizio.<br>
<br>
Questo potrebbe rispondere in parte alla tua domanda:<br>
<br>
  <a href="http://stackoverflow.com/questions/2220749/rasterizing-a-gdal-layer" target="_blank">http://stackoverflow.com/questions/2220749/rasterizing-a-gdal-layer</a><br>
<br>
quoto: "you have to make the source and destination extents match or<br>
everything is clipped out."<br>
<br>
Sul canale irc #gdal ti possono dare una indicazione migliore sulle cose<br>
da controllare.<br>
--<br>
                                       Riccardo Lemmi<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 15 Jan 2013 12:23:29 +0100<br>
From: Giovanni Porcari <<a href="mailto:giovanni.porcari@softwell.it">giovanni.porcari@softwell.it</a>><br>
To: <a href="mailto:python@lists.python.it">python@lists.python.it</a><br>
Subject: [Python] [OT] Trello<br>
Message-ID: <<a href="mailto:1FAFD885-EC07-4D44-BAF8-A35FC896D267@softwell.it">1FAFD885-EC07-4D44-BAF8-A35FC896D267@softwell.it</a>><br>
Content-Type: text/plain; charset=iso-8859-1<br>
<br>
Ho da poco conosciuto Trello (<a href="http://www.trello.com" target="_blank">www.trello.com</a>) e me ne sono innamorato.<br>
Per gestire progetti complessi o anche solo per organizzarsi la vita<br>
è una meraviglia. Il fatto che sia gratuito lo rende perfetto.<br>
<br>
<br>
Un grazie a Giovanni Bajo che me lo ha fatto conoscere.<br>
<br>
<br>
G<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 15 Jan 2013 14:23:37 +0100<br>
From: Andrea Ambu <<a href="mailto:andreambu@gmail.com">andreambu@gmail.com</a>><br>
To: Discussioni generali sul linguaggio Python<br>
        <<a href="mailto:python@lists.python.it">python@lists.python.it</a>><br>
Subject: [Python] [django] max_age cache control dinamico<br>
Message-ID:<br>
        <<a href="mailto:CAFCbtovRKo%2BX2-Ry2vrwjr_CzVznP9cCCLqY8TxkCCL5j8SqAg@mail.gmail.com">CAFCbtovRKo+X2-Ry2vrwjr_CzVznP9cCCLqY8TxkCCL5j8SqAg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Ciao!<br>
<br>
Dunque si puo` facilmente controllare la max_age per una view cosi`:<br>
<br>
"""""""""""<br>
from django.views.decorators.cache import cache_control<br>
<br>
@cache_control(max_age=3600)<br>
def my_view(request):<br>
    # ...<br>
<br>
"""""""""""<br>
<br>
Ma se volessi che il valore di max_age venga deciso _dentro_ my_view come<br>
posso fare?<br>
<br>
Per esempio:<br>
"""""""""""<br>
def my_view(request):<br>
    if is_good_to_keep_in_cache_for_a_bit(request):<br>
        # set max_age to 36000<br>
    else:<br>
        # set max_age to 42<br>
    # ...<br>
"""""""""""<br>
<br>
Cheers,<br>
Andrea<br>
-------------- parte successiva --------------<br>
Un allegato HTML è stato rimosso...<br>
URL: <<a href="http://lists.python.it/pipermail/python/attachments/20130115/3dc0a2ed/attachment-0001.html" target="_blank">http://lists.python.it/pipermail/python/attachments/20130115/3dc0a2ed/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Tue, 15 Jan 2013 14:40:50 +0100<br>
From: Marco Beri <<a href="mailto:marcoberi@gmail.com">marcoberi@gmail.com</a>><br>
To: Andrea Ambu <<a href="mailto:andreambu@gmail.com">andreambu@gmail.com</a>>,  Discussioni generali sul<br>
        linguaggio Python <<a href="mailto:python@lists.python.it">python@lists.python.it</a>><br>
Subject: Re: [Python] [django] max_age cache control dinamico<br>
Message-ID:<br>
        <CAN1J36jHAW4x-kB=<a href="mailto:Lu2FR_9yAemyCNiOzzu33iY41UcaFvPNng@mail.gmail.com">Lu2FR_9yAemyCNiOzzu33iY41UcaFvPNng@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
On Tue, Jan 15, 2013 at 2:23 PM, Andrea Ambu <<a href="mailto:andreambu@gmail.com">andreambu@gmail.com</a>> wrote:<br>
<br>
> Ciao!<br>
> Dunque si puo` facilmente controllare la max_age per una view cosi`:<br>
><br>
> """""""""""<br>
> from django.views.decorators.cache import cache_control<br>
><br>
> @cache_control(max_age=3600)<br>
> def my_view(request):<br>
>     # ...<br>
><br>
> """""""""""<br>
><br>
> Ma se volessi che il valore di max_age venga deciso _dentro_ my_view come<br>
> posso fare?<br>
><br>
> Per esempio:<br>
> """""""""""<br>
> def my_view(request):<br>
>     if is_good_to_keep_in_cache_for_a_bit(request):<br>
>         # set max_age to 36000<br>
>     else:<br>
>         # set max_age to 42<br>
>     # ...<br>
> """""""""""<br>
><br>
<br>
Boh, potresti importare patch_cache_control da <a href="http://django.utils.cache.py" target="_blank">django.utils.cache.py</a> e fare:<br>
<br>
    response = patch_cache_control(response, max_age=<quello che vuoi>)<br>
<br>
Oppure provare a passare una property come valore di max_age.<br>
<br>
Entrambe idee non provate: lascio al lettore l'onere della prova :-)<br>
<br>
Ciao.<br>
Marco.<br>
<br>
--<br>
<a href="http://beri.it/" target="_blank">http://beri.it/</a> - Un blog<br>
<a href="http://beri.it/i-miei-libri/" target="_blank">http://beri.it/i-miei-libri/</a> - Qualche libro<br>
-------------- parte successiva --------------<br>
Un allegato HTML è stato rimosso...<br>
URL: <<a href="http://lists.python.it/pipermail/python/attachments/20130115/94c55c0b/attachment-0001.html" target="_blank">http://lists.python.it/pipermail/python/attachments/20130115/94c55c0b/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Tue, 15 Jan 2013 14:46:14 +0100<br>
From: Manlio Perillo <<a href="mailto:manlio.perillo@gmail.com">manlio.perillo@gmail.com</a>><br>
To: <a href="mailto:python@lists.python.it">python@lists.python.it</a><br>
Subject: Re: [Python] [django] max_age cache control dinamico<br>
Message-ID: <<a href="mailto:50F55DA6.6090806@gmail.com">50F55DA6.6090806@gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Il 15/01/2013 14:23, Andrea Ambu ha scritto:<br>
> Ciao!<br>
><br>
> Dunque si puo` facilmente controllare la max_age per una view cosi`:<br>
><br>
> """""""""""<br>
> from django.views.decorators.cache import cache_control<br>
><br>
> @cache_control(max_age=3600)<br>
> def my_view(request):<br>
>     # ...<br>
><br>
> """""""""""<br>
><br>
> Ma se volessi che il valore di max_age venga deciso _dentro_ my_view<br>
> come posso fare?<br>
><br>
<br>
Dovresti leggere la specifica del protocollo HTTP, se vuoi sviluppare<br>
applicazioni web:<br>
<a href="http://tools.ietf.org/html/rfc2616#section-14.9" target="_blank">http://tools.ietf.org/html/rfc2616#section-14.9</a><br>
<br>
Mi aspetto (ed è così) che il middleware di Django onori l'header<br>
Cache-Control, magari (ma non è così) con una estensione per limitare il<br>
caching internamente (e non inviare l'header al client).<br>
<br>
Nel dubbio basta leggere il codice sorgente:<br>
django/views/decorators/cache.py<br>
e<br>
django/utils/cache.py<br>
<br>
> Per esempio:<br>
> """""""""""<br>
> def my_view(request):<br>
>     if is_good_to_keep_in_cache_for_a_bit(request):<br>
          request['Cache-Control'] = 'max-age=3600'<br>
>         # set max_age to 36000<br>
>     else:<br>
>         # set max_age to 42<br>
          request['Cache-Control'] = 'max-age=42'<br>
>     # ...<br>
> """""""""""<br>
><br>
<br>
Ciao  Manlio<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iEYEARECAAYFAlD1XaYACgkQscQJ24LbaUSkBgCdGpfyolXjBbyVcQsoK4lpG1MU<br>
x0oAn0kWgfUSCjNyrCSltZf9oeYAWtZl<br>
=PQeC<br>
-----END PGP SIGNATURE-----<br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Tue, 15 Jan 2013 15:00:42 +0100<br>
From: Lorenzo Macchiavelli <<a href="mailto:lmacchiavelli@gmail.com">lmacchiavelli@gmail.com</a>><br>
To: Discussioni generali sul linguaggio Python<br>
        <<a href="mailto:python@lists.python.it">python@lists.python.it</a>><br>
Subject: [Python] Problema avvio python<br>
Message-ID:<br>
        <CAC+hpxWN04hbahQcPX=<a href="mailto:RU2oTurOWaX6pN-vtJcn%2Bp_Gmh2mqUw@mail.gmail.com">RU2oTurOWaX6pN-vtJcn+p_Gmh2mqUw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Ciao a tutti,<br>
sul mio pc utilizzo py 2.7 Ho installato la versione 3.3.0,<br>
ora quando cerco di avviare o la linea di comando o idle<br>
su entrambe le versioni parte per un'istante e si chiude senza dare nessun<br>
messaggio di errore..<br>
<br>
qualcuno ha avuto il mio stesso problema??<br>
<br>
<br>
Lorenzo Macchiavelli<br>
<br>
web designer<br>
-------------- parte successiva --------------<br>
Un allegato HTML è stato rimosso...<br>
URL: <<a href="http://lists.python.it/pipermail/python/attachments/20130115/d07ce734/attachment-0001.html" target="_blank">http://lists.python.it/pipermail/python/attachments/20130115/d07ce734/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 7<br>
Date: Tue, 15 Jan 2013 15:05:10 +0100<br>
From: Michele Gatti <<a href="mailto:mgsoluzioni@gmail.com">mgsoluzioni@gmail.com</a>><br>
To: Discussioni generali sul linguaggio Python<br>
        <<a href="mailto:Python@lists.python.it">Python@lists.python.it</a>><br>
Subject: [Python] Documentazione<br>
Message-ID:<br>
        <<a href="mailto:CAOvJdBvB7_CNHPmFWPUzqfVfJzZQbm%2B6kc_x1nVbuCbO27N3Ng@mail.gmail.com">CAOvJdBvB7_CNHPmFWPUzqfVfJzZQbm+6kc_x1nVbuCbO27N3Ng@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Ciao a tutti, avrei bisogno di recuperare la documentazione dei moduli<br>
della libreria standard di python a runtime<br>
Come posso fare?<br>
<br>
<br>
  [image: logo]<br>
*Michele Gatti*<br>
*"Per imparare un nuovo linguaggio di programmazione ci vuole un sacco di<br>
lavoro, e le persone non imparano Python perché questo permetterà loro di<br>
avere un lavoro, ma perché amano genuinamente programmare e non sono<br>
soddisfatte con i linguaggi che già conoscono."*<br>
  [image: Flickr] <<a href="http://www.flickr.com/photos/gmikele/" target="_blank">http://www.flickr.com/photos/gmikele/</a>> [image:<br>
LinkedIn]<<a href="http://it.linkedin.com/in/michelegatti" target="_blank">http://it.linkedin.com/in/michelegatti</a>> [image:<br>
Tumblr] <<a href="http://tryexcept.tumblr.com/" target="_blank">http://tryexcept.tumblr.com/</a>> [image:<br>
pinterest]<<a href="http://pinterest.com/gmikele/" target="_blank">http://pinterest.com/gmikele/</a>><br>
 Get a signature like this:<br>
<<a href="http://r1.wisestamp.com/r/landing?promo=29&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_29" target="_blank">http://r1.wisestamp.com/r/landing?promo=29&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_29</a>><br>

Click<br>
here!<<a href="http://r1.wisestamp.com/r/landing?promo=29&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_29" target="_blank">http://r1.wisestamp.com/r/landing?promo=29&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_29</a>><br>

-------------- parte successiva --------------<br>
Un allegato HTML è stato rimosso...<br>
URL: <<a href="http://lists.python.it/pipermail/python/attachments/20130115/8fe96223/attachment.html" target="_blank">http://lists.python.it/pipermail/python/attachments/20130115/8fe96223/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Python mailing list<br>
<a href="mailto:Python@lists.python.it">Python@lists.python.it</a><br>
<a href="http://lists.python.it/mailman/listinfo/python" target="_blank">http://lists.python.it/mailman/listinfo/python</a><br>
<br>
<br>
Fine di Digest di Python, Volume 83, Numero 14<br>
**********************************************<br>
</blockquote></div><br>