Convert S57 data to SHP format using ogr2ogr

Source: Internet
Author: User

S57 chart data contains a large number of layers. Currently, ArcMap is one of the necessary GIS software, therefore, the SHP format may be easier to process (the convenience here is only the most common and widely used SHP for some people, in fact, I personally think the bad thing about SHP is that it is a bit uncomfortable to have multiple files in one data file ). Therefore, you may need to convert S57 data into SHP data. The following describes how to use the ogr2ogr tool provided by gdal for conversion.

First, we use ogrinfo to view the layer and other information contained in the S57 data, because this information is required for subsequent conversion. 1.

Figure 1 layer contained in S57 data

After understanding the layers contained in the S57 data, you can use the ogr2ogr tool to convert the layers in S57 to the SHP data. The command line is as follows:

 
C: \ gdal \ bin> ogr2ogr.exe-F "ESRI shapefile" D: \ s57polygon. shp d: \ S57 \ c1100102.000 Area
Figure 2 Use ogr2ogr to convert to SHP format

It can be seen that the attribute values in stringlist and integerlist formats cannot be returned in the SHP Data Attribute Table. Others are correct.

Today, I also found a problem. The same S57 data and the same gdal database experienced exceptions on my computer. In S57, there are actually 25 layers. For example, it is right to open the data using qgis, as shown in 3, but I only have 5 layers to view using gdalinfo, as shown in 1, however, this data is displayed on another computer with 25 layers consistent with that on qgis. The cause of this problem is not found yet and will be investigated later. At present, it is generally possible to read 25 layers into 5 layers. It seems that the classification is a DSID, with four layers: point, line, surface, and metadata. That is, 25 layers are reclassified by layer type, which can be verified by the data transferred from Figure 2.

Figure 3 Number of layers displayed in S57 opened by qgis

Use qgis to open figure 2, convert the surface data into SHP, and load all the surface data of S57. As shown in figure 4, there is a big difference between the two, but I read 25 layers from my company's computer, and then turn one to OK.

Figure 4 load SHP data display Profile

Figure 5 load S57 surface data display Profile

............................................................ Split line... 2013-07-13 .................................................................................

In the preceding section, the data layers of S57 are changed to five. The reason is that the gdal_data directory is not set. InProgramUse the followingCodeThe layer of S57 can be read.

 
Cplsetconfigoption ("gdal_data", "C: \ warmerda \ BLD \ data ");

If you use the ogrinfo command line tool, you can also add the following parameters to the command line tool.

 
-- Config gdal_data c: \ warmerda \ BLD \ data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.