From 7fc1c0cd24d5a1f9e40204127e0caaa8cf95127b Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 23 Sep 2014 14:02:18 -0700 Subject: [PATCH] Fix index mixup that kept points from working at all --- geojson.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geojson.c b/geojson.c index 9621a17a..d8cf465c 100644 --- a/geojson.c +++ b/geojson.c @@ -217,7 +217,7 @@ void parse_geometry(int t, json_object *j, unsigned *bbox, long long *fpos, FILE int i; for (i = 0; i < j->length; i++) { if (within == GEOM_POINT) { - if (i == 0 || t == GEOM_MULTIPOINT) { + if (i == 0 || mb_geometry[t] == GEOM_MULTIPOINT) { op = VT_MOVETO; } else { op = VT_LINETO; @@ -256,7 +256,7 @@ void parse_geometry(int t, json_object *j, unsigned *bbox, long long *fpos, FILE } } - if (t == GEOM_POLYGON) { + if (mb_geometry[t] == GEOM_POLYGON) { serialize_int(out, VT_CLOSEPATH, fpos); } } @@ -414,7 +414,7 @@ void read_json(FILE *f) { unsigned bbox[] = { UINT_MAX, UINT_MAX, 0, 0 }; - serialize_int(metafile, t, &fpos); + serialize_int(metafile, mb_geometry[t], &fpos); parse_geometry(t, coordinates, bbox, &fpos, metafile, VT_MOVETO); serialize_int(metafile, VT_END, &fpos);