Feature request #3259

Delimited text enhancement - use WKT column

Added by Chris Crook almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Low
Assignee:Gary Sherman
Category:Data Provider
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:13319

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.

delimited_text_enhancement.patch Magnifier - Patch file to implement delimited text provider enhancement (38.2 KB) Chris Crook, 2010-11-28 11:58 AM

gns_linestring.wkt - Example delimited text with wkt linestring elements (705 Bytes) Chris Crook, 2010-11-28 02:52 PM

gns_poly.wkt - Example delimited text with wkt polygon elements (POLYGON Z) (1.19 KB) Chris Crook, 2010-11-28 02:52 PM

delimited_text_enhancement_fix.patch Magnifier - Patch to fix wkt object selection bug (622 Bytes) Chris Crook, 2010-11-30 05:51 PM

History

#1 Updated by Chris Crook almost 10 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...

#2 Updated by Chris Crook almost 10 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.

#3 Updated by Gary Sherman almost 10 years ago

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

#4 Updated by Gary Sherman almost 10 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Patch added in

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

Thanks for the patch!

#5 Updated by Chris Crook almost 10 years ago

Replying to [comment:5 gsherman]:

Patch added in

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

Thanks for the patch!

Brilliant - thanks!

#6 Updated by Chris Crook almost 10 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

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

#7 Updated by Gary Sherman almost 10 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

Patch applied in 2517e13a (SVN r14825)

Also available in: Atom PDF