Author Topic: Get FileMaker Go to play nicely with PDF Maps  (Read 1722 times)

Otto

  • Newbie
  • *
  • Posts: 6
Get FileMaker Go to play nicely with PDF Maps
« on: September 01, 2012, 02:05:40 pm »
Field scientists often work out of cell phone range.  PDF Maps is an excellent platform for them to use to enter data, letting them export the data later when back in the world of WiFi or cell phones.  (I can post more on this if anyone is interested...)  Filemaker has a free mobile app called FileMaker Go, which permits users to download a database and then access it in the field.   I have developed the following workflow to get the two apps to play well together.  Others may have better ways to do this...

1. Start with a Filemaker Pro 12 database, and set up a calculation field which will combine all of the data you wish from one record.  In my case, I have about 3,000 locations (stops) which NYSGA trips have visited over the years.  There are lots of fields permitting users to search effectively: the number of words in the Description field, the latitude and longitude, etc.  But on PDF Maps placemarks I need only the name, the ID of the stop (which includes the year, trip and stop number), the leader of the trip, and the stop description.

PDF Maps uses the Schema method for Extended Data, so we need to stick some extra text around these fields.  The Calculation field I came up with is:

"      <Placemark>
       <styleUrl>#pdfmaps_style_red</styleUrl>
       <ExtendedData>
        <SchemaData schemaUrl=\"#schema0\">
        <SimpleData name=\"ID\"><![CDATA[" & ID &" ]]></SimpleData>
        <SimpleData name=\"Description\"><![CDATA[" & description & "]]></SimpleData>
        <SimpleData name=\"Leaders\"><![CDATA[" & leader & "]]></SimpleData>
        </SchemaData>
       </ExtendedData>
       <name><![CDATA[" &  name & "]]></name>
       <Point><coordinates>"  & coords & "</coordinates></Point>
      </Placemark>
"

Of course, you should modify this to fit your needs, substituting your names for ID, Description and Leaders, etc.

2. Set up a layout for export which contains only this field.

3.  Import your database into FileMaker Go.

4.  Out in the boondocks, search for whatever placemarks you wish, limiting your search by lat and long to the area of the geo pdf map you wish to use.  Refine your search, if necessary, so that you have fewer than 500 placemarks.  Export your results as a .tab file, using the export layout you made earlier.

5. Use a text editor on your mobile device to modify this .tab file.  I have found Textastic (~$10) to work well. 

  5a.  You need to add the kml header stuff at the beginning.  I have found the following to work with PDF Maps:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
 <Document>
  <Style id="pdfmaps_style_red">
   <IconStyle>
    <Icon>
     <href>http://download.avenza.com/images/pdfmaps_icons/v2/pin-red-inground.png</href>
    </Icon>
    <hotSpot x="9"  y="0" xunits="pixels" yunits="pixels" />
   </IconStyle>
  </Style>
  <Schema name="" id="schema0">
   <SimpleField name="Year" type="string"></SimpleField>
   <SimpleField name="Trip" type="string"></SimpleField>
   <SimpleField name="Leaders" type="string"></SimpleField>
      <SimpleField name="PDFMaps_photos" type="string"><displayName>Photos</displayName></SimpleField>
  </Schema> 

Once again, however, this needs to be adjusted for your values...

  5b.  You need to add the </Document> and </kml> tags at the end.

  5c.  You need to change the file extension from .tab to .kml.   

  5d.  If you have exported fields which contained carriage returns in FileMaker Pro (in my case the Description field often contains these), you will need to find and replace the vertical tabs (\x0b) with returns (\r) with regular expressions enabled.

6.  From your text editor choose "Open in..." and PDF Maps should show up.  Click on it.

7.  In PDF Maps, if the map you wish to use is open, the placemarks should appear.  If not, open it and and the placemarks which were sent from the text editor will be in the "Previously Imported" page.

8.  After the placemarks load, it may be desirable to collect them into a folder and rename the folder with the search terms used in FileMaker Go.



Bear in mind that this is an early effort, just trying to get something that will work in the boondocks.  My database is unique and what works for me may not work for others. 



davida

  • Full Member
  • ***
  • Posts: 58
Re: Get FileMaker Go to play nicely with PDF Maps
« Reply #1 on: September 05, 2012, 03:09:53 pm »
Hello Otto,

We would like to extend a thank you for providing this information on the user forum to the benefit of everyone. It is our intention to review this workflow further.

Otto

  • Newbie
  • *
  • Posts: 6
Re: Get FileMaker Go to play nicely with PDF Maps
« Reply #2 on: September 23, 2012, 11:09:21 pm »
As I played with this I figured out that PDF Maps is very good with folders, and nested folders.  So I've changed the kml header stuff by adding, after </SchemaData>:

<Folder>
<name>your search terms go here</name>

and then, at the end of your file:

</Folder>
</Document>
<kml>

You can turn folders on and off, change the icons used, etc.  Folders containing Placemarks which are not within the bounds of the map you are using will still appear in your list of Placemarks, they just won't have anything in them.

Otto

  • Newbie
  • *
  • Posts: 6
Re: Get FileMaker Go to play nicely with PDF Maps
« Reply #3 on: December 06, 2012, 10:31:32 pm »
Knowing that my workaround is awkward, at best, I put together a presentation (Keynote, ppt, and pdf) explaining in a better, step by step way, how to do this: http://ottohmuller.com/Go2PDFMaps/

Otto

  • Newbie
  • *
  • Posts: 6
Re: Get FileMaker Go to play nicely with PDF Maps
« Reply #4 on: December 14, 2012, 10:26:28 am »
Hi all,

I figured out how to write a script so that FileMaker Go will output placemarks in kml files which PDF Maps, and Google Earth, can import.  The text editor in Go is limited to 64 K characters, and the output is in UTF8, so it divides up large Found Sets into 64K files.  Similarly, as PDF Maps can only import 200 Placemarks, Found Sets with more than this are divided up, too.  You can find it here: 

http://ottohmuller.com/Go2PDFMaps/

There's a reasonable description on the page where you land, so no need to repeat it here.  I ended up putting in the whole database, 7.6 MB, zipped.  Any feedback would be appreciated.

Thanks,
Otto --