Skip to content

Commit

Permalink
Fix wrong EPSG conversion code for UTM south
Browse files Browse the repository at this point in the history
When generating a Conversion object for a UTM south conversion (for
example when importing from PROJ.4 or WKT1), we currently use a wrong
offset.

Fixes https://gis.stackexchange.com/questions/482037/what-is-epsg17056
  • Loading branch information
rouault committed Jun 5, 2024
1 parent e0e1482 commit 355a7c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/iso19111/operation/conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ getUTMConversionProperty(const util::PropertyMap &properties, int zone,
conversionName += (north ? 'N' : 'S');

return createMapNameEPSGCode(conversionName,
(north ? 16000 : 17000) + zone);
(north ? 16000 : 16100) + zone);
} else {
return properties;
}
Expand Down Expand Up @@ -1760,7 +1760,8 @@ ConversionNNPtr Conversion::createPopularVisualisationPseudoMercator(
* sphere at centerLat.
*
* This method is defined as
* <a href="https://epsg.org/coord-operation-method_1026/Mercator-Spherical.html">
* <a
* href="https://epsg.org/coord-operation-method_1026/Mercator-Spherical.html">
* EPSG:1026</a>.
*
* @param properties See \ref general_properties of the conversion. If the name
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ TEST(operation, utm_export) {
" PARAMETER[\"False northing\",10000000,\n"
" LENGTHUNIT[\"metre\",1],\n"
" ID[\"EPSG\",8807]],\n"
" ID[\"EPSG\",17001]]");
" ID[\"EPSG\",16101]]");

EXPECT_EQ(
conv->exportToWKT(
Expand Down

0 comments on commit 355a7c7

Please sign in to comment.