Maps not rendering on LOCUS parser

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
doncoleman
 
Posts: 30
Joined: Sat Feb 09, 2013 12:54 am

Maps not rendering on LOCUS parser

Post by doncoleman »

The LOCUS parser http://learn.adafruit.com/custom/ultimate-gps-parser is failing with my file from a Flora GPS module.

The XML looks OK. The KML has an error and the map is not rendering. In the KML the opening style tag is written as </style id="yellowLineGreenPoly"> instead of <Style id="yellowLineGreenPoly">. Maybe the KML error is causing the problem with the map?

The file I'm using is sample.log from https://github.com/don/locus

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Maps not rendering on LOCUS parser

Post by adafruit_support_rick »

You are absolutely correct. I'll ask somebody to fix that. :oops:
Thanks for the tip! :D

User avatar
jwcooper
 
Posts: 1004
Joined: Tue May 01, 2012 9:08 pm

Re: Maps not rendering on LOCUS parser

Post by jwcooper »

Is it possible there's something wrong with the data you're trying to use (https://raw.github.com/don/locus/master/sample.log)? I'm not entirely familiar with this format, but do you see anything Rick?

I used the following data (the only I could find quickly (half way down in the file, and pasted below): https://github.com/douggilliland/Dougs- ... eLOCUS.cpp) and it rendered just fine. I have fixed the typo with the </Style> tags though.

Code: Select all

$PMTK001,314,3*36
$PMTKLOX,0,43*6E
$PMTKLOX,1,0,0100010A,1F000000,0F000000,0000100A,00000000,00000000,0000007F,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,00FC8C1C,288C4850,02760620,42642D9F,C2B90001,378C4850,027D0720,42532D9F,C2CB0051*23
$PMTKLOX,1,1,468C4850,02B50920,42652D9F,C2E600FD,558C4850,02E30B20,427A2D9F,C2120150,648C4850,02C30D20,42892D9F,C22D018B,738C4850,022A0E20,422E2E9F,C23701C8,828C4850,02880E20,42912E9F,C22D013E,918C4850,02561020,428D2E9F,C22201FE*20
$PMTKLOX,1,2,A08C4850,02D91120,42CA2E9F,C2270103,AF8C4850,02F01120,42C52E9F,C22D0120,BE8C4850,02F01120,42C72E9F,C22E0130,CD8C4850,02FF1120,423D2F9F,C22901B0,DC8C4850,02D01120,427F309F,C22401DE,EB8C4850,023C1120,42EC319F,C2210192*27
$PMTKLOX,1,3,FA8C4850,02AA1020,42A8329F,C2200152,098D4850,02930E20,423B329F,C21C0128,188D4850,02E80D20,4285329F,C21501F6,278D4850,02BF0D20,42F5329F,C21401EF,368D4850,02B70D20,4208339F,C2160108,458D4850,021E0D20,421D339F,C21C01CD*22
$PMTKLOX,1,4,548D4850,02F10A20,42EF329F,C22201F9,638D4850,02E30820,42E2339F,C23201C2,728D4850,02530620,428A349F,C23A010A,818D4850,02680320,4202359F,C2350141,908D4850,028D0120,42A8359F,C23C0114,9F8D4850,02B50020,42F3359F,C23F017A*27
$PMTKLOX,1,5,AE8D4850,0462FE1F,42DF369F,C244010F,BD8D4850,04FBFB1F,4235389F,C2330113,CC8D4850,0490FA1F,42F8399F,C23101C6,DB8D4850,04BCF91F,42E13B9F,C23501E1,EA8D4850,04E8F81F,42C83D9F,C23D01A2,F98D4850,04EBF71F,42973F9F,C24A0197*22
$PMTKLOX,1,6,088E4850,04F2F51F,423F419F,C25601B4,178E4850,04FDF21F,426C429F,C26101C4,268E4850,0485EF1F,42E1429F,C257012B,358E4850,0475EC1F,4216449F,C266010B,448E4850,0479E91F,4292459F,C27001E0,538E4850,047FE61F,420C479F,C27A0168*5C
$PMTKLOX,1,7,628E4850,049DE31F,427A489F,C281013C,718E4850,04F7E01F,42CB499F,C28101F6,808E4850,0478DE1F,420C4B9F,C27D018F,8F8E48FFFFFFF,FFFFFFFF,FFFFFFFF*6E
$PMTKLOX,2*47
$PMTK001,622,3*36

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Maps not rendering on LOCUS parser

Post by adafruit_support_rick »

The Style tag was the only issue, I believe.

The parser generates

Code: Select all

    </style id="yellowLineGreenPoly"> 
It should be generating

Code: Select all

    <Style id="yellowLineGreenPoly"> 

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Maps not rendering on LOCUS parser

Post by adafruit_support_rick »

Actually, you're right about the data.

@doncoleman - if you delete all the lines with FFFFFFF (starting at line 15), the map renders correctly

Code: Select all

$PMTK001,314,3*36
$PMTKLOX,0,43*6E
$PMTKLOX,1,0,0100010A,1F000000,0F000000,0000100A,00000000,00000000,000003FF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,FFFFFFFF,00FC8C1C,69165652,02EF8920,429E6996,C23800E6,78165652,02EF8920,429D6996,C23800F4*57
$PMTKLOX,1,1,8C165652,02EE8920,429B6996,C2380007,9B165652,02ED8920,429B6996,C2380013,AA165652,02EC8920,429A6996,C2380022,B9165652,02E98920,42996996,C2390036,C8165652,02EA8920,429A6996,C2390047,72175652,02D28D20,42D56C96,C24100F2*5B
$PMTKLOX,1,2,81175652,02D08D20,42D66C96,C2420003,90175652,02D08D20,42D66C96,C2420012,9F175652,02D08D20,42D66C96,C242001D,AE175652,02D08D20,42D66C96,C242002C,BD175652,02D08D20,42D66C96,C242003F,CC175652,02D08D20,42D66C96,C242004E*27
$PMTKLOX,1,3,DB175652,02D08D20,42D66C96,C2420059,EA175652,02D08D20,42D66C96,C2420068,F9175652,02D08D20,42D56C96,C2420078,08185652,02D08D20,42D56C96,C2420086,17185652,04D08D20,42D56C96,C242009F,26185652,04CF8D20,42D56C96,C24200B1*5D
$PMTKLOX,1,4,35185652,04D08D20,42D56C96,C24100BE,44185652,04CF8D20,42D56C96,C24000D1,53185652,04CF8D20,42D46C96,C24000C7,62185652,04CE8D20,42D46C96,C24000F7,71185652,04D08D20,42D46C96,C24000FA,80185652,04D18D20,42D46C96,C240000A*25
$PMTKLOX,1,5,8F185652,04D18D20,42D46C96,C2400005,9E185652,04D18D20,42D46C96,C23F006B,AD185652,04D18D20,42D46C96,C23F0058,BC185652,04D18D20,42D46C96,C23F0049,CB185652,045C8D20,42BD6C96,C24200A7,DA185652,04E78C20,42946C96,C2470020*26
$PMTKLOX,1,6,E9185652,04A18B20,42826B96,C2450041,F8185652,04248A20,42446A96,C239006F,07195652,04908820,42F36896,C236009D,16195652,042A8820,426D6896,C23800A6,25195652,04628820,42A96796,C2380016,34195652,04148820,42A46696,C238007D*5E
$PMTKLOX,1,7,43195652,04B88920,421F6796,C23D0018,52195652,043B8D20,42056796,C24600EF,61195652,041C9120,42B76796,C2510042,70195652,04439520,42BF6896,C25C0002,7F195652,045F9920,422E6896,C26500B5,8E195652,04979D20,42456796,C26D00E4*5F
$PMTKLOX,1,8,9D195652,04E7A120,42046796,C26200F5,AC195652,042BA620,42306796,C26A0033,BB195652,0444AA20,424B6896,C2680031,CA195652,04D0AD20,42186A96,C26C0086,D9195652,0411B120,42126C96,C274005C,E8195652,04BEB420,42506D96,C2700080*56
$PMTKLOX,1,9,F7195652,04CDB820,42766C96,C27500C2,061A5652,0440BD20,42DB6B96,C268000F,151A5652,0444C120,42406D96,C26800F9,241A5652,04A4C420,427C6F96,C267001C,331A5652,04BBC720,42D77196,C27000B5,421A5652,04DBCB20,42B87296,C27100C5*51
$PMTKLOX,1,10,511A5652,04E8CF20,42DF7296,C26B009C,601A5652,04A8D220,42F77296,C26000D3,6F1A5652,04A0D220,42F67296,C26100D4,7E1A5652,04A0D220,42F67296,C26100C5,8D1A5652,0491D320,42FF7296,C263000D,9C1A5652,04E1D520,42127396,C2660083*10
$PMTKLOX,1,11,AB1A5652,0457D920,42977396,C26D0080,BA1A5652,04DFDC20,42BC7496,C27A0027,C91A5652,0455E020,42D87596,C2890074,D81A5652,04D8E320,42CC7696,C28400F1,E71A5652,049CE620,42BF7796,C29500EC,F61A5652,04A4E920,42E67896,C287008E*6E
$PMTKLOX,1,12,051B5652,04C6EC20,42D27996,C283002A,141B5652,04B5EF20,42717A96,C28900E1,231B5652,04B8F020,42CF7A96,C28C007F,321B5652,04BFF120,42347B96,C28E0090,411B5652,0469F420,42157C96,C293000B,501B5652,04C0F420,42217C96,C2910085*6F
$PMTKLOX,1,13,5F1B5652,0466F720,425D7C96,C2920050,6E1B5652,0442FA20,42927C96,C298008D,7D1B5652,04C9FC20,42C77C96,C295004B,8C1B5652,04FEFC20,42CE7C96,C2930082,9B1B5652,04FEFC20,42CE7C96,C2930095,AA1B5652,041DFE20,421D7D96,C2950091*17
$PMTKLOX,1,14,B91B5652,04650121,42397E96,C28E0038,C81B5652,04030521,42D87E96,C27E003A,D71B5652,04740821,421A7F96,C2760094,E61B5652,04CF0B21,42E67F96,C26E00F9,F51B5652,04EF0E21,42368196,C26100EE,041C5652,04421121,422F8296,C26300B2*10
$PMTKLOX,2*47
$PMTK001,622,3*36

User avatar
doncoleman
 
Posts: 30
Joined: Sat Feb 09, 2013 12:54 am

Re: Maps not rendering on LOCUS parser

Post by doncoleman »

@adafruit_support_rick and @jwcooper Thanks for fixing the style issue.

My data file is pulled directly from the Flora GPS http://www.adafruit.com/products/1059, which seems to include a lot of blank rows at the end. Removing them isn't difficult. However I've also found when the GPS loses signal indoors, I get FFFFFFFF mixed in with good data.

I think there is a bit flag to tell if a particular data reading is valid, but I haven't figured out all the details yet. For now I just discard any reading where the Fit value is < 1 or > 4 before using the data.

Code: Select all

import locus
coords = locus.parseFile('sample.log')

# filter out any bad records
coords = [c for c in coords if c.fix > 0 and c.fix < 5] 

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”