Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata abstract writen with wrong font #49

Open
maxlebourg opened this issue Jul 10, 2019 · 3 comments
Open

Metadata abstract writen with wrong font #49

maxlebourg opened this issue Jul 10, 2019 · 3 comments

Comments

@maxlebourg
Copy link

maxlebourg commented Jul 10, 2019

Hi there and thank you for your work,

I am using arcpy_metadata to mainly fill the layers' abstract section, this is the part of my code that does the work

if ext == "shp":
    
    metadata = md.MetadataEditor(metadata_file = shp + ".xml")
    title = ""
    metadata.title = title

    if title == old_shp_name:
        metadata.title = shp

    metadata.abstract = MD_ABS
    metadata.save()

NB: arcpy_metadata has been imported as md and MD_ABS is the abstract parameter I fill beforehand

This works most of the time, but sometimes I get the abstract written with the same font as the subtitle Abstract in ArcCatalog as you can see below (French version)
image

while it should be displayed like this
image

I don't understand why at some point it occurs, but when it does looks like I have to reboot to correct this until it comes back again !

Problem (beside the font) : when I try to update the metadata directly from ArcCatalog it crashes every time

Should I add something in my code to prevent the font from changing ?
Any thoughts are very welcome

Thank you again

Max

Edit : I add 2 xml, one good and one evil, to me I don't see any difference but it might help

abstract_font_issue.zip

@nickrsan
Copy link
Member

Hi Max,

Thanks for reporting this - I'm not sure if I think this is an issue with arcpy_metadata's abstract handling yet, but it's possible it is. I'm looking at the XML you sent and not seeing any differences that I think could impact the display. I'd think the primary reason would be invalid XML resulting from the edits, but I'm not seeing anything invalid here. I'll let you know if I see anything

@thomas-maschler
Copy link
Collaborator

Hi Max,

can you add some more information?

  • Which version of ArcGIS Desktop do you use?
  • Do you enter encoded or decoded french special characters? I noticed that in the XML file accents are encoded as é while we don't encode them in arcpy_metadata.
  • Are the attached files the direct output from arcpy_metadata or did you open them in ArcGIS Desktop prior to sending them along?

To clarify, ArcGIS desktop might try to alter the files prior to opening.

Thomas

@maxlebourg
Copy link
Author

Hi to you both and thanks for the time you spend on my request,

here's some precision:

  • I'm using ArcGis desktop 10.5

  • I do not use any encode nor decode in the process, save the magic line at the beginning """ -*- coding: utf-8 -*-, I don't think special characters have to do something with this as I encountered this issue while no special characters were filled in the inputs

  • I did opened these files with ArcCatalog first to see the output

I'm adding the whole code, might help you, the metadata process starts at line 123. Sorry all the comments are in french but the code is quite simple as the first part adds fields then takes on the metadata

Thanks again
Max
Integration_01.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants