ST_Colormap

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ST_Colormap

dahaynes
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: ST_Colormap

Regina Obe

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:[hidden email]] On Behalf Of David Haynes II
Sent: Friday, April 22, 2016 12:51 PM
To: PostGIS Development Discussion <[hidden email]>
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


_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: ST_Colormap

dahaynes
CONTENTS DELETED
The author has deleted this message.