lonlate <- cbind(longitude, latitude)
###Llamamos a la libreria Terra
library(terra)
## terra version 1.0.10
PU <-vect(lonlate)
class (PU)
## [1] "SpatVector"
## attr(,"package")
## [1] "terra"
PU
## class : SpatVector
## geometry : points
## dimensions : 34, 0 (geometries, attributes)
## extent : 967727, 967925, 979257, 979333 (xmin, xmax, ymin, ymax)
## coord. ref. :
geom(PU)
## geom part x y hole
## [1,] 1 1 967759 979257 0
## [2,] 2 1 967770 979259 0
## [3,] 3 1 967795 979268 0
## [4,] 4 1 967816 979276 0
## [5,] 5 1 967822 979276 0
## [6,] 6 1 967823 979277 0
## [7,] 7 1 967830 979273 0
## [8,] 8 1 967831 979273 0
## [9,] 9 1 967832 979272 0
## [10,] 10 1 967840 979274 0
## [11,] 11 1 967847 979274 0
## [12,] 12 1 967853 979277 0
## [13,] 13 1 967861 979283 0
## [14,] 14 1 967865 979284 0
## [15,] 15 1 967865 979285 0
## [16,] 16 1 967865 979285 0
## [17,] 17 1 967892 979294 0
## [18,] 18 1 967897 979294 0
## [19,] 19 1 967911 979296 0
## [20,] 20 1 967917 979297 0
## [21,] 21 1 967920 979297 0
## [22,] 22 1 967925 979300 0
## [23,] 23 1 967920 979302 0
## [24,] 24 1 967912 979305 0
## [25,] 25 1 967905 979308 0
## [26,] 26 1 967901 979309 0
## [27,] 27 1 967900 979309 0
## [28,] 28 1 967864 979307 0
## [29,] 29 1 967849 979317 0
## [30,] 30 1 967831 979321 0
## [31,] 31 1 967776 979333 0
## [32,] 32 1 967764 979325 0
## [33,] 33 1 967727 979304 0
## [34,] 34 1 967733 979297 0
crsref <- "epsg:3116"
PU <- vect(lonlate, crs=crsref)
crs(PU)
## [1] "PROJCRS[\"MAGNA-SIRGAS / Colombia Bogota zone\",\n BASEGEOGCRS[\"MAGNA-SIRGAS\",\n DATUM[\"Marco Geocentrico Nacional de Referencia\",\n ELLIPSOID[\"GRS 1980\",6378137,298.257222101,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4686]],\n CONVERSION[\"Colombia MAGNA Bogota zone\",\n METHOD[\"Transverse Mercator\",\n ID[\"EPSG\",9807]],\n PARAMETER[\"Latitude of natural origin\",4.59620041666667,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8801]],\n PARAMETER[\"Longitude of natural origin\",-74.0775079166667,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8802]],\n PARAMETER[\"Scale factor at natural origin\",1,\n SCALEUNIT[\"unity\",1],\n ID[\"EPSG\",8805]],\n PARAMETER[\"False easting\",1000000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8806]],\n PARAMETER[\"False northing\",1000000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8807]]],\n CS[Cartesian,2],\n AXIS[\"northing (N)\",north,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"easting (E)\",east,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n USAGE[\n SCOPE[\"unknown\"],\n AREA[\"Colombia - 75°35'W to 72°35'W\"],\n BBOX[-2.51,-75.59,11.82,-72.58]],\n ID[\"EPSG\",3116]]"
cbind(id=1, part=1, longitude, latitude)
## id part longitude latitude
## [1,] 1 1 967759 979257
## [2,] 1 1 967770 979259
## [3,] 1 1 967795 979268
## [4,] 1 1 967816 979276
## [5,] 1 1 967822 979276
## [6,] 1 1 967823 979277
## [7,] 1 1 967830 979273
## [8,] 1 1 967831 979273
## [9,] 1 1 967832 979272
## [10,] 1 1 967840 979274
## [11,] 1 1 967847 979274
## [12,] 1 1 967853 979277
## [13,] 1 1 967861 979283
## [14,] 1 1 967865 979284
## [15,] 1 1 967865 979285
## [16,] 1 1 967865 979285
## [17,] 1 1 967892 979294
## [18,] 1 1 967897 979294
## [19,] 1 1 967911 979296
## [20,] 1 1 967917 979297
## [21,] 1 1 967920 979297
## [22,] 1 1 967925 979300
## [23,] 1 1 967920 979302
## [24,] 1 1 967912 979305
## [25,] 1 1 967905 979308
## [26,] 1 1 967901 979309
## [27,] 1 1 967900 979309
## [28,] 1 1 967864 979307
## [29,] 1 1 967849 979317
## [30,] 1 1 967831 979321
## [31,] 1 1 967776 979333
## [32,] 1 1 967764 979325
## [33,] 1 1 967727 979304
## [34,] 1 1 967733 979297
linea <- vect(lonlate, type="lines", crs=crsref)
polig <- vect(lonlate, type="polygons", crs=crsref)
polig
## class : SpatVector
## geometry : polygons
## dimensions : 1, 0 (geometries, attributes)
## extent : 967727, 967925, 979257, 979333 (xmin, xmax, ymin, ymax)
## coord. ref. : +proj=tmerc +lat_0=4.59620041666667 +lon_0=-74.0775079166667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
plot(polig, border='brown', lwd=2)
### Gráfica de los puntos capturados con el navegador
plot(PU,col='red', pch=10, cex=1)