1

Getting POI images and icons using the Remote API -how to?

Тема: Getting POI images and icons using the Remote API -how to?

Hello,
I need to get the POI images and icons for every POI I have.
Can I do this using the Remote API? When I get my POIs as resources I do get values for every field described here:
http://docs.gurtam.com/en/hosting/sdk/w … t/resource
The CRC16 codes contained in the fields "i' and "e" (I suppose they are the icon and the image, respectively) are different than zero, but I wonder how to get the images themselves -I guess I mean their URLs, or even their data.
Is there any way to do this using the Remote API?
Thanks in advance!

2

Getting POI images and icons using the Remote API -how to?

Re: Getting POI images and icons using the Remote API -how to?

To get POI image use request:

http://{host}/avl_poi_image/<sid>/<rid>/<pid>/<max_border>/<i>.png

documentation

Mobile Development
Gurtam
3

Getting POI images and icons using the Remote API -how to?

Re: Getting POI images and icons using the Remote API -how to?

kopa пишет:

To get POI image use request:

http://{host}/avl_poi_image/<sid>/<rid>/<pid>/<max_border>/<i>.png

documentation

Thanks for your reply. In the path you mention above, I assume "sid" means "session ID", right? But then, you say "rid", "pid", "max_border" and "i". Where do I get those values from? Can you please tell me?

FYI, I'm getting the following information back, when I get the POIs. It's not evident guessing how to map these fields to the fields in the path you've offered as an example:

{
    "poi":{
        <text>:{        /* sequence number of a POI */
            "id":<long>,    /* POI ID */
            "n":<text>,    /* POI name */
            "y":<double>,    /* longitude */
            "x":<double>,    /* latitude */
            "t":<double>,    /* image aspect ratio */
            "i":<short>,    /* image CRC16 */
            "e":<ushort>    /* data image CRC16 */
        }
    }
}

Thanks a lot again!

4

Getting POI images and icons using the Remote API -how to?

Re: Getting POI images and icons using the Remote API -how to?

To get POI image:

http://{host}/avl_poi_image/<sid>/<rid>/<pid>/<max_border>/<i>.png

    sid – session ID;
    rid – resource ID;
    pid – POI ID;
    max_border – maximum image size (from 16 to 256; 32 is recommended);
    i – image check sum (crc16).

Return result is an URL with POI image.

http://docs.gurtam.com/en/hosting/sdk/w … _poi_image

Mobile Development
Gurtam
5

Getting POI images and icons using the Remote API -how to?

(08/11/2012 14:08:16 отредактировано zorrow)

Re: Getting POI images and icons using the Remote API -how to?

OK, thanks. I guess we're getting there, but I'm still having some trouble to get all the chunks together and make the whole thing work.

So, while still connected, I got the first POI in my list and composed a URL that looks like this:

http://hosting.wialon.com/wialon/avl_poi_image/ba417a5d364166c98f600224e3214fd2/3/1/32/34476.png

While my session was alive, I tried to hit it and I received a "404 Not Found" anyway.

Then I tried this:

http://hosting.wialon.com/avl_poi_image/ba417a5d364166c98f600224e3214fd2/3/1/32/34476.png

Still received a "404 Not Found".

Then I realized in your documentation here it is said that "Return result is an URL with POI image". So, maybe I should have understood that if it returns something it's because there's a call first, right?

This got me trying something wilder, like trying to create a request to your Ajax service in order to receive the URL back. But no, it didn't work.

So, what seemed obvious (the "{host}" part of the URL) is finally not obvious to me. Can you please help me once again?

BTW, I got the rest of the values in the URL from the right sources. For example, "rid – resource ID" is 3 for POIs. For the rest of them, it was pretty straightforward.

Thanks again in advance!

6

Getting POI images and icons using the Remote API -how to?

Re: Getting POI images and icons using the Remote API -how to?

We have corrected documentation. Now you don't need to specify sid.

Resource flag 0x1 contains "id":<uint>,    /* resource ID */ http://docs.gurtam.com/en/hosting/sdk/w … asic_props
This is a rid (resource ID).

Resource flag 0x800 contains Object of POI's, where each POI contains "id":<long>,    /* POI ID */ http://docs.gurtam.com/en/hosting/sdk/w … 800_-_pois
This is a pid (POI ID).

http://{host}/avl_poi_image/<rid>/<pid>/<max_border>/<i>.png
Return result is a POI image.

http://docs.gurtam.com/en/hosting/sdk/w … _poi_image (updated documentation)

Mobile Development
Gurtam
7

Getting POI images and icons using the Remote API -how to?

Re: Getting POI images and icons using the Remote API -how to?

Well, it does work, though some of my images are shrunk, as the maximum "max_border" I seem to be able to go for is 256.

Also, the field "e" contains another CRC16, and when I tried it, it contains a URL to an image too. Is that an icon? Why two images?

By the way, both images from the fields "e" and "i" look the same to me, even if their names differ.

Thanks again!