[postgis-users] Create a Thematic grid map with postgresql
Brent Wood
pcreso at pcreso.com
Thu Nov 18 14:52:28 PST 2004
Hi...
This may be of interest as I'm also using GMT to plot PostGIS data.
>
> I run a balance between defining a zillion CLASS-es w/ different colors and
> constraints to produce a nice image from point data TO pumping point data
> into GMT to produce nice images. I'd suggest you check out GMT if you
> haven't already.
>
> This approach is to take either randomly spaced data or a nicely gridded
> data set and pump it into a GMT grid. Create a color table on that, and
> then run through a GMT script to produce the image. Then pass that image
> back to MapServer, and away you go.
I'm not sure exactly how you did this, but it would be nice to compare. (OGR
support for GMT vectors would be nice :-) How did you extract the PostGIS data
for use with GMT? I have a Perl script which sort of works, but if you have a
PostGIS function to do this I'd love to see it!
I used GMT to grid the data & generate a PS file (all in a script which also
writes a world file), ImageMagick to trim & convert to tiff & gdal to turn the
tiff/world file into a geotiff.
This image (in this case a hillshade based on topo contours) is then used as a
background for overlaying various PostGIS or other vector layers.
A q'n'd example (on my PC at home) is at
http://203.79.92.204/cgi-bin/mapserv?map=/srv/www/htdocs/topo/wgtn1/wgtn.map&mode=map
(I really need to learn html & mapserver!!!)
>
> Our data comes in near real time, but I generate the grids ahead of time.
> The only ad-hoc stuff comes in when you're creating the image based on the
> user's current extent.
In my case real time = geological time so a slightly different scale :-)
On a related note, I have a script which uses GMT to produce maps from PostGIS
data & QGIS. QGIS is the data browser, when you save a QGIS project file (of
PostGIS layers) you can run a shell script which parses the QGIS file & writes
a script to extract & plot the same data with the same line/fill colours but
using GMT. It is rough, but has met my needs so far.
ie: QGIS provides PostGIS data viewer/browser & GMT turns the on screen map
into a publication quality graphic.
Cheers
Brent Wood
More information about the postgis-users
mailing list