[postgis-users] Exporting 3D Shape to PostGIS

Kevin Neufeld kneufeld at refractions.net
Fri Feb 8 08:48:37 PST 2008


http://postgis.refractions.net/docs/ch06.html#id2615538

ST_AsText(Geometry) returns the WKT representation according to OGC 
standards, which does not include 3D values.

Try PostGIS's WKT extension instead: ST_AsEWKT(Geometry)

Cheers,
Kevin


Matthew Pulis wrote:
> Hi,
>
>  
>
> I have a 3D Shapefile, which I am trying to export to a PostGIS table.
>
>  
>
> This is the an extract from the ogrinfo on the shape file :
>
>  
>
> yancho at Ubuntu:~$ ogrinfo -so streets3d_new_shps/ testogr
>
> Geometry: 3D Line String
>
> 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.0174532925199433]],
>
>     PROJECTION["Lambert_Conformal_Conic_2SP"],
>
>  
>
>  
>
> I exported this shapefile to PostGIS table and this is the result of this
> query : 
>
>  
>
> select astext(the_geom) from streets_3d where gid=1; :
>
>  
>
> "MULTILINESTRING((625304.649659493 214113.544271209,625301.199687227
> 214078.520974251,625299.489760683 214056.176602372,625299.289850496
> 214050.649031119))"
>
>  
>
> And this is the resulting query from the streets table which is the normal
> 2D table :
>
>  
>
> select astext(the_geom) from streets where gid=1; :
>
>  
>
> "MULTILINESTRING((625304.649659493 214113.544271209,625301.199687227
> 214078.520974251,625299.489760683 214056.176602372,625299.289850496
> 214050.649031119))"
>
>  
>
>  
>
> Any idea what I can do so I can start using elevation on this table please? 
>
>  
>
> Any help will be extremely appreciated
>
>  
>
> Regards
>
>  
>
> Matthew
>
>  
>
>   _____  
>
> I am using the free version of SPAMfighter for private users.
> It has removed 22873 spam emails to date.
> Paying users do not have this message in their emails.
> Try SPAMfighter <http://www.spamfighter.com/len>  for free now!
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   



More information about the postgis-users mailing list