From: Ethan A M. <me...@uw...> - 2020-03-04 01:44:18
|
On Tuesday, 3 March 2020 17:05:40 PST Allin Cottrell wrote: > On Tue, 3 Mar 2020, Ethan A Merritt wrote: > > > On Tuesday, 3 March 2020 14:30:40 PST Allin Cottrell wrote: > >> This question has been posed before (a few years back) but I'm > >> hoping someone may be able to point me to the state-of-the-art, > >> if there is such. > >> > >> I'd like to be able to produce via gnuplot a map of (for example) > >> the USA showing the states colored by median income, or PM2.5 > >> particulate emissions, or whatever. > >> > >> I understand that the starting point would be a suitable US states > >> shapefile (I know where I can get that), which would have to be > >> translated to a format (resembling world.dat, I suppose) that can be > >> understood by gnuplot. I have some notion of how that might be done. > >> > >> The next issue would be to get gnuplot to colorize specified areas > >> of the map according to the values of some additional data. > >> Unfortunately I have little notion of how to do that. > > > > The development version of gnuplot supports > > > > splot <data> with polygons > > Thanks Ethan, and also Dima in this thread. This sounds promising! > Right now I'm not sure when I'll find time to pursue this in depth, > but I'm definitely interested and will push it when I can. > > Allin Cottrell This may be putting the cart before the horse, but... Do you think it would be helpful to teach gnuplot to read shape files? I imagine it would be possible to test for the presence of shapelib.so and provide a binary input mode: splot <data> binary filetype=shapelib with polygons I have never worked with this libary so I don't know if it is organized in such a way that this would be possible. A quick look at the spec for the shapefile format makes it look horrible (mixed little-ending big-endian in the same file?! variable record types that are required not to vary?!), but if it is hidden by a usable library .... Ethan |