2

I have a .CSV file with information about polygons (which are squares), represented by the coordinates of the four points that shape a square (4 pairs of long/lat coordinates)

All are in one column, with this format: "[[43.65709678906501,-8.143885243142325],[43.67871793261613,-8.022902253073957],[43.76597461330047,-8.050819877487672],[43.74431550733586,-8.171971006002625]]".

Notice that i have all that coordinates on the same column.

Do you know any way to convert that information directly to polygons in QGIS?

2
  • Do you only have the geometry string in between brackets in your .csv or do you have the point coordinates to generate a geometry? With "delimited text layer" you can import Polygons from .csv files. For that you need to select WKT Geometry definition and have your geometry as a WKT formatted string, which in your case is: 'POLYGON((43.6570967890650 -8.143885243142325,43.67871793261613 -8.022902253073957,43.76597461330047 -8.050819877487672,43.74431550733586 -8.171971006002625))'. "43,..." being longitude. See stackoverflow.com/questions/45011384/…
    – Kasper
    Commented Dec 14, 2022 at 15:23
  • Ideally, you would want your current format to be reworked or processed to match the WKT format
    – Kasper
    Commented Dec 14, 2022 at 15:26

1 Answer 1

1

Problem was solved. I formatted the data to WKT, and then I added to QGIS as CSV.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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