[gdal-dev] gdaltranslate and gdalwarp rotating and resizing image without being asked to, why?
Jesse McGraw
jlmcgraw at gmail.com
Tue Jul 1 06:50:18 PDT 2014
On Mon, Jun 30, 2014 at 3:07 PM, Even Rouault <even.rouault at mines-paris.org>
wrote:
>
>
> That might the problem. If you create the GCPs on the PDF and not on the
> PNG,
> and that the PDF has rotation, pdftoppm I think will apply the rotation,
> hence
> the axis swapping.
>
Remember, I'm using the PNG I've created for all gdal operations, gdal
never interacts with the source PDF
I'm probably fundamentally misunderstanding some aspect of the command
lines I'm using in gdal*. My end goal is to get the necessary affine
transformation information to display the PNG I create in step 3a properly
in a separate Android moving-map application (eg. your current position
displayed on the diagram as you move around the airport)
Well I'm really confused by what you are trying to do.
>
> For a better understanding, you should perhaps provide the PDF and all
> exact
> command lines you are typing.
>
Here's a step-by-step with links to relevant files for a landscape diagram
(SFO)
1. Get source PDFs from the Federal Aviation Administrator (FAA)
https://drive.google.com/file/d/0B4EbUsrclSoDeXdmM3gyV29WN0U/edit?usp=sharing
2. Run my utility.
3a. It converts the PDF to a PNG,
https://drive.google.com/file/d/0B4EbUsrclSoDMTlDZzQzeDJWU1U/edit?usp=sharing
3b. create GCPs for GDAL based on the coordinates within the PNG (hard to
see but green circles mark the GCPs chosen to correspond to the lat/lon
shown on diagram)
https://drive.google.com/file/d/0B4EbUsrclSoDWUtqNVgtWFUwa0k/edit?usp=sharing
3c. gdal_translate the PNG file based on the GCPs we found to an
intermediate VRT
gdal_translate -q -of VRT -strict -a_srs EPSG:4326 -gcp 1017.14863049096
1800.51717680381 -122.4 37.6166666666667 -gcp 337.854728682168 1260.25
-122.383333333333 37.6333333333333 -gcp 1017.14863049095 1260.25
-122.383333333333 37.6166666666667 -gcp 1017.14863049096 720.166666666667
-122.366666666667 37.6166666666667 -gcp 337.854728682172 720.166666666667
-122.366666666667 37.6333333333333 -gcp 337.854728682172 1800.33895140302
-122.4 37.6333333333333 './dtpp/00375AD.png'
'./dtpp/CA-SFO-00375AD-PDF-AIRPORT-DIAGRAM.vrt'
https://drive.google.com/file/d/0B4EbUsrclSoDX2hzTTBsY1c5dXM/edit?usp=sharing
3d. gdalwarp the intermediate VRT to the final VRT
gdalwarp -q -of VRT -t_srs EPSG:4326 -order 1 -overwrite
''./dtpp/CA-SFO-00375AD-PDF-AIRPORT-DIAGRAM.vrt''
'./dtpp/warpedCA-SFO-00375AD.PDF-AIRPORT DIAGRAM.vrt'
https://drive.google.com/file/d/0B4EbUsrclSoDTmNDanFmbkVvVm8/edit?usp=sharing
Here's the process for a portrait one
1. Get source PDFs from the Federal Aviation Administrator (FAA)
https://drive.google.com/file/d/0B4EbUsrclSoDMjNPOVBPT01JS1U/edit?usp=sharing
2. Run my utility.
3a. It converts the PDF to a PNG,
https://drive.google.com/file/d/0B4EbUsrclSoDTUZNY2RKaVVHMDQ/edit?usp=sharing
3b. create GCPs for GDAL based on the coordinates within the PNG (hard to
see but green circles mark the GCPs chosen to correspond to the lat/lon
shown on diagram)
https://drive.google.com/file/d/0B4EbUsrclSoDbHNyTnhGczh3RDA/edit?usp=sharing
3c. gdal_translate the PNG file based on the GCPs we found to an
intermediate VRT
gdal_translate -q -of VRT -strict -a_srs EPSG:4326 -gcp 310.408626924008
1496.72390271202 -77.3333333333333 37.5 -gcp 976.562655349203
660.697730425566 -77.3166666666667 37.5166666666667 -gcp 310.523817613394
660.744792369168 -77.3333333333333 37.5166666666667 -gcp 976.580225174465
1496.63921742496 -77.3166666666667 37.5 './dtpp/00347AD.png'
'./dtpp/VA-RIC-00347AD-PDF-AIRPORT-DIAGRAM.vrt'
https://drive.google.com/file/d/0B4EbUsrclSoDRzdVZDQzY2lZT1U/edit?usp=sharing
3d. gdalwarp the intermediate VRT to the final VRT
gdalwarp -q -of VRT -t_srs EPSG:4326 -order 1 -overwrite
''./dtpp/VA-RIC-00347AD-PDF-AIRPORT-DIAGRAM.vrt''
'./dtpp/warpedVA-RIC-00347AD.PDF-AIRPORT DIAGRAM.vrt'
https://drive.google.com/file/d/0B4EbUsrclSoDRGptZFhhaVdaT1E/edit?usp=sharing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140701/4be15736/attachment.html>
More information about the gdal-dev
mailing list