Most of you know about the standard “clipboard” that comes with Microsoft Windows or most Linux distributions. This is the tool that lets you paste text from one cell in a spreadsheet to another, or from one document to another. I can even us it in AutoCAD to paste geometry from one drawing to another.
I thought it would be cool to have a “Geo Clipboard” for open source Java applications. This would simply be a text file stored in a known location (like C:/Program Files/Geo Clipboard/clipboard.txt) that would store items like positions and simple features. You could then write plug-ins for applications like UDig and OpenJUMP that wrote to and read from the clipboard.
Ideally, the GeoClipboard would allow me to select a feature in OpenJUMP and paste it right into UDig. In the standard operating system clipboard each new selection saved to the clipboard overwrites the previous selection. I think it would be cool to associate selections in the Geo Clipboard with a tag or label. That way the user could store multiple selections on the clipboard.
The file format might look like this in XML (I replaced the greater than/lesser than symbols with square brackets.):
[clipboard]
[clipboard_item]
[tag]Road Features East of Interstate 5[/tag]
[date]2009-02-24[/date]
[time]13:07[/time]
[type]simple features[type]
[value]
Simple features would go here…
[/value]
[clipboard_item]
[/clipboard]
Of course, it would be cool if the Geo Clipboard came with a little application that allowed you to view and edit its contents without the need for an external application like OpenJUMP or UDig.
There is no need for the Geo Clipboard to be limited to Java programs either. Since we are working with a text file, you could use it in applications like QGIS to.
The Sunburned Surveyor
Tuesday, February 24, 2009
Subscribe to:
Post Comments (Atom)
3 comments:
cool idea - could we extend it so I could select items in an OpenLayers map and paste them into UDig or OpenJUMP?
Also would it have to be a textfile - couldn't you use the existing java clipboard/drag and drop classes.
Ian,
You could use the existing Java clipboard/drag and drop classes for this type of thing. But I think that might present some hurdles to use of the clipboard by programs written in other programming languages. I suppose you could simply define the text file format for things like features or positions, and then use the operating system's clipboard, but I sort of liked the idea of tagging and storing multiple selections.
Provided you used a "well known" mime type to define the dataflavor then other programs in any language would be able to read/write to the system clipboard provided they understood that mime type. I guess something like text/xml; subtype=gml/2.1.2 would work.
Ian
Post a Comment