Can someone give me test case nuber 2 or 5.. thx
WKT Polygon
I see you solved this task. What did you check?
I checked:
- num of points >= 3
- all intervals ( is all in [180,180], mixing of lat and lan )
- is first point = last point
- is there "POLYGON ((" at the start and "))" at the end
Did I forget something?
I have problems with same tests.
I checked:
- num of points >= 3
- all intervals ( is all in [180,180], mixing of lat and lan )
- is first point = last point
- is there "POLYGON ((" at the start and "))" at the end
Did I forget something?
I have problems with same tests.
There is no need to check if there are more or equal than 3 points, but that is not the problem.
It says:
"Lat coordinate represents the latitude from the interval [-90..90], and lon coordinate represents the longitude from the interval [-180..180]
The condition is that the one of the coordinates represents the latitude (-90..90), and the other ones represent longitude (-180..180)." But in your code both of the coordinates need to be at the same time latitude and longitude. I noticed too that you compare doubles with "==", you should use fabs instead. At first, try to fix that. I see you're using a scanset for the input at the begining, but additional spaces may appear anywhere in the text, so be more careful with reading of the input.
It says:
"Lat coordinate represents the latitude from the interval [-90..90], and lon coordinate represents the longitude from the interval [-180..180]
The condition is that the one of the coordinates represents the latitude (-90..90), and the other ones represent longitude (-180..180)." But in your code both of the coordinates need to be at the same time latitude and longitude. I noticed too that you compare doubles with "==", you should use fabs instead. At first, try to fix that. I see you're using a scanset for the input at the begining, but additional spaces may appear anywhere in the text, so be more careful with reading of the input.
... But in your code both of the coordinates need to be at the same time latitude and longitude ...
It is not like that, but never mind. Looks like there is no space between "POLYGON" and "((", and that was the problem.
There is no need to compare double with fabs because all of them are from input, I don't do anything with them.
Thanks for help, I did it.
It is not like that, but never mind. Looks like there is no space between "POLYGON" and "((", and that was the problem.
There is no need to compare double with fabs because all of them are from input, I don't do anything with them.
Thanks for help, I did it.