Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reprojection error for CONNECTIONTYPE WMS #5437

Closed
Schneegans opened this issue May 30, 2017 · 2 comments
Closed

Reprojection error for CONNECTIONTYPE WMS #5437

Schneegans opened this issue May 30, 2017 · 2 comments

Comments

@Schneegans
Copy link

Schneegans commented May 30, 2017

I am using mapserver to reproject raster data from various projections to the HEALPix projection from proj.4. This works well when the layer source is a raster, however I get severe reprojection problems when using an external WMS as source for my layer.

Some examples

Here is the layer description for the raster source (I omitted all metadata for clarity, if this is important, I can provide it):

LAYER
    NAME "bluemarble"
    STATUS ON
    TYPE RASTER
    DATA "bluemarble.vrt"

    PROJECTION
        AUTO
    END
END

And here we have the WMS sourced layer:

LAYER
    NAME "dlrbasemap"
    TYPE RASTER
    STATUS ON

    CONNECTION "https://geoservice.dlr.de/eoc/basemap/wms?"
    CONNECTIONTYPE WMS

    METADATA
        WMS_NAME            "basemap"
        WMS_SERVER_VERSION  "1.1.1"
        WMS_FORMAT          "image/png"
        WMS_SRS             "EPSG:4326"
        WMS_TITLE           "dlrbasemap"
    END
END

In the epsg file I added this line:

<900916> +proj=healpix +a=1 <>

When I request the raster layer with ...&LAYERS=bluemarble&SRS=EPSG:900916&BBOX=-3.5,-1.6,3.5,1.6 I get the expected result:

healpix_good_all

When I perform the very same request but with ...&LAYERS=dlrbasemap&... I get an empty image.
For smaller bounding boxes (...&LAYERS=bluemarble&SRS=EPSG:900916&BBOX=-0.5,0.6,0.5,1) I get again correct results for the raster layer but somehow distorted results for the WMS layer.

Raster layer:
healpix_good

WMS layer:
healpix_bad

(for example observe how parts of Africa are missing)

Some thoughts

  • Maybe it's just a configuration problem? But that seems unlikely since the reprojection is working more or less, it looks more like a precision problem...
  • I guess that we see here actually two problems:
    1. The source bounding box is calculated incorrectly, resulting in a empty map in the first example
    2. Something goes wrong during the reprojection itself (example 2)

What to do now?

  • Is there any information I should provide additionally?
  • I am willing to have look at the source code myself (actually already skimmed through several parts, especially mapwmslayer.c) but I will need some guidance where I should start investigating...

Thank you!

Edit: It seems as if this issue could be reproduced with this tiny example GeoTiff: test.zip

Reprojection with gdal works: gdalwarp -t_srs '+proj=healpix +a=1 +b=1 +wktext' -te -0.5 0.6 0.5 1 test.tiff healpix.tiff, using it in a layer as above results in the distortion:

LAYER
    NAME "test"
    STATUS ON
    TYPE RASTER
    DATA "test.tiff"

    PROJECTION
        AUTO
    END
END
@jmckenna
Copy link
Member

please start by sending this to the mapserver-users mailing list, where many eyes will be able to help you decide if it is a config issue or not (subscribe at https://lists.osgeo.org/listinfo/mapserver-users). Also, in your message to that mailing list, be sure to not include images, please use an external service (such as http://pasteboard.co/) and include that link in your email message. thanks.

@Schneegans
Copy link
Author

Fixed with #5447. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants