XY-resolution changed when exporting data

260
1
11-12-2018 03:54 AM
LisaKunz
New Contributor

Hi,

I'm using ArcMap 10.5 and arcpy and I observe the following: I have a Layer in an ArcMap Document. I'm trying to export this Layer by using arcpy.CopyFeatures_management() . Doing so changes the 1/(XY-Resolution)-value in the string, that one receives when calling the exportToString() - method of the spatialReference-Object, to 10000. So for example:

Let's assume we have a Layer "someLayer" loaded in ArcMap. Calling

arcpy.Describe('someLayer').spatialReference.exportToString()

gives me:

u"PROJCS['MGI_Austria_GK_Central',GEOGCS['GCS_MGI',DATUM['D_MGI',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',-5000000.0],PARAMETER['Central_Meridian',13.33333333333333],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5622500 -15001000 450314931,243925;-100000 10000;-100000 10000;0,001;0,001;0,001;IsHighPrecision"‍

which is what I would like to have in the end as 450314931,243925 is the original 1/(XY-Resolution) - value of the projection (third value after the WKT). ArcMap seems to use German decimal separators (',') here instead of points -btw. However when I continue with

arcpy.CopyFeatures_management("someLayer", 'D:\test.shp')

and calling afterwards

arcpy.Describe('someLayer').spatialReference.exportToString()

returns:

u"PROJCS['MGI_Austria_GK_Central',GEOGCS['GCS_MGI',DATUM['D_MGI',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',-5000000.0],PARAMETER['Central_Meridian',13.33333333333333],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5622500 -15001000 10000;-100000 10000;-100000 10000;0,001;0,001;0,001;IsHighPrecision"‍

So the value 450314931,243925 changed to 10000. With other words the spatialReference object of the original Layer-Object is obviously changed. When I delete the Layer in the TOC and reload it, I get the original string with the original reciprocal value. This is even true for the exported data, so when loading the Shape-File in the TOC everything seems ok. However reloading is not a feasible workaround for me as I use the exportToString() - method for comparing projections in a bigger automatic workflow with no user interaction. I already tried to export to a FeatureClass in a gdb, however I have the same problem when doing so. Anyone any idea what's going on here? What am I missing?

0 Kudos
1 Reply
NeilAyres
MVP Alum

As for this :

ArcMap seems to use German decimal separators (',') here instead of points -btw. 

That's your windows settings, nothing to do with ArcMap.

The decimal separator is quite deeply buried in Date & Time, Regional settings, Advanced or something like that.

0 Kudos