4

As your question is about overall QGIS 3, the answer by MrXsquared is the best. If you have access to QGIS 3.8 or later, try Add X/Y fields to layer (see visual changelog "New Feature: Add X/Y fields to layer". It can be found in the Processing Toolbox > Vector table). You can add X/Y fields calculated in the CRS of your choice.


4

To calculate coordinates of features, open the attribute table of your layer and then the field calculator. Create a new field and make sure to choose the correct field type (E.g. float with precision 8). Enter $x for x-coordinates and $y to calculate the y-coordinate for each feature. Units, by default are specified by the layers CRS. But of course you ...


2

Then projection is EPSG:3628. How to find such info? You try your luck at https://epsg.io/ and search for New York. You get a big list of possible EPSGs and then try. When you click one, let's say EPSG:3628 (as I did in my first try), you'll see something like: Don't get discouraged by the text about Puerto Rico, trust the title (New York Long Island), ...


2

If I understand correctly, you are trying to subtract 1000 from the x coords. Here is how I would go about it: library(sf) p1 <- rbind(c(1000,1000), c(1000,2000), c(2000,2000), c(1000,1000)) pol <-st_polygon(list(p1)) pol_geom = st_sfc(pol, crs = 4326) # Getting the coordinates of pol_geom coords = st_coordinates(pol_geom) new_coords = coords[,1:2] ...


1

Thanks to the comment of Taras, I found the answer. The coordinates can be extracted based on Shapely commands, i.e. by using p.geometry.x, p.geometry.y


1

Simple example: library(sf) nc <- st_read(system.file("shape/nc.shp", package="sf")) nc1 <- st_transform(nc[1, ], 32617) nc2 <- st_geometry(nc1) - c(1000, 0) plot(nc1[0], axes = T, reset = F) plot(nc2, add = T, col = NA, border ='red') See sf Vignette #3's section on Affine Transformations for more tricks.


Only top voted, non community-wiki answers of a minimum length are eligible