Skip to content

date columns converted to unix timestamp #216

Description

@JosiahParry

mapgl correctly creates the legend but then the visualization uses values that do not match the legend. They look to be posix time stamps

Image

repro below:

repro_data <- list(
  objectid = 10,
  globalid = "ef948b26-7cca-451a-81c0-014cf8edd381",
  additional_information = NA_character_,
  CreationDate = as.POSIXct("2026-07-14 08:28:30"),
  Creator = "",
  EditDate = as.POSIXct("2026-07-14 08:28:30"),
  Editor = "",
  date = as.POSIXct("2026-07-14"),
  geometry = list(
    c(-77.01528856199997, 38.879945409000015) |>
      structure(class = c("XY", "POINT", "sfg"))
  ) |>
    structure(
      class = c("sfc_POINT", "sfc"),
      precision = 0,
      bbox = c(
        xmin = -77.01528856199997,
        ymin = 38.879945409000015,
        xmax = -77.01528856199997,
        ymax = 38.879945409000015
      ) |>
        structure(class = "bbox"),
      crs = list(
        input = "EPSG:4326",
        wkt = 'GEOGCRS["WGS 84",\n    ENSEMBLE["World Geodetic System 1984 ensemble",\n        MEMBER["World Geodetic System 1984 (Transit)"],\n        MEMBER["World Geodetic System 1984 (G730)"],\n        MEMBER["World Geodetic System 1984 (G873)"],\n        MEMBER["World Geodetic System 1984 (G1150)"],\n        MEMBER["World Geodetic System 1984 (G1674)"],\n        MEMBER["World Geodetic System 1984 (G1762)"],\n        MEMBER["World Geodetic System 1984 (G2139)"],\n        MEMBER["World Geodetic System 1984 (G2296)"],\n        ELLIPSOID["WGS 84",6378137,298.257223563,\n            LENGTHUNIT["metre",1]],\n        ENSEMBLEACCURACY[2.0]],\n    PRIMEM["Greenwich",0,\n        ANGLEUNIT["degree",0.0174532925199433]],\n    CS[ellipsoidal,2],\n        AXIS["geodetic latitude (Lat)",north,\n            ORDER[1],\n            ANGLEUNIT["degree",0.0174532925199433]],\n        AXIS["geodetic longitude (Lon)",east,\n            ORDER[2],\n            ANGLEUNIT["degree",0.0174532925199433]],\n    USAGE[\n        SCOPE["Horizontal component of 3D system."],\n        AREA["World."],\n        BBOX[-90,-180,90,180]],\n    ID["EPSG",4326]]'
      ) |>
        structure(class = "crs"),
      n_empty = 0L
    )
) |>
  structure(
    row.names = c(NA, -1L),
    class = c("sf", "data.frame"),
    sf_column = "geometry",
    agr = factor(
      c(
        objectid = NA_character_,
        globalid = NA_character_,
        additional_information = NA_character_,
        CreationDate = NA_character_,
        Creator = NA_character_,
        EditDate = NA_character_,
        Editor = NA_character_,
        date = NA_character_
      ),
      levels = c("constant", "aggregate", "identity")
    )
  )


mapgl::maplibre_view(repro_data, column = "date")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions