Add more shapefile point type tests - one should be failing due to #1193

This commit is contained in:
Dane Springmeyer 2012-12-05 18:40:18 -08:00
parent bb72e0e2d6
commit e62aa47f44
25 changed files with 47 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
PROJCS["NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-79.0],PARAMETER["Standard_Parallel_1",34.33333333333334],PARAMETER["Standard_Parallel_2",36.16666666666666],PARAMETER["Latitude_Of_Origin",33.75],UNIT["Foot_US",0.3048006096012192]]

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
PROJCS["NAD_1983_HARN_StatePlane_North_Carolina_FIPS_3200_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-79.0],PARAMETER["Standard_Parallel_1",34.33333333333334],PARAMETER["Standard_Parallel_2",36.16666666666666],PARAMETER["Latitude_Of_Origin",33.75],UNIT["Foot_US",0.30480060960121924]]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

View file

@ -0,0 +1 @@
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.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

View file

@ -0,0 +1 @@
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.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]

Binary file not shown.

Binary file not shown.

View file

@ -70,6 +70,45 @@ if 'shape' in mapnik.DatasourceCache.plugin_names():
eq_(feat['NUMERIC'],32) eq_(feat['NUMERIC'],32)
eq_(feat['DATE'],'20121202') eq_(feat['DATE'],'20121202')
# created by hand in qgis 1.8.0
def test_shapefile_point2d_from_qgis():
ds = mapnik.Shapefile(file='../data/shp/points/qgis.shp')
eq_(len(ds.fields()),2)
eq_(ds.fields(),['id','name'])
eq_(ds.field_types(),['int','str'])
eq_(len(ds.all_features()),3)
# ogr2ogr tests/data/shp/3dpoint/ogr_zfield.shp tests/data/shp/3dpoint/qgis.shp -zfield id
def test_shapefile_point_z_from_qgis():
ds = mapnik.Shapefile(file='../data/shp/points/ogr_zfield.shp')
eq_(len(ds.fields()),2)
eq_(ds.fields(),['id','name'])
eq_(ds.field_types(),['int','str'])
eq_(len(ds.all_features()),3)
def test_shapefile_multipoint_from_qgis():
ds = mapnik.Shapefile(file='../data/shp/points/qgis_multi.shp')
eq_(len(ds.fields()),2)
eq_(ds.fields(),['id','name'])
eq_(ds.field_types(),['int','str'])
eq_(len(ds.all_features()),1)
# pointzm from arcinfo
def test_shapefile_point_zm_from_arcgis():
ds = mapnik.Shapefile(file='../data/shp/points/poi.shp')
eq_(len(ds.fields()),7)
eq_(ds.fields(),['interst_id', 'state_d', 'cnty_name', 'latitude', 'longitude', 'Name', 'Website'])
eq_(ds.field_types(),['str', 'str', 'str', 'float', 'float', 'str', 'str'])
eq_(len(ds.all_features()),17)
# copy of the above with ogr2ogr that makes m record 14 instead of 18
def test_shapefile_point_zm_from_ogr():
ds = mapnik.Shapefile(file='../data/shp/points/poi_ogr.shp')
eq_(len(ds.fields()),7)
eq_(ds.fields(),['interst_id', 'state_d', 'cnty_name', 'latitude', 'longitude', 'Name', 'Website'])
eq_(ds.field_types(),['str', 'str', 'str', 'float', 'float', 'str', 'str'])
eq_(len(ds.all_features()),17)
if __name__ == "__main__": if __name__ == "__main__":
setup() setup()
[eval(run)() for run in dir() if 'test_' in run] [eval(run)() for run in dir() if 'test_' in run]