<p></p>
<p><b>@joto</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/1277#discussion_r499602504">src/output-flex.cpp</a>:</p>
<pre style='color:#555'>> double const area =
- get_options()->reproject_area
- ? ewkb::parser_t(geom).get_area<reprojection>(
- get_options()->projection.get())
- : ewkb::parser_t(geom)
- .get_area<osmium::geom::IdentityProjection>();
+ column.srid() == srid
+ ? ewkb::parser_t(geom)
+ .get_area<osmium::geom::IdentityProjection>()
+ : ewkb::parser_t(geom).get_area<reprojection>(
+ reprojection::create_projection(srid).get());
</pre>
<p>Yes, this is expensive. But this code is hopefully soon going to be revised anyway when we clean up the geometry generation with a cache holding already created geometries. I opted to leave this in for the time being. In most cases where this is used the projection for the <code>area</code> column will be the same as for the geometry column anyway, in which case the first option with the hard-coded <code>IdentityProjection</code> is used. So the expensive path here will only be taken if you use a non-mercator projection and use an area column.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/1277#discussion_r499602504">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353WBUUL52HBL2HFOP73SJHDQDANCNFSM4SADFGBQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353XL6IIS3GIO6MTM5GDSJHDQDA5CNFSM4SADFGB2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODXWNQSI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/1277#discussion_r499602504",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/1277#discussion_r499602504",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>