[Gdal-dev] ogr2ogr and postgis arbitrary third dimension (mapserver related)

Jean-Denis Giguere jdenisgiguere at fastmail.fm
Thu Feb 10 16:49:27 EST 2005


I used ogr2ogr (GDAL 1.2.5.0, released 2004/11/22) to translate 2d data 
from Arc/Info Coverage to PostGIS database. I don't know why, but a 
third coordinate appears in my PostGIS database. This should not be so 
problematic since I know that the third coordinnate is not 
representative. But, I have a problem when I want to map this data with 
Mapserver because the request :
SELECT 
asbinary(force_collection(force_2d(wkb_geometry)),'NDR'),OID::text from 
habit_p_ll WHERE wkb_geometry && setSRID('BOX3D(38.5633333333333 
-79.77,69.0166666666667 -56.93)'::BOX3D, 
find_srid('','habit_p_ll','wkb_geometry') )
return 0 feature. The BOX3D produced has z=0.

I think that mapserver should not suppose that data are at sea level, 
but I don't understand the arbitrary value of z introduced by ogr2ogr.

Greetings,

Jean-Denis

These come from orginfo on both dataset.

OGRFeature(LAB):753
   ValueId (Integer) = 753
   PolyId (Integer) = 0
   AREA (Real) =        0.000
   PERIMETER (Real) =        0.000
   HABIT_P_LL# (Integer) = 753
   HABIT_P_LL-ID (Integer) = 753
   HABIT_P_ (Real) =         753
   HABIT_P_ID (Real) =        3290
   HAP_CO_PRE (String) = PRE
   HAP_NO_IND (String) = 03 63 0000 001
   HAP_DE_IND (String) = Lieu habité
   HAP_CO_CLA (String) = SEC
   HAP_CO_TOP (String) =
   HAP_NM_TOP (String) = Sturgeon Falls
   HAP_DA_TOP (String) =        0
   HAP_CO_VER (String) = BDGA1M v1.1
   HAP_DA_MOD (String) =        0
   INT_AFF (String) = 2M
   POINT (-79.93342590 46.36622238)

OGRFeature(habit_p_ll):753
   valueid (Integer) = 753
   polyid (Integer) = 0
   area (Real) =        0.000
   perimeter (Real) =        0.000
   habit_p_ll_ (Integer) = (null)
   habit_p_ll_id (Integer) = (null)
   habit_p_ (Real) = 753
   habit_p_id (Real) = 3290
   hap_co_pre (String) = PRE
   hap_no_ind (String) = 03 63 0000 001
   hap_de_ind (String) = Lieu habité
   hap_co_cla (String) = SEC
   hap_co_top (String) =
   hap_nm_top (String) = Sturgeon Falls
   hap_da_top (String) =        0
   hap_co_ver (String) = BDGA1M v1.1
   hap_da_mod (String) =        0
   int_aff (String) = 2M
   POINT (-79.93342590 46.36622246 2.005)

-- 
Jean-Denis Giguère
Étudiant en géomatique
appliquée à l'environnement
Stagiaire à l'Agence de développement
de réseaux locaux de services de santé
et de services sociaux de l'Estrie
Tél. 829-3400 42008
Courriel. jdenisgiguere at fastmail.fm



More information about the Gdal-dev mailing list