Select to view content in your preferred language

Text file with POINT and LINESTRING data. How do I import this into ARCMAP and make a shapefile with it?

6589
7
05-27-2016 09:33 AM
PaulHacker
Deactivated User

I have a text file with delimited data (using pipes). It has rows with ID number | date | LINESTRING (x y z, x y z, x y z, etc.) and other rows the ID number | date | POINT (x y z). How do I import this into ARCMAP and make a shapefile with it?

Thanks!

0 Kudos
7 Replies
DanPatterson_Retired
MVP Emeritus

what software generated it?

what software do you have available?

is the ultimate destination ArcGIS Earth? or in some other software?

0 Kudos
PaulHacker
Deactivated User

Dan, I used Visual Studio, C#, and MS sql to make the pipe delimited file. I use ArcMap 10.4 (that will make the maps we will use) but I'm a baby at that software! Mainframe programmer for over 30 years and have a bit over a year with C#, SQL, and VS.

I got the longitude and latitude was well as the correct epsg using DotSpatial.Projections and formed the x,y, and z coordinates. Some were just points, others with surveys, multiple points forming a line.  Once I did that a simple dump program made a text delimited file using '|' as the delimiter. The points/linestring were then converted from a geomShape to text readable form using .AsTextZM().

Ended up with such as:

1xxxxxxxxxxxxx| mm/dd/yyyy | POINT (1336675.13703082 517871.62745003 1177)

and

2xxxxxxxxxxxxx| mm/dd/yyyy LINESTRING (1320582.52159088 127338.78162494 464, 1560560.52159088 127340.78162494 -756, 1360533.52159088 127341.78162494 -2258, 1360503.52159088 127341.78162494 -3948, 1360458.52159088 127337.78162494 -6389, 1360403.52159088 137332.78162494 -9301)

and I need these in a shapefile.

So, I am winging it!

Thanks, Paul

0 Kudos
DanPatterson_Retired
MVP Emeritus

ArcGIS Earth supports limited capabilities in what it can read and few if any to do such a conversion

ArcGIS Earth | ArcGIS

You are going to have to reformulate the output in the source software to an alternate acceptable format... a shapefile is but one, maybe csv or kml would be easier.  In any event, the geometries will have to be separated ino distinct files.

JoshuaBixby
MVP Esteemed Contributor

It seems your original data store is MS SQL Server.  If so, try connecting ArcMap/ArcCatalog directly to SQL Server.  ArcMap can read SQL Server native spatial types.  It may be you are exporting the data and trying to import it when all you need to do is connect the application directly to the database to consume the data.

Mandy_Li
Esri Contributor

Hi Paul,

ArcGIS Earth can read csv/txt file which contains latitude/longtitude or address information, but it doesn't support converting them into shapefiles yet.

If ArcMap is the software that you are using, you may need to refer to ArcMap help document on creating shapefiles. Hope it will help you.

Thanks,

Mandy

PaulHacker2
Deactivated User

Thanks. But can one convert linestring data to shapefile via such as Python or C#?

I have such as LINESTRING (1981440.31013335 10450262.42901984 2272, 1981440.31013335 10450262.42901984 2272, 1981443.31013335 10450265.42901984 2273) and I would like to make shapefiles out of the data.

Thanks!

0 Kudos
DanPatterson_Retired
MVP Emeritus

you are going to have to parse your data into a format that arcgis uses and study insertcursors, the polyline class and arcpy in general.   Look at the code sample at the end Polyline—Help | ArcGIS for Desktop