Logo Search packages:      
Sourcecode: josm-plugins version File versions  Download package

org::openstreetmap::josm::plugins::ywms::ImageLoader Class Reference

List of all members.

Detailed Description

Loads a stellite image from Yahoo accordin to a WMS request.

The image is captured from firefox using one of its features: when the environment variable MOZ_FORCE_PAINT_AFTER_ONLOAD is set, it causes firefox to dump, as PPM files, the contents of all the pages loaded. The value of the variable is used to locate where the files are dumped.

As the image served by Yahoo is bigger than the one requested, it is cropped and resized to the desired size.

Currently, there is no way of knowing whether a zone has imagery or not. If not, the Yahoo message "We're sorry, the data you have requested is not available. Please zoom out to see more map information or refresh your browser to try again".

Implementation note: <lu> Some information is passed from Javascript to Java, so Firefox must be configured with the method "dump" to work. To allow this method in firefox, create or modify the option "browser.dom.window.dump.enabled=true" in "about:config"

Also, as firefox must be started and killed once and again, it is recommended to create a profile with the option "browser.sessionstore.resume_from_crash" to false and set other profile to default, so no nag screens are shown. </lu>


Definition at line 47 of file ImageLoader.java.

Public Member Functions

void cleanImages ()
BufferedImage getBufferedImage ()
 ImageLoader (String wmsUrl) throws ImageLoaderException
void save (String fileName)

Static Public Attributes


Package Attributes

int final_height = -1
int final_width = -1
List< String > firefoxFiles = new ArrayList<String>()
int height = -1
Image image
double[] orig_bbox = null
int width = -1

Private Member Functions

double[] getBbox (String line) throws ImageLoaderException
void load () throws ImageLoaderException
void resizeImage ()

Private Attributes

URI yahooUrl

Static Private Attributes

static final Pattern BBOX_RE = Pattern.compile("bbox=([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+),([+-]?\\d+\\.\\d+)", Pattern.CASE_INSENSITIVE)

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index