QGIS: list of coordinates to polygon [duplicate]












1















This question already has an answer here:




  • How to create a polygon using coordinates?

    1 answer




In the course of a monitoring exercise for small scale farmers, we captured the coordinates of fields using a GPS tracking in the SurveyCTO app. We used automatic capturing of the coordinates every 5 seconds to compensate for low GPS accuracy. Therefore, the coordinate list for every field is very long. With these coordinates, we would like to create polygons in QGIS to e.g. determine the size of fields. Unfortunately, the coordinates can only be extracted in one cell of an excel file. This looks like this:
enter image description here



Now my question is: Does anyone have a suggestion how we can import such a list into QGIS in a way that a polygon is created for each of these coordinate lists?










share|improve this question















marked as duplicate by Andre Silva, nmtoken, JGH, BERA, Richard Law Nov 23 '18 at 23:20


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















    1















    This question already has an answer here:




    • How to create a polygon using coordinates?

      1 answer




    In the course of a monitoring exercise for small scale farmers, we captured the coordinates of fields using a GPS tracking in the SurveyCTO app. We used automatic capturing of the coordinates every 5 seconds to compensate for low GPS accuracy. Therefore, the coordinate list for every field is very long. With these coordinates, we would like to create polygons in QGIS to e.g. determine the size of fields. Unfortunately, the coordinates can only be extracted in one cell of an excel file. This looks like this:
    enter image description here



    Now my question is: Does anyone have a suggestion how we can import such a list into QGIS in a way that a polygon is created for each of these coordinate lists?










    share|improve this question















    marked as duplicate by Andre Silva, nmtoken, JGH, BERA, Richard Law Nov 23 '18 at 23:20


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















      1












      1








      1








      This question already has an answer here:




      • How to create a polygon using coordinates?

        1 answer




      In the course of a monitoring exercise for small scale farmers, we captured the coordinates of fields using a GPS tracking in the SurveyCTO app. We used automatic capturing of the coordinates every 5 seconds to compensate for low GPS accuracy. Therefore, the coordinate list for every field is very long. With these coordinates, we would like to create polygons in QGIS to e.g. determine the size of fields. Unfortunately, the coordinates can only be extracted in one cell of an excel file. This looks like this:
      enter image description here



      Now my question is: Does anyone have a suggestion how we can import such a list into QGIS in a way that a polygon is created for each of these coordinate lists?










      share|improve this question
















      This question already has an answer here:




      • How to create a polygon using coordinates?

        1 answer




      In the course of a monitoring exercise for small scale farmers, we captured the coordinates of fields using a GPS tracking in the SurveyCTO app. We used automatic capturing of the coordinates every 5 seconds to compensate for low GPS accuracy. Therefore, the coordinate list for every field is very long. With these coordinates, we would like to create polygons in QGIS to e.g. determine the size of fields. Unfortunately, the coordinates can only be extracted in one cell of an excel file. This looks like this:
      enter image description here



      Now my question is: Does anyone have a suggestion how we can import such a list into QGIS in a way that a polygon is created for each of these coordinate lists?





      This question already has an answer here:




      • How to create a polygon using coordinates?

        1 answer








      qgis polygon coordinates






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 16:38









      Vale

      828519




      828519










      asked Nov 21 '18 at 14:35









      cbrcbr

      62




      62




      marked as duplicate by Andre Silva, nmtoken, JGH, BERA, Richard Law Nov 23 '18 at 23:20


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by Andre Silva, nmtoken, JGH, BERA, Richard Law Nov 23 '18 at 23:20


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          3 Answers
          3






          active

          oldest

          votes


















          3














          You are going to need to edit the coordinates to make them into Polygons.



          The easiest way is to open the file in excel (or open office) and adding a new string column where you concatenate "POLYGON((" to the start, then your coordinates replacing ';' with ',' and then add "))" on the end. So a formula something like:



          =CONCATENATE("POLYGON((",SUBSTITUTE(B2,";",","),"))") 


          At least in OpenOffice Calc.



          Then you can save it as a CSV file and import it into QGIS using the delimited text import (and selecting WKT for the geometry).



          You may run into issues with the polygons being invalid as the first and last points should be the same, in that case use:



          =CONCATENATE("LINESTRING(",SUBSTITUTE(B2,";",","),")")


          to import them as lines and convert them to polygons in QGIS.






          share|improve this answer





























            2














            You'll have to manipulate the data a bit to get it to conform to WKT format in Excel or a text editor but then you may add it as a delimited text layer and use the WKT option:



            https://en.wikipedia.org/wiki/Well-known_text



            id~coord
            1~POLYGON((-83.784 42.215, -83.264 42.256, -83.264 42.49, -83.784 42.215))
            2~POLYGON((-83.784 42.415, -83.344 42.236, -83.94 42.999, -83.784 42.415))
            3~POLYGON((-83.484 42.315, -83.244 42.346, -83.233 42.2, -83.484 42.315))


            enter image description here



            enter image description here






            share|improve this answer





























              0














              You can import it as a delimited text layer and choose WKT and polygon as the type of geometry.






              share|improve this answer





















              • Thanks for the quick reply. Unfortunately, this only adds the csv file as attribute table ("NoGeometry" displayed in the properties) and not as shape file although I selected the "coord" column as geometry field and "polygon" as geometry type when importing as WKT...
                – cbr
                Nov 21 '18 at 15:08


















              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3














              You are going to need to edit the coordinates to make them into Polygons.



              The easiest way is to open the file in excel (or open office) and adding a new string column where you concatenate "POLYGON((" to the start, then your coordinates replacing ';' with ',' and then add "))" on the end. So a formula something like:



              =CONCATENATE("POLYGON((",SUBSTITUTE(B2,";",","),"))") 


              At least in OpenOffice Calc.



              Then you can save it as a CSV file and import it into QGIS using the delimited text import (and selecting WKT for the geometry).



              You may run into issues with the polygons being invalid as the first and last points should be the same, in that case use:



              =CONCATENATE("LINESTRING(",SUBSTITUTE(B2,";",","),")")


              to import them as lines and convert them to polygons in QGIS.






              share|improve this answer


























                3














                You are going to need to edit the coordinates to make them into Polygons.



                The easiest way is to open the file in excel (or open office) and adding a new string column where you concatenate "POLYGON((" to the start, then your coordinates replacing ';' with ',' and then add "))" on the end. So a formula something like:



                =CONCATENATE("POLYGON((",SUBSTITUTE(B2,";",","),"))") 


                At least in OpenOffice Calc.



                Then you can save it as a CSV file and import it into QGIS using the delimited text import (and selecting WKT for the geometry).



                You may run into issues with the polygons being invalid as the first and last points should be the same, in that case use:



                =CONCATENATE("LINESTRING(",SUBSTITUTE(B2,";",","),")")


                to import them as lines and convert them to polygons in QGIS.






                share|improve this answer
























                  3












                  3








                  3






                  You are going to need to edit the coordinates to make them into Polygons.



                  The easiest way is to open the file in excel (or open office) and adding a new string column where you concatenate "POLYGON((" to the start, then your coordinates replacing ';' with ',' and then add "))" on the end. So a formula something like:



                  =CONCATENATE("POLYGON((",SUBSTITUTE(B2,";",","),"))") 


                  At least in OpenOffice Calc.



                  Then you can save it as a CSV file and import it into QGIS using the delimited text import (and selecting WKT for the geometry).



                  You may run into issues with the polygons being invalid as the first and last points should be the same, in that case use:



                  =CONCATENATE("LINESTRING(",SUBSTITUTE(B2,";",","),")")


                  to import them as lines and convert them to polygons in QGIS.






                  share|improve this answer












                  You are going to need to edit the coordinates to make them into Polygons.



                  The easiest way is to open the file in excel (or open office) and adding a new string column where you concatenate "POLYGON((" to the start, then your coordinates replacing ';' with ',' and then add "))" on the end. So a formula something like:



                  =CONCATENATE("POLYGON((",SUBSTITUTE(B2,";",","),"))") 


                  At least in OpenOffice Calc.



                  Then you can save it as a CSV file and import it into QGIS using the delimited text import (and selecting WKT for the geometry).



                  You may run into issues with the polygons being invalid as the first and last points should be the same, in that case use:



                  =CONCATENATE("LINESTRING(",SUBSTITUTE(B2,";",","),")")


                  to import them as lines and convert them to polygons in QGIS.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 21 '18 at 15:04









                  Ian TurtonIan Turton

                  47.6k546111




                  47.6k546111

























                      2














                      You'll have to manipulate the data a bit to get it to conform to WKT format in Excel or a text editor but then you may add it as a delimited text layer and use the WKT option:



                      https://en.wikipedia.org/wiki/Well-known_text



                      id~coord
                      1~POLYGON((-83.784 42.215, -83.264 42.256, -83.264 42.49, -83.784 42.215))
                      2~POLYGON((-83.784 42.415, -83.344 42.236, -83.94 42.999, -83.784 42.415))
                      3~POLYGON((-83.484 42.315, -83.244 42.346, -83.233 42.2, -83.484 42.315))


                      enter image description here



                      enter image description here






                      share|improve this answer


























                        2














                        You'll have to manipulate the data a bit to get it to conform to WKT format in Excel or a text editor but then you may add it as a delimited text layer and use the WKT option:



                        https://en.wikipedia.org/wiki/Well-known_text



                        id~coord
                        1~POLYGON((-83.784 42.215, -83.264 42.256, -83.264 42.49, -83.784 42.215))
                        2~POLYGON((-83.784 42.415, -83.344 42.236, -83.94 42.999, -83.784 42.415))
                        3~POLYGON((-83.484 42.315, -83.244 42.346, -83.233 42.2, -83.484 42.315))


                        enter image description here



                        enter image description here






                        share|improve this answer
























                          2












                          2








                          2






                          You'll have to manipulate the data a bit to get it to conform to WKT format in Excel or a text editor but then you may add it as a delimited text layer and use the WKT option:



                          https://en.wikipedia.org/wiki/Well-known_text



                          id~coord
                          1~POLYGON((-83.784 42.215, -83.264 42.256, -83.264 42.49, -83.784 42.215))
                          2~POLYGON((-83.784 42.415, -83.344 42.236, -83.94 42.999, -83.784 42.415))
                          3~POLYGON((-83.484 42.315, -83.244 42.346, -83.233 42.2, -83.484 42.315))


                          enter image description here



                          enter image description here






                          share|improve this answer












                          You'll have to manipulate the data a bit to get it to conform to WKT format in Excel or a text editor but then you may add it as a delimited text layer and use the WKT option:



                          https://en.wikipedia.org/wiki/Well-known_text



                          id~coord
                          1~POLYGON((-83.784 42.215, -83.264 42.256, -83.264 42.49, -83.784 42.215))
                          2~POLYGON((-83.784 42.415, -83.344 42.236, -83.94 42.999, -83.784 42.415))
                          3~POLYGON((-83.484 42.315, -83.244 42.346, -83.233 42.2, -83.484 42.315))


                          enter image description here



                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 21 '18 at 15:03









                          artwork21artwork21

                          30.7k554120




                          30.7k554120























                              0














                              You can import it as a delimited text layer and choose WKT and polygon as the type of geometry.






                              share|improve this answer





















                              • Thanks for the quick reply. Unfortunately, this only adds the csv file as attribute table ("NoGeometry" displayed in the properties) and not as shape file although I selected the "coord" column as geometry field and "polygon" as geometry type when importing as WKT...
                                – cbr
                                Nov 21 '18 at 15:08
















                              0














                              You can import it as a delimited text layer and choose WKT and polygon as the type of geometry.






                              share|improve this answer





















                              • Thanks for the quick reply. Unfortunately, this only adds the csv file as attribute table ("NoGeometry" displayed in the properties) and not as shape file although I selected the "coord" column as geometry field and "polygon" as geometry type when importing as WKT...
                                – cbr
                                Nov 21 '18 at 15:08














                              0












                              0








                              0






                              You can import it as a delimited text layer and choose WKT and polygon as the type of geometry.






                              share|improve this answer












                              You can import it as a delimited text layer and choose WKT and polygon as the type of geometry.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Nov 21 '18 at 14:51









                              Ignacio dtIgnacio dt

                              454




                              454












                              • Thanks for the quick reply. Unfortunately, this only adds the csv file as attribute table ("NoGeometry" displayed in the properties) and not as shape file although I selected the "coord" column as geometry field and "polygon" as geometry type when importing as WKT...
                                – cbr
                                Nov 21 '18 at 15:08


















                              • Thanks for the quick reply. Unfortunately, this only adds the csv file as attribute table ("NoGeometry" displayed in the properties) and not as shape file although I selected the "coord" column as geometry field and "polygon" as geometry type when importing as WKT...
                                – cbr
                                Nov 21 '18 at 15:08
















                              Thanks for the quick reply. Unfortunately, this only adds the csv file as attribute table ("NoGeometry" displayed in the properties) and not as shape file although I selected the "coord" column as geometry field and "polygon" as geometry type when importing as WKT...
                              – cbr
                              Nov 21 '18 at 15:08




                              Thanks for the quick reply. Unfortunately, this only adds the csv file as attribute table ("NoGeometry" displayed in the properties) and not as shape file although I selected the "coord" column as geometry field and "polygon" as geometry type when importing as WKT...
                              – cbr
                              Nov 21 '18 at 15:08



                              Popular posts from this blog

                              android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                              SQL update select statement

                              'app-layout' is not a known element: how to share Component with different Modules