[OpenLayers-Dev] [UMN_MAPSERVER-USERS] [UMN_MAPSERVER-DEV] Projections

Bradley Mclain bradleym06 at gmail.com
Thu Jul 12 00:12:36 EDT 2007


I thought I had this one solved but after a firefox crash my WMS layer test
gives unresponsive script warnings and then when it eventually loads it
gives SRS errors in OpenLayers. i am almost positive that it was working
fine before this crash but maybe the changes had failed to update or
something. Calling the map in a WMS request using the new custom SRS
EPSG:41002 works fine.

The Mapserver Untiled test still works fine though and it is apparent that
the new projections are correct because they line up perfect with the Google
maps layers, unlike before where they were close but not perfect. The
Mapserver (tiled) test however shows up but the tiles do not line up
correctly for the Mapserver layers.

On 7/11/07, Bradley Mclain <bradleym06 at gmail.com> wrote:
>
> Just thought I let you all know I have managed to get it working, all I
> needed to do was convert the co-ordinates to get the new extent using proj,
> now everything lines up perfect and works beautifully.
>
> Thanks for all your help guys :)
>
> On 7/10/07, Bradley Mclain <bradleym06 at gmail.com> wrote:
> >
> > Any tips on how to do this? I've looked through0 the proj manual but I'm
> > a bit unsure how to go about it.
> >
> > On 7/10/07, Ed McNierney < ed at topozone.com> wrote:
> > >
> > >  Bradley –
> > >
> > >
> > >
> > > BBOX is a required WMS parameter, so you must be using it.
> > >
> > >
> > >
> > > You have to be able to express the geographic extents of your area of
> > > interest in the units used by your desired map projection.  Otherwise
> > > there's no way you can know what you're asking for.  I don't use OpenLayers
> > > and can't help you on its configuration, but you can use the PROJ
> > > command-line tools to reproject individual coordinate pairs from your input
> > > to your output projections so you can calculate a starting bounding box for
> > > your map.
> > >
> > >
> > >
> > > -          Ed
> > >
> > >
> > >
> > > *From:* Bradley Mclain [mailto:bradleym06 at gmail.com]
> > > *Sent:* Monday, July 09, 2007 10:11 PM
> > > *To:* Ed McNierney
> > > *Cc:* MAPSERVER-USERS at lists.umn.edu
> > > *Subject:* Re: [UMN_MAPSERVER-USERS] [UMN_MAPSERVER-DEV] Projections
> > >
> > >
> > >
> > > Being defined by server and clients at the moment shouldn't be an
> > > issue because I am testing off the server at the moment which I have updated
> > > the proj epsg file. Is this correct have I correctly understood this
> > > concept?
> > >
> > > How do I get the correct extent for this new projection I have
> > > absolutely now idea how to do it? I'm not using bbox so this shouldn't be a
> > > problem.
> > >
> > >  On 7/10/07, *Ed McNierney* <ed at topozone.com> wrote:
> > >
> > > Bradley –
> > >
> > >
> > >
> > > Don't just experiment with combinatorial testing – think about what
> > > you're trying to do, make sure you understand it, then be sure your map file
> > > and request do it.  Since we've explained that whatever EPSG code you're
> > > using is not standard, you need to be sure that it is defined in both the
> > > server and all clients.  Have you done that?  Failure to do so would be an
> > > obvious cause of an "SRS error" from the client.
> > >
> > >
> > >
> > > Remember that when you change your map file output or your WMS request
> > > to a different SRS, you need to change the extent or BBOX parameters, too.
> > > In a WMS request the BBOX parameter always uses the units of the SRS used,
> > > so you can't just keep the same GDA94 coordinates and expect them to work.
> > > If you don't change them, you're requesting a Mercator output image at some
> > > random location that bears no relation to your input data, so it is quite
> > > likely to give you a white image (since no input data overlaps the requested
> > > map area).
> > >
> > >
> > >
> > > -          Ed
> > >
> > >
> > >
> > > *From:* UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]
> > > *On Behalf Of *Bradley Mclain
> > > *Sent:* Monday, July 09, 2007 9:12 PM
> > > *To:* MAPSERVER-USERS at LISTS.UMN.EDU
> > > *Subject:* Re: [UMN_MAPSERVER-USERS] [UMN_MAPSERVER-DEV] Projections
> > >
> > >
> > >
> > > When I have the custom projection defined in my mapfile and the native
> > > projection defined for layers the map does not show up when doing a WMS
> > > getmap request, it just appears white.
> > >
> > > When I change it so that all layers have the custom projection, the
> > > map displays correctly from a WMS request but fails to display correctly in
> > > OpenLayers giving an SRS error.
> > >
> > > On 7/10/07, *Ed McNierney* <ed at topozone.com> wrote:
> > >
> > > Paul -
> > >
> > > Those parameters look good.  There is obviously not a "standard" EPSG
> > > code
> > > for this projection.
> > >
> > > Bradley, you need to decide whether you need to serve these WMS images
> > > out
> > > to the wide world ( i.e. clients over which you have no control) or
> > > only use
> > > them "internally" where you can control both your WMS server and the
> > > client.
> > >
> > > If it's the former, you have a problem, as there is no EPSG code
> > > describing
> > > the projection you need that seems to be in general usage so your
> > > clients
> > > can be expected to support it.  If it's the latter, you're fine.  You
> > > can
> > > simply pick any number you like that's not already taken and add that
> > > line
> > > to your EPSG file.  It's just a text file.  Let's assume you'll pick
> > > 41002
> > > (since 41001 seems to be in popular usage, but is wrong).  Then you'd
> > > add
> > > the single text line:
> > >
> > > <41002>+proj=merc +lat_ts=0 +lon_0=0 +k= 1.0 +x_0=0 +y_0=0 +a=
> > > 6378137.0
> > > +b=6378137.0 +units=m
> > >
> > > To the EPSG files on your server and on each client.  Then you can
> > > refer to
> > > it as SRS=EPSG:41002 in your WMS requests and you're all set.
> > >
> > >     - Ed
> > >
> > > > From: Paul Spencer <pspencer at DMSOLUTIONS.CA>
> > > > Date: Mon, 9 Jul 2007 14:55:22 -0400
> > > > To: Ed McNierney <ed at topozone.com >
> > > > Cc: "MAPSERVER-USERS at LISTS.UMN.EDU" <MAPSERVER-USERS at LISTS.UMN.EDU>
> > > > Subject: Re: [UMN_MAPSERVER-DEV] Projections
> > > >
> > > > Thanks for the clarification Ed (and for fixing the cross-list-
> > > > posting-bug :)).  I just looked into this more and you are correct
> > > (I
> > > > was completely wrong).  From the site that Bradley quoted, they seem
> > >
> > > > to think that the spherical projection is what is used by Google
> > > > etc.  The (unverified) proj.4 parameters for this seem to be:
> > > >
> > > > +proj=merc +lat_ts=0 +lon_0=0 +k=1.0 +x_0=0 +y_0=0 +a=6378137.0
> > > > +b=6378137.0 +units=m
> > > >
> > > > Cheers
> > > >
> > > > Paul
> > > >
> > > > On 9-Jul-07, at 2:06 PM, Ed McNierney wrote:
> > > >
> > > >> Paul -
> > > >>
> > > >> This doesn't seem correct to me.  You're suggesting a Transverse
> > > >> Mercator
> > > >> projection on an ellipsoid when the request was for a Mercator on a
> > > >> sphere.
> > > >>
> > > >> I did a little Googling around and while it appears that the 41001
> > > >> projection is often referred to as "Transverse Mercator", and there
> > >
> > > >> are
> > > >> several references to the PROJ definition you mention (+proj=tmerc,
> > > >> etc.),
> > > >> there is a more sensible reference to 41001 being defined in a
> > > >> GeoServer
> > > >> install as:
> > > >>
> > > >> PROJCS["WGS84 / Simple Mercator",
> > > >>   GEOGCS["WGS 84",
> > > >>     DATUM["WGS_1984",
> > > >>       SPHEROID["WGS_1984", 6378137.0, 298.257223563 ]],
> > > >>     PRIMEM["Greenwich", 0.0],
> > > >>     UNIT["degree", 0.017453292519943295],
> > > >>     AXIS["Lon", EAST],
> > > >>     AXIS["Lat", NORTH]],
> > > >>   PROJECTION["Mercator_1SP"],
> > > >>   PARAMETER["central_meridian", 0.0],
> > > >>   PARAMETER["scale_factor", 1.0],
> > > >>   PARAMETER["false_easting", 0.0],
> > > >>   PARAMETER["false_northing", 0.0],
> > > >>   UNIT["m", 1.0],
> > > >>   AXIS["x", EAST],
> > > >>   AXIS["y", NORTH],
> > > >>   AUTHORITY["EPSG","41001"]]
> > > >>
> > > >> This is more sensible (at least it's a Mercator projection!) but it
> > >
> > > >> is still
> > > >> a ellipsoidal rather than spherical projection, so it's not quite
> > > >> right.
> > > >>
> > > >> However, the entire universe of Web-based "geographic" projection
> > > >> fans,
> > > >> stimulated by Google and Microsoft, obviously don't really get
> > > >> bothered when
> > > >> their maps are "not quite right", so I should learn not to be so
> > > >> fussy.
> > > >>
> > > >>      - Ed
> > > >>
> > > >> P.S. I modified the reply to go only to the MAPSERVER-USERS list,
> > > >> since the
> > > >> original cross-posting to both lists only complicates matters for
> > > >> people
> > > >> trying to help.
> > > >>
> > > >>
> > > >>> From: Paul Spencer <pspencer at DMSOLUTIONS.CA>
> > > >>> Reply-To: Paul Spencer < pspencer at DMSOLUTIONS.CA>
> > > >>> Date: Sun, 8 Jul 2007 22:17:03 -0400
> > > >>> To: <MAPSERVER-DEV at LISTS.UMN.EDU >
> > > >>> Subject: Re: [UMN_MAPSERVER-DEV] Projections
> > > >>>
> > > >>> You need what is commonly referred to as EPSG:41001, defined as:
> > > >>>
> > > >>> <41001> +proj=tmerc +ellps=WGS84 +units=m +no_defs  <>
> > > >>>
> > > >>> To use this, add the above line to your 'epsg' file and also add a
> > > >>> projection object to your map object:
> > > >>>
> > > >>> PROJECTION
> > > >>> "init=epsg:41001"
> > > >>> END
> > > >>>
> > > >>> You will also need to make sure that every layer in your map file
> > > has
> > > >>> a proper projection so mapserver can reproject it correctly.
> > > >>>
> > > >>> Cheers
> > > >>>
> > > >>> Paul
> > > >>>
> > > >>> On 8-Jul-07, at 9:44 PM, Bradley Mclain wrote:
> > > >>>
> > > >>>> This is kind of hard to explain but what I want to do is use
> > > >>>> Mapserver to project my data which is in the GDA94 projection as
> > > >>>> shown below:
> > > >>>>
> > > >>>> "# GDA94 / MGA zone 55
> > > >>>> <28355> +proj=utm +zone=55 +south +ellps=GRS80
> > > >>>> +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>"
> > > >>>>
> > > >>>> to a projection that will be able to be properly merged with
> > > Google
> > > >>>> maps (using OpenLayers) which uses a projection something like
> > > the
> > > >>>> following:
> > > >>>>
> > > >>>> "Update 4: Agreement frrom Melita Kennedy and David Burrows that
> > > >>>> Google Maps and Virtual Earth use spherical equations for the
> > > >>>> Mercator projection.  The correct proj4  settings are:
> > > >>>>
> > > >>>> +proj=merc +latts=0 +lon0=0 +k=1.0 +x0=0 +y0=0
> > > >>>> +a=6378137.0 +b=6378137.0 +units=m
> > > >>>>
> > > >>>> Note this is different than using the  ellipsoidal equations
> > > which
> > > >>>> would be:
> > > >>>>
> > > >>>> +proj=merc +latts=0 +lon0=0 +k=1.0 +x0=0 +y0=0
> > > >>>> +ellps=WGS84 +datum=WGS84 +units=m no_defs"
> > > >>>>
> > > >>>> I believe that I need to use Mapserver to do this but I have no
> > > >>>> idea how to go about it. Currently my Mapserver is running fine
> > > >>>> displaying the data correctly using the GDA94 projection except i
> > > >>>> had to use a .vrt file to correctly align the raster image which
> > > >>>> was slightly out of alignment. I have also set up and can call my
> > > >>>> Mapserver as a WMS (thought having issues with the WMS Layer
> > > >>>> function in OpenLayers, just displays a white screen but I
> > > believe
> > > >>>> that this is to do with projections)
> > > >>>>
> > > >>>> My Mapserver has been compiled with GD, GDAL, GEOS, PostGIS, PHP
> > > >>>> and proj4.
> > > >>>>
> > > >>>> In my mapfile I have defined each layer using "init=epsg:28355"
> > > as
> > > >>>> well as globally defining the map using the same projection.
> > > >>>>
> > > >>>> This reason I am trying to do this is because currently I don't
> > > >>>> think that my projection can be properly imported into OpenLayers
> > >
> > > >>>> and merged with Google Maps.
> > > >>>>
> > > >>>> Thanks
> > > >>>>
> > > >>>> Brad
> > > >>>
> > > >>>
> > > +-----------------------------------------------------------------+
> > > >>> |Paul Spencer                          pspencer at dmsolutions.ca
> > >     |
> > > >>>
> > > +-----------------------------------------------------------------+
> > > >>> |Chief Technology Officer
> > > |
> > > >>> |DM Solutions Group Inc                http://www.dmsolutions.ca/|
> > > >>>
> > > +-----------------------------------------------------------------+
> > > >>
> > > >
> > > > +-----------------------------------------------------------------+
> > > > |Paul Spencer                          pspencer at dmsolutions.ca    |
> > > > +-----------------------------------------------------------------+
> > > > |Chief Technology Officer                                         |
> > > > |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
> > > > +-----------------------------------------------------------------+
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20070712/1bb4a1cf/attachment.html


More information about the Dev mailing list