Is there any way to modify a map's coordinate system in ArcGIS Pro using Python?
Define Projection or the Project tool are your options ... what are you looking to modify?
I need to read the map objects spatialReference properties. Picture that it's 2019 and Esri have GIS Software where you can't read spatial reference of a map.
aprx_object = arcpy.mp.ArcGISProject(aprx)
m = aprx_object.listMaps()
for mp in m:
ID = 0
mapname = mp.name
mp_projection = mp.spatialReference() #
My guess is you know you can already manually make the change
Specify a coordinate system—Properties of maps | ArcGIS for Desktop
(I think if you have a default basemap with a different spatial reference, that will also change to the basemaps spatial reference as default....one way to change it)
as Dan asked, what are you looking to modify? And to add, are you trying to do this once, or on-the-fly. Remember that all your layers may need to be reprojected on the fly as well.
some links to look at
Output Coordinate System (Environment setting)—Geoprocessing | ArcGIS for Desktop
Using the spatial reference class—ArcPy Get Started | ArcGIS for Desktop
Specify a coordinate system—Properties of maps | ArcGIS for Desktop
Rebecca Strauch, GISP & Dan_Patterson, sorry I meant change the spatial reference for either an arcpy.mp.Map or arcpy.mp.MapFrame.
According to bixb0012, looks like it's not possible. If that's true, that's a shame. It will be hard to come up with a Python-based workaround for that limitation.
add an empty data frame, add a layer in the coordinate system you want... the dataframe coordinate system is now set... add/copy your other layers over and remove the 'seed' layer... done... depends how hard you need to have it done
Pro doesn't have data frames. Do you mean a Map? The only way I see to programmatically create a new map is to call the arcpy.mp.ArcGISProject.importDocument() function. However, that would require you to have an mxd pre-authored for any coordinate system the user might want to change to. Then you'd still have to copy over all the existing layers into the new map. Also, if the map had already been used in a MapFrame in a Layout, then you'd really run into some issues...
Unlike most ArcPy modules, ArcPy Mapping (arcpy.mp) had to be rewritten from the ground up since the UI and structure of ArcGIS Pro is completely different than ArcMap. They will be playing catch up for quite some time, which is why it is important for people to open enhancement requests and create ArcGIS Ideas. There is a lot to port over from ArcMap to ArcGIS Pro, and without user feedback, Esri is left to either do what is easiest first or guess at what users want.
OK, vote me up!
https://community.esri.com/ideas/12767