Announcement

Collapse
No announcement yet.

Creating Garmin POI from CNGprices.com

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating Garmin POI from CNGprices.com

    I developed a method of creating POI files from the station data on CNGprices.

    Use mobile.cngprices.com.

    Scrape the station data of interest into a text file. each station will have 4 lines of data (station description,address,telephone, lat-long). Make sure there is a blank line between the station data. Don't worry about duplicates as the conversion program will discard duplicates. Check the scraped data as not all entries have a phone number; just put "none" on these entries.l

    You will have to install a free text processing language GAWK on your computer. Google is your friend.

    This is the program:

    # cng.awk --- converts entries from cut and paste of mobile.cngprices.com output
    # to POI file for Garmin
    # \42 prints double quote
    # first line of cngprices output is ignored

    # Records are separated by blank lines.
    # Each line is one field.
    BEGIN { RS = "" ; FS = "\n" }
    {
    split($4,field,",")
    long = field[2]
    lat = substr(field[1],6)
    address = $2
    phone = $3
    # if location appeared before skip printing it
    if (used[long,lat] == "") {
    print long,",",lat,",\42",address,"\42",",\42",phone,"\4 2"
    used[long,lat] = 1
    }
    # else {print "Duplicate ",address}
    }
    # The End

    if the scraped data is in a file name cng.poi and the gawk program is in a file
    cng.awk then do in the command lineA:

    gawk -f cng.awk cng.poi >cng.csv

    The csv file will contain lines with:

    longitude,latitude,address,telephone

  • #2
    Re: Creating Garmin POI from CNGprices.com

    I've got the info listed here as well. It's got all north america stations (though some didn't have correct addresses listed, I think).
    1997 Factory Crown Victoria w/ extended tanks ~~ Clunkerized!
    2000 Bi-Fuel Expedition --> ~~ Sold ~~ <--

    Comment

    Working...
    X