<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=210532016-26082004><FONT face=Arial 
color=#0000ff size=2>Brant -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=210532016-26082004><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=210532016-26082004><FONT face=Arial 
color=#0000ff size=2>Thanks - I guess I must have slept through that one 
&lt;g&gt;.&nbsp; Considering that I'm a rather heavy user of tile indexes, I 
guess I should pay more attention!</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=210532016-26082004><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=210532016-26082004><FONT face=Arial 
color=#0000ff size=2>You might want to try one of the GDAL command-line tools to 
read the JP2 files you've got - maybe just convert one to a TIFF.&nbsp; That 
would help ensure that you've (a) got valid JP2 files and (b) that GDAL's 
working correctly at least in that case.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=210532016-26082004><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=210532016-26082004>&nbsp;&nbsp;&nbsp; <FONT 
face=Arial color=#0000ff size=2>- Ed</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=210532016-26082004>
<P><FONT size=2>Ed McNierney<BR>President and Chief Mapmaker<BR>TopoZone.com / 
Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North Chelmsford, 
MA&nbsp; 01863<BR>ed@topozone.com<BR>(978) 251-4242 </FONT></P></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List 
[mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <B>On Behalf Of </B>Brant 
Anderson<BR><B>Sent:</B> Thursday, August 26, 2004 2:18 PM<BR><B>To:</B> 
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> Re: [UMN_MAPSERVER-USERS] JPEG 
2000 format instead of TIFF for a RASTER layer<BR></FONT><BR></DIV>
<DIV></DIV>The two layer combination is the "new way" of doing tile indexes. I 
have tried both the original and the new ways.<BR><BR>Look at this post: <A 
class=moz-txt-link-freetext 
href="http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0405/msg00799.html">http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0405/msg00799.html</A><BR><BR>After 
seeing this message in the apache error log...<BR>[Thu Aug 26 02:29:45 2004] 
[error] [client 192.168.1.101] malformed header from<BR>script. Bad 
header=GeoJp2 info found...: /usr/lib/cgi-bin/mapserv421<BR><BR>... I am 
wondering if it is an internal Mapserver/GDAL/Apache error. I looked up 
"malformed header" on the Apache site.<BR><A class=moz-txt-link-freetext 
href="http://search.apache.org/index.cgi?query=malformed+header&amp;what=docs1&amp;brief=1&amp;submit=Search%21">http://search.apache.org/index.cgi?query=malformed+header&amp;what=docs1&amp;brief=1&amp;submit=Search%21</A><BR>Result 
2 <A href="http://httpd.apache.org/docs/misc/compat_notes.html">Apache HTTP 
Server: Notes about Compatibility with NCSA's Server</A> looks to be the most 
relevant result.<BR><BR>This line...<CODE><BR>exec cgi=""</CODE> produces 
reasonable <STRONG>malformed header</STRONG> responses when used to invoke 
non-CGI scripts.<BR>The NCSA code ignores the missing header (bad 
idea).<BR>Solution: write CGI to the CGI spec and use 
<CODE>include&nbsp;virtual</CODE>, or use <CODE>exec cmd=""</CODE> 
instead.<BR>...appears to be somewhat related. I'm not familiar with the 
interworkings of Apache, so I'm not sure.<BR><BR>I feel confident that my syntax 
is correct. I have beat it to death! For some reason, gdal-config is telling me 
that I have JPEG2000 support. I know that it was compiled in. But maybe the way 
gdal is calling the JPEG2000 conversion isn't working via the 
web-server.<BR><BR><BR>Any insight?<BR><BR>Thanks,<BR>Brant<BR><BR><BR><BR>Ed 
McNierney wrote: 
<BLOCKQUOTE cite=mid2A6FDD75AE04BE4A9E8C918D3C09FB0721CD25@ptolemy.topozone.com 
type="cite">
  <META content="MSHTML 6.00.2800.1458" name=GENERATOR>
  <DIV dir=ltr align=left><SPAN class=812220812-26082004><FONT face=Arial 
  color=#0000ff size=2>Brant -</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=812220812-26082004></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=812220812-26082004><FONT face=Arial 
  color=#0000ff size=2>You've posted two LAYER definitions - what's the second 
  one for?&nbsp; The default field name used to look up the name of the image 
  file is not "PATH" - that's why there's a TILEITEM statement in the second 
  LAYER definition you've posted.&nbsp; But there is no such TILEITEM statement 
  in the LAYER where you're trying to use the JPEG2000 
files.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=812220812-26082004></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=812220812-26082004>&nbsp;&nbsp;&nbsp; 
  <FONT face=Arial color=#0000ff size=2>- Ed</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=812220812-26082004><!-- Converted from text/plain format -->
  <P><FONT size=2>Ed McNierney<BR>President and Chief Mapmaker<BR>TopoZone.com / 
  Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North Chelmsford, 
  MA&nbsp; 01863<BR>Phone: +1 978 251-4242&nbsp;&nbsp; Fax: +1 978 251-1396 
  </FONT></P></SPAN></DIV><BR>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List [<A 
  class=moz-txt-link-freetext 
  href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">mailto:MAPSERVER-USERS@LISTS.UMN.EDU</A>] 
  <B>On Behalf Of </B>Brant Anderson<BR><B>Sent:</B> Thursday, August 26, 2004 
  3:34 AM<BR><B>To:</B> <A class=moz-txt-link-abbreviated 
  href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A><BR><B>Subject:</B> 
  Re: [UMN_MAPSERVER-USERS] JPEG 2000 format instead of TIFF for a RASTER 
  layer<BR></FONT><BR></DIV>Here is a line from the apache web server log 
  file:<BR><BR>[Thu Aug 26 02:29:45 2004] [error] [client 192.168.1.101] 
  malformed header from<BR>script. Bad header=GeoJp2 info found...: 
  /usr/lib/cgi-bin/mapserv421<BR><BR><BR>Maybe that has something to do with it. 
  If so, any ideas how to fix this?<BR><BR>Brant<BR><BR><BR><BR>Brant Anderson 
  wrote: 
  <BLOCKQUOTE cite=mid412D88C5.4080404@mudlabs.com type="cite">Here are some 
    more details:<BR>Mapfile: ( Full mapfile can be found here: <A 
    class=moz-txt-link-freetext 
    href="http://mudlabs.homelinux.org:8181/mapserver_dev/Douglas.map">http://mudlabs.homelinux.org:8181/mapserver_dev/Douglas.map</A> 
    )<BR>----&gt;snip&lt;----<BR>&nbsp; LAYER<BR>&nbsp;&nbsp;&nbsp; NAME 
    'index'<BR>&nbsp;&nbsp;&nbsp; TYPE TILEINDEX<BR>&nbsp;&nbsp;&nbsp; DATA 
    'dougIndex_jp2.shp' # JPEG2000 Images in same folder as Shapefiles 
    (TESTING)<BR>&nbsp;&nbsp;&nbsp; #DATA 'dougIndex_ortho.shp' # TIFF Images in 
    'ortho' sub-folder (WORKING)<BR>&nbsp;&nbsp;&nbsp; #DATA 'dougIndex.shp' # 
    TIFF Images in same folder as Shapefiles (WORKING)<BR>&nbsp; 
    END<BR><BR>&nbsp; LAYER<BR>&nbsp;&nbsp;&nbsp; NAME 
    'test_raster'<BR>&nbsp;&nbsp;&nbsp; STATUS OFF<BR>&nbsp;&nbsp;&nbsp; TYPE 
    RASTER<BR>&nbsp;&nbsp;&nbsp; TILEINDEX 'index'<BR>&nbsp;&nbsp;&nbsp; 
    TILEITEM 'PATH'<BR>&nbsp; END<BR>----&gt;snip&lt;----<BR><BR>The 'tile 
    index' layer was created via an ArcGIS extension written by Mike Juvrud of 
    Mud Labs. What it does is takes the Orthophoto/raster image from a MrSID 
    format, and chops it up into tiles, outputting the tiles as TIFF formatted 
    images (max 50MB per image). At the same time, it generates the 'tile index' 
    layer, filling in the corresponding filename in an attribute named 
    'PATH'.<BR><BR>After verifying this method worked using TIFF files, the 
    'PATH' attribute was changed from a .tif extension to a .jp2 extension. So 
    if I had an image named '104.tif' the new name would be '104.jp2'<BR><BR>I 
    used the 'jasper' utility to convert the TIFF image to a JPEG2000 using the 
    command: 'jasper -f 104.tif -t tif -F 104.jp2 -T jp2'<BR><BR>Here is the 
    output from ogrinfo of a TIFF version, and another of the JPEG2000 
    version.<BR><BR>==TIFF: (command used: 'ogrinfo dougIndex.shp 
    dougIndex')<BR>INFO: Open of `dougIndex.shp'<BR>using driver `ESRI 
    Shapefile' successful.<BR>&nbsp;<BR>Layer name: dougIndex<BR>Geometry: 
    Polygon<BR>Feature Count: 7<BR>Extent: (285931.949063, 5109160.000042) - 
    (289100.000009, 5109580.000043)<BR>Layer SRS WKT:<BR>(unknown)<BR>PATH: 
    String (15.0)<BR>STATUS: Integer (4.0)<BR>IndexID: Integer 
    (9.0)<BR>OGRFeature(dougIndex):0<BR>&nbsp; PATH (String) = 104.tif<BR>&nbsp; 
    STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 104<BR>&nbsp; POLYGON 
    ((286040.000 5109160.000,285931.949 5109160.000,285945.481 
    5109580.000,286040.000 5109580.000,286040.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex):1<BR>&nbsp; PATH (String) = 
    105.tif<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 
    105<BR>&nbsp; POLYGON ((286550.000 5109160.000,286040.000 
    5109160.000,286040.000 5109580.000,286550.000 5109580.000,286550.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex):2<BR>&nbsp; PATH (String) = 
    106.tif<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 
    106<BR>&nbsp; POLYGON ((287060.000 5109160.000,286550.000 
    5109160.000,286550.000 5109580.000,287060.000 5109580.000,287060.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex):3<BR>&nbsp; PATH (String) = 
    107.tif<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 
    107<BR>&nbsp; POLYGON ((287570.000 5109160.000,287060.000 
    5109160.000,287060.000 5109580.000,287570.000 5109580.000,287570.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex):4<BR>&nbsp; PATH (String) = 
    108.tif<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 
    108<BR>&nbsp; POLYGON ((288080.000 5109160.000,287570.000 
    5109160.000,287570.000 5109580.000,288080.000 5109580.000,288080.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex):5<BR>&nbsp; PATH (String) = 
    109.tif<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 
    109<BR>&nbsp; POLYGON ((288590.000 5109160.000,288080.000 
    5109160.000,288080.000 5109580.000,288590.000 5109580.000,288590.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex):6<BR>&nbsp; PATH (String) = 
    110.tif<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 
    110<BR>&nbsp; POLYGON ((289100.000 5109160.000,288590.000 
    5109160.000,288590.000 5109580.000,289100.000 5109580.000,289100.000 
    5109160.000))<BR>==========<BR><BR>==JPEG2000: (command used: 'ogrinfo 
    dougIndex_jp2.shp dougIndex_jp2')<BR>INFO: Open of 
    `dougIndex_jp2.shp'<BR>using driver `ESRI Shapefile' 
    successful.<BR>&nbsp;<BR>Layer name: dougIndex_jp2<BR>Geometry: 
    Polygon<BR>Feature Count: 7<BR>Extent: (286040.000007, 5109160.000042) - 
    (289100.000009, 5109580.000043)<BR>Layer SRS WKT:<BR>(unknown)<BR>PATH: 
    String (15.0)<BR>STATUS: Integer (4.0)<BR>IndexID: Integer 
    (9.0)<BR>OGRFeature(dougIndex):0<BR>&nbsp; PATH (String) = 104.jp2<BR>&nbsp; 
    STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 104<BR>&nbsp; POLYGON 
    ((286040.000 5109160.000,285931.949 5109160.000,285945.481 
    5109580.000,286040.000 5109580.000,286040.000 
    5109160.000))<BR><BR>OGRFeature(dougIndex_jp2):1<BR>&nbsp; PATH (String) = 
    105.jp2<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID (Integer) = 
    105<BR>&nbsp; POLYGON ((286550.000 5109160.000,286040.000 
    5109160.000,286040.000 5109580.000,286550.000 5109580.000,286550.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex_jp2):2<BR>&nbsp; PATH 
    (String) = 106.jp2<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID 
    (Integer) = 106<BR>&nbsp; POLYGON ((287060.000 5109160.000,286550.000 
    5109160.000,286550.000 5109580.000,287060.000 5109580.000,287060.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex_jp2):3<BR>&nbsp; PATH 
    (String) = 107.jp2<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID 
    (Integer) = 107<BR>&nbsp; POLYGON ((287570.000 5109160.000,287060.000 
    5109160.000,287060.000 5109580.000,287570.000 5109580.000,287570.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex_jp2):4<BR>&nbsp; PATH 
    (String) = 108.jp2<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID 
    (Integer) = 108<BR>&nbsp; POLYGON ((288080.000 5109160.000,287570.000 
    5109160.000,287570.000 5109580.000,288080.000 5109580.000,288080.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex_jp2):5<BR>&nbsp; PATH 
    (String) = 109.jp2<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID 
    (Integer) = 109<BR>&nbsp; POLYGON ((288590.000 5109160.000,288080.000 
    5109160.000,288080.000 5109580.000,288590.000 5109580.000,288590.000 
    5109160.000))<BR>&nbsp;<BR>OGRFeature(dougIndex_jp2):6<BR>&nbsp; PATH 
    (String) = 110.jp2<BR>&nbsp; STATUS (Integer) = 1<BR>&nbsp; IndexID 
    (Integer) = 110<BR>&nbsp; POLYGON ((289100.000 5109160.000,288590.000 
    5109160.000,288590.000 5109580.000,289100.000 5109580.000,289100.000 
    5109160.000))<BR>==========<BR><BR><BR>I hope I covered all the bases. If 
    you need any more info, sling your questions my way.<BR><BR><BR>Thank 
    you,<BR><BR>Brant Anderson<BR><BR><BR>
    <BLOCKQUOTE cite=mid412D85C5.3010203@mudlabs.com type="cite">Ed McNierney 
      wrote: 
      <BLOCKQUOTE 
      cite=mid2A6FDD75AE04BE4A9E8C918D3C09FB0721CD22@ptolemy.topozone.com 
      type="cite">
        <META content="MSHTML 6.00.2800.1458" name=GENERATOR>
        <DIV dir=ltr align=left><SPAN class=703202903-26082004><FONT face=Arial 
        color=#0000ff size=2>Brant -</FONT></SPAN></DIV>
        <DIV dir=ltr align=left><SPAN 
        class=703202903-26082004></SPAN>&nbsp;</DIV>
        <DIV dir=ltr align=left><SPAN class=703202903-26082004><FONT face=Arial 
        color=#0000ff size=2>You mentioned "tile", so I assume you're using a 
        TILEINDEX.&nbsp; You mention changing the PATH attribute of the 
        shapefile - could you be a little more specific?&nbsp; Could you post 
        the LAYER definition in your MAP file for this layer?&nbsp; I would 
        expect that you would use gdaltindex to create a new TILEINDEX shapefile 
        with the new filenames in it (remember that gdaltindex will add to an 
        existing file, so you'll want to create a new one).&nbsp; Then you would 
        change the TILEINDEX statement in your MAP file to refer to this new 
        shapefile.</FONT></SPAN></DIV>
        <DIV dir=ltr align=left><SPAN 
        class=703202903-26082004></SPAN>&nbsp;</DIV>
        <DIV dir=ltr align=left><SPAN 
        class=703202903-26082004>&nbsp;&nbsp;&nbsp; <FONT face=Arial 
        color=#0000ff size=2>- Ed</FONT></SPAN></DIV>
        <DIV dir=ltr align=left><SPAN class=703202903-26082004><!-- Converted from text/plain format -->
        <P><FONT size=2>Ed McNierney<BR>President and Chief 
        Mapmaker<BR>TopoZone.com / Maps a la carte, Inc.<BR>73 Princeton Street, 
        Suite 305<BR>North Chelmsford, MA&nbsp; 01863<BR>Phone: +1 978 
        251-4242&nbsp;&nbsp; Fax: +1 978 251-1396 </FONT></P></SPAN></DIV><BR>
        <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
        <HR tabIndex=-1>
        <FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List [<A 
        class=moz-txt-link-freetext 
        href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">mailto:MAPSERVER-USERS@LISTS.UMN.EDU</A>] 
        <B>On Behalf Of </B>Brant Anderson<BR><B>Sent:</B> Thursday, August 26, 
        2004 1:21 AM<BR><B>To:</B> <A class=moz-txt-link-abbreviated 
        href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A><BR><B>Subject:</B> 
        [UMN_MAPSERVER-USERS] JPEG 2000 format instead of TIFF for a RASTER 
        layer<BR></FONT><BR></DIV>I am trying to tile ortho photos using the 
        JPEG 2000 (jp2) format. I have created a working tif version.<BR><BR>I 
        converted the TIF images to JP2 files using jasper. Then I updated the 
        PATH attribute of the shapefile to reflect the new file extension. This, 
        however, created unexpected results. I am getting an Internal Server 
        Error.<BR><BR>Here is my MapServer output: (mapserv -v)<BR>MapServer 
        version 4.2.2 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF 
        SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=EPPL7 
        INPUT=OGR <B>INPUT=GDAL</B> INPUT=SHAPEFILE<BR><BR>Here is my 
        gdal-config output: (gdal-config --formats)<BR>gxf gtiff hfa aigrid 
        aaigrid ceos ceos2 iso8211 xpm sdts raw dted mem jdem envisat elas fit 
        vrt usgsdem l1b nitf bmp pcidsk bsb <B>jpeg2000</B> gif jpeg png 
        grass<BR><BR><BR>Does anybody know if it is possible to use JPEG 2000 
        instead of TIFF for this?<BR><BR>I would like to use this format if 
        possible, as the file sizes are 2-3x smaller than with the .tif, and the 
        quality differences are unnoticeable.<BR><BR>Any help/suggestions 
        welcome.<BR><BR><BR>Thank you,<BR><BR>Brant 
    Anderson<BR></BLOCKQUOTE><BR></BLOCKQUOTE><BR></BLOCKQUOTE><BR></BLOCKQUOTE><BR></BODY></HTML>