Posts Tagged ‘path’

Google Maps Elevation Web Services (Google)

Thursday, March 25th, 2010

screen-shot-2010-03-24-at-104824-pm

[Editor's note: A free, sans-API key solution from the web mapping giant for showing elevation (point or along custom path) for Google Maps Mashups either in the v3 API directly or separately as a stand-alone web service. And it returns JSON :) Thanks @lagerratrobe!]

Republished from Google.

The Google Elevation web service provides you a simple interface to query locations on the earth for elevation data. Additionally, you may request sampled elevation data along paths, allowing you to calculate elevation changes along routes.

The Elevation service provides elevation data for all locations on the surface of the earth, including depth locations on the ocean floor (which return negative values). In those cases where Google does not possess exact elevation measurements at the precise location you request, the service will interpolate and return an averaged value using the four nearest locations.

With the Elevation service, you can develop hiking and biking applications, mobile positioning applications, or low resolution surveying applications.

Check the documentation out over at Google . . .

Great Script for Simplifying Paths in Illustrator (Kelso)

Monday, March 30th, 2009

[Editor's note: Cartographers looking for Douglas-Peucker type line simplication in Illustrator now have a solution to Illustrator's default simplify command when trying to generalize features like river oxbows. Jim started on the problem of fixing an Illustrator bug (see image above) where redundant points were created in the path outline command, and now has a more generalized solution.]

Jim Heck shared an amazing tool for Adobe Illustrator with me recently to deal with the irritating bug in versions CS3 and CS4 where redundant points (stacked on top of each other, illustrated above where the dupplicate points are pulled away from the basic shape) are created on outline or offset of a path’s stroke. The script (in Javascript) and Action set he created quickly remove these redundant points while still keeping the path shape. He does this with a bit of behind the scenes trigonometry wizardry. Please note this bug still exists in CS4 contray to rumors, though is lesser virulent form than CS3 (confirmed by me via email with Adobe engineers).

I’ve worked with Jim to refine it the last couple weeks. I think it’s ready for prime time now.

Screenshots:

Settings shown to remove redundant points for outlined path screenshot above. I used a tolerance of 12 points for the river ox bow screenshot below.

How it works:

  • Selected path points only or all document paths
  • Set distance tolerance in page units (optional)
  • Works in locked objects
  • Works in compound paths
  • Reporting, Selection, and Removal modes

Cartographic applications:

I illustrate below the result of using Jim’s generalization script on a typial river path and you can see in area 1a and 2b how the ox bow removal is light years above Illustrator’s default path simplify command which grossly distorts the shape in the pursuit of point removal. Jim’s script preserves the shape and removes the tiny, tight wiggles. It needs a little bit more programming work to fix areas 1b and 2a + 2c where the shape is loosing some fidelity for not keeping the trailing point in the series of removed points. And maybe needing to keep an intermediary point between 2a and 2c for shape since this is a longer removal?

With a little more tweaking, this tool will become popular for cartographers since we often want to simplify lines while keeping the overall geometry shape when reducing clustered points. The opposite may be achievable, too, when adding points selectively to long curves, but NOT to segments of the line that are already dense with points. But that’s for a 2.0 release ;)

Download the script and actions from Jim Heck’s site . . .

Illustrator Script: SelectPathsBySize.jsx (Wundes)

Monday, February 23rd, 2009

[Editor's note: John Wundes has updated his Select Path Items script for Illustrator. It still needs the ability to select by number of path points (see my script for that: page, download), but it has other very nice options, including a GUI exposing all the settings. Good job, John!]

Republished from John Wundes’s js4ai blog (1 | 2).

Download script (download page).

Updates in version 3

  • Rebuilt the processing engine from scratch, and now it is much faster.
  • There is also now a floating text field that updates as pathItems are processed in real time. This way, it still may take a long time to finish, but at least you have a very rudimentary progress bar to let you know that the system hasn’t taken a dump on you.
  • It also tells you when it’s complete, and reports the total processing time.

Updates in version 2

  • More Selections: Rebuilt interface to select objects based on Size, Area, Width, or by Height.
  • Exact Same Size: Added “Exact” option to the “less than” and “more than” radio-buttons (Thanks to Nathaniel for that suggestion)
  • Default Selection: If one object is selected, starts threshold at that size. (Also thanks to Nathaniel’s input…)
  • Added Tool Tips: If you mouse-over the dialog elements, you now get helpful tooltips. (Now I just need someone to help me translate them into other languages…)