Skip to content

Commit

Permalink
small refactoring hopefully fixing macos build problems #12
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Oct 26, 2023
1 parent 76dfa43 commit 56cc971
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/polyconvert/PCLoaderArcView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ PCLoaderArcView::loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, PCTypeMap&
#ifdef HAVE_GDAL
const PositionVector
PCLoaderArcView::toShape(OGRLineString* geom, const std::string& tid) {
OGRSpatialReference* srs = geom->getSpatialReference();
bool latLongOrder = srs != nullptr && srs->GetAxisMappingStrategy() == OSRAxisMappingStrategy::OAMS_AUTHORITY_COMPLIANT;
const OGRSpatialReference* const srs = geom->getSpatialReference();
const bool latLongOrder = srs != nullptr && srs->GetAxisMappingStrategy() == OSRAxisMappingStrategy::OAMS_AUTHORITY_COMPLIANT;
if (myWarnMissingProjection) {
int outOfRange = 0;
for (int j = 0; j < geom->getNumPoints(); j++) {
Expand All @@ -103,15 +103,10 @@ PCLoaderArcView::toShape(OGRLineString* geom, const std::string& tid) {
Position pos(geom->getX(j), geom->getY(j));
#else
for (const OGRPoint& p : *geom) {
double x, y;
Position pos(p.getX(), p.getY());
if (latLongOrder) {
x = p.getY();
y = p.getX();
} else {
x = p.getX();
y = p.getY();
pos.set(p.getY(), p.getX());
}
Position pos(x, y);
#endif
if (!geoConvHelper.x2cartesian(pos)) {
WRITE_ERRORF(TL("Unable to project coordinates for polygon '%'."), tid);
Expand Down

0 comments on commit 56cc971

Please sign in to comment.