[gdal-dev] Seg fault & error running gdal_rasterize on a non georeferenced raster
Mark Johnson
mj10777 at googlemail.com
Tue Nov 29 21:44:11 PST 2016
This may be a similar problem to what was mentioned here:
#6721: Simplifing use of gdalwarp with cutline with non-georeferenced
rasters
https://trac.osgeo.org/gdal/ticket/6721
(which has not been reacted to)
There the gal was to use gdalwarp, together with a cutline, to cut out a
portion of the non georeferenced raster (sample: image with folds which
need to be removed).
Here the idea was to emulate any meter base system (such as 3395 WGS 84 /
World Mercator), creating a world file that always looks like this:
1.00000000000000
0.00000000000000
0.00000000000000
-1.00000000000000
0.00000000000000
0.00000000000000
Sample: small non georeferenced raster map from Wiki (1200x864):
wget
https://upload.wikimedia.org/wikipedia/commons/a/a0/Karte_berlin_akzisemauer.png
-O 18550101.Karte_berlin_akzisemauer.wiki.png
echo -e "1.00000000000000\n 0.00000000000000\n 0.00000000000000\n
-1.00000000000000\n 0.00000000000000\n 0.00000000000000" >
18550101.Karte_berlin_akzisemauer.wiki.pgw
gdal_translate -a_srs epsg:3395 18550101.Karte_berlin_akzisemauer.wiki.png
18550101.Karte_berlin_akzisemauer.wiki.ref_3395.tif
gdalinfo 18550101.Karte_berlin_akzisemauer.wiki.ref_3395.tif
Using '-te' create a cutline around the boundry shown on the map
- remembering the 'y/height' is always minus (i.e top=0, bottom=height*-1)
--> top=-50 ; bottom=-690
gdalwarp -s_srs epsg:3395 -t_srs epsg:3395 -te 220 -690 1160 -50
18550101.Karte_berlin_akzisemauer.wiki.ref_3395.tif
18550101.Karte_berlin_akzisemauer.cut.ref_3395.tif
Without a world file you get with:
gdalwarp -s_srs epsg:3395 -t_srs epsg:3395 -te 220 -690 1160 -50
18550101.Karte_berlin_akzisemauer.wiki.png
18550101.Karte_berlin_akzisemauer.cut.ref_png.tif
ERROR 1: The transformation is already "north up" or
a transformation between pixel/line and georeferenced
coordinates cannot be computed for
18550101.Karte_berlin_akzisemauer.wiki.png.
There is no affine transformation and no GCPs.
Specify transformation option SRC_METHOD=NO_GEOTRANSFORM to bypass this
check.
(which is what you got)
What the meaning of is: SRC_METHOD=NO_GEOTRANSFORM
- no idea
But with a world file the expected result comes out.
Mark Johnson Berlin Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161130/b635bc89/attachment.html>
More information about the gdal-dev
mailing list