## Your code:
##
## import arcpy
## import glob
##
##
## inFCFolder = "C:\Data"
## def projectToWebM():
## for f in glob.glob(r""+ inFCFolder + "\*.shp"):
## try:
## arcpy.Project_management(f, f + r"\Project\*.shp","PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]]","#","GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]")
## except:
## print 'Error: Unable to project ' + f
##
## if __name__== '__main__':
## projectToWebM()
# I would suggest something like this:
import arcpy
import glob
import os
# Normally the '\' character is an escape character, so you will need to use the
# r'C:\Data' raw string format, or use 'C:\\Data' to get a "backslash" in your string
# literal.
#
# See: http://docs.python.org/reference/lexical_analysis.html#literals
inFCFolder = r'C:\Data'
def projectToWebM():
for f in glob.glob(inFCFolder + r'\*.shp'):
try:
# Let arcpy create a scratch name, and use os.path.basename to transfer part
# of the original file name to the new file name.
scratch_name = arcpy.CreateScratchName('wm_' + os.path.basename(f).replace('.shp', '') + '_', \
'', \
'Shapefile', \
inFCFolder)
# To make it simple, I'm outputting the new projected shapefiles to the same
# directory that they came from (guaranteed to exist). It looks like you will
# want to put them in the "Project" folder from looking at your code. Also,
# if your data is already projected (as in has a defined spatial reference),
# you don't need to specify a fifth "in_coor_system" parameter.
arcpy.Project_management(f, scratch_name, \
r"PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere'," + \
r"GEOGCS['GCS_WGS_1984'," + \
r"DATUM['D_WGS_1984'," + \
r"SPHEROID['WGS_1984',6378137.0,298.257223563]]," + \
r"PRIMEM['Greenwich',0.0]," + \
r"UNIT['Degree',0.0174532925199433]]," + \
r"PROJECTION['Mercator_Auxiliary_Sphere']," + \
r"PARAMETER['False_Easting',0.0]," + \
r"PARAMETER['False_Northing',0.0]," + \
r"PARAMETER['Central_Meridian',0.0]," + \
r"PARAMETER['Standard_Parallel_1',0.0]," + \
r"PARAMETER['Auxiliary_Sphere_Type',0.0],"+ \
r"UNIT['Meter',1.0]]")
except:
print 'Error: Unable to project ' + f
if __name__== '__main__':
projectToWebM()
Since you work with data for Berlin, I do not believe that the second shapefile is DHDN_Soldner_Berlin. I assume the right coordinate system is EPSG 3045 - ETRS89/UTM zone 33 (N-E).
Try to use Define Projection Tool (not Project Tool!) and overwrite the coordinate system information with is EPSG 3045 - ETRS89/UTM zone 33 (N-E) (the name my differs in ArcGIS).
Reasons why I assume EPSG 3045 - ETRS89/UTM zone 33 (N-E) is the right system:
Typical coordinates (DHDN_Soldner_Berlin) for the area of Berlin should fall in this range (about):
- min x: 3,000
- max x: 49,000
- min y: 2,000
- max y: 38,000
The coordinates of your second shapefile did not fit to this extend. So your second shapefile is not DHDN_Soldner_Berlin.
But what is the right coordinate system?
Berlin is surrounded by Brandenburg. In Brandenburg UTM 33 is used.
The extent of Berlin in UTM 33 is about:
- min x: 370,000 (or 3,370,000 or 33,370,000
- max x: 416,000 (or 3,416,000 or 33,416,000)
- min y: 5,800,000
- max y: 5,837,000
Your coordinates fall in this range.
There are 3 different UTM 33 systems in use which only differs in false easting resulting in x coordinates with 6, 7 or 8 digits.
For your data EPSG 3045 - ETRS89/UTM zone 33 (N-E) which uses a false easting of 500,000 fits best (6 digits x-coordinate).
Best Answer
I think you guys are overthinking this one...