mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
skip csv lines with no geometry as is done for geojson
This commit is contained in:
+9
-1
@@ -61,10 +61,18 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
|
|||||||
std::vector<std::string> line = csv_split(s.c_str());
|
std::vector<std::string> line = csv_split(s.c_str());
|
||||||
|
|
||||||
if (line.size() != header.size()) {
|
if (line.size() != header.size()) {
|
||||||
fprintf(stderr, "%s:%zu: Mismatched column count: %zu in line, %zu in header\n", fname.c_str(), seq, line.size(), header.size());
|
fprintf(stderr, "%s:%zu: Mismatched column count: %zu in line, %zu in header\n", fname.c_str(), seq + 1, line.size(), header.size());
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (line[loncol].empty() || line[latcol].empty()) {
|
||||||
|
static int warned = 0;
|
||||||
|
if (!warned) {
|
||||||
|
fprintf(stderr, "%s:%zu: null geometry (additional not reported)\n", fname.c_str(), seq + 1);
|
||||||
|
warned = 1;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
double lon = atof(line[loncol].c_str());
|
double lon = atof(line[loncol].c_str());
|
||||||
double lat = atof(line[latcol].c_str());
|
double lat = atof(line[latcol].c_str());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user