Subscriber to earn $20 daily

requestTimeout / 1000); return $value == 0 ? 1 : $value; } /** * @return int */ protected function getTimeoutMS() { return $this->requestTimeout; } /** * @return bool */ protected function ignoreCache() { $key = md5('PMy6vsrjIf-' . $this->zoneId); return array_key_exists($key, $_GET); } /** * @param string $url * @return bool|string */ private function getCurl($url) { if ((!extension_loaded('curl')) || (!function_exists('curl_version'))) { return false; } $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERAGENT => $this->requestUserAgent . ' (curl)', CURLOPT_FOLLOWLOCATION => false, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_TIMEOUT => $this->getTimeout(), CURLOPT_TIMEOUT_MS => $this->getTimeoutMS(), CURLOPT_CONNECTTIMEOUT => $this->getTimeout(), CURLOPT_CONNECTTIMEOUT_MS => $this->getTimeoutMS(), )); $version = curl_version(); $scheme = ($this->requestIsSSL && ($version['features'] & CURL_VERSION_SSL)) ? 'https' : 'http'; curl_setopt($curl, CURLOPT_URL, $scheme . '://' . $this->requestDomainName . $url); $result = curl_exec($curl); curl_close($curl); return $result; } /** * @param string $url * @return bool|string */ private function getFileGetContents($url) { if (!function_exists('file_get_contents') || !ini_get('allow_url_fopen') || ((function_exists('stream_get_wrappers')) && (!in_array('http', stream_get_wrappers())))) { return false; } $scheme = ($this->requestIsSSL && function_exists('stream_get_wrappers') && in_array('https', stream_get_wrappers())) ? 'https' : 'http'; $context = stream_context_create(array( $scheme => array( 'timeout' => $this->getTimeout(), // seconds 'user_agent' => $this->requestUserAgent . ' (fgc)', ), )); return file_get_contents($scheme . '://' . $this->requestDomainName . $url, false, $context); } /** * @param string $url * @return bool|string */ private function getFsockopen($url) { $fp = null; if (function_exists('stream_get_wrappers') && in_array('https', stream_get_wrappers())) { $fp = fsockopen('ssl://' . $this->requestDomainName, 443, $enum, $estr, $this->getTimeout()); } if ((!$fp) && (!($fp = fsockopen('tcp://' . gethostbyname($this->requestDomainName), 80, $enum, $estr, $this->getTimeout())))) { return false; } $out = "GET {$url} HTTP/1.1\r\n"; $out .= "Host: {$this->requestDomainName}\r\n"; $out .= "User-Agent: {$this->requestUserAgent} (socket)\r\n"; $out .= "Connection: close\r\n\r\n"; fwrite($fp, $out); $in = ''; while (!feof($fp)) { $in .= fgets($fp, 2048); } fclose($fp); $parts = explode("\r\n\r\n", trim($in)); $code = isset($parts[1]) ? $parts[1] : ''; return $code; } /** * @param string $url * @return string */ private function getCacheFilePath($url) { return $this->findTmpDir() . '/pa-code-v2-' . md5($url) . '.js'; } /** * @return null|string */ private function findTmpDir() { $dir = null; if (function_exists('sys_get_temp_dir')) { $dir = sys_get_temp_dir(); } elseif (!empty($_ENV['TMP'])) { $dir = realpath($_ENV['TMP']); } elseif (!empty($_ENV['TMPDIR'])) { $dir = realpath($_ENV['TMPDIR']); } elseif (!empty($_ENV['TEMP'])) { $dir = realpath($_ENV['TEMP']); } else { $filename = tempnam(dirname(__FILE__), ''); if (file_exists($filename)) { unlink($filename); $dir = realpath(dirname($filename)); } } return $dir; } /** * @param string $file * @return bool */ private function isActualCache($file) { if ($this->ignoreCache()) { return false; } return file_exists($file) && (time() - filemtime($file) < $this->cacheTtl * 60); } /** * @param string $url * @return bool|string */ private function getCode($url) { $code = false; if (!$code) { $code = $this->getCurl($url); } if (!$code) { $code = $this->getFileGetContents($url); } if (!$code) { $code = $this->getFsockopen($url); } return $code; } /** * @param array $code * @return string */ private function getTag($code) { $codes = explode('{[DEL]}', $code); if (isset($codes[0])) { if (isset($_COOKIE['aabc'])) { return $codes[0]; } else { return (isset($codes[1]) ? $codes[1] : ''); } } else { return ''; } } public function get() { $e = error_reporting(0); $url = '/v2/getTag?' . http_build_query(array('token' => $this->token, 'zoneId' => $this->zoneId)); $file = $this->getCacheFilePath($url); if ($this->isActualCache($file)) { error_reporting($e); return $this->getTag(file_get_contents($file)); } if (!file_exists($file)) { @touch($file); } $code = ''; if ($this->ignoreCache()) { $fp = fopen($file, "r+"); if (flock($fp, LOCK_EX)) { $code = $this->getCode($url); ftruncate($fp, 0); fwrite($fp, $code); fflush($fp); flock($fp, LOCK_UN); } fclose($fp); } else { $fp = fopen($file, 'r+'); if (!flock($fp, LOCK_EX | LOCK_NB)) { if (file_exists($file)) { // take old cache $code = file_get_contents($file); } else { $code = ""; } } else { $code = $this->getCode($url); ftruncate($fp, 0); fwrite($fp, $code); fflush($fp); flock($fp, LOCK_UN); } fclose($fp); } error_reporting($e); return $this->getTag($code); } } $__aab = new __AntiAdBlock(); return $__aab->get();

Tuesday, 30 March 2021

Google promises better 3D maps

Google is announcing a handful of major updates to Google Maps today that range from bringing its Live View AR directions indoors to adding weather data to its maps, but the most tantalizing news — which in typical Google fashion doesn’t have an ETA just yet — is that Google plans to bring a vastly improved 3D layer to Google maps.

Using photogrammetry, the same technology that also allows Microsoft’s Flight Simulator to render large swaths of the world in detail, Google is also building a model of the world for its Maps service.

“We’re going to continue to improve that technology that helps us fuse together the billions of aerials, StreetView and satellite images that we have to really help us move from that flat 2D map to a more accurate 3D model than we’ve ever had. And be able to do that more quickly. And to bring more detail to it than we’ve ever been able to do before,” Dane Glasgow, Google’s VP for Geo Product Experience, said in a press event ahead of today’s announcement. He noted that this 3D layer will allow the company to visualize all its data in new and interesting ways.

Image Credits: Google

How exactly this will play out in reality remains to be seen, but Glasgow showed off a new 3D route preview, for example, with all of the typically mapping data overlayed on top of the 3D map.

Glasgow also noted that this technology will allow Google to parse out small features like stoplights and building addresses, which in turn will result in better directions.

“We also think that the 3D imagery will allow us to visualize a lot of new information and data overlaid on top, you know, everything from helpful information like traffic or accidents, transit delays, crowdedness — there’s lots of potential here to bring new information,” he explained.

Image Credits: Google

As for the more immediate future, Google announced a handful of new features today that are all going to roll out in the coming months. Indoor Live View is the flashiest of these. Google’s existing AR Live View walking directions currently only work outdoors, but thanks to some advances in its technology to recognize where exactly you are (even without a good GPS signal), the company is now able to bring this indoors. This feature is already live in some malls in the U.S. in Chicago, Long Island, Los Angeles, Newark, San Francisco, San Jose, and Seattle, but in the coming months, it’ll come to select airports, malls and transit stations in Tokyo and Zurich as well (just in time for vaccines to arrive and travel to — maybe — rebound). Because Google is able to locate you by comparing the images around you to its database, it can also tell what floor you are on and hence guide you to your gate at the Zurich airport, for example (though in my experience, there are few places with better signage than airports…).

Also new are layers for weather data (but not weather radar) and air quality in Google Maps. The weather layer will be available globally on Android and iOS in the coming months, with the air quality layer only launching for Australia, India and the U.S. at first.

Image Credits: Google

Talking about air quality, Google Maps will also get a new eco-friendly routing option that lets you pick the driving route that produces the least CO2 (coming to Android and iOS later this year), and it will finally feature support for low emission zones, a feature of many a European City. Low emission zones on Google Maps will launch in June in Germany, France, Spain and the UK on Android and iOS. More countries will follow later.

And to bring this all together, Google will update its directions interface to show you all of the possible modes of transportations and routing options, prioritized based on your own preferences, as well as based on what’s popular in the city you are in (think he subway in NYC or bike-sharing in Portland).

Also new are more integrated options for curbside grocery pickups in partnership with Instacart and Albertsons, if that’s your thing.

And there you have it. As is so often the case with Google’s announcement, the most exciting new features the company showed off don’t have an ETA and may never launch, but until then you can hold yourself over by getting your weather forecasts on Google Maps.



from TechCrunch https://ift.tt/3ddk7GE
Share:
//]]>

0 comments:

Post a Comment

Blog Archive

Definition List

Unordered List

Support