2

I have a csv file which I converted to points. It contains features that are a mix of lines and polygons. Format is below. Now I would like to use the point to line processing tool to generate the lines and polygons. Not sure if my csv format needs to be changed but it does not separate each feature.

enter image description here

  • do you know python? if so, that might be the best option to solve this problem – ziggy Apr 17 '17 at 13:19
2

First, you will need to separate your data into two files, one each for lines and polygons.

After you have the data separated, I would suggest concatenating the coordinates into Well Known Text in an excel sheet. I use the formula and layout pictured below. enter image description here

As you can see the format for WKT is "Geometry Type"(Long1 Lat1, Long2 Lat2,...,Long[n] Lat[n]) with [n] being the number of nodes along the line. The geometry types you would be after are "linestring" and "Polygon". With the formula formatted properly in your sheet you should be able to automatically generate a WKT string for each record with a drop down copy operation. The final product of the process would be a column containing text strings similar to the following example. Linestring(-82.7642 27.76782,-82.7642 27.76782) The resulting line would show up on the west coast of Florida.

  • Awesome. Let me give this a go. – Jotter Apr 15 '17 at 13:39
  • Not working for me. My format is: lat1 lon1 lat 2 lon2, etc. Do the lat/lon pairs need to be in the same column? So for a line with 4 points, you would have four columns, vs 8 columns? – Jotter Apr 16 '17 at 20:11
  • The whole string needs to be in a single column no matter how many nodes are in the line. The purpose of the screen shot was only to illustrate how you can concatenate a series of points into the wkt format into the single column from a data set that contains multiple columns. It also looks like you are switching the order of the coordinates. The longitude needs to come first. – Kingfisher Apr 16 '17 at 23:03

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.