I have some site boundary data as follow:
UNB_BDSB_SiBdry_v08_201028lico_25831.cpq
UNB_BDSB_SiBdry_v08_201028lico_25831.dbf
UNB_BDSB_SiBdry_v08_201028lico_25831.prj
UNB_BDSB_SiBdry_v08_201028lico_25831.sbn
UNB_BDSB_SiBdry_v08_201028lico_25831.sbx
UNB_BDSB_SiBdry_v08_201028lico_25831.shp
UNB_BDSB_SiBdry_v08_201028lico_25831.shp.xml
UNB_BDSB_SiBdry_v08_201028lico_25831.shx
Reading those is R
via rgdal
package:
myfile = readOGR(dsn = dsn
layer = "UNB_BDSB_SiBdry_v08_201028lico_25831")
I'm getting a warning:
OGR data source with driver: ESRI Shapefile
Source: dsn, layer: "UNB_BDSB_SiBdry_v08_201028lico_25831"
with 1 features
It has 4 fields
Warning message:
In OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, dumpSRS = dumpSRS, :
Discarded datum European_Terrestrial_Reference_System_1989 in Proj4 definition: +proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
And the data looks like:
head(myfile@data)
NAME GISFILE SHAPE_Leng SHAPE_Area
0 Norfolk Boreas UNB_BDSB_SiBdry_v08_201028lico_25831 90513.37 442457610
Now if I use the addpolygons
function from leaflet, I can not see any added polygon!
leaflet::leaflet(data = myfile) %>% addTiles() %>%
addPolygons(
fillColor = "green",
highlight = highlightOptions(color = "red", weight = 5,
fillOpacity = 0.7,
bringToFront = TRUE))
I'm wondering if there is something wrong with the data or I am doing something wrong!
Also the result using the st_read
function from the sf
package is as follow :
sf_data = st_read(dsn = "\\\\sv52hcn8934.corp.vattenfall.com/bgf93$/Documents/Map/220420_AH_BdyShp",
+ layer = "UNB_BDSB_SiBdry_v08_201028lico_25831")
summary(sf_data)
NAME GISFILE SHAPE_Leng SHAPE_Area geometry
Length:1 Length:1 Min. :90513 Min. :442457610 POLYGON :1
Class :character Class :character 1st Qu.:90513 1st Qu.:442457610 epsg:25831 :0
Mode :character Mode :character Median :90513 Median :442457610 +proj=utm ...:0
Mean :90513 Mean :442457610
3rd Qu.:90513 3rd Qu.:442457610
Max. :90513 Max. :442457610
sf
package and functionst_read
to read the shapefile, and show us the summary or the normal print value of the object?sf
package added to the question !