I organize my data in different txt files and dat. files, mostly in each file there is one specific column of data. Now I want to import and combine 4 of them to create a table. Say I have one file for feature ID, one for timestamp, one for the WKT coordinates, and one for the feature's length. I want to create a table joining four of them like

feature_ID | timestamp | WKT | length

I also have to combine 5 files into one to complete the data for some column since the amount of data is too large (e.g. the first file contains 1-100000 data points, the 2nd one is from 100001 to 200000 etc.) Can I do this simply by importing these files to the table in the correct order?

  • 1
    As it stands, this is not really a GIS question. I'd recommend you make it GIS-relevant by using a "geom" column of GEOMETRY type in lieu of a "wkt" column of VARCHAR or CLOB. – Vince Jun 24 '15 at 20:59

There may be some pieces missing in your question; it may be helpful to be more precise.

Right now, if you have 4 files of data with one column in each, how do you know they match each other? What is the (primary) key to each of these? You could create a new table based on joins between existing tables. Also you have a column for coordinates as well as length -- is your feature type a point or a line?

Also, you may not be maximizing the power of PostGres without the extension of POSTGIS being enabled, which allows for spatial extensions and features -- could be more powerful to add a vertex based on points/coordinates for future analysis, for example. (Depends on what your'e going to do.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.