[pgrouting-users] Syntax error in sampledata_notopo.sql

Hi

I am trying to install and use pgrouting using the attached document. Currently I am in step 5.1(Load network data). It says to create a database and load data in it using the following two commands.

createdb -U postgres pgrouting-workshop

*psql -U postgres -d pgrouting-workshop *
-f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

The first one goes well. When I execute the second command I get some errors. Please check here.
Here is the sampledata_notopo.sql file.

How can I solve this problem?

Thanks

Maruf

pgRoutingWorkshop.pdf (592 KB)

Hi Maruf,

Could be that this version of the workshop is outdated as it’s the one from FOSS4G 2010.
Can you try the workshop FOSS4G 2011 instead?
The most up-to-date content is always the online version: http://workshop.pgrouting.org/

Daniel

On Sat, Mar 9, 2013 at 11:28 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

I am trying to install and use pgrouting using the attached document. Currently I am in step 5.1(Load network data). It says to create a database and load data in it using the following two commands.

createdb -U postgres pgrouting-workshop

*psql -U postgres -d pgrouting-workshop *
-f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

The first one goes well. When I execute the second command I get some errors. Please check here.
Here is the sampledata_notopo.sql file.

How can I solve this problem?

Thanks

Maruf


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

Hi

The problem still occurs. Here is the output.

Previously i replaced all ‘\N’, so it wasn’t in error list. Now I have run the command in original file.

Thanks

Maruf

···

On Sat, Mar 9, 2013 at 8:46 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Hi Maruf,

Could be that this version of the workshop is outdated as it’s the one from FOSS4G 2010.
Can you try the workshop FOSS4G 2011 instead?
The most up-to-date content is always the online version: http://workshop.pgrouting.org/

Daniel

On Sat, Mar 9, 2013 at 11:28 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

I am trying to install and use pgrouting using the attached document. Currently I am in step 5.1(Load network data). It says to create a database and load data in it using the following two commands.

createdb -U postgres pgrouting-workshop

*psql -U postgres -d pgrouting-workshop *
-f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

The first one goes well. When I execute the second command I get some errors. Please check here.
Here is the sampledata_notopo.sql file.

How can I solve this problem?

Thanks

Maruf


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Here is the original sampledata_notopo.sql file.
https://docs.google.com/file/d/0B3djwV2dbCYZVV9QVjg3TngzUzg/edit?usp=sharing

···

On Sat, Mar 9, 2013 at 9:18 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

The problem still occurs. Here is the output.

Previously i replaced all ‘\N’, so it wasn’t in error list. Now I have run the command in original file.

Thanks

Maruf

On Sat, Mar 9, 2013 at 8:46 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Hi Maruf,

Could be that this version of the workshop is outdated as it’s the one from FOSS4G 2010.
Can you try the workshop FOSS4G 2011 instead?
The most up-to-date content is always the online version: http://workshop.pgrouting.org/

Daniel

On Sat, Mar 9, 2013 at 11:28 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

I am trying to install and use pgrouting using the attached document. Currently I am in step 5.1(Load network data). It says to create a database and load data in it using the following two commands.

createdb -U postgres pgrouting-workshop

*psql -U postgres -d pgrouting-workshop *
-f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

The first one goes well. When I execute the second command I get some errors. Please check here.
Here is the sampledata_notopo.sql file.

How can I solve this problem?

Thanks

Maruf


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Maruf,

In your first email you wrote, that you created a database first. But the database creation is actually part of SQL dump file already.
You can also just login to some other database and then run “\i path/to/sampledata_notopo.sql”

Inside this file it creates the database like this:

CREATE DATABASE “pgrouting-workshop” WITH TEMPLATE = template_routing ENCODING = ‘UTF8’ LC_COLLATE = ‘en_US.UTF-8’ LC_CTYPE = ‘en_US.UTF-8’;

So it is looking for a “template_routing” template database, that was mentioned in a previous chapter.
The errors you posted you need to debug from top. So first it complains about already existing database and second about missing “geometry” things. When using the template database it should work.

Daniel

···

On Sat, Mar 9, 2013 at 9:18 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

The problem still occurs. Here is the output.

Previously i replaced all ‘\N’, so it wasn’t in error list. Now I have run the command in original file.

Thanks

Maruf

On Sat, Mar 9, 2013 at 8:46 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Hi Maruf,

Could be that this version of the workshop is outdated as it’s the one from FOSS4G 2010.
Can you try the workshop FOSS4G 2011 instead?
The most up-to-date content is always the online version: http://workshop.pgrouting.org/

Daniel

On Sat, Mar 9, 2013 at 11:28 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

I am trying to install and use pgrouting using the attached document. Currently I am in step 5.1(Load network data). It says to create a database and load data in it using the following two commands.

createdb -U postgres pgrouting-workshop

*psql -U postgres -d pgrouting-workshop *
-f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

The first one goes well. When I execute the second command I get some errors. Please check here.
Here is the sampledata_notopo.sql file.

How can I solve this problem?

Thanks

Maruf


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Daniel

I have reinstalled everything and started from scratch. However when i execute this command
psql -d routing -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql

it generates this error.

