Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/SymbolixAU/geojsonsf
Browse files Browse the repository at this point in the history
q# especially if it merges an updated upstream into a topic branch.
  • Loading branch information
dcooley committed Mar 15, 2020
2 parents 13593a7 + 48e7bac commit 559d52b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 180 deletions.
160 changes: 0 additions & 160 deletions R/scratch.R

This file was deleted.

2 changes: 1 addition & 1 deletion inst/include/geojsonsf/geojson/api/df_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace api {
for ( i = 0; i < df.length(); ++i) {

Rcpp::String this_column = column_names[i];
int idx = sfheaders::utils::where_is( this_column, geometry_columns );
R_xlen_t idx = sfheaders::utils::where_is( this_column, geometry_columns );

if ( idx == -1 ) { // i.e. it's not in the vector

Expand Down
2 changes: 1 addition & 1 deletion inst/include/geojsonsf/geojson/geojson_properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace geojson_properties {
std::vector< std::string > n = properties.names();
std::reverse( n.begin(), n.end() );
std::vector< std::string > sv( n.size() );
unsigned int i;
R_xlen_t i;

for( i = 0; i < n.size(); ++i ) {
sv[i] = n[i];
Expand Down
12 changes: 6 additions & 6 deletions inst/include/geojsonsf/geojson/parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ namespace parse {
std::string geom_type;
geojsonsf::validate::validate_geometries(val, sfg_objects);
auto geometries = val["geometries"].GetArray();
unsigned int n = geometries.Size();
unsigned int i;
R_xlen_t n = geometries.Size();
R_xlen_t i;
Rcpp::List geom_collection(n);

for (i = 0; i < n; ++i) {
Expand Down Expand Up @@ -137,8 +137,8 @@ namespace parse {
geojsonsf::geojson_properties::get_property_keys(p, property_keys);
geojsonsf::geojson_properties::get_property_types(p, property_types);

unsigned int geomsize = 1;
unsigned int i;
R_xlen_t geomsize = 1;
R_xlen_t i;

if (expand_geometries && type == "GeometryCollection") {
geojsonsf::validate::validate_geometries( geometry, sfg_objects );
Expand Down Expand Up @@ -185,8 +185,8 @@ namespace parse {

auto features = fc["features"].GetArray();

unsigned int n = features.Size(); // number of features
unsigned int i;
R_xlen_t n = features.Size(); // number of features
R_xlen_t i;

Rcpp::List feature_collection(n);

Expand Down
24 changes: 12 additions & 12 deletions inst/include/geojsonsf/geojson/writers/writers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ namespace writers {

template< typename Writer >
inline void points_to_geojson( Writer& writer, Rcpp::IntegerVector& point, int digits ) {
int n = point.size();
int i;
R_xlen_t n = point.size();
R_xlen_t i;
int value;
writer.StartArray();
for ( i = 0; i < n; ++i ) {
Expand All @@ -138,8 +138,8 @@ namespace writers {

template< typename Writer >
inline void points_to_geojson( Writer& writer, Rcpp::NumericVector& point, int digits ) {
int n = point.size();
int i;
R_xlen_t n = point.size();
R_xlen_t i;
double value;
writer.StartArray();
for ( i = 0; i < n; ++i ) {
Expand Down Expand Up @@ -187,8 +187,8 @@ namespace writers {

template< typename Writer >
inline void linestring_to_geojson( Writer& writer, Rcpp::IntegerMatrix& line, int digits ) {
int i;
int nrow = line.nrow();
R_xlen_t i;
R_xlen_t nrow = line.nrow();
for ( i = 0; i < nrow; ++i ) {
Rcpp::IntegerVector this_row = line(i, Rcpp::_ );
points_to_geojson( writer, this_row, digits );
Expand All @@ -202,8 +202,8 @@ namespace writers {

template< typename Writer >
inline void linestring_to_geojson( Writer& writer, Rcpp::NumericMatrix& line, int digits ) {
int i;
int nrow = line.nrow();
R_xlen_t i;
R_xlen_t nrow = line.nrow();
for ( i = 0; i < nrow; ++i ) {
Rcpp::NumericVector this_row = line(i, Rcpp::_ );
points_to_geojson( writer, this_row, digits );
Expand Down Expand Up @@ -238,8 +238,8 @@ namespace writers {

template< typename Writer >
inline void polygon_to_geojson( Writer& writer, Rcpp::List& sfg, int digits ) {
int i;
int n = sfg.size();
R_xlen_t i;
R_xlen_t n = sfg.size();
for ( i = 0; i < n; ++i ) {
Rcpp::NumericMatrix sfgi = sfg[i];
linestring_to_geojson( writer, sfgi, digits );
Expand All @@ -254,8 +254,8 @@ namespace writers {

template< typename Writer >
inline void multi_polygon_to_geojson( Writer& writer, Rcpp::List& sfg, int digits ) {
int i;
int n = sfg.size();
R_xlen_t i;
R_xlen_t n = sfg.size();
for ( i = 0; i < n; ++i ) {
Rcpp::List sfgi = sfg[i];
polygon_to_geojson( writer, sfgi, digits );
Expand Down

0 comments on commit 559d52b

Please sign in to comment.