Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#4983 closed defect (fixed)

Problem reading Geoconcept GXT with OGR

Reported by: gnerred Owned by: dgrichard
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: dgrichard

Description

Hi,

I have a problem trying to read a GXT file with OGR and the following command :

ogr2ogr -f "ESRI Shapefile" eu_collecteur.shp test2.gxt ASSAINISSEMENT.Collecteur

I get this error :

ERROR 1: 'Subclass' expected. Geoconcept export syntax error at line 8.

FAILURE: Unable to open datasource `test2.gxt' with the following drivers. -> ESRI Shapefile -> MapInfo File ...

Thanks !

Daniel

Attachments (1)

test2.gxt (920.0 KB ) - added by gnerred 11 years ago.
GXT file concerned

Download all attachments as: .zip

Change History (11)

by gnerred, 11 years ago

Attachment: test2.gxt added

GXT file concerned

comment:1 by dgrichard, 11 years ago

Owner: changed from warmerdam to dgrichard

comment:2 by dgrichard, 11 years ago

Status: newassigned

Running :

$ GDAL_DEBUG=1 ogrinfo gdal4983.gxt

shows the following error :

ERROR 1: 'Subclass' expected.
Geoconcept export syntax error at line 8.

ERROR 1: 'Subclass' expected.
Geoconcept export syntax error at line 8.

FAILURE:
Unable to open datasource `gdal4983.gxt' with the following drivers.
...

Removing the heading space before Subclass keyword in the test2.gxt raises a new error :

ERROR 1: 'Kind' expected.
Geoconcept export syntax error at line 8.

ERROR 1: 'Kind' expected.
Geoconcept export syntax error at line 8.

FAILURE:
Unable to open datasource `gdal4983.gxt' with the following drivers.
...

Cleaning all spaces leads to the following error :

ERROR 1: field 'ASSAINISSEMENT.Fontaine@commune#-1' already exists.

ERROR 1: Geoconcept export syntax error at line 8.

ERROR 1: field 'ASSAINISSEMENT.Fontaine@commune#-1' already exists.

ERROR 1: Geoconcept export syntax error at line 8.

FAILURE:
Unable to open datasource `gdal4983.gxt' with the following drivers.
...

I have to investigate why the gxt is not correctly read. It sounds like the format version is 7 which might not be supported by the Geoconcept driver so far.

How did you get your test file ?

in reply to:  2 comment:3 by gnerred, 11 years ago

I got the test file from a Geoconcept 7 application, in a Swiss city

comment:4 by dgrichard, 11 years ago

I have a fix and it works :

$ ogrinfo gdal4983.gxt
INFO: Open of `gdal4983.gxt'
      using driver `Geoconcept' successful.
