<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Okay.<br>
<br>
This time I compiled 'jasper' without the geo referencing 'geojasper'
so now I am using plain Jasper.<br>
I then compiled GDAL with the new ungeofied (GeoJP2=no) Jasper library.<br>
<br>
Then I tried to view my map. The server didn't give an Internal Server
Error this time! But a new problem is here. The images just don't show
up. I viewed the JPEG2000 images with "Image Viewer 2" in Windows, and
they appear just fine, so I know they are supposed to be there. The
layer used for tiling uses the same shapes as the TIFF version did, so
the Extent values should be proper.<br>
<br>
Next I compiled a new Mapserver. Wondering if the new GDAL needs to be
reflected in the Mapserver compilation.<br>
Then I tried to view my map again. The orthophotos still are not there.<br>
<br>
Is there a way to display an image using Mapserver without using an
extent, just to test if Mapserver is displaying the graphic at all? I
would like to know if the image is not being processed correctly, or if
it is just out of the viewport of my map. I did zoom out aways, to see
if the images were near by, but no such luck.<br>
<br>
Thanks,<br>
Brant<br>
<br>
<br>
<br>
Brant Anderson wrote:
<blockquote cite="mid412E2E3D.8040909@mudlabs.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
I ran 'gdal_translate' and it converted the JP2 image perfectly.<br>
  <br>
This is the text it sent to the console:<br>
Input file size is 108, 420<br>
GeoJp2 info found...<br>
  <br>
I notice a simularity in the second line gdal_translate's output and
the 'malformed header' apache error.<br>
Snip from Apache error log:<br>
Bad header=GeoJp2 info found...<br>
  <br>
Hmmm... I am getting closer. My guess is that the output from the
translation utility is getted slapped to the begining of the header
that is sent to Apache. This would make the header invalid, which in
turn, would cause Apache to choke with the Internal Server Error.<br>
  <br>
  <br>
More insight needed.<br>
  <br>
Thanks,<br>
  <br>
Brant<br>
  <br>
  <br>
  <br>
Ed McNierney wrote:
  <blockquote
 cite="mid2A6FDD75AE04BE4A9E8C918D3C09FB0721CD3E@ptolemy.topozone.com"
 type="cite">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; ">
    <meta content="MSHTML 6.00.2800.1400" name="GENERATOR">
    <div align="left" dir="ltr"><span class="210532016-26082004"><font
 color="#0000ff" face="Arial" size="2">Brant -</font></span></div>
    <div align="left" dir="ltr"><span class="210532016-26082004"></span>&nbsp;</div>
    <div align="left" dir="ltr"><span class="210532016-26082004"><font
 color="#0000ff" face="Arial" 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 align="left" dir="ltr"><span class="210532016-26082004"></span>&nbsp;</div>
    <div align="left" dir="ltr"><span class="210532016-26082004"><font
 color="#0000ff" face="Arial" 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 align="left" dir="ltr"><span class="210532016-26082004"></span>&nbsp;</div>
    <div align="left" dir="ltr"><span class="210532016-26082004">&nbsp;&nbsp;&nbsp; <font
 color="#0000ff" face="Arial" size="2">- Ed</font></span></div>
    <div align="left" dir="ltr"><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>
    <a class="moz-txt-link-abbreviated" href="mailto:ed@topozone.com">ed@topozone.com</a><br>
(978) 251-4242 </font></p>
    </span></div>
    <br>
    <div class="OutlookMessageHeader" align="left" dir="ltr"
 lang="en-us">
    <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 2:18 PM<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>
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 align="left" dir="ltr"><span class="812220812-26082004"><font
 color="#0000ff" face="Arial" size="2">Brant -</font></span></div>
      <div align="left" dir="ltr"><span class="812220812-26082004"></span>&nbsp;</div>
      <div align="left" dir="ltr"><span class="812220812-26082004"><font
 color="#0000ff" face="Arial" 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 align="left" dir="ltr"><span class="812220812-26082004"></span>&nbsp;</div>
      <div align="left" dir="ltr"><span class="812220812-26082004">&nbsp;&nbsp;&nbsp; <font
 color="#0000ff" face="Arial" size="2">- Ed</font></span></div>
      <div align="left" dir="ltr"><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" align="left" dir="ltr"
 lang="en-us">
      <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 align="left" dir="ltr"><span class="703202903-26082004"><font
 color="#0000ff" face="Arial" size="2">Brant -</font></span></div>
            <div align="left" dir="ltr"><span class="703202903-26082004"></span>&nbsp;</div>
            <div align="left" dir="ltr"><span class="703202903-26082004"><font
 color="#0000ff" face="Arial" 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 align="left" dir="ltr"><span class="703202903-26082004"></span>&nbsp;</div>
            <div align="left" dir="ltr"><span class="703202903-26082004">&nbsp;&nbsp;&nbsp;
            <font color="#0000ff" face="Arial" size="2">- Ed</font></span></div>
            <div align="left" dir="ltr"><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" align="left" dir="ltr"
 lang="en-us">
            <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>
        </blockquote>
      </blockquote>
    </blockquote>
  </blockquote>
</blockquote>
</body>
</html>