Opened 11 years ago

Closed 11 years ago

#3259 closed patch (fixed)

Delimited text enhancement - use WKT column

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

Description

This is a proposal for an enhancement to the delimited text plugin to allow it to use a geometry column formatted as well known text, as an alternative to using x and y columns to define point features.

The attached patch implements this option.

The main limitation in this implementation is that all the geometries must be of the same well known text type.

Attachments (4)

delimited_text_enhancement.patch (38.2 KB) - added by ccrook 11 years ago.
Patch file to implement delimited text provider enhancement
gns_linestring.wkt (705 bytes) - added by ccrook 11 years ago.
Example delimited text with wkt linestring elements
gns_poly.wkt (1.2 KB) - added by ccrook 11 years ago.
Example delimited text with wkt polygon elements (POLYGON Z)
delimited_text_enhancement_fix.patch (622 bytes) - added by ccrook 11 years ago.
Patch to fix wkt object selection bug

Download all attachments as: .zip

Change History (12)

comment:1 Changed 11 years ago by lutra

Type: enhancementpatch

comment:2 Changed 11 years ago by ccrook

I've found that this doesn't work when the WKT contains Z, M, or ZM types (eg LINESTRING Z(...). I'll provide a revised patch which handles this soon...

Changed 11 years ago by ccrook

Patch file to implement delimited text provider enhancement

comment:3 Changed 11 years ago by ccrook

New version of patch added .. this version handles .. Z, .. M, and .. ZM type geometries by removing the Z, M, ZM, and removing extra coordinates from the WKT string before passing it to the QgsGeometry? factory function.

comment:4 Changed 11 years ago by gsherman

Owner: changed from nobody to gsherman

Can you provide a couple of small test files with WKT coordinates?

Changed 11 years ago by ccrook

Attachment: gns_linestring.wkt added

Example delimited text with wkt linestring elements

Changed 11 years ago by ccrook

Attachment: gns_poly.wkt added

Example delimited text with wkt polygon elements (POLYGON Z)

comment:5 Changed 11 years ago by gsherman

Resolution: fixed
Status: newclosed

Patch added in r14781

Help file and dialog modified to reflect addition of WKT capability.

Thanks for the patch!

comment:6 in reply to:  5 Changed 11 years ago by ccrook

Replying to gsherman:

Patch added in r14781

Help file and dialog modified to reflect addition of WKT capability.

Thanks for the patch!

Brilliant - thanks!

comment:7 Changed 11 years ago by ccrook

Resolution: fixed
Status: closedreopened

Discovered I introduced a bug in the selection of non-point objects (ie wkt objects). Currently selection testing is based on bound box of object only. Needs to include testing actual geometry of object.

Attached patch fixes this

Changed 11 years ago by ccrook

Patch to fix wkt object selection bug

comment:8 Changed 11 years ago by gsherman

Resolution: fixed
Status: reopenedclosed

Patch applied in r14824

Note: See TracTickets for help on using tickets.