Skip to content

Commit 62dc3fd

Browse files
author
Olivier Courtin
committed
Merge pull request #65 from rouault/fix_projected_srs_ending_with_northing_NORTH
Fix incorrect inversion of axis order for projected SRS
2 parents 633ca48 + ce068ff commit 62dc3fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ows/ows_srs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ bool ows_srs_set(ows * o, ows_srs * c, const buffer * auth_name, int auth_srid)
134134

135135
sql = buffer_init();
136136
buffer_add_str(sql, "SELECT srid, position('+units=m ' in proj4text)");
137-
buffer_add_str(sql, ", (position('AXIS[\"X\",NORTH]]' in srtext) + position('AXIS[\"Easting\",EAST]]' in srtext))");
137+
buffer_add_str(sql, ", (position('AXIS[\"X\",NORTH]]' in srtext) + position('AXIS[\"Northing\",NORTH]]' in srtext))");
138138
buffer_add_str(sql, " FROM spatial_ref_sys WHERE auth_name='");
139139
buffer_copy(sql, auth_name);
140140
buffer_add_str(sql, "' AND auth_srid=");
@@ -161,7 +161,7 @@ bool ows_srs_set(ows * o, ows_srs * c, const buffer * auth_name, int auth_srid)
161161
else
162162
c->is_degree = false;
163163

164-
/* Is northing-easting SRID ? */
164+
/* Is easting-northing SRID ? */
165165
if (atoi(PQgetvalue(res, 0, 2)) != 0)
166166
c->is_eastern_axis = true;
167167

@@ -216,7 +216,7 @@ bool ows_srs_set_from_srid(ows * o, ows_srs * s, int srid)
216216
sql = buffer_init();
217217
buffer_add_str(sql, "SELECT auth_name, auth_srid, ");
218218
buffer_add_str(sql, "position('+units=m ' in proj4text), ");
219-
buffer_add_str(sql, "(position('AXIS[\"X\",NORTH]]' in srtext) + position('AXIS[\"Easting\",EAST]]' in srtext)) ");
219+
buffer_add_str(sql, "(position('AXIS[\"X\",NORTH]]' in srtext) + position('AXIS[\"Northing\",NORTH]]' in srtext)) ");
220220
buffer_add_str(sql, "FROM spatial_ref_sys WHERE srid = '");
221221
buffer_add_int(sql, srid);
222222
buffer_add_str(sql, "'");
@@ -240,7 +240,7 @@ bool ows_srs_set_from_srid(ows * o, ows_srs * s, int srid)
240240
else
241241
s->is_degree = false;
242242

243-
/* Is northing-easting SRID ? */
243+
/* Is easting-northing SRID ? */
244244
if (atoi(PQgetvalue(res, 0, 3)) != 0)
245245
s->is_eastern_axis = true;
246246

0 commit comments

Comments
 (0)