简体   繁体   English

如何通过OSM Tiles在Java应用程序中创建地图?

[英]How to create a map in Java Application from OSM Tiles?

I am trying to create a map of one city in my Java Application. 我正在尝试在Java应用程序中创建一个城市的地图。 I have been able to do this with the Geotools library but only shapefiles have been mapped. 我已经可以使用Geotools库执行此操作,但是仅映射了shapefile。 I am trying to be able to map OSM data as well. 我也试图映射OSM数据。 I have already downloaded the OSM tiles needed to create the map. 我已经下载了创建地图所​​需的OSM磁贴。 Does anyone know how I can use these tiles to be mapped in my Java App? 有谁知道我如何使用这些图块在Java App中进行映射? I have looked into PostGIS but I am only a beginner and it is complicated for me to understand. 我已经研究过PostGIS,但我只是一个初学者,对我来说理解起来很复杂。

You should build your stack for osm : 您应该为osm构建堆栈:

  1. PostGIS PostGIS的
  2. GeoServer GeoServer的
  3. OpenStreerMap in a Box - for data import to PostGIS and Geoserver styles & stuff 盒子中的OpenStreerMap-用于将数据导入到PostGIS和Geoserver样式和内容
  4. GeoTools for rendering and spatial stuff or Open Layers for Web Applications. 用于渲染和空间填充的GeoTools或Web应用程序的开放层 There is also an Open Layers for GWT library available. 还有一个GWT开放层

There is a lot of knowledge involved and once you make up your mind on what you want to do I will be happy to answer your further questions (Desktop vs Web App, your own rendering, etc...). 涉及很多知识,一旦您决定要做什么,我将很乐意回答您进一步的问题(台式机与Web应用程序,您自己的呈现等)。 You should start by reading the tutorial on how to import your osm data in PostGres, and then try to configure GeoServer to use the imported data (by using the tools provided by the kind guys at OSM in a Box). 您应该先阅读有关如何在PostGres中导入osm数据的教程,然后尝试配置GeoServer以使用导入的数据(通过使用Box中OSM的同伴提供的工具)。 The you can render your data by using the industry standard WMS/WFS. 您可以使用行业标准WMS / WFS呈现数据。

mapsforge项目是一个基于Java的库,用于绘制嵌入到应用程序中的OSM地图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM