start well-known-names enum from 1 + pre-initialise keys_map with well-known-names
This commit is contained in:
parent
d6bedd235c
commit
1b74544b08
2 changed files with 12 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue