From 98f025fa358bd90baf1f7b26ce49fbc6bed970fa Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 20 Sep 2017 18:40:54 -0700 Subject: [PATCH] Fix off-by-one error in attributes, and canonicalize number formats --- shapefile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shapefile.cpp b/shapefile.cpp index 58c6c5e..124a2dd 100644 --- a/shapefile.cpp +++ b/shapefile.cpp @@ -204,7 +204,7 @@ void parse_shapefile(struct serialization_state *sst, std::string fname, int lay std::vector full_keys; std::vector full_values; - unsigned char *dbp = db; + unsigned char *dbp = db + 1; for (size_t i = 0; i < columns.size(); i++) { std::string s = std::string((char *) dbp, column_widths[i]); dbp += column_widths[i]; @@ -219,6 +219,7 @@ void parse_shapefile(struct serialization_state *sst, std::string fname, int lay if (column_types[i] == 'F' || column_types[i] == 'N') { sv.type = mvt_double; + sv.s = milo::dtoa_milo(atof(sv.s.c_str())); } else if (column_types[i] == 'L') { sv.type = mvt_bool; if (s == "Y" || s == "y" || s == "T" || s == "t") {