[postgis-users] Create a Thematic grid map with postgresql
Brent Wood
pcreso at pcreso.com
Thu Nov 18 16:44:14 PST 2004
--- Paul Ramsey <pramsey at refractions.net> wrote:
> > I resolved this in the perl script by having a Z value in the PostGIS
> export as
> > "ring no". So I can grep all the non #1 rings & plot in GMT as an overlay
> on
> > the #1 rings to "look" like holes in the #1 rings. (Hope this makes sense
> :-)
>
> How does it know where one polygon stops and another ends?
> For that matter, how does it know what's a polygon?
>
Each new line segment is treated as a new polygon.
If you tell it to use a fill brush/colour/pattern it tries very hard to use the
line segments as polygons. If you just define a pen/line it draws it. If the
end point does not replicate the start point, it joins it for you for polygon
fills (-L).
Please note, I'm just a user, this sort of dscussion is prob more appropriate
on the GMT list where those with more technical understanding reside :-)
However, as I understand it (or as I use it), the -M & -S parameters set a line
segment (polygon boundary) or point sequence mode, otherwise it treats the
coordinate sequence as a set of points. The -S option forces a Symbol at each
coordinate location- ie, the data are points, -M forces multi-line (ie, more
than one line segment separated by a line in the file begining with the
specified char.
So -S (symbol) -M (multiline) are mutually exclusive, but a fill colour can be
applied to the symbols or the polygons.
(an aside) I know GMT has it's own projection support, but proj4 is absolutely
PERFECT for piping GMT vector files or streams through :-)
I've attached the psxy help (NOT the man page) output below if anyone is
interested. It provides more detail on this.
Given the superb quality output GMT can produce from spatial data, I'd love to
see improved interoperability with PostGIS etc. (There, now it's on topic! :-)
Brent
______________________________________________________________________________
psxy 3.4.2 - Plot lines, polygons, and symbols on maps
usage: psxy <infiles> -J<params> -R<west/east/south/north> [-A] [-B<tickinfo>]
[-C<cpt>] [-E[x|y|X|Y][cap][/<pen>]] [-G<fill>] [-H[<nrec>]] [-K] [-L]
[-M<flag>] [-N]
[-O] [-P] [-S[<symbol>][<size>]] [-U[<label>]] [-V] [-W[<pen>]]
[-c<ncopies>]
[-X<x_shift>] [-Y<y_shift>] [-:] [-bi[s][<n>]]
<infiles> is one or more files. If no, read standard input
-J Selects map proJection. (<scale> in cm/degree, <mapwidth> in cm)
-Ja|A<lon0>/<lat0>/<scale (or radius/lat)|mapwidth> (Lambert
Azimuthal Equal Area)
-Jb|B<lon0>/<lat0>/<lat1>/<lat2>/<scale|mapwidth> (Albers Equal-Area
Conic)
-Jc|C<lon0>/<lat0><scale|mapwidth> (Cassini)
-Jd|D<lon0>/<lat0>/<lat1>/<lat2>/<scale|mapwidth> (Equidistant
Conic)
-Je|E<lon0>/<lat0>/<scale (or radius/lat)|mapwidth> (Azimuthal
Equidistant)
-Jf|F<lon0>/<lat0>/<horizon>/<scale (or radius/lat)|mapwidth>
(Gnomonic)
-Jg|G<lon0>/<lat0>/<scale (or radius/lat)|mapwidth> (Orthographic)
-Jh|H<lon0>/<scale|mapwidth> (Hammer-Aitoff)
-Ji|I<lon0>/<scale|mapwidth> (Sinusoidal)
-Jj|J<lon0>/<scale|mapwidth> (Miller)
-Jk|K[f|s]<lon0>/<scale/mapwidth> (Eckert IV (f) or VI (s))
-Jl|L<lon0>/<lat0>/<lat1>/<lat2>/<scale|mapwidth> (Lambert Conformal
Conic)
-Jm|M (Mercator). Specify one of two definitions:
-Jm|M<scale|mapwidth>
-Jm|M<lon0>/<lat0>/<scale|mapwidth>
-Jn|N<lon0>/<scale|mapwidth> (Robinson projection)
-Jo|O (Oblique Mercator). Specify one of three definitions:
-Jo|Oa<orig_lon>/<orig_lat>/<azimuth>/<scale|mapwidth>
-Jo|Ob<orig_lon>/<orig_lat>/<b_lon>/<b_lat>/<scale|mapwidth>
-Jo|Oc<orig_lon>/<orig_lat>/<pole_lon>/<pole_lat>/<scale|mapwidth>
-Jq|Q<lon0>/<scale|mapwidth> (Equidistant Cylindrical)
-Jr|R<lon0>/<scale|mapwidth> (Winkel Tripel)
-Js|S<lon0>/<lat0>/[<slat>/]<scale (or radius/lat)|mapwidth>
(Stereographic)
-Jt|T (Transverse Mercator). Specify one of two definitions:
-Jt|T<lon0>/<scale|mapwidth>
-Jt|T<lon0>/<lat0>/<scale|mapwidth>
-Ju|U<zone>/<scale|mapwidth> (UTM)
-Jv|V<lon0>/<scale/mapwidth> (van der Grinten)
-Jw|W<lon0>/<scale|mapwidth> (Mollweide)
-Jy|Y<lon0>/<lats>/<scale|mapwidth> (Cylindrical Equal-area)
-Jp|P[a]<scale|mapwidth>[/<origin>] (Polar [azimuth] (theta,radius))
-Jx|X<x-scale|mapwidth>[l|p<power>][/<y-scale|mapheight>[l|p<power>]] (Linear
projections)
(See psbasemap for more details on projection syntax)
-R specifies the min/max coordinates of data region in user units.
Use dd:mm[:ss] format for regions given in degrees and minutes [and
seconds].
Append r if -R specifies the longitudes/latitudes of the lower left
and upper right corners of a rectangular area
OPTIONS:
-B Boundary anotation, give
-B<xinfo>[/<yinfo>[/<zinfo>]][.:"title":][wesnzWESNZ+]
<?info> is 1-3 substring(s) of form [a|f|g]<tick>[m][l|p] and
optionally :"label": and/or :,[-]"unit":
(See psbasemap man pages for more details and examples.)
-A Suppress drawing line segments as great circle arcs
-C Use cpt-file to assign symbol colors based on z-value in 3rd column
(requires -S)
Without -S, psxy expects -M polygons and looks for -Z<val> options
in each multiheader
-E means draw error bars for x, y, or both. Add cap-width [0.0984252].
Append pen attributes.
If X or Y is used instead a box-and-whisker diagram is drawn
instead, using data from 4
extra columns to get the 0 %, 25 %, 75 % ,and 100% quartiles (point
value is assumed to be 50%)
Then, use -W, -G to control the appearance of the 25-75% box.
-G Specify color (for symbols/polygons) or pattern (for polygons). fill
can be either
1) <r/g/b> (each 0-255) for color or <gray> (0-255) for gray-shade
[0].
2) p[or P]<dpi>/<pattern> for predefined patterns (1-90).
3) not given; -G option is present in all subheader (requires -M and
no -S)
Default is no fill (transparent symbols or polygons)
-H means input/output file has 1 Header record(s) [OFF]
Optionally, append number of header records
-K means allow for more plot code to be appended later [OFF].
-L Force closed polygons.
-M Input file(s) contain multiple segments separated by a record
whose first character is <flag> [>]
-N Do Not skip/clip symbols that fall outside map border [Default will
ignore those outside]
-O means Overlay plot mode [OFF].
-P means Portrait page orientation [OFF].
-S to select symbol type and symbol size (in cm). Choose between
st(a)r, (b)ar, (c)ircle, (d)iamond, (e)llipse, (f)ront, (h)exagon,
(i)nvtriangle, (l)etter, (p)oint, (s)quare, (t)riangle, (v)ector,
(w)edge, (x)cross
If no size is specified, psxy expects the 3rd column to have sizes.
If no symbol is specified, psxy expects the last column to have
symbol code.
[Note: if -C is selected then 3rd means 4th column, etc.]
Symbols A, C, D, H, I, S, T are adjusted to have same area as a
circle of given size
Bars: Append b<base> to give the y-value of the base [Default = 0]
Append u if width is in x-input units [Default is cm]
Ellipses: the direction, major, and minor axis must be in input
columns 3, 4 and 5.
If -SE rather than -Se is selected, psxy will expect azimuth, and
axes in km
and convert azimuths based on the chosen map projection
Fronts: Give tickgap/ticklen[dir][type][:offset], where
dir = Plot symbol to the l(eft) or r(ight) of front [Default is
centered]
type = b(ox), c(ircle), f(ault), s(lip), t(riangle) [Default is
f]
box : square when centered, half-square otherwise.
circle : full when centered, half-circle otherwise.
fault : centered cross-tick or tick only in the <dir>
direction.
slip : left-lateral or right-lateral strike-slip arrows
(centered is not defined).
triangle : diagonal square when centered, directed triangle
otherwise.
offset = start plotting symbols when along-track distance equals
offset [0].
Letter: append /<string> after symbol size, and optionally %<font>
Vectors: the direction and length must be in input columns 3 and 4.
Furthermore, <size> means arrowwidth/headlength/headwith [Default
is 0.0295276/0.11811/0.0984252]
If -SV rather than -Sv is selected, psxy will expect azimuth and
length
and convert azimuths based on the chosen map projection
Wedges: the start and stop directions of pie wedge must be in input
columns 3, 4.
-U to plot Unix System Time stamp [and optionally appended text].
You may also set the lower left corner position of stamp
[-0.787402/-0.787402].
Give -Uc to have the command line plotted [OFF].
-V Run in verbose mode [OFF].
-W sets pen attributes [width = 0.25p, color = (0/0/0), texture = solid
line].
Implicitly draws symbol outline with this pen.
-X -Y to shift origin of plot to (<xshift>, <yshift>)
[a0.984252,a0.984252].
Prepend a for absolute [Default r is relative]
(Note that for overlays (-O), the default is [r0,r0].)
-c specifies the number of copies [1].
-: Expect lat/lon input rather than lon/lat [OFF].
-bi for binary input. Append s for single precision [Default is
double]
Append <n> for the number of columns in binary file(s).
Default is the required number of columns
(See gmtdefaults man page for hidden GMT default parameters)
More information about the postgis-users
mailing list