epsg.py 1.8 KB

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. import subprocess
  3. import sys
  4. import arcpy
  5. # 4326(wg84) --> cgs2000
  6. import importlib, sys
  7. importlib.reload(sys)
  8. sys.setdefaultencoding('utf8')
  9. arcpy.Project_management('D:/test/test.shp', 'D:/test/test4326.shp',
  10. "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433],METADATA['World',-180.0,-90.0,180.0,90.0,0.0,0.0174532925199433,0.0,1262]]",
  11. 'CGCS2000_WGS84',
  12. "PROJCS['CGCS2000_GK_CM_117E',GEOGCS['GCS_China_Geodetic_Coordinate_System_2000',DATUM['D_China_2000',SPHEROID['CGCS2000',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Gauss_Kruger'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',117.0],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]")
  13. arcpy.BatchProject_management(Input_Feature_Class_or_Dataset="E:/99project/demo/4326.gdb/Mian",
  14. Output_Workspace="E:/99project/demo/2000.gdb",
  15. Output_Coordinate_System="GEOGCS['GCS_CGCS_2000',DATUM['D_CGCS_2000',SPHEROID['CGCS_2000',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]",
  16. Template_dataset="", Transformation="")
  17. # cgs2000 --> 4326(wg84)
  18. # arcpy.BatchProject_management(Input_Feature_Class_or_Dataset="E:/99project/demo/2000.gdb/Mian", Output_Workspace="E:/99project/demo/4326.gdb", Output_Coordinate_System="GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", Template_dataset="", Transformation="")