[QGIS-trac] Re: [Quantum GIS] #2987: Auto GCP detection library
Quantum GIS
qgis at qgis.org
Mon Oct 18 05:21:42 EDT 2010
#2987: Auto GCP detection library
--------------------------------+-------------------------------------------
Reporter: jamesm6162 | Owner: timlinux
Type: patch | Status: assigned
Priority: minor: annoyance | Milestone: Version 1.6.0
Component: C++ Plugins | Version: Trunk
Keywords: | Platform_version:
Platform: Debian | Must_fix: No
Status_info: 0 |
--------------------------------+-------------------------------------------
Comment(by timlinux):
Replying to [comment:12 jamesm6162]:
> Hi Tim
>
> Thanks for the feedback. We are working on getting all the crashes fixed
adn we'll get to all your recommended features as soon as possible.
>
> One question from my side though.
> What would be the best resource to start looking at if we want to
implement the Georeferencing with GDAL?
>
> Thanks
>
> James
>
>
Using gdal_translate either via the python api (I've never tried so you
will need to check their docs) or by doing a shell call from python. Below
is an example from some code of mine:
{{{
myString = "gdal_translate -a_srs 'EPSG:4326' -gcp 0 0 %s %s -gcp %s 0 %s
%s -gcp %s %s %s %s -gcp 0 %s %s %s -of GTIFF -co COMPRESS=DEFLATE -co
TILED=YES %s %s" % ( \
myTL[0], myTL[1], \
myImageXDim, myTR[0],myTR[1], \
myImageXDim, myImageYDim, myBR[0],myBR[1], \
myImageYDim, myBL[0],myBL[1], \
myPath, \
myOutputPath )
print myString
os.system( myString )
}}}
You can add as many -gcp parameters as you like. My example above simply
georeferences the corners hence the hard coded 0's. You can verify your
GCPs in the output file by calling gdaoinfo on it.
Hope that helps!
Regards
Tim
--
Ticket URL: <http://trac.osgeo.org/qgis/ticket/2987#comment:15>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list