1: ASSAINISSEMENT.Fontaine (Point)
2: ASSAINISSEMENT.Collecteur (Line String)
3: ASSAINISSEMENT.Branchement priv� (Line String)
4: ASSAINISSEMENT.S�parateur/deshuileur (Point)
5: ASSAINISSEMENT.Rejet (Point)
6: ASSAINISSEMENT.Point branchement (Point)
7: ASSAINISSEMENT.Chgt caract�ristique (Point)
8: ASSAINISSEMENT.Conduite sous pression (Line String)
9: ASSAINISSEMENT.Grille/Sac route (Point)
10: ASSAINISSEMENT.D�faut/Dommage (Point)
11: ASSAINISSEMENT.Regard/Chambre (Point)
12: ASSAINISSEMENT.Regard/chambre priv� (Point)
13: ASSAINISSEMENT.Descente de toit (Point)
14: ASSAINISSEMENT.Branchement (Line String)
15: EAU - Cotation.Texte borne hydrante (Point)
16: ASS - Habillage/Cotation.No Regard/Chambre (Point)
17: ASS - Habillage/Cotation.Caract�ristique ouvrage (Point)
18: ASS - Habillage/Cotation.Collecteur supprim� (Point)
19: ASS - Habillage/Cotation.Altitude collecteur (Point)
20: ASS - Habillage/Cotation.Trait de rappel (Line String)
21: ASS - Habillage/Cotation.Caract�ristiques (Point)
22: ARB - Objet.Divers (Line String)
23: ARB - Objet.Objet - Gazon (Multi Polygon)
24: ARB - Objet.Objet - Arbre (Multi Polygon)
25: LOC - Cartes raster.Orthophoto SF 2010 25 SWISSIMAGE (Multi Polygon)
26: LOC - Cartes raster.Orthophoto 2004 SWISSIMAGE (Multi Polygon)
27: LOC - Cartes raster.Carte Nationale 50'000 (Multi Polygon)
28: LOC - Cartes raster.Orthophoto AF 2008 25 SWISSIMAGE (Multi Polygon)
29: LOC - Cartes raster.Orthophoto 1998 SWISSIMAGE (Multi Polygon)
30: LOC - Cartes raster.Carte Nationale 100'000 (Multi Polygon)
31: LOC - Cartes raster.Carte Nationale 25'000 (Multi Polygon)
32: PAC - Patrimoine communal.Parcelle communale (Multi Polygon)
33: PAR - Parking.Place de parc projet�e (Multi Polygon)
34: PAR - Parking.Place de parc (Multi Polygon)
35: PAR - Parking.Zone de parcage (Multi Polygon)
36: EAU - R�seau eau potable.Branchement (Line String)
37: EAU - R�seau eau potable.Pi�ce d�rivation (Point)
38: EAU - R�seau eau potable.Vanne (Point)
39: EAU - R�seau eau potable.Conduite (Line String)
40: EAU - R�seau eau potable.Hydrant (Point)
41: EAU - R�seau eau potable.Vanne cosm�tique (Point)
42: EAU - R�seau eau potable.Chgt caract�ristique (Point)
43: ROU - Voirie.D�neigement VILLE (Line String)
44: ROU - Voirie.D�neigement Z.I. (Line String)
45: ROU - Voirie.Salage ROUTES (Line String)
46: ROU - Voirie.Balayage VILLE (Line String)
47: ROU - Voirie.Salage TROTTOIRS (Line String)
48: DEC - Gestion des d�chets.Contr�le sacs noirs (Point)
49: DEC - Gestion des d�chets.Point de r�cup�ration (Point)
50: EPB - Eclairage public.Point lumineux (Point)
51: CAD - Point limite.No point situation (Point)
52: CAD - Point limite.Point de situation (Point)
53: CAD - Point limite.No point limite (Point)
54: CAD - Point limite.Point limite (Point)
55: ROU - Signalisation compl�mentaire.Interdiction parquage DG (Point)
56: ROU - Signalisation compl�mentaire.Interdiction rappel (Point)
57: ROU - Signalisation compl�mentaire.Indicateur P Gare (Point)
58: ROU - Signalisation compl�mentaire.Interdiction VM ERLSP (Point)
59: ROU - Signalisation compl�mentaire.Parking 4h (Point)
60: ROU - Signalisation compl�mentaire.Interdiction parquage DD (Point)
61: CAD - B�timent.No b�timent (Point)
62: CAD - B�timent.B�timent (Multi Polygon)
63: CAD - B�timent.B�timent souterrain (Multi Polygon)
64: CAD - Point fixe altim�trique.No PFA1 (Point)
65: CAD - Point fixe altim�trique.PFA3 (Point)
66: CAD - Point fixe altim�trique.PFA1 (Point)
67: ROU - Signalisation verticale.4.11 Passage pour pi�tons (Point)
68: ROU - Signalisation verticale.4.18 Parcage avec disque (Point)
69: ROU - Signalisation verticale.2.34 Obstacle � contourner par la droite (Point)
70: ROU - Signalisation verticale.2.50 Interdiction de parquer (Point)
71: ROU - Signalisation verticale.3.03 Route principale (Point)
72: ROU - Signalisation verticale.2.02 Acc�s interdit (Point)
73: CAD - Point fixe planim�trique.No PFP3 (Point)
74: CAD - Point fixe planim�trique.PFP3 (Point)
75: AME - Limite construction.Plan sp�cial (Line String)
76: CAD - Division plans.D�coupage impression (Multi Polygon)
77: CAD - Division plans.No plan cadastral (Point)
78: VOI - Adresse.No adresse (Point)
79: VOI - Adresse.Localisation (Point)
80: VOI - Adresse.Adresse (Point)
81: CAD - Objet divers.El�ment lin�aire (Line String)
82: ASS - Zone de gestion assainissement.Zone � s�curiser (Multi Polygon)
83: ASS - Zone de gestion assainissement.Zone potentielle d'infiltration (Multi Polygon)
84: ASS - Zone de gestion assainissement.Sous-bassin versant (Multi Polygon)
85: IMP - Construction.Lineaire (Line String)
86: IMP - Construction.Point de construction (Point)
87: ASS - R�seau planifi�.Collecteur planifi� (Line String)
88: ROU - Graphe routier.Route principale (Line String)
89: ROU - Graphe routier.Tron�on (Line String)
90: CIT - Citerne.Citerne (Point)
91: EAU - R�seau planifi�.Conduite planifi�e (Line String)
92: ARB - Arbre.Arbre isol� (Point)
93: AME - Plan de base.Zone Raster (Multi Polygon)
94: CAD - Division administrative.Commune (Multi Polygon)
95: CAD - Biens-fonds.No parcelle (Point)
96: CAD - Biens-fonds.Parcelle (Multi Polygon)
97: CAD - Nomenclature.Texte d�signation compl. (Point)
98: CAD - Nomenclature.Axes (Point)
99: AME - Zone d'affectation.Zone d'affectation (Multi Polygon)
100: CAD - Couverture du sol.Couverture du sol (Multi Polygon)
101: CAD - Domaine num�rotation.DN (Multi Polygon)
102: Raster EP.Plan 3 (Multi Polygon)
103: Raster EP.Plan 1 (Multi Polygon)
104: Topologie.Erreur topologique (Point)
105: EAU - A supprimer/ A controler.A supprimer (apr�s contr�le) (Point)

