Merging different projection

Ed McNierney ed at TOPOZONE.COM
Fri Feb 18 06:39:36 PST 2005


Sten-Helge -

If you are going to use data sources in different projections you MUST
describe the projection of EVERY layer with a PROJECTION block, and you
must describe the output map image projection with a top-level
PROJECTION block.  If you don't tell MapServer "this layer is projection
A, this one is projection B, and the output is projection C", then it
has no way to know that information.

The first step I'd suggest is to add the PROJECTION blocks to the map
and first layer, and get that working to the point where you can
reproduce the output you get with just the first layer and no PROJECTION
blocks.  Then we can try to add the second projection.

     - Ed

Ed McNierney
TopoZone.com

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Sten-Helge Henriksen
Sent: Friday, February 18, 2005 9:27 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Merging different projection

On Fri, 18 Feb 2005 08:50:33 -0500, Ed McNierney <ed at TOPOZONE.COM>
wrote:

>Sten-Helge -
>
>Could you post the map file you are using that does not work properly?
>Are you describing a PROJECTION block for each layer, selecting an
>output PROJECTION for the map image, and setting the output map EXTENT
>to match the output projection?
>
>        - Ed
>
>Ed McNierney
>TopoZone.com
>
>-----Original Message-----
>From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]
On
>Behalf Of Sten-Helge Henriksen
>Sent: Friday, February 18, 2005 6:53 AM
>To: MAPSERVER-USERS at LISTS.UMN.EDU
>Subject: [UMN_MAPSERVER-USERS] Merging different projection
>
>Hi all!
>I have two different types of shape files whice I would like to use in
>the
>same .map.
>The projection from the first corresponding .prj file looks like this;
>
>PROJCS["WGS_1984_UTM_Zone_33N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984"
>,SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0]
>,UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],
>PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],
>PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",0.9996],
>PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
>
>while from the second, it looks like this;
>GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,
2
>98.257223563]
>],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
>
>I have tried several ways, with differnt types of projection to get
>those
>two filetypes into the same map, without success.
>
>Separately they turn up nicely with respectively extent;
>EXTENT 404929.999959 7516685.438843 424106.999991 7544257.142516
>and
>EXTENT -4.792797 37.909400 51.301297 81.166931
>
>Does anyone have a clue how to solve this?
>
>Thanks in advance
>
>stenhh

Hello there!

Here is a dump of my mapfile with those two layers in qustion. Layer #1
takes data from a dataset based on proj=utm, zone=33, ellps=WGS,
datum=WGS84
and units=meters. Together with extent #1, it works perfectly.
Layer #2 with extent #2 does also work perfectly.

However, my objective is to get those two dataset to work together in
the
same .map, even though they have different projections, and I can't
figure
out which projection to use on layer #2. Even though I have the
corresponding .prj file for the second dataset, it dosn't seem to work.
Just
a blank screen with no errors.

MAP
  NAME cmis
  STATUS ON
  EXTENT 404929.999959 7516685.438843 424106.999991 7544257.142516
#extent 1
# Extent -4.792797 37.909400 51.301297 81.166931 #extent 2
  SIZE 800 600
  SYMBOLSET "./etc/symbols.sym"
  UNITS meters
  FONTSET ./etc/fonts.txt
  DEBUG ON
 TEMPLATEPATTERN "cmis"
  WEB
    IMAGEPATH "set in index.html"
    IMAGEURL "set in index.html"
    TEMPLATE test.html84
    LOG "/tmp/mapserv.log"
  END

##### Layer #1

 LAYER
    NAME "Kontur"
    STATUS default
    TYPE line
    CONNECTIONTYPE postgis
    CONNECTION "user=xxxx dbname=xxxx host=xxxxx"
    DATA "the_geom from areal_line"
    FILTER "objtype='Coastal'"
    CLASS
      NAME "Kontur"
      #EXPRESSION "0"
      STYLE
        SYMBOL 0
        COLOR 225 0 0
        OUTLINECOLOR 186 234 245
        SIZE 1
        MINSIZE 1
        MAXSIZE 100
      END
    END

  END

#### Layer #2
  LAYER
    NAME "country_boundaries"
    STATUS default
    TYPE line
    UNITS meters
    CONNECTIONTYPE postgis
    CONNECTION "user=xxxx dbname=xxxx host=xxxx"
    DATA "the_geom from country_boundaries"
    PROJECTION
#      "proj=utm"
#      "zone=33"
#      "ellps=WGS84"
#      "datum=WGS84"
#      "units=m"
#      "no_defs"
       "init=epsg:4326" # I have tried many of these wihtout success
#       "proj=latlong"
    END
    CLASS
      NAME "country_boundaries"
      #EXPRESSION "0"
      STYLE
        SYMBOL 0
        COLOR 225 0 0
        OUTLINECOLOR 186 234 245
        SIZE 1
        MINSIZE 1
        MAXSIZE 100
      END
    END
  END

END #MAP



More information about the MapServer-users mailing list