[Mapserver-users] geotiff output problem

Aaron D. Hunt hunt at zedxinc.com
Wed Jan 28 07:57:07 PST 2004


The perl and mapfile are bellow.

Perl
#!/usr/bin/perl

use lib("/home/mapserver");
use mapscript40;

$ENV{MS_ERRORFILE} = "mapserver.log";
$ENV{PROJ_LIB} = "/home/mapserver/proj-4.4.7/nad/";

my $map = new mapscript40::mapObj("geotif.map") or die("Unable to open
mapfile. $!");

$img = $map->draw() or die('Unable to draw map');

$imagename = "test.tiff";

$img->save($imagename);

Map file

#
# Start of map file
#
NAME Demo
STATUS ON
SIZE 500 500

EXTENT 720138 3723926 721518 3724986


SHAPEPATH "/tmp"
IMAGECOLOR 255 255 255

 WEB
   IMAGEPATH "/home/hunt/"
   IMAGEURL ""
 END

 PROJECTION
  "init=epsg:26915"
 END

 OUTPUTFORMAT
   NAME GTiff
   DRIVER "GDAL/GTiff"
  MIMETYPE "image/tiff"
  IMAGEMODE RGB
   EXTENSION "tif"
 END



 LAYER
    NAME ortho-15
    METADATA
      "wms_title" "USGS Digital Ortho-Quadrangles"
      "wms_srs"   "EPSG:26915" #NAD83 UTM zone 15N
      #"wms_latlonboundingbox" "-78 0 -72 90"
      LYRNAME "DOQs (orthophotos)"
      LINK
"http://terraserver.microsoft.com/about.aspx?n=AboutTerraServiceOverview"
    END
    #MAXSCALE 700000
    #MINSCALE 5401
    OFFSITE 255 255 255
    GROUP "ORTHO DATA"
    STATUS ON
    TYPE RASTER
    CONNECTIONTYPE WMS
    CONNECTION
"http://terraservice.net/ogcmap.ashx?VERSION=1.1.1&SERVICE=wms&LAYERS=DOQ&FO
RMAT=image/jpeg&styles="
    PROJECTION
      "init=epsg:26915" #NAD83 UTM zone 15N
    END
 END

END

----- Original Message ----- 
From: "Frank Warmerdam" <warmerdam at pobox.com>
To: "Aaron D. Hunt" <hunt at zedxinc.com>
Sent: Tuesday, January 27, 2004 6:08 PM
Subject: Re: [Mapserver-users] geotiff output problem


> Aaron D. Hunt wrote:
> > I worked when I used shp2img. Is there any reason it is not working in
the
> > script?
>
> Aaron,
>
> I seem to have misplaced your original email, and it isn't in the archive
> yet.  Could you resend it?  I am wondering if there is anything
> peculiar about how you call stuff from the Perl script.
>
> Best regards,
>
> -- 
> ---------------------------------------+----------------------------------
----
> I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>




More information about the MapServer-users mailing list