[mapserver-users] Postgis Tile Index

Rahkonen Jukka (Tike) jukka.rahkonen at mmmtike.fi
Wed Aug 20 03:56:55 PDT 2014


Perhaps it is something like this (from http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html)

“Reading raster data from the database
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):
PG:"host='<host>' port:'<port>' dbname='<dbname>' user='<user>' password='<password>' [schema='<schema>'] [table='<raster_table>'] [where='<sql_where>'] [mode='<working_mode>']"

I would test first by using the string for one image as  DATA of your raster layer before to continue towards TILEINDEX+TILEITEM.

-Jukka Rahkonen-

Dave Barter wrote:

I’ve figured this out,

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



“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
So nearly there?


On 20 August 2014 at 11:34:03, Dave Barter (dave.barter at gmail.com<mailto:dave.barter at gmail.com>) wrote:
Final question. How should my map file look in order to get the raster tile from the database not the file system?

LAYER
            # 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
            NAME streetview_tileindex
            TYPE polygon
            PROJECTION
                "init=epsg:27700"
            END
            CONNECTIONTYPE postgis
            CONNECTION “********"
            DATA "shape from (SELECT shape,location FROM mapping_os_opendata_raster.streetview_tileindex) AS FOO USING UNIQUE location using srid=27700"

        END

        LAYER
            #RASTER TILE LAYERS MUST RUN FROM A TILEINDEX
            NAME streetview
            TYPE RASTER
            STATUS ON
            TILEINDEX "streetview_tileindex"
            TILEITEM "location"
            OFFSITE 0 0 0
            PROJECTION
                "init=epsg:27700"
            END
            DEBUG 5
            EXTENT 0 0 3000000 1000000

        END

This is not working as the layer street view returns an error:-

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’.

I set SHAPEFILE “” at the top of the file, but am unclear as to how the streetview layer will retrieve the tile ?



--
Dave Barter

Web: http://www.phased.co.uk<http://www.phased.co.uk/>
Email:dave at phased.co.uk<mailto:Email%3Adave at phased.co.uk>
Twitter:@Citizenfishy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140820/2b291a15/attachment-0001.html>


More information about the mapserver-users mailing list