How to load geospatial pdf file in R?

I am new to spatial data processing and the new one is in R.

My last attemp tried to read geographic pdf data. This is information about the Mexican political bourds, so the polygons are a file .

I tried using a package rgdalto read data. After input ogrDrivers()[40:45,]that shows the available drivers, I received.

         name write
40     PCIDSK  TRUE
41        PDF  TRUE
42        PDS FALSE
43     PGDump  TRUE
44       PGeo FALSE
45 PostgreSQL  TRUE

The result shows that there is a driver for PDF files, but when you try to read files normally, it readOGR(dsn = "data source name", layer = "LAYER")creates:

Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  : 
  Cannot open file

The help of the function does not say the values โ€‹โ€‹expected neither for dsnnor for layerwhen the file is in geospatial pdf format.

- pdf? ; .

, Ubuntu 14.04.3 Qgis R rgeos.

+4
1

dsn - , - PDF. ogrListLayers :

> ogrListLayers("foo.pdf")
[1] "polys"
attr(,"driver")
[1] "PDF"
attr(,"nlayers")
[1] 1

, polys. :

> polys = readOGR("./foo.pdf","polys")
OGR data source with driver: PDF 
Source: "./foo.pdf", layer: "polys"
with 9 features
It has 1 fields

, PDF , . , PDF , Geospatial PDF. Geospatial PDF:

$ ogrinfo Monaco/foo.pdf 
Had to open data source read-only.
INFO: Open of `Monaco/foo.pdf'
      using driver `PDF' successful.
1: polys (Polygon)

:

$ ogrinfo CED06_CARTA_110614.pdf 
FAILURE:
Unable to open datasource `CED06_CARTA_110614.pdf' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
   [etc etc]
  -> PDF
   [etc etc]

, Geospatial PDF.

:

  • (, , GeoPDF)
  • , , (QGIS )
  • PDF- PDF, ( , ), , , , , , ...

, pstoedit, PDF DXF, QGIS, , . , .

PDF, raster::stack("file.pdf") readGDAL("file.pdf"). ( ), PDF.

+5

Source: https://habr.com/ru/post/1624735/


All Articles