[postgis-users] Adding raster to PostGIS database

Smaran Harihar smaran.harihar at gmail.com
Mon Nov 26 14:30:17 PST 2012


Hmmm.

This was the output,

gdalinfo failed - unable to open 'Quercus_acutifolia_raw.tif'.

For

gdalinfo Quercus_acutifolia_raw.tif

Thanks,
Smaran

On Mon, Nov 26, 2012 at 3:07 PM, Bborie Park <bkpark at ucdavis.edu> wrote:

> Run the following...
>
> gdalinfo Quercus_acutifolia_raw.tif
>
> If that returns an error, something may be wrong with the tif file.
>
> -bborie
>
> On 11/26/2012 02:03 PM, Smaran Harihar wrote:
> > But I am executing the command in the directory where it is located
> >
> > I can list that raster using `ls`
> >
> > On Mon, Nov 26, 2012 at 2:46 PM, Bborie Park <bkpark at ucdavis.edu> wrote:
> >
> >> That error would only happen if raster2pgsql can't find the file in your
> >> current working directory. raster2pgsql supports relative paths for
> >> input rasters.
> >>
> >> -bborie
> >>
> >> On 11/26/2012 01:37 PM, Smaran Harihar wrote:
> >>> Thanks for the reply bborie,
> >>>
> >>> I ran this command,
> >>>
> >>> raster2pgsql -c -s 4326 -I Quercus_acutifolia_raw.tif
> >>> public.Quercus_acutifolia_raw | psql -h localhost -d rasterdb -U
> postgres
> >>>
> >>> But this is the new error,
> >>>
> >>> ERROR: Unable to read raster file: Quercus_acutifolia_raw.tif
> >>>
> >>> Thanks,
> >>> Smaran
> >>>
> >>> On Mon, Nov 26, 2012 at 2:27 PM, Bborie Park <bkpark at ucdavis.edu>
> wrote:
> >>>
> >>>> -D is not a valid flag recognized by raster2pgsql.  Remove the flag as
> >>>> raster2pgsql is assuming that -D is a file.
> >>>>
> >>>> -bborie
> >>>>
> >>>> On 11/26/2012 01:23 PM, Smaran Harihar wrote:
> >>>>> Hi Guys,
> >>>>>
> >>>>> I am trying to add a raster to PostGIS database using,
> >>>>>
> >>>>> raster2pgsql -c -D -s 4326 -I Quercus_acutifolia_raw.tif
> >>>>> public.Quercus_acutifolia_raw | psql -h localhost -d dbnm -U usr
> >>>>>
> >>>>> But I am getting this error,
> >>>>>
> >>>>> ERROR: Unable to read raster file: -D
> >>>>>
> >>>>> Any idea what is wrong? The database already has numerous point and
> >>>> polygon
> >>>>> shapefiles. Is that a problem that I cannot add rasters to the same
> >>>>> database having shapefiles?
> >>>>>
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> postgis-users mailing list
> >>>>> postgis-users at lists.osgeo.org
> >>>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >>>>>
> >>>>
> >>>> --
> >>>> Bborie Park
> >>>> Programmer
> >>>> Center for Vectorborne Diseases
> >>>> UC Davis
> >>>> 530-752-8380
> >>>> bkpark at ucdavis.edu
> >>>> _______________________________________________
> >>>> postgis-users mailing list
> >>>> postgis-users at lists.osgeo.org
> >>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> postgis-users mailing list
> >>> postgis-users at lists.osgeo.org
> >>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >>>
> >>
> >> --
> >> Bborie Park
> >> Programmer
> >> Center for Vectorborne Diseases
> >> UC Davis
> >> 530-752-8380
> >> bkpark at ucdavis.edu
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at lists.osgeo.org
> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >>
> >
> >
> >
> >
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >
>
> --
> Bborie Park
> Programmer
> Center for Vectorborne Diseases
> UC Davis
> 530-752-8380
> bkpark at ucdavis.edu
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 
Thanks & Regards
Smaran Harihar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20121126/082fe416/attachment.html>


More information about the postgis-users mailing list