<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I have this working now:-</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div id="bloop_customfont" style="margin: 0px;">CREATE MATERIALIZED VIEW mapping_raster.streetview_tileindex AS </div><div id="bloop_customfont" style="margin: 0px;">SELECT 'PG:host=localhost port=5432 …. schema=''mapping__raster'' table=''streetview'' mode=''1'' where=rid='||rid as location, </div><div id="bloop_customfont" style="margin: 0px;">ST_ConvexHull(rast) as shape from mapping_raster.streetview </div></div> <div><br></div>Thanks for the help, I will update the wiki shortly<div><br><p style="color:#000;">On 20 August 2014 at 12:15:48, Smith, Michael ERDC-RDE-CRREL-NH (<a href="mailto:michael.smith@erdc.dren.mil">michael.smith@erdc.dren.mil</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div></div><div>
<title></title>
<div>Note that the current Wiki entry is here: <a href="https://github.com/mapserver/mapserver/wiki/MapServer-TILEINDEXes-with-Database-RASTERS">https://github.com/mapserver/mapserver/wiki/MapServer-TILEINDEXes-with-Database-RASTERS</a></div>
<div><br></div>
<div>And when you do get this working, please update this for the
other PostGIS users.</div>
<div><br></div>
<div>Mike</div>
<div><br></div>
<div>
<div>
<div>
<div>-- </div>
<div>Michael Smith</div>
</div>
<div>US Army Corps</div>
<div>Remote Sensing GIS/Center</div>
</div>
</div>
<div><br></div>
<span id="OLK_SRC_BODY_SECTION"></span>
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span id="OLK_SRC_BODY_SECTION"><span style="font-weight:bold">From:</span> "Rahkonen Jukka (Tike)"
<<a href="mailto:jukka.rahkonen@mmmtike.fi">jukka.rahkonen@mmmtike.fi</a>><br>
<span style="font-weight:bold">Date:</span> Wednesday, August 20,
2014 at 6:56 AM<br>
<span style="font-weight:bold">To:</span> Dave Barter <<a href="mailto:dave.barter@gmail.com">dave.barter@gmail.com</a>>,
"<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>"
<<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
<span style="font-weight:bold">Subject:</span> [EXTERNAL] Re:
[mapserver-users] Postgis Tile Index<br>
<span style="font-weight:bold">Resent-From:</span> Michael Smith
<<a href="mailto:michael.smith@usace.army.mil">michael.smith@usace.army.mil</a>><br>
</span></div>
<div><br></div>
<div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
Perhaps it is something like this (from <a href="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html</a>)</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
“Reading raster data from the database</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
If you want to use the GDAL WKT Raster driver, you must provide a
connection string as Dataset's name. The syntax of this connection
string is (the quotes may be ommitted):</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
PG:"host='<host>' port:'<port>' dbname='<dbname>'
user='<user>' password='<password>'
[schema='<schema>'] [table='<raster_table>']
[where='<sql_where>']
[mode='<working_mode>']"</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
I would test first by using the string for one image as DATA
of your raster layer before to continue towards
TILEINDEX+TILEITEM.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
-Jukka Rahkonen-</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">
</span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif;">Dave Barter
wrote:</span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<div id="bloop_customfont">
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: Helvetica, sans-serif;">I’ve figured
this out,</span></p>
</div>
<div id="bloop_customfont">
<p class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div id="bloop_customfont">
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size: 10pt; font-family: Helvetica, sans-serif; color: black;">
CREATE MATERIALIZED VIEW
mapping_os_opendata_raster.streetview_tileindex AS SELECT rid as
location, S</span><span style="font-size: 10pt; font-family: Helvetica, sans-serif; color: black;">T_ConvexHull(rast)
as shape from
mapping_os_opendata_raster.streetview </span></p>
</div>
</blockquote>
</div>
<p><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
<p><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">“location"
needs to be a path to the database/table/raster currently it is
just returning an ID, but I cannot find any documentation as to how
to construct this for postgres</span></p>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">So nearly
there?</span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
<p><span style="font-size: 10pt; font-family: Helvetica, sans-serif; color: black;">
On 20 August 2014 at 11:34:03, Dave Barter (<a href="mailto:dave.barter@gmail.com">dave.barter@gmail.com</a>)
wrote:</span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div id="bloop_customfont">
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">Final
question. How should my map file look in order to get the raster
tile from the database not the file system?</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">LAYER</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
# CREATE MATERIALIZED VIEW
mapping_os_opendata_raster.streetview_tileindex AS SELECT rid as
location, ST_ConvexHull(rast) as shape from
mapping_os_opendata_raster.streetview </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
NAME
streetview_tileindex</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
TYPE polygon</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
PROJECTION</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
"init=epsg:27700"</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
END</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
CONNECTIONTYPE
postgis</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
CONNECTION “********"</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
DATA "shape from (SELECT
shape,location FROM
mapping_os_opendata_raster.streetview_tileindex) AS FOO USING
UNIQUE location using srid=27700"</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
END</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
LAYER</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
#RASTER TILE LAYERS MUST RUN
FROM A TILEINDEX</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
NAME streetview</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
TYPE RASTER</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
STATUS ON</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
TILEINDEX
"streetview_tileindex"</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
TILEITEM "location"</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
OFFSITE 0 0 0 </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
PROJECTION</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
"init=epsg:27700"</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
END</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
DEBUG 5</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
EXTENT 0 0 3000000
1000000</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">
END</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">This is not
working as the layer street view returns an
error:- </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">msDrawMap():
Image handling error. Failed to draw layer named 'streetview'.
msDrawRasterLayerLow(): Unable to access file. Corrupt, empty or
missing file '654016' for layer 'street view’.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;">I set
SHAPEFILE “” at the top of the file, but am unclear as to how the
streetview layer will retrieve the tile ?</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Helvetica, sans-serif;"> </span></p>
</div>
<div id="bloop_sign_1408530673579525120">
<div>
<p class="MsoNormal"><span style="font-family: Arial, sans-serif;">-- <br>
Dave Barter<br>
<br>
Web: </span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="http://www.phased.co.uk/" target="_blank"><span style="font-size: 12pt; font-family: Arial, sans-serif;">http://www.phased.co.uk</span></a></span><span style="font-family: Arial, sans-serif;"><br>
</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:Email%3Adave@phased.co.uk" target="_blank"><span style="font-size: 12pt; font-family: Arial, sans-serif;">Email:dave@phased.co.uk</span></a></span><span style="font-family: Arial, sans-serif;"><br>
Twitter:@Citizenfishy</span></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div></div></span></blockquote></div></body></html>