In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "QT map compilation method to obtain area boundary". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
I. Foreword
The regional boundary is also a set of some coordinate points, and the number of regional boundary point sets obtained by different administrative divisions is different. I think some of them are a set, and a few of them have enclaves and the like, so multiple closed regions are needed, so multiple array sets will be obtained. When drawing, they should be drawn separately.
Obtaining boundary points is generally used in conjunction with administrative divisions. For example, users input the name of a province and city, and then automatically locate the province and city, and then obtain all boundary points for the outline and output them to js files. Finally, they are used offline. Obtaining boundary points also has the function of obtaining latitude and longitude coordinates of the lower left corner and upper right corner of the current area. This is mainly for offline map download. Baidu map provides bdary.get very well.(cityname, function(rs) function to obtain the boundary point set of administrative divisions, where rs.boundaries is the set of all boundary points, estimated that it is the set of each area stored on the server, the query is returned immediately, and it may also be manually circled a little bit in the early stage to save it to the database. In fact, according to this way, a program can automatically dig down all the boundary point set data of all provinces and cities in the country. For offline map use, testing seems to support only to the county level, does not support specific towns.
II. Functional characteristics
Timer queues download the provincial and municipal outline map point coordinate set stored in JS file.
Support multiple irregular area downloads in one administrative area.
Automatically calculates the number of download profiles for administrative regions.
You can accurately select provinces, cities, counties, or directly enter the name of the administrative region.
You can set download intervals, start and stop downloads at any time.
Provide edit boundary function, you can edit the point set of irregular area directly on the map, and then get the boundary point set data, this can be used to draw the area to get the data, such as a certain town or even a certain district administrative area data, very awesome.
III. Experience address
Experience address: pan.baidu.com/s/1ZxG-oyUKe286LPMPxOrO2A Extraction code: o05q File name: bin_map.zip
Domestic website: gitee.com/feiyangqingyun
International website: github.com/feiyangqingyun
IV. Effect Drawing
void frmMapBoundary::getBoundary(){ //Determine whether the check box of the provincial capital corresponding to the current index is checked. If it is not checked, find the next checked box. int count = names.count(); while (indexMain
< count - 1 && !cks.at(indexMain)->isChecked()) { indexMain++; indexSub = 0; } //Stop timer when index of last provincial capital is reached if (indexMain == count || ! cks.at(indexMain)->isChecked()) { on_btnStop_clicked(); return; } //Download to the last county of the provincial capital, the index automatically jumps to the next provincial capital QStringList list = names.at(indexMain); if (indexSub == list.count()) { indexMain++; indexSub = 0; getBoundary(); return; } QString name = list.at(indexSub); addBoundary(name); indexSub++; //Update progress bar int value = bars.at(indexMain)->value(); bars.at(indexMain)->setValue(value + 1); ui->txtTip->setText(name);}void frmMapBoundary::addBoundary(){ //Open editing status QString name = ui->cboxName->currentText(); addBoundary(name, true);}void frmMapBoundary::addBoundary(const QString &name, bool edit){ currentName = name; QString js = QString("addBoundary('%1', true, %2)").arg(name).arg(edit ? "true" : "false"); runJs(js);}void frmMapBoundary::saveBoundary(const QString &fileName, const QVariant &data){ //The coordinates of boundary points of administrative divisions are transmitted and stored in js file. //There may be multiple data, such as Kinmen Island in Taiwan, all of which are independent regional shapes and stored in arrays. QStringList boundarys; QStringList list = data.toString().split("|"); foreach (QString points, list) { boundarys
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.