Skip to main content
added 50 characters in body; edited tags; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Transfering Outputting bookmarks in TXT file from ArcMap to QGISusing ArcPy

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any otheranother way to transfer bookmarks from ArcMap so that they are suitable to be read by QGIS?

Transfering bookmarks from ArcMap to QGIS

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any other way to transfer bookmarks from ArcMap to QGIS?

Outputting bookmarks in TXT file from ArcMap using ArcPy

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there another way to transfer bookmarks from ArcMap so that they are suitable to be read by QGIS?

moved code to a separate answer
Source Link
CreekGeek
  • 389
  • 1
  • 13

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any other way to transfer bookmarks from ArcMap to QGIS?

Added 6-May 2021

Working from @PolyGeo's answer, here's some code that gets the info out of Arc:

import arcpy

srcPath = "D:\\SomeFolder\\Data\\"
srcFile = "MyMap.mxd"


# set working mxd
mxd = arcpy.mapping.MapDocument(srcPath+srcFile)

out_lst = []

# list frames within mxd
for df in arcpy.mapping.ListDataFrames(mxd,"*"):
    for bkmk in arcpy.mapping.ListBookmarks(mxd, "", df):
        e = bkmk.extent
        out_lst.append([bkmk.name.encode("utf-8"), e.XMin,e.YMin,e.XMax,e.YMax,df.rotation,df.scale])


with open(srcPath + "file.txt", "w") as output:
    output.write(str(out_lst))

Will jump into PyQGIS next.

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any other way to transfer bookmarks from ArcMap to QGIS?

Added 6-May 2021

Working from @PolyGeo's answer, here's some code that gets the info out of Arc:

import arcpy

srcPath = "D:\\SomeFolder\\Data\\"
srcFile = "MyMap.mxd"


# set working mxd
mxd = arcpy.mapping.MapDocument(srcPath+srcFile)

out_lst = []

# list frames within mxd
for df in arcpy.mapping.ListDataFrames(mxd,"*"):
    for bkmk in arcpy.mapping.ListBookmarks(mxd, "", df):
        e = bkmk.extent
        out_lst.append([bkmk.name.encode("utf-8"), e.XMin,e.YMin,e.XMax,e.YMax,df.rotation,df.scale])


with open(srcPath + "file.txt", "w") as output:
    output.write(str(out_lst))

Will jump into PyQGIS next.

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any other way to transfer bookmarks from ArcMap to QGIS?

added working code
Source Link
CreekGeek
  • 389
  • 1
  • 13

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any other way to transfer bookmarks from ArcMap to QGIS?

Added 6-May 2021

Working from @PolyGeo's answer, here's some code that gets the info out of Arc:

import arcpy

srcPath = "D:\\SomeFolder\\Data\\"
srcFile = "MyMap.mxd"


# set working mxd
mxd = arcpy.mapping.MapDocument(srcPath+srcFile)

out_lst = []

# list frames within mxd
for df in arcpy.mapping.ListDataFrames(mxd,"*"):
    for bkmk in arcpy.mapping.ListBookmarks(mxd, "", df):
        e = bkmk.extent
        out_lst.append([bkmk.name.encode("utf-8"), e.XMin,e.YMin,e.XMax,e.YMax,df.rotation,df.scale])


with open(srcPath + "file.txt", "w") as output:
    output.write(str(out_lst))

Will jump into PyQGIS next.

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any other way to transfer bookmarks from ArcMap to QGIS?

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor.

What is the file structure of an ArcGIS Place File? suggests it may not be possible to access content directly and probably requires ArcObjects to extract bookmark info.

Is there any other way to transfer bookmarks from ArcMap to QGIS?

Added 6-May 2021

Working from @PolyGeo's answer, here's some code that gets the info out of Arc:

import arcpy

srcPath = "D:\\SomeFolder\\Data\\"
srcFile = "MyMap.mxd"


# set working mxd
mxd = arcpy.mapping.MapDocument(srcPath+srcFile)

out_lst = []

# list frames within mxd
for df in arcpy.mapping.ListDataFrames(mxd,"*"):
    for bkmk in arcpy.mapping.ListBookmarks(mxd, "", df):
        e = bkmk.extent
        out_lst.append([bkmk.name.encode("utf-8"), e.XMin,e.YMin,e.XMax,e.YMax,df.rotation,df.scale])


with open(srcPath + "file.txt", "w") as output:
    output.write(str(out_lst))

Will jump into PyQGIS next.

added 13 characters in body; edited tags; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Source Link
CreekGeek
  • 389
  • 1
  • 13
Loading