% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generics.R, R/st_translate.R
\name{st_translate}
\alias{st_translate}
\alias{st_translate,dbSpatial-method}
\title{Translate x, y coordinates by delta x, delta y for point geometries}
\usage{
st_translate(dbSpatial, geomName = "geom", dx, dy, ...)

\S4method{st_translate}{dbSpatial}(dbSpatial, geomName = "geom", dx, dy, ...)
}
\arguments{
\item{dbSpatial}{\code{\link{dbSpatial}} object.}

\item{geomName}{\code{character string}. The geometry column name in the  \code{\link{dbSpatial}}  object. Default: \code{"geom"}.}

\item{dx}{\code{numeric}.value to shift x coordinates by}

\item{dy}{\code{numeric}. value to shift y coordinates by}

\item{...}{additional arguments passed to methods}
}
\value{
\code{\link{dbSpatial}} object
}
\description{
This function translates point geometries by the specified delta x and delta y values.
}
\section{Functions}{
\itemize{
\item \code{st_translate(dbSpatial)}: Method for \code{dbSpatial} object

}}
\examples{
if (interactive() && requireNamespace("duckdb", quietly = TRUE)) {
  con = DBI::dbConnect(duckdb::duckdb(), ":memory:")
  DBI::dbExecute(con, "SET threads = 1")

  coordinates <- data.frame(x = c(100, 200, 300), y = c(500, 600, 700))
  attributes <- data.frame(id = 1:3, name = c("A", "B", "C"))

  # Combine the coordinates and attributes
  dummy_data <- cbind(coordinates, attributes)

  points <- dbSpatial(conn = con,
                      name = "points",
                      value = dummy_data,
                      overwrite = TRUE,
                      x_colName = "x",
                      y_colName = "y")

  points

  points_translated <- st_translate(dbSpatial = points, dx = 100, dy = -20)

  points_translated
  DBI::dbDisconnect(con, shutdown = TRUE)
}
}
\concept{geom_construction}
