7

I have a CSV file with population data according to specific locations (Points). My problem is that all locations are given in WKB format like that:

0101000020E6100000B953EFEEEEB253C0F15BD4CCCC4C05C0

How can I visualize my data with QGIS?

I don't know why there is no simple solution. Because to visualize WKB from a database is no problem.

Taras
  • 32,823
  • 4
  • 66
  • 137
Cris
  • 73
  • 1
  • 3

3 Answers3

8

An alternative is

  • open your CSV as a table without geometry attribute with menu "Layers" > "Add layer" > "Add Delimited Text Layer"
  • use a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... to transform the ewkb to a geometry using a query like SELECT GeomFromEWKB(the_geom) as geom, * FROM out where out is the table name alias of your attribute table and the_geom is the column name of EWKB text content

enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137
ThomasG77
  • 30,725
  • 1
  • 53
  • 93
3

As per your question following plugin QuickWKT will helpful for you.

This plugin opens a dialog where the user can paste(E)WKT and WKB code and see it on the map.

For more details please open this link (Translate this link to the English to understand)

hope it will help for you..

let us know if you have any questions

Sunil
  • 4,763
  • 7
  • 43
  • 87
  • Hey Sunil, thanks for your quick response. I already know QuickWKT but I don't know how to import several WKBs. Because I have several thousands of population points. Cheers, Chris – Cris Aug 23 '13 at 06:55
  • @Cris I am researching this my end + you need to write python script for that. I am not so expert in this but please go through following posts might be helpful for you http://gis.stackexchange.com/questions/58359/how-to-convert-geometry-to-wkt-using-arcpy , http://stackoverflow.com/questions/16731461/parsing-a-wkt-file – Sunil Aug 23 '13 at 07:07
2

I create CSV table with attribute "0101000020E6100000B953EFEEEEB253C0F15BD4CCCC4C05C0" (without header). Then import csv table in PostgreSQL/PostGIS database: first: create table with Point geometry field, WGS1984 SRID

CREATE TABLE layer (coord geometry(Point, 4326));

second: import in table data from scv table

COPY layer("coord") FROM 'D:\data.csv';

Then open QGIS, add PostGIS layer (table layer) and receive point feature with coordinates "-78.79583333;-2.6625". This table in PostgreSQL/PostGIS database you caan easy save/export in shapefile.

spatialhast
  • 3,631
  • 2
  • 27
  • 52