jeudi 18 juin 2009

Freemind tip: explore and edit your XML Files

More and more, we use XML files to store data.
The XML file format gives structure to data in a hierarchical way. Thanks to its validation rules, the compliance of data can be checked. Most development languages allow parsing them in order retrieve a specific data.

Here are some examples of XML-based Files in the GIS World:
  • KML, aka Keyhole Markup Language has been developed by google.
  • GML, geographical markup language.
  • GeoRSS, the RSS files with embedded location data.
  • SLD, Styled Layer Descriptor, which permits advanced map renderings.
  • getfeatureinfo request responses returned by a WMS server.
You can read XML files in your web browser but it turns out to be limited and very static.
With Freemind, you can add metadata to nodes like web links, notes, which can be useful if you'd like to collaborate on an XML file before releasing a final version of it.
Also, you can highlight some nodes, add some markers (icons for example), things that are helpful when you start learning a specific XML-based format.

Freemind and XMLs


Freemind is used to represent and organize ideas in a hierarchical, dynamic and graphical way. The Freemind files are XML-based files with a .mm extension.

Let's take the case of an SLD file. Its structure is rich and complex. I'd like to comfortably explore it before editing it. Freemind will ease navigation through it. Here are the steps to import our SLD file in Freemind.
The operation is valid for any XML files, so you can do it for KMLs.

1 -I open my SLD file in a text editor and I copy all the text

2 - Then I simply paste it in FreeMind. Here is the result:


As you can see, my initial linear text has been rendered in a tree-structured way, which is much more readable and attractive. it's much more comfortable to edit as well.

By default, after pasting your text, all your nodes are unfolded. You'd surely prefer to get all your nodes folded and unfold only the nodes you want.
To fold all the nodes, just pass your cursor over the root node and select in the navigation item > "fold all the nodes".

Now, you can use FreeMind features:
  • zooming, automatic folding and unfolding.
  • add nodes, edit nodes
  • take notes,
  • add attributes, icons...
  • attach web links to nodes
  • filtering your nodes by their icons or attributes.
To export your mindmap to an XML:
1 - select the node you want, most often the root node, press copy
2 - then paste in a text editing tool. Now you've got your xml. Note that the icons and attributes you added in Freemind have no consequences on the content of your XML but beware of the "note" nodes you might have added. These ones will be considered as XML nodes.

FreeMind is a pretty efficient for taking notes.
One goal of Freemind is to implement a mode in which people would collaborate on a common file over the internet.

vendredi 5 juin 2009

Unexpected Uses of OpenLayers

As I went through the websites listed in the OpenLayers Gallery, I was surprised of some unexpected uses of the javascript library. Discovering them made me enthusiastic. I decided to make a post about these strange maps...

Here is the collection I noticed. If you have some more, why not sharing them!

Mathematics : Mandelbrot Fractal Browser



With this project, you can navigate through a mandelbrot fractal frame.
You can zoom in or out. All along your navigation, you won't get lost in this infinity of forms thanks to the overview map.
OpenLayers was obviously the most convenient technology for this kind of displaying.
This website makes intelligent use of the resolution configuring, the zooming capabilities and ergonomic characteristics of OpenLayers.

Biology : Genome browser



What if, in the same manner as above, you could explore the genome?
That's what this website allows you to accomplish.
The coordinates are, here, replaced by the base pairs position and each genome's area is georeferenced.
A click on a region triggers the display of its characteristics.
Really nice!

The code is avalaible on google code. If you're curious about it, check it out here.

Gaming : Pentamino puzzle



This website demonstrates extensive use of OpenLayers' Vector Capabilities.
The build of such an interface is a real technical challenge.

Communication : Rosetta Project



The rosetta project aims at building an archive of all the languages in the world.
A very rich image representing the Earth with languages labels emerging from the continents helps you find your way in this tremendous collection.
With such an attractive and interactive homepage, you want to go deeper into the subject.


These examples show localization in fields where it wasn't expected.
It shows some very clever uses of OpenLayers. For some of these applications, one might have first thought of other technologies like Flash, but as we can see, the light-weight OpenLayers library really does the business good.

