Beispiel 1 - Importieren von Shape-Dateien

Dieses Beispiel zeigt, wie Sie spatialgateway als einen einfachen Geodaten-Importer benutzen. Sie sind mit spatialgateway in der Lage fast alle Geodatenformate zu lesen.

 

In diesem Beispiel werden den Elementen Ebene, Farbe und Füllfarbe zugewiesen. Um zu sehen, welche weiteren Elementeigenschaften den Elementen zugewiesen werden können, dann schauen Sie sich die Online-Hilfe an. Wenn Sie Attributwerte aus den Features der Geodatenbanken verwenden wollen, können Sie die mit ${field.FIELDNAME} überall referenzieren.

 

Ausserdem wurden zusätzliche Regeln verwendet, um an bestimmten Elementen die Attribute zu überschreiben.

  • Die erste Regel gibt Deutschland eine andere Farbe/Füllfarbe.

  • Die zweite Regel gibt allen Ländern in Afrika eine Füllfarbe entsprechend der Bevölkerungszahlen.

 

Zu den Import zu starten, muss folgender Befehl eingegeben werden: mdl load spatialgateway [xmlfile].

    
  

 

Importzeit: 3200 Millisekunden für 7800 Polygone auf einem i7-Dual-Core.

Example 2 - ORACLE Spatial as Live-Background

In this example we query a ORACLE spatial database to deliver a background for view 1.

 

The map is generated out of two tables and a datasource and a checkout element is configured for each table. (But it is also possible to access two and more tables with a single datasource.)

 

We use the threaded parameter in the spatialgateway element to force spatialgateway to operate in a separate thread. This allows you to cancel the update any time you want. You are even able to work with your MicroStation, when spatialgateway is still processing.

 

We use the chunksize parameter in the checkout element to force a redraw of the view after each chunk of data. This gives the impression of streaming to the user. The chunksize parameter slows down spatialgateway, so handle with care.

 

In the first checkout element we implemented three switches, all of them must be true to perform the checkout.

  • A scale denominator. The effective view scale of the view must be between maxscale and minscale. You can use the keyin spatialgateway viewinfo to determine the current view scale.

  • A MicroStation Configuration Variable. You can set any Konfiguration Variable with the keyin: expand set [CFGNAME] = [VALUE]. (Attention: Don't forget the space before and after the =.) Use expand setsave to persist the value.

    We would suggest to name the Configuration Variables with a starting SPATIALGATEWAY_ to clearify their usage.

  • A Level Name: Just switch off the level to prevent the checkout from checking out. Even if other levels are used as targetattribute, switching the level off will set the whole checkout to halt.

 

Note the spatialfilter element. Only the actually visible subset of graphical elements is read.

 

In the second checkout element we use rules to style the capitals-label depending on the current view scale. Note the slightly different configuration variable.

 

To implement the behaviour just key in: mdl load spatialgateway [xmlfile]. To cancel the update key in: spatialgateway cancel. It is advisable to put this command on a function key.

    
  

The Example shows the behaviour of Microstation after initialising the xml file.

#videoPlayer("/site/files/spatialgateway/example_2.FLV")