# GeoLocation1

Keywords: geolocation

This demo includes various examples of geolocated objects and platforms.

## Summary

Scene geometry and the platform location can be specified using geocoordinates. DIRSIG supports the Geographic (latitude, longitude and altitude), Universal Transverse Mercator (UTM) and Earth-Centered, Earth-Fixed (ECEF) coordinate systems in the GLIST file (to position geometry instances) and the PPD file (to position and orient scene geometry and the platform).

## Details

This demo focuses on different places that the user can utilize any of the geographic coordinate systems available in DIRSIG. Although we strongly encourage users to build scenes in the Scene ENU coordinate system because the entire scene can be relocated by just changing the geographic coordinate of the scene origin, there are clearly cases when it is preferrable to use geographic coordinates. This demo guides the user through the various places where geographic coordinates can be used.

## Important Files

### Scene GLIST File

The `geometry/demo.glist` file include two objects: the ground and a fighter. The ground object is instanced using the Scene ENU coordinate system:

The ground object using a Scene ENU instance.

      <object>
        <basegeometry>
          <box>
            <matid>8000</matid>
            <lowerextent><point><x>-1000</x><y>-1000</y><z>-1</z></point></lowerextent>
            <upperextent><point><x> 1000</x><y> 1000</y><z> 0</z></point></upperextent>
          </box>
        </basegeometry>
        <staticinstance>
          <translation>
            <point><x>0</x><y>0</y><z>0</z></point>
          </translation>
        </staticinstance>
      </object>

The fighter is instanced using the geographic coordinate system:

The fighter object using a geographic instance.

      <object>
        <basegeometry>
          <gdb><filename>aircraft.gdb</filename></gdb>
        </basegeometry>
        <staticinstance>
          <translation>
            <location type="geodetic">
              <latitude>43.12</latitude>
              <longitude>-78.45</longitude>
              <altitude>300</altitude>
            </location>
          </translation>
          <rotation>
            <cartesiantriple><x>0</x><y>0</y><z>45</z></cartesiantriple>
          </rotation>
        </staticinstance>
      </object>

### Platform Motion Files

This demo includes examples using both the GenericMotion and FlexMotion models. For each motion model, there are then 6 separate setups, each using a different combination of coordinate systems for the location and orientation of the platform. The table below summarizes the coordinate system combinations employed by each setup:

Table 1. Table of included Generic and Flex motion model files.
Filename | Motion Model | Location | Orientation
--- | --- | --- | ---
`enu_enu.ppd` | Generic | Scene ENU | Scene ENU
`enu_ecef.ppd` | Generic | Scene ENU | ECEF
`ecef_enu.ppd` | Generic | ECEF | Scene ENU
`ecef_ecef.ppd` | Generic | ECEF | ECEF
`geodetic_enu.ppd` | Generic | Geodetic | Scene ENU
`geodetic_ecef.ppd` | Generic | Geodetic | ECEF
`enu_enu.motion` | Flexible | Scene ENU | Scene ENU
`enu_ecef.motion` | Flexible | Scene ENU | ECEF
`ecef_enu.motion` | Flexible | ECEF | Scene ENU
`ecef_ecef.motion` | Flexible | ECEF | ECEF
`geodetic_enu.motion` | Flexible | Geodetic | Scene ENU
`geodetic_ecef.motion` | Flexible | Geodetic | ECEF

There is a corresponding `.sim` file for each GenericMotion setup (i.e., `generic_ecef_enu.sim` uses `ecef_enu.ppd`) and a corresponding `.jsim` file for each FlexMotion setup (i.e., `flex_ecef_enu.jsim` uses `ecef_enu.motion`).

## Setup

To run any of the simulations, perform the following steps:

1. Run the DIRSIG `generic_enu_enu.sim` file

2. Load the resulting `demo.img` radiance file in the image viewer.

## Results

Below is the RGB output of the GenericMotion simulation using ECEF location and Scene ENU orientation (i.e., `generic_ecef_enu.sim`) using the default gamma scaling.

Figure 1. Output of the GenericMotion ECEF+ENU simulation (gamma scaling).

Below is the RGB output of the GenericMotion simulation using ECEF location and ECEF orientation (i.e., `ecef_enu.sim`) using the default gamma scaling. The change in view orientation compared to the ECEF+ENU simulation is due to the default image "top" or "up" axis convention when using ECEF.

Figure 2. Output of the GenericMotion ECEF+ECEF simulation (gamma scaling).