Add more shapefile point type tests - one should be failing due to #1193
This commit is contained in:
parent
bb72e0e2d6
commit
e62aa47f44
25 changed files with 47 additions and 0 deletions
BIN
tests/data/shp/points/ogr_zfield.dbf
Normal file
BIN
tests/data/shp/points/ogr_zfield.dbf
Normal file
Binary file not shown.
1
tests/data/shp/points/ogr_zfield.prj
Normal file
1
tests/data/shp/points/ogr_zfield.prj
Normal 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]]
|
BIN
tests/data/shp/points/ogr_zfield.shp
Normal file
BIN
tests/data/shp/points/ogr_zfield.shp
Normal file
Binary file not shown.
BIN
tests/data/shp/points/ogr_zfield.shx
Normal file
BIN
tests/data/shp/points/ogr_zfield.shx
Normal file
Binary file not shown.
BIN
tests/data/shp/points/poi.dbf
Normal file
BIN
tests/data/shp/points/poi.dbf
Normal file
Binary file not shown.
1
tests/data/shp/points/poi.prj
Normal file
1
tests/data/shp/points/poi.prj
Normal 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]]
|
BIN
tests/data/shp/points/poi.shp
Normal file
BIN
tests/data/shp/points/poi.shp
Normal file
Binary file not shown.
BIN
tests/data/shp/points/poi.shx
Normal file
BIN
tests/data/shp/points/poi.shx
Normal file
Binary file not shown.
1
tests/data/shp/points/poi.xml
Normal file
1
tests/data/shp/points/poi.xml
Normal file
File diff suppressed because one or more lines are too long
BIN
tests/data/shp/points/poi.zip
Normal file
BIN
tests/data/shp/points/poi.zip
Normal file
Binary file not shown.
BIN
tests/data/shp/points/poi_ogr.dbf
Normal file
BIN
tests/data/shp/points/poi_ogr.dbf
Normal file
Binary file not shown.
1
tests/data/shp/points/poi_ogr.prj
Normal file
1
tests/data/shp/points/poi_ogr.prj
Normal 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]]
|
BIN
tests/data/shp/points/poi_ogr.shp
Normal file
BIN
tests/data/shp/points/poi_ogr.shp
Normal file
Binary file not shown.
BIN
tests/data/shp/points/poi_ogr.shx
Normal file
BIN
tests/data/shp/points/poi_ogr.shx
Normal file
Binary file not shown.
BIN
tests/data/shp/points/qgis.dbf
Normal file
BIN
tests/data/shp/points/qgis.dbf
Normal file
Binary file not shown.
1
tests/data/shp/points/qgis.prj
Normal file
1
tests/data/shp/points/qgis.prj
Normal 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]]
|
1
tests/data/shp/points/qgis.qpj
Normal file
1
tests/data/shp/points/qgis.qpj
Normal 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"]]
|
BIN
tests/data/shp/points/qgis.shp
Normal file
BIN
tests/data/shp/points/qgis.shp
Normal file
Binary file not shown.
BIN
tests/data/shp/points/qgis.shx
Normal file
BIN
tests/data/shp/points/qgis.shx
Normal file
Binary file not shown.
BIN
tests/data/shp/points/qgis_multi.dbf
Normal file
BIN
tests/data/shp/points/qgis_multi.dbf
Normal file
Binary file not shown.
1
tests/data/shp/points/qgis_multi.prj
Normal file
1
tests/data/shp/points/qgis_multi.prj
Normal 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]]
|
1
tests/data/shp/points/qgis_multi.qpj
Normal file
1
tests/data/shp/points/qgis_multi.qpj
Normal 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"]]
|
BIN
tests/data/shp/points/qgis_multi.shp
Normal file
BIN
tests/data/shp/points/qgis_multi.shp
Normal file
Binary file not shown.
BIN
tests/data/shp/points/qgis_multi.shx
Normal file
BIN
tests/data/shp/points/qgis_multi.shx
Normal file
Binary file not shown.
|
@ -70,6 +70,45 @@ if 'shape' in mapnik.DatasourceCache.plugin_names():
|
|||
eq_(feat['NUMERIC'],32)
|
||||
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__":
|
||||
setup()
|
||||
[eval(run)() for run in dir() if 'test_' in run]
|
||||
|
|
Loading…
Reference in a new issue