Python urce is now widely used by many people. Why is Python urce used more and more? The following articles describe the advantages of Python urce related operations. The following is a detailed introduction of the article. I hope you will gain some benefits.
Advantages
1. Free, suitable for individuals and small companies
2. Powerful development tools make it easier to find bugs
3. cross-platform, windows and linux
4. Pull the wind!
1. OGR vector Library: Simple vector data read/write, is part of GDAL
2. GDAL geospatial data abstraction database:
A) Read and Write Raster Data
B) ArcGIS is also developed based on GDAL.
C) C ++ library, but can be called using python
Python urce modules
1. Numeric: High-Speed array processing, especially important for raster data
2. NumPy: the next generation of Numeric
3. More powerful gis database import and export:
- import ogr
Or:
- from osgeo import ogr
The omnipotent method is:
- try:
- from osgeo import ogr
- except:
- import ogr
To read data of a certain type, you must first load the data driver, that is, initialize an object to let Python urce "know" A data structure.
- import ogr
- driver = ogr.GetDriverByName(‘ESRI Shapefile’)
-
The data-driven driver's open () method returns more than one data source object, which is an introduction to Python urce.