当前位置:网站首页>Various utilization forms of map tile data and browsing display of tile data

Various utilization forms of map tile data and browsing display of tile data

2022-06-10 01:26:00 nanke_ yh

    in the light of 【 Personally practice the Google Maps slice that you can download url Address 】 Google maps data download attempt and Python Reptile implementation A friend asked in the comment area ‘ Can the downloaded tile data be displayed in ArcGIS Use directly on ’ The problem of , Describe the relevant utilization methods .

First, engineering , After getting the tile data , It is mainly used for the base map background of map software . Then it will be hit tar package , And then access through software in the mobile terminal .

hit tar package

1、windows:

If there is Git Can be directly in Git Bash Here Inside, it is packaged through the command line ;

         It can also be done through 7-ZipPortable Tool packing , open exe Then select the file to package / Folder , The right choice 7-zip-> Add to compressed package , choice tar that will do .

WINDOWS Next use 7z Compression generation tar.gz package - Let's have a look (zoukankan.com)

2、Linux:

Package directly on the terminal through commands ;

tar Packing command (linux)_ pressure cooker _1220 The blog of -CSDN Blog _tar pack

command :tar -cvf < Package file name .tar> < Files that need to be packaged >

for example :tar -cvf satellite.tar satellite

         It's over tar After package , It can be placed on the corresponding terminal ( Like mobile phone. ) Browse map data through the developed map software .

And then through tomcat Browse through the service distribution form . This is also the focus of this article .

1、 Put the downloaded image on the server tomcat Under the webapps Under the folder , Then start tomcat( ./catalina.sh run)

2、 This can be done directly in the virtual machine / Start in the server tomcat, It can also be started by remote connection .

For the download method of Google tile map, see :【 Personally practice the Google Maps slice that you can download url Address 】 Google maps data download attempt and Python Reptile implementation _nanke_yh The blog of -CSDN Blog _ Google maps data download

For detailed operations of remote connection to the server, please refer to :【 Step by step to pass the pass 】windows This machine passes through xftp/xshell Connection connection Ubuntu Virtual machine server _nanke_yh The blog of -CSDN Blog

3、 And then html Upper use openlayers To load offline images , Through service requests url by :

http://localhost:8080/satellite/{z}/{x}/{y}.png

Then open it directly html File can browse the map .

Tile map data display effect demonstration

Here, we will mainly demonstrate the effect of loading tiles through remote connection ( Remote meeting , Then direct access will be ):

1、 Open on host Xshell, Then set up the server , Mainly IP Address and port number , Server user name and password ;

2、 Connect to server , use cd The command navigates to the... Where the tile data is placed tomcat The folder bin Under the folder ;

3、 Input ./catalina.sh run start-up tomcat;

4、 After starting , We can go through url To get the tile data in the server :

Here we need to pay attention to , Because the server is accessed through remote connection , that url Medium localhost The server needs to be replaced ip Address .

5、 It can also be done by writing html Access all tile datasets :

Inside html Inside, it mainly calls openlayers, Let it load the offline map :

<script src="js/ol.js"></script>

The important thing is to be in body Define a map block :

<div id="myposition"></div><!-- Point coordinates display -->
<div id="map"></div>

Then use it directly ol The functions in the are used to load tile data . 

    // Create map 
    var map = new ol.Map({
        view: new ol.View({
            center: centerPos,// The center of the map 
            minZoom:1,
	    	maxZoom:20,
	    	zoom: 5// Map initial level 
        }),
		//extent: fullExtent,
		controls: ol.control.defaults().extend([mousePositionControl]),
        target: 'map'
    });

	var offlineSource =  new ol.source.XYZ({
            url:'http:// The server IP Address :8080/satellite/{z}/{x}/{y}.png',			
            projection: 'EPSG:3857',
      });
	  
    // ol.source.XYZ Add layers of Tile Map 
    var tileLayer = new ol.layer.Tile({
	    source: offlineSource
    });

    map.addLayer(tileLayer);// Add to map Inside 
原网站

版权声明
本文为[nanke_ yh]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206100102219473.html

随机推荐