essential Python GIS modules

ESRI provides support for automated mapping of the python modules for python gradually more GIS staff are familiar with, rather than outside the ESRI arcpy need to know, in the course of their work, sometimes it can give us several Python modulesbring a lot of convenience. Here are a few common foreign records. Include: the GDAL, numpy, NetworkX.

GDAL

GDAL is a class library all GISer familiar, we can also see it in the shadow of the ESRI. Especially when our computer does not have any GIS software, this one is when a small GIS tool to use. Another fact, OGR, accustomed to call together. The GDAL responsible reading of raster data, while OGR responsible for reading raster data. The following commonly used examples:Download.

import gdal
from gdalconst import *
# Open the raster dataset
dataset = gdal.Open(filename, GA_ReadOnly)
# Print the projection of the data
print dataset.GetProjection()

numpy

The numerical computation of the time must ultimately numpy, and raster data in operation, this is the lack of。Download

from numpy import *
# Sample IO Table data
ioSample = [[1,2], [3,4]]
# Turn into a numpy array
ioMatrix = array(ioSample)
# Find the inverse of ioMatrix
ioMatrixInv = linalg.inv(ioMatrix)

NetworkX

GIS network analysis is a complex thing, NetworkX is provided based on the python to create, operate, maintain the network management of a class library, we can easily create to manage their own network.Download

import networkx as nx
# Create a graph
g = nx.Graph()
# Populate the graph
g.add_node(1)
g.add_node(2)
g.add_node(3)
# Create edges
g.add_edge(1,2)
g.add_edge(1,3)
# Print the neighbors of node 1 (returns 2)
print g.neighbors(1)

本文固定链接: http://www.higis.org/en/2012/06/04/gis-python-module/ | Hi,GIS


该日志由 H.J 于2012年06月04日发表在 GIS, Program 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: essential Python GIS modules | Hi,GIS
关键字: , , ,

essential Python GIS modules:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter