How to open the TSV roads data as spatial layer in any Map application?

Haitham Abdelmonim 1 Reputation point
2023-01-09T12:50:42.46+00:00

I downloaded MS Roads data from the link: https://github.com/microsoft/RoadDetections
as TSV file
I struggled to open the data in Bing Maps, Google Map, ArcMap, ArcGIS Pro
Please let me know how to open the TSV file as spatial layer.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
587 questions
{count} votes

3 answers

Sort by: Most helpful
  1. rbrundritt 15,231 Reputation points Microsoft Employee
    2023-01-17T16:38:32.55+00:00

    As noted in other responses, you will need to parse the TSV file into something the map can understand. Azure Maps, Bing Maps, and Google Maps all support loading GeoJSON data, although Azure Maps does this natively while the others parse GeoJSON into another format for the map. Azure Maps also has the best performance out of these three maps. That said, these files are massive. The smallest file, when uncompressed in over 200MB. No web browser-based map control can load this much data directly and have any sort of decent performance. Alternate methods of loading the data would be needed, such as converting the data to vector tiles ahead of time and loading those.

    Looking at the TSV file it appears to have two columns; the first is some sort of identifier, and the second is a GeoJSON geometry object. I'm not sure why they didn't make the identifier a property of the geometry and make this a GeoJSONL file format like this have for other open data.

    In any case, given the size of the files, you will need to convert these ahead of time into a usable format and then either load a portion of the data into a web-based map control, covert the data into a more efficient format, or try a desktop app like QGIS.

    1 person found this answer helpful.

  2. LeelaRajeshSayana-MSFT 13,456 Reputation points
    2023-01-17T20:14:27.9166667+00:00

    Hi @Haitham Abdelmonim Greetings! Welcome to Microsoft Q&A forum! Apologies for the delay in getting back to you.

    The Read spatial data section of the Azure Maps indicate that when reading a compressed file, either as a zip or a KMZ, it will be unzipped and scanned for the first valid file. For example, doc.kml, or a file with other valid extension, such as: .kml, .xml, geojson, .json, .csv, .tsv, or .txt. Then, images referenced in KML and GeoRSS files are preloaded to ensure they're accessible. Have you tried to load it as a compressed file instead of TSV format?

    I have also noticed an issue being reported on the TSV file format The work around suggested in the issue is to convert the TSV file format to GeoJSON. There are different approaches recommended in the GitHub thread. One of the solutions offered on the thread provides Script to convert the TSV file to GeoJSON

    Please go through the steps and let us know if the information shared above is useful. Kindly update us if you still face any issues or need further assistance on this.

    0 comments No comments

  3. treetexan 0 Reputation points
    2023-04-14T18:29:23.62+00:00

    None of these answers seemed particularly useful, so if you would like to know how to convert it to geojson in R, check this out: https://stackoverflow.com/questions/74931194/how-to-extract-geojson-data-stored-as-a-column-within-a-tsv-file-any-language The main thing in any language is to strip the first column programatically, while avoiding string quotation marks when writing out, and making sure a newline separator is enforced for each row (that's JSON's separator). If you import the tsv in a data.frame friendly language like R or Python, you can export the first 10 rows as a txt file and play with the formatting until you get it right. the code above works great.