<p></p>
<p dir="auto">Ok, thanks <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/joto/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/joto">@joto</a>. Sorry, more info here, but as all was working fine in EPSG:3857 including Mapnik rendering, but went wrong with EPSG:28992 (invalid coordinate values in PostGIS). Steps taken:</p>
<ul dir="auto">
<li>downloaded Netherlands North-Holland pbf from geofabrik.de, cut out small area with Osmosis as ${DOWNLOAD_FILE}</li>
<li>run:<br>
<code class="notranslate">osm2pgsql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -H ${POSTGRES_HOST} -P ${POSTGRES_PORT} -s -S ${OSM2PGSQL_STYLE} ${DOWNLOAD_FILE}</code></li>
<li>OSM2PGSQL_STYLE: Style file is standard OpenTopoMap Style</li>
<li>running the OpenTopoMap SQL files after</li>
<li>this worked fine, could generate Mapnik image with the OpenTopoMap Mapnik Style, no problems at all.</li>
<li>then trying to use custom projection EPSG:28992 (Dutch)</li>
<li><code class="notranslate">osm2pgsql -E 28992 -U ${POSTGRES_USER} -d ${POSTGRES_DB} -H ${POSTGRES_HOST} -P ${POSTGRES_PORT} -s -S ${OSM2PGSQL_STYLE} ${DOWNLOAD_FILE}</code></li>
<li>(or with <code class="notranslate">--proj=28992</code> same result).</li>
<li>database tables (PG 14 with PostGIS 3.2 in postgis:postgis Docker, also proj 8.2) filled, geometry columns have SRID 28992 ok, but all coordinates are not even in EPSG:28992 range (but look like EPSG:3857 range in NL but negative values)</li>
<li>like said I think the problem may be in proj, as projinfo EPSG:28992 does not contain the <code class="notranslate">+towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812</code> part normally found, line in proj v5 in the <code class="notranslate">epsg</code> file. Full proj-string (from v5.2.0) is:<br>
<code class="notranslate">+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m +no_defs</code></li>
</ul>
<p dir="auto">Unless the <code class="notranslate">+towgs84</code> which is essential for any transform from/to WGS84 and other projections, somewhere else in proj. This happened more often in older proj/GDAL/PostGIS versions but we could always fix in the <code class="notranslate">epsg</code> file.<br>
I will ask on the Proj Gitter chat first. I may be missing something essential.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/issues/1672#issuecomment-1113363280">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353T5QPRVGHX753MXPOLVHPU6TANCNFSM5UVRB2BQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353QTVW46MVECUEEWF2TVHPU6TA5CNFSM5UVRB2B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIJOJGUA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/osm2pgsql/issues/1672/1113363280</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/1672#issuecomment-1113363280",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1672#issuecomment-1113363280",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>