Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Article about geotools and uDig

Hi

thanks for the commercials Andrea :-)

Matthias Basler schrieb:
Hi uDiggers,
though I am not the Matthias you were asking for ;-) I can at least help a bit with this article's content. Our company has the same Java magazine subscribed. The Java magazine has occasionally articles about geospatial Java applications, just recently a new series.
This older article describes uDig and its structure from a technical POV. Starting with the structure of GeoTools (mentioning GeoApi and JTS). They continue with a sample code constructing an SLD style and the differences between Raster and vector data, mentining the WMS/WFS standards and other supported formats like GML. After describing the meaning of filters they change over to uDig.
The Map Info view in the screenshot is just an "overview" map showing where your viewport is located globally. They mention that it is easy to implement using a ViewportModelListener (see code example) but has the caveat that it only works well with certain map projections, because with others the bounding box would not be a rectangle  but some distorted shape when shown on the global map. So Matthias Lendholt explains how to modify the Source code to disable the update of the map CRS in order to fix it to WGS84. (Sounds like a quick and dirty method to me, but anyway.)

There is (or: was?) no configuration possibility in uDig to disable the CRS button. And for this project we were forced to block the button. It was a big RCP application with several 'map-free perspectives' and business logic and most users were not GIS-aware. This button was to much confusing and all our data was lat/lon (WGS84). Call it a dirty method but it was an easy and fast solution :-)

The outline map was developed for this project and it shouldn't be a problem to donate it back to uDig but it is more or less hardcoded to WGS84: A IViewportModelListeneris added to the map's viewport and on event the rectangle on the outline world map is redrawn. The conversion (world to image coordinates) is done manually (not using GeoTools) in the PaintListener and currently only handles lat/lon coordinates. And the PaintListener draws either a crossline or a rectangle (like on the screen shot) if the resulting bounding box on the outline map is > 2x2 pixel. As Matthias Basler wrote: other CRS wouldn't end up in other shapes and this has not been implemented.

Cheers,
Matthias Lendholt

In the fifth part they focus on the layers and their data sources and why connecting to a database can be useful for a spatial application.

I hope this helps.

Andrea wrote:
...
What is that "MapInfo" screen and do you think they would donate it back
to uDig core?

I was wondering about the exactly same thing when I saw it :)
Matthias, ping! :)






Back to the top