<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:large"><div class="gmail-postcell gmail-post-layout--right"><div class="gmail-s-prose gmail-js-post-body"><p><strong>PostgreSQL 13, PostGIS 3, QGIS 3.22</strong></p>
<p>In a table, I had a geometry column geom with a SRID 2154.<br>
Now I have to store geometries with different SRIDs in geom. So I did :</p>
<pre class="gmail-lang-sql gmail-s-code-block"><code class="gmail-hljs gmail-language-sql"><span class="gmail-hljs-keyword">alter</span> <span class="gmail-hljs-keyword">table</span> activite.prescription
<span class="gmail-hljs-keyword">alter</span> <span class="gmail-hljs-keyword">column</span> geom type geometry(MULTIPOLYGON, <span class="gmail-hljs-number">0</span>),
</code></pre>
<p>to be able to store different SRIDs, replacing 2154 with 0.</p>
<pre class="gmail-lang-sql gmail-s-code-block"><code class="gmail-hljs gmail-language-sql"><span class="gmail-hljs-keyword">SELECT</span> Find_SRID(<span class="gmail-hljs-string">'activite'</span>, <span class="gmail-hljs-string">'prescription'</span>, <span class="gmail-hljs-string">'geom'</span>)
</code></pre>
<p>returns 0 as expected.</p>
<p>Now I try to upload a shapefile with a SRID 5490 using QGIS and the plugin <code>export to PostgreSQL</code>. (The shapefile has the correct .prj file)</p>
<p>If the shp is imported correctly, even the geometry, its SRID is 
"converted" in 2154. It is not a reprojection but just a 
ununderstandable change. No trigger is activated.</p>
<pre class="gmail-lang-sql gmail-s-code-block"><code class="gmail-hljs gmail-language-sql"><span class="gmail-hljs-keyword">select</span> <span class="gmail-hljs-keyword">distinct</span> st_srid(geom) <span class="gmail-hljs-keyword">from</span> activite.prescription
</code></pre>
<p>returns just <strong>one</strong> SRID 2154!</p>
<p>When I load the layer in QGIS choosing 5490 to display the feature, the layer is indeed empty.</p>
<p>When I run a query like <code>select st_setsrid(geom)...</code> applied to the feature imported, it returns 2154 so to speak the SRID initially existing.</p>
<p>Why can't I keep the different SRIDs ?</p>
    </div></div>

</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><br><div><i style="font-size:small">----------</i></div><div><font size="1"><i>Mathias Cunault</i><br></font></div></div></div><div><font size="1"><i>référent SIG / Admin Caviar<br></i><i><i>Inrap Tours - </i>148 av. Maginot<br>37000 TOURS<br>06 32 05 98 96</i></font><font size="1"><br></font></div><div><font size="1">abonn</font><i style="font-size:small"></i><font size="1">ez-vous à la lettre d'information de l'Inrap : <a href="http://www.inrap.fr/newsletter.php" target="_blank">http://ww</a></font><font size="1"><a href="http://www.inrap.fr/newsletter.php" target="_blank">w.inrap.fr/newsletter.php</a></font><br></div></div></div></div></div></div></div></div></div></div></div></div></div>