In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to analyze GeoJSON file compression, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
GeoJSON is a format that encodes various geographic data structures and is a geospatial information data exchange format based on Javascript object representation. GeoJSON objects can represent geometry, features, or feature sets. GeoJSON supports the following geometric types: points, lines, faces, multipoints, multilines, multifaces, and geometric collections. The features in GeoJSON contain a geometric object and other attributes, and the feature set represents a series of features.
GeoJSON is an extension of json files. When the map data is displayed and transferred to the front end of the web page, more and more GeoJSON data are used, and all kinds of maps can be parsed and displayed directly using GeoJSON files. For point-like data, the amount of coordinates is less, and the amount of data transmitted is OK, but for linear and area-like data, it involves more coordinate information. In many cases, the geometry of a line or surface can reach hundreds or thousands. In this way, the data transferred from the server to the client will have several megabytes or tens of megabytes, and the longer download time will affect the experience of the client.
Data suction (smooth)
In the case of low data accuracy, the space vector can be pumped. There are corresponding functions on Arcmap and QGIS. This operation is to reduce the point data of the space vector and ensure the outline of the space as far as possible, which can also reduce the amount of data of the spatial data.
Data suction function of QGIS
Server data compression (gzip, deflate)
This is on the server side, when the data is transmitted, the data is compressed in advance, and the corresponding data compression header, ex:Content-Encodin:gzip, is added to the data returned to the client. The general browser receives this data header and can parse the data.
Nodejs data compression simple code
Zlib.gzip (_ jsondata, (err, bufferdata) = > {
If (err) throw err
Fs.writeFile ('china.province.json.gz', bufferdata, (err1) = > {
If (err1) throw err1
});
});
Test and compress 5m GeoJSON data, and compress about 2m.
Reduce useless attribute information
The corresponding attribute information of the object can be stored in GeoJSON, which can be deleted if it is not necessary to draw the map, which can reduce the amount of data.
After reading the above, do you have any further understanding of how to parse GeoJSON file compression? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.