ScenProc

From FSDeveloper Wiki
Revision as of 20:25, 17 October 2011 by Arno (Talk | contribs)

Jump to: navigation, search

Scenery Processor, or scenProc for short, is a tool to process data and create scenery output from it. It can for example import vector data and create autogen AGN files from this data. It is a command line tool, driven by a configuration file. This means the tool is probably more for experienced developers. In the future a graphical user interface might be added, but that is not a high priority issue at this moment.

Getting scenProc

Prerequisites

Microsoft .NET Framework version 2.0

Installation

At this moment scenProc is still under development, but a beta version is already available. Please be aware that this version might have bug left. You can download the latest development release here.

The development release also contains other tools that I made, like ModelConverterX. Just unzip all of these tools to a folder of your choice. That's all the installation.

Usage

scenProc is like a compiler and it is best used from the command prompt. The only argument you need to give to the tool when you are starting it is the configuration file that you want it to process. You can also drag and drop the configuration file on the application, but then you won't be able to see the feedback given by the tool.

Configuration file

In the configuration file you specify what data you want to process and how you want to process it. In the next section the available commands are described. The default extension for scenProc configuration files is SPC, but you can use any extension you want.

All lines starting with a hash (#) are comments and are ignored. Each lines starts with the name of the action you want to perform, followed by arguments of needed. The arguments are separated with a pipe (|) symbol.

Filter

Some processing commands take a filter as input. With this filter you can select the features that match certain attributes. You specify the filter with the syntax:

 ATTRIBUTENAME=VALUE

If you want to specify multiple conditions you separate them with semicolons (;):

 ATTRIBUTENAME1=VALUE1;ATTRIBUTENAME2=VALUE2

Besides the attributes that are present in the source data you imported, there are some special attributes that scenProc adds while importing the data:

  • FTYPE: type of feature (POINT/LINE/POLYGON)
  • FROMFILE: name of the source file that the feature comes from (without path)

Use can use an asterisk (*) to select all features.

Example

Below is an example configuration file to create some autogen.

 # Schiermonnikoog autogen test
 IMPORTSHP|natural_schier.shp|NOREPROJ
 IMPORTSHP|buildings_schier.shp|NOREPROJ
 #
 SPLITGRID|AGN
 #
 SETAGNPROPERTIES|1.0;0.0;0.0;0.0
 CREATEAGNPOLYVEG|FTYPE=POLYGON;type=forest|{e8b937fd-a1f2-4bd5-8548-2c80d30102af}
 CREATEAGNGENBUILD|FTYPE=POLYGON;FROMFILE=buildings_schier.shp|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
 CREATEAGNROWHOUSE|FTYPE=POLYGON;FROMFILE=houses_schier.shp
 CREATEAGNLIBOBJ|FTYPE=POINT;type=light|{0017a263-464f-14fd-f77f-2996fed44864}
 #
 WRITEAGNFILES|c:\flightsim\nl2000\nl2k_v4_resample_FR\texture

Available processing steps

IMPORTSHP

Imports features from an ESRI Shapefile. This command takes the following arguments:

 IMPORTSHP|filename|projection
filename
Path to the file you want to import.
projection
Proj4 string to define the projection that the source data is using. If the projection is already in WGS84 latitude and longitude use NOREPROJ as argument.

SPLITGRID

Splits the features into cells with a given size. This command takes the following arguments:

 IMPORTSHP|gridsize
gridsize
The grid size to use while splitting the features.
  • If you specify AGN for the grid size, the correct LOD square for autogen files will be used automatically.
  • If you specify one value, a square grid cell will be created.
  • If you specify two values, separated by a semicolon (;) a rectangle with the given sizes is used for the cells.

SETAGNPROPERTIES

Sets the properties for the AGN cell. This command takes the following arguments:

 SETAGNPROPERTIES|buildingsize|buildingtexture|rowhousetexture
buildingsize
The size distribution of autogen buildings. You need to specify four values, separated by semicolons (;). These specify the percentage of buildings with the given size:
  • Buildings with 1 to 2 floor (value between 0.0 and 1.0)
  • Buildings with 3 to 5 floor (value between 0.0 and 1.0)
  • Buildings with 6 to 8 floor (value between 0.0 and 1.0)
  • Buildings with 9 to 12 floor (value between 0.0 and 1.0)
buildingtexture
The name of the texture to be used for the autogen buildings. This argument is optional.
rowhousetexture
The name of the texture to be used for the autogen row houses. This argument is optional.

CREATEAGNPOLYVEG

Create an autogen polygon forest from the selected features. This command takes the following arguments:

 CREATEAGNPOLYVEG|filter|guid
filter
Filter to select which features to process
guid
GUID of the vegetation type to use. See FSX SDK for details.

CREATEAGNGENBUILD

Create generic autogen buildings from the selected features. This command takes the following arguments:

 CREATEAGNPOLYVEG|filter|guid|options
filter
Filter to select which features to process
guid
GUID of the vegetation type to use. See FSX SDK for details.
options
Additional options. These are optional. Each option is specified like OPTION=VALUE. If multiple options are given a semicolon (;) is used to separate them. The following options are available:
MAXRATIO
This option specifies the maximum ratio between the length and width of the building. If the ratio is bigger than the value given, the building will be split into multiple smaller buildings. This can be used to convert a footprint of a row of houses into separate houses.

CREATEAGNROWHOUSE

Create autogen row houses from the selected features. This command takes the following arguments:

 CREATEAGNROWHOUSE|filter
filter
Filter to select which features to process

CREATEAGNLIBOBJ

Create an autogen polygon forest from the selected features. This command takes the following arguments:

 CREATEAGNPOLYVEG|filter|guid
filter
Filter to select which features to process
guid
GUID of the vegetation type to use. See FSX SDK for details.


WRITEAGNFILES

Create an autogen polygon forest from the selected features. This command takes the following arguments:

 CREATEAGNPOLYVEG|filter|guid
filter
Filter to select which features to process
guid
GUID of the vegetation type to use. See FSX SDK for details.

Support

If you have any problems while using the program or if you have suggestions and other feedback to improve the tool, please let me know. You can either contact me directly or visit the scenProc subforum at FSDeveloper.com.

User license

(c) 2011 SceneryDesign.org / Arno Gerretsen

This software program is distributed without charge to other addon developers. Redistribution of the original ZIP file is allowed. You are NOT allowed to sell this software program or ask money for its distribution. Special effects created with this software program can be used in commercial scenery projects if you wish.

The copyright and any intellectual property relating to this program remain the property of the author.

The software distributed in this way may represent work in progress, and bears no warranty, either expressed or implied.