Converting mileposts to latitude and longitude

Aren Cambre's picture

In the past few months, I've been learning graphical information systems (GIS). This is a challenge; I've never done GIS before.

The latest learning task is figuring out how to convert highway mileposts to latitude and longitude. Why do I need this? Highways generally don't have street addresses. For example, almost all TxDPS tickets reference a milepost on a highway, such as milepost 283 on I-20.

That introduces another problem: there's no existing dataset that maps mile markers to latitude and longitude. So I have to create it myself.

Back to GIS, I have a GIS ShapeFile file from TxDOT. It has precise coordinates for all highways, and it also has the highway's length.

I've converted this ShapeFile to a PostGIS-enabled PostGres database. Now I get to use PostGIS's linear referencing functions to trace these routes and discover their mile markers.

But even that creates interesting challenges. In the ShapeFile, each highway's distance is measured in degrees. As in degrees of latitude. (Not longitude--each degree of longitude is a different distance apart depending on distance from the equator.)

So I have to convert degrees of latitude to miles. Not too hard--take the earth's circumference in miles and divide by 360.

NASA says the equatorial circumference is 24,901.55 (source). (Can I use that as a serious source when I write my praxis? Ha!) That divided by 360, the number of degrees of latitude, means a degree of latitude is 69.17 miles.

Yay, now I can find mile markers!

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <small> <sup> <sub> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <img> <br> <br /> <p> <div> <span> <b> <i> <table> <td> <tr> <tbody>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <pre>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <ps1>, <python>, <r>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.