lunedì 12 maggio 2014

TFW: Comma to Point

The TFW was build with the comma instead of point as decimal separator.
This is an issue for some GIS softwares so is need to resolve.

An example:
----
4,2336280797917594
8,7000389611034787e-005
-3,7967992801623495e-005
-4,2334471495687653
1687840,3554409891
4787158,6027319813
----

The solution is using the OSGEO4Wshell:

The sed command:
sed "/[0-9]\,/s/,/\./g" -i file.tfw < file.tfw

and a FOR cycle.

So:
suppose the tiff+tfw are all in this folder path
D:/temp/temp/prove

The for cycle is this:


for /R D:/temp/temp/prove %f IN (*.tfw) do sed "/[0-9]\,/s/,/\./g" -i %f < %f

Run and see that all the tfw are correctly with the point symbol.
like this:

---
4.2333743174393925
-2.3049048341267813e-005
-6.1198092636898077e-005
-4.2328667675685194
1577094.09993232
4940038.9227409437
---

ok, the problem is gone.

A.

1 commento: