/[thuban]/branches/WIP-pyshapelib-bramz/test/test_load.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/test_load.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2642 by bh, Fri Jul 1 20:49:04 2005 UTC revision 2688 by frank, Fri Jun 30 12:27:20 2006 UTC
# Line 46  from Thuban.Model.load import load_sessi Line 46  from Thuban.Model.load import load_sessi
46       LoadCancelled       LoadCancelled
47  from Thuban.Model.color import Transparent  from Thuban.Model.color import Transparent
48  from Thuban.Model.classification import ClassGroupProperties, ClassGroupRange,\  from Thuban.Model.classification import ClassGroupProperties, ClassGroupRange,\
49      ClassGroupSingleton, ClassGroupDefault      ClassGroupSingleton, ClassGroupPattern, ClassGroupDefault
50  from Thuban.Model.postgisdb import ConnectionError  from Thuban.Model.postgisdb import ConnectionError
51  from Thuban.Model.table import DBFTable, MemoryTable, \  from Thuban.Model.table import DBFTable, MemoryTable, \
52       FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING, \       FIELDTYPE_DOUBLE, FIELDTYPE_INT, FIELDTYPE_STRING, \
# Line 175  class ClassificationTest(LoadSessionTest Line 175  class ClassificationTest(LoadSessionTest
175                  elif data[CLASSES][i][GROUP_TYPE] == "single":                  elif data[CLASSES][i][GROUP_TYPE] == "single":
176                      g = ClassGroupSingleton(data[CLASSES][i][GROUP_DATA],                      g = ClassGroupSingleton(data[CLASSES][i][GROUP_DATA],
177                                            props, data[CLASSES][i][GROUP_LABEL])                                            props, data[CLASSES][i][GROUP_LABEL])
178                    elif data[CLASSES][i][GROUP_TYPE] == "pattern":
179                        g = ClassGroupPattern(data[CLASSES][i][GROUP_DATA],
180                                              props, data[CLASSES][i][GROUP_LABEL])
181    
182                  eq(group, g)                  eq(group, g)
183    
# Line 201  class TestSingleLayer(LoadSessionTest): Line 204  class TestSingleLayer(LoadSessionTest):
204              <parameter value="units=m"/>              <parameter value="units=m"/>
205              <parameter value="zone=27"/>              <parameter value="zone=27"/>
206          </projection>          </projection>
207          <layer shapestore="D1" visible="true"          <layer shapestore="D1" visible="true" title="K\xc3\xbcste">
208                  stroke="#000000" title="K\xc3\xbcste" stroke_width="1"              <classification>
209                  fill="None"/>                  <clnull label="">
210                        <cldata stroke="#000000" stroke_width="1" fill="None"/>
211                    </clnull>
212                </classification>
213            </layer>
214      </map>      </map>
215  </session>  </session>
216  '''  '''
# Line 293  class TestNonAsciiColumnName(LoadSession Line 300  class TestNonAsciiColumnName(LoadSession
300              <parameter value="units=m"/>              <parameter value="units=m"/>
301              <parameter value="zone=27"/>              <parameter value="zone=27"/>
302          </projection>          </projection>
303          <layer shapestore="D1" visible="true"          <layer shapestore="D1" visible="true" title="layer">
                 stroke="#000000" title="layer" stroke_width="1"  
                 fill="None">  
304              <classification field="Fl\xc3\xa4che" field_type="double">              <classification field="Fl\xc3\xa4che" field_type="double">
305                  <clnull label="">                  <clnull label="">
306                      <cldata stroke="#000000" stroke_width="1" fill="None"/>                      <cldata stroke="#000000" stroke_width="1" fill="None"/>
# Line 368  class TestLayerVisibility(LoadSessionTes Line 373  class TestLayerVisibility(LoadSessionTes
373              <parameter value="proj=utm"/>              <parameter value="proj=utm"/>
374              <parameter value="ellps=clrk66"/>              <parameter value="ellps=clrk66"/>
375          </projection>          </projection>
376          <layer shapestore="D1" visible="false" stroke="#000000"          <layer shapestore="D1" visible="false" title="My Layer">
377                  title="My Layer" stroke_width="1" fill="None"/>              <classification>
378                    <clnull label="">
379                        <cldata stroke="#000000" stroke_width="1" fill="None"/>
380                    </clnull>
381                </classification>
382            </layer>
383      </map>      </map>
384  </session>  </session>
385  '''  '''
# Line 399  class TestSymbolSize(ClassificationTest) Line 409  class TestSymbolSize(ClassificationTest)
409  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.1-dev.dtd" title="Thuban sample session">  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.1-dev.dtd" title="Thuban sample session">
410      <fileshapesource filetype="shapefile" id="D813968480" filename="../../Data/iceland/cultural_landmark-point.shp"/>      <fileshapesource filetype="shapefile" id="D813968480" filename="../../Data/iceland/cultural_landmark-point.shp"/>
411      <map title="Iceland map">      <map title="Iceland map">
412          <layer title="cultural_landmark-point" stroke_width="1" shapestore="D813968480" visible="true" stroke="#000000" fill="#000000">          <layer title="cultural_landmark-point" shapestore="D813968480" visible="true">
413              <classification field="CLPTLABEL" field_type="string">              <classification field="CLPTLABEL" field_type="string">
414                  <clnull label="">                  <clnull label="">
415                      <cldata stroke="#000000" stroke_width="1" size="3" fill="#000000"/>                      <cldata stroke="#000000" stroke_width="1" size="3" fill="#000000"/>
# Line 449  class TestClassification(ClassificationT Line 459  class TestClassification(ClassificationT
459          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
460      <fileshapesource filetype="shapefile" id="D138504492"      <fileshapesource filetype="shapefile" id="D138504492"
461          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
462        <fileshapesource filetype="shapefile" id="D123456789"
463            filename="../../Data/iceland/cultural_landmark-point.shp"/>
464      <map title="Test Map">      <map title="Test Map">
465          <projection name="">          <projection name="">
466              <parameter value="zone=26"/>              <parameter value="zone=26"/>
467              <parameter value="proj=utm"/>              <parameter value="proj=utm"/>
468              <parameter value="ellps=clrk66"/>              <parameter value="ellps=clrk66"/>
469          </projection>          </projection>
470          <layer shapestore="D138389860" visible="true" stroke="#000000"          <layer shapestore="D138389860" visible="true" title="My Layer">
                 title="My Layer" stroke_width="1" fill="None">  
