I have a CSV file that contains 4 coordinates on each line, 1 min latitude, 1 max latitude, 1 min longitude and 1 max longitude. These 4 points delimit a particular region(they are the bounds) I would like to draw for each row of my CSV, the region corresponding to the 4 points. How can I do that?

To be more clear this is what i want(done with OpenStreetMap): enter image description here

This is the csv: enter image description here

In particular NORTH,SOUTH,WEST and EAST are the 4 coordinates that define my bounds

  • Can give a screenshot of your csv file, or provide the first 4 rows.
    – MyGIS
    Sep 27 '18 at 3:09
  • OK i added it. Look at the post Sep 27 '18 at 3:15

How to convert east-west-north-south bounds to WKT formatted polygon

WKT format for polygons is like this:

POLYGON ((x y, x y, x y, x y, x y))

It's useful to note that the OGC standard definition requires a polygon to be topologically closed. It also states that if the exterior linear ring of a polygon is defined in a counter clockwise direction it will be seen from the "top". Any interior linear rings should be defined in opposite fashion compared to the exterior ring, in this case, clockwise. - Wikipedia

So you need to convert your boundary lat/long values to corner coordinates. It helps to draw out the polygon, like so:

enter image description here

Starting at the southwest corner and proceeding counterclockwise, the WKT coordinates look like this:

POLYGON ((W S, E S, E N, W N, W S))

In your spreadsheet, add a new column called WKT. Use the concatenate() function to combine the W-E-S-N values into WKT format.

=CONCATENATE("POLYGON ((", C2, " ", E2, ", ", D2, " ", E2, ", ", D2, " ", F2, ", ", C2, " ", F2, ", ", C2, " ", E2, "))")

enter image description here


I would import my data 4 times using the Add Delimiter 4 times:

enter image description here

West-South West-North East-North East-South

Merge the layers and then use the Points2One plugin (not available in Qgis3x)

enter image description here

enter image description here

enter image description here

Group your layers by Region. You might need to create intermediary ids to sort the order of you points in the merged file.

enter image description here

I hope this helps.


create well-know-text polygons in your spreadsheet-programm and import this wkt-polygons

  • 1
    could you please expand on this answer? How would you go about doing this? Please provide the OP with more information so they can adequately repeat the process.
    – Fezter
    Sep 27 '18 at 5:45

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.