/[thuban]/branches/WIP-pyshapelib-bramz/Resources/XML/thuban-1.1.dtd
ViewVC logotype

Annotation of /branches/WIP-pyshapelib-bramz/Resources/XML/thuban-1.1.dtd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2104 - (hide annotations)
Fri Mar 12 12:19:15 2004 UTC (20 years, 11 months ago) by bh
Original Path: trunk/thuban/Resources/XML/thuban-1.1.dtd
File size: 6775 byte(s)
Final step for explicit id/geometry columns: Loading and saving

* Resources/XML/thuban-1.1.dtd: New.  Derived from thuban-1.0.dtd
with the following changes:
(dbshapesource): Two new attributes id_column and geometry_column

* Thuban/Model/save.py (SessionSaver.write): Use the new dtd
(SessionSaver.write_session): Use the new namespace
(SessionSaver.write_data_containers): Write the new dbshapesource
parameters

* Thuban/Model/load.py (SessionLoader.__init__): New namespace for
the new file format version
(SessionLoader.start_dbshapesource): Handle the new db parameters

* test/test_save.py: Update to the new dtd and namespace
(SaveSessionTest.test_save_postgis): Update the NonConnectionStore
mock object to provide a working IDColumn method.

* test/test_load_1_0.py: New.  Copy of the test_load.py before
today's changes but with the round-trip tests removed.

* test/test_load_0_9.py: Update doc-string.

* test/test_load.py: Update all .thuban files to the new dtd and
namespace.
(TestPostGISLayer.file_contents): Add the new dbshapesource
paramters

