heremaps/here-location-services-python

get_weather_alerts faulty default value for width

DeemanOne opened this issue · 3 comments

If i dont set the width value, i get the following response:
ApiError: 400, Bad Request, {"status":400,"title":"Invalid Request","code":"E611302","cause":"Maximum width is 25000, from request = 50000","action":null,"correlationId":null}

The default value for width should be set to 25000 I guess.

sackh commented

@DeemanOne Thank you for reporting this. but the default value of width 50000 seems to be working for me. Will you please share all the parameters you are passing to method get_weather_alerts. It will be great if you could share the code snippet you are trying.

Sure, the following code reproduces the error:
here_api.get_weather_alerts(LineString(rev),weather_type=dest_weather_config.WEATHER_TYPE.air_quality,weather_severity=dest_weather_config.WEATHER_SEVERITY.insignificant,start_time=datetime.datetime.now())
where rev is: [[8.310961, 53.17764], [8.52653, 53.05768], [9.03649, 53.02307], [9.62167, 52.81372], [9.88487, 52.42911], [10.4348, 52.33265], [11.03672, 52.22743], [11.8283, 52.22543], [12.81583, 52.33333], [13.17951, 52.39597], [13.40415, 52.51961]]
Another bug i discovered is using the .to_geojson method on the response object. It throws an exception for me. Also I think it is unneeded, as the response seems to be in geojson format anyways. Maybe the reason is that there is no weather alert found?
Also, if the width of 50000 is correct, why is there an ApiError which says that the maximum width is 25000?

sackh commented

This is fixed in #23. The maximum width supported for Point geometry is 100000, while for LineString geometry is only 25000. Checks have been put in place to ensure this.