[postgis-users] problem for converting shp to sql on postgis

Meng - Luen Tseng t7ag24 at hotmail.com
Thu Sep 1 12:24:55 PDT 2005


Hi,
  I have one problem. when i using shp2pgsql to convert shp file into sql 
file and run the sql file to insert data into database. The data format is 
like this:


sdb=# select 
st_nm_pref,st_nm_base,st_typ_aft,st_nm_suff,r_refaddr,r_nrefaddr,l_
refaddr,l_nrefaddr,r_postcode,l_postcode,transform(SetSRID(the_geom,4269),26941)
,distance(transform(SetSRID(the_geom,4269),26941), 
transform(GeometryFromText( '
POINT(-121.9722 37.30554)', 4269),26941) ), 
transform(GeometryFromText('POINT(-1
21.9722 37.30554)',4269),26941) from roads where the_geom && 
'BOX3D(-121.9822 37
.29554, -121.9622 37.31554)'::box3d order by distance limit 1;
st_nm_pref | st_nm_base | st_typ_aft | st_nm_suff | r_refaddr | r_nrefaddr | 
l_
refaddr | l_nrefaddr | r_postcode | l_postcode |
                                                                  transform

              |     distance     |                     transform

------------+------------+------------+------------+-----------+------------+---
--------+------------+------------+------------+--------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------+------------------+----------------------------------------------
------
            | ROEWILL    | DR         |            | 1198      | 1000       
| 11
99      | 1001       | 95117      | 95117      | 
01050000203D6900000100000001020
000000500000059C2D9EF2C8E3E41E9758813C8C21041E85877F1248E3E41DB90DCF5D0C21041B7B
A2047228E3E411C01644CDEC21041924E6963218E3E41BD13F615F0C210413CF15C851F8E3E41969
166E36FC71041 | 4.10093259484239 | 
01010000203D690000BD359CE9248E3E41249A41DC53C
41041
(1 row)

The data desplay like Hex on column 'transform'


The correct should be:



sdb=# select 
st_nm_pref,st_nm_base,st_typ_aft,st_nm_suff,r_refaddr,r_nrefaddr,l_
refaddr,l_nrefaddr,r_postcode,l_postcode,transform(SetSRID(the_geom,4269),26941)
,distance(transform(SetSRID(the_geom,4269),26941), 
transform(GeometryFromText( '
POINT(-121.9722 37.30554)', 4269),26941) ), 
transform(GeometryFromText('POINT(-1
21.9722 37.30554)',4269),26941) from roads where the_geom && 
'BOX3D(-121.9822 37
.29554, -121.9622 37.31554)'::box3d order by distance limit 1;
st_nm_pref | st_nm_base | st_typ_aft | st_nm_suff | r_refaddr | r_nrefaddr | 
l_
refaddr | l_nrefaddr | r_postcode | l_postcode |
                                                                transform

         |     distance     |                      transform

------------+------------+------------+------------+-----------+------------+---
--------+------------+------------+------------+--------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------+------------------+---------------------------------------------------
--
            | ROEWILL    | DR         |            | 1198      | 1000       
| 11
99      | 1001       | 95117      | 95117      | 
SRID=26941;MULTILINESTRING((200
2476.93691649 274610.019075242,2002468.94322735 
274612.240099204,2002466.2778431
6 274615.574600235,2002465.38832561 274620.021446521,2002463.52094944 
274907.972
070955)) | 4.10093259485145 | SRID=26941;POINT(2002468.91253982 
274708.965094002
)



Could some body help me how to solve this problem?
Thank you very much.

Allen

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the postgis-users mailing list