#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include "Types.h"
#include "constants.h"
#include "LatLong-UTMconversion.h"

#ifndef _OSMFUNCTIONS_
#define _OSMFUNCTIONS_

using namespace std;



//Ziskani pozice way
int getPositionWay(vector<int> &Ways_v, long wayID);

// Ziskani nodu a jejich pozice dle way ID
NODES_t getNodesByWayId(DataFile_t &data, long wayId);

// Ziskani souradnice nodu
void getNodePosition(DataFile_t &data, long nodeId, double &lat, double &lon);

// Ziskani way ID podle nodu
void getWayIdByNodeId(DataFile_t &data, long nodeId, DataPos_t &PosNode);

//Vzdalenost dvou bodu
double getDistance(double PointLatA, double PointLatB, double PointLonA, double PointLonB);

//ziskani ID nodu pomoci lat a lon a pozice ve Way a nodu
long getNodeByLL(DataFile_t &data, double lat, double lon, DataPos_t &PosNode);

//Ziskani nejblizsiho bodu pozici ve way a nodu a vzdalenost
double getNearestPoint(DataFile_t &data, double RoundLat, double RoundLon, 
					   double &NearestLat, double &NearestLon, long &Node, DataPos_t &PosNode);

// Prevod do RNDF souradnic
void ConvertToRNDF (DataFile_t &data, vector<int> &Ways_v, string RNDFoutFILE);


#endif 