Fix the any-valid-geometries check again

This commit is contained in:
Eric Fischer 2016-04-04 11:25:21 -07:00
parent c9e542e688
commit 7b6cd2d0f4

View File

@ -2264,6 +2264,11 @@ int read_json(int argc, struct source **sourcelist, char *fname, const char *lay
munmap(map, indexpos);
}
if (indexpos == 0) {
fprintf(stderr, "Did not read any valid geometries\n");
exit(EXIT_FAILURE);
}
/* Copy geometries to a new file in index order */
struct index *index_map = mmap(NULL, indexpos, PROT_READ, MAP_PRIVATE, indexfd, 0);
@ -2301,11 +2306,6 @@ int read_json(int argc, struct source **sourcelist, char *fname, const char *lay
size[j] = 0;
}
if (geompos == 0 || metapos == 0) {
fprintf(stderr, "did not read any valid geometries\n");
exit(EXIT_FAILURE);
}
if (!quiet) {
fprintf(stderr, "%lld features, %lld bytes of geometry, %lld bytes of metadata, %lld bytes of string pool\n", progress_seq, geompos, metapos, poolpos);
}