Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize provincial hollowed-out Feature production by manually modifying GeoJson files

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to manually modify the GeoJson file to achieve provincial hollowed-out Feature production, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

First, draw a circular Feature with QGIS and save it as GeoJson to see what the data structure of the circular Feature looks like.

Draw a polygon first, right-click to save

Add a ring within the drawn polygon (note: during this period, the edited layer must be selected in the lower left corner, otherwise an error will be reported)

If you don't have this component, right-click the toolbar and check Advanced Digitizing Toolbar.

Export the circle Feature we just drew as GeoJson

Open the GeoJson file you just saved and look at its data structure. It is found that the coordinate arrays of the inner and outer rings of the circular Feature are placed in the coordinates, with the outer ring in front and the inner ring behind:

{"type": "FeatureCollection", "name": "test", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}, "features": [{"type": "Feature" "properties": {"id": 1}, "geometry": {"type": "MultiPolygon" "coordinates": [98.62682583778792,54.32228639928258] [109.40281163615893, 55.957263554897494], [116.64873312127047 55.02829926193448], [117.35474598392236, 52.94741924569732] [114.64217024847035, 51.832662094141696], [112.7842416625443 50.68074637086755], [103.71755016322525, 50.792222086023116] [98.62682583778792, 54.32228639928258]] [[103.9976189834291, 53.8974727328586], [105.91267520881026 51.91148849913], [107.99323012033545, 54.18118476624841] [103.9976189834291 53.8974727328586]}]}] 2. Work on the hollowed-out Inner Mongolia GeoJson

After understanding the GeoJson structure of the circular Feature, we can modify the existing Inner Mongolia region GeoJson to make it hollowed out.

Draw a box with QGIS, be sure to wrap the whole Inner Mongolia into it, and then get the coordinate array of the box. The specific process will not be repeated.

The coordinate array I got here:

[[70.35465968686151, 73.302099634723305], [158.04277887424999, 73.181814148869549], [157.922493388396219, 11.234788934184962], [70.114088715153997, 12.317358306868769], [70.35465968686151, 73.302099634723305]]

Modify the GeoJson file of Inner Mongolia and add the coordinate array obtained in the previous step to the front of the Inner Mongolia boundary coordinate array.

Load the modified GeoJson to see the effect:

On how to manually modify the GeoJson file to achieve provincial hollowed-out Feature production questions are shared here, I hope the above content can be of some help to you, if you still have a lot of doubts have not been solved, you can follow the industry information channel to learn more related knowledge.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report