[GIS] Is it possible to georeference an existing, un-georeferenced pdf

arcgis-desktopgeoreferencinggeospatial-pdfimportpdf

I was wondering if there was anyway to georeference a pdf directly without first converting it to an image. I have access to ArcGIS 10.1 but haven't been able to find any information that would indicate it is possible. I am willing to try other open source software if they have a solution.

I receive site plans in PDF form, often generated from AutoCAD. Currently I save the pdf as a jpg to import into ArcMap, geo-reference it, and then digitize things like building footprints. I'm just wondering if there is a way to skip the conversion to jpg step.

Best Answer

I know this question is old, but I had this issue recently and eventually came out with a way to do this.

This can be accomplished by using Osgeo's gdal, which happens to have a PDF driver included. Basically you can do something like:

from osgeo import gdal
#Open your Unreferenced PDF
src = gdal.Open("originalFile.pdf")

Then obtain or calculate somehow the desired Projection System and Geotransform you want to add to the PDF. For example, we can extract those from a GeoTiff by doing:

#Open the Tiff to obtain its data from
geoTiff = gdal.Open("someMap.tif")
#Obtain its Projection system and its Geotransform
coords = geoTiff.GetProjection()
gt = geoTiff.GetGeoTransform()

Finally, set the projection and geotransform to your PDF and then create a copy with the PDF Driver:

src.SetProjection(coords)
src.SetGeoTransform(gt)
#Instantiate a PDF driver and save your Referenced copy
pdf_driver = gdal.GetDriverByName("PDF")
dst = pdf_driver.CreateCopy("referencedFile.pdf", src, 1)

The result is a PDF that is georeferenced to have its upper-left corner placed at location gt using the Projection System coords. This can be verified by opening the PDF on QGis or ArcGis, or well by using the gdalinfo command on your referenced PDF.

Related Question