By the way, line 1476 is cut into 2 parts (the file is not compliant with specification) that crash the driver :

ogrinfo gdal4983.gxt
Erreur de segmentation (core dumped)

SO, i still have to fix this ...

comment:5 by dgrichard, 11 years ago

I also got in touch with Geoconcept SA about the version 7 of their export specifications :

1/ they have relaxed the syntax by allowing the space between fields (that causes the bug) 2/ they have added in version 7.1 the following (not supported so far) :

Virtual layer fields have been added to the GXT (« Visibilité », « Décalage X »,
« Décalage Y », « Flèche », …).

Within the metadata records (//$FIELDS) these fields can be found under the new syntax :

Private#VL#<name_of_the_source_layer>#<name_of_the_layer_property_field>

where :

<name_of_the_source_layer> is the virtual layer name;
<name_of_the_layer_property_field> is one of the following :

· Visibility = field “Nom de couche.Visibilité” (french locale) allowing displaying of the feature;

· DX = field “Nom de couche.Delta X” (french locale) allowing X translation of the feature position;
· DY = field “Nom de couche. Delta Y” (french locale) allowing Y translation of the feature position;

· Arrow = field “Nom de couche.Flèche” (french locale) arrow style

· DXArrow = field “Nom de couche.Décalage X Flèche” (french locale) allowing X translation of the arrow's position

· DYArrow = field “Nom de couche.Décalage Y Flèche” (frenchlocale) allowing Y translation of the arrow's position


Example with a « Labels 1 » virtual layer :

//$FIELDS Class=Unités administratives; Subclass=Départements; Kind=4;
Fields=Private#Identifier       Private#Class Private#Subclass
Private#Name Private#NbFields    Code géog. de département  Code
téléphonique Private#VL#Labels 1#Visibility    Private#VL#Labels 1#DX
Private#VL#Labels 1#DY       Private#VL#Labels 1#Arrow  Private#VL#Labels
1#DXArrow       Private#VL#Labels 1#DYArrow       Private#X    Private#Y
Private#Graphics

comment:6 by dgrichard, 11 years ago

Reading the corrupted file does not crash anymore :

ERROR 1: Line 1476, Total number of fields differs with type definition 'CIT - Citerne.Citerne' (10 found, at least 51 expected).

ERROR 1: Line 1476, Total number of fields differs with type definition 'CIT - Citerne.Citerne' (10 found, at least 51 expected).

FAILURE:
Unable to open datasource `test2.gxt' with the following drivers.
...

With the fixes, your command is working :

ogr2ogr -f "ESRI Shapefile" eu_collecteur.shp gdal4983.gxt ASSAINISSEMENT.Collecteur 
Warning 6: Normalized/laundered field name: 'Nom commune' to 'Nom commun'
Warning 6: Normalized/laundered field name: 'Num�ro commune' to 'Num�ro com'
Warning 6: Normalized/laundered field name: 'Gestionnaire' to 'Gestionnai'
Warning 6: Normalized/laundered field name: 'R�f�rence dossier' to 'R�f�rence'
Warning 6: Normalized/laundered field name: 'Ann�e de pose/construction' to 'Ann�e de p'
Warning 6: Normalized/laundered field name: 'Dernier constat' to 'Dernier co'
Warning 6: Normalized/laundered field name: 'Ref�rence plan' to 'Ref�rence'
Warning 6: Normalized/laundered field name: 'Image / sch�ma 1' to 'Image / sc'
Warning 6: Normalized/laundered field name: 'Image / sch�ma 2' to 'Image / _1'
Warning 6: Normalized/laundered field name: 'Dernier entretien' to 'Dernier en'
Warning 6: Normalized/laundered field name: 'Mode d'acquisition' to 'Mode d'acq'
Warning 6: Normalized/laundered field name: 'Date d'acquisition' to 'Date d'acq'
Warning 6: Normalized/laundered field name: 'Nom du propri�taire' to 'Nom du pro'
Warning 6: Normalized/laundered field name: 'Valeur �conomique de remplacement' to 'Valeur �co'
Warning 6: Normalized/laundered field name: 'No tourn�e de contr�le' to 'No tourn�e'
Warning 6: Normalized/laundered field name: 'Fr�quence des contr�les (mois)' to 'Fr�quence'
Warning 6: Normalized/laundered field name: 'Priorit� d'intervention' to 'Priorit� d'
Warning 6: Normalized/laundered field name: 'Ann�e de remplacement projet�e' to 'Ann�e de r'
Warning 6: Normalized/laundered field name: 'Date de cr�ation fiche' to 'Date de cr'
Warning 6: Normalized/laundered field name: 'Auteur fiche' to 'Auteur fic'
Warning 6: Normalized/laundered field name: 'Date de mise � jour' to 'Date de mi'
Warning 6: Normalized/laundered field name: 'Auteur de mise � jour' to 'Auteur de'
Warning 6: Normalized/laundered field name: 'Date d'estimation' to 'Date d'est'
Warning 6: Normalized/laundered field name: 'Nom du gestionnaire' to 'Nom du ges'
Warning 6: Normalized/laundered field name: 'Valeur r�siduelle comptable' to 'Valeur r�s'
Warning 6: Normalized/laundered field name: 'Valeur r�siduelle technique' to 'Valeur r_1'
Warning 6: Normalized/laundered field name: 'D�termination planim�trique' to 'D�terminat'
Warning 6: Normalized/laundered field name: 'Prix unitaire' to 'Prix unita'
Warning 6: Normalized/laundered field name: 'Profil du collecteur' to 'Profil du'
Warning 6: Normalized/laundered field name: 'Code mat�riau' to 'Code mat�r'
Warning 6: Normalized/laundered field name: 'Etat d'exploitation' to 'Etat d'exp'
Warning 6: Normalized/laundered field name: 'Altitude amont (m)' to 'Altitude a'
Warning 6: Normalized/laundered field name: 'Altitude aval (m)' to 'Altitude_1'
Warning 6: Normalized/laundered field name: 'Pente r�elle (%)' to 'Pente r�el'
Warning 6: Normalized/laundered field name: 'Diam�tre/hauteur' to 'Diam�tre/h'
Warning 6: Normalized/laundered field name: 'Longueur horizontale' to 'Longueur h'
Warning 6: Normalized/laundered field name: 'Code du profil' to 'Code du pr'
Warning 6: Normalized/laundered field name: 'Caract�ristiques' to 'Caract�ris'
Warning 6: Normalized/laundered field name: 'Nom collecteur' to 'Nom collec'
Warning 6: Normalized/laundered field name: 'Mat�riau chemisage' to 'Mat�riau c'
Warning 6: Normalized/laundered field name: 'No bande vid�o' to 'No bande v'
Warning 6: Normalized/laundered field name: 'D�bit nominal (Qnom) (l/s)' to 'D�bit nomi'
Warning 6: Normalized/laundered field name: 'No du sous bassin versant' to 'No du sous'
Warning 6: Normalized/laundered field name: 'Temps de retour consid�r� T1 pour le d�bit maximal' to 'Temps de r'
Warning 6: Normalized/laundered field name: 'D�bit maximal (Qmax) pour T1 (l/s)' to 'D�bit maxi'
Warning 6: Normalized/laundered field name: 'Charge hydraulique pour T1 (%)' to 'Charge hyd'
Warning 6: Normalized/laundered field name: 'D�bit min. par temps sec (l/s)' to 'D�bit min.'
Warning 6: Normalized/laundered field name: 'No tourn�e de curage' to 'No tourn_1'
Warning 6: Normalized/laundered field name: 'Fr�quence de curage' to 'Fr�quenc_1'
Warning 6: Normalized/laundered field name: 'Quantit� ECP permanentes' to 'Quantit� E'
Warning 6: Normalized/laundered field name: 'Quantit� ECP saisonni�res' to 'Quantit�_1'
Warning 6: Normalized/laundered field name: 'Travaux futurs' to 'Travaux fu'
Warning 6: Normalized/laundered field name: 'Contenu futur' to 'Contenu fu'
Warning 6: Normalized/laundered field name: 'Temps de retour consid�r� T5 pour le d�bit maximal' to 'Temps de_1'
Warning 6: Normalized/laundered field name: 'D�bit maximal (Qmax) pour T5 (l/s)' to 'D�bit ma_1'
Warning 6: Normalized/laundered field name: 'Charge hydraulique pour T5 (%)' to 'Charge h_1'
Warning 6: Normalized/laundered field name: 'Temps de retour consid�r� T10 pour le d�bit maximal' to 'Temps de_2'
Warning 6: Normalized/laundered field name: 'D�bit maximal (Qmax) pour T10 (l/s)' to 'D�bit ma_2'
Warning 6: Normalized/laundered field name: 'Charge hydraulique pour T10 (%)' to 'Charge h_2'
Warning 6: Normalized/laundered field name: 'Temps de retour consid�r� T4 pour le d�bit maximal' to 'Temps de_3'
Warning 6: Normalized/laundered field name: 'D�bit maximal (Qmax) pour T4 (l/s)' to 'D�bit ma_3'
Warning 6: Normalized/laundered field name: 'Charge hydraulique pour T4 (%)' to 'Charge h_3'
Warning 6: Normalized/laundered field name: 'Capacit� pour T1' to 'Capacit� p'
Warning 6: Normalized/laundered field name: 'Capacit� pour T5' to 'Capacit�_1'
Warning 6: Normalized/laundered field name: 'Capacit� pour T10' to 'Capacit�_2'
Warning 6: Normalized/laundered field name: 'Capacit� pour T4' to 'Capacit�_3'
Warning 6: Normalized/laundered field name: 'Dur�e de vie calc.' to 'Dur�e de v'
Warning 6: Normalized/laundered field name: 'Charge Hydraulique T1 calc.' to 'Charge H_4'
Warning 6: Normalized/laundered field name: 'Charge Hydraulique T2 calc.' to 'Charge H_5'
Warning 6: Normalized/laundered field name: 'Charge Hydraulique T3 calc.' to 'Charge H_6'
Warning 6: Normalized/laundered field name: 'Charge Hydraulique T4 calc.' to 'Charge H_7'
Warning 6: Normalized/laundered field name: 'No objet amont' to 'No objet a'
Warning 6: Normalized/laundered field name: 'No objet aval' to 'No objet_1'
Warning 6: Normalized/laundered field name: 'Dur�e de vie' to 'Dur�e de_1'
Warning 6: Normalized/laundered field name: 'Etat d'exploitation futur' to 'Etat d'e_1'
Warning 6: Normalized/laundered field name: 'Diam�tre futur' to 'Diam�tre f'
Warning 6: Normalized/laundered field name: 'Inspection TV' to 'Inspection'
Warning 6: Normalized/laundered field name: 'Genre de raccordement' to 'Genre de r'
Warning 6: Normalized/laundered field name: 'Lit de pose enrobage' to 'Lit de pos'
Warning 6: Normalized/laundered field name: 'Mat�riau SIA 405' to 'Mat�riau S'
Warning 6: Normalized/laundered field name: 'Ann�e dernier curage' to 'Ann�e dern'
Warning 6: Normalized/laundered field name: 'M�thode d'entretien' to 'M�thode d''
Warning 6: Normalized/laundered field name: 'Pente admise (%)' to 'Pente admi'
Warning 6: Normalized/laundered field name: 'Temps de retour consid�r� T2 pour le d�bit maximal' to 'Temps de_4'
Warning 6: Normalized/laundered field name: 'Temps de retour consid�r� T3 pour le d�bit maximal' to 'Temps de_5'
Warning 6: Normalized/laundered field name: 'Capacit� pour T3' to 'Capacit�_4'
Warning 6: Normalized/laundered field name: 'Degr� d'urgence' to 'Degr� d'ur'

I will try to commit the fixes asap.

comment:7 by dgrichard, 11 years ago

committed in r25620

comment:8 by dgrichard, 11 years ago

Resolution: fixed
Status: assignedclosed

comment:9 by dgrichard, 11 years ago

Daniel if you could check it out and report me back if this fixes the problem on our side it will be great ! Do not hesitate to reopen this ticket if needed.

comment:10 by gnerred, 11 years ago

Thanks a lot for your work ! Question from a beginner... how can I install gdal trunk ? I have Windows machines or a Linux Ubuntu.

Note: See TracTickets for help on using tickets.