471              <classification field="POPYREG" field_type="string">              <classification field="POPYREG" field_type="string">
472                  <clnull label="">                  <clnull label="">
473                      <cldata stroke="#000000" stroke_width="1" fill="None"/>                      <cldata stroke="#000000" stroke_width="1" fill="None"/>
# Line 473  class TestClassification(ClassificationT Line 484  class TestClassification(ClassificationT
484                  </clpoint>                  </clpoint>
485              </classification>              </classification>
486          </layer>          </layer>
487          <layer shapestore="D138504492" visible="true" stroke="#000000"          <layer shapestore="D138504492" visible="true" title="My Layer 2">
                 title="My Layer 2" stroke_width="2" fill="None">  
488              <classification field="AREA" field_type="double">              <classification field="AREA" field_type="double">
489                  <clnull label="">                  <clnull label="">
490                      <cldata stroke="#000000" stroke_width="2" fill="None"/>                      <cldata stroke="#000000" stroke_width="2" fill="None"/>
# Line 493  class TestClassification(ClassificationT Line 503  class TestClassification(ClassificationT
503                  </clpoint>                  </clpoint>
504              </classification>              </classification>
505          </layer>          </layer>
506            <layer shapestore="D123456789" visible="true" title="My Layer 3">
507                <classification field="CLPTLABEL" field_type="string">
508                    <clnull label="">
509                        <cldata stroke="#000000" size="5" stroke_width="2" fill="None"/>
510                    </clnull>
511                    <clpoint label="" value="FARM">
512                        <cldata stroke="#111111" size="5" stroke_width="1" fill="None"/>
513                    </clpoint>
514                    <clpattern label="" pattern="BUI">
515                        <cldata stroke="#000000" size="5" stroke_width="1" fill="None"/>
516                    </clpattern>
517                </classification>
518            </layer>
519      </map>      </map>
520  </session>  </session>
521  '''  '''
# Line 524  class TestClassification(ClassificationT Line 547  class TestClassification(ClassificationT
547                            ("range", (-1, 0), "",                            ("range", (-1, 0), "",
548                              ("#000000", 1, "None")),                              ("#000000", 1, "None")),
549                            ("single", -.5, "",                            ("single", -.5, "",
550                              ("#000000", 1, "None"))])]                              ("#000000", 1, "None"))]),
551                         ("My Layer 3", 2,
552                             [("default", (), "",
553                                ("#000000", 2, "None")),
554                              ("single", "FARM", "",
555                                ("#111111", 1, "None")),
556                              ("pattern", "BUI", "",
557                                ("#000000", 1, "None"))]),
558                        ]
559    
560          self.TestLayers(map.Layers(), expected)          self.TestLayers(map.Layers(), expected)
561    
# Line 546  class TestLabels(ClassificationTest): Line 577  class TestLabels(ClassificationTest):
577              <parameter value="proj=utm"/>              <parameter value="proj=utm"/>
578              <parameter value="ellps=clrk66"/>              <parameter value="ellps=clrk66"/>
579          </projection>          </projection>
580          <layer shapestore="D1" visible="true" stroke="#000000"          <layer shapestore="D1" visible="true" title="My Layer">
                 title="My Layer" stroke_width="1" fill="None">  
581              <classification field="POPYREG" field_type="string">              <classification field="POPYREG" field_type="string">
582                  <clnull label="hallo">                  <clnull label="hallo">
583                      <cldata stroke="#000000" stroke_width="1" fill="None"/>                      <cldata stroke="#000000" stroke_width="1" fill="None"/>
# Line 596  class TestLayerProjection(LoadSessionTes Line 626  class TestLayerProjection(LoadSessionTes
626              <parameter value="proj=utm"/>              <parameter value="proj=utm"/>
627              <parameter value="ellps=clrk66"/>              <parameter value="ellps=clrk66"/>
628          </projection>          </projection>
629          <layer shapestore="D4" visible="true" stroke="#000000"          <layer shapestore="D4" visible="true" title="My Layer">
                 title="My Layer" stroke_width="1" fill="None">  
630              <projection name="hello">              <projection name="hello">
631                  <parameter value="zone=13"/>                  <parameter value="zone=13"/>
632                  <parameter value="proj=tmerc"/>                  <parameter value="proj=tmerc"/>
# Line 612  class TestLayerProjection(LoadSessionTes Line 641  class TestLayerProjection(LoadSessionTes
641                  </clpoint>                  </clpoint>
642              </classification>              </classification>
643          </layer>          </layer>
644          <layer shapestore="D2" visible="true" stroke="#000000"          <layer shapestore="D2" visible="true" title="My Layer">
                 title="My Layer" stroke_width="1" fill="None">  
645              <projection name="Unknown">              <projection name="Unknown">
646                  <parameter value="proj=lcc"/>                  <parameter value="proj=lcc"/>
647                  <parameter value="lat_1=10"/>                  <parameter value="lat_1=10"/>
648                  <parameter value="lat_2=20"/>                  <parameter value="lat_2=20"/>
649                  <parameter value="ellps=clrk66"/>                  <parameter value="ellps=clrk66"/>
650              </projection>              </projection>
651                <classification>
652                    <clnull label="">
653                        <cldata stroke="#000000" stroke_width="1" fill="None"/>
654                    </clnull>
655                </classification>
656          </layer>          </layer>
657      </map>      </map>
658  </session>  </session>
# Line 711  class TestJoinedTable(LoadSessionTest): Line 744  class TestJoinedTable(LoadSessionTest):
744      <derivedshapesource table="D136169900" shapesource="D137227612"      <derivedshapesource table="D136169900" shapesource="D137227612"
745          id="D136170932"/>          id="D136170932"/>
746      <map title="Test Map">      <map title="Test Map">
747          <layer shapestore="D136170932" visible="true" stroke="#000000"          <layer shapestore="D136170932" visible="true" title="My Layer">
748                  title="My Layer" stroke_width="1" fill="None"/>              <classification>
749                    <clnull label="">
750                        <cldata stroke="#000000" stroke_width="1" fill="None"/>
751                    </clnull>
752                </classification>
753            </layer>
754      </map>      </map>
755  </session>  </session>
756  '''  '''
# Line 761  class TestLabelLayer(LoadSessionTest): Line 799  class TestLabelLayer(LoadSessionTest):
799              <parameter value="proj=utm"/>              <parameter value="proj=utm"/>
800              <parameter value="ellps=clrk66"/>              <parameter value="ellps=clrk66"/>
801          </projection>          </projection>
802          <layer shapestore="D145265052" visible="true" stroke="#000000"          <layer shapestore="D145265052" visible="true" title="political">
                 title="political" stroke_width="1" fill="#c0c0c0">  
803              <projection name="Geographic">              <projection name="Geographic">
804                  <parameter value="proj=latlong"/>                  <parameter value="proj=latlong"/>
805                  <parameter value="to_meter=0.017453"/>                  <parameter value="to_meter=0.017453"/>
806                  <parameter value="ellps=clrk66"/>                  <parameter value="ellps=clrk66"/>
807              </projection>              </projection>
808                <classification>
809                    <clnull label="">
810                        <cldata stroke="#000000" stroke_width="1" fill="#c0c0c0"/>
811                    </clnull>
812                </classification>
813          </layer>          </layer>
814          <layer shapestore="D145412868" visible="true" stroke="#000000"          <layer shapestore="D145412868" visible="true" title="landmarks">
                 title="landmarks" stroke_width="1" fill="#ffff00">  
815              <projection name="Geographic">              <projection name="Geographic">
816                  <parameter value="proj=latlong"/>                  <parameter value="proj=latlong"/>
817                  <parameter value="to_meter=0.017453"/>                  <parameter value="to_meter=0.017453"/>
818                  <parameter value="ellps=clrk66"/>                  <parameter value="ellps=clrk66"/>
819              </projection>              </projection>
820                <classification>
821                    <clnull label="">
822                        <cldata size="5" stroke="#000000" stroke_width="1" fill="#ffff00"/>
823                    </clnull>
824                </classification>
825          </layer>          </layer>
826          <labellayer>          <labellayer>
827              <label x="-21.5" y="64.25" text="RUINS"              <label x="-21.5" y="64.25" text="RUINS"

Legend:
Removed from v.2642  
changed lines
  Added in v.2688

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26