mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Add the ability to specify the file format with -L{"format":"…"}
This commit is contained in:
+15
-7
@@ -10,10 +10,16 @@
|
||||
#include "milo/dtoa_milo.h"
|
||||
|
||||
void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fname, int layer, std::string layername) {
|
||||
FILE *f = fopen(fname.c_str(), "r");
|
||||
if (f == NULL) {
|
||||
perror(fname.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
FILE *f;
|
||||
|
||||
if (fname.size() == 0) {
|
||||
f = stdin;
|
||||
} else {
|
||||
f = fopen(fname.c_str(), "r");
|
||||
if (f == NULL) {
|
||||
perror(fname.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
std::string s;
|
||||
@@ -120,8 +126,10 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
|
||||
serialize_feature(&sst[0], sf);
|
||||
}
|
||||
|
||||
if (fclose(f) != 0) {
|
||||
perror("fclose");
|
||||
exit(EXIT_FAILURE);
|
||||
if (fname.size() != 0) {
|
||||
if (fclose(f) != 0) {
|
||||
perror("fclose");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user