Conversion to GDA2020

56 views
Skip to first unread message

ia...@jcis.net.au

unread,
Nov 1, 2021, 5:01:44 PM11/1/21
to QGIS Australia User Group
I have a long term project on an area in Sydney and over the course of time I have accumulated a number of georeferenced historical plans. These have been georeferences to GDA94 (you know what's coming next). The project has now moved to construction phase and everyone is working in GDA 2020 and we are getting survey data in 2020..

I think that I am ok because both of the three GIS programs I use reproject on the fly.

However thinking about the long term, it might be good to get the georeferenced plans into GDA 2020. Am I right in assuming that the way to go is to raster and reproject them into GDA 2020.

I would welcome some thoughts.

Cheers

Sheece

unread,
Nov 1, 2021, 10:20:58 PM11/1/21
to australian-qg...@googlegroups.com

I usually use a script in python to fix projections:

import rasterio
from rasterio.warp import calculate_default_transform, reproject, Resampling

input_dataset = "path/to/input/dataset.tiff"
output_dataset = "path/to/output/dataset.tiff"
output_projection = rasterio.crs.CRS.from_string('EPSG:3577')

def check_projection(input_dataset, output_dataset, output_projection):

   
    with rasterio.open(input_dataset) as src:
        if output_projection != src.crs:
            transform, width, height = calculate_default_transform(
                src.crs,
                output_projection,
                src.width,
                src.height,
                *src.bounds)
            kwargs = src.meta.copy()
            kwargs.update({'crs': output_projection, 'transform': transform, 'width': width, 'height': height})

            with rasterio.open(output_dataset, 'w', **kwargs) as dst:
                reproject(
                    source=rasterio.band(src, 1),
                    destination=rasterio.band(dst, 1),
                    src_transform=src.transform,
                    src_crs=src.crs,
                    dst_transform=transform,
                    dst_crs=output_projection,
                    resampling=Resampling.nearest)


    return output_dataset




--
You received this message because you are subscribed to the Google Groups "QGIS Australia User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to australian-qgis-use...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/australian-qgis-user-group/dff596fa-3cff-449e-bfef-aa8c98d15f87n%40googlegroups.com.


--
Regards,
Sheece
 

Luke Kirkwood

unread,
Nov 3, 2021, 5:28:12 AM11/3/21
to australian-qg...@googlegroups.com
Hi Sheece

Do you find this a better solution than the built in Warp Raster functions in QGIS?

Cheers

Luke

Reply all
Reply to author
Forward
0 new messages