Statewide trail info map

Statewide trail info map

Postby NoyzSource » Mon Feb 18, 2013 2:57 pm

On MTBIowa.org I had hoped to be able to use Google Docs to have an easy to manipulate spreadsheet of trail information. Shortly after I did that, my company blocked Google Docs and my maps don't work for myself.

So I want to be able to aggregate information about trails and post it in an easy to see format. Basic information at first:

Trail name (Beverly Park)
Trail maintainer (Linn Area MTB Assoc.)
Trail maintainer website (LAMBAonline.org)
Lat/Long of trail head
Trail Status (Good, Fair, Poor, Call, Winter)


Ideally this information would be stored on the webserver of the trail maintainer so they could change it whenever they wanted. Maybe some sort of easily parsed INI or XML file.

MTBIowa would access the file every hour and display this information on the main map. MTBIowa wouldn't have the map of the individual trails but would hopefully drive the user to click on the map information and take them to the trail maintainer website. All control of the individual trail information would be handled locally and MTBIowa would only take care of maintaining a link to the local trail information file. I think this would be pretty easy to maintain and make sure the local group has control.

Of course of those groups without a webserver, MTBIowa.org would be happy to provide a place to store these files.

My question to the people who cares is what format should this file have? (XML, HTML, etc.)
Would the other web gurus be willing to implement it?
User avatar
NoyzSource
Site Admin
 
Posts: 711
Joined: Mon Aug 20, 2007 9:20 am
Location: Cedar Rapids, IA

Re: Statewide trail info map

Postby Ken » Wed Feb 20, 2013 4:57 pm

Ooooooooooooooooooo... http://www.mtbproject.com/
User avatar
Ken
Site Admin
 
Posts: 1819
Joined: Sun Aug 19, 2007 9:47 pm
Location: Cedar Rapids

Re: Statewide trail info map

Postby NoyzSource » Wed Feb 20, 2013 6:26 pm

I generally try not to be negative but that website is still vaporware and you can only be granted access if you have a Facebook account. The Facebook login is nice so you don't have to manage user accounts.

It would be very cool if IMBA could provide mapping resources. If would be even cooler if it didn't require another login, IMBA chapter/club, or money of any sort. If they implement it similar to other mapping sites where you have to login to change stuff then after awhile the people that maintained it leave and forget to pass on the password. That is an inherent problem with a central database vs locally stored markup that is aggregated. Similar things can happen to locally stored if you have frequent webmaster changes or are not web savvy.

In my opinion their About Us page is ambitious but could also cause a huge headache/delay in actual release.

Things I would like to see from their maps:
Ability to embed state view in other website.
Ability to embed local view in other website (eg. Pinicon to Squaw).
Information to drive users to local club website.
Trail conditions icon for quick glance views on map.

Those things would negate the need for me to aggregate that data but I still think my way is better. :P My background is Unix/Linux where the motto is "Do one thing and do it well.". Sometimes the project gets too big and the original purpose gets lost. It is a sit and wait on this one. I'm hoping it works though.
User avatar
NoyzSource
Site Admin
 
Posts: 711
Joined: Mon Aug 20, 2007 9:20 am
Location: Cedar Rapids, IA

Re: Statewide trail info map

Postby dgw2jr » Sun Jun 16, 2013 6:03 pm

XML PLZ. Would like to be able to reference it in a mobile app currently in development.
dgw2jr
 
Posts: 62
Joined: Wed Feb 15, 2012 12:25 pm
Location: Davenport, IA

Re: Statewide trail info map

Postby NoyzSource » Mon Jun 17, 2013 3:30 pm

Trail name (Beverly Park)
Trail maintainer (Linn Area MTB Assoc.)
Trail maintainer website (LAMBAonline.org)
Lat/Long of trail head
Trail Status (Good, Fair, Poor, Call, Winter)


I'm not very experienced at this so help me out a little.
  • Looking at the possibilities of XML, I have no idea if I need to pull in some other things like namespaces.
  • What is the best way to specify what the format of the items is in?
  • How do we define globally the status options? Do I need to host something that describes it or can I put it in the document with CDATA?

Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<trail>
  <trailName>Beverly Park</trailName>
  <trailMaintainer>Linn Area MTB Assoc</trailMaintainer>
  <trailMaintainerWebsite>http://LAMBAonline.org</trailMaintainerWebsite>
  <trailheadLat format="Decimal degrees">41.941650</trailheadLat>
  <trailheadLong format="Decimal degrees">-91.703680</trailheadLong>
  <trailStatus>Poor</trailStatus>
  <trailStatusUpdate format="YYYYMMDD HH">20130615 19</trailStatusUpdate>
  <trailStatusPhone format="xxx-yyy-zzzz">319-244-8682</trailStatusPhone>
</trail>
User avatar
NoyzSource
Site Admin
 
Posts: 711
Joined: Mon Aug 20, 2007 9:20 am
Location: Cedar Rapids, IA

Re: Statewide trail info map

Postby dgw2jr » Mon Jun 17, 2013 5:00 pm

NoyzSource wrote:
Trail name (Beverly Park)
Trail maintainer (Linn Area MTB Assoc.)
Trail maintainer website (LAMBAonline.org)
Lat/Long of trail head
Trail Status (Good, Fair, Poor, Call, Winter)


I'm not very experienced at this so help me out a little.
  • Looking at the possibilities of XML, I have no idea if I need to pull in some other things like namespaces.
  • What is the best way to specify what the format of the items is in?
  • How do we define globally the status options? Do I need to host something that describes it or can I put it in the document with CDATA?

Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<trail>
  <trailName>Beverly Park</trailName>
  <trailMaintainer>Linn Area MTB Assoc</trailMaintainer>
  <trailMaintainerWebsite>http://LAMBAonline.org</trailMaintainerWebsite>
  <trailheadLat format="Decimal degrees">41.941650</trailheadLat>
  <trailheadLong format="Decimal degrees">-91.703680</trailheadLong>
  <trailStatus>Poor</trailStatus>
  <trailStatusUpdate format="YYYYMMDD HH">20130615 19</trailStatusUpdate>
  <trailStatusPhone format="xxx-yyy-zzzz">319-244-8682</trailStatusPhone>
</trail>


I'll check your XML when I get home to see if it deserializes correctly. Just by looking it looks legit though.
dgw2jr
 
Posts: 62
Joined: Wed Feb 15, 2012 12:25 pm
Location: Davenport, IA

Re: Statewide trail info map

Postby NoyzSource » Mon Jun 17, 2013 5:21 pm

The nice part is that this can be hold multiple trail statuses (statii?) in one file.



  • Should I break down the date and time of the status update to smaller chunks?
  • I need to create a script that updates this XML file whenever the status changes.
  • What should the XML filename be so it can be easily found on all webservers? Assuming we can get more clubs to adopt this.
  • I should create a web form that will generate the XML for the less tech savvy to put on their website.
User avatar
NoyzSource
Site Admin
 
Posts: 711
Joined: Mon Aug 20, 2007 9:20 am
Location: Cedar Rapids, IA

Re: Statewide trail info map

Postby dgw2jr » Mon Jun 17, 2013 9:36 pm

I got this XML...

Code: Select all
<?xml version="1.0" encoding="utf-16"?>
<Trail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <TrailName>Beverly</TrailName>
  <TrailMaintainer>LAMBA</TrailMaintainer>
  <TrailMaintainerWebsite>http://lambaonline.org</TrailMaintainerWebsite>
  <TrailHeadLat>41.941650</TrailHeadLat>
  <TrailHeadLong>-91.703680</TrailHeadLong>
  <TrailStatus>Poor</TrailStatus>
  <TrailStatusUpdate>2013-06-17T21:31:17.807965-05:00</TrailStatusUpdate>
  <TrailStatusPhone>(563) 499-1234</TrailStatusPhone>
</Trail>


...by serializing the following C# class:

Code: Select all
public class Trail
   {
      public string TrailName { get; set; }

      public string TrailMaintainer { get; set; }

      public string TrailMaintainerWebsite { get; set; }

      public decimal TrailHeadLat { get; set; }

      public decimal TrailHeadLong { get; set; }

      public string TrailStatus { get; set; }

      public DateTime TrailStatusUpdate { get; set; }

      private string _TrailStatusPhone;

      public string TrailStatusPhone
      {
         get { return String.Format ("{0:(###) ###-####}", Int64.Parse (_TrailStatusPhone)); }
         set { _TrailStatusPhone = value; }
      }
   }


A web interface for CRUDing trail objects wouldn't be too difficult. What type of frameworks does your web server support? ASP.Net MVC would be the fastest way to get something like this implemented. If it's a Linux box then we can use the Mono version as well.
dgw2jr
 
Posts: 62
Joined: Wed Feb 15, 2012 12:25 pm
Location: Davenport, IA

