Commit 37469311 authored by Kris Vanneste's avatar Kris Vanneste
Browse files

Added 'out_srs' argument to get_data method of GisData.

git-svn-id: 40b490c5-b4d9-47cb-8714-9bef99b524d5
parent 8d1a419e
......@@ -17,6 +17,7 @@ except:
import numpy as np
import ogr
from mapping.geotools.coordtrans import WGS84
from .base import BasemapData
from .point import PointData, MultiPointData
from .line import LineData, MultiLineData
......@@ -91,7 +92,7 @@ class GisData(BasemapData):
return read_gis_file_attributes(self.filespec)
def get_data(self, point_value_colnames=None, line_value_colnames=None,
polygon_value_colnames=None, layer_num=None):
polygon_value_colnames=None, layer_num=None, out_srs=WGS84):
Read GIS records, transforming into LayeredBasemap data types
......@@ -107,6 +108,11 @@ class GisData(BasemapData):
:param layer_num:
int, layer number to read
(default: None)
:param out_srs:
instance of :class:`ogr.SpatialReference`
spatial reference system into which coordinates will be transformed
If None, native spatial reference system will be used
(default: WGS84)
(MultiPointData, MultiLineData, MultiPolygonData) tuple
......@@ -160,7 +166,8 @@ class GisData(BasemapData):
attribute_filter = None
for rec in read_gis_file(self.filespec, layer_num=layer_num,
region=self.region, verbose=self.verbose):
region=self.region, out_srs=out_srs,
selected = np.zeros(len(self.selection_dict.keys()))
for i, (selection_colname, selection_value) in enumerate(self.selection_dict.items()):
if rec[selection_colname] == selection_value:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment