Opened 13 years ago

Closed 13 years ago

#3414 closed patch (fixed)

Add Coordinate Reference System to memory provider and delim text provider uri

Reported by: ccrook Owned by: gsherman
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Data Provider Version:
Keywords: Delimited text provider plugin, Memory provider plugin Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

This patch adds the ability to specify the coordinate reference system in the datasourceUri for memory and delimited text providers.

The main intention in this is to allow plugins to create these providers with the CRS predefined, so that regardless of the QGIS default providers settings the layer can be created without displaying a reference system dialogue to the user.

Other changes made as part of this: QgsCoordinateReferenceSystem string constructor has been generalised to allow strings such as "epsg:1234" as alternative to WKT QgsMemoryProvider datasourceUri can also specify spatial indexing and attributes QgsMemoryProvider and QgsDelimitedTextProviders uri's are encoded and decoded using QUrl rather than building as QString, to ensure reliable encoding of special characters QgsDelimitedTextProvider UI tidied up to correctly remember delimiter settings in QSettings

Attachments (1)

crs_in_providers.diff (23.9 KB ) - added by ccrook 13 years ago.

Download all attachments as: .zip

Change History (8)

in reply to:  description ; comment:1 by ccrook, 13 years ago

Hold fire on this ... Found a few issues so will put up a revised patch shortly :-(

in reply to:  1 ; comment:2 by ccrook, 13 years ago

Should be good to go now...

in reply to:  2 ; comment:3 by ccrook, 13 years ago

And forgot to update the SIP file for QgsCoordinateReferenceSystem. Now included too...

in reply to:  3 ; comment:4 by ccrook, 13 years ago

Fixed bug in patch - mSkipLines was not being initiallized, resulting in arbitrary behaviour when not defined in URI.

comment:5 by mhugent, 13 years ago

Owner: changed from nobody to gsherman

by ccrook, 13 years ago

Attachment: crs_in_providers.diff added

in reply to:  4 comment:6 by ccrook, 13 years ago

Found and fixed another bug in delimited text provider. Not related directly to this change, but expedient to include with this. Bug causes to QGIS to crash when reading empty wkt strings. Crash caused in nextFeature where it will attempt to check extents of a null geometry feature.

comment:7 by gsherman, 13 years ago

Resolution: fixed
Status: newclosed

Patch applied in r15074 - thanks!

Note: See TracTickets for help on using tickets.