开发者

NAD83 to WGS84 using Map Server

开发者 https://www.devze.com 2023-04-03 08:56 出处:网络
I\'m in the process of adding a WAC overlay to google maps. The map tiles are projected in NAD83 (lcc), google maps is WGS84 (mercator).

I'm in the process of adding a WAC overlay to google maps.

The map tiles are projected in NAD83 (lcc), google maps is WGS84 (mercator).

The WAC tiles are broken up into their individual areas as found on: http:开发者_运维问答//map.aeroplanner.com/mapping/chart/smartchart.cfm so there are quite a large number of tiles. That said, I'm currently experiencing problems positioning even a single tile.

The world file appears to be properly formed, as ArcGIS displays the tiles properly using the associated world file.

When using LCC projection and setting the lat/long that they tiles are expected to fill, the north and south tiles which comprise a WAC sector are correctly aligned with respect to each other.

http://img716.imageshack.us/img716/1742/waclcc.jpg - In this image, you can see CF16 A&B, and CF17 A&B. The projection looks like it is working correctly, however the position is wrong. An absolute lat/long must be assigned as leaving them out causes MapServer to throw a positioning error.

This is a segment from the map file which produces the above output:

LAYER TYPE RASTER NAME "16_40_NORTH" GROUP "wac" DATA "/opt/fgs/www/htdocs/WAC/CF-16 WAC 40 North.tif"

    #projection of this layer
    PROJECTION
            "proj=lcc"
            "lat_2=49"
            "lat_1=44.5"
            "lat_0=40"
            "lon_0=-125"
            "x_0=0"
            "y_0=0"
            "ellps=GRS80"
            "datum=NAD83"
            "units=m"
            "no_defs"
    END

    OFFSITE 0 0 0
END


LAYER
    TYPE RASTER
    NAME "16_40_SOUTH"
    GROUP "wac"
    DATA "/opt/fgs/www/htdocs/WAC/CF-16 WAC 40 South.tif"

    #projection of this layer
    PROJECTION
            "proj=lcc"
            "lat_2=49"
            "lat_1=44.5"
            "lat_0=40"
            "lon_0=-125"
            "x_0=0"
            "y_0=0"
            "ellps=GRS80"
            "datum=NAD83"
            "units=m"
            "no_defs"
    END

    OFFSITE 0 0 0
END

Other types of positioning such as UTM provide incorrect projections (in that the lines are not level) and are similarly incorrectly positioned.

Why is MapServer positioning so incorrectly despite being given absolute values, where ArcGIS displays the tiles using the world file without any problems?

Is it possible the version of MapServer is faulty, or is it more likely to be our mapfile?


We revisited this issue a month ago while solving a completely different issue.

What we found is that our legacy JavaScript (using Google Maps API) wasn't calculating the bounding box properly. We had assumed it was fine, given it had been in production for a few years without issue.

I investigated alternative mapping API's including leaflet.js and created a sample solution from scratch. We made some adjustments to our internal JavaScript functionality and were able to have the maps project correctly.

Personally, I've found Leaflet.js and OSM to be invaluable when trying to troubleshoot Google Maps issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号