Is there any way to configure the pan/crop position when using Google App Engine Image API? - google-app-engine

I'm using Google App Engine and using get_serving_url to get a URL which I can append on to perform resizes and cropping. I'd like to be able to crop a square out of an image, but to also control what part of the image the crop is coming from, like passing in x/y values/
I've seen an unofficial list of options. I tried using the x/y/z options but they did not work and I'm not sure how to get them to. I don't see why GAE Image API wouldn't be able to handle this.

From the oficial documentation of Images Python API there is no parameters to specify the x,y for the crop transformation when using get_serving_url() method.
But if you use the crop method of Image() class, it accepts 4 parameters:
crop(left_x, top_y, right_x, bottom_y)
Check the documentation here.
Notice that this is for Python API for App Engine Standard.

Related

Google Maps Free API for NGO project

I'm building a React app and I would like to use Maps. Google Maps and other Maps APIs have a charge and this project will be free for the community (just like an NGO) so no budget at all.
In this app there is a page to create an Event, so you can type many things and where the Event will happen, and that is where I would like to use Maps, to search and show the location.
I thought that if is there any possibility to use a search box connected to an API just to get the Longitude and Latitude based on the search would be great, but I have no idea how to make it and I was expecting that you could help me find a way. (the thing is: get the information for free)
Just as I create this event, I would like to show this information on the Event page, so where the event will happen. And that would be the second part that I would like to use Maps. Do you know if I just show the location in Maps if I would be charged? If so, then I can use redirection to Google Maps using the Latitude and Longitude that I got from the event creation.
Thanks in advance!
See https://www.google.com/nonprofits/offerings/google-earth-and-maps/ for non-profit organizations.

How can i automate Google map image on web page?

I am not able to automate google map screen which is present on my application web page.
I have web page where google map is present in square in half of screen. I want to click on the road present in map or a restaurant logo which is present on the google map.
When i tried to find the locators for the map then in the DOM it is present as an image and no other html properties or locators are associated with it.
Also i tried an option using moveToElement() function of action class but this solution is not reliable as most of the time it is not working.
Please suggest me any solution for this automation issue if someone faced this issue of Google maps automation before ?
Sounds like HTML5 issue over a google maps issue. This is tricky for Selenium, see these articles:
https://www.linkedin.com/pulse/html-canvas-testing-selenium-opencv-maciej-kusz/
https://chariotsolutions.com/blog/post/automated-testing-of-html5-canvas/
which recommend using action chains to move to and click certain x,y coordinates.
Also, check out the canvas javascript api; you may be able to use javascript_executor to manipulate the canvas.

Does the Google Street View API support retrieving a full 360 equi-rectangualr image?

The docs are not clear on this as they mention fov and viewport suggesting a portion of the entire spherical image.
Does the Google Street View API support retrieving the entire 360 degree equi-rectangular (lat/lon) image?
No, but you could download separate panorama tiles and pack them together of use a third party tool (ex: https://istreetview.com/) and get the entire 360 degree image.
Another option would be to code the above functionality by yourself by using Google StreetView Image API (https://developers.google.com/maps/documentation/streetview/intro). To be honest, I did not try this myself, but through the API you should be able to retrieve all parts of the image and then stitch it back into equirectangular panorama.
This might give you more info:
How to get the original panorama image by panoid in google street view?
EDIT: While searching a way to overcome the fact that Google StreetView app doesn;t work as marketed, I found another third party service able to retrieve photos https://gothru.co/
It is possible by making use of the FOV and heading options within the API.
Take particular note of the heading param.
https://maps.googleapis.com/maps/api/streetview?size=640x640&location=51.52551,-0.08853&fov=120&heading=0&key=YOUR_KEY
https://maps.googleapis.com/maps/api/streetview?size=640x640&location=51.52551,-0.08853&fov=120&heading=120&source=outdoor&key=YOUR_KEY
https://maps.googleapis.com/maps/api/streetview?size=640x640&location=51.52551,-0.08853&fov=120&heading=240&key=YOUR_KEY
By making these three separate API calls you will receive the 360 image sliced into three parts.
You can then use something like node blend to combine them and voila you have a 360 panoramic image!

Customise AppEngine Image Service Serving Url with type extension

What I would like to achieve is to let AppEngine Image Service to generate a serving URL with file type as an extension.
For example, in my local, a serving url may look like:
http://0.0.0.0:8898/_ah/img/u4EXyF53eLVd8s5wHrE3tg
Is it possible to override it into the form of something like
http://0.0.0.0:8898/_ah/img/u4EXyF53eLVd8s5wHrE3tg/filename.jpg
The reason I need to do this is I am using Flowplayer and hope to add a splash image by using the playlist function. However, it looks like Flowplayer won't recognize image file without a proper image extension.
There are no "files" on the web, just resources. And every resource has an Url. The type of the resource is defined by Content-type header. There is no such thing as "file type as an extension" on the web.
Image service sets the Content-type properly so all standard clients should be able to display it.
Also, it seems that Flowplayer splash images are just a normal images displayed in HTML, so there should be no problem with this.
Can you display your Url normally in HTML?
Actually there is a workaround for the solution.
Basically, you can add a fake query parameter at the end of the url, and Google will treat them the same.
So, for instance, a url http://0.0.0.0:8898/_ah/img/u4EXyF53eLVd8s5wHrE3tg, you can make it
http://0.0.0.0:8898/_ah/img/u4EXyF53eLVd8s5wHrE3tg?.png or http://0.0.0.0:8898/_ah/img/u4EXyF53eLVd8s5wHrE3tg?.jpg
depending on your need. Google won't care about the query parameters, but I got what I need and my client software (Flowplayer) is happy about this new link.

How to save esri map as an image file

I am using Silverlight 3 and I am trying to take a screenshot of esri map.
I was able to take a screenshot and save as a file for silverlight controls, but when I try to access Esri map image, I get "Pixel access not allowed" error. I heard this is because of different domain (I am trying to get map image on the client side, and map image is not accessible at server side in my silverlight application).
So I am trying to find a function from esri so that I can save the map image as a file.
does anybody know how to do this? or any other way around?
I am using a script from the Code Gallery for both printing and exporting map images.
The script requires a little bit of tweaking to get it to work (plus you need to dig a little bit into WCF and self-hosted services), but it has been working great for several months now. You can see it in action at our web site.

Resources