<p dir="ltr">Pour répondre à vos questions sur la détection des SRID géodésiques dans PostGIS :</p>
<p dir="ltr">### 1) Vérifier si `srtext` commence par "GEO" ?<br>
**Non, ce n'est pas une méthode fiable.**  <br>
Les CRS géodésiques (sphère/ellipsoïde) sont représentés en WKT par `GEOGCS` (ex: `GEOGCS["WGS 84", ...]`). Bien que "GEO" soit présent, il est préférable de vérifier **`srtext LIKE 'GEOGCS%'`** pour éviter les faux positifs. Cependant, cette approche reste fragile (format WKT variable, entrées personnalisées).</p>
<p dir="ltr">---</p>
<p dir="ltr">### 2) Existe-t-il une fonction PostGIS dédiée ?<br>
**Oui, utilisez `ST_IsGeographic(srid)`** (disponible depuis PostGIS 2.2).  <br>
Cette fonction retourne **`true`** si le SRID correspond à un CRS géographique (géodésique), et **`false`** pour un CRS projeté ou inconnu.</p>
<p dir="ltr">**Exemple d'utilisation :**<br>
```sql<br>
SELECT ST_IsGeographic(4326); -- Retourne true (WGS84 géodésique)<br>
SELECT ST_IsGeographic(3857); -- Retourne false (Web Mercator projeté)<br>
```</p>
<p dir="ltr">---</p>
<p dir="ltr">### Solution recommandée :<br>
```sql<br>
-- Vérifier directement via ST_IsGeographic()<br>
SELECT srid, auth_name, srtext <br>
FROM spatial_ref_sys <br>
WHERE ST_IsGeographic(srid) = true;<br>
```</p>
<p dir="ltr">Cette méthode est **plus robuste** que l'analyse de `srtext` ou `proj4text`, car elle s'appuie sur la logique interne de PostGIS.</p>
<br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le mar. 29 avr. 2025, 22:45, Richard Huesken <<a href="mailto:richard.huesken@gmail.com">richard.huesken@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I'm wondering if there is an easy way to detect if an srid refers to a geodetic CRS, by checking the spatial_ref_sys table.</div><div><br></div><div>1) Would it be safe to assume the srid is a geodetic CRS if the value in the srtext column starts with 'GEO'? It almost seems to be too good to be true...</div><div><br></div><div>2) Did I overlook a Postgis function that returns this information (and if so, which one would that be)?</div><div><br></div><div>Thanks in advance,</div><div><br></div><div>Kind regards</div><div>Richard.</div></div>
</blockquote></div>