3D Streets Data

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

3D Streets Data

Yancho

Hi,

 

First of all Happy New Year to all on the list J

 

I am trying to build a 3D Street Network, thus where the streets have elevation so I can do routing depending on slope level.

 

I am using the GRASS Book Dataset of North Carolina.

 

I tried to combine : streets_wake and elev_state_500m layers together, using the v.drape :

v.drape in=streets_wake rast=elev_state_500m method=bilinear out=streets3d

 

But to no avail. This is the v.info on streets3d :

 

|   Number of lines:        49746           Number of islands:    0          |

 |   Number of boundaries:   0               Number of faces:      0          |

 |   Number of centroids:    0               Number of kernels:    0          |

 |                                                                            |

 |   Map is 3D:              1                                                |

 |   Number of dblinks:      1                                                |

 |                                                                            |

 |         Projection: Lambert Conformal Conic                                |

 |               N:   258102.57210146    S:   196653.34855345                 |

 |               E:   676816.24830376    W:    610869.3848495                 |

 |               B:       49.16141063    T:      156.87280191                 |

 

The result of streets3d ended up exactly as streets_wake without any altitude data.

 

Any idea how I can do this endeavour please? I am planning the dataset for routing using pGRouting afterwards.

 

Thanks and regards

 

Matthew

 


I am using the free version of SPAMfighter for private users.
It has removed 19049 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!


_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

RE: 3D Streets Data

Yancho

Hi again,

 

I am really sorry I am sending again but I have tried to read many documents on how to use v.drape all gave me the same conclusions I did here.

 

Is there some extra information you might require that I make available in order to get some knowledge on this situation please?

 

Also anyone can suggest how I can work out my problem without using v.drape please?

 

Thanks again J

 

Matthew

 

From: Matthew Pulis [mailto:[hidden email]]
Sent: Saturday, January 05, 2008 6:33 PM
To: '[hidden email]'
Subject: 3D Streets Data

 

Hi,

 

First of all Happy New Year to all on the list J

 

I am trying to build a 3D Street Network, thus where the streets have elevation so I can do routing depending on slope level.

 

I am using the GRASS Book Dataset of North Carolina.

 

I tried to combine : streets_wake and elev_state_500m layers together, using the v.drape :

v.drape in=streets_wake rast=elev_state_500m method=bilinear out=streets3d

 

But to no avail. This is the v.info on streets3d :

 

|   Number of lines:        49746           Number of islands:    0          |

 |   Number of boundaries:   0               Number of faces:      0          |

 |   Number of centroids:    0               Number of kernels:    0          |

 |                                                                            |

 |   Map is 3D:              1                                                |

 |   Number of dblinks:      1                                                |

 |                                                                            |

 |         Projection: Lambert Conformal Conic                                |

 |               N:   258102.57210146    S:   196653.34855345                 |

 |               E:   676816.24830376    W:    610869.3848495                 |

 |               B:       49.16141063    T:      156.87280191                 |

 

The result of streets3d ended up exactly as streets_wake without any altitude data.

 

Any idea how I can do this endeavour please? I am planning the dataset for routing using pGRouting afterwards.

 

Thanks and regards

 

Matthew

 


I am using the free version of SPAMfighter for private users.
It has removed 19049 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!

 


I am using the free version of SPAMfighter for private users.
It has removed 19198 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!


_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: RE: 3D Streets Data [v.drape]

Dylan Beaudette-2
On Thursday 10 January 2008, Matthew Pulis wrote:

> Hi again,
>
>
>
> I am really sorry I am sending again but I have tried to read many
> documents on how to use v.drape all gave me the same conclusions I did
> here.
>
>
>
> Is there some extra information you might require that I make available in
> order to get some knowledge on this situation please?
>
>
>
> Also anyone can suggest how I can work out my problem without using v.drape
> please?
>
>
>
> Thanks again J
>
>
>
> Matthew
>


This is odd behavior indeed. The usage of v.drape is relatively simple, and
the only problem that one might encounter is when the elevation surface does
not extend beyond the extents of the input 2D vector.

Some questions:

1. are you sure that you are working with a vector file which contains lines
(not boundaries) ? If this is the case v.drape will exit with an error- but
will leave an unfinished output vector (I need to fix this!)

2. can you give some examples on how you are invoking the command?



I just gave it a try in the Spearfish dataset

