start well-known-names enum from 1 + pre-initialise keys_map with well-known-names

This commit is contained in:
artemp 2016-11-15 11:18:44 +01:00
parent d6bedd235c
commit 1b74544b08
2 changed files with 12 additions and 5 deletions

View file

@ -34,10 +34,10 @@ namespace mapnik { namespace json {
enum well_known_names
{
type = 0,
geometry = 1,
coordinates = 2,
properties = 3
type = 1,
geometry,
coordinates,
properties
};
constexpr char const* wkn_to_string(well_known_names val)

View file

@ -428,7 +428,14 @@ std::pair<bool,typename T::value_type::first_type> process_geojson_file_x3(T & b
auto const* itr = start;
extract_positions<base_iterator_type, boxes_type> callback(itr, boxes);
mapnik::json::grammar::keys_map keys;
mapnik::json::grammar::keys_map keys =
{
{"type", mapnik::json::well_known_names::type},
{"geometry", mapnik::json::well_known_names::geometry},
{"coordinates", mapnik::json::well_known_names::coordinates},
{"properties", mapnik::json::well_known_names::properties}
};
std::size_t bracket_counter = 0;
auto feature_collection_impl = x3::with<mapnik::json::grammar::bracket_tag>(std::ref(bracket_counter))
[x3::with<mapnik::json::keys_tag>(std::ref(keys))