Re: Statewide trail info map

Postby dgw2jr » Thu Jun 20, 2013 1:50 pm

Here's a C# program (you will need to copypasta) that will create clubs and trails and output the data as XML:

Code: Select all
using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;

public class Club
    {
      public Club() { }
      public string Name { get; set; }
      
      public string Url { get; set; }
      
      public virtual List<Trail> Trails { get; set; }
      
      // Add more properties as needed
      
   }

public class Trail
   {
      public Trail() { }
      public string Name { get; set; }
      
      private string _Status;
      public string Status {
         get {
            return this._Status;
            }
         set {
            this._Status = value;
            this.LastUpdate = DateTime.Now;
            }
      }

      public DateTime LastUpdate;
      
      // Add more properties as needed
      
   }

class Program {
    static void Main()
    {
       // Create a club that we can add trails to
       Club FORC = new Club() { Name = "FORC", Url = "http://www.qcforc.org" };
       
       // Define a club's default list of trails
       FORC.Trails = new List<Trail>() {
          new Trail() { Name = "Sunderbruch", Status = "Open" },
          new Trail() { Name = "Scott County Park", Status = "Open" },
          new Trail() { Name = "Illiniwek Forest Preserve", Status = "Open" }
       };
       
       // Add another trail later
       FORC.Trails.Add(new Trail() { Name = "Sylvan Island", Status = "Open" });
       
       // Change a trail status
       //System.Threading.Thread.Sleep(5000); // Sleep for 5 seconds to show a difference between each trail status update time
       FORC.Trails.Where(x => x.Name.Equals("Sunderbruch")).FirstOrDefault().Status = "Closed";
       
       // Create clubs and trails all at once
       List<Club> clubs = new List<Club>() {
          new Club() { Name = "LAMBA", Url = "http://lambaonline.org",
             Trails = new List<Trail>() {
                new Trail() { Name = "Beverly", Status = "Fair" },
                new Trail() { Name = "Thomas Park", Status = "Fair" }
             }
          }
       };
       
        // Add another club to the existing club list
       clubs.Add(FORC);
       
        // Create object to store our XML output
       TextWriter t = new StringWriter();
       
        // Mix magic potion
       System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(clubs.GetType(), new XmlRootAttribute("Clubs"));
       
        // Do magic
       serializer.Serialize(t,clubs);
       
        // Finish writing to storage object
       t.Close();
       
        // Dump the XML results to console
       Console.Write(t.ToString());
       
    }
}


This is a prototype to a more robust web application that can handle creation/modification of clubs and trail systems. This is how web sites like singletracks.com work on a very basic level.
dgw2jr
 
Posts: 62
Joined: Wed Feb 15, 2012 12:25 pm
Location: Davenport, IA

Re: Statewide trail info map

Postby urbanbigfoot » Mon Jun 24, 2013 9:16 am

Hey Eric -- I think we should sit down and discuss what the end goal is here. I bet if we toss back a few brews, throw around a few ideas, and look at the available technology available to us, we can find a solution. You know...a programmer like myself writes his best code when he's inebriated.
When I was a kid, I rode bikes. Now I ride bikes and act like a kid. Some things never change.
User avatar
urbanbigfoot
 
Posts: 401
Joined: Wed Mar 24, 2010 1:51 pm
Location: Marion, Iowa

Re: Statewide trail info map

Postby dgw2jr » Mon Jun 24, 2013 1:49 pm

Having looked at the mtbproject, I think it looks pretty cool. They even have this widget you can embed in your site.
dgw2jr
 
Posts: 62
Joined: Wed Feb 15, 2012 12:25 pm
Location: Davenport, IA

Re: Statewide trail info map

Postby NoyzSource » Tue Jun 25, 2013 12:40 pm

I can't get together this week with baseball stuff but maybe next week. Tuesday?

dgw2jr is working on secret skunkworks stuff so maybe he can shoot us something offline to give us some insight.

Jaxon also threw together and made a few upgrades to his Android app in this topic viewtopic.php?f=1&t=1819.

I could probably host that on the MTBIowa website. If we can implement a nifty XMLish thing then maybe it would be easy to get the THOR and CITA and CVAST folks to use it. Then maybe MTBproject could show a map similar to the MTBIowa front page. If that were the case then my ideas would all be covered.
User avatar
NoyzSource
Site Admin
 
Posts: 711
Joined: Mon Aug 20, 2007 9:20 am
Location: Cedar Rapids, IA


Return to Tech Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron