|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /lib64/python2.7/site-packages/django/contrib/gis/gdal/ |
Upload File : |
�
r�\c @ s� d Z d d l m Z d d l m Z d d l m Z d d l m Z m Z d d l
m Z d d l m
Z d d l m Z m Z d d l m Z d d
l m Z d e f d � � YZ d
S( s�
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line file from the government.
The ds_driver keyword is used internally when a ctypes pointer
is passed in directly.
Example:
ds = DataSource('/home/foo/bar.shp')
for layer in ds:
for feature in layer:
# Getting the geometry for the feature.
g = feature.geom
# Getting the 'description' field for the feature.
desc = feature['description']
# We can also increment through all of the fields
# attached to this feature.
for field in feature:
# Get the name of the field (e.g. 'description')
nm = field.name
# Get the type (integer) of the field, e.g. 0 => OFTInteger
t = field.type
# Returns the value the field; OFTIntegers return ints,
# OFTReal returns floats, all else returns string.
val = field.value
i����( t byref( t GDALBase( t Driver( t OGRExceptiont
OGRIndexError( t Layer( t ds( t force_bytest
force_text( t six( t xranget
DataSourcec B sk e Z d Z e e d d � Z d � Z d � Z d � Z d � Z d � Z e
d � � Z e
d � � Z RS(
s Wraps an OGR Data Source object.s utf-8c C s( | r d | _ n d | _ | | _ t j � s= t j � n t | t j � r� t j � } y( t j
t | � | j t | � � } Wq� t
k
r� t
d | � � q� XnC t | | j � r� t | t j � r� | } n t
d t | � � � t | � r| | _ t | � | _ n t
d | � � d S( Ni i s% Could not open the datasource at "%s"s"