[gdal-dev] problem: gdal_grid, output ers raster file

Even Rouault even.rouault at spatialys.com
Wed Mar 3 14:11:44 PST 2021


Hi,

This is a "well known" behaviour of gdal_grid in which it writes raster 
with a bottom-left corner origin, whereas most other GDAL utilities use 
a top-left corner origin. The ERS driver doesn't support such 
convention. The workaround you can use is to output gdal_grid as a TIFF 
(tmp.tif), then use "gdalwarp tmp.tif out.ers" to flip the origin to a 
top-left one.

Even

Le 03/03/2021 à 22:55, Ron Palmer a écrit :
>
> Looks to me like the ERMapper ERS driver has a bug, using the bottom 
> left corner to georef the raster, instead of top left. I can only use 
> it if I use local coordinates, any negative northings are plotted 
> towards the north. ERS is the main raster format I use.
>
> I am happy to assist in sorting out the ERS format if the person 
> behind it is willing to have a look at it.
>
> Thanks,
>
> Ron
>
> On 17/02/2021 4:55 pm, Ron Palmer wrote:
>>
>> I am having issues with outputting ers raster file from gdal_grid. I 
>> import a csv as shape, then grid it and output as ers. The Y coords 
>> are all negative as it is in fact a section I simply grid as a 2D 
>> raster. Although the shape file plots as I expect it, the ers is 
>> flipped upside-down, and hung at the lowest Y value. Please note, if 
>> I use GS7BG it works fine.
>>
>> How do I get an ERS output that matches the shape file/data points?
>>
>> I have created a simple example... however, I am new to GDAL, and 
>> this is my first post, so please let me know if there is anything 
>> else I should provide.
>>
>> Thanks
>>
>> Ron
>>
>>
>> These are the commands:
>>
>>   711  ogr2ogr -f "ESRI Shapefile" xc_zc.shp new.csv -oo 
>> X_POSSIBLE_NAMES=xc -oo Y_POSSIBLE_NAMES=zc
>>   712  gdal_grid -zfield Value -a linear:radius=5 xc_zc.shp -of ERS 
>> xc_zc.ers
>>
>> here is the content of the data
>>
>> xc,zc,Value
>> 1.25,-0.625,5
>> 3.75,-0.625,5
>> 6.25,-0.625,5
>> 8.75,-0.625,5
>> 11.25,-0.625,5
>> 1.25,-1.938,4
>> 3.75,-1.938,4
>> 6.25,-1.938,4
>> 8.75,-1.938,4
>> 11.25,-1.938,4
>> 1.25,-3.381,3
>> 3.75,-3.381,3
>> 6.25,-3.381,3
>> 8.75,-3.381,3
>> 11.25,-3.381,3
>> 1.25,-4.969,2
>> 3.75,-4.969,2
>> 6.25,-4.969,2
>> 8.75,-4.969,2
>> 11.25,-4.969,2
>> 1.25,-6.716,1
>> 3.75,-6.716,1
>> 6.25,-6.716,1
>> 8.75,-6.716,1
>> 11.25,-6.716,1
>>
>> I have attached a jpg of my output (not sure whether the mailing list 
>> allows attachments...)
>>
>>
>>
>> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>> 	Virus-free. www.avg.com 
>> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>>
>>
>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> -- 
>
> *Ron Palmer*MSc MBA
>
> Principal Geophysicist
>
> 0413 579 099 ron.palmer at pgcgroup.com.au
>
> www.pgcgroup.com.au <URL:www.pgcgroup.com.au>
>
> */PGC Geophysics - We specialise in Electrical Surveys!/*
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210303/5b8b85e5/attachment.html>


More information about the gdal-dev mailing list