How can I solve this?

Thanks

Maruf

···

On Sat, Mar 9, 2013 at 9:32 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Hi Maruf,

In your first email you wrote, that you created a database first. But the database creation is actually part of SQL dump file already.
You can also just login to some other database and then run “\i path/to/sampledata_notopo.sql”

Inside this file it creates the database like this:

CREATE DATABASE “pgrouting-workshop” WITH TEMPLATE = template_routing ENCODING = ‘UTF8’ LC_COLLATE = ‘en_US.UTF-8’ LC_CTYPE = ‘en_US.UTF-8’;

So it is looking for a “template_routing” template database, that was mentioned in a previous chapter.
The errors you posted you need to debug from top. So first it complains about already existing database and second about missing “geometry” things. When using the template database it should work.

Daniel

On Sun, Mar 10, 2013 at 12:22 AM, maruf rahman <maruf.csdu@gmail.com> wrote:

Here is the original sampledata_notopo.sql file.
https://docs.google.com/file/d/0B3djwV2dbCYZVV9QVjg3TngzUzg/edit?usp=sharing


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

On Sat, Mar 9, 2013 at 9:18 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

The problem still occurs. Here is the output.

Previously i replaced all ‘\N’, so it wasn’t in error list. Now I have run the command in original file.

Thanks

Maruf

On Sat, Mar 9, 2013 at 8:46 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Hi Maruf,

Could be that this version of the workshop is outdated as it’s the one from FOSS4G 2010.
Can you try the workshop FOSS4G 2011 instead?
The most up-to-date content is always the online version: http://workshop.pgrouting.org/

Daniel

On Sat, Mar 9, 2013 at 11:28 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

I am trying to install and use pgrouting using the attached document. Currently I am in step 5.1(Load network data). It says to create a database and load data in it using the following two commands.

createdb -U postgres pgrouting-workshop

*psql -U postgres -d pgrouting-workshop *
-f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

The first one goes well. When I execute the second command I get some errors. Please check here.
Here is the sampledata_notopo.sql file.

How can I solve this problem?

Thanks

Maruf


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Daniel

I have reinstalled everything and started from scratch. However when i execute this command
psql -d routing -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql

it generates this error.

You look at the first error and it already tells you the problem:

psql:/usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql:59: ERROR:  type "spheroid" already exists

So you already have PostGIS added to your database.
Also it seems you’re using PostGIS 2.0 and PostgreSQL 9.1, so you can install PostGIS much easier with “CREATE EXTENSION postgis”.
Be aware that the workshop was written when no PostGIS 2.0 was available yet. So simple copy & paste might not work every time.
Furthermore the sample data in dump files (such as notopo.sql) where created with an older version of PostgreSQL.
This can be a reason why things don’t work.

Daniel

···

On Sat, Mar 9, 2013 at 9:32 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Hi Maruf,

In your first email you wrote, that you created a database first. But the database creation is actually part of SQL dump file already.
You can also just login to some other database and then run “\i path/to/sampledata_notopo.sql”

Inside this file it creates the database like this:

CREATE DATABASE “pgrouting-workshop” WITH TEMPLATE = template_routing ENCODING = ‘UTF8’ LC_COLLATE = ‘en_US.UTF-8’ LC_CTYPE = ‘en_US.UTF-8’;

So it is looking for a “template_routing” template database, that was mentioned in a previous chapter.
The errors you posted you need to debug from top. So first it complains about already existing database and second about missing “geometry” things. When using the template database it should work.

Daniel

On Sun, Mar 10, 2013 at 12:22 AM, maruf rahman <maruf.csdu@gmail.com> wrote:

Here is the original sampledata_notopo.sql file.
https://docs.google.com/file/d/0B3djwV2dbCYZVV9QVjg3TngzUzg/edit?usp=sharing


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

On Sat, Mar 9, 2013 at 9:18 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

The problem still occurs. Here is the output.

Previously i replaced all ‘\N’, so it wasn’t in error list. Now I have run the command in original file.

Thanks

Maruf

On Sat, Mar 9, 2013 at 8:46 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Hi Maruf,

Could be that this version of the workshop is outdated as it’s the one from FOSS4G 2010.
Can you try the workshop FOSS4G 2011 instead?
The most up-to-date content is always the online version: http://workshop.pgrouting.org/

Daniel

On Sat, Mar 9, 2013 at 11:28 PM, maruf rahman <maruf.csdu@gmail.com> wrote:

Hi

I am trying to install and use pgrouting using the attached document. Currently I am in step 5.1(Load network data). It says to create a database and load data in it using the following two commands.

createdb -U postgres pgrouting-workshop

*psql -U postgres -d pgrouting-workshop *
-f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql

The first one goes well. When I execute the second command I get some errors. Please check here.
Here is the sampledata_notopo.sql file.

How can I solve this problem?

Thanks

Maruf


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Daniel,

Now I am at section 6.1.
What are the actual parameters of this query?

shortest_path( sql text,
source_id integer,
target_id integer,
directed boolean,
has_reverse_cost boolean )

Could you please give an original function call, which will work?
Additionally where should I run this? in psql query interface or in normal console?

Maruf