

How to transform a curved surface of an ellipsoid into a plane?




N 49°44.62543', E 15°20.31830'49.7437572N, 15.3386383Eparzer helps to parse coordinates in weird formats.-682473.3, -1089493From https://urstudio.sec.sg/wp-content/uploads/2022/03/featured-3.png
Points, lines, polygons…
terra package and its predeccessor, rasterstars package – spatiotemporal arrays, raster and vector data cubesggplot2tmap package – thematic mapsleaflet package – interactive maps
LASOLES_14C_database.csv
;)Latitude_WGS84 and Longitude_WGS844326)# A tibble: 4 × 5
  ID_Date  Latitude_WGS84 Longitude_WGS84 Site_category_ENG Contex_dating_AMCR
  <chr>             <dbl>           <dbl> <chr>             <chr>             
1 CzArch_1           49.1            16.6 hillfort          br.st             
2 CzArch_5           50.1            14.5 settlement        bronz             
3 CzArch_6           49.8            17.0 settlement        ne.lin            
4 CzArch_7           49.8            17.0 settlement        ne.lin            
lasoles_wgs84 <- st_as_sf(lasoles, coords = c(x = "Longitude_WGS84", y = "Latitude_WGS84"), crs = 4326)
head(lasoles_wgs84, 4)Simple feature collection with 4 features and 3 fields
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 14.52986 ymin: 49.05189 xmax: 16.95067 ymax: 50.05246
Geodetic CRS:  WGS 84
# A tibble: 4 × 4
  ID_Date  Site_category_ENG Contex_dating_AMCR            geometry
  <chr>    <chr>             <chr>                      <POINT [°]>
1 CzArch_1 hillfort          br.st              (16.62982 49.05189)
2 CzArch_5 settlement        bronz              (14.52986 50.05246)
3 CzArch_6 settlement        ne.lin             (16.95067 49.77669)
4 CzArch_7 settlement        ne.lin             (16.95067 49.77669)
Function st_transform(x, crs)
EPSG codes:
4326551432633Simple feature collection with 4 features and 3 fields
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: -735634.8 ymin: -1176759 xmax: -566666.7 ymax: -1047924
Projected CRS: S-JTSK / Krovak East North
# A tibble: 4 × 4
  ID_Date  Site_category_ENG Contex_dating_AMCR             geometry
  <chr>    <chr>             <chr>                       <POINT [m]>
1 CzArch_1 hillfort          br.st              (-598287.7 -1176759)
2 CzArch_5 settlement        bronz              (-735634.8 -1047924)
3 CzArch_6 settlement        ne.lin             (-566666.7 -1099048)
4 CzArch_7 settlement        ne.lin             (-566666.7 -1099048)
Geom geom_sf()
Package RCzechia (Lacko, 2023) has spatial data for the Czech republic…
Simple feature collection with 4 features and 3 fields
Geometry type: GEOMETRY
Dimension:     XY
Bounding box:  xmin: 12.40056 ymin: 48.55189 xmax: 15.60422 ymax: 50.61901
Geodetic CRS:  WGS 84
  KOD_KRAJ KOD_CZNUTS3        NAZ_CZNUTS3                       geometry
1     3018       CZ010 Hlavní město Praha MULTIPOLYGON (((14.49806 50...
2     3026       CZ020   Středočeský kraj POLYGON ((15.16973 49.61046...
3     3034       CZ031     Jihočeský kraj MULTIPOLYGON (((15.4962 48....
4     3042       CZ032      Plzeňský kraj MULTIPOLYGON (((13.60536 49...
Simple feature collection with 4 features and 3 fields
Geometry type: GEOMETRY
Dimension:     XY
Bounding box:  xmin: -891822.3 ymin: -1211576 xmax: -665628.7 ymax: -989063.4
Projected CRS: S-JTSK / Krovak East North
  KOD_KRAJ KOD_CZNUTS3        NAZ_CZNUTS3                       geometry
1     3018       CZ010 Hlavní město Praha MULTIPOLYGON (((-736092 -10...
2     3026       CZ020   Středočeský kraj POLYGON ((-696420.7 -110267...
3     3034       CZ031     Jihočeský kraj MULTIPOLYGON (((-681445.6 -...
4     3042       CZ032      Plzeňský kraj MULTIPOLYGON (((-817386.4 -...
st_union()
Simple feature collection with 2 features and 3 fields
Geometry type: GEOMETRY
Dimension:     XY
Bounding box:  xmin: -816235.3 ymin: -1109600 xmax: -665628.7 ymax: -989063.4
Projected CRS: S-JTSK / Krovak East North
  KOD_KRAJ KOD_CZNUTS3        NAZ_CZNUTS3                       geometry
1     3018       CZ010 Hlavní město Praha MULTIPOLYGON (((-736092 -10...
2     3026       CZ020   Středočeský kraj POLYGON ((-696420.7 -110267...
Geometry set for 1 feature 
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: -904576.9 ymin: -1227293 xmax: -431722.5 ymax: -935236.5
Projected CRS: S-JTSK / Krovak East North
st_centroid()
Geometry set for 1 feature 
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: -682473.1 ymin: -1089493 xmax: -682473.1 ymax: -1089493
Projected CRS: S-JTSK / Krovak East North
st_buffer()
Geometry set for 1 feature 
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: -702473.1 ymin: -1109493 xmax: -662473.1 ymax: -1069493
Projected CRS: S-JTSK / Krovak East North
Many types of raletionships, the most generic one is intersection:
st_intersects(x, y)
Simple feature collection with 1 feature and 3 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: -719989.4 ymin: -1181194 xmax: -607864.3 ymax: -1077931
Projected CRS: S-JTSK / Krovak East North
  KOD_KRAJ KOD_CZNUTS3   NAZ_CZNUTS3                       geometry
1     3107       CZ063 Kraj Vysočina MULTIPOLYGON (((-711377.1 -...

st_read() – reads spatial data from the path (data source name, and layer name)
st_write() – writes an object to a specified path (DNS and layer name)
The functions detect what driver to use by the extension.
OGC GeoPackage format (.gpkg)Writing layer `czrep' to data source 
  `<...>/czrep.gpkg' using driver `GPKG'
Writing 1 features with 1 fields and geometry type Polygon.
Reading layer `czrep' from data source `<...>/czrep.gpkg' using driver `GPKG'
Simple feature collection with 1 feature and 1 field
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: -904576.9 ymin: -1227293 xmax: -431723.3 ymax: -935236.5
Projected CRS: S-JTSK / Krovak East North
Brno is this point:
Site_category_ENG)?