# digit new line:
v.in.ascii --o format=standard out=newline << EOF
VERTI:
L  12 1
 594003.22429907 4917469.71962617
 594772.28971963 4919333.22429907
 596280.8411215 4920102.28971963
 598292.24299065 4920545.98130841
 599652.89719626 4920338.92523364
 600214.90654206 4919717.75700935
 601900.93457944 4918978.27102804
 602581.26168224 4919214.90654206
 603439.06542056 4920753.03738318
 603379.90654206 4921581.26168224
 603734.85981308 4922675.70093458
 604710.98130841 4922646.12149533
 1     1
EOF

# convert to 3D
v.drape in=newline out=newline3d rast=elevation.dem

# check:
v.info # looks ok!

# dump for testing:
VERTI:
L  12 1
 594003.22429907 4917469.71962617 1454        
 594772.28971963 4919333.22429907 1580        
 596280.8411215 4920102.28971963 1490        
 598292.24299065 4920545.98130841 1373        
 599652.89719626 4920338.92523364 1439        
 600214.90654206 4919717.75700935 1457        
 601900.93457944 4918978.27102804 1328        
 602581.26168224 4919214.90654206 1345        
 603439.06542056 4920753.03738318 1266        
 603379.90654206 4921581.26168224 1221        
 603734.85981308 4922675.70093458 1182        
 604710.98130841 4922646.12149533 1198        
 1     1



The last column is the elevation.

I will look over the source code, and will try and get the bad behavior noted
above fixed. Any devs have some hints on cleaning up if a module fails to
complete?

Cheers,

Dylan





>
> From: Matthew Pulis [mailto:[hidden email]]
> Sent: Saturday, January 05, 2008 6:33 PM
> To: '[hidden email]'
> Subject: 3D Streets Data
>
>
>
> Hi,
>
>
>
> First of all Happy New Year to all on the list J
>
>
>
> I am trying to build a 3D Street Network, thus where the streets have
> elevation so I can do routing depending on slope level.
>
>
>
> I am using the GRASS Book Dataset of North Carolina.
>
>
>
> I tried to combine : streets_wake and elev_state_500m layers together,
> using the v.drape :
>
> v.drape in=streets_wake rast=elev_state_500m method=bilinear out=streets3d
>
> But to no avail. This is the v.info on streets3d :
> |   Number of lines:        49746           Number of islands:    0
> |
>  |   Number of boundaries:   0               Number of faces:      0
>  |
>  |
>  |   Number of centroids:    0               Number of kernels:    0
>  |
>  |
>  |
>  |
>  |
>  |   Map is 3D:              1
>  |
>  |
>  |   Number of dblinks:      1
>  |
>  |
>  |
>  |
>  |
>  |         Projection: Lambert Conformal Conic
>  |
>  |
>  |               N:   258102.57210146    S:   196653.34855345
>  |
>  |
>  |               E:   676816.24830376    W:    610869.3848495
>  |
>  |
>  |               B:       49.16141063    T:      156.87280191
>
> The result of streets3d ended up exactly as streets_wake without any
> altitude data.
>
>
>
> Any idea how I can do this endeavour please? I am planning the dataset for
> routing using pGRouting afterwards.
>
>
>
> Thanks and regards
>
>
>
> Matthew
>
>
>
>   _____
>
> I am using the free version of SPAMfighter for private users.
> It has removed 19049 spam emails to date.
> Paying users do not have this message in their emails.
> Try SPAMfighter <http://www.spamfighter.com/len>  for free now!
>
>
>
>   _____
>
> I am using the free version of SPAMfighter for private users.
> It has removed 19198 spam emails to date.
> Paying users do not have this message in their emails.
> Try SPAMfighter <http://www.spamfighter.com/len>  for free now!



--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: 3D Streets Data

Markus Neteler
In reply to this post by Yancho
On Jan 5, 2008 6:32 PM, Matthew Pulis <[hidden email]> wrote:

>
>
>
>
> Hi,
>
>
>
> First of all Happy New Year to all on the list J
>
>
>
> I am trying to build a 3D Street Network, thus where the streets have
> elevation so I can do routing depending on slope level.
>
>
>
> I am using the GRASS Book Dataset of North Carolina.
>
>
>
> I tried to combine : streets_wake and elev_state_500m layers together, using
> the v.drape :
>
> v.drape in=streets_wake rast=elev_state_500m method=bilinear out=streets3d
>
>
>
> But to no avail. This is the v.info on streets3d :
>
>
>
> |   Number of lines:        49746           Number of islands:    0
> |
>
>  |   Number of boundaries:   0               Number of faces:      0
> |
>
>  |   Number of centroids:    0               Number of kernels:    0
> |
>
>  |
> |
>
>  |   Map is 3D:              1
> |
>
>  |   Number of dblinks:      1
> |
>
>  |
> |
>
>  |         Projection: Lambert Conformal Conic
> |
>
>  |               N:   258102.57210146    S:   196653.34855345
> |
>
>  |               E:   676816.24830376    W:    610869.3848495
> |
>
>  |               B:       49.16141063    T:      156.87280191
> |

