I am using QGIS 3.2 and I need to create an area to form a polygon shapefile using latitude and longitude, not using Python as I am just a beginner. How to do this?
-
Some of the CAD drawing tools should be what you're after: https://gis.stackexchange.com/questions/34204/creating-point-features-with-exact-coordinates-in-qgis – DPSSpatial_BoycottingGISSE Nov 20 '18 at 18:59
-
There are various text file formats, that can be imported into QGis. Is importing a text file an option? – Andreas Müller Nov 20 '18 at 20:58
-
If You have Your latitude and longitude and perhaps other data in a table, you could use a plain .csv file and load it as text-layer: https://docs.qgis.org/2.18/en/docs/user_manual/managing_data_source/opening_data.html#importing-a-delimited-text-file – geom Nov 20 '18 at 21:00
3 Answers
To give an example according to @geom recommendation. You must use the syntax to define polygons in WKT format, here an example in CSV:
Finally use add delimited text data source:
With the following result:
To edit the question to provide an example of where I need to create a polygon via distances.
I need to create a polygon to represent a survey area. The survey area required is 3.58km x 3.0km. I have used the v.buffer GRASS tool and the Buffer tool. Which I select a certain point to buffer Around to create the survey area. However I cant find any input within these tools where I can enter such distances. Do you know how to fix this?
- 807
- 1
- 8
- 22
- 446
- 3
- 12
-
perfect, thank you for providing an example. Would I follow the same formula if I wanted a polygon with specific dimensions rather than coordinates. e.g length in km. – Louis Tate Nov 21 '18 at 14:16
-
Could @Bodhi provide some example, some data to provide what you require? I think it's best to do the coordinate calculations from the dimensions in the spreadsheet and then perform their representation in QGIS. – SamTux Nov 21 '18 at 16:17
-
Use geojson. Just create a valid .geojson file with contents such as:
{"coordinates": [[[31, -5],
[32, -5],
[32, -4],
[31, -4],
[31, -5]]],
"type": "Polygon"}
You can use a tool like geojsonlint to make sure the syntax is correct. Once you have a valid geojson, save it to a file, e.g my_polygon.geojson. Then, just drag and drop it to your "Layers" in QGIS. That's it.
In my opinion, this is much easier than the methods mentioned in other answers.
-
1Note that geojson must follow the right-hand rule: https://mapster.me/right-hand-rule-geojson-fixer/ – filups21 Oct 24 '20 at 17:37
-
An addition to the answer above: I found it pretty complicated to write the WKT using the boundary coordinates myself. If you have Postgres with Postgis extension (and possibly pgadmin) available (use the Docker version!), just execute the following:
SELECT ST_AsEWKT(ST_MakeEnvelope (
12.147653576, 50.978794549, --lng-lat bounding
13.216635542, 51.684973715, --lng-lat box limits (Example)
4326))
You will get back the eWKT formatted string:
SRID=4326;POLYGON((12.147653576 50.978794549,12.147653576 51.684973715,13.216635542 51.684973715,13.216635542 50.978794549,12.147653576 50.978794549))
This can be loaded using the answer above in QGIS with import CSV or using the "QuickWKT" plugin
For anyone who still wants to do this manually, here's the format for 2-coordinate bbox-polygon:
POLYGON((
left-lng bottom-lat,
left-lng top-lat,
right-lng top-lat,
right-lng bottom-lat,
left-lng bottom-lat))
- 714
- 1
- 6
- 17



