Skip to content

Commit

Permalink
- Removed unecessary console output
Browse files Browse the repository at this point in the history
- Changed MULTILINESTRING to LINESTRING
- Should work with PostGIS 2.x
  • Loading branch information
dkastl committed Sep 14, 2012
1 parent c65e35e commit 2a20f6e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/ConfigurationParserCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace osm
*/
void ConfigurationParserCallback::StartElement( const char *name, const char** atts )
{
std::cout << "SE for <" << name << ">" << std::endl;
//std::cout << "SE for <" << name << ">" << std::endl;
if( strcmp(name,"class") == 0 )
{
if (atts != NULL)
Expand All @@ -49,19 +49,19 @@ void ConfigurationParserCallback::StartElement( const char *name, const char** a
if( strcmp( key, "id" ) == 0 )
{
id = atol( value );
std::cout << "class id = " << id << std::endl;
//std::cout << "class id = " << id << std::endl;

}
else if( strcmp( key, "name" ) == 0 )
{
name = value;
std::cout << "class name = " << name << std::endl;
//std::cout << "class name = " << name << std::endl;
}
}
if( id>0 && !name.empty() )
{
m_pActType->AddClass( new Class( id, name ) );
std::cout << "class id = "<<id<<" name = " << name << " added to type name=" << m_pActType->name << std::endl;
//std::cout << "class id = "<<id<<" name = " << name << " added to type name=" << m_pActType->name << std::endl;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Export2DB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void Export2DB::createTables()
}

std::cout << "Nodes table created" << std::endl;
result = PQexec(mycon, "CREATE TABLE ways (gid integer, class_id integer not null, length double precision, name char(200), x1 double precision, y1 double precision, x2 double precision,y2 double precision, reverse_cost double precision,rule text, to_cost double precision, osm_id integer); SELECT AddGeometryColumn('ways','the_geom',4326,'MULTILINESTRING',2);");
result = PQexec(mycon, "CREATE TABLE ways (gid integer, class_id integer not null, length double precision, name char(200), x1 double precision, y1 double precision, x2 double precision,y2 double precision, reverse_cost double precision,rule text, to_cost double precision, osm_id integer); SELECT AddGeometryColumn('ways','the_geom',4326,'LINESTRING',2);");
if (PQresultStatus(result) != PGRES_COMMAND_OK)
{
std::cerr << PQresultStatus(result);
Expand Down
8 changes: 4 additions & 4 deletions src/OSMDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ void OSMDocument::SplitWays()



//GeometryFromText('MULTILINESTRING(('||x1||' '||y1||','||x2||' '||y2||'))',4326);
//GeometryFromText('LINESTRING('||x1||' '||y1||','||x2||' '||y2||')',4326);

splitted_way->geom="MULTILINESTRING(("+ boost::lexical_cast<std::string>(node->lon) + " " + boost::lexical_cast<std::string>(node->lat) +",";
splitted_way->geom="LINESTRING("+ boost::lexical_cast<std::string>(node->lon) + " " + boost::lexical_cast<std::string>(node->lat) +",";

splitted_way->AddNodeRef(node);

Expand All @@ -137,7 +137,7 @@ void OSMDocument::SplitWays()
if(length<0)
length*=-1;
splitted_way->length+=length;
splitted_way->geom+= boost::lexical_cast<std::string>(secondNode->lon) + " " + boost::lexical_cast<std::string>(secondNode->lat) + "))";
splitted_way->geom+= boost::lexical_cast<std::string>(secondNode->lon) + " " + boost::lexical_cast<std::string>(secondNode->lat) + ")";

}
else if(backNode==(*it_node))
Expand All @@ -148,7 +148,7 @@ void OSMDocument::SplitWays()
if(length<0)
length*=-1;
splitted_way->length+=length;
splitted_way->geom+= boost::lexical_cast<std::string>(lastNode->lon) + " " + boost::lexical_cast<std::string>(lastNode->lat) + "))";
splitted_way->geom+= boost::lexical_cast<std::string>(lastNode->lon) + " " + boost::lexical_cast<std::string>(lastNode->lat) + ")";
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/osm2pgrouting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int main(int argc, char* argv[])
}
else
{
cout << "unknown paramer: " << argv[i] << endl;
cout << "unknown parameter: " << argv[i] << endl;
_error();
return 1;
}
Expand Down

0 comments on commit 2a20f6e

Please sign in to comment.