The Following User Says Thank You to orangegoat For This Useful Post: | ||
|
2008-01-13
, 00:24
|
|
Posts: 145 |
Thanked: 20 times |
Joined on Dec 2007
@ Seattle, WA USA
|
#2
|
|
2008-01-13
, 16:22
|
Posts: 5 |
Thanked: 2 times |
Joined on Dec 2007
|
#3
|
|
2008-03-10
, 23:57
|
Posts: 79 |
Thanked: 21 times |
Joined on Sep 2007
|
#4
|
#!/usr/bin/perl -w print "PRAGMA synchronous=off;\n"; print "DELETE FROM poi WHERE cat_id=(SELECT cat_id FROM category WHERE label=\"FON\");\n"; while(<>) { my ($lat, $lon, $addr); if (!(($lon,$lat,$addr) = /(-?[\d.]+),(-?[\d.]+),"([^"]+)"/)) { print STDERR "Could not parse:\n$_"; next; } #print "Lon: $lon\nLat: $lat\nAddr: $addr\n\n"; print "INSERT INTO poi (lat,lon,label,cat_id) VALUES ($lat,$lon,\"$addr\",(SELECT cat_id FROM category WHERE label=\"FON\"));\n"; }
cat FON*.csv | ./csv2sql | sqlite3 poi.db
The Following 3 Users Say Thank You to tvogel For This Useful Post: | ||
My problem is that Maemo Mapper doesn't import the GPX files properly. It hangs on the import. When you kill it and restart, the POIs seem to be in the database, but if you deselect the category they're in, you can never get them back.
I've tried to convert both KML and GPX versions of the FON POIs to GPX using KMLtoGPX, GPSBabel, and Load_POI. None can complete the conversion. From GPSBabel, I learned that the file contains invalid lat/long points, which I now assuming are what's screwing everything up. I tried removed a few manually, but there are thousands of POIs in the file, and I'm not even sure if this is really the probem.
Does anyone know either:
1. How to make this work
or
2. How to filter out invalid entries in a large GPX file?
Many thanks.