Cory, 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?
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. 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, David On Wed, Sep 3, 2025 at 10:18 PM Cory Foy via gdal-dev < gdal-dev@lists.osgeo.org> wrote: > Hi All, > > 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! > > 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): > > - Call GDALGetExtentWGS84LongLat to get the envelope > - Call GDALGetGeoTransform to get the geotransfmrm > - Calculate the four corners to get the bounding box: > - LL: (env.MinX, env.MinY) > - UL: (env.MaxX, env.MinY) > - LR: (env.MinX, env.MaxY) > - UR: (env.MaxX, env.MaxY) > - Apply the transformation matrix from the GeoTransform > > 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. > > Thanks so much! > > Cory > > > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/gdal-dev > Disclaimer 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.
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev