Author Topic: KML imports but no line work?  (Read 3885 times)

Dave M

  • Jr. Member
  • **
  • Posts: 40
KML imports but no line work?
« on: February 08, 2010, 10:49:26 pm »
I have a KML file that I need to open in MAPub. The file opens fine in Google Earth but when I use the MAPub import I all Iget is an empty Map View (no line work shows up on the art board, no new layers).

What is the correct work-flow for opening a KML in MAPub?

KML attached for reference.

Thanks,
David Medeiros

kimi

  • Avenza
  • Administrator
  • Hero Member
  • *****
  • Posts: 245
  • Avenza Systems Inc.
    • Avenza Systems Inc.
Re: KML imports but no line work?
« Reply #1 on: February 09, 2010, 11:32:58 am »
Hi, Dave! Thank you so much for posting your KML file.
We are now looking into this.  I will post a new message when any update information becomes available!

Best regards,
Kimi
***************************
Avenza Systems Inc.
http://www.avenza.com

kimi

  • Avenza
  • Administrator
  • Hero Member
  • *****
  • Posts: 245
  • Avenza Systems Inc.
    • Avenza Systems Inc.
Re: KML imports but no line work?
« Reply #2 on: February 09, 2010, 11:44:46 am »
Note from our developer ---

Its not the problem I thought it was, since you're using a network link! I wasn't sure if anyone was using that ability of the reader so I'm at least happy to see someone is trying to leverage it wink.gif

I had a big response typed out here to explain why it wasn't working and then I realized what the problem is -- there's a bug where its not reading the html entities correctly. Unfortunately, if you convert them (in this case, & to &) they'll just cause the libkml portion to complain they're not formatted correctly (which is true).

The only good news is that this is already fixed internally. There was a dependency problem with the method I was using to fetch the network'd KML so they switched that part to a different library, and from what I see that one handles the html entities properly. The bad news is I don't see how to fix this with the current build. We only ever tested it with direct links to external KML files since we didn't have a server process anywhere serving up KML files -- so we never tried it with parameters. I'm definitely going to hang on to this file and add it to our test suite!

I know that's probably not super comforting, but for now I guess the MAPublisher KML reader only supports links without html entities in them. Unfortunately, this means pretty much any server-generated KML sad.gif MAPublisher 8.3 should have a fix for this, but I'I don't see a workaround in the interim (other than to download the linked KML file and import it directly).

I'm sorry David, I wish I had better news there.
-------------------------------------------------------
***************************
Avenza Systems Inc.
http://www.avenza.com

Dave M

  • Jr. Member
  • **
  • Posts: 40
Re: KML imports but no line work?
« Reply #3 on: February 09, 2010, 01:27:03 pm »
Hi Kimi, thanks. Sorry I didn't get back to you sooner to let you know I posted this issue over at CartoTalk as well. I just replied to Andrew over there.

kimi

  • Avenza
  • Administrator
  • Hero Member
  • *****
  • Posts: 245
  • Avenza Systems Inc.
    • Avenza Systems Inc.
Re: KML imports but no line work?
« Reply #4 on: February 09, 2010, 01:29:45 pm »
No, problem. Andrew mentioned me about the Cartotalk, too!

Thank you, Dave!

Kimi
***************************
Avenza Systems Inc.
http://www.avenza.com

kimi

  • Avenza
  • Administrator
  • Hero Member
  • *****
  • Posts: 245
  • Avenza Systems Inc.
    • Avenza Systems Inc.
Re: KML imports but no line work?
« Reply #5 on: February 09, 2010, 01:50:49 pm »
Hello, Dave! There was a workaround... Please take a look at below:
Hi, Dave and everyone. This will work with MAPublisher 8.2 or any earlier version of MAPublisher.

-------
Suggested workaround: Obtain the KML data from the original source (see below)

1) Open the KML file in the notepad / text editor
2) Use the Find and Replace function. You will have to replace the "amp;" to "&"
3) After the find and replace function is performed for all "amp;", select the http link in the file.
4) Open an Internet browser and paste the copied HTTP link to the address bar. You will be asked to save or open the file from the link. I saved it on my Desktop.
5) When importing the directly downloaded KML file to MAPublisher, you now have the arts imported successfully.

(Please take a look at the screeshot for step 1, 2, 3, adn 5 if it helps :) )

I hope this will work for your KML files.. :)

Best regards,
Kimi
***************************
Avenza Systems Inc.
http://www.avenza.com