Skip to content
nvkelso edited this page Jan 23, 2012 · 8 revisions

Import SHP file with MaPublisher

  • Have a SHP file from GIS
  • In Illustrator, size new doc to approx size of Flash stage.
  • Ideally you’d be doing the import into a map you’ve already designed. To help this process along, import both your thematic data and a coastline or administrative boundary layer at the same time to help with registration and scaling the new data onto the existing map.
  • NOTE: I’ve found it easier to project the new data in ArcMap before adding it to MaPublisher. That way you’re only doing an import and not also a reproject in their weird system.
  • Use File > Import Map Data > Advanced (so you can import more than 1 SHP at a time: eg your new thematic data and a reference layer to help register and scale it into place).
  • Browse and select the thematic SHP file and the reference SHP file. Use default coordinate system (it’ll use what the SHP is so, make sure it’s projected, best to do that in ArcGIS), format, and other settings.
  • Make sure your character encoding is set to “1252 western Europe”
  • NOTE: If you later add another SHP, a second dialog will pop up after you click OK in the basic import dialog. It’ll say something like “Matching MAP View Found” and ask if you want to add it to the same one. Say yes to adding to existing view. With the major caveat that if you moved or resized you map after importing, you might have to start over. It’s often easier to just import everything at once at the very beginning.

Reprojection:

  • Likely your SHP will come in unprojected and you’ll need to reproject it to fit your basemap. Either do that in ArcGIS before importing via MaPublisher, or follow these steps:

  • Bring up the Views panel: Window > MaPublisher > MAP Views

  • 2x click on the green world icon in the top left of that panel.

  • In the bottom of that dialog, check “Perform Coordinate System Transformation”.

  • Click the Specify button to click thru their list in a new dialog (use the triangle buttons, with the final selection options being listed in the right pane of that dialog). Or load from PRJ file with the From File button.

  • If you have two map views (eg: imported two SHPs with different projectinos) you can just use the “Same as” checkbox with the popup menu listing the available options.

  • TIP: To match an unknown Raster or Vector’s projection, guess then scale the raster to fit by using one of the Natural Earth layers (like coastline). Once you’ve got them fitting, move the “Non-Map Layers” in question in the VIEWS panel up into that green View area (move them like in the Illustrator Layers panel, click and drag). A dialog will popup asking if they are a Line, Area, Point, or Annotation. You can also base your data attributes schema on an existing file. Or you can just add column once you’ve moved it. But this way you can match the projection, and also use the Select by color attributes in Illustrator to sort your data into classes and formalize that in the MAP attributes before exporting back to SHP.

To make a custom projection:

  • Search for your base projection (eg Albers) in their big projection index dialog, and then select result in upper right pane, and then right click and “copy object” (otherwise known as duplicate). In the resulting dialogue box, rename to [base-map-projection_project-name] in the identification tab and enter the parameters in the second tab called “definition”. The parameters will come from Azimuth/VectorWorks document. Click “ok” when you’re done.

  • Now you need to activate that projection. To find it click on “recent” in the top left pane, and select your custom proj [base-map-projection_project-name]. click “ok” and accept adding it to the illustrator document.

  • TIP: If you’re Illustrator artboard document is sized near the size of your map, you’ll get better results.

Giving the features a Unique ID variable name to use in Flash:

  • Select all the features in that new Layer (for that imported theme). If more than one theme need to be interactive, repeat this process.
  • Open the panel: Windows > MaPublisher > MAP Attributes.
  • Use the Flyout menu on that panel > Apply Expression.
  • Apply to the #Name column. Click the Pencil icon to edit the expression.
  • In the Expression Builder dialog that comes up, find your unique ID column (determine this in the GIS before exporting the SHP). Often it’s a number. If there is none, then in the GIS add a new column called “uniqueID” and calculate expression to equal the FID (feature ID) which is the first column in the attributes window there. It’s an ArcMap only thing, basically listing them in order they appear in the file. But other programs don’t see that. If you do have a unique ID that is a number, Flash doesn’t like that so we need to prefix with a ABC letter, use:
  •   “f_”&UniqueID where “f_” is the prefix (fill). & stands for concatenate, and UniqueID is whatever column you’re using.
    
  • TIP: If you need to target strokes and fills separately (when you have polygons, not for lines or poitns), duplicate the layer in Illustrator layer panel and then select it’s contents and repeate the last Apply Expression step, renaming with “s_”&UniqueID instead of “f_” etc.
  • Check that the features have names by expanding the Illustrator Layer panel disclosure triangle to see objects in that layer. They should be named with the expression rather than or like before. You might need to open and close the disclosure triangle before/after doing this Apply Expression step to see the change.
  • NOTE: If you’re doing symbols rather than paths, it’s a little easier as you can just copy-paste into Flash CS3+.
  • NOTE: If you’re doing paths, you need an extra little tool in Flash to apply the object name to the symbols, and it only works in CS3. So keep a copy of that around. The script is called “instance_setMcName”, under the Commands menu once you’ve installed it. Find out more here: http://kelsocartography.com/blog/?p=2276
  • NOTE: If you can no longer use that script, pay Nathaniel to write a new one for Illustrator ;)

For exporting back to SHP:

  • In the VIEW panel, highlight the layer you want to export. Then use the flyout menu to “Export Layer X”. You’ll want to use ESRI SHP with “Windows 1252” encoding. Browse to set the export path. If you want to export all layers, highlight the entire view instead of just one layer.

To setup the MaPublisher license server

  • NOTE: When the machine is restarted, the IP address might change, and the license server might not have been relaunched. To check the IP address, go to Apple menu > System Preferences > Network. Read off the IP address from that window (the .25.47 part might change, but not the 10.140. part). To relaunch the server app, Open Terminal.app and type the following commands (read more about this in the manual, MP81_FloatingLicenseGuide_MacLinux.pdf). You might also need to update the license file with the new IP address, edit it in TextEdit.app.

  • Filename:

  •   `/-MyGTprojects/MapPublisher_floating/MP81_FloatingLicense_RLM/Mac/launch_MP_license_server.command`
    
  • File contents:

  •   cd /-MyGTprojects/MapPublisher_floating/MP81_FloatingLicense_RLM/Mac
    

./rlm

  • Change the permissions on it so it’s executable:
  •   `chmod a+x /-`MyGTprojects/MapPublisher_floating/MP81_FloatingLicense_RLM/Mac/launch_MP_license_server.command
    

Add it to your login items:

  • Apple menu > System prefs > Accounts > Login Items > + icon > locate script.
  1. Ensure to place the license file in the same directory as the other binaries are placed, look for the following three files:
  •   	avenza
    
  •   	rlm
    
  •   	MAPublisher.lic
    
  1. Open Terminal Window (Applications / Utilities, then select Terminal)
  2. Navigate to the directory where all the binaries and the license file is stored: cd /-MyGTprojects/MapPublisher_floating/MP81_FloatingLicense_RLM/Mac
  3. Type ./rlm
  4. You should get back the following confirmation: Server started on “ServerName” (hosted: “Machine ID”) for: mapublisher

Floating licenses:

To check out the license in Illustrator:

  • Go to: Help menu > MaPublisher Licensing > License Managment...
  • Select MaPublisher (and not LabelPro)
  • Initial setup:
  • Click “Floating” button Enter server ip: 10.140.25.47 and Port: 5053. Click the Check Settings button to test the connection. It should say “good”. Then press OK to confirm the settings. Once everything is setup: Click the “Checkout” button and it’ll check the license out to you (and lock everyone else out). Reminder: when you’re done with your project, follow the same steps to Checkin the license.
Clone this wiki locally