Negative Longitude Value Error in Beta 2

130 views
Skip to first unread message

Louis

unread,
Sep 30, 2011, 3:46:25 AM9/30/11
to PorPOISe
Hello,

I am using PorPOISe 1.2 beta 2, and I am experiencing a very strange
error. I am unable to insert a negative value for longitude in my
POIs. As long as my lat and lon are positive values, the correct JSON
response is sent to layar and I am able to see my POIs show up just
fine in my test window within my layer development panel. However,
when I insert a negative value, specifically <0 (less than zero), I
receive the following error:

Value [] for field 'anchor' is not of type 'object', Failed to
validate field 'hotspots' list schema: "Value [] for field 'anchor' is
not of type 'object'"
oauth disabled
POI fwd url =
http://MYURL/MYSUB/web/porpoise.php?lang=en&countryCode=AF&lon=4.887339&userId=6f85d06929d160a7c8a3cc1ab4b54b87db99f74b&version=6.0&radius=1500&lat=52.377544&layerName=porpoison&accuracy=100
Response received from provider, validating...
response code : 200
error validating provider response - Traceback (most recent call
last): File "/var/www/layar.com/app/api/handlers/api_layer/
mainproxy.py", line 85, in validate_response data =
validator.validate(response_as_dict, schema) File "/var/www/layar.com/
app/api/jsontransmogrifier.py", line 560, in validate raise
ValidationError(message=", ".join(self.errors), errors=self.errors)
ValidationError: Value [] for field 'anchor' is not of type 'object',
Failed to validate field 'hotspots' list schema: "Value [] for field
'anchor' is not of type 'object'"
JSON parse error( most likely)!, validate your response at http://www.jsonlint.com/
Value [] for field 'anchor' is not of type 'object', Failed to
validate field 'hotspots' list schema: "Value [] for field 'anchor' is
not of type 'object'"
Error: No content available




I am testing this under API v6
oddly enough I get a different error when evaluating under a lower API
version. It is as follows (for a v5.0):

Required field 'title' is missing, Failed to validate field 'hotspots'
list schema: "Required field 'title' is missing"
oauth disabled
POI fwd url =
http://MYURL/MYSUB/web/porpoise.php?lang=en&countryCode=AF&lon=4.887339&userId=6f85d06929d160a7c8a3cc1ab4b54b87db99f74b&version=5.0&radius=1500&lat=52.377544&layerName=porpoison&accuracy=100
Response received from provider, validating...
response code : 200
error validating provider response - Traceback (most recent call
last): File "/var/www/layar.com/app/api/handlers/api_layer/
mainproxy.py", line 85, in validate_response data =
validator.validate(response_as_dict, schema) File "/var/www/layar.com/
app/api/jsontransmogrifier.py", line 560, in validate raise
ValidationError(message=", ".join(self.errors), errors=self.errors)
ValidationError: Required field 'title' is missing, Failed to validate
field 'hotspots' list schema: "Required field 'title' is missing"
JSON parse error( most likely)!, validate your response at http://www.jsonlint.com/
Required field 'title' is missing, Failed to validate field 'hotspots'
list schema: "Required field 'title' is missing"
Error: No content available



Considering the fact I am in North America, this presents a problem.
My current workaround has been to set longitude values in the positive
hundreds, so that the marker on the google map wraps far enough around
the earth to allow placement over north america. It would be great if
there is a solution! When viewing a location in the layar browser,
clicking "take me there" fails because the gps location is obviously
false. Im surprised that layar even accepts these false values.

Any help is much appreciated.

Louis

Matt

unread,
Apr 29, 2012, 5:30:01 PM4/29/12
to porp...@googlegroups.com
I was able to correct this by commenting out  this line:

                             /*      if (array_sum($aPoi['anchor']['geolocation'])<1) {
                                                unset($aPoi['anchor']['geolocation']);
                                        }

*/

In the poiserver.class.php.

It is obviously in there for error checking, so I need to figure out what they were checking for, but this will fix the issue.
Because, the gelocation was being unset everytime the sum of lat/lon was negative, which can happen frequently.

Cheers

Matt

Drew Carver

unread,
Nov 30, 2012, 1:41:47 AM11/30/12
to porp...@googlegroups.com
You, my friend, are a genius. Solved my problem that I've been attempting to solve for hours now. Thanks! :)
Reply all
Reply to author
Forward
0 new messages