Collections.sort sorting two methods for list

2023-01-23   ES  

Overview:

When I saw the map of echarts, I felt that I could do something, but I have been implemented by rice. Recently, I just used it. I studied research. I added custom Geojson data to ECharts to realize the map display of data.

Geojson data generation:

There are many ways to generate

Geojson data, and two ways are introduced here: 1. Direct conversion through GDAL; 2. Generate through Geoserver.

1, via GDAL

can be generated by GDAL for reference articlesGDAL’s Java environment configuration and convert SHP to JSON

2, via Geojson

Select Geojson in the layer preview, as shown below.

display implementation:

Implementation code is as follows:

<! Doctype html> 
 <head> 
     <meta charset = "utf-8"> 
     <Title> ECharts </Title> 
     <Style> 
         html, body,#main { 
             padding: 0px; 
             margin: 0px; 
             height: 100%; 
             overflow: hidden; 
         } 
     </style> 
 </head> 
 <body> 
 <!-Prepare a DOM--> DOM--> 
 <div ID = "main"> </div> 
 <!-Echarts single file introduction-> 
 <script src = "../../ plugin/echart/build/dist/echarts.js"> </script> 
 <script src = "../../ plugin/jquery/jquery-1.8.3.js"> </script> 
 <script type = "text/javascript"> 
     Require.config ({{ 
         Paths: { 
             echarts: '../../plugin/echart/build/dist' 
         } 
     }); 
     Require (Require ( 
             
                 'echarts', 
                 'echarts/chart/map' 
             ],,, 
             function (EC) { 
                 // Based on the prepared DOM, initialize the ECharts chart 
                 var mychart = ec.init (document.GetelementByid ('main')); 
                 varlingmap = { 
                     "China": "PROVINCE", 
                     "Provincial capital": "Capital" 
                 }; 
                 var maptype = []; 
                 var mapgeodata = request ('eCharts/Util/Mapdata/Params'); 
 for (varling in cityMap) { 
                      Maptype.push (city); 
                      // Custom extension chart type 
                      mapgeodata.params [city] = { 
                          getGeojson: (function (c) { 
                              var geojsonname = cityMap [C]; 
                              Return function (callback) {{ 
                                  $ .getjson ('Data/' + GeojsonName +'.geojson ', callback); 
                              } 
                          }) (City) 
                      } 
                 } 
                 var option = { 
                     series: [[[[[ 
                         {{ 
                             name: 'CHINA MAP', 
                             type: 'map', // map type 
                             Maptype: 'China', 
                             SelectedMode: 'Single', // Select type, 
                             Roam: TRUE, // Mouse rolling wheels 
                             HOVERABLE: false, // The mouse is highlighting 
                             itemStyle: {{ 
                                 normal: { 
                                     borderWidth: 1, 
                                     borderColor: '#cccccc', 
                                     Color: '#F3F3F3', 
                                     label: {{ 
                                         show: false, 
                                         textstyle: {{ 
                                             color: '#ff0000' 
                                         } 
                                     } 
                                 }, 
                                 EMPHASIS: {// is also selected style 
                                     borderWidth: 1, 
                                     borderColor: '#00ffff', 
                                     color: '#fffffff', 
                                     label: {{ 
                                         show: true, 
                                         textstyle: {{ 
                                             color: '#ff0000' 
                                         } 
                                     } 
                                 } 
                             }, 
                             Data: [] 
                         } 
                     ] 
                 }; 
                 // Load data for ECharts objects 
                 MyChart.setOption (Option); 
             } 
     ); 
 </script> 
 </body>

Implementation The effect is as follows:

—————————————————————————————————————

Technical blog

http://blog.csdn.NET/gisshixisheng

Online tutorial

http://edu.csdn.Net/course/detail/799
Github

https://github.com/lzugis/

Contact information

q       q:1004740957

e-mail:[email protected]

Public account: lzugis15

Q Q group: 452117357 (webgis)
             337469080(Android)

source

Related Posts

Algorithm Getting Started “Two Meeting” Simple 04 -leetcode 1346. Check whether the integer and two times the number exists

Cats (4) -Play the free program operation result, Stacking Monadic Result Typestiger

Record a lot of errors in YOLOV5

OPENCV3 Implements a picture of a picture into multiple images

Collections.sort sorting two methods for list

Random Posts

GetlastinputInfo failed

c ++ stack stack usage brief description

Core Technology (Volume 2) 02, Chapter 1-Regular expression

assume y takes value if self.w is none: #If w is empty, the random initial one # lazily initialize w Self.w = 0.001 * np.random.randn (dim, num_classes) # Run stochastic gradient descent to optimize w loss_history = [] for it in range (num_iters): X_batch = None y_batch = None # ***** start of your code (do not delete/model this line) ***** Indices = np.arenge (num_train) #First of all define an array with a size of the training set Indices_result = np.sort (np.random.choice (indices, batch_size, replace = false)) #Randomly grabs BATCH_SIZE 行 引 引 i i i i i i i i i i i i i i i i # X_BATCH = x [Indices_result] #From the complete training concentration, the row data corresponding to the above indexing ground index is placed in X_BATCH Y_BATCH = y [Indices_result]#Tag the line data extracted by the corresponding line # ***** End of your code (do not delete/model this line) ***** # Evaluate Loss and Gradient Loss, Grad = Self.loss (x_batch, y_batch, reg) loss_history.append (loss) # Perform parameter update # ***** start of your code (do not delete/model this line) ***** Self.w = Self.w -Learning_rate*Grad#update gradient # ***** End of your code (do not delete/model this line) ***** if Verbose and IT % 100 == 0: Print (‘Iteration %d / %d: loss %f’ %(it, num_iters, loss)) Return Loss_history

TOMCAT Apache-Tomcat-8.5.60 \ CONF \ Web.xml file configuration instructions