I'm trying to build a heatmap of crime locations as part of a big data solution. My inputs are street names that I must map to geo coordinates. I know java and have downloaded several gis toolsets but have no experience with GIS at all.

I found an ArcGIS dataset that seems to have all street names for the state in question and have managed to export it to .csv format as follows

A45, Federal Forest Road 4694,0,0,0,0,48763,48763,, Federal Forest Road 4694,,,,,,,,,,,87180,87180,69,69,0,1,1,0,5491232,0,0.314,83013877,83013878,54912328301387783013878,505.59898942,8301387708041,14a
A32,.TRUE. Dr SW,4699,4629,4698,4628,49544,49544,,.TRUE.,Dr,SW,,,,,,,,,82960,82960,81,81,7,4,4,5,443704,0,0.093,41019877,41035029, 4437044101987741035029,148.7904383145,4101987705219,14a
A32,0 27,0,0,0,0,49835,49835,,0 27,,,,O 27,,,,,,,26960,26960,41,41,7,1,1,3,1357703,0,0.16,21012040,21013908,13577032101204021013908,257.495040047,2101204009438,14a
A32,0 32,0,0,0,0,49835,49835,,0 32,,,,O 32,,,,,,,26960,26960,41,41,7,1,1,3,1357510,0,0.246,21013561,21012894,13575102101356121012894,396.278062758,2101356135998,14a

The problem is this doesn't contain geo coordinates in any format I recognize (decimal lat and lng coordinates).

I do have QGIS downloaded and loaded that with the .shp file. Looks like that will do it but don't know how to proceed. Can someone please advise? All I need for now is a .csv file with street names and vectors with lat/lng end point coordinates.

  • You mention an "ArcGIS dataset". Which format are you referring to with that (.shp, .gdb etc) - Assuming .shp as it's in the question title. Have you got access to ArcGIS? Are you also/alternatively looking for a solution using QGIS?
    – Phil G
    Nov 12, 2016 at 15:25

2 Answers 2


Shapefiles only store attribute data in the dbf file, the other files associated with the shapefile contain the geometry data and metadata in binary and text formats. The shapefile binary format is open, but you are on a good track using QGIS to do the conversion rather than reinventing the wheel.


  • right-click on the shapefile in the layers panel and choose "Save As".
  • At the top, choose "CSV" from the "Format" drop-down.
  • Set the file name in the "Save As" text box.
  • Under CRS, choose EPSG:4326.
  • Under layer options at the bottom, make sure "Geometry" is set to "AS_XY" if you have point coordinates. For a line, you likely want "AS_WKT".

These steps, together with the 4326, should get you long-lat coordinates. The line coordinates will be in well-known text format (WKT), as described here.

There is a whole lot more that can be said about coordinate systems, ways to store data, etc., but this should be a starting point for you.

enter image description here

  • You solution seemed to work, but the generated csv is exactly the same as what I posted (except for simplified header line). Still don't see lat/lng geocoords there. Please advise.
    – Bradjcox
    Nov 12, 2016 at 16:36
  • 1
    @Bradjcox Sorry about that - the instructions were for points and you have lines. I have edited the answer for lines. Does that work any better? Nov 12, 2016 at 16:49
  • You should be able to parse the first and last long-lat coordinates of a line from the WKT as the first and last pairs of coordinates if that is what you need. The pairs are separated by spaces, while nodes on the line are separated by commas. Nov 12, 2016 at 16:55

You can calculate the x and y coordinates in Arcmap.

  1. Open ArcMap and add the shapefile in it.
  2. right click to the shapefile in TOC (Table of Content) and click Open Attribute Table
  3. Create two fields named x and y in double format
  4. Right click to x field and select Calculate Geometry ( calculate x coordinates). for y field calculate y coordinates.
  5. export data to csv

another and very simple solution is using Add xy Coordinates tool in Data management toolS of ArcGIS.

enter image description here

I assumed that your data type is point

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.