[OpenLayers-Users] projections/resolution/extents

David Fawcett david.fawcett at gmail.com
Thu Aug 7 11:30:43 EDT 2008


Even though you carried this issue over to the OpenLayers list, your
problem still has nothing to do with OpenLayers.  I would suggest
working this issue out in MapServer with a simple mode=map request
before attempting to serve the data up as a WMS or through OpenLayers.

If I recall some of your previous posts from MapServer-Users related
to this issue, you have a few layers that are in different spatial
reference systems (SRS), and you don't know what SRS one of the layers
is in.  By the extent values it looks like it is being expressed in
meters or feet.  It could be UTM.

To find out what SRS the data is in, you will likely have to ask the
person that you got it from (if there was no metadata that came with
it).  If you think that it is in UTM, you could look at what the
values for the coordinates in your area of interest would be in your
local UTM zone.

If you don't know what SRS your data is in, you will not be able to
serve up data layers with different SRS.  MapServer only outputs the
map in one SRS.  You can use data layers that have different SRS as
long as you have projection blocks for the map and for each layer
defining the SRS for the output and for each input layer.  Also, note
that the EXTENT values need to be in the units used by your output
SRS.

David.

On Thu, Aug 7, 2008 at 7:41 AM, FCampos <fcampos at efacec.pt> wrote:
>
> Hi Christopher .
> I really need to understand this because i´m having troubles shownig a map,
> and i think this maybe the problem.
>
> I´ve a mapserver with 3 layers (2 oracle 1 shape).
>
> With the following code, my oracle layers only show zoom 0 and 1.
> The shape file show in every zooms.
>
> I was thinking that is a mapserver, but i random try a resolution and
> finnaly i see something in zoom 0 and 1.
>
> in mapserver i´ve got EXTENT -180 -90 180 90
> But with a export of qgis it gives me a
> EXTENT -448507.794215 -314818.265947 491449.524215 290499.415448
>
> what unit is this ?? not lat/lon ?
>
> i´m confused !
>
>
>
>                  map = new OpenLayers.Map( 'map',
>                                                                                        {
>                                                                                                controls: [
>                                                                                                                 new OpenLayers.Control.Navigation(),
>                                                                                     new OpenLayers.Control.PanZoomBar()],
>                                                                                        } );
>            var basemap = new OpenLayers.Layer.WMS.Untiled( "MS 4.10",
>                "http://172.18.210.67:8080/cgi-bin/mapserv.exe?",
>                {map: '/ms4w/apps/wmssrvrefer/ora.map', layers:
> 'country,Cont_Freg_CAOP2008_HG73,streets', format: 'png', 'transparent':
> 'off'},
>                {
>                                        maxResolution: 10000 ,
>                                        projection:"EPSG:4326" }
>                                );
>            map.addLayers([basemap]);
>                        map.setCenter(new OpenLayers.LonLat(-8, 39.5), 0);
>
>
>
>
>
>
>
>
> Christopher Schmidt-4 wrote:
>>
>> On Thu, Aug 07, 2008 at 05:12:10AM -0700, FCampos wrote:
>>>
>>> Hi,
>>> is there anywhere, a good tutorial for :
>>>
>>> - what extents in mapserver, and what is the consequence in the
>>> resolution /
>>> extent/ scales of openlayers ?
>>
>> Resolution is "map units per pixel". By default, OpenLayers uses a
>> maxExtent of:
>>
>>   -180,-90,180,90
>>
>> It uses a default maxResolution of:
>>
>>   1.40625
>>
>> Which means that each tile is:
>>
>>   1.40625 * 256 -> 360 map units (degrees)
>>
>> Scales are never important to OpenLayers, but you can display them
>> (using OpenLayers default DOTS_PER_INCH of 72) using the
>> OpenLayers.Control.Scale(), which allows you to use those values in
>> other tools like SLD or Mapfiles.
>>
>> To pick a good maxResolution, generally taking your map extent and
>> dividing by 256 or 512 is a good start. You can also set maxResolution
>> "auto" -- this will divide the extent by the size of your map in the
>> larger direction, fitting your map tiles exactly (at the cost of using
>> different URLs for different map sizes, and therefore avoiding caches
>> and not working with things like TileCache).
>>
>> Regards,
>> --
>> Christopher Schmidt
>> MetaCarta
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
> --
> View this message in context: http://www.nabble.com/projections-resolution-extents-tp18869013p18869558.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list