a question about my mapviewer program

Chris Barker Chris.Barker at noaa.gov
Tue Dec 28 19:17:19 CET 2004


Bernhard Reiter wrote:
> On Mon, Dec 27, 2004 at 11:46:01AM -0800, Chris Barker wrote:
> The recent work to support ogr layers by Nina opens up many formats
> for Thuban.

That sounds great, but what is OGR? I've been following this list for a 
while, but have not had a chance to really dig into the code yet. 
Hopefully I can do that starting in February.

> Especially if projection come into the game, a simple GIS application
> is getting much more complicated.

Exactly. I have no need for a variety of projections with vector data, 
but with raster data, I need to match the projection already used. I'm 
really hoping I can use Thuban and not have to deal with that myself!

>>By the way, I have written a little mapping engine myself, for wxPython, 
>>but it doesn't support raster data. Rather than adding that support, I'm 
>>hoping to adapt Thuban to my needs. Mine is called FloatCanvas (I use it 
>>for other data that aren't maps as well) it is now part of the wxPython 
>>demo/lib, or you can get it here:
>>
>>http://home.comcast.net/~chrishbarker/FloatCanvas
> 
> Is it Free Software? I did not find any statements on the page
> or in the file in the archive.

Yes. In the docstring at the top of floatcanvas/__init__.py, it says:

"""
Copyright: Christopher Barker
License: Same as the version of wxPython you are using it with.
"""

the wxPython license is the wxWidgets license which is almost the LGPL. 
I did it that way because it's useless without wxPython, so it made 
sense for it to have exactly the same restrictions and freedoms. Also, 
IANAL, so I don't want to try to figure out what other license to pick. 
Also, it is now distributed with wxPython, so it really should have the 
same license.

Clearly, I need to put that info in a more obvious/standard place.

> If not I suggest to make it Free Software
> and also submit it to www.freegis.org. 

hmmm. I wonder if I want the additional users or not. I do, because 
they'd help make it better, but I don't have much time to work on it. 
Also, it really is just a component now, it's not useful by itself.

> Another wish: add a screenshot to the page. ;)

I really should do that, but I'm about to drop that ISP account anyway, 
so I'm not sure there's much point.

Did you check it out enough to have any feedback?

Now that I've brought it up, I have a few questions I'd like some 
feedback on. Not too long after I started developing my FloatCanvas, I 
discovered Thuban (in its earlier stages). My first thought was that I 
should dump what I'm doing and just use Thuban. However, my early 
impression of the code was disappointing, but only because I was hoping 
to find what I was building, i.e. my own vision, which is really a 
component, rather than an application.

I need a way to easily build small custom applications that view and 
manipulate geo-referenced data (and other non-geo data in arbitrary 
floating point coords). That's what FloatCanvas is designed to provide, 
a component that makes it easy to display and interact with floating 
point coordinate data, allowing zooming, panning, etc, without having to 
re-write all that natural-coord to pixel code all the time. It 
accomplishes this goal pretty well, but for ease of coding and 
performance considerations, it only does a simple flat-earth projection. 
  You can plug other projections in, but they have to involve only a 
simple multiplication scaling of point data (the same for all points), 
so it's not the least bit flexible.

What I do have now, however, is a wxWindow that you can simply do things 
like:

Poly = FloatCanvas.AddPolygon(Points, FillColor="Red", LineColor="Blue")

and get a polygon on the screen that can be zoomed, panned, etc. You can 
then do:

Poly.Bind(FloatCanvas.EVT_FC_LEFT_DOWN, MyCallback)

and MyCallback will get called when the user clicks on the polygon.

Where the polygon coordinates came from and how they are stored it 
files, etc, is all a separate problem, and left to the user. So far, 
I've used if for a small number of very specialized small data viewers. 
I do have a need for some more complex apps, so I'm looking at other 
options again.

There's a lot of details, but that's the gist of it. I was hoping that I 
could pull the drawing and interacting component out of Thuban, and be 
able to use it in a similar way. What it looked like to me (and this is 
from looking at the code for only a hour or so) is that Thuban was 
designed from the beginning as a whole application with a particular set 
of needs, rather than as a set of individual components. The result is 
that it looked to me that it would be quite difficult to pull out the 
components I need and use them to build my own specialized app. For 
example, it seems very tied to shape files.

Am I correct in this analysis?

However, I may well have fallen into the common trap that any 
substantial body of someone else's code always looks more complex then 
your own, so it seemed easier to just keep working on mine than to 
figure out Thuban. Perhaps my impression of incompatible design was 
really just a different design than mine, and therefore would take some 
effort to figure out.

However, as I start to think about adding support for projected raster 
data, I realize that the learning curve is probably well worth it!

So, here's a summary of a couple custom apps I want to build:

1) A custom mapping app that lets me import an existing raster map (most 
likely a nautical chart), and draw lines, polygons and text boxes on it, 
then write it out as an image (PNG, JPEG, whatever) and a PDF. I also 
need to import other vector data (points and polygons) in a custom format.

2) A tool that will let me create and manipulate a finite element grid, 
on top of a raster image and/or a vector map in a custom format. I have 
code that does the triangulation and all, I just need a way to 
manipulate points and display the resulting triangles.

This all needs to run on OS-X, Windows, and Linux.

Do you think Thuban would be a good basis for building these apps?

-Chris










-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)