260 likes | 432 Views
« GIS Concept & Methods ». « GIS PROGRAMMING ». Summary. Programming issues Automating tasks Integrating GIS functionnalities into another application GIS Add-ons Programming issues Programming techniques Scripting Object architectures Internet technologies Database technologies
E N D
« GIS Concept & Methods » « GIS PROGRAMMING »
Summary • Programming issues • Automating tasks • Integrating GIS functionnalities into another application • GIS Add-ons • Programming issues • Programming techniques • Scripting • Object architectures • Internet technologies • Database technologies • Performance issues
Automating tasks • Using the command line of a GIS is a very basic form of programming • Allows the automation of a large number of repetitive tasks without having to resort to a complicated language or a compiler • Graphical interfaces also make it possible to string tasks together in an intuitive manner
Automating tasks : illustration Mapinfo’s command line : the MapBasic window
Integration GIS functionalities into another application • Often desirable to integrate a particular GIS functionality into an application • Example: to view plots of land and their associated alphanumeric data • Direct use can be made of GIS engines via programming libraries supplied by the various publishers
Integration GIS functionalities into another application : illustration Integration of GeoConcept functionalities in Ms Access
GIS Add-ons • Personalisation • In dedicated applications, the need may arise to personalise the working environment • Majority of GIS packages offer such options as the addition of a special menu, the definition of new buttons to launch a suite of preconfigured actions, etc… • Algorithmic implementation • use of new algorithms, modification of certain pre-programmed algorithms, etc., may oblige the user to construct add-ons for the SIG solution used. In this event, it will be necessary to use the various programming libraries providing access to the GIS engine in order to add this extra functional brick • In such cases, concern for performance often becomes a central issue
GIS Add-ons : illustration Tool manager in Mapinfo GIS
Internet • Makes it possible to disseminate information on a massive scale • Publishers offer possibilities in several programming environments • Internet places the user in a client-server environment • Technology choices have to be made before sarting any developments • Entire application on the server. Principal technologies used are the Active Server Page (ASP) dynamic Web programming languages based on VBScript, Java Server Page based on JAVA, CGI programming, and .NET components • Interactivity of client-side is possible by using JavaScript, ActiveX, JAVA applets or any other language capable of being interpreted on the client side • Programming is not limited to browser environments. Dedicated applications can also use the Internet to retrieve information layers (e.g. WMS layer, etc…).
Internet : illustration Mapping with an Internet browser : example : MapGIC
Scripting • Command line makes it possible to carry out most of the accessible operations via menus, using a simple, dedicated language • Open, view, save or close a table or map • Make a selection according to alphanumeric or geographical criteria • Update a series of values • Create, modify or delete a series of values • Create, edit or modify geographical objects • Modify the appearance, position or scale of an existing map • Possibility to introduce loops and conditions which allow the creation of small programs or macros mainly designed to save time with repetitive operations
Scripting (2) • Advanced use of the script editor allows a small degree of personalisation of the working environment • addition of a menu or buttons • modification of a dialogue box • In some cases, a graphical interface makes it possible to string commands together by placing them visually in relation to each other • Provides sufficient possibilities for the automation of tasks • Spares the user from having to learn a sometimes daunting syntax • Allows an intuitive approach to the development of scripts
Scripting : illustration Scripting in VBscript in GeoConcept 5.5
Object architectures • COM • Common Object Model standard developed by Microsoft is the most widely used in the Windows environment. • Programming is carried out with a COM object architecture developed by the publisher of the GIS system used • Possibility to personalise COM objects on the basis of the objects available in the programming library, but this demands more advanced skills • JAVA • Java is an object programming language which is particularly convenient for the creation of personalised object classes • Java is available under most operating systems (Linux, Windows, MacOS, etc.). • Java technologies integrate perfectly with Internet projects based on JSP (Java Server Pages) technology • In addition, an active community is developing, and a large number of object libraries is available in this language, allowing substantial re-use of existing projects
Process Modules (dll / exe) Apartments COM Objects Contexts Interfaces Methods Object architectures : illustration COM JAVA
Internet technologies • Solutions Integration of a cartographic dimension into an Intranet or Internet application Advantages • Allows information to be made available to a group of peopleor a usersnetwork, without having to install an application on each workstation • Simplicity of deployment • Straightforward portability to different platforms • Easy updating • Can take numerous forms and satisfy a wide variety of needs • Simple consultation • Only a little programming is needed to create a Website which makes information available to users. • e.g.Municipal planning department might give its citizens access to land cover maps for consultation when any modifications are under consideration
Internet technologies (2) • Localisation and routes • Interfaces allowing users to determine the geographic location of a specific address (dealer or Points of Interest locators) • Interfaces giving the route between to given addresses • Localisation of movable points for fleet management purposes (position of a vehicle, calculation ofroutes, ‘snapshot’ speeds, average speeds, …) • Such apllication must be user-friendly, ergonomic and fast • Help with decision-making E.g. A university, wishing to share harvest projections with several farmers with respective crop zones.Thematic maps with farmers figures can be navigated by the users. If interested in a particular zone, they can zoom in to display more detail. Combining this with more traditional result tables gives a very valuable analysis tool.Depending on the degree of confidentiality of the data, it is possible toprogram a security layer which will verify access rights to particular items of information.
Internet technologies (3) • Technologies • Cartographic application server: Esri; Mapinfo, GeoConcept, … • A server manages sessions for the users and generates appropriate maps according to the instructions received • Website in different languages (ASP, JSP, etc.) calls on a “map server” in its code. E.g. when the user wishes to change the scale of the map, the corresponding instruction is given to the server and the result is integrated into the page returned to the user • Most of the functions available in the software interface are programmablein an object-oriented language such as C++ • Complex add-ons which execute a series of operations as the user navigates within the site can be created
Internet technologies (4) • Infrastructure and security • requires a more complex infrastructure,implementation is much more critical • Security implications must be fully understand prior to any developments to avoid any incompatibility between the infrastructure demanded by the site and the security imperatives imposed by IT managers. If compatibility is not ensured, the managers may simply refuse to include your site on their servers! • Architecture: aWebsite with a cartographic component generally calls on various resources: an Internet server containing the code for dynamic pages (ASP, JSP, etc.), a map server containing the spatial data, and possibly a database server Simple architecture All elements on a single server. Easy and relatively cheap to implement, not the most effective in terms of performance or security, quite suitable for sites with relatively low traffic and in small infrastructures
Internet technologies (5) Traditional architecture Different components installed on dedicated servers, or on server farms provided with load-balancing systems. Better answer to security imperatives • Web servers demands a suitable network infrastructure comprising at least a firewall and a DMZ. A DMZ (demilitarised zone) can be defined as a sub-network physically separated from the critical zone constituted by the LAN. The DMZ contains highly secure servers known as bastions • The Web servers are placed in the DMZ, behind the firewall. This ensures that the number of connections between these servers and the LAN (Local Area Network) is kept within a predefined limit • Database servers should preferably be placed on well-protected machines inside the LAN to only allow through the necessary traffic between the Web servers and the DB servers. Offers easy and sure access to the data from stations on the LAN
Internet technologies : illustration Architecture of an ArcIMS site
Database technologies • GIS systems offer storage architecture similar to that of databases, generally giving access to geographical data using “Structured Query Language” - SQL • Added extension have usually been added to carry out spatial requests (inclusion, intersection, etc.) but are often specific to a publisher • International standards are emerging (ISO/IEC 13249-3:1999-SQL Multimedia and Application Packages - Part 3: Spatial) • GIS application can be integrated into an existing client-server architecture by connecting it directly to a relational database system • Geometry of the objects can be stored in the database • Creation of spatial indexes there which will rapid access to spatial data • Some database systems provide a spatial module capable of storing geographical objects in a format compatible with the most widely used GIS packages, managing projections and systems of co-ordinates, carrying out spatial requests and even visualising one or more layers
MapInfo ArcView AutoCad Access IgorPro GC Expert Database technologies : illustration Architecture GCES/Oracle Oracle Internet / intranet – ASP, JSP GCIS GCES GCES GCES GCES Internet / intranet – Applet Jump Dynalmics links Import - Export
Performance issues E.g Developments involving algorithms for the processing of vectorial objects or images • Compiled programsare preferable to written ones in an interpreted language as difference in speed may be significant • The way in which the program communicates with the GIS also has an impact on performance • Maximum performance is obtained by creating modules integrated into the GIS system and that are executed inside it. The exchange of information between the module and the core of the system then takes place in the same memory space on the machine • When an external application calls on the functionalities of a GIS, these calls are made between different processes which do not share the same memory space, and a translation of the requests must be carried out, thus slowing down the execution. This slowdown is, of course, even greater when the calls are made between distant machines, and is directly dependent upon the speed of communication between the machines