带 openmap 的 shapefile

发布于 2024-09-11 21:41:19 字数 81 浏览 3 评论 0原文

我有美国州边界形状文件,我想使用 openmap 从该文件中读取信息 java 的 api。还可以查找给定城市 50 英里范围内的州。 我该怎么做?

I have us state border shape file and I want to read information from that file using openmap
api for java.Also to find the states within 50 miles of a given city.
How can i do it?

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

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

发布评论

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

评论(1

从﹋此江山别 2024-09-18 21:41:19

如果您只想以编程方式检查文件的内容,则可以使用 com.bbn.openmap.dataAccess.shape.EsriGraphicList 从形状文件中读取信息。有一个静态 getGraphicList(...) 方法将加载存储在 dbf 文件中的形状和属性。

如果要显示文件的内容,请使用 com.bbn.openmap.layer.shape.ShapeLayer。

要对形状文件的内容进行空间分析,您需要使用 com.bbn.openmap.geo 包进行一些编程工作:

  1. 创建一个 ExtentIndex,它将是 GeoExtents 的集合。
  2. 从 EsriGraphicList EsriPolygons 创建 GeoRegions,将它们添加到 ExtentIndex。
  3. 为您要测试的城市创建 GeoPoint。
  4. 创建交集,MatchParameters 为 Length.MILE.toRadians(50)。
  5. 调用 Intersection.considerPointXRegions(GeoPoint, ExtentIndex);
  6. 调用 Intersection.getCollector().iterator() 获取结果。

If you just want to inspect the contents of the file programmatically, you can read the information from the shape files using a com.bbn.openmap.dataAccess.shape.EsriGraphicList. There is a static getGraphicList(...) method that will load the shapes and the attributes stored in the dbf file.

If you want to display the contents of the file, use a com.bbn.openmap.layer.shape.ShapeLayer.

To do spatial analysis on the contents of a shape file, you'll need do to a little programmatic work, using the com.bbn.openmap.geo package:

  1. Create an ExtentIndex, which will be a collection of GeoExtents.
  2. Create GeoRegions from the EsriGraphicList EsriPolygons, add them to the ExtentIndex.
  3. Create GeoPoint for the city you want to test for.
  4. Create Intersection with MatchParameters being Length.MILE.toRadians(50).
  5. Call intersection.considerPointXRegions(GeoPoint, ExtentIndex);
  6. Call intersection.getCollector().iterator() to get results.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文