[postgis-devel] ST_Colormap

David Haynes II dahaynes at umn.edu
Wed Apr 27 06:30:55 PDT 2016


Thanks for that information Regina. Your right, ST_Colormap does retain the
projection information. That's interesting as I have been able to retain
the spatial information in a jpeg using gdal_translate without creating the
jpegw file.

Thanks

On Tue, Apr 26, 2016 at 12:48 AM, Regina Obe <lr at pcorp.us> wrote:

> David,
>
> I could be mistaken, but I always thought that for jpegs the spatial info
> is stored in a .jpegw file and since ST_ASJPEG only outputs the jpg part it
> wouldn't keep the spatial ref info.
>
>
>
> Are you saying you loose it at the ST_ColorMap part or the ST_AsJPEG.  I
> would expect it maintained in ST_ColorMap and lost at ST_AsJPEG call.
>
>
>
> Thanks,
>
> Regina
>
>
>
> *From:* postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] *On
> Behalf Of *David Haynes II
> *Sent:* Friday, April 22, 2016 12:51 PM
> *To:* PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
> *Subject:* [postgis-devel] ST_Colormap
>
>
>
> Hello
>
>
>
> Working on an application for clipping rasters (
> data.terrapop.org/terraclip) and running into an issue with the
> ST_Colormap function. It seems that whenever we run the ST_Colormap
> function we lose the spatial reference information for the image.This is
> the sample of the query that we are running. The query is successful, but
> the resulting images can be built into a vrt with gdal. I'm using
> PostgreSQL 9.3.7  and POSTGIS 2.1.7.
>
>
>
> WITH projection as
>
> (
>
> SELECT ST_SRID(rast) as srid
>
> FROM gis_rasters.apricothar
>
> Limit 1
>
> ),polygon as
>
> (
>
> SELECT sgl.id as sample_geog_level_id, gi.id as geog_instance_id,
> gi.label as geog_instance_label,
>
> gi.code as geog_instance_code, ST_Transform(bound.geog::geometry,
> prj.srid) as geom
>
> FROM projection prj, sample_geog_levels sgl
>
> inner join geog_instances gi on sgl.id = gi.sample_geog_level_id
>
> inner join boundaries bound on bound.geog_instance_id = gi.id
>
> WHERE sgl.id = 226
>
> ),raster_clip as
>
> (
>
> SELECT ST_Clip(r.rast, 1, p.geom, TRUE) AS rast
>
> FROM polygon p inner join gis_rasters.apricothar  r on
> ST_Intersects(r.rast,p.geom)
>
> )
>
> select ST_AsJPEG(ST_Colormap(rast, 1, 'greyscale'))  as img
>
> from raster_clip, projection prj
>
>
>
> --
>
> David Haynes, Ph.D.
>
> Research Associate Terra Populus
>
> Minnesota Population Center
>
> 612-626-3933
>
> www.terrapop.org
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-devel
>



-- 
David Haynes, Ph.D.
Research Associate Terra Populus
Minnesota Population Center
612-626-3933
www.terrapop.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20160427/a3f677eb/attachment.html>


More information about the postgis-devel mailing list