Postgres Raster image display

Ryan Ollerenshaw ryanollerenshaw at GMAIL.COM
Mon Oct 22 17:52:34 EDT 2007


On 10/22/07, Paul Ramsey <pramsey at refractions.net> wrote:
> Answer here?
>
> http://mapserver.gis.umn.edu/docs/howto/wms_time_support/#example-of-
> wms-t-with-postgis-tile-index-for-raster-imagery
>

I gave it a try but i keep getting the error:
 msSHPOpenFile(): Unable to access file. (/var/www/html/data/location)

here is what i changed by map file too:

LAYER
  NAME "stereo_simp"
  TYPE POLYGON
  STATUS on
  CONNECTION "host=localhost dbname=mars user=postgres"
  CONNECTIONTYPE POSTGIS
  #DATA "/hiview/products/data_sun/20070929_000600_14euA_171_16_gdal.tif"
  DATA "the_geom FROM usgs_gaz"
END

LAYER
  NAME "stereo_test"
  STATUS on
  TYPE RASTER
  PROCESSING "SCALE=AUTO" #rescale 16-bit to 8-bit
  PROJECTION
    "init=epsg:4326"
  END
  DUMP TRUE
  METADATA
   wms_title "USGS Gazetteer Place Names" ## REQUIRED
   wms_srs "EPSG:4326"
  END
  TILEINDEX "location"
  TILEITEM "stereo_simp"
END  # layer

whenever i use the tag TILEINDEX is always looks for a file, in my
case a file /var/www/html/data/location.  Why cant i get this to grab
the path in the database that contains the location of the file?

> On 22-Oct-07, at 2:28 PM, Ryan Ollerenshaw wrote:
>
> > On 10/22/07, Ryan Ollerenshaw <ryanollerenshaw at gmail.com> wrote:
> >> How can i use a Postgres database to display raster images with
> >> Mapserver?  There are lots of examples on display features this way
> >> and using a gdaltindex to create a shapefile but i cant find any that
> >> talk about using a database to store raster images.  Here is what
> >> i am
> >> currently trying:
> >>
> >> LAYER
> >>   NAME "stereo_simp"
> >>   TYPE RASTER
> >>   PROCESSING "SCALE=AUTO" #rescale 16-bit image to 8-bit
> >>   STATUS on
> >>   CONNECTION "host=localhost dbname=test user=postgres"
> >>   CONNECTIONTYPE POSTGIS
> >>   DATA "location FROM stereo"
> >>   TILEINDEX "stereo" #the table name
> >>   TILEITEM "location" #column that contains the path to the image
> >> END
> >>
> >> if i just try and display the image directly it works just fine:
> >>
> >> LAYER
> >>   NAME "stereo_simp"
> >>   TYPE RASTER
> >>   PROCESSING "SCALE=AUTO" #rescale 16-bit to 8-bit
> >>   STATUS on
> >>   DATA "/hiview/products/data/20070929_000600_14euA_171_16_gdal.tif"
> >> END
> >>
> >
> > Sorry i should have been more clear on my post I do not want to store
> > the images directly in the database, what i am trying to do is store
> > the location of the image in the database and use mapserver to read
> > this location column and display the image.  This works fine when
> > using gdaltindex when gdal generates the dbf file for example using
> > this technique:
> >
> > LAYER
> >   NAME "stereo_simp"
> >   TYPE RASTER
> >   PROCESSING "SCALE=AUTO" #rescale 16-bit to 8-bit
> >   STATUS on
> >   TILEINDEX "images.shp"
> >   TILEITEM "location"
> > END
> >
> > but when i try to use Postgres as the TILEINDEX this does not work,
> > ie:
> >
> > LAYER
> >   NAME "stereo_simp"
> >   TYPE RASTER
> >   PROCESSING "SCALE=AUTO" #rescale 16-bit to 8-bit
> >   STATUS on
> >   CONNECTION "host=localhost dbname=test user=postgres"
> >   CONNECTIONTYPE POSTGIS
> >   TILEINDEX "the_geom FROM stereo"
> >   TILEITEM "location"
> > END
> >
> >   any ideas on what i am doing wrong?
>
>



More information about the mapserver-users mailing list