[gdal-dev] gdal_rasterize usage problems

Jamie Adams jaadfoo at gmail.com
Fri Nov 14 18:49:59 EST 2008


The datum change isn't sufficient, as they are using different coordinate
systems.  They actually have to have the same SRS, otherwise gdal_rasterize
will see 2 very different ranges of coordinates (meter vs latlong).

PROJCS["OSGB 1936 / British National Grid",
    GEOGCS["OSGB 1936",
        DATUM["OSGB_1936",
            SPHEROID["Airy 1830",6377563.396,299.3249646,
                AUTHORITY["EPSG","7001"]],
            AUTHORITY["EPSG","6277"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.01745329251994328,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4277"]],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",49],
    PARAMETER["central_meridian",-2],
    PARAMETER["scale_factor",0.9996012717],
    PARAMETER["false_easting",400000],
    PARAMETER["false_northing",-100000],
    AUTHORITY["EPSG","27700"]]

vs.

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

As far as the reprojection goes, are you getting errors in the output vector
or only after rasterization?


On Fri, Nov 14, 2008 at 3:19 PM, Andrew Brooks <arb at sat.dundee.ac.uk> wrote:

> Thanks for the help everyone, I'll summarise when I get it all working ;-)
>
> Jamie Adams <jaadfoo at gmail.com> wrote:
> >
> > Are your files in the same projection?  I know gshhs is projected in
> wgs84
> > by default, and I see your raster is in British National Grid.
>
> To what extent do they need to be in the same projection?  Isn't a change
> of datum sufficient?
>
> Firstly, is gdal_rasterize not capable of performing the change of SRS
> internally itself?  That would save having to use ogr2ogr to write a new
> vector file for every image.
>
> Secondly, how closely do the vector and raster SRS need to match?  Surely
> as long as both are WGS84 (for example) that should suffice?  But when I
> try to rasterise a WGS84 vector onto a WGS84 Mercator raster it complains
> and doesn't work.
>
> Thirdly, when I "reproject" the vector to Mercator first and then rasterize
> it does work, to an extent, but it smears random extra vectors across the
> raster :-(  It does this for both gshhs_land and v0_landmass so I don't
> think the vector itself is the problem.
>
> Andrew
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20081114/5a30a03c/attachment-0001.html


More information about the gdal-dev mailing list