[postgis-users] ST_AsJpeg

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue Feb 14 14:53:59 PST 2012


Curious that the question was never raised for ST_AsKML(geometry)...

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of Paragon Corporation
> Sent: Tuesday, February 14, 2012 5:43 PM
> To: 'PostGIS Users Discussion'
> Subject: Re: [postgis-users] ST_AsJpeg
> 
> Here it is in the docs now:
> 
> http://postgis.refractions.net/documentation/manual-
> svn/using_raster.xml.html#RasterOutput_PSQL
> 
> 
> ________________________________
> 
> 	From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-
> users-bounces at postgis.refractions.net] On Behalf Of Joan
> 	Sent: Tuesday, February 14, 2012 4:23 PM
> 	To: PostGIS Users Discussion
> 	Subject: Re: [postgis-users] ST_AsJpeg
> 
> 
> 	The last two solutions result in a black square, which I think is the tile.
> But it's a good start. I will have to look more into that.
> 	Regina, I have tried using \g to out put to a file but the file is corrupted.
> 
> 
> 	I appreciate the help.
> 
> 	Joan
> 
> 	On 14 February 2012 21:27, Paragon Corporation <lr at pcorp.us> wrote:
> 
> 
> 		We have this documented in the docs.
> 
> 		http://www.postgis.org/documentation/manual-
> svn/using_raster.xml.html#RT_Raster_Applications
> 
> 		There is an example for doing it with PHP, .NET, Java, and
> PLPython
> 
> 		Sorry don't have one for psql only.  Haven't tried using psql for
> outputting
> 		files.
> 
> 		Regina
> 		http://www.postgis.us
> 
> 
> 
> 
> 
> 
> 		> -----Original Message-----
> 		> From: postgis-users-bounces at postgis.refractions.net
> 		> [mailto:postgis-users-bounces at postgis.refractions.net] On
> 
> 		> Behalf Of Pierre Racine
> 		> Sent: Tuesday, February 14, 2012 11:05 AM
> 		> To: PostGIS Users Discussion
> 		> Subject: Re: [postgis-users] ST_AsJpeg
> 		>
> 
> 		> So you might have to write a script connecting to PostgreSQL
> 		> and writing the file for you. See an example in:
> 		>
> 		> http://www.bostongis.com/blog/index.php?/archives/175-
> Minimali
> 		> st-Web-based-PHP-PostGIS-2.0-Spatial-GeometryRaster-
> Viewer.html
> 		>
> 		> Pierre
> 		>
> 		> > -----Original Message-----
> 		> > From: postgis-users-bounces at postgis.refractions.net
> 		> > [mailto:postgis-users- bounces at postgis.refractions.net] On
> 		> Behalf Of
> 		> > Joan
> 		> > Sent: Tuesday, February 14, 2012 10:10 AM
> 		> > To: PostGIS Users Discussion
> 		> > Subject: Re: [postgis-users] ST_AsJpeg
> 		> >
> 		> > Yes, I want to create a jpeg/tiff file. I am new to
> 		> cursors, how would
> 		> > that work in a query.
> 		> >
> 		> >
> 		> > On 14 February 2012 15:39, Pierre Racine
> 		> <Pierre.Racine at sbf.ulaval.ca> wrote:
> 		> >
> 		> >
> 		> >     Thanks,
> 		> >
> 		> >     Do you see any way to make the file directly readable
> 		> (without having
> 		> > to edit it)?
> 		> >
> 		> >
> 		> >     Pierre
> 		> >
> 		> >     > -----Original Message-----
> 		> >     > From: postgis-users-bounces at postgis.refractions.net
> 		> > [mailto:postgis-
> 		> > users-
> 		> >
> 		> >     > bounces at postgis.refractions.net] On Behalf Of Sandro
> Santilli
> 		> >     > Sent: Tuesday, February 14, 2012 9:28 AM
> 		> >     > To: PostGIS Users Discussion
> 		> >
> 		> >     > Subject: Re: [postgis-users] ST_AsJpeg
> 		> >     >
> 		> >     > On Tue, Feb 14, 2012 at 09:22:21AM -0500, Pierre
> Racine wrote:
> 		> >     > > Yes. You want to write the file directly to the
> filesystem?
> 		> > Sandro wrote
> 		> >     > something in the list about this recently but I can't
> 		> find it. Sandro?
> 		> > Robe?
> 		> >     > >
> 		> >     >
> 		> >     > I ended up binary-editing the result afterwards.
> 		> >     >
> 		> >     > Anyway, first step is declaring a binary cursor,
> 		> redirecting output
> 		> > to a file and
> 		> >     > calling the function.
> 		> >     >
> 		> >     > For the binary editing, I looked at another file with
> 		> my expected
> 		> > format to tell
> 		> >     > where it started (human eye pattern matching).
> 		> >     >
> 		> >     > > You can also use gdal_translate...
> 		> >     >
> 		> >     > Much better, when it works (it wasn't working for me).
> 		> >     >
> 		> >     > --strk;
> 		> >     >
> 		> >     >   ,------o-.
> 		> >     >   |   __/  |    Delivering high quality PostGIS 2.0 !
> 		> >     >   |  / 2.0 |    http://strk.keybit.net
> 		> >     >   `-o------'
> 		> >     >
> 		> >     >
> _______________________________________________
> 		> >     > postgis-users mailing list
> 		> >     > postgis-users at postgis.refractions.net
> 		> >     > http://postgis.refractions.net/mailman/listinfo/postgis-
> users
> 		> >     _______________________________________________
> 		> >     postgis-users mailing list
> 		> >     postgis-users at postgis.refractions.net
> 		> >     http://postgis.refractions.net/mailman/listinfo/postgis-
> users
> 		> >
> 		> >
> 		>
> 		> _______________________________________________
> 		> postgis-users mailing list
> 		> postgis-users at postgis.refractions.net
> 		> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 		>
> 
> 
> 		_______________________________________________
> 		postgis-users mailing list
> 		postgis-users at postgis.refractions.net
> 		http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 




More information about the postgis-users mailing list