tiling_etopos
Differences
This shows you the differences between two versions of the page.
tiling_etopos [2023/07/07 18:40] – created bushwalking | tiling_etopos [2023/07/08 09:52] (current) – bushwalking | ||
---|---|---|---|
Line 12: | Line 12: | ||
First step is to strip off the border of the PDF and convert to a raster format. We can do this for a single image using gdalwarp, by setting a few options, including: | First step is to strip off the border of the PDF and convert to a raster format. We can do this for a single image using gdalwarp, by setting a few options, including: | ||
- | - | + | |
* -r < | * -r < | ||
* -cutline - applies a mask to the raster (confusingly, | * -cutline - applies a mask to the raster (confusingly, | ||
Line 21: | Line 21: | ||
Sample command in full - you'll need to set your own directories, | Sample command in full - you'll need to set your own directories, | ||
- | < | + | < |
Unfortunately this approach turns a 10MB PDF into a 70MB GeoTiff! | Unfortunately this approach turns a 10MB PDF into a 70MB GeoTiff! | ||
You can batch automate the conversion of these in Windows by running a Powershell command eg | You can batch automate the conversion of these in Windows by running a Powershell command eg | ||
- | < | + | < |
$srcFile = $_.FullName | $srcFile = $_.FullName | ||
$destFile = $_.FullName -replace ' | $destFile = $_.FullName -replace ' | ||
Line 35: | Line 35: | ||
You now have a directory of GeoTiffs. In Windows, you can run the following at the command line to create a list of all the files in a text document: | You now have a directory of GeoTiffs. In Windows, you can run the following at the command line to create a list of all the files in a text document: | ||
- | < | + | < |
Finally, you can run gdal_merge, using the list from the previous step to create one huge GeoTiff. Note that normal GeoTiffs max out at 4GB, so you need to be selective about how many files you include in the merge. If you try to include too many, you will get errors, and a partially completed output. I got away with 56 1:25k maps, but the actual number will depend on various factors. There is a BIGTIFF=YES option that can be added to the -co option, but I don't know how this works in downstream processes/ | Finally, you can run gdal_merge, using the list from the previous step to create one huge GeoTiff. Note that normal GeoTiffs max out at 4GB, so you need to be selective about how many files you include in the merge. If you try to include too many, you will get errors, and a partially completed output. I got away with 56 1:25k maps, but the actual number will depend on various factors. There is a BIGTIFF=YES option that can be added to the -co option, but I don't know how this works in downstream processes/ | ||
- | < | + | < |
For OziExplorer, | For OziExplorer, |
tiling_etopos.1688719243.txt.gz · Last modified: 2023/07/07 18:40 by bushwalking