...
The XML file we are using connects to the NIWA NIC Specify database, which is a MySQL database under the hood, with columns of latitudes and longitudes in decimal degrees for specimen locations. The password Access details can be provided on request, if you require accessthem. This is not a public database, but NIWA staff can contact Sadie Mills if you need accessto discuss such access. Note that you can access public records from this database using the IPT plugin for QGIS to access GBIF data, as NIWA submits publicly available species records to OBIS and GBIF global databases. The file is shown here both as a specific example in this use case, but also as a more general example of how QGIS can be used like this to directly access and interact with already existing non-spatial databases, providing a GIS/map based access to data where perhaps this was never considered previously.
<OGRVRTDataSource>
<OGRVRTLayer name="collectionObjects">
<SrcDataSource>MYSQL:niwainverttestXXXXXXXXXX,user=specreaderXXXXXXXXX,password=XXXXXXXXXX,host=specify6.niwa.co.nzXXXXXXXXXXX,port=3306</SrcDataSource>
<SrcSQL>select catalognumber, latitude1 AS y, case when longitude1 > 180 then -360+longitude1 else longitude1 end AS x,localityName as StationID, startDate, latitude1, longitude1, latitude2, longitude2,
maxElevation, minElevation, taxon.fullname as TaxonName, prefT.fullname as PreferredName from collectionobject INNER JOIN collectingevent ON collectionobject.collectingeventid = collectingevent.collectingeventid
INNER JOIN locality on collectingevent.localityid = locality.localityid LEFT JOIN determination on collectionobject.collectionobjectid = determination.collectionobjectid
LEFT JOIN taxon on determination.taxonid = taxon.taxonid
LEFT JOIN taxon prefT on determination.preferredtaxonid = prefT.taxonid
WHERE Latitude1 is not null and longitude1 is not null and determination.iscurrent = 1 and catalognumber is not null
ORDER BY Catalognumber</SrcSQL>
<GeometryType>wkbPoint</GeometryType>
<GeometryField encoding="PointFromColumns" x="x" y="y"/>
<LayerSRS>EPSG:4326</LayerSRS>
</OGRVRTLayer>
</OGRVRTDataSource>
...