谷歌地图怎样测量城市面积

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了谷歌地图怎样测量城市面积相关的知识,希望对你有一定的参考价值。

Google Earth 提供了多个用于测量距离和估算面积的工具,但是不同的版本所能使用的工具不一样,视不同情况你可以使用的测量工具有:

Line:直线 , 所有版本的 Google Earth 都支持使用直线来测量,直接是连接两个点的图形,测量结果是两点之间的直线距离。
Path: 曲线 , 同样也适用于所有版本的 Google Earth ,它是连接两个或多个点之间非闭合的图形,测量结果是所有连接点所组成的曲线之间的距离。
Polygon: 多边形 , 仅适用于 Google Earth Pro 版本,它是连接至少三个点之间的闭合图形,测量结果是该图形的周长和面积。
Circle: 圆 , 仅适用于 Google Earth Pro 版本,它的测量结果是该圆的周长、半径以及面积。

修改和重定位几何图形 :当你在 3D 视图里定义好一个几何图形后,你可以通过拖动的方式改变它的位置或范围,要实现这一点,请先打开这个几何形状的“ Ruler ”编辑框,然后当你鼠标移动到该图形时就会变成一个手状的图标,这意味着你可以拖动了。对于圆,你可以点击圆心并拖动到新的位置,对于曲线和多边形, Google Earth 是依据各点设定的先后顺序连线而成的,所以要改变它的形状,必须在原有两点之间插入新点, Google Earth 会自动连接并形成新的图形,但增加新点时要注意,请先选中这两个点之中先创建的那个点,否则会从最后一点连到新添加的点。
删除选中的点: 如果你希望移除某曲线或多边形上的一个点,请先选中该点,然后按下键盘上的“Backspace”键。
删除选中的图形 :先在「Places」面板里选中 该图形对象,然后点击右键,再在弹出菜单中选择「Delete」。
移除所有图形 :点击测量对话框中的「Clear」按钮,可删除 3D 上的所有测量用的几何图形。
移动视图: 默认情况下,在使用测量工具是,点击并拖动鼠标时,会在 3D 视图上添加一个新的点并随之移动,但若你勾选「Mouse Navigation」,那么这个动作将被用来移动视图。

参考资料:http://www.godeyes.cn/html/2008/08/23/google_earth_51.html

参考技术A iphone或者ipad上有此类的软件,本人用着还可以。。。

如何在谷歌地图API中找到最近的城市

【中文标题】如何在谷歌地图API中找到最近的城市【英文标题】:How to find the nearest cities in Google map API 【发布时间】:2012-07-25 12:14:40 【问题描述】:

我想找到我为example 提供的澳大利亚最近的城市。在此查看示例。我尝试使用 Google API 但没有用。我怎样才能做到这一点。你能帮帮我吗?

代码是

var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

     var request = 
         location: fenway,
         radius: 500,
         types: ['store']
     ;
     var service = new google.maps.places.PlacesService(map);
     service.search(request, callback);

     function callback(results, status) 
         if (status == google.maps.places.PlacesServiceStatus.OK) 
             for (var i = 0; i < results.length; i++) 
                 var lat = results[i].geometry.location.lat();
                 var geocoder = new google.maps.Geocoder();
                 var lng = results[i].geometry.location.lng();
                 var latlng = new google.maps.LatLng(lat, lng);
                 geocoder.geocode(
                     'latLng': latlng
                 , function (result, status1) 
                     if (status == google.maps.GeocoderStatus.OK) 
                         if (result[1]) 
                             console.log(result[1]);
                         
                      else 
                         alert("Geocoder failed due to: " + status1);
                     
                 );

             
         
     

我想靠近城市,而不是商店等。我必须找到澳大利亚的郊区,靠近我给的郊区

【问题讨论】:

我添加了我尝试过的代码。你有什么建议吗? 之前也被问过很多次了:***.com/… 【参考方案1】:

我编写了一个代码 sn-p,通过结合 Google Maps Geocoding APIGeoNames.org API(除了 strong>file_get_contents 你也可以发出 cURL 请求)。

/*
 * Get cities based on city name and radius in KM
 */

// get geocode object as array from The Google Maps Geocoding API
$geocodeObject = json_decode(file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?address=CITY NAME,COUNTRY CODE'), true);

// get latitude and longitude from geocode object
$latitude = $geocodeObject['results'][0]['geometry']['location']['lat'];
$longitude = $geocodeObject['results'][0]['geometry']['location']['lng'];

// set request options
$responseStyle = 'short'; // the length of the response
$citySize = 'cities15000'; // the minimal number of citizens a city must have
$radius = 30; // the radius in KM
$maxRows = 30; // the maximum number of rows to retrieve
$username = 'YOUR USERNAME'; // the username of your GeoNames account

// get nearby cities based on range as array from The GeoNames API
$nearbyCities = json_decode(file_get_contents('http://api.geonames.org/findNearbyPlaceNameJSON?lat='.$latitude.'&lng='.$longitude.'&style='.$responseStyle.'&cities='.$citySize.'&radius='.$radius.'&maxRows='.$maxRows.'&username='.$username, true));

// foreach nearby city get city details
foreach($nearbyCities->geonames as $cityDetails)

    // do something per nearby city

请注意您的请求数量,因为 API 有限

有关 API 的更多信息,请访问以下网址:

https://developers.google.com/maps/documentation/geocoding/intro#GeocodingResponses http://www.geonames.org/export/web-services.html

【讨论】:

一个 7 年的旧帖子仍然新鲜的 btt 地理名称的洞察力是获得附近城市的最准确的服务

以上是关于谷歌地图怎样测量城市面积的主要内容,如果未能解决你的问题,请参考以下文章

城市范围内的限制标记android谷歌地图

离线谷歌地图API的开发笔记

如何在谷歌地图API中找到最近的城市

谷歌地图怎么使用

怎么使用谷歌地图

获取用户国家和城市名称并在谷歌地图上定位