Use of different epsg code

Brent Fraser bfraser at GEOANALYTIC.COM
Fri Apr 20 11:02:02 EDT 2007


Antonio,

See comments inserted below...

Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta

----- Original Message ----- 
From: "Antonio" <volpicelli at oato.inaf.it>
To: "Brent Fraser" <bfraser at geoanalytic.com>
Cc: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Friday, April 20, 2007 3:02 AM
Subject: Re: [UMN_MAPSERVER-USERS] Use of different epsg
code


> Thanks Brent,
> I start to see a bit of light.
> So I tried to change units in meters but there is always
something not
> clear.
>
> I have :
> MAP
>     NAME ASTRO
>     STATUS ON
>     EXTENT -18000000 -9000000 18000000 9000000
>     UNITS meters
>     TRANSPARENT ON
>     SHAPEPATH "G:/GalexData/TestPoint"
>     CONFIG "PROJ_LIB" "E:/ms4w/proj/nad/"
>
>     PROJECTION
>             "init=epsg:54009"  # Mollweide
>       END
>
> and at the layer level If I define epsg:54009 with
MAXARC=1 and
> MAXINTERVAL=1500000 the graticule is just rectangular
grid.
> If I define epsg:4326 with MAXARC=1 and MAXINTERVAL=15 I
can see the
> whole mollweide sphere.

Good, that works as expected.

> My application use astronomic data then my shape files
data are in sky
> coordinates  ( somenthing like Lon and Lat) .
> If I draw using mapserver one of this shape (see LAYER
"TestPoints") ,
> the objects go in the right position in the Mollweide
projection , the
> only thing is that the grid and the data are not using the
same projection.

In the LAYER object, the PROJECTION object refers to the
coordinate system of the input data described in the LAYER
object (for example, your data files, or the line segments
generated by the GRID object).  The PROJECTION object for
the MAP object determines the coordinate system of the
output data (the graphic displayed in the browser).  Each
LAYER can have a different PROJECTION definition, and if
they are different from the MAP object's PROJECTION
Mapserver will do the map projection calaculation on-the-fly
(every time it creates the output graphic) to convert all
the input data to the output coordinate system. This is one
of best features of Mapserver.

For Mapserver to put all the data in the right place when it
generates the output graphic, you must correctly define the
coordinate system of the input data in the Map file's LAYER
objects (whoever created the data must tell you which
coordinate system it's in).  The choice of the output
coordinate system (in the MAP object) is entirely up to you.



> I tried to use Aitoff projection too.
> There isn't an epsg code for that, so I inserted one with
an unused id .

There's no point in doing that (EPSG is the organization
that defines the codes). Instead use the Proj4 method of
defining the coordinate system:
  PROJECTION
        "proj=aitoff"
        "lon_0=00d"
  END

> But here too , in the layer definition I have to use
epsg:4326 to plot
> the points in the Aitoff projection but I am not able to
draw the grid
> sphere.
>

Your LAYER definitions below and the MAP definition above
are ok.  The only change I would suggest is to set MAXARCS
10 or comment it out and use MAXINTERVAL 30.

>
>
> LAYER
>    NAME "Grid"
>    METADATA
>      "DESCRIPTION" "Grid"
>    END
>    TYPE LINE
>    STATUS OFF
>    CLASS
>      NAME "Graticule"
>      COLOR 123 123 123
>   END
>   PROJECTION
>       "init=epsg:4326"
>       #"init=epsg:54009" # Mollweide
>   END
>   GRID
>     MAXARCS 2
>    # MAXINTERVAL 15000000
>
>   END
>
> LAYER
>   NAME "TestPoints"
>   TYPE POLYGON
>   STATUS ON
>
>   DATA "TestPoints"
>   PROJECTION
>         "init=epsg:4326"
>   END
>
>   LABELITEM 'tilename'
>   DUMP true
>
>   CLASS
>     NAME "TestPoint"
>     STYLE
>       SIZE 2
>       OUTLINECOLOR 123 123 123
>       COLOR 0 0 255
>         END
>     LABEL
>       MINFEATURESIZE 200
>     END
>
>   END
>
>    METADATA
>       GML_INCLUDE_ITEMS
"tilename,survey,ra,dec,nuvexptime,fuvexptime"
>       WMS_SERVER_VERSION "1.1.1"
>       WMS_FORMAT "image/png"
>       WMS_TITLE "Galex AIS Survey"
>       WMS_ABSTRACT "SDSS DR3 imaging level 0"
>       WMS_SRS "EPSG:54009"
>       WMS_NAME "TestPoint"
>      #WMS_FORCE_SEPARATE_REQUEST "0"
>     END
>
>
> END



More information about the mapserver-users mailing list