[Openstreetmap] Problems using the osmeditor (Was: Landsat update)

Petter Reinholdtsen pere at hungry.com
Sat Apr 30 21:53:18 BST 2005


[Nick Whitelegg]
>> Can I use it to annotate the GPX data from Oslo?
>
> Yes, you should be able to do that.

I tried, but it seem to have some special requirements for the GPX
files not fulfilled by my GPX files.  I had some crashes because the
wpt type isn't set.  When I fixed these, I was able to run the program
but nothing appeared on the screen.

If you want to test, try to load 
<URL:http://developer.skolelinux.no/~pere/gis/openstreetmap/data/pere-2005-03.gpx.gz>

This is my current patch.  Some of it need more work.

Index: Makefile
===================================================================
--- Makefile    (revisjon 275)
+++ Makefile    (arbeidskopi)
@@ -1,3 +1,4 @@
+CXX = c++

 TESTGPSOBJ = testgps.o GPSDevice.o
 OBJ = main.o MainWindow.o GPSDevice.o Segment.o functions.o \
@@ -3,13 +4,16 @@
          Track.o Waypoint.o Components.o  GPXParser.o WaypointDialogue.o \
          Permissions.o LoginDialogue.o moc_MainWindow.o
-LIBS = -ljeeps
+LIBS = -Ljeeps-0.1.4-nick -ljeeps
 LIBPATH = -L/usr/local/lib

-QTINCPATH = /usr/lib/qt3/include
+QTINCPATH = /usr/include/qt3
 QTLIB = -lqt-mt
-QTLIBPATH = -L/usr/lib/qt3/lib
+QTLIBPATH = -L/usr/lib

 #set OPTS to -DXMLRPC to compile in XMLRPC stuff
-CXXFLAGS = -I$(QTINCPATH) -I/usr/local/include $(OPTS)
+WARNFLAGS=-W -Wall
+DEBUGFLAGS=-g
+CXXFLAGS = $(WARNFLAGS) $(DEBUGFLAGS) \
+       -I$(QTINCPATH) -I/usr/local/include $(OPTS) -Ijeeps-0.1.4-nick

 JEEPSSRC = jeeps-0.1.4-nick
@@ -22,20 +26,20 @@
                        -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils\
                        -lmd5 -ldl -lz -lssl -lcrypto -lxmlrpc_client

-MOC=/usr/lib/qt3/bin/moc
+MOC=moc

 moc_%.cpp : %.h
        ${MOC} $< -o $@

 osmeditor: $(OBJ)
        #cd $(JEEPSSRC); make INSTROOT=/usr/local; make install
-       g++ -o osmeditor $(OBJ) $(LIBPATH) $(QTLIBPATH) $(LIBS) $(QTLIB) $(XMLRPCLIBS)
+       $(CXX) -o osmeditor $(OBJ) $(LIBPATH) $(QTLIBPATH) $(LIBS) $(QTLIB) $(XMLRPCLIBS)

 testgps: $(TESTGPSOBJ)
-       g++ -o testgps $(TESTGPSOBJ) $(LIBS)
+       $(CXX) -o testgps $(TESTGPSOBJ) $(LIBS)

 testparser : $(PARSEROBJ)
-       g++ -o testparser $(PARSEROBJ) $(QTLIBPATH) $(LIBS) $(QTLIB)
+       $(CXX) -o testparser $(PARSEROBJ) $(QTLIBPATH) $(LIBS) $(QTLIB)

 clean:
        rm -f *.o *~
Index: GPXParser.cpp
===================================================================
--- GPXParser.cpp       (revisjon 275)
+++ GPXParser.cpp       (arbeidskopi)
@@ -126,9 +126,10 @@

        else if(inWpt && element=="wpt")
        {
+               const char *asciitype = curType.ascii();
                cerr<<"adding waypoint:" <<
                                curName <<" " << curLat << " " << curLong << " "
-                               << atoi(curType.ascii()) << endl;
+                               << atoi(asciitype ? asciitype : "") << endl;
                components->addWaypoint(Waypoint(curName,curLat,curLong,curType));
                inWpt = false;
        }
Index: MainWindow.cpp
===================================================================
--- MainWindow.cpp      (revisjon 275)
+++ MainWindow.cpp      (arbeidskopi)
@@ -466,7 +466,8 @@
        {
        ScreenPos pos = map.getScreenPos(waypoint.lat,waypoint.lon);
        WaypointRep* img=waypointReps[waypoint.type];
-       img->draw(p,pos.x,pos.y,waypoint.name);
+       if (img)
+               img->draw(p,pos.x,pos.y,waypoint.name);
        }
 }






More information about the talk mailing list