Opened 13 years ago

Closed 13 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 13 years ago.
Patch file to implement delimited text provider enhancement
gns_linestring.wkt (705 bytes ) - added by ccrook 13 years ago.
Example delimited text with wkt linestring elements
gns_poly.wkt (1.2 KB ) - added by ccrook 13 years ago.
Example delimited text with wkt polygon elements (POLYGON Z)
delimited_text_enhancement_fix.patch (622 bytes ) - added by ccrook 13 years ago.
Patch to fix wkt object selection bug

Download all attachments as: .zip

Change History (12)

comment:1 by lutra, 13 years ago

Type: enhancementpatch

comment:2 by ccrook, 13 years ago

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...

by ccrook, 13 years ago

Patch file to implement delimited text provider enhancement

comment:3 by ccrook, 13 years ago

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 by gsherman, 13 years ago

Owner: changed from nobody to gsherman

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

by ccrook, 13 years ago

Attachment: gns_linestring.wkt added

Example delimited text with wkt linestring elements

by ccrook, 13 years ago

Attachment: gns_poly.wkt added

Example delimited text with wkt polygon elements (POLYGON Z)

comment:5 by gsherman, 13 years ago

Resolution: fixed
Status: newclosed

Patch added in r14781

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

Thanks for the patch!

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

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 by ccrook, 13 years ago

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

by ccrook, 13 years ago

Patch to fix wkt object selection bug

comment:8 by gsherman, 13 years ago

Resolution: fixed
Status: reopenedclosed

Patch applied in r14824

Note: See TracTickets for help on using tickets.