[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapserver-users
Subject:    Re: [mapserver-users] mapserver wrong scale computation
From:       Worth Lutz <wal3 () mindspring ! com>
Date:       2014-07-09 16:18:49
Message-ID: 53BD6B69.1030304 () mindspring ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Are you using mapscript? If so leave resolution alone and do the 
following in the order shown (important!):

$map = new mapObj($mapfile);

// set the image size first - important!
$map->setSize($width, $height);

// now set extent
// extent will be modified to fit into aspect ratio of the size set above
$map->setExtent($minx, $miny, $maxx, $maxy);

$w = $map->width;
$h = $map->height;

$x = $map->width / 2;
$y = $map->height / 2;

$centerPixel = new pointObj();
$centerPixel->setXY($x, $y);


$map->zoomScale($scale, $centerPixel, $map->width, $map->height, 
$map->extent);

I get good pdf maps which print accurately to scale using this method.


*Worth Lutz*
------------------

On 07/09/2014 10:55 AM, Mario Jurcevic wrote:
> Hi,
> I am trying to create an image with same size as the map extent, only 
> by a scale factor of 500.
> The mapserver scale computation gives 500.8989383487 scale.
>
> If I set the image inch*72.129302863661 instead of default 72 the 
> mapsever scale computed is
> 500.00127000041.
>
> What is the correct value for resolution?
>
> Regards,
> Mario Jurcevic
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Are you using mapscript? If so leave
      resolution alone and do the following in the order shown
      (important!):<br>
      <div class="moz-signature"><br>
        $map = new mapObj($mapfile);<br>
        <br>
        // set the image size first - important!<br>
        $map-&gt;setSize($width, $height);<br>
        <br>
        // now set extent<br>
        // extent will be modified to fit into aspect ratio of the size
        set above<br>
        $map-&gt;setExtent($minx, $miny, $maxx, $maxy);<br>
        <br>
        $w = $map-&gt;width;<br>
        $h = $map-&gt;height;<br>
        <br>
        $x = $map-&gt;width / 2;<br>
        $y = $map-&gt;height / 2;<br>
        <br>
        $centerPixel = new pointObj();<br>
        $centerPixel-&gt;setXY($x, $y);<br>
        <br>
        <br>
        $map-&gt;zoomScale($scale, $centerPixel, $map-&gt;width,
        $map-&gt;height, $map-&gt;extent);<br>
        <br>
        I get good pdf maps which print accurately to scale using this
        method.<br>
        <br>
        <br>
        <b>Worth Lutz</b><br>
        ------------------<br>
        <br>
      </div>
      On 07/09/2014 10:55 AM, Mario Jurcevic wrote:<br>
    </div>
    <blockquote cite="mid:53BD57EA.9070408@geosar.ch" type="cite">Hi,
      <br>
      I am trying to create an image with same size as the map extent,
      only by a scale factor of 500.
      <br>
      The mapserver scale computation gives 500.8989383487 scale.
      <br>
      <br>
      If I set the image inch*72.129302863661 instead of default 72 the
      mapsever scale computed is
      <br>
      500.00127000041.
      <br>
      <br>
      What is the correct value for resolution?
      <br>
      <br>
      Regards,
      <br>
      Mario Jurcevic
      <br>
      <br>
      _______________________________________________
      <br>
      mapserver-users mailing list
      <br>
      <a class="moz-txt-link-abbreviated" \
href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>  \
                <br>
      <a class="moz-txt-link-freetext" \
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
  <br>
      <br>
    </blockquote>
    <br>
  </body>
</html>



_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic