<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">This entry from the 3.12.3 changelog seems pertinent <div><br></div><div><div>  - DouglasPeuckerLineSimplifier, avoid crash with Point input and NaN tolerance (GH-1078, Dan Baston)</div><div><br></div><div>Running the latest patch releases is always the best practice.</div><div><br></div><div>P.</div><div><br><blockquote type="cite"><div>On Jul 29, 2025, at 12:25 PM, Bharath Tadikonda <tadikondabharath@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Team, <div><br></div><div>Dear PostGIS Team,</div><div><p>We’re encountering the following exception during execution of a spatial operation in our Python application using PostGIS:</p>
<pre class="gmail-overflow-visible!"><div class="gmail-contain-inline-size gmail-rounded-2xl gmail-relative gmail-bg-token-sidebar-surface-primary"><div class="gmail-flex gmail-items-center gmail-text-token-text-secondary gmail-px-4 gmail-py-2 gmail-text-xs gmail-font-sans gmail-justify-between gmail-h-9 gmail-bg-token-sidebar-surface-primary gmail-select-none gmail-rounded-t-2xl"><br></div><div class="gmail-sticky gmail-top-9"><div class="gmail-absolute end-0 gmail-bottom-0 gmail-flex gmail-h-9 gmail-items-center gmail-pe-2"><div class="gmail-bg-token-bg-elevated-secondary gmail-text-token-text-secondary gmail-flex gmail-items-center gmail-gap-4 gmail-rounded-sm gmail-px-2 gmail-font-sans gmail-text-xs"><br></div></div></div><div class="gmail-overflow-y-auto gmail-p-4" dir="ltr"><code class="gmail-whitespace-pre!">psycopg2.errors.InternalError_<span class="gmail-hljs-operator">:</span> GEOSTopologyPreserveSimplify<span class="gmail-hljs-operator">:</span> IllegalArgumentException<span class="gmail-hljs-operator">:</span> CGAlgorithmsDD<span class="gmail-hljs-operator">::</span>orientationIndex encountered <span class="gmail-hljs-literal">NaN</span><span class="gmail-hljs-operator">/</span><span class="gmail-hljs-literal">Inf</span> numbers
</code></div></div></pre><p>This error arises from a call to <code>ST_TopologyPreserveSimplify()</code> in our function that processes and simplifies geometry.</p><p>After some investigation, our development team suspects the issue is related to the <strong>PostGIS and GEOS versions</strong> installed in different environments:</p>
<hr>
<h3>🔴 <strong>Validation Environment — Not Working</strong></h3>
<pre class="gmail-overflow-visible!"><div class="gmail-contain-inline-size gmail-rounded-2xl gmail-relative gmail-bg-token-sidebar-surface-primary"><div class="gmail-flex gmail-items-center gmail-text-token-text-secondary gmail-px-4 gmail-py-2 gmail-text-xs gmail-font-sans gmail-justify-between gmail-h-9 gmail-bg-token-sidebar-surface-primary gmail-select-none gmail-rounded-t-2xl"><br></div><div class="gmail-overflow-y-auto gmail-p-4" dir="ltr"><code class="gmail-whitespace-pre! gmail-language-sql"><span class="gmail-hljs-keyword">SELECT</span> postgis_full_version();
<span class="gmail-hljs-comment">-- POSTGIS="3.4.0 0874ea3" [EXTENSION] PGSQL="160" GEOS="3.12.2-CAPI-1.18.2" ...</span>
</code></div></div></pre>
<h3>✅ <strong>Production (AWS RDS) — Working Fine</strong></h3>
<pre class="gmail-overflow-visible!"><div class="gmail-contain-inline-size gmail-rounded-2xl gmail-relative gmail-bg-token-sidebar-surface-primary"><div class="gmail-flex gmail-items-center gmail-text-token-text-secondary gmail-px-4 gmail-py-2 gmail-text-xs gmail-font-sans gmail-justify-between gmail-h-9 gmail-bg-token-sidebar-surface-primary gmail-select-none gmail-rounded-t-2xl"><br></div><div class="gmail-overflow-y-auto gmail-p-4" dir="ltr"><code class="gmail-whitespace-pre! gmail-language-sql"><span class="gmail-hljs-keyword">SELECT</span> postgis_full_version();
<span class="gmail-hljs-comment">-- POSTGIS="3.4.3 e365945" [EXTENSION] PGSQL="160" GEOS="3.13.0-CAPI-1.19.0" ...</span>
</code></div></div></pre>
<hr><p>It appears that the error occurs only on PostGIS 3.4.0 with GEOS 3.12.2, while the same code works as expected in environments with PostGIS 3.4.3 and GEOS 3.13.0.</p><p>Currently, we are unable to find and install <strong>GEOS 3.13.0</strong> on-prem and only see <strong>GEOS 3.13.1</strong> as available.<br>
We’d appreciate your guidance on the following:</p>
<ol>
<li><p><strong>Has this issue (NaN/Inf handling in <code>ST_TopologyPreserveSimplify</code>) been addressed between PostGIS 3.4.0 and 3.4.3 or GEOS 3.12 → 3.13?</strong></p>
</li>
<li><p>Would upgrading to <strong>GEOS 3.13.1</strong> with <strong>PostGIS 3.4.3</strong> on-prem likely resolve this issue?</p>
</li>
<li><p>What is the best practice to keep <strong>PostGIS + GEOS versions in sync</strong> between on-prem and cloud (AWS RDS) environments?</p>
</li>
</ol><p>Thank you for your support and any insights you can share.</p><p>Best regards,<br>
<strong>Bharath</strong></p></div><div><span style="color:rgb(191,193,196);font-family:"Atlassian Mono",ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace;font-size:14px;white-space:pre;background-color:rgba(206,206,217,0.07)"><br></span></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></body></html>