[mapserver-commits] [MapServer/MapServer] 47f19e: msProjectRect(): cache whether source projection i...

Even Rouault noreply at github.com
Mon Dec 2 05:44:02 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/MapServer/MapServer
  Commit: 47f19e3f3a2bb55bfb0f8d8b760781f3218bc95a
      https://github.com/MapServer/MapServer/commit/47f19e3f3a2bb55bfb0f8d8b760781f3218bc95a
  Author: Even Rouault <even.rouault at spatialys.com>
  Date:   2024-12-02 (Mon, 02 Dec 2024)

  Changed paths:
    M src/mapproject.c
    M src/mapproject.h

  Log Message:
  -----------
  msProjectRect(): cache whether source projection is polar when repeatdly projecting from it (#7190)

Helps marginally on the belows scenario of
https://github.com/MapServer/MapServer/issues/7189 where the execution
time goes from ~440 ms to ~400 ms

```c++
#include "mapserver.h"
#include <stdio.h>
#include <string>

int main() {
    projectionObj src;
    msInitProjection(&src);
    msLoadProjectionStringEPSG(&src, "EPSG:25833");
    const int epsg_list[] = { 25832,
            3034,
            3035,
            3044,
            3045,
            31468,
            31469,
            3857,
            4258,
            4326,
            4647,
            5650,
            5652,
            5674,
            5675,
            5677,
            5678,
            5679,
            4937,
            7409,
            7423,
            9422,
            4979 };
    double minx=200000;
    double miny=5.886e+06;
    double maxx=465000;
    double maxy=6.075e+06;
    for( int epsg: epsg_list )
    {
        projectionObj dst;
        msInitProjection(&dst);
        msProjectionInheritContextFrom(&dst, &src);
        msLoadProjectionStringEPSG(&dst, (std::string("EPSG:") + std::to_string(epsg)).c_str());
        rectObj ext;
        ext.minx = minx;
        msProjectRect(&src, &dst, &ext);
        msFreeProjection(&dst);
    }
    msFreeProjection(&src);
    return 0;
}
```



To unsubscribe from these emails, change your notification settings at https://github.com/MapServer/MapServer/settings/notifications


More information about the MapServer-commits mailing list