|
From: Manfred S. <man...@gm...> - 2020-03-04 15:59:55
|
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. 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? Cheers, Manfred > I'm hopeful that libshape can do the job without requiring the whole > of gdal. Libshape was developed by Frank Warmerdam, the guy who > initially developed gdal, and is used by gdal's OGR library. > > Allin Cottrell > |