<html><head><style type="text/css">.style1 {font-family: "Times New Roman";}</style></head><body><div dir="ltr">Cory,<div><br></div><div>So I apologize if I misunderstood your question, but it sounds like you may be trying to implement a geographic to grid transformation of a GeoPDF via a matrix transformation of the four corners of the PDF?</div><div><br></div><div>I have written software to place imagery geolocated using geographic coordinates into documents geolocated using grid coordinates. I spoke with a geodesist at my company about a similar issue and he recommended that I take a sample of points across the image, transform these points from geographic coordinates to grid coordinates and compute a best fit affine transformation between the two sets of points.</div><div><br></div><div>Obviously there is still error inherent in this process (it is best fit not correct fit), but -- for our clients at least -- it produces results with reasonable error and it is not terribly difficult to implement. If I misunderstood your question I apologize. Anyway, I hope that is helpful,</div><div><br></div><div>David</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Sep 3, 2025 at 10:18 PM Cory Foy via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi All,<div><br></div><div>My apologies if this has been asked previously. I’m relatively new to GDAL and recently was able to get it building with PDFium support using GDAL 3.11 for iOS. I’m the developer of a mapping application which allows users to import GeoPDFs and GeoTIFFs (among many other things). I was able to back port the GetExtent code that is going in to 3.12 and extract the extent from a GeoPDF, which was very exciting!</div><div><br></div><div>However, what I’m ultimately trying to do is take a GeoPDF/GeoTIFF and place it on the map. I do this now with KMZ GroundOverlays by bringing in the four corner points and transforming the image to fit those points. I’m guessing the flow I’ll use is something like (and assuming WGS84 just to make things easier):</div><div><br></div><div>- Call GDALGetExtentWGS84LongLat to get the envelope</div><div>- Call GDALGetGeoTransform to get the geotransfmrm</div><div>- Calculate the four corners to get the bounding box:</div><div><span style="white-space:pre-wrap">      </span>- LL: (env.MinX, env.MinY)</div><div><span style="white-space:pre-wrap">       </span>- UL: <span style="color:rgb(0,0,0)">(env.MaxX, env.MinY)</span></div><div><span style="white-space:pre-wrap">  </span>- LR: <span style="color:rgb(0,0,0)">(env.MinX, env.MaxY)</span></div><div><span style="white-space:pre-wrap">  </span>- UR: <span style="color:rgb(0,0,0)">(env.MaxX, env.MaxY)</span></div><div><span style="color:rgb(0,0,0)">- Apply the transformation matrix from the GeoTransform</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><font color="#000000">Does this seem roughly correct? I know there’s GDALWarp but I don’t know enough about it to know if it would help handle this situation.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Thanks so much!</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Cory</font></div><div><br></div><div><br></div></div>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>
<br><br><p style="font-family: Verdana; font-size:10pt; color:#777777;"><b>Disclaimer</b></p><p style="font-family: Verdana; font-size:8pt; color:#777777;">The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.</p></body></html>