FSX KML

From FSDeveloper Wiki
Revision as of 15:29, 14 December 2007 by MatthewS (talk | contribs) (Resample based scenery)
Jump to: navigation, search

Contents

Introduction

Before and after screenshot

FSX KML is a freeware scenery design tool for Microsoft Flight Simulator X (FSX).

It converts KML (Keyhole Markup Language) files generated by Google Earth into FSX scenery.

Using Google Earth to draw polygons and polylines you can accurately and easily many types of scenery.

Shp2Vec based scenery

FSX KML uses the FSX SDK Shp2Vec tool to create the following types of vector scenery:-

  • Water polygons including oceans, rivers, lakes and canals
  • Islands inside water features
  • Irregular shaped land class polygons for cities, parks, beaches, forest, golf courses etc
  • Airport boundaries and flatten polygons and AUTOGEN EXCLUSIONS
  • Shorelines
  • Streams
  • Roads
  • Railways
  • Freeways (ie Moving traffic)
  • Utility lines (eg power and telephone lines)
  • Exclusions polygons (for vector data)

BGLComp based scenery

FSX KML uses the FSX SDK BGLComp tool to create the following types of scenery:-

  • Place scenery objects (from the FSX library) along a polyline using a wide variety of placement options
  • Exclusion rectangles
  • Extrusion bridges

Resample based scenery

FSX KML uses the FSX SDK Resample tool to create the following types of scenery:-

  • Land class tiles
  • Water class tiles

Make sure you also download and install FWTools which is required for creating these types of scenery.

Support Forum

You can discuss FSX KML at the fsdeveloper.com FSX KML forum. This is the best place to ask support questions about FSX_KML since other FSX_KML users (as well as the author) can answer your questions.


Downloading FSX KML

The latest version of FSX KML (1.10) can be downloaded from:-


Make sure you also download and install FWTools which is required for land class tile and water class tile support.


Installation

Installing FSX KML

FSX KML can be installed in a folder of your choice. Simply unzip the FSX KML installation zip file into the desired folder.

After unzipping the installation file you should have the following files:-

  • FSX_KML.exe
  • ShapeLib129.dll
  • FreeImage.DLL
  • FSX_KML_TAGS.XML

Installing the FSX Software Development Kit (SDK)

To generate FSX scenery you will need the FSX SDK, which is distributed with the FSX Deluxe version. To install the SDK:

(1) Browse the FSX Deluxe Edition Disk 1

(2) Open the SDK sub-folder

(3) Double-click the setup.exe

(4) Tell it where to install. Default is C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK


If the SDK is not installed in the default SDK folder you must specify its location on the FSX_KML build tab.

For more info on the SDK installation and Service packs: http://www.fsdeveloper.com/wiki/index.php?title=SDK_Installation_%28FSX%29

Installing FWTools

FSX KML makes use of the freeware tool set called FWTools. FW Tools is required for scenery that uses the FSX SDK Resample tool, such as landclass and waterclass.

Download and install the latest version of FWTools.

Specify the location of FWTools on the FSX KML Build tab.

Building Scenery

Building your own scenery with FSX KML is easy.

Step 1 - Creating a KML file with Google Earth

The first step in creating your FSX scenery is to create a KML file by using Google Earth to "trace" scenery features.

Creating polygons and polylines

Using Google Earth create a polygon using the "Add Poly" function or create a polyline using the "Add Path" function, and then trace the scenery feature (for example a lake or road).

After you click the "Add Poly" or "Add Path button" you will be presented with a form as shown below:-

GE-polygon-dialog.jpg

  • Name - Give your polygon or polyline a description or leave blank
  • Description - This is where you "tag" your polygon or polyline. You may enter a tag from FSX_KML_TAGS.XML or leave blank and tag later using FSX_KML
  • Style & Color - You may choose the border and fill color for polyline or polygon
  • Altitude - You may enter an altitude for your polyline or polygon. This can be used to specify the elevation of lakes. You may also enter the elevation later using FSX_MKL. All elevations must be entered in meters.

Begin tracing your polyline or polygon. You may either click the mouse or hold the mouse button down and drag the mouse to create vertices.

  • Use your mouse wheel to zoom the view in and out vertically.
  • Use the up, down, left, right arrow keys to move the view horizontally.
  • Hold Shift and press left or right arrow to rotate the view.
  • Hold Ctrl and press up or down arrow to tilt the view.

Once you have finished click OK to save your polygon or polyline.

To edit your polyline or polygon highlight it, right click the mouse and choose properties.

"Tagging" the scenery features

To describe what scenery feature your polygon or polyline represents it needs to be "tagged". The file FSX_KML_TAGS.XML contains a list of the tags you can use.

There are two ways to tag a polygon or polyline:-

  • Place the name of the tag in the description field of the polygon or polyline.
  • Place the name of the tag in the description field of the parent folder that contains the polygon or polyline. If a polygon/polyline has no tag then it will inherit its tag from the parent folder.

You can place these tags in GE using the properties dialog of the polygon or polyline, or you can use FSX_KML to place these tags.

To tag using FSX_KML click on a description "cell" and press F2. An arrow will be displayed so then click on the arrow to drop down a list of valid tags. Highlight the tag you want and press ENTER. If you had multi-selected several cells then all the selected cells will be tagged. To select multiple cells hold down the shift key while clicking cells.

Saving your work to a KML file

Once you're done drawing your polygon(s) or polyline(s), simply right-click on the top-most folder you created (or the polygon itself if you didn't create folders) under the "My Places" tab on the left side of your GE window. Select "Save As", makes sure that you choose .kml as the file type, and select your desired location in your file structure.

Step 2 - Processing the KML file with FSX KML

The Project tab
The Build tab
  • Run FSX_KML
  • On the "Project" tab, click the "Add KML" button and choose a KML file. The contents of the selected KML file will be displayed. You may add multiple KML files. A FSX BGL file will be generated for each KML input file.
  • Change to the "Build" tab
  • Set the following build options:-
    • "FSX folder" - Input the folder where FSX is installed. By default this is "C:\Program Files\Microsoft Games\Microsoft Flight Simulator X"
    • "Terrain SDK" - Input the location of the FSX terrain SDK
    • "FW Tools" - Input the location where you installed FW Tools. FW Tools is required for scenery that uses the FSX SDK Resample tool, such as landclass and waterclass.
    • "Run SDK tools" - If you select this option FSX KML will automatically run the SDK tools to turn your Shape Files into a FSX BGL
    • "Copy generated scenery to FSX Addon Scenery Folder" - If you select this option FSX KML will copy the generated BGLS to the FSX addon scenery directory
  • Click the "Build" button. FSX KML will now build your scenery. The progress of the build will be displayed in the build log window. The following actions will occur during the build:-
    • For each KML file in your project
      • For vector based scenery an appropriate set of Shape files is generated depending on the features that have been tagged in the KML
      • For resample based scenery an appropriate Tiff file is created.
      • An XML config file is created for use by Shp2Vec, BGLComp and Resample
    • A batch file called "Run_SDK_Tools.bat" will be created. This batch file contains the appropriate commands to call the FSX SDK tools (Shp2Vec, BGLComp and Resample)
    • If you have selected the "Run SDK Tools" option then the Run_SDK_Tools.bat file will be executed. This will create various scenery .BGL files ready for use by FSX
    • If you have selected the "Copy generated scenery..." option then the BGL files(s) will be copied to the FSX addon scenery directory. Please note: If FSX is running and using a previous version of your BGL file then the copy will not work because FSX will have the file "locked". The easiest way to ensure your file is copied to the addon scenery folder is to make sure FSX is not running.

Step 3 - Testing the scenery

  • If you selected the "Copy generated files..." option then your scenery will have been copied to the FSX addon scenery folder. Simply run FSX and goto your scenery location to test the scenery

Scenery Design Tutorial

The FSX KML Tutorial provides help with a variety of scenery design tasks.

Editing a KML file using FSX_KML

Using FSX_KML you can easily edit your KML file. The following types of edits can be performed:-

Copy

To copy a KML item (folder or polygon/polyline) select the item to copy and click the copy button.

Delete

To delete a KML item select the item to copy and click the delete button.

Edit

To edit the Name and Description attributes of a KML item select either a single item or multiple items (hold the shift key to multi-select) and then press F2 to display the inline editor. Enter the new value and press enter. Your edit will be applied to the items you selected

Saving your changes

Click the save button to write your changes back to disk.. .

Open in Notepad

Click the "Open in Notepad" button to open the selected KML file in Notepad.

Open in Google Earth

Click the "Open in Google Earth" button to open the selected KML file in Google Earth.

Reload a KML file

If you have edited the selected KML file using an external program (eg Google Earth or Notepad) then you can reload those changes back into FSX_KML by clicking the reload button.

Properties Tab

This tab shows the properties for the selected polygon or polyline.

Freeways: Use the "NumberOfLanes" and "Traffic Direction" attributes to define freeway related data.

Hydropolygons: Use the "SlopeX" and "SlopeY" attributes to define slope characteristics of hydropolygons.

Vertices Tab

This tab shows the vertices (ie points) for the selected polygon or polyline.

Click the "Edit" button to display the vertice editor. This editor lets you edit the vertices in several ways:-

Reversing points: The direction of a polygon or polyline can be reversed by using the REVERSE POINTS button. Click the "Reverse" button to change the direction of points in the polygon/polyline.

Setting elevation: You can set the elevation for all vertices by clicking the "Set Elevation" button.

Manual editing: You can manually edit vertices (longtitude, latitude and elevation) by editing data in the vertice grid.

XML Tab

This tab shows the XML for the selected polygon or polyline.

FSX_KML_TAGS.XML

FSX_KML_TAGS tab

What is the FSX_KML_TAGS file?

This file holds the "tags" that are used in the KML file to describe FSX scenery features. You can customise this file to add more tags or change existing ones.

An easy way to browse this file is by clicking on the "FSX_KML_TAGS.XML" tab in FSX KML.

This XML contains the following attributes for each "tag":-

  • Tag - The unique identifier for this scenery feature. This tag is what you use to "tag" the polygons/polylines in your Google Earth KML file
  • Description - A description of the scenery feature. This description is displayed in FSX KML.
  • Feature Type - The type of scenery feature and must be one of the following types:-
    • WATERPOLY - Water polygons such as coastline, rivers, lakes, canals etc
    • WATERPOLYGPS - Low resolution water polygons for use in the GPS
    • LANDCLASSPOLY - irregular shaped landclass polygons for towns, forest, beaches, park etc
    • AIRPORTBOUNDRY - define airport boundries and also flatten areas and AUTOGEN EXCLUSIONS
    • EXCLUSION - exclude default vector scenery from the polygon
    • STREAM - create streams
    • SHORELINE - create animated shorelines
    • ROAD - create roads (NOT road bridges)
    • FREEWAY - create moving traffic
    • RAILWAY - create railways (NOT rail bridges)
    • UTILITY - power lines, telegraph lines, fences etc
    • SCENERYOBJECT - place scenery objects
    • EXCLUSIONRECTANGLE - excludes scenery objects
    • EXTRUSIONBRIDGE - creates extrusion bridges
    • LANDCLASS - create land class
    • WATERCLASS - create water class
  • GUID - The FSX GUID for the scenery feature.

Please refer to the FSX "terrain.cfg" file and terrain SDK documentation for futher information on feature types and GUIDs

Editing FSX_KML_TAGS.XML using FSX KML

The FSX_KML_TAGS.XML file can be easily edited in FSX KML. To following edits can be performed:-

Copy

To copy an item select the item to copy and click the copy button.

Delete

To delete an item select the item to delete and click the delete button.

Edit

To edit the Tag, Description, FeatureType or GUID attributes of an item select either a single item or multiple items (hold the shift key to multi-select) and then press F2 to display the inline editor. Enter the new value and press enter. Your edit will be applied to the items you selected

Saving your changes

Click the save button to write your changes back to disk.

Open in Notepad

Click the "Open in Notepad" button to open the FSX_KML_TAGS.XML file in Notepad.

Reload

If you have edited the FSX_KML_TAGS.XML file using an external program (eg Notepad) you can reload those changes by clicking the reload button.

Google Earth

Downloading Google Earth

The free version Google Earth may be downloaded from the Google Earth home page

Copyright of Google Earth Data

Scenery developers need to be aware that there may be copyright issues associated with the use of data obtained from Google Earth. Please see the Google Earth support page for more information on the Google Earth policy of using this data in your freeware or commercial products.

Freeware scenery using FSX KML

The following freeware has used FSX KML during their development:-

Freeware authors please list your freeware scenery here!

Commercial scenery using FSX KML

The following commercial scenery has used FSX KML during their development:-

Please list other commercial scenery here.

End User Licence

Copyright © 2007 Innova Software ALL RIGHTS RESERVED

FSX KML ("Software") is distributed without charge to FSX add-on designers, redistribution of the original ZIP file is not allowed. You are NOT allowed to sell this software or ask money for its distribution.

FSX KML may be used free of charge for the production of both freeware and commercial add-ons (including sceneries,missions,aircraft) subject to the following terms and conditions:-

  • You notify Innova Software of the use of FSX KML in your add-on
  • You give Innova Software a free copy of your add-on (and any updates)
  • In your readme file you say that FSX KML was used to help with the production of your add-on
  • The copyright and any intellectual property relating to the FSX KML software shall remain the property of Innova Software
  • LIMITED WARRANTY - INNOVA SOFTWARE SHALL NOT BE RESPONSIBLE IN TORT OR IN CONTRACT FOR ANY LOSS OR DAMAGE HOWSOEVER CAUSED TO THE PROPERTY OR PERSON OF YOURSELF OR ANY THIRD PARTY AS A RESULT OF ANY DEFECT IN THE SOFTWARE WHETHER PATENT OR LATENT OR AS A RESULT OF ANY FAULT, NEGLIGENCE, WRONGFUL ACT OR OMISSION OF INNOVA SOFTWARE OR ANY OF ITS SERVANTS, EMPLOYEES, CONTRACTS AND AGENTS, AND YOU INDEMNIFY INNOVA SOFTWARE AGAINST ANY CLAIMS MADE AGAINST IT BY ANY THIRD PARTY ARISING OUT OF ANY SUCH DEFAULT OR FAULT, NEGLIGENCE, WRONGFUL ACT OR OMISSION AND IN NO EVENT SHALL INNOVA SOFTWARE BE LIABLE FOR ANY CLAIMS OR DAMAGES INCLUDING, BUT NOT LIMITED TO CLAIMS OF FAULTY DESIGN, NEGLIGENT OR MISLEADING ADVICE, DAMAGES ARISING FROM LOSS OR USE OF THE SOFTWARE AND/OR SUPPLY OF SERVICES; AND ANY INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR INJURY TO ANY PERSON, CORPORATION OR OTHER ENTITY BY REASON OF THE PROVISION OF THE SOFTWARE AND/OR PROVISION OF SERVICES PURSUANT TO THESE TERMS AND CONDITIONS

Developers can email acceptance of these terms and conditions to fsx_kml@innovasoftware.com.

Release History

v1.00 Beta - 19th 0ct 2006

This is first beta release of FSX KML

v1.01 Beta - 19th 0ct 2006

Issues resolved:-

  • Fixed error with FSX_KML_TAGS.XML file not found

v1.02 Beta - 21st 0ct 2006

Issues resolved:-

  • Fixed error reading polygon/poylines. FSX KML could sometimes insert an erroneous point of 0,0

v1.03 Beta - 28th 0ct 2006

New features and issues resolved:-

  • Better handle tags in description field. Be less strict about "whitespace" and cr/lf
  • Better handle international settings for decimals
  • Add more excludes to fsx_kml_tags.xml (see tags starting with "exclude__")
  • Add support for moving kml items up/down
  • Add support for moving kml items via drag drop
  • Add support for creating new kml folder
  • Create shapes in order they appear in the KML
  • Assign UUID (starting at 1) to each shape in the KML based on its order in the KML

Known issues (Features not implemented in this release):-

  • Freeway tags (moving traffic) - in v1.03 you must manually edit the FW .DBF file to set traffic density and direction

v1.04 Beta - 20th Jan 2007

New features and issues resolved:-

  • Use INI file (FSX_KML.INI) to remember settings including list of KML files and FSX folder settings
  • Allow multi select of KML files in Add KML file dialog
  • Display points for selected polygon/polyline
  • Add REVERSE POINTS button to allow direction of polygon/polyline to be reversed
  • Add POLYGONHOLE tag to support "holes" in polygons, eg for making islands in rivers
  • Add LEGACY_LANDWATERMASK_WATER_NOFLATTEN tag for water polygons that "cling" to mesh
  • Default freeway traffic to one lane of traffic

v1.05 Beta - 21st Jan 2007

New features and issues resolved:-

  • Added "Automatically Reverse Points In Polygon Holes" build option. This option will auto reverse points for polygon holes when creating the shape file. Apparently Google Earth always writes polygons in a clockwise fashion to the KML file irrespective of which way they are actually drawn in Google Earth. This option simplifies the creation of polygon holes because you no longer need to manually reverse point order in FSX KML. Option is on by default.
  • Added "Output Folder" build option. This lets you specify the folder where files are written during the build process
  • Fixed error when loading the saved list of KML files and a KML file can longer be found.

v1.05.1 Beta - 21st Jan 2007

Issues resolved:-

  • Fixed bug where directory would not be changed prior to running the RUN_SDK_TOOLS batch file

v1.06 Beta - 14th Apr 2007

New features:-

  • Added grid to allow manual editing of polygon/polyline points (longitude,latitude,elevation)
  • Added button for setting all points in polygon/polyline to a specific elevation
  • Added support for tag parameters (eg freeway traffic data and hydro poly slopeX/Y)
  • Added option to save backups to backup subdirectory (on by default).
  • Added XML tab to show XML for highlighted node
  • Remember window size and position

Issues resolved:-

  • Changed tag name of "Park" to "LandClassPoly" since landclass polys can be used for more than just parks! Existing "Park" tags are automatically renamed to "LandClassPoly"
  • Handle extra '.' in filenames

v1.07 Beta - 25th Apr 2007

New features:-

  • Added "Shape" tab with support for shape viewing. Select single (or multiple) polygon/polylines to see its shape. Selecting a folder will show all shapes in that folder and any sub folders.
  • Added "Select All" function (Ctrl A) to select all polylines/polygons
  • Added "New" button to Vertices form to insert vertice.
  • Added "Copy" button to Vertices form to copy the selected vertice.
  • Added "Delete" button to Vertices form to delete selected vertice.
  • Added "Move Up" and "Move Down" button to Vertices form to move selected vertice up or down in list.
  • Added Options menu to main form. Moved "Save Backups" to this menu
  • Added "Remember Window Position and Size" to the options menu

Issues resolved:-

  • Updated the "About" form to credit the 3rd party development libraries used (eg Shapelib)
  • Fixed misplaced longitude and latitude labels on vertice grid

v1.08 Beta - 18th May 2007

New features:-

  • Add BGLCOMP support for placing of FSX library objects along polyline. The use of "Variance" parameters below helps create more naturalistic looking scenery by applying random variance to object positioning. Support the following parameters:-
    • Altitude AGL or MSL
    • Altitude variance - Random variance in meters applied to alitude (use 0 for no variance)
    • Pitch (0 - 360)
    • Pitch variance - Random variance in degrees (0 - 180) applied to pitch (use 0 for no variance)
    • Bank (0 - 360)
    • Bank variance - Random variance in degrees (0 - 180) applied to bank (use 0 for no variance)
    • HeadingType
      • Track - Heading of each object follows the direction of each polyline segment
      • Fixed - Heading of all objects is specified by Heading parameter
      • Random - Heading is random for each object
      • Elevation - Heading for each object is specified by elevation of associated polyline vertice
    • Heading (0 - 360) - Used when HeadingType = Fixed
    • Heading variance - Random variance in degrees (0 - 180) applied to heading (use 0 for no variance)
    • Scale - Scale multiply of object (defaults to 1.0)
    • ScaleVariance - Random variance in scale to apply to objects. (use 0 for no variance)
    • ImageComplexity - VerySparse, Sparse, Normal, Dense, VeryDense, ExtremelyDense
  • FSX_KML_Tags tab - Add tags for all default FSX scenery library objects
  • Build tab - Add button for setting BGLComp SDK path
  • Build tab - Add "Open" button for output folder path to open Windows Explorer on that folder

Issues resolved:-

  • Fixed issue with copy button

v1.09 Beta - 23rd June 2007

New features:-

  • Added BGLCOMP support for scenery exclusion rectangles ("ExclusionRectangle" tag). The exclusion rectangle will be defined by the "bounding" rectangle of the polyline/polygon. Supports the following parameters
    • ExcludeAllObjects
    • ExcludeBeaconObjects
    • ExcludeEffectObjects
    • ExcludeGenericBuildingObjects
    • ExcludeLibraryObjects
    • ExcludeTaxiwaySignObjects
    • ExcludeTriggerObjects
    • ExcludeWindsockObjects
    • ImageComplexity - VerySparse, Sparse, Normal, Dense, VeryDense, ExtremelyDense
  • Added BGLCOMP support for Extrusion Bridges ("ExtrusionBridge" tag). Draw a polyline and tag it with "ExclusionBridge", then use the vertice editor to set the height of each bridge segment.
  • Added "Change to" button on the Vertice Editor to change shape type from polygon to polyline and vice versa
  • Enhanced polygons holes so that if a polygon cannot be found in the same folder as polygon hole ("polygon folder") then the parent folder is searched for the first polygon preceding the polygon folder. This makes it possible to better organize a project by placing polygon holes (i.e islands) in a sub folder and still have them associated with a water polygon in a parent folder

v1.10 Beta - 19th August 2007

New features:-

  • Land class tiles
  • Water class tiles

Development Roadmap

The following features are planned for upcoming releases:-

Future releases

  • Update this manual :)
  • Add 10 minute autosave
  • Add following params to BGLCOMP support:-
    • Heading Type
      • FixedTrack - Heading of all objects is fixed to the direction of first polyline segment
    • Divergence - Random divergence (in meters) from vertice. Applied in direction which is perpendicular to direction of polyline segment (use 0 for no variance)
  • Add "AutoPolygonHole" to polygon properties sheet. This allows a polygon hole to be automatically created in the shape of the polygon, and removes the need manually create a hole (by copying and tagging as hole)
  • Fix - Ensure lon/lat uses '.' and not ','
  • FSX_KML_Tags tab - Add support for tag groups
  • Add BGLCOMP support for Tag Groups. Tag grouping allows the scenery designer to group together similar scenery library objects into a single group. For example, when populating a car park the designer could use a tag group containing a variety of car models. This would result in car models being chosen at random from the tag group.
  • Add shape viewer to Vertice Editor form and have it refresh as vertices are edited.
  • Add "Fly to" button to Vertices Editor form to move FSX aircraft to the selected vertice
  • Add "Paste Aircraft pos" button to Vertices Editor form to paste the current location of aircraft (longtitude, latitude, and optionally altitude) into the list of Vertices.
  • Export - Ability to export selected polygons/polylines to a CSV file, with option for long/lat/elevation ordering
  • Scenery Placer - Add support for dynamically previewing scenery objects while FSX is running. This allows very precise and interactive control over the objects placement and orientation without the need to build a BGL and reload FSX.
  • Placing FSX library objects inside a polygon. Allow number of objects and elevation to be specified. Objects will be distributed randomly within the polygon. This can be used to populate livestock, wildlife, boats/ships in harbors, people on beaches, birds, hot air balloons etc
  • FSX_KML_Tags tab - Texture preview for land class polygons and tiles tags
  • FSX_KML_Tags tab - Scenery object preview for default FSX scenery objects
  • Ability to inject a QMID 11 grid into the KML to aid with visualization of exclusion areas
  • New, Open and Save project buttons to support multiple projects.
  • "Check for Update" menu option to check online for updates.
  • If possible conditional display of FSX scenery library objects based on various triggers such as date/time, weather conditions and probability factor. For example, this would allow harbors to be populated with pleasure craft on sunny warm days, but not at night or in cold weather. Would allow forest fires to be generated in hot, windy conditions.
  • If possible ability to animate FSX scenery library objects along a polyline
  • "Photo scenery" ground textures
  • Flight plan generation along polyline