Home / Expert Answers / Computer Science / java-project-1-gpx-to-csv-using-java-a-gpx-file-is-a-gps-data-file-saved-in-the-gps-exchange-for-pa685

(Solved): JAVA Project 1: GPX to CSV using Java A GPX file is a GPS data file saved in the GPS Exchange for ...



JAVA

Project 1: GPX to CSV using Java
A GPX file is a GPS data file saved in the GPS Exchange format, which is an open standard usDont forget to add the header of Time, Latitude, Longitude at the top of your c.sv.
- Note that the data file used in Zybo

Project 1: GPX to CSV using Java A GPX file is a GPS data file saved in the GPS Exchange format, which is an open standard used by many GPS programs. It contains latitude and longitude location data that may include waypoints, routes, and tracks. A CSV file is a comma-separated values file commonly used by spreadsheet programs such as Microsoft Excel. It contains plain text data sets separated by commas, with each new line in the CSV file representing a new database row and each database row consisting of one or more fields separated by a comma. For this project, you are given the gpx file triplog.gpx which was gathered recently over a 3 day trip. Your objective is to read the latitude and longitude data stored within to create a new csv file called triplog.csv so that we can add to the data and have easier access to it in future projects. You are given oriver.java, and triplog.gpx (do not edit these files). You are required to create and write the class convert. java to complete the project. The Data Inside triplog.gpx you will find entries that look like this: Each pair of lat (latitude) and lon (longitude) is a point that was captured during the trip. The points were captured at 5 minute intervals, which is another column we will be adding during the conversion to a csv. We want to grab the data and add a time column starting at 0 (minutes) incrementing by 5 for each further point. The resulting csv should be of the form "Time,Latitude,Longitude" which you can see here in excel: As well as what it looks like in a txt format: Time, Latitude, Longitude Don't forget to add the header of "Time, Latitude, Longitude" at the top of your c.sv. - Note that the data file used in Zybooks is different from the one in GitHub, so your solution should be a general solution. Data Anomalies There are some inconsistencies in the gpx data you will need to work around. These include extra newlines between lines, extra whitespace on some lines (spaces and tabs), and '?' characters in some of the latitude and longitude values. You should account for these errors while reading the gpx file, and resolve them before writing to the csv file. For example, you may see a line that looks like this: ?377" 1 on=" Notice the latitude has extra spaces after the 34 and a '?' in the middle of the decimal. These should be removed in your csv as such:


We have an Answer from Expert

View Expert Answer

Expert Answer


Here's a possible implementation of the Convert class with the convertFile method to convert a GPX file to a CSV file:import java.io.BufferedReader;im
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe