[Liblas-commits] r1333 - branches/1.2/python/tests
liblas-commits at liblas.org
liblas-commits at liblas.org
Sun Aug 2 00:47:12 EDT 2009
Author: hobu
Date: Sun Aug 2 00:47:12 2009
New Revision: 1333
URL: http://liblas.org/changeset/1333
Log:
new test for #134
Modified:
branches/1.2/python/tests/SRS.txt
Modified: branches/1.2/python/tests/SRS.txt
==============================================================================
--- branches/1.2/python/tests/SRS.txt (original)
+++ branches/1.2/python/tests/SRS.txt Sun Aug 2 00:47:12 2009
@@ -1,4 +1,5 @@
>>> from liblas import srs
+ >>> from liblas import point
>>> import liblas
>>> s = srs.SRS()
>>> s.proj4
@@ -59,3 +60,49 @@
True
>>> del f
+
+ >>> f = file.File('../test/data/1.2_3.las',mode='r')
+ >>> f.header.data_offset
+ 438L
+ >>> utm_wkt = """PROJCS["NAD83 / UTM zone 15N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.2572221010002,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","26915"]]"""
+
+ >>> dd_wkt = """GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]"""
+ >>> s_dd = srs.SRS()
+ >>> s_dd.wkt = dd_wkt
+ >>> s_utm = srs.SRS()
+ >>> s_utm.wkt = utm_wkt
+ >>> p = f.read(0)
+ >>> origx, origy = p.x, p.y
+ >>> origx, origy
+ (470692.44, 4602888.9000000004)
+ >>> f.set_srs(s_dd)
+ True
+ >>> p = f.read(0)
+ >>> p.descale(f.header)
+ >>> p.x, p.y
+ (-92.999999999999972, 89.999999999999972)
+ >>> dd_header = f.header
+ >>> dd_header.scale = [0.000001,0.000001,0.000001]
+ >>> dd_header.srs = s_dd
+ >>> f_project = file.File('junk_srs_project.las',mode='w',header=dd_header)
+ >>> dd_header.srs.proj4
+ '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '
+ >>> f_project.write(p);f_project.write(p);f_project.write(p)
+ >>> f_project.close()
+ >>> del f_project
+ >>> f3 = file.File('junk_srs_project.las')
+ >>> f3.header.data_offset
+ 476L
+ >>> s_utm = srs.SRS()
+ >>> s_utm.wkt = utm_wkt
+ >>> p3 = f3.read(1)
+ >>> p3.x, p3.y
+ (-92.999999000000003, 89.999999000000003)
+ >>> p3 = f3.read(0)
+ >>> p3.x,p3.y
+ (-92.999999000000003, 89.999999000000003)
+ >>> import os
+ >>> os.remove('junk_srs_project.las')
+
+
+
\ No newline at end of file
More information about the Liblas-commits
mailing list