Creating Shapes.txt without manually drawing

1,369 views
Skip to first unread message

ryland...@gmail.com

unread,
Sep 2, 2014, 3:13:50 PM9/2/14
to transit-d...@googlegroups.com
Good Afternoon!

I'm working for a rather large interline company and wish to move our GTFS Data onto Google Transit.  We have everything under control except we have no Shapes.txt.  I've spent the time manually drawing lines in MyMaps then exporting a txt from http://bmander.com/makeshapes/ for two of the routes, but since many of our trips are over 400 miles I was hoping there's another method.  

I've signed up for a 2 month trial of ArcGIS and was hoping there was a way of exploiting that, otherwise, is there a method of turning google's directions into a polyline?

Thanks in advance,
Steve

redlandscommu...@gmail.com

unread,
Sep 2, 2014, 10:39:45 PM9/2/14
to transit-d...@googlegroups.com, ryland...@gmail.com
Hi Steve.  There is a prototype tool I've created that allows you to create a shapes.txt file using ArcGIS.  You can download it here: http://www.arcgis.com/home/item.html?id=ce51601e18ae4367814a8a53a1659b33

To use the tool, you feed it your existing GTFS dataset and a network dataset (a street network covering the area served by your transit system), and it generates the likely on-street routes connecting adjacent stops in the network.  It basically just gives you a starting point to work from.  You are then able to edit these route shapes to your satisfaction, and then you can export the feature class to a shapes.txt file when you're ready, using the second part of the tool.  You are likely to have to do quite a bit of editing.  A user's guide is included with the tool download.

If you end up using the tool (or trying to use it), I would be interested in your feedback, as this will help me improve the tool in the future.

Good luck, and I hope this helps.

Melinda Morang
Product Engineer
Esri, Network Analyst Team
mmo...@esri.com
909-793-2853 x3315

Kelvin Nicholson

unread,
Sep 3, 2014, 12:18:02 AM9/3/14
to transit-d...@googlegroups.com
Hi Steve,

I don't have a definitive solution for you, but I'll help start the brainstorm.

One way to perhaps expedite the translation is to use Google Maps Engine Lite (w/Driving Directions) -> KML -> shapes.txt

I have just tested it out with a sample trip from Sydney to Perth, and the process only takes a few minutes.

In Google Maps Engine Lite:

Aadd directions from one point to another
Click the folder and say "Export to KML", save the route(s)

In a text editor and spreadsheet program:

Open the KML and remove everything around coordinates
Convert spaces to newlines, save as a txt file
Open with Excel, use comma as a delimiter
Insert new column A with the shapes name
Insert a shape_pt_sequence column and have it increase as per the spec

Note: I'm not certain if Google's Directions Terms of Service allows you to do this, but since it will mostly end up on Google Maps in the end, perhaps there isn't a problem.

Automating this would be relatively straightforward, i.e. use Google Maps Engine Lite to do all the driving directions, one per layer with the shape_id as layername, then use a small script to convert the exported KML to a shapes.txt file. I could probably help knock something up if there was enough demand, and if the above process actually works :)

Regards,

Kelvin


--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to transit-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Barbeau

unread,
Sep 3, 2014, 9:02:33 AM9/3/14
to transit-d...@googlegroups.com
Steve,
Landon Reed put together a tool to export shapes.txt files from Google Maps Directions API:
https://github.com/atlregional/bus-router

Sean
To unsubscribe from this group and stop receiving emails from it, send an email to transit-developers+unsub...@googlegroups.com.

ryland...@gmail.com

unread,
Sep 3, 2014, 11:02:15 AM9/3/14
to transit-d...@googlegroups.com, ryland...@gmail.com, redlandscommu...@gmail.com
Thanks for the reply!

I've been trying to use different ArcGIS tools to accomplish this, but I cannot find an appropriate network dataset to use.  Do you know where I'd be able to find a functional set of the United States?  We primarily serve the midwest (WI, MN, ND, SD, MT) but also have routes that go down to TX.

Steve Rylander

Tony Laidig

unread,
Sep 3, 2014, 11:43:46 AM9/3/14
to transit-d...@googlegroups.com, ryland...@gmail.com
The standard ArcGIS package comes with a DVD containing a street map of the entire US, but as you're using a demo you probably don't have access to it.

So this is a great moment to introduce OpenStreetMap: http://wiki.openstreetmap.org/wiki/About

There is a package for editing/importing OSM data to ArcGIS. which I have not used, but supposedly allows network datasets to be generated from OSM data.

https://esriosmeditor.codeplex.com/wikipage?title=Create%20a%20Network%20Dataset%20from%20OSM%20Data

As an aside, I'm worried about the licensing ramifications of using Google or other proprietary map data to create derivative works. This is expressly prohibited in the maps TOS: https://developers.google.com/maps/terms . While OSM has some restrictions ( http://wiki.openstreetmap.org/wiki/Common_licence_interpretations ) about derivative works, they are far less onerous than those of Google. If those are still too onerous, the TIGER/Line dataset is in the public domain.

ryland...@gmail.com

unread,
Sep 4, 2014, 9:42:40 AM9/4/14
to transit-d...@googlegroups.com
Hey Sean,

Is there any way you can walk me through a bit of this application?  The ReadMe file wasn't too helpful to me :(

This looks like a very helpful tool, though!

Barbeau, Sean

unread,
Sep 4, 2014, 10:25:40 AM9/4/14
to transit-d...@googlegroups.com, Landon Reed (LReed@atlantaregional.com)

Steve,

I’ve never used it, but I’m copying Landon Reed here, who is the one who wrote it.  If anyone can help, its him J.

 

Sean

To unsubscribe from this group and stop receiving emails from it, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.

Steve Rylander

unread,
Sep 4, 2014, 10:29:32 AM9/4/14
to transit-d...@googlegroups.com
I love the internet.

Landon Reed

unread,
Sep 4, 2014, 10:31:30 AM9/4/14
to transit-d...@googlegroups.com, ryland...@gmail.com
Haha, yep, I'm happy to help out.  I guess I'll start by updating the docs :)

If you have any specific questions, feel free to message me directly.

I'll probably be able to start working on the docs around 3pm EST.

-Landon
I love the internet.


To unsubscribe from this group and stop receiving emails from it, send an email to transit-developers+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-developers+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to transit-developers+unsub...@googlegroups.com.

Barbeau, Sean

unread,
Sep 4, 2014, 11:10:40 AM9/4/14
to transit-d...@googlegroups.com, ryland...@gmail.com

Steve,

For completeness sake, and since I brought up Landon’s tool in this thread, I feel that I should echo Tony’s previous comment on possible license issues with Google’s data when using the Google Directions API.  So, caveat emptor.

 

You could accomplish something similar using OpenTripPlanner (http://www.opentripplanner.org/) API and OpenStreetMap data (following the licensing terms linked to in Tony’s previous post), although it requires setting up your own OTP server.  OTP used to support loading shp files for networks as well (which would allow loading TIGER data and other sources), not sure if it still does.  Maybe someone would be interested in adding support for the OTP REST API to Landon’s tool?  I opened an issue about this here on Github for discussion - https://github.com/atlregional/bus-router/issues/1.

 

Sean

To unsubscribe from this group and stop receiving emails from it, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.

Landon Reed

unread,
Sep 5, 2014, 10:47:27 AM9/5/14
to transit-d...@googlegroups.com, ryland...@gmail.com
Just to update everyone, the bus-router script now has default support for the OSRM (Open Source Routing Machine) API.  So no more concerns about Google's restrictive ToS.  However, since this new routing is based on OpenStreetMap, it is probably subject to derivative works under ODbL, so be sure to mention the license when you pass along the data.

It also now has command-line args that allow you to convert between shapes.txt and GeoJSON.

To unsubscribe from this group and stop receiving emails from it, send an email to transit-developers+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-developers+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-developers+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-developers+unsub...@googlegroups.com.

Barbeau, Sean

unread,
Sep 5, 2014, 10:48:41 AM9/5/14
to transit-d...@googlegroups.com, ryland...@gmail.com

That’s awesome, Landon!  Thanks for working on this!

To unsubscribe from this group and stop receiving emails from it, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Transit Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/transit-developers/EIe2dRsRWyY/unsubscribe.

To unsubscribe from this group and all its topics, send an email to transit-develop...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages