CSV2SHP(1)
π CSV2SHP β okay bestie, let's make a shapefile π
So there's this little icon csv2shp and its whole thing is converting a character delimited file into an ESRI shapefile. That's it. That's the job. And it's from shplib, which β respectfully β ate. π«Ά
β¨ NAME β¨
csv2shp β converts a character delimited file to a ESRI shapefile π
πΈ SYNOPSIS πΈ
csv2shp csv_filename delimiter_character shp_filename
fprintf(stderr,
"csv2shp csv_filename delimiter_character shp_filename\n");
fprintf(stderr, " csv_filename\n");
fprintf(stderr,
" columns named longitude and latitude must exist\n");
fprintf(stderr, " delimiter_character\n");
fprintf(stderr, " one character only\n");
fprintf(stderr, " shp_filename\n");
fprintf(stderr,
" base name, do not give the extension\n");
return EXIT_FAILURE;
That's literally the usage message right there in the synopsis, no cap. Three arguments, that's the whole vibe check.
π¦ DESCRIPTION π¦
Okay so first thing's first, and this is important, so listen: this program operates on single points only β not polygons, not lines. Points. Just points. If you came here for lines or polygons, this is not it, sorry babe π
The input file can be a .csv file (comma separated values), or tab-separated values, or honestly separated by any other character you want. Your file, your rules.
The first row must contain column names. Mandatory. And there has to be a column named longitude and a column named latitude in there β both of them, no skipping. π₯
Now for the part where I have to be the bearer of bad news π: the .csv parser does not understand text delimiters (like a quotation mark, for example). It parses fields only by the given field delimiter (so like a comma, or a tab). That's the only thing it's looking at. Periodt.
Also β and I cannot stress this enough β the program has not been tested with null values, and in that case the behavior is undefined. Not "probably fine", not "yolo", undefined. Like, genuinely undefined behavior. And it will not accept lines with a trailing delimiter character. Just won't. Don't do it.
Good news though: all columns (yes, including longitude and latitude) in the input file get exported to the .dbf file. Nothing gets left behind. π
Oh and it's smart about it too β the program attempts to find the best type (integer, decimal, string) and the smallest size of the fields necessary for the .dbf file. It's optimizing. It's doing the most, in a good way. slay π
π OPTIONS π
csv_filenameβ bestie, there must exist columns namedlongitudeandlatitude. Non-negotiable.delimiter_characterβ one character only. One. Uno. Single. Don't try to be cute with it.shp_filenameβ this is a base name, so do not give the extension. Leave it off, trust. π
Friendly reminder: points only, no nulls (undefined behavior!! π±), no trailing delimiters, and your first row better have column names. iykyk.
byeee bestie, go make some shapefiles πβ¨π¦πΈ
That's CSV2SHP(1) from shplib, dated March 2026. Mwah. π«Ά
π¦ where this page comes from
- ubuntu stonking: shapelib 1.6.3-1 Β· MIT OR LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms