Question

How to Georeference a PDF?

  • 2 October 2023
  • 7 replies
  • 20 views

Userlevel 1
Badge +14
  • Contributor
  • 120 replies

Using two files: a PDF with no geodata, and a georeferenced polygon. They cover the exact same area (bounding box of PDF = polygon). The polygon and the PDF were originally created in the same coordinate system. There should be no need for "warping". Its just only the georeferenced coordinates in the PDF that are missing.

 

Q: How do I georeference the PDF using the polygon?

 


7 replies

Userlevel 6
Badge +33

Multiple ways to do this, but one way is to use the AffineWarper. You need to generate from - to lines with two points based on the unreferenced bounding box and the georeferenced polygon, these are the control features. From these the transformation parameters will be calculated. Features entering the Observed port will be transformed with these parameters.

Userlevel 1
Badge +14

Multiple ways to do this, but one way is to use the AffineWarper. You need to generate from - to lines with two points based on the unreferenced bounding box and the georeferenced polygon, these are the control features. From these the transformation parameters will be calculated. Features entering the Observed port will be transformed with these parameters.

Thanks!

 

You mentioned multiple methods, which method is the quickest in your experience? The PDF-files in question are beasts.

Userlevel 5
Badge +28

If it's just an offset which need to be applied you can use an Offsetter

 

You will need to know the difference between the x,y of the lower left corner of the bounding box and the lower left corner of the PDF.

 

the offsetter will shift the data by the provided x and y components.

 

If, however, your PDF has been scaled and/or rotated then you'll need to use an Affiner transformer - the Affiner transformer requires that you provide a TransformationMatrix e.g., https://en.wikipedia.org/wiki/Affine_transformation#Image_transformation

 

There might be an easier way but off the top of my head I can't think of anything

Userlevel 1
Badge +14

I forgot an important piece of info.

 

The polygon and the PDF files were originally created in the same coordinate system. There should be no need for "warping". Its only the georeferenced coordinates in the PDF that are missing.

Userlevel 6
Badge +33

Thanks!

 

You mentioned multiple methods, which method is the quickest in your experience? The PDF-files in question are beasts.

If it is only scaled and moved you can use a Scaler and an Offsetter.

Userlevel 6
Badge +33

Attached sample workspace demonstrating the AffineWarper.

AffineWarperSample(2021)_result

Userlevel 1
Badge +14

In case it is of use to anyone else, I ended up scavenging what I needed from the excellent FME Hub transformer ‘BoundsFitter’.

Reply