@@ -190,16 +190,21 @@ namespace Isis {
190190 projJson = projJson[" base_crs" ];
191191 }
192192
193- std::string direction = projJson[" coordinate_system" ][" axis" ][1 ][" direction" ];
194- if (direction == " east" ) {
195- mappingGroup.addKeyword (PvlKeyword (" LongitudeDirection" , " PositiveEast" ));
196- }
197- else if (direction == " west" ) {
198- mappingGroup.addKeyword (PvlKeyword (" LongitudeDirection" , " PositiveWest" ));
199- }
200- else {
201- QString msg = " Unknown direction [" + QString::fromStdString (direction) + " ]" ;
202- throw IException (IException::Programmer, msg, _FILEINFO_);
193+ nlohmann::json axes = projJson[" coordinate_system" ][" axis" ];
194+ for (nlohmann::json axis : axes) {
195+ if (axis[" name" ] == " Longitude" ) {
196+ std::string direction = axis[" direction" ];
197+ if (direction == " east" ) {
198+ mappingGroup.addKeyword (PvlKeyword (" LongitudeDirection" , " PositiveEast" ));
199+ }
200+ else if (direction == " west" ) {
201+ mappingGroup.addKeyword (PvlKeyword (" LongitudeDirection" , " PositiveWest" ));
202+ }
203+ else {
204+ QString msg = " Unknown direction [" + QString::fromStdString (direction) + " ]" ;
205+ throw IException (IException::Programmer, msg, _FILEINFO_);
206+ }
207+ }
203208 }
204209
205210 if (oSRS.GetSemiMajor () == oSRS.GetSemiMinor ()) {
@@ -215,7 +220,7 @@ namespace Isis {
215220 // Read the GeoTransform and get the elements we care about
216221 double *padfTransform = new double [6 ];
217222 dataset->GetGeoTransform (padfTransform);
218- if (abs (padfTransform[1 ]) != abs (padfTransform[5 ])) {
223+ if (( abs (padfTransform[1 ]) - abs (padfTransform[5 ])) > 1e-2 ) {
219224 delete[] padfTransform;
220225 QString msg = " Vertical and horizontal resolution do not match" ;
221226 throw IException (IException::Io, msg, _FILEINFO_);
0 commit comments