As you see - the data are 3D!


I run
g.region vect=streets_wake res=100 -pa
v.drape in=streets_wake rast=elev_state_500m method=bilinear out=streets3d
#
r.mapcalc sealevel=0
nviz el=sealevel vect=streets3d

Looks pretty much 3D (sorry for flat terrain there...).

Check also
v.out.ascii streets3d format=standard | head -50
ORGANIZATION: NC OneMap
DIGIT DATE:   Nov 7 6
DIGIT NAME:   helena
MAP NAME:     Wake County roads and streets (lines map)
MAP DATE:     Tue Nov  7 20:04:56 2006
MAP SCALE:    1
OTHER INFO:
ZONE:         0
MAP THRESH:   0.000000
VERTI:
L  4 1
 625304.64965949 214113.54427121 111.15730809
 625301.19968723 214078.52097425 111.15730809
 625299.48976068 214056.17660237 111.15730809
 625299.2898505 214050.64903112 111.15730809
 1     1
L  4 1
 670282.21275792 227601.93222423 80.19490021
 670374.57454089 227594.34858999 80.19490021
 670445.44075096 227585.49027471 80.19490021
 670480.4596783 227576.2012396 82.07733239
 1     2
L  2 1
 640859.16790248 227574.18138204 107.09736996
 640807.37009659 227572.59333673 107.09736996
 1     3
...

Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Fwd: 3D Streets Data

Yancho



Hi Markus,

Thanks alot for your help :)

v.out.ascii on my streets3d gave me :

GRASS 6.3.0RC1 (nc_spm_06):/usr/include > v.out.ascii streets3d format=standard | head -50
ORGANIZATION: NC OneMap
DIGIT DATE: Nov 7 6
DIGIT NAME: helena
MAP NAME: Wake County roads and streets (lines map)
MAP DATE: Tue Nov 7 20:04:56 2006
MAP SCALE: 1
OTHER INFO:
ZONE: 0
MAP THRESH: 0.000000
VERTI:
L 4 1
625304.64965949 214113.54427121 110.63827327
625301.19968723 214078.52097425 110.53516127
625299.48976068 214056.17660237 110.46902923
625299.2898505 214050.64903112 110.45167028
1 1
L 4 1
670282.21275792 227601.93222423 77.30562497
670374.57454089 227594.34858999 77.75031661
670445.44075096 227585.49027471 78.06294622
670480.4596783 227576.2012396 78.16904676
1 2
L 2 1
640859.16790248 227574.18138204 101.43534006
640807.37009659 227572.59333673 102.82421757
1 3
L 3 1
641027.66472275 226005.86943382 101.61656721
641029.28632052 226018.73890562 101.82055249
641027.87805392 226096.09665666 103.0005327
1 4
L 4 1
650813.12379857 226001.6206011 63.07461956
650817.8816922 226025.06362068 62.85028877
650825.19690683 226054.93404143 62.54284598
650837.89284223 226126.89484171 61.86218497
1 5
L 4 1
657988.42877208 239117.08507621 101.59256415
657999.49858403 239106.02572014 101.24871757
658006.91367573 239097.03756468 105.86902948
658014.55349082 239087.3753951 105.64730814
1 6
L 10 1
658852.96011106 240354.2803688 123.12467481
658856.76542719 240347.57596483 123.13784494
658860.93295374 240341.59644987 123.16069965
658865.82536929 240335.97914532 123.1962029
658871.44267384 240331.08672976 123.24659675
658878.14707781 240326.01313098 123.31148144



I followed your instructions (except the nviz one - since I do not have it installed) and this is the v.ascii  on the new streets3d_new level I recreated using your method :

GRASS 6.3.0RC1 (nc_spm_06):/usr/include > v.out.ascii streets3d_new format=standard | head -50

