Ferries are now extracted with 25 kph average speed.
This commit is contained in:
parent
106155a97a
commit
3bdfd1437b
@ -38,10 +38,11 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
residential 40
|
residential 40
|
||||||
living_street 10
|
living_street 10
|
||||||
service 30
|
service 30
|
||||||
|
ferry 25
|
||||||
*/
|
*/
|
||||||
|
|
||||||
string names[13] = { "motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary", "secondary_link", "tertiary", "unclassified", "residential", "living_street", "service" };
|
string names[14] = { "motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary", "secondary_link", "tertiary", "unclassified", "residential", "living_street", "service", "ferry" };
|
||||||
double speeds[13] = { 110, 90, 90, 70, 70, 60, 60, 50, 55, 50, 40 , 10, 30};
|
double speeds[14] = { 110, 90, 90, 70, 70, 60, 60, 50, 55, 50, 40 , 10, 30, 25};
|
||||||
|
|
||||||
struct _Node : NodeInfo{
|
struct _Node : NodeInfo{
|
||||||
bool trafficSignal;
|
bool trafficSignal;
|
||||||
@ -80,6 +81,12 @@ struct _Way {
|
|||||||
short type;
|
short type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _Relation {
|
||||||
|
enum {
|
||||||
|
unknown = 0, ferry
|
||||||
|
} type;
|
||||||
|
};
|
||||||
|
|
||||||
struct _Edge {
|
struct _Edge {
|
||||||
_Edge() {};
|
_Edge() {};
|
||||||
_Edge(NodeID s, NodeID t) : start(s), target(t) { }
|
_Edge(NodeID s, NodeID t) : start(s), target(t) { }
|
||||||
@ -210,6 +217,15 @@ _Way _ReadXMLWay( xmlTextReaderPtr& inputReader, Settings& settings ) {
|
|||||||
way.maximumSpeed = 10;
|
way.maximumSpeed = 10;
|
||||||
way.usefull = true;
|
way.usefull = true;
|
||||||
}
|
}
|
||||||
|
} else if ( xmlStrEqual( k, ( const xmlChar* ) "route" ) == 1 ) {
|
||||||
|
string route( (const char* ) value );
|
||||||
|
if (route == "ferry") {
|
||||||
|
for ( int i = 0; i < settings.speedProfile.names.size(); i++ ) {
|
||||||
|
way.maximumSpeed = 25;
|
||||||
|
way.usefull = true;
|
||||||
|
way.direction == _Way::oneway;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if ( xmlStrEqual( k, ( const xmlChar* ) "highway" ) == 1 ) {
|
} else if ( xmlStrEqual( k, ( const xmlChar* ) "highway" ) == 1 ) {
|
||||||
string name( ( const char* ) value );
|
string name( ( const char* ) value );
|
||||||
for ( int i = 0; i < settings.speedProfile.names.size(); i++ ) {
|
for ( int i = 0; i < settings.speedProfile.names.size(); i++ ) {
|
||||||
@ -374,6 +390,13 @@ _Node _ReadXMLNode( xmlTextReaderPtr& inputReader ) {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Relation _ReadXMLRelation ( xmlTextReaderPtr& inputReader ) {
|
||||||
|
_Relation relation;
|
||||||
|
relation.type = _Relation::unknown;
|
||||||
|
|
||||||
|
return relation;
|
||||||
|
}
|
||||||
|
|
||||||
double ApproximateDistance( const int lat1, const int lon1, const int lat2, const int lon2 ) {
|
double ApproximateDistance( const int lat1, const int lon1, const int lat2, const int lon2 ) {
|
||||||
static const double DEG_TO_RAD = 0.017453292519943295769236907684886;
|
static const double DEG_TO_RAD = 0.017453292519943295769236907684886;
|
||||||
///Earth's quatratic mean radius for WGS-84
|
///Earth's quatratic mean radius for WGS-84
|
||||||
|
@ -88,7 +88,7 @@ int main (int argc, char *argv[])
|
|||||||
SignalNodes.push_back( node.id );
|
SignalNodes.push_back( node.id );
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ( xmlStrEqual( currentName, ( const xmlChar* ) "way" ) == 1 ) {
|
if ( xmlStrEqual( currentName, ( const xmlChar* ) "way" ) == 1 ) {
|
||||||
_Way way = _ReadXMLWay( inputReader, settings );
|
_Way way = _ReadXMLWay( inputReader, settings );
|
||||||
|
|
||||||
if ( way.usefull && way.access && way.path.size() ) {
|
if ( way.usefull && way.access && way.path.size() ) {
|
||||||
@ -117,6 +117,9 @@ int main (int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if ( xmlStrEqual( currentName, ( const xmlChar* ) "relation" ) == 1 ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
xmlFree( currentName );
|
xmlFree( currentName );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user