# HG changeset patch # User fknauft # Date 1317228360 -7200 # Node ID cb953cc153a6c78271429887989e0152a79700e9 # Parent ec7b63319fad6b1950e34b1d02c8407bb2bbbd0c GIS-Links from MPDL-Documents now served by Mappit-Server diff -r ec7b63319fad -r cb953cc153a6 RestDbGisApi.py --- a/RestDbGisApi.py Wed Sep 28 17:43:50 2011 +0200 +++ b/RestDbGisApi.py Wed Sep 28 18:46:00 2011 +0200 @@ -583,8 +583,14 @@ coordlist=[] i=0 while (i<5 and coordlist==[]): - urlresponse=urlFunctions.zUrlopenParseString(self,urlFunctions.zUrlopenRead(self,"http://chgis.hmdc.harvard.edu/xml/id/"+gis_id)) - baseDocElement= urlFunctions.zUrlopenDocumentElement(self,urlresponse) + urlinfo=urlFunctions.zUrlopenInfo(self,"http://chgis.hmdc.harvard.edu/xml/id/"+gis_id) + urlinfoLength=urlinfo.get('content-length') + if int(urlinfoLength)<500: + urlresponse=urlFunctions.zUrlopenRead(self,"http://chgis.hmdc.harvard.edu/xml/id/cts_"+gis_id) + else: + urlresponse=urlFunctions.zUrlopenRead(self,"http://chgis.hmdc.harvard.edu/xml/id/"+gis_id) + urlresponseString=urlFunctions.zUrlopenParseString(self,urlresponse) + baseDocElement= urlFunctions.zUrlopenDocumentElement(self,urlresponseString) childnodes=urlFunctions.zUrlopenChildNodes(self,baseDocElement) itemnodes=urlFunctions.zUrlopenGetElementsByTagName(self,baseDocElement,'item') itemspatialnodes=None