mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Add an option to treat empty CSV columns as nulls, not empty strings
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "text.hpp"
|
||||
#include "csv.hpp"
|
||||
#include "milo/dtoa_milo.h"
|
||||
#include "options.hpp"
|
||||
|
||||
void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fname, int layer, std::string layername) {
|
||||
FILE *f;
|
||||
@@ -97,6 +98,9 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
|
||||
serial_val sv;
|
||||
if (is_number(line[i])) {
|
||||
sv.type = mvt_double;
|
||||
} else if (line[i].size() == 0 && prevent[P_EMPTY_CSV_COLUMNS]) {
|
||||
sv.type = mvt_null;
|
||||
line[i] = "null";
|
||||
} else {
|
||||
sv.type = mvt_string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user