Raster VRT SRS syntax

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Raster VRT SRS syntax

Zoltan Szecsei
Hi,
I'm running an older version of gdalbuildvrt that does not recognise the a_srs parameter, so I want to replace line 2 of the resulting VRT file with my own SRS entry.
I have tried:
<SRS>HBKNO27</SRS>
and various other permutations with and without the 'ZANGI:' prefix.

From the GDAL tutorial, I know the EPSG code syntax style is <SRS>EPSG:4326</SRS>

The CRS I need is  ZANGI:ZANGI:HBKNO27 or 'South African CRS: HBK_NO_27'

Can someone please guide me to the correct syntax.

TIA,
Zoltan
-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
GIS and Photogrammetric Services

P.O. Box 7, Muizenberg 7950, South Africa.

Mobile: +27-83-6004028
Fax:    +27-86-6115323     www.geograph.co.za
===========================================

_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Raster VRT SRS syntax

Even Rouault-2
Zoltan,

Le mercredi 29 octobre 2014 13:21:51, Zoltan Szecsei a écrit :
> Hi,
> I'm running an older version of gdalbuildvrt that does not recognise the
> a_srs parameter, so I want to replace line 2 of the resulting VRT file
> with my own SRS entry.
> I have tried:
>
>     <SRS>HBKNO27</SRS>

Yes, that will not work. The VRT driver uses the SetFromUserInput() API. See
its doc for accepted syntax :
http://www.gdal.org/classOGRSpatialReference.html#aec3c6a49533fe457ddc763d699ff8796

Based on the definition I found in http://hub.qgis.org/issues/8487.pdf, I have
managed to make it work with

<SRS>+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=0 +y_0=0 +axis=enu +ellps=WGS84
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs</SRS>

Perhaps the following can work too (untested) provided a 'ZANGI' file exists in
the PROJ.4 resource directory that contains the 'epsg' file, grids, and other
files.

<SRS>+init=ZANGI:ZANGI:HBKNO27</srs>

Even

>
> and various other permutations with and without the 'ZANGI:' prefix.
>
>  From the GDAL tutorial, I know the EPSG code syntax style is
> <SRS>EPSG:4326</SRS>
>
> The CRS I need is  ZANGI:ZANGI:HBKNO27 or 'South African CRS: HBK_NO_27'
>
> Can someone please guide me to the correct syntax.
>
> TIA,
> Zoltan

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Raster VRT SRS syntax

Zoltan Szecsei
On 2014/10/29 14:37, Even Rouault wrote:
Perhaps the following can work too (untested) provided a 'ZANGI' file exists in the PROJ.4 resource directory that contains the 'epsg' file, grids, and other files. <SRS>+init=ZANGI:ZANGI:HBKNO27</srs>

Hi Even,
When I let gdalbuildvrt simply add its own SRS from the image files, when I load that VRT into QGIS, it loads correctly without asking me to specify the CRS for that layer.

However

When I query that layer to see its CRS, it shows me a Generated CRS, even though the HBKNO27 is in the known list (see screenshot below).
I want the user to see the named CRS and not the generated (more confusing) CRS.

The first few lines of my VRT is as follows, yet I still get the pop-up asking me to set the CRS.
(I'm still trying different permutations, but I just wanted to give feedback)
Regards,
Zoltan
<VRTDataset rasterXSize="24455" rasterYSize="22659">
  <SRS>+init=ZANGI:ZANGI:HBKNO27</SRS>
  <GeoTransform>  9.5763066019661390e+04,  5.0000000000000000e-01,  0.0000000000000000e+00, -2.5336277500000000e+06,  0.0000000000000000e+00, -5.0000000000000000e-01</GeoTransform>
  <VRTRasterBand dataType="Byte" band="1">
    <NoDataValue>0.00000000000000E+00</NoDataValue>
    <ColorInterp>Red</ColorInterp>
    <SimpleSource>









-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
GIS and Photogrammetric Services

P.O. Box 7, Muizenberg 7950, South Africa.

Mobile: +27-83-6004028
Fax:    +27-86-6115323     www.geograph.co.za
===========================================

_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Raster VRT SRS syntax

Even Rouault-2
Le mercredi 29 octobre 2014 14:37:57, Zoltan Szecsei a écrit :
> On 2014/10/29 14:37, Even Rouault wrote:
> > Perhaps the following can work too (untested) provided a 'ZANGI' file
> > exists in the PROJ.4 resource directory that contains the 'epsg' file,
> > grids, and other files. <SRS>+init=ZANGI:ZANGI:HBKNO27</srs>
>
> Hi Even,
> When I let gdalbuildvrt simply add its own SRS from the image files,

So, what SRS does it put ? Why not just keeping it ? I'm confused.

> when I load that VRT into QGIS, it loads correctly without asking me to
> specify the CRS for that layer.
>
> However
>
> When I query that layer to see its CRS, it shows me a Generated CRS,
> even though the HBKNO27 is in the known list (see screenshot below).
> I want the user to see the named CRS and not the generated (more
> confusing) CRS.
>
> The first few lines of my VRT is as follows, yet I still get the pop-up
> asking me to set the CRS.

Likely the logic of QGIS that tries to match the SRS it gets from GDAL with
the ones it has in his DB doesn't manage to do a match.

> (I'm still trying different permutations, but I just wanted to give
> feedback)
> Regards,
> Zoltan
>
>     <VRTDataset rasterXSize="24455" rasterYSize="22659">
>        <SRS>+init=ZANGI:ZANGI:HBKNO27</SRS>
>        <GeoTransform>  9.5763066019661390e+04, 5.0000000000000000e-01,
>     0.0000000000000000e+00, -2.5336277500000000e+06,
>     0.0000000000000000e+00, -5.0000000000000000e-01</GeoTransform>
>        <VRTRasterBand dataType="Byte" band="1">
>     <NoDataValue>0.00000000000000E+00</NoDataValue>
>          <ColorInterp>Red</ColorInterp>
>          <SimpleSource>

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user