Skip to content

Commit

Permalink
unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
David Cooley committed Apr 17, 2018
1 parent 2ac615e commit 5b3d3f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions inst/include/geojsonsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ namespace geojsonsf {
const std::string PROJ4STRING = "+proj=longlat +datum=WGS84 +no_defs";
}

static const char* ARRAY_TYPES[] =
{ "Null", "False", "True", "Object", "Array", "String", "Number" };

#define UNKNOWN 0
#define POINT 1
#define MULTIPOINT 2
Expand Down
5 changes: 5 additions & 0 deletions src/geojson_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ void vector_to_string(Rcpp::List& lst, std::string& key) {


void get_property_types(const Value& v, std::map< std::string, std::string>& property_types) {

// TODO: move to a header??
static const char* ARRAY_TYPES[] =
{ "Null", "False", "True", "Object", "Array", "String", "Number" };

for (Value::ConstMemberIterator iter = v.MemberBegin(); iter != v.MemberEnd(); ++iter){
std::string property = iter->name.GetString();

Expand Down
4 changes: 4 additions & 0 deletions src/geojson_to_sf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,17 @@ void fill_property_vectors(Document& doc_properties,
Rcpp::List& properties,
int& row_index) {

static const char* ARRAY_TYPES[] =
{ "Null", "False", "True", "Object", "Array", "String", "Number" };

for (auto& m : doc_properties.GetObject()) {
row_index = std::stoi(m.name.GetString());

for (auto& p : m.value.GetObject() ) {

std::string key = p.name.GetString();
std::string type = property_types[key];

std::string value_type = ARRAY_TYPES[p.value.GetType()];

if (value_type == "String") {
Expand Down

0 comments on commit 5b3d3f5

Please sign in to comment.