Map Inspector Example

This example demonstrates a simple GUI application that creates OMPoly instances from map layers data. Created instances can be used lately for further processing, for example, like in "Shuffle Europe" example.  It also demonstrates how to use Closure programming language through ClojureTab for implementation of actions.

    Running Map Inspector example

1. Start run_protege.sh (Linux, Mac OS X) or run_protege.bat (Windows).

2. Open project Functional.pprj, go to "Clojure" Tab.

3. Select "Map Inspector" program and click "Load" button. You should see "Loaded 1 programs from 1 selected" message in the status line to the left from the button.

4. Click "Start" button. You should see "Repl started.." message. That means "Read-Eval-Print-Loop" of Clojure interpreter is started and you can input function calls (commands) into "Funcall" field with combo-box. Try, for example, "(+  2  2)" (without double quotes).

5. Input command "(in-ns 'map.inspector)". This switches REPL to "map.inspector" namespace in which "Map Inspector" program is working.

6. Input command "(new-inspector)". This check active OpenMap layers and brings "Map Inspector" window with  "M-layers" list filled with their names.

7. Click "DCWPO" layer. This fills "M-Polygons" list with automatically generated names of polygons in this layer along with point numbers of them.

8. Click "DCWPO131 148" line. The name can differ but the number of points 148 gives, probably, sought-for polygon. This brings new instance of OMPoly class.

9. Go to "OpenMap" Tab. You should see new red polygon on the place of Portugal.

10. Update "label" field of "DCWPO131 148" instance of OMPoly class to "Portugal".

11. Go to "Instances" Tab. Open "IGIS" ontlolgy and in turn open classes: MapOb -> OMGraphic -> OMPoly. You will see new "Portugal" instance among other instances of OMPoly class.

12. Do the same for "DCWPO133 3816" line in "Map Inspector". This will be Russia. If you save this project now, new created instances will be saved too. So, "Map Inspector" gives us possibility to extract polygons from the map layers data and store them for further processing.

6. To get aquainted with the details of implementation of this example have a close look at the "Map Inspector" program's functions on the Clojure Tab. Also helpful to download ClojureTab separately and become aquainted with it more closely.
    
If something goes wrong send me Windows/Linux/MacOSX console output and the problem description.

    Ru (mailto:sorokin@oogis.ru)