From: Allin C. <cot...@wf...> - 2020-03-04 20:40:23
|
On Wed, 4 Mar 2020, Manfred Schwarb wrote: > Am 04.03.20 um 16:07 schrieb Allin Cottrell: >> On Wed, 4 Mar 2020, Manfred Schwarb wrote: >> >>>> 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. >>> >>> I do it using the gdal software and some shell magic: >>> # ogr2ogr -f "GMT" gaga.gmt gaga.shp >>> # grep -v "^#" gaga.gmt | sed 's/>//' > gaga.txt >> >> That's also the approach taken by Bob Mesibov at >> https://www.datafix.com.au/BASHing/2018-10-31.html > > Well, you don't need 2 blank lines for separation, a single blank > line is enough. OK, but not a big deal. > More to the topic, I think the shape format is proprietary, > complicated, spread over multiple files, limited (number of > fields, length of field names, file size,...), so in one word: > "legacy". > > So I don't think it is an appropriate format for interfacing with > gnuplot. I made positive experiences with GeoJSON, it is a simple, > very versatile format, and I think most GIS programs can read and > write this format, so why not use some geojson routine and put it > into gnuplot? I'm all in favor of nicer and non-proprietary formats, but what's the comparison in terms of availability of files representing polygons one might want (US states, counties or commuting zones, EU countries or regions, etc.)? It's my impression that you can easily pick up shapefiles for any/all of these -- nasty as the format may be -- but what about GeoJSON files? Allin Cottrell |