Comments (10)
Hello
I think I have same issue with Ubuntu 10.10. For me the problem was that atof
function in xmlreader.h was returning integer. I don't know much of coding or
compilers so I just made my own function to return double and now the
preprocessor is working right.
Original comment by [email protected]
on 5 Jan 2011 at 4:44
from monav.
Sorry for the late reply, I have been busy during the last few days.
That's a weird behavior you encounter there. I could not reproduce it with any
computer available to me.
The only thing I can think of right now is that atof might be using your locale
settings, i.e., use "," instead of "." as a decimal separator. Can you check
what results you get for "atof( "1.5" )" and "atof( "1,5" )" or whatever your
local settings might be?
If this can be confirmed I have to replace atof with local-independent routines
as the OSM input always uses '.' as a separator.
Original comment by [email protected]
on 5 Jan 2011 at 8:59
- Changed state: Accepted
- Added labels: Priority-High
- Removed labels: Priority-Medium
from monav.
Hello
I did some testing with clean project only main function and cstdlib and
iostream included. atof returns 1.5 as 1.5 and 1,5 as 1. Then I added
QApplication to includes and "QApplication app(argc, argv);" to the top of main
function. Now atof returns 1.5 as 1 and 1,5 as 1.5.
That same happens inside MoNav's code, I think.
Original comment by [email protected]
on 6 Jan 2011 at 4:10
from monav.
$ cat foo.c
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("1,50 → %.2f\n", atof("1,5"));
printf("1.50 → %.2f\n", atof("1.5"));
}
$ ./a.out
1,50 → 1.00
1.50 → 1.50
$
It seems it's doing the "right" thing. However, a locale-agnostic
implementation would be better in any case, I'd say.
Original comment by [email protected]
on 9 Jan 2011 at 8:55
from monav.
(so yes, maybe it's something related to QApplication)
Original comment by [email protected]
on 9 Jan 2011 at 8:57
from monav.
...and, strange, but yes, my locale has "," as decimal separator:
Compare:
$ df -h | grep sdb
/dev/sdb1 7,4G 20K 7,4G 1% /media/PHOTOSD
$ LANG=C df -h | grep sdb
/dev/sdb1 7.4G 20K 7.4G 1% /media/PHOTOSD
(sorry for the multiple comments)
Original comment by [email protected]
on 9 Jan 2011 at 9:12
from monav.
Nice piece of investigative work.
Could you try whether r404 fixes the behavior?
Original comment by [email protected]
on 9 Jan 2011 at 9:56
from monav.
I couldn't backport it to 0.2, so I checked it out. And yes, it works great :)
When will you release a new version I could package? :)
Thanks!
Original comment by [email protected]
on 9 Jan 2011 at 10:43
from monav.
Works great! Thank you
Original comment by [email protected]
on 9 Jan 2011 at 11:26
from monav.
Original comment by [email protected]
on 13 Jan 2011 at 11:57
- Changed state: Fixed
from monav.
Related Issues (20)
- Building Monav against Qt 5 HOT 1
- Guidance on how to integrate Monav in a Windows 8 App Project
- monav-preprocessor: bad_alloc HOT 3
- MoNav Preprocessor HOT 2
- Misleading turn instructions when route is almost straight at a crossing HOT 4
- Routing prefers highway all the time HOT 1
- Plays only the first audio file in Qt Simulator HOT 1
- Way modificators greater than zero are ignored HOT 2
- build failure: QtMultimedia: No such file or directory HOT 7
- Assertion `edges->size() != ( int ) edgesBegin' failed. (for one specific route) HOT 1
- Some turns are not announced HOT 1
- libxml2 include path HOT 1
- Preprocessor linker error with libprotobuf
- monav 0.3.release-3+hg5585bb4a8d77 crashes on startup
- No map with Mapnik renderer and metaTileSize > 63
- Fix memory handling bugs HOT 1
- Fix preprocessor crash on small data sets without places HOT 2
- Fix QTileRenderer crash on small data sets HOT 2
- Preprocessor: Fix unpredicatable result of BinaryHeap::WasInserted() HOT 4
- Bicycle routing on footways / steps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monav.