Lookup table of a different type

I volunteer at a railroad museum. I would like an app that displays where we are on the track. We have mile markers each mile and I need finer resolution than that. Right now our locations are 6 rail joints past where the tree fell down thirty years ago. I think I can get the display figured out, but finding the location is not quite as trivial. I have ran this in excel and the concept works, i just need to get it into an app.

So I have a table of longitude, latitude, milepost, and an optional description (like crossing at Lings) There will be approximately 2000 data points.

I take current longitude minus all longitude individually.
The same is done with latitudes.
I then sum the difference of each line in the spreadsheet.
Then I find the minimum value in the column of summed differences.
This minimum corresponds to a mile post and description. This milepost will be on the display along with location description, time, and speed and heading.

Is this possible to build with this app?
I'll take the time to learn how if it possible to make a robust app using this method. If someone wants to help that would be great too. It will be on an android tablet.

Sorry, can you give some real data and how to operate with these datas, so we can understand what you want to achieve?

Upload the excel sheet or share it as a Google Sheet?

AI2 has facilities for loading tables and doing lookups in them.

It also has a Location Sensor whose idea of Latitude and Longitude differs from what you have in your sample table.

A Longitude stretching from 19 to 29 would be more appropriate to the Orient Express than to a railroad museum.

Search this board for 'geoJSON' for topics dealing with maps and map features.

For introductions to AI2 list facilities, see

I know my location is wrong. To get actual data is going to be a large task. Truthing the positions of the mile markers to GPS data needs to be done. One mile may be 5280 feet the next may be 5300, and the next 5100. Also Crossings, bridges, and other landmarks have published mile marker locations. SO if the app will work I will put int that effort to get it to all line up.

Do you want to know where the train is presently located on the track? Where is this railroad located?

There may be a simpler way Andy to do what you hope to do.

This would work for a train as well as a bus

The actual locations of the mile posts on the rail line can be spotted on the map if their gps coordinates are known.

A tutorial showing how to post lots of mile markers (or whatever)

We are in Indiana,

There are rules about using handheld devices while on duty. I can not have any thing fancy, or interactive. I want it to have a single display page giving the location in mile marker increments, Generic description, Time, heading Northbound or southbound and an green yellow or red light to indicate GPS accuracy.

There really is a method to the madness of getting location in this fashion. This will be used to track and monitor problems in the track. Right now communication between crews is trying to be improved. Imagine trying to describe to someone where a missing bolt is in the middle of a mile long stretch of rail. They actually do a good job with what they have. Mile markers down to one hundredth of a mile will get them within 53 feet. Rail lengths are 33 feet, so with repeatability of location to 15 feet, we should be able to our location down to a rail joint or two.
Our repair logs are all referenced back to a mile marker location, albeit not very precise.

Any Android solution must use a LocationSensor and interaction with the display, even your proposal. App Inventor has tools to provide the information you hope to display in the museum. The solutions require either an active android or a telephone contact from the train to broadcast the mile post (and consequently the train's location)

Where in Indiana? What is the name of the historical rail road. Who operates the train? Historical society, railroad museum etc.? Does it have a web page? for example train museum in indiana - Google Search

I guessed I missed a detail. The device will reside in the vehicle on the rails.
"For today's task we need to replace a tie at 56.73" They will then travel to 56.73 area find the defect and do the work. Many times the wrong tie was replaced. Normally so many ties need replaced that it was needed anyway, however we want to avoid the confusion.
I hope the app does not need to "call home" to work properly. We have areas where the cellular data reception is sketchy.
It is the white water valley railroad.


If the Android is in the track vehicle, App Inventor can plot the vehicle's location and coordinates on a Map like this one with an accuracy of from a precision of 10 to 2 meters.

It is possible an app can plot the gps location on a map even if you do not have cell phone or wifi connections but a connection makes it easier.

Let me know if you are interested. /The app can be used simply by the track crew and with a bit more coding pain can be shared with someone in the station.