ORGANIZATION: NC OneMap
DIGIT DATE: Nov 7 6
DIGIT NAME: helena
MAP NAME: Wake County roads and streets (lines map)
MAP DATE: Tue Nov 7 20:04:56 2006
MAP SCALE: 1
OTHER INFO:
ZONE: 0
MAP THRESH: 0.000000
VERTI:
L 4 1
625304.64965949 214113.54427121 111.15730809
625301.19968723 214078.52097425 111.15730809
625299.48976068 214056.17660237 111.15730809
625299.2898505 214050.64903112 111.15730809
1 1
L 4 1
670282.21275792 227601.93222423 80.19490021
670374.57454089 227594.34858999 80.19490021
670445.44075096 227585.49027471 80.19490021
670480.4596783 227576.2012396 82.07733239
1 2
L 2 1
640859.16790248 227574.18138204 107.09736996
640807.37009659 227572.59333673 107.09736996
1 3
L 3 1
641027.66472275 226005.86943382 102.38978817
641029.28632052 226018.73890562 103.15115211
641027.87805392 226096.09665666 107.85202063
1 4
L 4 1
650813.12379857 226001.6206011 67.55276255
650817.8816922 226025.06362068 67.11642843
650825.19690683 226054.93404143 65.72167216
650837.89284223 226126.89484171 65.72167216
1 5
L 4 1
657988.42877208 239117.08507621 110.0050774
657999.49858403 239106.02572014 109.75625556
658006.91367573 239097.03756468 111.837334
658014.55349082 239087.3753951 111.66560996
1 6
L 10 1
658852.96011106 240354.2803688 115.85651881
658856.76542719 240347.57596483 115.85651881
658860.93295374 240341.59644987 115.85651881
658865.82536929 240335.97914532 115.85651881
658871.44267384 240331.08672976 115.85651881
658878.14707781 240326.01313098 115.85651881




As you can see the Z coordinate did change. However, the problem is that when I exported this layer to a shape file to load it from QGis, and when I exported this to a PostGIS database there is no showings of the Altitude layer. 

Technically I do not need to see the altitude however it is important that altitude can be read since I need to make routing using the Altitude constraint.

Any help will be extremely appreciated

Thanks for your help already :)




On 1/11/08, Markus Neteler <[hidden email]> wrote:
On Jan 5, 2008 6:32 PM, Matthew Pulis <[hidden email]> wrote:

>
>
>
>
> Hi,
>
>
>
> First of all Happy New Year to all on the list J
>
>
>
> I am trying to build a 3D Street Network, thus where the streets have
> elevation so I can do routing depending on slope level.
>
>
>
> I am using the GRASS Book Dataset of North Carolina.
>
>
>
> I tried to combine : streets_wake and elev_state_500m layers together, using
> the v.drape :
>

> v.drape in=streets_wake rast=elev_state_500m method=bilinear out=streets3d
>
>
>
> But to no avail. This is the <a href="http://v.info" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> v.info on streets3d :
>
>
>
> |   Number of lines:        49746           Number of islands:    0
> |
>
>  |   Number of boundaries:   0               Number of faces:      0
> |
>
>  |   Number of centroids:    0               Number of kernels:    0
> |
>
>  |
> |
>

>  |   Map is 3D:              1
> |
>
>  |   Number of dblinks:      1
> |
>
>  |
> |
>
>  |         Projection: Lambert Conformal Conic
> |
>
>  |               N:   258102.57210146    S:   196653.34855345
> |
>
>  |               E:   676816.24830376    W:    610869.3848495
> |
>
>  |               B:       49.16141063    T:       156.87280191
> |

As you see - the data are 3D!


I run
g.region vect=streets_wake res=100 -pa
v.drape in=streets_wake rast=elev_state_500m method=bilinear out=streets3d
#
r.mapcalc sealevel=0
nviz el=sealevel vect=streets3d

Looks pretty much 3D (sorry for flat terrain there...).

Check also
v.out.ascii streets3d format=standard | head -50
ORGANIZATION: NC OneMap
DIGIT DATE:   Nov 7 6
DIGIT NAME:   helena
MAP NAME:     Wake County roads and streets (lines map)
MAP DATE:     Tue Nov  7 20:04:56 2006
MAP SCALE:    1
OTHER INFO:
ZONE:         0
MAP THRESH:   0.000000
VERTI:
L  4 1
625304.64965949 214113.54427121 111.15730809
625301.19968723 214078.52097425 111.15730809
625299.48976068 214056.17660237 111.15730809
625299.2898505 214050.64903112 111.15730809
1     1
L  4 1
670282.21275792 227601.93222423 80.19490021
670374.57454089 227594.34858999 80.19490021
670445.44075096 227585.49027471 80.19490021
670480.4596783 227576.2012396 82.07733239
1     2
L  2 1
640859.16790248 227574.18138204 107.09736996
640807.37009659 227572.59333673 107.09736996
1     3
...

