NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

I was hoping someone could please help.

I need to collect data for a project i have which looks at all the states a route goes through.

For example going from Jacksonville Florida to Lexington Kentucky the route would go through: Georgia Tennessee

I have over 100 routes and to look and write down each state a route goes through manually wouldn't be time effective so i wanted to see if there's a better way.

Is there a way i am able to get an output of this data from this site or another site base on the different origin and destination i have please?

I would be grateful for your help, suggestion and guidance.

Thank you.

asked 28 Jul '21, 04:51

Studnt123's gravatar image

Studnt123
26112
accept rate: 0%


If you are looking for web service that magically solves your problem - I'm afraid I don't know any.

What needs to be done is:

  • download the routes from a suitable routing engine, ideally in GeoJSON format (observe potential usage policies - but 100 routes, if queried with a little delay, shouldn't be an issue
  • prepare a data set with state boundaries - you can get them from OSM but it's probably easier to find a shape file on a random web site
  • have the computer detect which state polygons intersect with the route

One way to automate this is loading your routes and state boundaries into a PostGIS database. Then (let's assume you have loaded the routes with an ID into a "routes" table and the states with their names into a "states" table) the database can do the work for you with a simple query like

SELECT routes.id, states.name
FROM routes, states
WHERE ST_Intersects(routes.geom, states.geom)
ORDER BY routes.id;
permanent link

answered 28 Jul '21, 11:31

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thank you very much for your suggestion and advice!

I appreciate it!

(29 Jul '21, 04:37) Studnt123

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×535
×118
×26

question asked: 28 Jul '21, 04:51

question was seen: 927 times

last updated: 29 Jul '21, 07:00

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum