Using Objects FSRW and GPS_Float to make a Google Earth .kml file
Thomas Fletcher
Posts: 91
I am trying to Use the objects FSRW and GPS_Float to make a Google Earth .kml file,
but I am having trouble writing the real numbers Float_Longitude_Deg and Float_Latitude_Deg
to the file on the sd card.
I believe the problem is at
sdcard.sdstr(gps.Float_Longitude_Deg)
sdcard.sdstr(string(","))
sdcard.sdstr(gps.Float_Latitude_Deg)
sdcard.sdstr(string(","))
sdcard.sdstr(string("155"))
sdcard.sdstr(string(13,10))
It writes
0,0,155
0,0,155
0,0,155
to the file.
I am sure this has been discussed before, but I can't find a thread with search.
The file created
but I am having trouble writing the real numbers Float_Longitude_Deg and Float_Latitude_Deg
to the file on the sd card.
I believe the problem is at
sdcard.sdstr(gps.Float_Longitude_Deg)
sdcard.sdstr(string(","))
sdcard.sdstr(gps.Float_Latitude_Deg)
sdcard.sdstr(string(","))
sdcard.sdstr(string("155"))
sdcard.sdstr(string(13,10))
It writes
0,0,155
0,0,155
0,0,155
to the file.
I am sure this has been discussed before, but I can't find a thread with search.
CON _CLKMODE = XTAL1 + PLL16X _XINFREQ = 5_000_000 obj sdcard: "fsrw" gps: "GPS_Float" var long start pub main sdcard.mount(3) sdcard.popen(string("text.kml"),"w") if gps.init sdcard.SDStr(string("<?xml version='1.0' encoding='UTF-8'?>",13,10)) sdcard.SDStr(string("<kml xmlns='http://www.opengis.net/kml/2.2'>",13,10)) sdcard.SDStr(string(" <Document>",13,10)) sdcard.SDStr(string(" <name>Paths</name>",13,10)) sdcard.SDStr(string("<description>This is a test run of collecting GPS data</description>",13,10)) sdcard.SDStr(string("<Style id='yellowLineGreenPoly'>",13,10)) sdcard.SDStr(string(" <LineStyle>",13,10)) sdcard.SDStr(string(" <color>7f00ffff</color>",13,10)) sdcard.SDStr(string(" <width>4</width>",13,10)) sdcard.SDStr(string(" </LineStyle>",13,10)) sdcard.SDStr(string(" <PolyStyle>",13,10)) sdcard.SDStr(string(" <color>7f00ff00</color>",13,10)) sdcard.SDStr(string(" </PolyStyle>",13,10)) sdcard.SDStr(string(" </Style>",13,10)) sdcard.SDStr(string(" <Placemark>",13,10)) sdcard.SDStr(string(" <name>Absolute Extruded</name>",13,10)) sdcard.SDStr(string(" <description>Transparent green wall with yellow outlines</description>",13,10)) sdcard.SDStr(string(" <styleUrl>#yellowLineGreenPoly</styleUrl>",13,10)) sdcard.SDStr(string(" <LineString>",13,10)) sdcard.SDStr(string(" <extrude>1</extrude>",13,10)) sdcard.SDStr(string(" <tessellate>1</tessellate>",13,10)) sdcard.SDStr(string(" <altitudeMode>absolute</altitudeMode>",13,10)) sdcard.SDStr(string("<coordinates>")) repeat 10000 sdcard.sdstr(gps.Float_Longitude_Deg) sdcard.sdstr(string(",")) sdcard.sdstr(gps.Float_Latitude_Deg) sdcard.sdstr(string(",")) sdcard.sdstr(string("155")) sdcard.sdstr(string(13,10)) sdcard.SDStr(string("</coordinates>",13,10)) sdcard.SDStr(string(" </LineString>",13,10)) sdcard.SDStr(string(" </Placemark>",13,10)) sdcard.SDStr(string(" </Document>",13,10)) sdcard.SDStr(string("</kml>",13,10)) else sdcard.SDStr(string("GPS failed to start",13,10)) sdcard.pclose Lightblink Pub Lightblink dira~~ repeat 9 !outa waitcnt(9_000_000 + cnt)
The file created
<?xml version='1.0' encoding='UTF-8'?> <kml xmlns='http://www.opengis.net/kml/2.2'> <Document> <name>Paths</name> <description>This is a test run of collecting GPS data</description> <Style id='yellowLineGreenPoly'> <LineStyle> <color>7f00ffff</color> <width>4</width> </LineStyle> <PolyStyle> <color>7f00ff00</color> </PolyStyle> </Style> <Placemark> <name>Absolute Extruded</name> <description>Transparent green wall with yellow outlines</description> <styleUrl>#yellowLineGreenPoly</styleUrl> <LineString> <extrude>1</extrude> <tessellate>1</tessellate> <altitudeMode>absolute</altitudeMode> <coordinates>0,0,155 0,0,155 0,0,155 0,0,155 .......many more </coordinates> </LineString> </Placemark> </Document> </kml>
Comments
Also looking at GPS_Float_Demo I needed to add the object FloatString to convert the float number to string.
http://forums.parallax.com/showthread.php?p=729953
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andrew Williams
WBA Consulting
WBA-TH1M Sensirion SHT11 Module
My Prop projects: Reverse Geo-Cache Box, Custom Metronome, Micro Plunge Logger
have a CR LF sequence ???? like this
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andrew Williams
WBA Consulting
WBA-TH1M Sensirion SHT11 Module
My Prop projects: Reverse Geo-Cache Box, Custom Metronome, Micro Plunge Logger
time saving a different track into one of ten files.
Disappointed that I am already out of cogs. I was hoping to add some sensors to the mix.
Check
obex.parallax.com/objects/579/
(only one cog, I haven't tested it yet)
and
obex.parallax.com/objects/225/
(2 cogs, the GPS parsing engine works very well)
Massimo