Markus



--
Matthew Pulis
URL : <a href="http://www.solutions-lab.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.solutions-lab.net
MSN : pulis_matthew[@]hotmail.com
ICQ : 145951110
Skype : <a href="http://solutions-lab.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">solutions-lab.net


--
Matthew Pulis
URL : http://www.solutions-lab.net
MSN : pulis_matthew[@]hotmail.com
ICQ : 145951110
Skype : solutions-lab.net
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: 3D Streets Data

Markus Neteler
On Jan 13, 2008 6:06 PM, Matthew Pulis <[hidden email]> wrote:
...
> However, the problem is that
> when I exported this layer to a shape file to load it from QGis, and when I
> exported this to a PostGIS database there is no showings of the Altitude
> layer.

Did you check the manual?

   Export 3D lines from GRASS vector map to Shapefile format:
       v.out.ogr     input=lines_3d    type=line    dsn=/tmp
olayer=testogr lco="SHPT=ARCZ"

Without lco= it won't work...

Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

RE: 3D Streets Data

Yancho
Thanks for your prompt answer Markus.

The v.out.ogr is what I tried before, but redid it on the new shape-file.
These are the first row of the new data :

wkt_geom,cat,STSEG,STID,STNAME,DIR_PRE,DIR_SUF,STYPE,CLASS,F_ELEV,T_ELEV,MAP
,PRIV,FRLEFT,TOLEFT,FRRIGHT,TORIGHT,FRLEFT_A,TOLEFT_A,FRRIGHT_A,TORIGHT_A,ST
ATEROAD,CARTONAME,CORP,SPEED,ONE_WAY,CLASSNAME,L_ZIPNAME,R_ZIPNAME,FT_COST,T
F_COST,LABELNAME,F_NODE,T_NODE,CARTOLEVEL,SHAPE_LEN
LINESTRING(625304.649659 214113.544271, 625301.199687 214078.520974,
625299.489761 214056.176602, 625299.289850
214050.649031),1,36074,20863,FIREFLY,,,RD,12,8,8,W0750-03,,101,199,100,198,1
01,119,100,118,0,FIREFLY RD,HS,25,BI,CITY,HOLLY SPRINGS,HOLLY
SPRINGS,0.094452,0.094452,FIREFLY RD,0,0,,207.131131

This is how I generated the shape file :

GRASS 6.3.0RC1 (nc_spm_06):~ > v.out.ogr input=streets3d_new type=line
dsn=streets3d_new_shps olayer=testogr lco="SPHT=ARCZ"

Ogrinfo on the streets3d new shape file gave me :

GRASS 6.3.0RC1 (nc_spm_06):~ > ogrinfo streets3d_new_shps/
INFO: Open of `streets3d_new_shps/'
using driver `ESRI Shapefile' successful.
1: testogr (Line String)

What I am seeing wrong is that there is no extra column being added to the
dataset which contains the elevation. I am attaching a screenshot which
shows this : http://solutions-lab.net/thesis/elevation.jpg

Am I testing the wrong way? If yes can you please mention some keywords I
can use to search for such operation please? I tried to google for a way out
of this problem but am really stuck.

Thanks a lot :)

Matthew

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Markus Neteler
Sent: Sunday, January 13, 2008 6:57 PM
To: Matthew Pulis
Cc: [hidden email]
Subject: Re: [GRASS-user] 3D Streets Data

On Jan 13, 2008 6:06 PM, Matthew Pulis <[hidden email]> wrote:
...
> However, the problem is that
> when I exported this layer to a shape file to load it from QGis, and when
I
> exported this to a PostGIS database there is no showings of the Altitude
> layer.

Did you check the manual?

   Export 3D lines from GRASS vector map to Shapefile format:
       v.out.ogr     input=lines_3d    type=line    dsn=/tmp
olayer=testogr lco="SHPT=ARCZ"

Without lco= it won't work...

Markus

--
I am using the free version of SPAMfighter for private users.
It has removed 19279 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: 3D Streets Data

sebastian sauer-2
Matthew,

