TransWikia.com

GDAL Georeference Script Not Working

Geographic Information Systems Asked on July 20, 2021

I have two GDAL scripts provided to me by a Developer for my app. Their purpose is to Georeference a large PNG used in the app. For that reason I am reluctant to try and Georeference the image in any other way. I am using GDAL 2.4.1, released 2019/03/15 in Mac Terminal. OSX Sierra

The first (gdal_translate -of GTiff) assigns coordinates to the image and that appears to work well. There is a displayed count up to 100 by tens that takes a few minutes and the new file with new name is created.

The second (gdalwarp Code Below) does not give any error message, but it does not render anything. After it is entered, the Terminal window just shows a caret. “gdalinfo –version” does not work on this second lone caret so that it appears to have been bounced out of the Terminal shell. I understand the second process is a long one and I have left it overnight. I am so new to Command Line apps that I am not sure how to find the fault or to monitor if the process is working in any part. When I type “exit” I do not get any Alert of an ongoing process.

Please let me know if you see an error or need further clarification.

gdal_translate -of GTiff -gcp 7563.95 4320.58 -73.9184 40.873 -gcp 8108.4 10226.6 -73.9248 40.8616 -gcp 7263.48 9620.7 -73.9261 40.8636 -gcp 6852.13 10204.4 -73.9278 40.863 -gcp 8256.75 23730.5 -73.9425 40.8371 -gcp 7652.04 23730.5 -73.944 40.8378 -gcp 7709.72 23991 -73.9443 40.8371 -gcp 9344.24 18121.9 -73.9324 40.8462 -gcp 8732.03 18377.3 -73.9343 40.8462 -gcp 8232.49 18125.7 -73.9351 40.8473 -gcp 20308.3 22232.3 -73.9117 40.8277 -gcp 21379.5 23523.3 -73.9109 40.8242 -gcp 22144.1 23160.2 -73.9086 40.8241 -gcp 26010.5 22679 -73.8989 40.8211 -gcp 28283.3 21440 -73.8918 40.821 -gcp 28717.5 21560.1 -73.8908 40.8204 -gcp 27365.5 20008.6 -73.892 40.8246 -gcp 26338.2 12450.3 -73.8843 40.8393 -gcp 10120.1 3523.4 -73.9113 40.8717 -gcp 5902.81 16559.1 -73.9387 40.8524 -gcp 6728.52 19084 -73.9399 40.847 -gcp 6887.73 19822.5 -73.9405 40.8454 -gcp 8254.82 26078.6 -73.9457 40.8328 -gcp 14195.9 30294.5 -73.9371 40.8191 -gcp 14898 37025.1 -73.9444 40.8064 -gcp 16128.8 38326.9 -73.943 40.8026 -gcp 10621.2 52177.7 -73.9745 40.7832 -gcp 11724.9 53505.6 -73.9736 40.7795 -gcp 25346.9 83459.4 -73.9806 40.7115 -gcp 14574.1 86816.6 -74.0109 40.7163 -gcp 8094.17 26801.2 -73.9469 40.8316 -gcp 18712.4 91404.6 -74.0071 40.7038 -gcp 25929.5 82168.8 -73.9776 40.7133 -gcp 12880.7 41824.3 -73.9554 40.7996 -gcp 22118.9 51021.4 -73.9457 40.7736 -gcp 22026.4 49580.4 -73.9439 40.7763 -gcp 20096.2 50380.2 -73.9494 40.7769 -gcp 8260.2 26173.3 -73.9457 40.8327 -gcp 9343.99 26173.3 -73.943 40.8316 -gcp 9343.99 26794.8 -73.944 40.8303 -gcp 8260.2 26798.6 -73.9466 40.8315 -gcp 10119.4 3607.08 -73.9113 40.8716 -gcp 12882.8 41825.8 -73.9554 40.7995 -gcp 24845.4 82724.5 -73.9809 40.7135 -gcp 12578.3 82600.8 -74.0099 40.726 -gcp 15460.1 59813.3 -73.973 40.7643 -gcp 11714.8 52182.3 -73.9717 40.782 -gcp 10622.1 53504.9 -73.9764 40.7807 -gcp 14103 59888 -73.9763 40.7657 -gcp 13006.9 60630.5 -73.98 40.7655 -gcp 8154.9 61697.1 -73.9929 40.7684 -gcp 14197.3 65862.7 -73.9841 40.7548 -gcp 8136.12 68647.1 -74.0021 40.7558 -gcp 9433.64 70712.2 -74.0019 40.7508 -gcp 21127.2 48967.8 -73.9453 40.7785 -gcp 15555.1 49311.6 -73.959 40.7834 -gcp 22113.2 51455.4 -73.9462 40.773 -gcp 21127.3 53284.6 -73.9509 40.7707 -gcp 23710.2 54419.1 -73.9462 40.7659 -gcp 15461.5 60158.1 -73.9735 40.7637 -gcp 15461.8 66483.7 -73.9819 40.7522 -gcp 16135.5 71393.2 -73.9866 40.7428 -gcp 20186.7 71733.8 -73.9776 40.7381 -gcp 20095 62724 -73.9657 40.7545 -gcp 9345.89 72812.1 -74.0047 40.747 -gcp 11730.6 74768.2 -74.0016 40.7411 -gcp 10158.2 76851.7 -74.0081 40.7388 -gcp 14830.7 77990.3 -73.9986 40.7322 -gcp 12767.1 80521.2 -74.0069 40.7295 -gcp 14188.3 84330.5 -74.0084 40.7213 -gcp 13266.4 88396.2 -74.0162 40.7148 -gcp 14596.1 91355.9 -74.0167 40.7081 -gcp 18854.2 74441.1 -73.9843 40.7345 -gcp 20102.7 75035.1 -73.9821 40.732 -gcp 21119.3 76917.4 -73.9822 40.7278 -gcp 22005.4 77820.1 -73.9812 40.7251 -gcp 23098.5 79782.9 -73.9813 40.7206 -gcp 25278 83213.4 -73.9807 40.7121 -gcp 16494.3 86972.4 -74.0063 40.7142 -gcp 17551.5 92587.9 -74.0115 40.7029 -gcp 16766.2 92593.5 -74.0131 40.7036 "/Users/graphicedge/manhattan_Slices/Slice1234.png" "/Users/graphicedge/manhattan_Slices/Slice1234-trans.png"

gdalwarp -r bilinear -order 2 -t_srs EPSG:4326 -co COMPRESS=LZW -co NUM_THREADS=ALL_CPUS -co TILED=YES "/Users/graphicedge/manhattan_Slices/Slice1234-trans.png” "/Users/graphicedge/manhattan_Slices/Slice1234_modified.tiff"

2 Answers

Latest news:

Looks like deleting quote marks (") in gdalwarp path works. Weird b/c quote marks worked in gdal_translate path.

Answered by TomH on July 20, 2021

You have a fancy quote instead of the proper "programmer" quote " there at the end:

"/Users/graphicedge/manhattan_Slices/Slice1234-trans.png”

Quotes are used to denote/deliminate strings and must always appear in pairs.

That means the full command has 3 proper quotes and one that is just a fancy character.

That then means that your terminal receives the following snippet as a string:

"/Users/graphicedge/manhattan_Slices/Slice1234-trans.png” "

and then the following bit with a single dangling quote at the end

/Users/graphicedge/manhattan_Slices/Slice1234_modified.tiff"

That nothing happens is because the terminal waits for a quote that closes the string.

Replace that fancy quote with a normal " and it will work.

Answered by bugmenot123 on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP