Section 1: PREPARING THE COMPUTER TO RUN THE PROJECT


Install maven by following steps described under "installation instructions" on http://maven.apache.org/download.html

check maven installation with "mvn -version" command. if succesful, maven version and java version are printed

give commands to create project folder
	"cd Documents\NetbeansProjects" and 
	"mvn archetype:create -DgroupId=org.geotools.GpsSim -DartifactId=GpsSim"
	
open netbeans, create new project, select maven under categories and maven project with existing POM under projects

select C:\Users\BURKAY\Documents\NetBeansProjects\GpsSim as the project

open project properties window, select sources tab, change source/binary format to 1.5

open pom.xml file under project files category. insert following just below </url> tag

  <properties>
    <geotools.version>2.6.3</geotools.version>
  </properties>
  
  following as a dependency:
  
  <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-main</artifactId>
      <version>${geotools.version}</version>
  </dependency>

  and followings as repositories just below the </dependencies> tag:
  
  <repositories>
	<repository>
	  <id>maven2-repository.dev.java.net</id>
	  <name>Java.net repository</name>
	  <url>http://download.java.net/maven/2</url>
	</repository>
	<repository>
	  <id>osgeo</id>
	  <name>Open Source Geospatial Foundation Repository</name>
	  <url>http://download.osgeo.org/webdav/geotools/</url>
	</repository>
  </repositories>
  
open sample code App.java, import org.geotools.factory.GeoTools and try printing the return value of function GeoTools.getVersion()

add following dependencies which will be needed:

    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-shapefile</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-epsg-hsql</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-swing</artifactId>
        <version>${geotools.version}</version>
    </dependency>

Right click libraries and select "download missing dependencies"


for windows, java se does not supply a library for serial port communication but we need it for the accelerometer part.
following the instructions in http://www.rxtx.org/ you should add rxtx.jar file to "JAVA_HOME\jre\lib\ext"
and rxtxSerial.dll to "JAVA_HOME\jre\bin". a copy of these two files may be found in folder "external files/rxtx"

Section 2: RUNNING THE PROJECT

after importing the project into Netbeans 6.8, there are two files to run. 

First is the GPS simulator which simulates the GPS data.
the class, org.geotools.GpsSim.SimulationInterface.java is under test packages. when it is right clicked and selected the run option,
GPS simulator interface starts running. This program needs a "shp" file which contains the information of railway lines. a copy of our railways.shp file 
may be found in "external files/railways" folder

Every city in the railways.shp file is symbolized with its vehicle registration plate code. For the "station on route" field, the desired path should be
entered one by one. if two consecutive values are not connected in the graph, the program throws exception and will not run. for instance if you want a 
train go from Edirne to Düzce, you should enter the plate codes of all the cities between these two. In this case, the cities are: 

"Edirne,Kırklareli,İstanbul,Kocaeli,Sakarya,Düzce", required input for the field is "22,39,34,41,54,81". be aware that the values are seperated by a comma.


Stations to stop requires a similar input. Just erase the middle values of cities at which you do not want the train to stop. For instance, if your train
will stop only at İstanbul, the input for that field should be "22,34,81"

Ip address is the ip address of the server machine. Multicasting or broadcasting is also supported. 


If simulation mode is selected to be automatic, the train accelerates to the speed limit. If it is in manual mode, you may determine the speed of the train.
to make it realistic, the train does not jump to that speed but accelerates to the speed value you specify.

Second is the accelerometer data converter which converts the acceleration information on three axis into the angle values in two dimensions. (two is enough,
third is the product of them because they are perpendicular to each other) This interface similarly requires an ip and port number to send the generated
data. If you do not have a accelerometer device, the program has the capability to simulate it from a file. If you have an accelerometer device, you should
select the "comm" radio button and enter the communication port which is assigned to the device. a sample accelerometer file is supplied under "external
files/accelerometer" folder.



These two files generates the required data and sends them over network. The sent data may be listened on server side and processed accordingly.


