Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

all, I want to use openlayers with mapserver to create map of stars. but I dont know how to setting up the WMS config in mapserver , especially the EPSG re-projection things. In fact, I didnt any re-projection, and I just want to mapserver provide WMS and communicate with openlayers.

anyone can give some advice?

many thanks zzz

share|improve this question
add comment

1 Answer 1

In case you want your mapserver to provide WMS layer, which is reprojected on the fly you will require GDAL to be configured with your MapServer. If you are on windows a simple solution is installing MS4W. Now your mapfile definition could be as simple as follows:

    MAP
        NAME USA
        STATUS ON
        SIZE 800 500
        IMAGETYPE PNG
        IMAGECOLOR 240 240 240
        SHAPEPATH "/var/www/html/data"
        UNITS dd
      # The projection object is typically used within the map and the layer
      # objects. You only define it once within the map object and this definition
      # becomes your output projection--MapServer will render your maps in this
      # projection.  You also use the projection object within the layer object to 
      # define your input projection.  Your layers can be in different 
      # projections--MapServer will reproject them into your output projection.
        PROJECTION
            "init=epsg:4326"
        END
        WEB
            IMAGEPATH "/var/www/html/tmp/"
            IMAGEURL "/tmp/"
        END

        LAYER
            NAME "US state boundaries"
            TYPE POLYGON
            STATUS ON
            DATA "statesp020"
            PROJECTION
                # projection for the Continental U.S.
                  "proj=laea"
                  "ellps=clrk66"
                  "lat_0=45"
                  "lon_0=-100"
            END
            CLASS
                NAME "US states"
                OUTLINECOLOR 60 60 60
                COLOR 255 255 0
                SYMBOL 0
            END
        END 
    END

Here your input projection is Lambert Azimuthal Equal-Area (for US state boundaries layer) and your output is geographic (latlong) projection using the WGS84 datum

share|improve this answer
    
Works! Thanks a lot! In fact, I just put PROJECTION "init=epsg:4326" END –  zzz May 2 '12 at 5:40
    
@zzz If it solves your requirement you can accept the answer. –  thelastray May 2 '12 at 6:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.