mercredi 27 mai 2009

Talend Case Studies

Talend is a powerful data integration opensource software.
The offical website includes a section with some clear, printscreened tutorials that let you explore the major functionalities.
The PDF documentations: user and components reference guide (in french and english) are really complete.
In the components reference guide, you'll find scenarios for each component.
Also, some webinars are animated live during which some Talend users from different organizations (public, private) explain how they use Talend. The webinars are still accessible in the webinar archives part.

Like for every software, the best thing is to practice. To approach all the software's potentials or even to figure out what could be processed, case studies are really helpful. So, it's a good news Talend published a case studies PDF. You'll probably find it useful to see how organizations used Talend in some ambitious business intelligence projects where data integration and orchestration were some prerequisites.
http://www.talend.com/document-download.php?doc=practosdi2fr&src=AdDeveloppez_may09

vendredi 15 mai 2009

From GIS File Management to DataBase Management with PostgreSQL/PostGIS

One goal of data Integration is to collect data from an organization into a single location.
One common difficulty for the data integrator is the spread of data that makes it difficult to locate.
Another one is to keep the data structure and unicity, even when data is centralized.

PostGIS/PostgreSQL is a very interesting and convenient datawarehouse for hosting an organization's pool of geographic Data:
-Fist of all, it is opensource, very well-documented.
-It takes advantage of the contributions of a growing community; PostGIS will soon support raster with the WKTRaster project.
-When you access PostGIS files through applications like QGIS, you guarantee the user a quick access to data; you can prevent him from modifying the data structure like the names, the types of the fields : this way, it maintains your data quality
-Automatic Processes can be performed on the server-side thanks to triggers. It's useful for historization : imagine automatically adding the current date, the user name when inserting / updating data.
-Roles and permissions are easily manageable and more fine-grained and versatile than ACL rights on a server. Whereas server's ACLs only allow you to give or revoke permissions on accessing/reading/writing a file, with PostgreSQL, you can grant privileges on reading (viewing), inserting, updating and deleting values.

All these elements contribute in easing Data Management, ensuring its quality.

Let's consider I managed to gather a tremendous quantity of geographic files in a set of folders ,now the question is: how to migrate my data into my PostgreSQL/PostGIS Database?
Assuming a database is equivalent to a folder and a database table to a GIS File, I'd like to get a database structure which would be as compliant as possible with the initial folder tree structure.

In the next posts, I'll detail two ways to get our database "skeleton", each one leaning on a delimited file with the databases' names. The first way uses a DOS Batch File, the second the ETL (Extract, Transform and Load) software Spatial Data Integrator.

PS: you can transform GIS Files into PostGIS tables, but it's also reversible: you can convert PostGIS Tables into GIS Files.

dimanche 26 avril 2009

QGIS routine: get the attribute values of selected features

Here, we'll learn how to access the values of a layer's selected features.

The retrieval of these values deserves many uses:
Statistics:
-some aggregation operations like sum, average, whatever...

Actions:
-Opening a picture related to a ponctual object
-Opening a web browser which URL includes one or more attribute values

Outputs:
-Export the values of selected features in a PDF report
-Opening a spreadsheet with these values so as to make graphs.

Notice: most of the actions mentionned above can also be accomplished using the QGIS actions that you access through the layer's properties.

Here is the QGIS routine that will allow you to access the attribute values of the active layer's selected features:

>>> myLayer=iface.activeLayer()
>>> objects=myLayer.selectedFeatures()
>>> objets.attributeMap()
>>> object=objects[0]
>>> attributes=object.attributeMap()
>>> attributes[0].toString()
"Bonifacio"

>>> objects=myLayer.selectedFeatures()
it returns a list of the selected objects
>>> attributes=object.attributeMap()
This attributeMap() method allows you to get the attribute values of the object you considered, in our case, the first one (object=object[0]).
It returns a dictionary which each key is an auto-incremented number. Notice that, unfortunately, the key is not the attribute name.
>>> attributes[0].toString()
Each value of the attributes is QString object. The method toString() makes it readable for the user. Here, we get the the first attribute's value.

Most often, you would combine the previous "attribute name" routine with this one.