1 bh 2104 <?xml version="1.0" encoding="UTF-8"?>
2     <!-- thuban-1.1.dtd
3    
4     Copyright (C) 2001, 2003, 2004 by Intevation GmbH
5     Authors:
6     Jan-Oliver Wagner <[email protected]>
7     Bernhard Herzog <[email protected]>
8    
9     This program is free software under the GPL (>=v2)
10     Read the file COPYING coming with Thuban for details.
11    
12     $Revision$
13     $Source$
14     $Id$
15     -->
16    
17     <!-- a session contains zero or more database connections zero or more
18     datasources and and zero or more maps
19    
20     At some point, the namespace attribute will likely be used by Thuban to
21     identify the version of the file format.
22     -->
23    
24     <!ENTITY % shapesources "fileshapesource | derivedshapesource | dbshapesource">
25     <!ENTITY % tables "filetable | jointable">
26     <!ELEMENT session ((dbconnection | %shapesources; | %tables; )*, map*)>
27     <!ATTLIST session
28     title CDATA #REQUIRED
29     xmlns CDATA #IMPLIED
30     >
31    
32    
33     <!--
34     A db connection represents the connection to a database.
35    
36     Currently only connections to postgis databases are supported and
37     thus The dbtype attribute must be "postgis".
38     -->
39    
40     <!ELEMENT dbconnection EMPTY>
41     <!ATTLIST dbconnection
42     id ID #REQUIRED
43     dbtype CDATA #REQUIRED
44     dbname CDATA #REQUIRED
45     host CDATA ""
46     port CDATA ""
47     user CDATA ""
48     >
49    
50    
51     <!-- A dbshapesource represents a table with geometry data in a database
52    
53     The dbconn attribute must be the id of a dbconnection element
54     occurring earlier in the document.
55     -->
56    
57     <!ELEMENT dbshapesource EMPTY>
58     <!ATTLIST dbshapesource
59     id ID #REQUIRED
60     dbconn IDREF #REQUIRED
61     tablename CDATA #REQUIRED
62     id_column CDATA #REQUIRED
63     geometry_column CDATA #REQUIRED
64     >
65    
66     <!--
67     A fileshapesource is a source of shapes and perhaps attribute data
68     read from a file. The filetype attribute must be one of the
69     supported file types. Currently only "shapefile" is supported.
70     -->
71    
72     <!ELEMENT fileshapesource EMPTY>
73     <!ATTLIST fileshapesource
74     id ID #REQUIRED
75     filename CDATA #REQUIRED
76     filetype CDATA #REQUIRED
77     >
78    
79     <!--
80     A derivedshapesource is a source of shapes and attribute data
81     derived from another shapesource for the shapes and a table for the
82     attribute data.
83     -->
84    
85     <!ELEMENT derivedshapesource EMPTY>
86     <!ATTLIST derivedshapesource
87     id ID #REQUIRED
88     shapesource IDREF #REQUIRED
89     table IDREF #REQUIRED
90     >
91    
92    
93     <!-- a filetable points to the actual file that
94     contains the tabular data.
95    
96     The filetype Attribute may be onve of "DBF" or "CSV"
97     -->
98     <!ELEMENT filetable EMPTY>
99     <!ATTLIST filetable
100     id ID #REQUIRED
101     title CDATA #REQUIRED
102     filename CDATA #REQUIRED
103     filetype CDATA #REQUIRED>
104    
105     <!--
106     A jointable is a table with the result of something equivalent to
107     this SQL Statement:
108    
109     SELECT * FROM left JOIN right WHERE left.leftcolumn = right.rightcolumn;
110    
111     The attributes left and right must be the ids of two tables defined
112     previously in the XML-Document file. leftcolumn and rightcolumn are
113     the column names to join on.
114    
115     The jointype attribute should be either "INNER" or "LEFT OUTER".
116     -->
117     <!ELEMENT jointable EMPTY>
118     <!ATTLIST jointable
119     id ID #REQUIRED
120     title CDATA #REQUIRED
121     left IDREF #REQUIRED
122     leftcolumn CDATA #REQUIRED
123     right IDREF #REQUIRED
124     rightcolumn CDATA #REQUIRED
125     jointype CDATA #REQUIRED
126     >
127    
128     <!-- A Map
129    
130     A map consists of a number of layers
131     the projection refers to the projection
132     used to display the map. If the projection
133     is missing, geographic coordinates in decimal
134     degrees are assumed.
135     -->
136     <!ELEMENT map (projection?, (layer | rasterlayer)*, labellayer?)>
137     <!ATTLIST map title CDATA #REQUIRED>
138    
139     <!-- a layer represents a set of geographic objects.
140     pointers to the actual data are stored.
141     The shapestore attributes contains the id of the data store
142     shown in the layer.
143     the projection refers to the projection
144     in which the data are stored. If the projection
145     is missing, geographic coordinates in decimal
146     degrees are assumed. Visibility is assumed true
147     unless otherwise specified.
148     -->
149     <!ELEMENT layer (projection?, classification?)>
150     <!ATTLIST layer title CDATA #REQUIRED>
151     <!ATTLIST layer shapestore IDREF #REQUIRED>
152     <!ATTLIST layer visible (true|false) "true">
153     <!-- the fill and stroke attributes can be either "None" or "#RRGGBB"
154     RGB hex values
155    
156     All of fill, stroke and stroke_width may be omitted and default to
157     "None", "#000000" and "1" respectively.
158     -->
159     <!ATTLIST layer fill CDATA "None">
160     <!ATTLIST layer stroke CDATA "#000000">
161     <!ATTLIST layer stroke_width CDATA "1">
162    
163    
164     <!-- a rasterlayer represents an image that has some geographic data
165     associated with it. The filename points to the image used.
166     -->
167     <!ELEMENT rasterlayer (projection?, classification?)>
168     <!ATTLIST rasterlayer
169     title CDATA #REQUIRED
170     filename CDATA #REQUIRED
171     visible (true|false) "true">
172    
173    
174     <!-- Classification data -->
175     <!ELEMENT classification (clnull?, clpoint*, clrange*, clcont*)>
176     <!ATTLIST classification field CDATA #REQUIRED>
177     <!ATTLIST classification field_type CDATA #REQUIRED>
178    
179     <!ELEMENT clnull (cldata*)>
180     <!ELEMENT clpoint (cldata*)>
181     <!ELEMENT clrange (cldata*)>
182     <!ELEMENT clcont (cldata*)>
183    
184     <!ATTLIST clnull label CDATA #IMPLIED>
185    
186     <!ATTLIST clpoint value CDATA #REQUIRED>
187     <!ATTLIST clpoint label CDATA #IMPLIED>
188    
189     <!ATTLIST clrange min CDATA #IMPLIED>
190     <!ATTLIST clrange max CDATA #IMPLIED>
191     <!ATTLIST clrange range CDATA #IMPLIED>
192     <!ATTLIST clrange label CDATA #IMPLIED>
193    
194     <!ATTLIST clcont rmin CDATA #REQUIRED>
195     <!ATTLIST clcont rmax CDATA #REQUIRED>
196     <!ATTLIST clcont dmin CDATA #REQUIRED>
197     <!ATTLIST clcont dmax CDATA #REQUIRED>
198    
199     <!-- Visual appearance of the classification
200    
201     the fill and stroke attributes can be either "None" or "#RRGGBB"
202     RGB hex values
203    
204     All of fill, stroke and stroke_width may be omitted and default to
205     "None", "#000000" and "1" respectively.
206     -->
207     <!ELEMENT cldata EMPTY>
208     <!ATTLIST cldata
209     stroke CDATA #IMPLIED
210     stroke_width CDATA #IMPLIED
211     fill CDATA #IMPLIED
212     >
213    
214    
215     <!-- a projection has a number of parameters
216     -->
217     <!ELEMENT projection (parameter*)>
218     <!ATTLIST projection
219     name CDATA ""
220     epsg CDATA #IMPLIED >
221    
222     <!-- just a simple parameter consisting of a value
223     -->
224     <!ELEMENT parameter EMPTY>
225     <!ATTLIST parameter value CDATA #REQUIRED>
226    
227    
228     <!-- The label layer contains text labels -->
229     <!ELEMENT labellayer (label*) >
230    
231     <!ELEMENT label EMPTY>
232     <!ATTLIST label
233     x CDATA #REQUIRED
234     y CDATA #REQUIRED
235     text CDATA #REQUIRED
236     halign (left|center|right) #REQUIRED
237     valign (top|center|bottom) #REQUIRED>

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26