[pgrouting-users] Syntax error in sampledata_notopo.sql

Daniel Kastl daniel at georepublic.de
Sat Mar 9 18:03:25 PST 2013


On Sun, Mar 10, 2013 at 5:38 AM, maruf rahman <maruf.csdu at gmail.com> wrote:

> 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 <http://paste.ubuntu.com/5600036/>.
>

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




>
> How can I solve this?
>
> Thanks
> Maruf
>
>
>
>
> On Sat, Mar 9, 2013 at 9:32 PM, Daniel Kastl <daniel at 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 at gmail.com>wrote:
>>
>>> 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 at gmail.com>wrote:
>>>
>>>> Hi
>>>> The problem still occurs. Here is the output<http://paste.ubuntu.com/5599146/>
>>>> .
>>>> 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 at 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 at 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 <http://paste.ubuntu.com/5598943/>.
>>>>>> Here<https://docs.google.com/file/d/0B3djwV2dbCYZMk1kZS1mQmdYVTg/edit?usp=sharing>is the sampledata_notopo.sql file.
>>>>>>
>>>>>> How can I solve this problem?
>>>>>>
>>>>>> Thanks
>>>>>> Maruf
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Pgrouting-users mailing list
>>>>>> Pgrouting-users at lists.osgeo.org
>>>>>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Georepublic UG & Georepublic Japan
>>>>> eMail: daniel.kastl at georepublic.de
>>>>> Web: http://georepublic.de
>>>>>
>>>>> _______________________________________________
>>>>> Pgrouting-users mailing list
>>>>> Pgrouting-users at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>>>>
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> Pgrouting-users mailing list
>>> Pgrouting-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>>
>>>
>>
>>
>> --
>> Georepublic UG & Georepublic Japan
>> eMail: daniel.kastl at georepublic.de
>> Web: http://georepublic.de
>>
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
>>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>


-- 
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20130310/498636cd/attachment-0001.html>


More information about the Pgrouting-users mailing list