Thread: [Pymag-devel] Bounding box
Status: Alpha
Brought to you by:
lhj
From: henrik j. <hen...@gm...> - 2009-05-30 07:24:14
|
Hi, I have now added bounding box support for the database reader. Think it's high time to make another release. It would be nice if you could test the latest trunk to see if it still works for you. /Henrik |
From: Josh <jo...@fe...> - 2009-06-02 02:22:33
|
Quoting henrik johansson <hen...@gm...>: > Hi, > > I have now added bounding box support for the database reader. > > Think it's high time to make another release. It would be nice if you > could test the latest trunk to see if it still works for you. > > /Henrik Hi Henrik, I've done a few tests with the current svn version today, and it looks good. I haven't tried the maps on a GPSr yet but at least they don't crash mapsend ;) Most polygons are rendering now. I haven't tested the bounding box or pgsql yet. On another note, I've been getting an error for a while on one particular map I've been building: magellan/DBUtil.py:190: DeprecationWarning: 'H' format requires 0 <= number <= 65535 return apply(struct.pack, (structendian+types,) + data) magellan/Layer.py:646: DeprecationWarning: 'H' format requires 0 <= number <= 65535 return struct.pack(prefix+types, *data) I *think* this is because there are more than 64k residential/unclassified roads in the osm extract going in to a single layer. Is this a limitation of the magellan map format, or in pymag? In an attempt to overcome this in the past I've split the roads into multiple layers, and that builds successfuly. The map can be opened in Mapsend and Vantagepoint, but locks up GPSRs (tested on half a dozen explorists) as soon as you select the detail map. I don't know if this is related or a different problem. Any hints on diagnosing the problem other than trial-and-error exclusion of objects? Cheers, Josh |
From: henrik j. <hen...@gm...> - 2009-06-02 19:15:00
|
Hi Josh, Thanks for testing. I think I know what the problem is. There's a limit of 64k cell elements in a cell. So it's clearly a pymagellan fault since it could just increase the number of cell levels if it reaches this limit. The threshold is set to max 2000 elements per cell but I think this might not be respected for some reason. I added some more asserts that should catch this problem. /Henrik 2009/6/2 Josh <jo...@fe...>: - Show quoted text - 2009/6/2 Josh <jo...@fe...>: > Quoting henrik johansson <hen...@gm...>: > >> Hi, >> >> I have now added bounding box support for the database reader. >> >> Think it's high time to make another release. It would be nice if you >> could test the latest trunk to see if it still works for you. >> >> /Henrik > > Hi Henrik, > > I've done a few tests with the current svn version today, and it looks good. > I haven't tried the maps on a GPSr yet but at least they don't crash > mapsend ;) > Most polygons are rendering now. I haven't tested the bounding box or > pgsql yet. > > > On another note, I've been getting an error for a while on one > particular map I've been building: > > magellan/DBUtil.py:190: DeprecationWarning: 'H' format requires 0 <= > number <= 65535 > return apply(struct.pack, (structendian+types,) + data) > magellan/Layer.py:646: DeprecationWarning: 'H' format requires 0 <= > number <= 65535 > return struct.pack(prefix+types, *data) > > I *think* this is because there are more than 64k > residential/unclassified roads in the osm extract going in to a > single layer. > Is this a limitation of the magellan map format, or in pymag? > In an attempt to overcome this in the past I've split the roads into > multiple layers, and that builds successfuly. > The map can be opened in Mapsend and Vantagepoint, but locks up GPSRs > (tested on half a dozen explorists) as soon as you select the detail > map. > I don't know if this is related or a different problem. > Any hints on diagnosing the problem other than trial-and-error > exclusion of objects? > > Cheers, > Josh > > > > > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Pymag-devel mailing list > Pym...@li... > https://lists.sourceforge.net/lists/listinfo/pymag-devel > |
From: Josh <jo...@fe...> - 2009-06-02 22:43:53
|
Hi Henrik, It looks like your guess was right - here's the output from svn trunk 28 on the same map build as yesterday: Traceback (most recent call last): File "/usr/bin/osmmag.py", line 244, in <module> main() File "/usr/bin/osmmag.py", line 240, in main fromdb=options.fromdb File "/usr/bin/osmmag.py", line 84, in osmmag data.load() File "osmmagellan/osm.py", line 199, in load parser.parse(self.filename) File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.5/xml/sax/expatreader.py", line 304, in end_element self._cont_handler.endElement(name) File "osmmagellan/osm.py", line 247, in endElement self.add_element(statement, self.tags, coords) File "osmmagellan/osm.py", line 105, in add_element cellelementrefs = layer.addCellElement(cellelement) File "magellan/Layer.py", line 745, in addCellElement assert nincell < 2**16 AssertionError Cheers, Josh Quoting henrik johansson <hen...@gm...>: > Hi Josh, > > Thanks for testing. > > I think I know what the problem is. There's a limit of 64k cell > elements in a cell. So it's clearly a pymagellan fault since it could > just increase the number of cell levels if it reaches this limit. The > threshold is set to max 2000 elements per cell but I think this might > not be respected for some reason. > > I added some more asserts that should catch this problem. > > /Henrik |
From: henrik j. <hen...@gm...> - 2009-06-03 19:59:32
|
Hi Josh, I found that this assertion was not correct. I added a new option that gives more verbose output. Can you please try again with the --debug option? Regards, 2009/6/3 Josh <jo...@fe...>: > Hi Henrik, > > It looks like your guess was right - here's the output from svn trunk > 28 on the same map build as yesterday: > > Traceback (most recent call last): > File "/usr/bin/osmmag.py", line 244, in <module> > main() > File "/usr/bin/osmmag.py", line 240, in main > fromdb=options.fromdb > File "/usr/bin/osmmag.py", line 84, in osmmag > data.load() > File "osmmagellan/osm.py", line 199, in load > parser.parse(self.filename) > File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse > xmlreader.IncrementalParser.parse(self, source) > File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse > self.feed(buffer) > File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed > self._parser.Parse(data, isFinal) > File "/usr/lib/python2.5/xml/sax/expatreader.py", line 304, in end_element > self._cont_handler.endElement(name) > File "osmmagellan/osm.py", line 247, in endElement > self.add_element(statement, self.tags, coords) > File "osmmagellan/osm.py", line 105, in add_element > cellelementrefs = layer.addCellElement(cellelement) > File "magellan/Layer.py", line 745, in addCellElement > assert nincell < 2**16 > AssertionError > > > Cheers, > Josh > > > > Quoting henrik johansson <hen...@gm...>: > >> Hi Josh, >> >> Thanks for testing. >> >> I think I know what the problem is. There's a limit of 64k cell >> elements in a cell. So it's clearly a pymagellan fault since it could >> just increase the number of cell levels if it reaches this limit. The >> threshold is set to max 2000 elements per cell but I think this might >> not be respected for some reason. >> >> I added some more asserts that should catch this problem. >> >> /Henrik > > > > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Pymag-devel mailing list > Pym...@li... > https://lists.sourceforge.net/lists/listinfo/pymag-devel > |
From: Josh <jo...@fe...> - 2009-06-03 22:06:04
|
Hi Henrik, Here's today's output. INFO Optimizing cell structure of normal layers DEBUG Optimizing layer 00_Freeways DEBUG nlevels=0 for layer 00_Freeways DEBUG Optimizing layer 00_Major_Highways DEBUG nlevels=1 for layer 00_Major_Highways DEBUG Optimizing layer 00_Minor_Highways DEBUG Max cell elements exceeded for layer 00_Minor_Highways. cellnum=1, # of cell elements=3103 DEBUG nlevels=1 for layer 00_Minor_Highways DEBUG Optimizing layer 00_Major_Roads DEBUG Max cell elements exceeded for layer 00_Major_Roads. cellnum=1, # of cell elements=5700 DEBUG nlevels=1 for layer 00_Major_Roads DEBUG Optimizing layer 00_Streets DEBUG Max cell elements exceeded for layer 00_Streets. cellnum=1, # of cell elements=81942 DEBUG nlevels=1 for layer 00_Streets Traceback (most recent call last): File "/usr/bin/osmmag.py", line 260, in <module> main() File "/usr/bin/osmmag.py", line 256, in main db=options.db File "/usr/bin/osmmag.py", line 97, in osmmag m.close() File "pymagellan/trunk/magellan/Map.py", line 365, in close group.optimizeLayers() File "pymagellan/trunk/magellan/SearchGroup.py", line 116, in optimizeLayers cellrefremap[self.map.getLayerIndex(layer)] = layer.optimize() File "pymagellan/trunk/magellan/Layer.py", line 473, in optimize newcellrefs = self.addCellElement(ce) File "pymagellan/trunk/magellan/Layer.py", line 745, in addCellElement assert self.nlevels == 0 or nincell < 2**16 AssertionError Cheers, Josh Quoting henrik johansson <hen...@gm...>: > Hi Josh, > > I found that this assertion was not correct. I added a new option that > gives more verbose output. > > Can you please try again with the --debug option? > > Regards, > > 2009/6/3 Josh <jo...@fe...>: >> Hi Henrik, >> >> It looks like your guess was right - here's the output from svn trunk >> 28 on the same map build as yesterday: >> >> Traceback (most recent call last): >> File "/usr/bin/osmmag.py", line 244, in <module> >> main() >> File "/usr/bin/osmmag.py", line 240, in main >> fromdb=options.fromdb >> File "/usr/bin/osmmag.py", line 84, in osmmag >> data.load() >> File "osmmagellan/osm.py", line 199, in load >> parser.parse(self.filename) >> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse >> xmlreader.IncrementalParser.parse(self, source) >> File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse >> self.feed(buffer) >> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed >> self._parser.Parse(data, isFinal) >> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 304, in end_element >> self._cont_handler.endElement(name) >> File "osmmagellan/osm.py", line 247, in endElement >> self.add_element(statement, self.tags, coords) >> File "osmmagellan/osm.py", line 105, in add_element >> cellelementrefs = layer.addCellElement(cellelement) >> File "magellan/Layer.py", line 745, in addCellElement >> assert nincell < 2**16 >> AssertionError >> >> >> Cheers, >> Josh >> >> >> >> Quoting henrik johansson <hen...@gm...>: >> >>> Hi Josh, >>> >>> Thanks for testing. >>> >>> I think I know what the problem is. There's a limit of 64k cell >>> elements in a cell. So it's clearly a pymagellan fault since it could >>> just increase the number of cell levels if it reaches this limit. The >>> threshold is set to max 2000 elements per cell but I think this might >>> not be respected for some reason. >>> >>> I added some more asserts that should catch this problem. >>> >>> /Henrik >> >> >> >> >> >> ------------------------------------------------------------------------------ >> OpenSolaris 2009.06 is a cutting edge operating system for enterprises >> looking to deploy the next generation of Solaris that includes the latest >> innovations from Sun and the OpenSource community. Download a copy and >> enjoy capabilities such as Networking, Storage and Virtualization. >> Go to: http://p.sf.net/sfu/opensolaris-get >> _______________________________________________ >> Pymag-devel mailing list >> Pym...@li... >> https://lists.sourceforge.net/lists/listinfo/pymag-devel >> > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Pymag-devel mailing list > Pym...@li... > https://lists.sourceforge.net/lists/listinfo/pymag-devel > |
From: henrik j. <hen...@gm...> - 2009-06-04 05:55:19
|
Thanks! I think I found the bug, try now. /Henrik 2009/6/4 Josh <jo...@fe...>: > Hi Henrik, > > Here's today's output. > > INFO Optimizing cell structure of normal layers > DEBUG Optimizing layer 00_Freeways > DEBUG nlevels=0 for layer 00_Freeways > DEBUG Optimizing layer 00_Major_Highways > DEBUG nlevels=1 for layer 00_Major_Highways > DEBUG Optimizing layer 00_Minor_Highways > DEBUG Max cell elements exceeded for layer 00_Minor_Highways. cellnum=1, # > of cell elements=3103 > DEBUG nlevels=1 for layer 00_Minor_Highways > DEBUG Optimizing layer 00_Major_Roads > DEBUG Max cell elements exceeded for layer 00_Major_Roads. cellnum=1, # of > cell elements=5700 > DEBUG nlevels=1 for layer 00_Major_Roads > DEBUG Optimizing layer 00_Streets > DEBUG Max cell elements exceeded for layer 00_Streets. cellnum=1, # of cell > elements=81942 > DEBUG nlevels=1 for layer 00_Streets > Traceback (most recent call last): > File "/usr/bin/osmmag.py", line 260, in <module> > main() > File "/usr/bin/osmmag.py", line 256, in main > db=options.db > File "/usr/bin/osmmag.py", line 97, in osmmag > m.close() > File "pymagellan/trunk/magellan/Map.py", line 365, in close > group.optimizeLayers() > File "pymagellan/trunk/magellan/SearchGroup.py", line 116, in > optimizeLayers > cellrefremap[self.map.getLayerIndex(layer)] = layer.optimize() > File "pymagellan/trunk/magellan/Layer.py", line 473, in optimize > newcellrefs = self.addCellElement(ce) > File "pymagellan/trunk/magellan/Layer.py", line 745, in addCellElement > assert self.nlevels == 0 or nincell < 2**16 > AssertionError > > > Cheers, > Josh > > > Quoting henrik johansson <hen...@gm...>: > >> Hi Josh, >> >> I found that this assertion was not correct. I added a new option that >> gives more verbose output. >> >> Can you please try again with the --debug option? >> >> Regards, >> >> 2009/6/3 Josh <jo...@fe...>: >>> >>> Hi Henrik, >>> >>> It looks like your guess was right - here's the output from svn trunk >>> 28 on the same map build as yesterday: >>> >>> Traceback (most recent call last): >>> File "/usr/bin/osmmag.py", line 244, in <module> >>> main() >>> File "/usr/bin/osmmag.py", line 240, in main >>> fromdb=options.fromdb >>> File "/usr/bin/osmmag.py", line 84, in osmmag >>> data.load() >>> File "osmmagellan/osm.py", line 199, in load >>> parser.parse(self.filename) >>> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse >>> xmlreader.IncrementalParser.parse(self, source) >>> File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse >>> self.feed(buffer) >>> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed >>> self._parser.Parse(data, isFinal) >>> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 304, in >>> end_element >>> self._cont_handler.endElement(name) >>> File "osmmagellan/osm.py", line 247, in endElement >>> self.add_element(statement, self.tags, coords) >>> File "osmmagellan/osm.py", line 105, in add_element >>> cellelementrefs = layer.addCellElement(cellelement) >>> File "magellan/Layer.py", line 745, in addCellElement >>> assert nincell < 2**16 >>> AssertionError >>> >>> >>> Cheers, >>> Josh >>> >>> >>> >>> Quoting henrik johansson <hen...@gm...>: >>> >>>> Hi Josh, >>>> >>>> Thanks for testing. >>>> >>>> I think I know what the problem is. There's a limit of 64k cell >>>> elements in a cell. So it's clearly a pymagellan fault since it could >>>> just increase the number of cell levels if it reaches this limit. The >>>> threshold is set to max 2000 elements per cell but I think this might >>>> not be respected for some reason. >>>> >>>> I added some more asserts that should catch this problem. >>>> >>>> /Henrik >>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> OpenSolaris 2009.06 is a cutting edge operating system for enterprises >>> looking to deploy the next generation of Solaris that includes the latest >>> innovations from Sun and the OpenSource community. Download a copy and >>> enjoy capabilities such as Networking, Storage and Virtualization. >>> Go to: http://p.sf.net/sfu/opensolaris-get >>> _______________________________________________ >>> Pymag-devel mailing list >>> Pym...@li... >>> https://lists.sourceforge.net/lists/listinfo/pymag-devel >>> >> >> >> ------------------------------------------------------------------------------ >> OpenSolaris 2009.06 is a cutting edge operating system for enterprises >> looking to deploy the next generation of Solaris that includes the latest >> innovations from Sun and the OpenSource community. Download a copy and >> enjoy capabilities such as Networking, Storage and Virtualization. >> Go to: http://p.sf.net/sfu/opensolaris-get >> _______________________________________________ >> Pymag-devel mailing list >> Pym...@li... >> https://lists.sourceforge.net/lists/listinfo/pymag-devel >> > > > > |
From: Josh <jo...@fe...> - 2009-06-05 13:29:34
|
That looks a bit better... The map built without error this time, but crashes mapsend so I can only guess it won't work too well on the GPSr. I'll have a muck around today and try to work out which layer is causing the problem. Here's the output from this attempt, anything look bad? I assume the nlevels=2 means that it's worked out another level is needed? INFO Create hydro polygons from coastline INFO Optimizing cell structure of normal layers DEBUG Optimizing layer 00_Freeways DEBUG nlevels=0 for layer 00_Freeways DEBUG Optimizing layer 00_Major_Highways DEBUG nlevels=2 for layer 00_Major_Highways DEBUG Optimizing layer 00_Minor_Highways DEBUG Max cell elements exceeded for layer 00_Minor_Highways. cellnum=1, # of cell elements=3103 DEBUG Max cell elements exceeded for layer 00_Minor_Highways. cellnum=1, # of cell elements=3103 DEBUG nlevels=2 for layer 00_Minor_Highways DEBUG Optimizing layer 00_Major_Roads DEBUG Max cell elements exceeded for layer 00_Major_Roads. cellnum=1, # of cell elements=5700 DEBUG Max cell elements exceeded for layer 00_Major_Roads. cellnum=1, # of cell elements=5700 DEBUG nlevels=2 for layer 00_Major_Roads DEBUG Optimizing layer 00_Streets DEBUG Max cell elements exceeded for layer 00_Streets. cellnum=1, # of cell elements=81942 DEBUG Max cell elements exceeded for layer 00_Streets. cellnum=1, # of cell elements=81942 DEBUG nlevels=2 for layer 00_Streets DEBUG Optimizing layer 00_Trails_4WD DEBUG nlevels=0 for layer 00_Trails_4WD DEBUG Optimizing layer 00_Railroads DEBUG nlevels=0 for layer 00_Railroads DEBUG Optimizing layer 00_Hydro_Polygons DEBUG nlevels=0 for layer 00_Hydro_Polygons DEBUG Optimizing layer 00_Hydro_Lines DEBUG nlevels=2 for layer 00_Hydro_Lines DEBUG Optimizing layer 00_Parks DEBUG nlevels=0 for layer 00_Parks DEBUG Optimizing layer 00_Trails DEBUG Max cell elements exceeded for layer 00_Trails. cellnum=1, # of cell elements=5417 DEBUG Max cell elements exceeded for layer 00_Trails. cellnum=1, # of cell elements=5417 DEBUG nlevels=2 for layer 00_Trails DEBUG Optimizing layer 00_Buildings DEBUG nlevels=0 for layer 00_Buildings DEBUG Optimizing layer 00_Farm DEBUG nlevels=0 for layer 00_Farm DEBUG Optimizing layer 00_Points DEBUG nlevels=0 for layer 00_Points DEBUG Optimizing layer poi DEBUG nlevels=0 for layer poi INFO Closing map Cheers, Josh Quoting henrik johansson <hen...@gm...>: > Thanks! > > I think I found the bug, try now. > > /Henrik |