Sun 13 Jan 2008 22:20, Matthew Pulis wrote:
> GRASS 6.3.0RC1 (nc_spm_06):~ > v.out.ogr input=streets3d_new type=line
> dsn=streets3d_new_shps olayer=testogr lco="SPHT=ARCZ"
according to frank warmerdam's excellent doc, other options for you would
be: POINTZ || POLYGONZ || MULTIPOINTZ
http://www.gdal.org/ogr/drv_shapefile.html

http://grass.gdf-hannover.de/wiki/Vectordata#ESRI_Shapefile

(darkly i remember i once used POINTZ, and had no problems with it)

HTH a little,
s.
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: 3D Streets Data

sebastian sauer-2
In reply to this post by Yancho
Sun 13 Jan 2008 22:20, Matthew Pulis wrote:
> What I am seeing wrong is that there is no extra column being added to the
> dataset which contains the elevation. I am attaching a screenshot which
> shows this : http://solutions-lab.net/thesis/elevation.jpg
>
> Am I testing the wrong way?
/me thinks, yes.
if i understand you correctly, you want a 2D shapefile, with the v.drape
output added as an extra category.?

> If yes can you please mention some keywords I
> can use to search for such operation please?
http://grass.itc.it/grass63/manuals/html63_user/v.category.html

s.
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: 3D Streets Data

Markus Neteler
In reply to this post by Yancho
Matthew,

On Jan 13, 2008 10:20 PM, Matthew Pulis <[hidden email]> wrote:

> Thanks for your prompt answer Markus.
>
> The v.out.ogr is what I tried before, but redid it on the new shape-file.
> These are the first row of the new data :
>
> wkt_geom,cat,STSEG,STID,STNAME,DIR_PRE,DIR_SUF,STYPE,CLASS,F_ELEV,T_ELEV,MAP
> ,PRIV,FRLEFT,TOLEFT,FRRIGHT,TORIGHT,FRLEFT_A,TOLEFT_A,FRRIGHT_A,TORIGHT_A,ST
> ATEROAD,CARTONAME,CORP,SPEED,ONE_WAY,CLASSNAME,L_ZIPNAME,R_ZIPNAME,FT_COST,T
> F_COST,LABELNAME,F_NODE,T_NODE,CARTOLEVEL,SHAPE_LEN
> LINESTRING(625304.649659 214113.544271, 625301.199687 214078.520974,
> 625299.489761 214056.176602, 625299.289850
> 214050.649031),1,36074,20863,FIREFLY,,,RD,12,8,8,W0750-03,,101,199,100,198,1
> 01,119,100,118,0,FIREFLY RD,HS,25,BI,CITY,HOLLY SPRINGS,HOLLY
> SPRINGS,0.094452,0.094452,FIREFLY RD,0,0,,207.131131
>
> This is how I generated the shape file :
>
> GRASS 6.3.0RC1 (nc_spm_06):~ > v.out.ogr input=streets3d_new type=line
> dsn=streets3d_new_shps olayer=testogr lco="SPHT=ARCZ"

There is a trick here - avoid typos: It is
 lco="SHPT=ARCZ"
not:
 lco="SPHT=ARCZ"

(I again recommend copy-paste from the manual page)

If you specify lco="SPHT=ARCZ" correctly, it will indicate 3D export:

 v.out.ogr input=streets3d type=line dsn=streets3d_new_shps
olayer=testogr lco="SHPT=ARCZ"
 WARNING: Vector map <streets3d> is 3D. Use format specific layer creation
          options (parameter 'lco') to export in 3D rather than 2D (default)
 Exporting 49746 points/lines...
 ...

(personally I find the "WARNING" here inappropriate since I use lco!)

> Ogrinfo on the streets3d new shape file gave me :
>
> GRASS 6.3.0RC1 (nc_spm_06):~ > ogrinfo streets3d_new_shps/
> INFO: Open of `streets3d_new_shps/'
> using driver `ESRI Shapefile' successful.
> 1: testogr (Line String)

To get useful output, better run

ogrinfo -so streets3d_new_shps/ testogr
INFO: Open of `streets3d_new_shps/'
      using driver `ESRI Shapefile' successful.

