我需要什么才能在 iPhone 应用程序中找到澳大利亚议会地图边界?

发布于 2024-10-20 04:51:08 字数 158 浏览 2 评论 0原文

澳大利亚大约有 600 个议会。我需要弄清楚如何在我的 iPhone 应用程序中为它们创建边界,以便当用户位于某个区域时,应用程序将知道用户所在的议会。

但是,我可能可以从议会获得很多此类信息我需要询问什么信息?边界信息足够吗?那么我的开发人员应该如何使用它呢?

谢谢,

There are probably about 600 councils in Australia. I need to work out how to create boundaries for them all within my iPhone application so that when a user is in a certain area the application will know which council the user is in.

I probably can get a lot of this information from councils, however what information would I need to ask for? Is boundary information enough? And then how should my developer use that?

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄凉少年不暖心 2024-10-27 04:51:08

听起来你问的是如何定义议会的边界。一般来说,一个议会(或国家,或任何其他地理区域)的边界可以通过一系列有序的纬度、经度对来定义,这些纬度、经度对代表地球表面上的点;边界是连接它们的线。

这样的一系列可能看起来有点像下面这样:

Region 1:
    64.222, 41.135
    64.161, 41.143
    64.114, 41.080
    ...
Region 2:
    64.114, 41.080
    64.008, 41.090
    64.008, 40.902
    ...

给定这样一系列的边界点,有已建立的算法来确定给定点是否在该区域内(如果您好奇,可以阅读它们 此处)。我不确定是否有更有效的算法来确定一个点位于多个区域中的哪一个,但这需要您的开发人员来弄清楚。

It sounds like what you're asking about is how to define the boundary of a council. Generally the boundary of a council (or country, or any other geographic region) can be defined by an ordered series of latitude, longitude pairs which represent points on the surface of the Earth; the border is the line that connects them.

Such a series might look a bit like the following:

Region 1:
    64.222, 41.135
    64.161, 41.143
    64.114, 41.080
    ...
Region 2:
    64.114, 41.080
    64.008, 41.090
    64.008, 40.902
    ...

Given such a series of border points there are established algorithms for determining whether a given point is within the region (if you're curious you can read about them here). I'm not sure whether there are more efficient algorithms for determining which of several regions a point is in, but that's for your developer to figure out.

雪落纷纷 2024-10-27 04:51:08

我将分别回答您的两个问题:

1. 在哪里可以获得澳大利亚的议会地图边界?

澳大利亚统计局以 ESRI Shapefile 和 MapInfo 格式发布此数据。这些区域被称为“地方政府区域”。 2010 年数据集可在 http 上获取://www.abs.gov.au/AUSSTATS/[电子邮件受保护]/DetailsPage/1259.0.30.001July%202010?OpenDocument

2. 如何使用地理空间数据?

ESRI Shapefile 格式几乎可以被所有空间数据包读取。不过,我有一些最喜欢的:

在客户端我最喜欢的库是GDAL,一个具有 X/MIT 风格开源许可证的翻译器库。它带有 C、C++、Python 和 C# 绑定。或者,如果这太重量级,您可能更愿意直接使用 Shapelib,GDAL 使用的 MIT 许可的 C 库。

在服务器端你不能超越PostGIS。如果您要将纬度/经度对发送到 Web 服务器,请考虑为 postgresql 服务器安装这些空间扩展。您可以使用捆绑的 shp2pgsql 实用程序将 shapefile 加载到数据库中。然后,要找到 LGA,您的纬度/经度对属于查询数据库,如下所示:

SELECT * FROM lga2010
  WHERE ST_Intersects(lga2010.the_geom,
                      ST_SetSRID(ST_MakePoint(your_longitude, your_latitude),4326))

I'll answer your two questions separately:

1. Where do I get council map boundaries for Australia?

The Australian Bureau of Statistics publish this data in ESRI Shapefile and MapInfo format. The areas are known as "Local Government Areas". The 2010 data set is available at http://www.abs.gov.au/AUSSTATS/[email protected]/DetailsPage/1259.0.30.001July%202010?OpenDocument

2. How do I use geospatial data?

The ESRI Shapefile format can be read by pretty much every spatial data package under the sun. I have some favourites however:

On client side my favourite library is GDAL, a translator library with an X/MIT style Open Source license. It comes with C, C++, Python and C# bindings. Or if this is too heavyweight, you might prefer to directly use Shapelib, an MIT licensed C library used by GDAL.

On the server side you can't go past PostGIS. If you are sending your latitude/longitude pair to a web server, consider installing these spatial extensions for the postgresql server. You can load a shapefile into the database using the bundled shp2pgsql utilty. Then, to find the LGA your lat/lon pair fall into query the database like this:

SELECT * FROM lga2010
  WHERE ST_Intersects(lga2010.the_geom,
                      ST_SetSRID(ST_MakePoint(your_longitude, your_latitude),4326))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文