QGIS-2.8-PyQGISDeveloperCookbook-en(12)
时间:2025-03-11
时间:2025-03-11
为开发人员准备的文档,涵盖QGIS的多种功能实现和代码。
Note:fromQGISversion1.7theproviderstringisstructuredasaURL,sothepathmustbepre xedwith
le://.AlsoitallowsWKT(wellknowntext)formattedgeometriesasanalternativeto“x”and“y” elds,
andallowsthe
coordinatereferencesystemtobespeci ed.Forexample
"shape") GPX les—the“gpx”dataproviderreadstracks,routesandwaypointsfromgpx les.Toopena le,the
type(track/route/waypoint)needstobespeci edaspartoftheurl
SpatiaLitedatabase—supportedfromQGISv1.1.SimilarlytoPostGISdatabases,QgsDataSourceURI
canbeusedforgenerationofdatasourceidenti er
MySQLWKB-basedgeometries,throughOGR—datasourceistheconnectionstringtothetable
WFSconnection:.theconnectionisde nedwithaURIandusingtheWFSprovider
Theuricanbecreatedusingthestandardurllib
library.
3.2RasterLayers
Foraccessingraster les,GDALlibraryisused.Itsupportsawiderangeof leformats.Incaseyouhavetroubles
withopeningsome les,checkwhetheryourGDALhassupportfortheparticularformat(notallformatsare
availablebydefault).Toloadarasterfroma le,specifyits
lenameandbasename