Layer name: testogr
Geometry: 3D Line String       <<========= !! worked
Feature Count: 49746
Extent: (610869.384850, 196653.348553) - (676816.248304, 258102.572101)
Layer SRS WKT:
PROJCS["Lambert Conformal Conic",
    GEOGCS["grs80",
        DATUM["North_American_Datum_1983",
            SPHEROID["Geodetic_Reference_System_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",36.16666666666666],
    PARAMETER["standard_parallel_2",34.33333333333334],
    PARAMETER["latitude_of_origin",33.75],
    PARAMETER["central_meridian",-79],
    PARAMETER["false_easting",609601.22],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
cat: Real (11.0)
STSEG: Real (11.0)
STID: Real (11.0)
STNAME: String (80.0)
...


> What I am seeing wrong is that there is no extra column being added to the
> dataset which contains the elevation. I am attaching a screenshot which
> shows this : http://solutions-lab.net/thesis/elevation.jpg

Ah, you want it as *attribute* column? This wasn't clear to me. So far
we worked on creating 3D geometry. Please note that GRASS is not
other proprietary GIS and hence it supports true 3D geometry. But you
can also generate a 2D SHAPE with 3rd dimension as attribute, check
the v.to.db page for this (or enjoy the new GRASS book :-)

good luck,
Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

RE: 3D Streets Data

Yancho
Thanks again Markus,

I am trying to follow your suggestions, and tried to use the v.to.db however
I read that you need to prepare the table first, so am trying to do so :

GRASS 6.3.0RC1 (nc_spm_06):~ > v.db.addtable streets3d columns="the_geom
geometry"
Using vector map name as table name: streets3d
ERROR: There is already a table linked to layer <1>

So I tried to delete the table using v.db.droptable but gave me this :

GRASS 6.3.0RC1 (nc_spm_06):~ > v.db.droptable -f streets3d layer=1

Removing table <streets3d> linked to layer <1> of vector map <streets3d>
Dropping table <streets3d>...
DBMI-Postgres driver error:
Cannot execute:
DROP TABLE streets3d

ERROR:  table "streets3d" does not exist


ERROR: Error while executing: 'DROP TABLE streets3d
       '
ERROR: An error occured while running db.execute
GRASS 6.3.0RC1 (nc_spm_06):~ >

In the whole process there was NO streets3d table created. I am for sure
connected to the PostGIS database and this is the result of my db.connect -p
:
GRASS 6.3.0RC1 (nc_spm_06):~ > db.connect -p
driver:pg
database:host=localhost,dbname=thesis
schema:
group:

I have tried some db.columns, db.describe, db.select commands on the tables
in the database, and they show that I am connected to the database.

The problem then is why it is hard to add a new table streets3d with the 3d
data. I tried to follow the manual but it still gave me that error.

I also tried to run db.test to see if there is a problem with the PostgreSQL
connection but to my eyes there are no significant problems :
GRASS 6.3.0RC1 (nc_spm_06):~ > db.test test=test1
create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))
EXECUTE: OK
insert into grass_test1 values ( 1, 123.456, 'abcd' )
EXECUTE: OK
insert into grass_test1 values ( 2, null, 'xxx' )
EXECUTE: OK
select * from grass_test1
EXECUTE: OK
1c1
< 1|123.456|abcd
---
> 1|123.456000|abcd
ERROR: RESULT: ******** ERROR ********
select c1 from grass_test1 where d1 < 500 / 2 and i1 <> 2  and c1 ~ 'bc'
EXECUTE: OK
RESULT: OK
insert into grass_test1 values ( 3, 0.0, '_''_' )
EXECUTE: OK
alter table grass_test1 add column i2 integer
EXECUTE: OK
update grass_test1 set d1 = 18.6, i2 = 987  where i1 = 2
EXECUTE: OK
select * from grass_test1
EXECUTE: OK
1,3c1,3
< 1|123.456|abcd|
< 3|0|_'_|
< 2|18.6|xxx|987
---
> 1|123.456000|abcd|
> 2|18.600000|xxx|987
> 3|0.000000|_'_|
ERROR: RESULT: ******** ERROR ********
drop table grass_test1
EXECUTE: OK
GRASS 6.3.0RC1 (nc_spm_06):~ >


Anyone else has any suggestion please on how I can import this 3d data file
into PostGIS please?

Thanks a lot for your continous support and sorry for so many questions :(


( BTW is there an online version of the Grass book I can buy? Since I am
really getting fed up of waiting for it to come by post :\ )

Matthew

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Markus Neteler
Sent: Monday, January 14, 2008 9:44 AM
To: Matthew Pulis
Cc: [hidden email]
Subject: Re: [GRASS-user] 3D Streets Data

Matthew,

On Jan 13, 2008 10:20 PM, Matthew Pulis <[hidden email]> wrote:
> Thanks for your prompt answer Markus.
>
> The v.out.ogr is what I tried before, but redid it on the new shape-file.
> These are the first row of the new data :
>
>
wkt_geom,cat,STSEG,STID,STNAME,DIR_PRE,DIR_SUF,STYPE,CLASS,F_ELEV,T_ELEV,MAP
>
,PRIV,FRLEFT,TOLEFT,FRRIGHT,TORIGHT,FRLEFT_A,TOLEFT_A,FRRIGHT_A,TORIGHT_A,ST
>
ATEROAD,CARTONAME,CORP,SPEED,ONE_WAY,CLASSNAME,L_ZIPNAME,R_ZIPNAME,FT_COST,T
> F_COST,LABELNAME,F_NODE,T_NODE,CARTOLEVEL,SHAPE_LEN
> LINESTRING(625304.649659 214113.544271, 625301.199687 214078.520974,
> 625299.489761 214056.176602, 625299.289850
>
214050.649031),1,36074,20863,FIREFLY,,,RD,12,8,8,W0750-03,,101,199,100,198,1
> 01,119,100,118,0,FIREFLY RD,HS,25,BI,CITY,HOLLY SPRINGS,HOLLY
> SPRINGS,0.094452,0.094452,FIREFLY RD,0,0,,207.131131
>
> This is how I generated the shape file :
>
> GRASS 6.3.0RC1 (nc_spm_06):~ > v.out.ogr input=streets3d_new type=line
> dsn=streets3d_new_shps olayer=testogr lco="SPHT=ARCZ"

There is a trick here - avoid typos: It is
 lco="SHPT=ARCZ"
not:
 lco="SPHT=ARCZ"

(I again recommend copy-paste from the manual page)

If you specify lco="SPHT=ARCZ" correctly, it will indicate 3D export:

 v.out.ogr input=streets3d type=line dsn=streets3d_new_shps
olayer=testogr lco="SHPT=ARCZ"
 WARNING: Vector map <streets3d> is 3D. Use format specific layer creation
          options (parameter 'lco') to export in 3D rather than 2D (default)
 Exporting 49746 points/lines...
 ...

(personally I find the "WARNING" here inappropriate since I use lco!)

> Ogrinfo on the streets3d new shape file gave me :
>
> GRASS 6.3.0RC1 (nc_spm_06):~ > ogrinfo streets3d_new_shps/
> INFO: Open of `streets3d_new_shps/'
> using driver `ESRI Shapefile' successful.
> 1: testogr (Line String)

To get useful output, better run

ogrinfo -so streets3d_new_shps/ testogr
INFO: Open of `streets3d_new_shps/'
      using driver `ESRI Shapefile' successful.

Layer name: testogr
Geometry: 3D Line String       <<========= !! worked
Feature Count: 49746
Extent: (610869.384850, 196653.348553) - (676816.248304, 258102.572101)
Layer SRS WKT:
PROJCS["Lambert Conformal Conic",
    GEOGCS["grs80",
        DATUM["North_American_Datum_1983",
 
SPHEROID["Geodetic_Reference_System_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",36.16666666666666],
    PARAMETER["standard_parallel_2",34.33333333333334],
    PARAMETER["latitude_of_origin",33.75],
    PARAMETER["central_meridian",-79],
    PARAMETER["false_easting",609601.22],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
cat: Real (11.0)
STSEG: Real (11.0)
STID: Real (11.0)
STNAME: String (80.0)
...


> What I am seeing wrong is that there is no extra column being added to the
> dataset which contains the elevation. I am attaching a screenshot which
> shows this : http://solutions-lab.net/thesis/elevation.jpg

Ah, you want it as *attribute* column? This wasn't clear to me. So far
we worked on creating 3D geometry. Please note that GRASS is not
other proprietary GIS and hence it supports true 3D geometry. But you
can also generate a 2D SHAPE with 3rd dimension as attribute, check
the v.to.db page for this (or enjoy the new GRASS book :-)

good luck,
Markus

--
I am using the free version of SPAMfighter for private users.
It has removed 19279 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: 3D Streets Data

Markus Neteler
On Jan 14, 2008 4:47 PM, Matthew Pulis <[hidden email]> wrote:
...
> ( BTW is there an online version of the Grass book I can buy? Since I am
> really getting fed up of waiting for it to come by post :\ )

Matthew,

the first printing is sold out - Springer told me that the second printing
should be ready in three weeks.

Yes, there is a digital version, too:
http://www.springerlink.com/content/j21632/

Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user