Giter Club home page Giter Club logo

Comments (1)

stephhazlitt avatar stephhazlitt commented on September 7, 2024

I can reproduce this @Karine-Pigeon.

data <- tibble::tibble(
  Row_ID = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
  NotSure = c(9608, 9609, 9610, 9611, 9612, 9613, 9614, 9615, 9616, 9617),
  Zone = c(10, 10, 10, 10, 10, 10, 9, 9, 9, 9),
  UTMe = c(
    361775,
    361775,
    307196,
    307196,
    328213,
    328213,
    636424,
    636648,
    636795,
    637401
  ),
  UTMn = c(
    6011950,
    6011950,
    5979777,
    5979777,
    5984261,
    5984261,
    6161177,
    6161270,
    6161127,
    6160851
  ),
  UTMe1 = c(
    361775,
    361775,
    307196,
    307196,
    328213,
    328213,
    636424,
    636648,
    636795,
    637401
  ),
  UTMn1 = c(
    6011950,
    6011950,
    5979777,
    5979777,
    5984261,
    5984261,
    6161177,
    6161270,
    6161127,
    6160851
  )
)
data
#> # A tibble: 10 × 7
#>    Row_ID NotSure  Zone   UTMe    UTMn  UTMe1   UTMn1
#>     <dbl>   <dbl> <dbl>  <dbl>   <dbl>  <dbl>   <dbl>
#>  1      1    9608    10 361775 6011950 361775 6011950
#>  2      2    9609    10 361775 6011950 361775 6011950
#>  3      3    9610    10 307196 5979777 307196 5979777
#>  4      4    9611    10 307196 5979777 307196 5979777
#>  5      5    9612    10 328213 5984261 328213 5984261
#>  6      6    9613    10 328213 5984261 328213 5984261
#>  7      7    9614     9 636424 6161177 636424 6161177
#>  8      8    9615     9 636648 6161270 636648 6161270
#>  9      9    9616     9 636795 6161127 636795 6161127
#> 10     10    9617     9 637401 6160851 637401 6160851

data2 <- bcmaps::utm_convert(data,
                             easting = "UTMe",
                             northing = "UTMn",
                             zone = "Zone")
data2
#> Simple feature collection with 10 features and 9 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 947410.6 ymin: 991848.1 xmax: 1057160 ymax: 1176079
#> Projected CRS: NAD83 / BC Albers
#>      Row_ID NotSure Zone  UTMe1   UTMn1         X         Y   UTMe    UTMn
#> 9.1       7    9614    9 636424 6161177  947410.6 1175995.7 361775 6011950
#> 9.2       8    9615    9 636648 6161270  947637.9 1176079.3 361775 6011950
#> 9.3       9    9616    9 636795 6161127  947778.3 1175929.7 307196 5979777
#> 9.4      10    9617    9 637401 6160851  948370.4 1175627.1 307196 5979777
#> 10.1      1    9608   10 361775 6011950 1057160.4 1026400.1 328213 5984261
#> 10.2      2    9609   10 361775 6011950 1057160.4 1026400.1 328213 5984261
#> 10.3      3    9610   10 307196 5979777 1004137.0  991848.1 636424 6161177
#> 10.4      4    9611   10 307196 5979777 1004137.0  991848.1 636648 6161270
#> 10.5      5    9612   10 328213 5984261 1024888.8  997232.0 636795 6161127
#> 10.6      6    9613   10 328213 5984261 1024888.8  997232.0 637401 6160851
#>                      geometry
#> 9.1  POINT (947410.6 1175996)
#> 9.2  POINT (947637.9 1176079)
#> 9.3  POINT (947778.3 1175930)
#> 9.4  POINT (948370.4 1175627)
#> 10.1  POINT (1057160 1026400)
#> 10.2  POINT (1057160 1026400)
#> 10.3 POINT (1004137 991848.1)
#> 10.4 POINT (1004137 991848.1)
#> 10.5   POINT (1024889 997232)
#> 10.6   POINT (1024889 997232)

It looks like bcmaps is returning the rows in ascending order of zone + X, which based on the example in the function documentation is expected behaviour (row id number is also ordered+labelled by zone increments, e.g. 9.1 9.2 ...). But the overwriting smells like a bug 🪳! 'cc @ateucher

from bcmaps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.