[gdal-dev] gdal2tiles PDF --config GDAL_PDF_DPI option

Mike Flannigan mikeflan at att.net
Sat Sep 19 07:08:34 PDT 2020


Obviously I am not an expert here, since gdal2tiles
does not work on my Linux system.

I do:
gdal2tiles -r antialias -a 255 king.pdf test1 --config GDAL_PDF_DPI 600

I get:
gdal2tiles: command not found

I do:
whereis gdal

I get:
gdal: /usr/share/gdal

I look up gdal2tiles on the web and I think I see that
it is part of gdal:
https://gdal.org/programs/gdal2tiles.html

I do:
gdal -v

Surprisingly I get:
Command 'gdal' not found, did you mean: . . .

I do:
gdal_translate -of GTiff -co "COMPRESS=DEFLATE" --config GDAL_PDF_DPI 
300 /home/mike/Documents/copy3/king.pdf /home/mike/Documents/copy3/king.tif
which I have done many times before.

It runs for many minutes and produces the TIF file, but
the TIF file is only 70 kB and does not display an image
when opened.  It only displays a checkerboard palette.


I go to:
/usr/share/gdal/2.2
and I don't see gdal_translate or gdal2tiles.
I do see the files below.


I am confused and I guess I need to study the
workings of the gdal program some more.  If anybody
wants to point me to a page that can help me,
please do.


Mike


2.2
├── compdcs.csv
├── coordinate_axis.csv
├── datum_shift.csv
├── default.rsc
├── ellipsoid.csv
├── epsg.wkt
├── esri_StatePlane_extra.wkt
├── esri_Wisconsin_extra.wkt
├── gcs.csv
├── gcs.override.csv
├── gdal_datum.csv
├── gdalicon.png
├── GDALLogoBW.svg
├── GDALLogoColor.svg
├── GDALLogoGS.svg
├── gdalvrt.xsd
├── geoccs.csv
├── gmlasconf.xml
├── gmlasconf.xsd
├── gml_registry.xml
├── gt_datum.csv
├── gt_ellips.csv
├── header.dxf
├── inspire_cp_BasicPropertyUnit.gfs
├── inspire_cp_CadastralBoundary.gfs
├── inspire_cp_CadastralParcel.gfs
├── inspire_cp_CadastralZoning.gfs
├── jpfgdgml_AdmArea.gfs
├── jpfgdgml_AdmBdry.gfs
├── jpfgdgml_AdmPt.gfs
├── jpfgdgml_BldA.gfs
├── jpfgdgml_BldL.gfs
├── jpfgdgml_Cntr.gfs
├── jpfgdgml_CommBdry.gfs
├── jpfgdgml_CommPt.gfs
├── jpfgdgml_Cstline.gfs
├── jpfgdgml_ElevPt.gfs
├── jpfgdgml_GCP.gfs
├── jpfgdgml_LeveeEdge.gfs
├── jpfgdgml_RailCL.gfs
├── jpfgdgml_RdArea.gfs
├── jpfgdgml_RdASL.gfs
├── jpfgdgml_RdCompt.gfs
├── jpfgdgml_RdEdg.gfs
├── jpfgdgml_RdMgtBdry.gfs
├── jpfgdgml_RdSgmtA.gfs
├── jpfgdgml_RvrMgtBdry.gfs
├── jpfgdgml_SBAPt.gfs
├── jpfgdgml_SBArea.gfs
├── jpfgdgml_SBBdry.gfs
├── jpfgdgml_WA.gfs
├── jpfgdgml_WL.gfs
├── jpfgdgml_WStrA.gfs
├── jpfgdgml_WStrL.gfs
├── netcdf_config.xsd
├── nitf_spec.xml
├── nitf_spec.xsd
├── ogrvrt.xsd
├── osmconf.ini
├── ozi_datum.csv
├── ozi_ellips.csv
├── pci_datum.txt
├── pci_ellips.txt
├── pcs.csv
├── pcs.override.csv
├── plscenesconf.json
├── prime_meridian.csv
├── projop_wparm.csv
├── ruian_vf_ob_v1.gfs
├── ruian_vf_st_uvoh_v1.gfs
├── ruian_vf_st_v1.gfs
├── ruian_vf_v1.gfs
├── s57agencies.csv
├── s57attributes.csv
├── s57expectedinput.csv
├── s57objectclasses.csv
├── seed_2d.dgn
├── seed_3d.dgn
├── stateplane.csv
├── trailer.dxf
├── unit_of_measure.csv
├── vdv452.xml
├── vdv452.xsd
├── vertcs.csv
└── vertcs.override.csv




On 9/19/20 5:49 AM, gdal-dev-request at lists.osgeo.org wrote:
> I've been looking into the gdal2tiles code (both version 2.4.0 and 3.1.2),
> but am quite unfamiliar with the gdal python library. I'm hoping for some
> pointers on what I can test/look into to get the results i'm hoping for.
>
> The input is a georeferenced PDF, with it's content being svg/vector instead
> of raster. I noticed that using the* --config GDAL_PDF_DPI* option allows
> for higher quality tiles at high zoom levels. E.g.:
> gdal2tiles -r antialias -a 255 input.pdf test1 --config GDAL_PDF_DPI 600
>
> But when also using the option *--processes=* (any number),  the
> GDAL_PDF_DPI is somehow ignored/misinterpreted:
> In V2.4.0, the option seems to be ignored, as tiles are created exactly the
> same to the output with --config and --processes
> In V3.1.2, the output is different, but faulty. It creates tiles according
> the new DPI size/resolution, but only the zone of the original DPI
> size/resolution contains content (e.g:for a pdf with size 100x100 at default
> dpi, at double the DPI it will create tiles for the same georeferenced area
> for a PDF at size 200x200, but only the top-left 100x100 contains content,
> the other has nodata values)
>
> Any ideas? Preferably in V2.4.0.



More information about the gdal-dev mailing list