19 Replies Latest reply on Jul 24, 2014 12:40 AM by JB1234510

    polyline to polygon

    mlenox
      I have a polyline feature class that I want to convert to a polygon.  what is best way to do this?


      Thanks,

      Matt
        • Re: polyline to polygon
          mark2208
          I have a polyline feature class that I want to convert to a polygon.  what is best way to do this?


          Thanks,

          Matt


          Depending on your license level, you could use the Feature To Polygon tool in ArcToolBox (requires an ArcInfo license).

          Other options would include ET Geowizards or XTools
          • Re: polyline to polygon
            mlenox
            When I used that tool, it created a new feature class, but it was empty.  Meaning there was no data in it.  Any suggestions?
            • Re: polyline to polygon
              mlenox
              What I am really trying to do is this.  I have a line shp that represents a boundary.  I would like that line to be totally connected.  So that in the attribute table there is just one feature.  This way I can have a completely "closed" polyline or polygon.  That way I can perform select by location functions inside of the shp.
              • Re: polyline to polygon
                Hardolph
                Matt,

                This should work regardless of licence level (though I infer from previous that you have ArcINFO).

                1. start by making sure the line segments are either snapped together or overlap and set snapping in the polyline layer. Make sure no polygons are present within the area.
                2. select all the segments with the edit tool; with Task:  Create New Feature  and Target: the FC the polylines are in and hit MERGE in the editor pull down.
                3. leaving merged line selected change "Target:" to a polygon layer and "Task:" to "Auto-complete Polygon"
                4. snap the SKETCH tool to the merged line and RIGHT-click and select "replace sketch" from the pull-down menu.
                5. all the vertices should show up; hit F2 or right-click again and hit Finish Sketch.

                That will generate a polygon even in ArcView (9.2, 9.3).  I've use it regularly.  I put up some previous posts describing this workaround for ArcView, but if you have ArcInfo the main thing is probably to get the line segments to close.

                http://forums.arcgis.com/threads/6288-Editing
                http://forums.arcgis.com/threads/5189-how-to-create-polygons-from-digitized-contour-polylines?p=15524#post15524


                Hardolph
                • Re: polyline to polygon
                  mlenox
                  I got the Feature to polygon tool to work.  The problem was that I  did not have an XY tolerance set.  Thanks so much for giving me those other steps.  I will probably use that method in the future.  Thanks!
                  • Re: polyline to polygon
                    RobertNS
                    Hardolph,
                    thank you from the ArcView 10 arena. It worked great
                    • Re: polyline to polygon
                      daniel.constable
                      Hi, I realize it has been quite some time since this has been posted (thank you for the detailed instructions by the way!).  I have been following them exactly, however every time I right-click to finish the auto-complete / replace sketch polygon ArcMap crashes.  I have tried it numerous times and it crashes again and again at this point.  I was wondering if either of you had run into this in while following these steps?
                      • Re: polyline to polygon
                        jheronymus
                        Wow, this's amazing! Here, it works fine with ArcMap 10, arcview/desktop license.
                        I'm very happy with this! Thank you very much!
                        • Re: polyline to polygon
                          neyson
                          your advice seems to work, however! my polylines are roads and my polygons are compartments, each with their own info, if i were to merge them, they will all have the same info and that will result in me getting fired.

                          so is there a way i can do it without merging it?
                          • Re: polyline to polygon
                            Hardolph
                            your advice seems to work, however! my polylines are roads and my polygons are compartments, each with their own info, if i were to merge them, they will all have the same info and that will result in me getting fired.

                            so is there a way i can do it without merging it?


                            Jason,

                            Never merge the original polylines.
                            I always copy all the polylines, which can be from numerous files and even different workspaces, to a new scratch file and merge them there.  Just use the edit tool right click "copy" function and "paste" to the active edit target layer.

                            Once I have the polygons I overlay the lines which commonly have different symbology types and attributes around the perimeter of each polygon.

                            Hardolph
                            • Re: polyline to polygon
                              Amytipple
                              Thank you Hardolph
                              • Re: polyline to polygon
                                dantdavi
                                How do you do this in arcmap 10?
                                I get lost on step 2, because there are different functions that are not there?
                                2. select all the segments with the edit tool; with Task: Create New Feature and Target: the FC the polylines are in and hit MERGE in the editor pull down.
                                3. leaving merged line selected change "Target:" to a polygon layer and "Task:" to "Auto-complete Polygon"
                                4. snap the SKETCH tool to the merged line and RIGHT-click and select "replace sketch" from the pull-down menu.
                                5. all the vertices should show up; hit F2 or right-click again and hit Finish Sketch.
                                • Re: polyline to polygon
                                  Hardolph
                                  How do you do this in arcmap 10?
                                  I get lost on step 2, because there are different functions that are not there?
                                  2. select all the segments with the edit tool; with Task: Create New Feature and Target: the FC the polylines are in and hit MERGE in the editor pull down.
                                  3. leaving merged line selected change "Target:" to a polygon layer and "Task:" to "Auto-complete Polygon"
                                  4. snap the SKETCH tool to the merged line and RIGHT-click and select "replace sketch" from the pull-down menu.
                                  5. all the vertices should show up; hit F2 or right-click again and hit Finish Sketch.


                                  Daniel,

                                  Although, I came up with the method and described steps in 9.3 it works in 10 and the steps are the same or very similar just the tools are under different headings.    Make sure you have enabled the editor toolbar:

                                  At Step 2 you just have to select the file you want to edit (and in this case to create new features in), and select the polylines by the "construction tools" or the editing tool (there is an edit tool in there) or any other method like attribute selection.  I believe the right click "copy" and "paste" function are also present to allow you to copy polylines from across several shapefiles or feature classes (even ones not in the editing space) to a new shapefile where you can merge them in preparation for using the Autocomplete function under "Construction Tools".  There are also "copy' and "paste" buttons.  In this case you don't want anything more that the spatial data to be copied so the "scratch" file does not need the same schema as the originals.   (you can also merge the polylines in the original file, but I do not recommend that.

                                  Hope that helps; I don't use 10 so guessing a bit at the names.   There is a new "construct polygons " tool in 10, but as in 9.3 it is disabled in the ArcView/ basic version of ArcMap despite its fairly essential editing function.

                                  Hardolph
                                  • Re: polyline to polygon
                                    rpaulsell
                                    What happens to the attributes from the line to polygon? Amazing what the online help tells.
                                    After describing the feature to polygon tool, there is a note that says the keep attributes button does not work and should not be used. ???? How to create polygons from line features keeping the attributes? I have some 200 files to create polys and thought
                                    I could use ArcToolbox to do such. Ugh. Anyone successful at creating polygons from lines and maintaining attributes?
                                    • Re: polyline to polygon
                                      scintilla
                                      Graphics and Shapes tools from Jeff Jenness  The best and still free. www.jennessent.com.  Build polygons from polyline.   jon
                                      • Re: polyline to polygon
                                        alla.skaskevych
                                        Hi everyone,

                                        I need to create polygons from contour lines as well, but I need to close polylines by the basin shapefile or create polygons by shape of the basin. After I created contour lines, I clipped it by the basin shapefile. I attached the picture. How can I convert it into polygons by the basin shapefile now? I DON'T have ArcInfo License, so I need alternatives. I'm trying to find out area of each polygon by basin as a result.

                                        Many thanks in advance!
                                        Alla
                                        • Re: polyline to polygon
                                          kd.fischer
                                          When I used that tool, it created a new feature class, but it was empty.  Meaning there was no data in it.  Any suggestions?


                                          I found the same problem, my solution was connecting/merging all the end segments of the poly line so that it was a closed loop. Not sure if this is the only solution to this kind of problem (the help side panel implies this shouldn't need to be done, but it's the process I did to get it to work)
                                          • Re: polyline to polygon
                                            kwgis

                                            I can't quite believe that the Feature to Polygon tool is unable to create polygons based on a common attribute - and this is a tool that is only available at the "Advanced" license level. Pathetic!

                                             

                                            I need a solution that I can automate in an arcpy script, so the manual clicky-clicky and the 3rd party tool options (e.g. ET Geowizards) aren't really suitable.

                                             

                                            Anybody have any suggestions?