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

Many changes (fix bugs, support Labeled Places) #4

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Commits on Oct 23, 2022

  1. PEP8 fixes

    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    0bf687d View commit details
    Browse the repository at this point in the history
  2. Update to use f strings

    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    457f7c7 View commit details
    Browse the repository at this point in the history
  3. Add encoding='utf8'

    UnicodeDecodeError: 'charmap' codec can't decode byte ...
    character maps to <undefined>
    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    e606814 View commit details
    Browse the repository at this point in the history
  4. Comment out sys.stdout

    UnsupportedOperation: detach
    
    Shouldn't be necessary in modern interpreters?
    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    c8f0bd4 View commit details
    Browse the repository at this point in the history
  5. Missing address to None instead of "N/A" string

    So it doesn't display at all
    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    1a55c4b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b4dfbf8 View commit details
    Browse the repository at this point in the history
  7. Use html.escape on titles and addresses

    An address of the form `Avenue U &, E 33rd St` was causing
    ExpatError: not well-formed (invalid token)
    
    Because XML requires it to be encoded as &amp;
    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    41906fa View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2233518 View commit details
    Browse the repository at this point in the history
  9. kml.resetidcounter()

    Each new file was continuing the sequence from the last one
    
    (The Document ID is not affected, though.  Still need to completely
    restart interpreter to make that repeatable from one KML to the next?)
    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    c4e7372 View commit details
    Browse the repository at this point in the history
  10. Add support for Labeled Places.json format

    Saved Places format:
    
    ```json
    {'geometry': {'coordinates': [...], 'type': 'Point'},
     'properties': {'Google Maps URL': '...',
      'Location': {'Address': '...',
       'Business Name': '...',
       'Country Code': 'US',
       'Geo Coordinates': {'Latitude': '...', 'Longitude': '...'}},
      'Published': '2018-05-02T01:46:02Z',
      'Title': '...',
      'Updated': '2018-05-02T01:46:02Z'},
     'type': 'Feature'}
    ```
    
    Labeled Places format:
    
    ```json
    {'geometry': {'coordinates': [...], 'type': 'Point'},
     'properties': {'address': '...',
      'name': 'Home'},
     'type': 'Feature'}
    ```
    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    bfbe590 View commit details
    Browse the repository at this point in the history
  11. Use sys.argv instead of hardcoded filename

    So you can it from the command line
    endolith committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    f49c490 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2022

  1. Names are already URL-encoded, just not addresses?

    Actually neither is true of original .json file.  This must be a Python
    simplekml issue?  Names are already encoded but addresses are not?
    endolith committed Nov 7, 2022
    Configuration menu
    Copy the full SHA
    ebe8f84 View commit details
    Browse the repository at this point in the history