Sunday, December 6, 2015

PDF Improvements

CalTopo PDFs are now sporting a couple of improvements.

The most noticeable of those is a title input field on the print page:

If filled out, it will show up in a couple places.  On the bottom of the PDF itself:

on the account dialog:

and also in Avenza PDF Maps:

Slightly less noticeable is an improvement in label positioning.  Before, labels were drawn without regard to each other; on a busy map, this resulted in an unreadable mess.  Now, labels will not draw on top of each other.  If two labels conflict, the PDF generator will attempt to move them around (to only few positions; it's not very smart yet), and if that doesn't solve the problem, it will omit the second label to improve readability.

Label 2 automatically floated to the left to avoid conflicts.

Finally, although hard to demonstrate on a screen, MapBuilder layers will now print better.  To create high resolution PDFs, CalTopo starts with a large image and then shrinks it down to fit the page.  With layers that look the same at all zoom levels, like USGS map scans, this works great.  With layers that get redrawn at each zoom level, like OpenStreetMap, shrinks all the lines and text down to the point where they're hard to read.

When you print a MapBuilder layer, the PDF generator will request a tile that's been scaled up by a custom amount so that lines weights and text will come out looking right.  This is only possible on layers produced in-house, but at some point I may ramp up an OpenStreetMap server so that I can do the same thing with OSM maps.

1:24k PDF created without scaling

1:24k PDF with scaling

Tuesday, December 1, 2015

WMS and WMTS: Using CalTopo Layers In ArcGIS

I regularly get asked about using CalTopo layers in desktop programs, often but not always ArcGIS.  There are a number of protocols for accessing seamless map data, and one of them (WMS) has been supported by CalTopo for a while.  However I always kept it closely guarded - if you asked nicely I'd provide the URL, but implore you not to share it with anyone lest a horde of ArcGIS users descend on my server.

With the introduction of paid subscriptions, I can now make this a publicly known feature, along with WMTS support for serving tilesets as-is.  As a note, this is limited to pro accounts, which seems reasonable to me as most people who need to import custom layers into a GIS program are likely paid professionals.

Access is restricted using account-specific API keys.  Click on your account name at the top of the left bar, and then the "Your Account" tab in the dialog.

If you are a pro-level user, you'll see an API access section with links to the WMS and WMTS endpoints.  In this case, ABC123 is my auto-generated (and made up) API key.

If the program you're using supports WMTS, you'll have better luck using that to serve tiles and letting your program combine them into a seamless image.  Because WMS has CalTopo's server compose a new image every time you pan the map, redraws will be slower and can't take advantage of caching.

Both services are provided in spherical mercator projection only (EPSG 3857, 900913, etc).  If you need something else, your GIS program needs to be able to do the reprojecting.

Also note that unlike traditional WMS services, CalTopo's WMS API is only intended to have one layer turned on at a time.  If you turn on multiple layers at once, you may get unexpected results, including no data showing up.

Comprehensive instructions for your program of choice should be available online, but an abbreviated version for ArcGIS and WMTS is shown below.  To start with, on the Add Data dialog, find the GIS Servers folder and choose "Add WMTS Server".

Enter the WMTS URL from your CalTopo account dialog, click Get Layers to verify it, and then OK.

Choose the layer you want to add.


As another example, here's the new MBTopo layer rendered in ArcGIS: