I've got following exception when tried geocoding for a POI (searched for "test"):
---
Info > Downloading http://lbs.nutiteq.ee/cloudmade/geocode_kml.php?out=kml&near=56%2E298538N%2C%2043%2E981704E&t=l&q=test&lang=ru&cat=&max=20&gzip=no
Debug > Connection opened in 972
Debug > Response NOT packed based on first 2 data bytes
java.lang.NumberFormatException: empty String
at java.lang.FloatingDecimal.readJavaFormatString(+29)
at java.lang.Double.parseDouble(+4)
at com.nutiteq.kml.KmlReader.parseWgsCoordinatesForPoint(+36)
at com.nutiteq.kml.KmlReader.readPoint(+35)
at com.nutiteq.kml.KmlReader.readPlace(+88)
at com.nutiteq.kml.KmlReader.read(+62)
at com.nutiteq.kml.KmlReader.dataRetrieved(+82)
at com.nutiteq.services.GeocodingService.dataRetrieved(+83)
at com.nutiteq.task.RetrieveNetworkReourceTask.streamOpened(+110)
at com.nutiteq.net.DefaultDownloadStreamOpener.openInputStream(+319)
at com.nutiteq.net.DefaultDownloadStreamOpener.openInputStream(+8)
at com.nutiteq.task.RetrieveNetworkReourceTask.execute(+159)
at com.nutiteq.task.RetrieveNetworkReourceTask.execute(+16)
at com.nutiteq.task.TaskWorker.executeTask(+146)
at com.nutiteq.task.TaskWorker.run(+82)
java.lang.ArrayIndexOutOfBoundsException
at com.nutiteq.kml.KmlReader.readPoint(+36)
at com.nutiteq.kml.KmlReader.readPlace(+88)
at com.nutiteq.kml.KmlReader.read(+62)
at com.nutiteq.kml.KmlReader.dataRetrieved(+82)
at com.nutiteq.services.GeocodingService.dataRetrieved(+83)
at com.nutiteq.task.RetrieveNetworkReourceTask.streamOpened(+110)
at com.nutiteq.net.DefaultDownloadStreamOpener.openInputStream(+319)
at com.nutiteq.net.DefaultDownloadStreamOpener.openInputStream(+8)
at com.nutiteq.task.RetrieveNetworkReourceTask.execute(+159)
at com.nutiteq.task.RetrieveNetworkReourceTask.execute(+16)
at com.nutiteq.task.TaskWorker.executeTask(+146)
at com.nutiteq.task.TaskWorker.run(+82)
Debug > KmlReader done
Debug > Response read in 334
---
My apps gets null when calling KmlPlace.getWGS() for the POI.
May it be caused by empty 'cat' I sent in the request?
Regards,
Mike
Proxy should be fixed now, it seems that cloudmade response had changed a bit, so coordinates were not passed. You must specify cat= value (e.g. cat=cafe) in query to make it work. Query parameter is optional, if you add it then it does additional filtering based on it.
Thanks. Category parameter is actually an integer array, not a string. I can't find info about category types - on cloudmade I see something about object types, not categories (http://developers.cloudmade.com/projects/local-search/examples). Can I get more info somewhere?
Could you provide an example of CloudMadeGeocodingService call for POI? I can't manage that myself, tried several options.
Thanks
When calling
final CloudMadeGeocodingService service =
new CloudMadeGeocodingService(
this, CloudMadeGeocodingService.SERVICE_URL_BASE,
"et", GeoMapComponent.getMiddlePoint(), "cafe",
CloudMadeGeocodingService.SEARCH_TYPE_POI, new int[]{}, 10, false);
I get another problem:
Debug > CloudMade url=http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?&query=cafe&return_location=true
Info > Downloading http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?&query=cafe&return_location=true
Debug > Connection opened in 512
Debug > Response NOT packed based on first 2 data bytes
Debug > found 21 objects
Error > Error in task runner: null
java.lang.NullPointerException
at com.nutiteq.kml.JsonKmlReader.read(+171)
at com.nutiteq.kml.JsonKmlReader.dataRetrieved(+106)
at com.nutiteq.services.CloudMadeGeocodingService.dataRetrieved(+46)
at com.nutiteq.task.RetrieveNetworkReourceTask.streamOpened(+110)
at com.nutiteq.net.DefaultDownloadStreamOpener.openInputStream(+319)
at com.nutiteq.net.DefaultDownloadStreamOpener.openInputStream(+8)
at com.nutiteq.task.RetrieveNetworkReourceTask.execute(+159)
at com.nutiteq.task.RetrieveNetworkReourceTask.execute(+16)
at com.nutiteq.task.TaskWorker.executeTask(+146)
at com.nutiteq.task.TaskWorker.run(+82)
Debug > TW: create new worker
Can't comment this issue, as meanwhile we have updated CloudMadeGeocodingService to be as close to full CloudMade service as possible, and this has updated parameter set, see http://www.nutiteq.com/beta/lib/javadoc/com/nutiteq/services/CloudMadeGeocodingService.html
This seems to work with query=cafe. However, you probably want to get object type (in our terms: category) cafe, not something with name cafe, so use objectType=cafe
There is one known issue: the service tries to provide also full geometry of found objects, which looks really cool with street or city searches. But if response becomes too large with too complex polygon objects, then we've got also outofmemory situations, e.g. search Florida (state in US, Argentina etc).
Thanks Jaak, that's what I need (I mean objectType parameter). Where can I find the updated CloudMadeGeocodingService class?
Regards,
Mike
nutiteq.com/beta/lib has latest version which should have it. I have not tried with j2me, hopefully obfuscation is ok now.
Dear JaakL
when using the new constructor from CloudMadeGeocodingService from the beta lib, I got the error that I need the token. Can you fix this? the same I think with CloudMadeDirections.
thx in advance
updated in nutiteq.com/beta/lib android and j2me versions
Well, it seems that the proxy is broken for this type of queries.
/JaakL