Skip to main content
deleted 9 characters in body
Source Link
Kadir Şahbaz
  • 78.6k
  • 57
  • 260
  • 407

Sorry for not answering your question, but I would definitlydefinitely do this in db-environment instead. Especially if it is a lot of data, then that will probably be a lot faster.

If you for instance load the shapefile and the dbf into a PostGIS db your query could look something like this:

CREATE TABLE new_table AS SELECT a.the_geom, a.populated_field, b.populated_field2, b.populated_field3 FROM shape_table a LEFT JOIN dbf_table b ON a.populated_field=b.populated_field1;

CREATE TABLE new_table AS SELECT a.the_geom, a.populated_field, b.populated_field2, b.populated_field3 FROM shape_table a LEFT JOIN dbf_table b ON a.populated_field=b.populated_field1; 

If you put index on the joining fields, this should be very fast. You can of course update shape_table instead, but like to create a new table instead to not destroy the original data.

Regards

Nicklas

Sorry for not answering your question, but I would definitly do this in db-environment instead. Especially if it is a lot of data, then that will probably be a lot faster.

If you for instance load the shapefile and the dbf into a PostGIS db your query could look something like this:

CREATE TABLE new_table AS SELECT a.the_geom, a.populated_field, b.populated_field2, b.populated_field3 FROM shape_table a LEFT JOIN dbf_table b ON a.populated_field=b.populated_field1;

If you put index on the joining fields, this should be very fast. You can of course update shape_table instead, but like to create a new table instead to not destroy the original data.

Regards

Nicklas

Sorry for not answering your question, but I would definitely do this in db-environment instead. Especially if it is a lot of data, then that will probably be a lot faster.

If you for instance load the shapefile and the dbf into a PostGIS db your query could look something like this:

CREATE TABLE new_table AS SELECT a.the_geom, a.populated_field, b.populated_field2, b.populated_field3 FROM shape_table a LEFT JOIN dbf_table b ON a.populated_field=b.populated_field1; 

If you put index on the joining fields, this should be very fast. You can of course update shape_table instead, but like to create a new table instead to not destroy the original data.

Source Link
Nicklas Avén
  • 13.3k
  • 1
  • 41
  • 48

Sorry for not answering your question, but I would definitly do this in db-environment instead. Especially if it is a lot of data, then that will probably be a lot faster.

If you for instance load the shapefile and the dbf into a PostGIS db your query could look something like this:

CREATE TABLE new_table AS SELECT a.the_geom, a.populated_field, b.populated_field2, b.populated_field3 FROM shape_table a LEFT JOIN dbf_table b ON a.populated_field=b.populated_field1;

If you put index on the joining fields, this should be very fast. You can of course update shape_table instead, but like to create a new table instead to not destroy the original data.

Regards

Nicklas