Re: [OSM-dev] Spatial vs. multi-column indexes for points

2008-09-14 Thread Florian Lohoff
On Fri, Sep 12, 2008 at 04:50:00PM +0200, Andreas Kalsch wrote:
 Subject: Re: [OSM-dev] Spatial vs. multi-column indexes for points

 Thanks!
 
 And this really outperforms a simple query like ... latitude between
 y1 and y2 and longitude between x1 and x2 ?

This would either need a combined multi-column index or be expensive
because 2 seperated indexes and a merge of the results which the
database will probably do as a full_seq_scan.

 I will use 2^24 tiles as length. It looks like tiles_for_area goes
 through all tiles which are in the bounding box. So if I have an area
 with e.g. 5x5 kilometers, it will loop through 2000x2000 = 4 Million
 tiles. And so the SQL for this are will be quite big, won't it?

IIRC it uses the top most 16 bit of lat and lon and shifts them together
in an int32. As lat lon bits get shifted in round-robin you have most
likely a very good distribution and a very efficient index on lat and
lon.

For the query bbox=8.3426546875,51.88222734375,8.4305453125,51.92617265625

it results in this:

tile BETWEEN 3496212715 AND 3496212719 OR tile BETWEEN 3496212728 AND
3496212735 OR tile BETWEEN 3496212904 AND 3496212911 OR tile BETWEEN
3496212920 AND 3496212927 OR tile BETWEEN 3496212968 AND 3496212971 OR
tile BETWEEN 3496213059 AND 3496213063 OR tile BETWEEN 3496213067 AND
3496213087 OR tile BETWEEN 3496213091 AND 3496213095 OR tile BETWEEN
3496213099 AND 3496213119 OR tile BETWEEN 3496213187 AND 3496213191 OR
tile BETWEEN 3496213195 AND 3496213215 OR tile BETWEEN 3496213219 AND
3496213223 OR tile BETWEEN 3496213232 AND 3496213241 OR tile BETWEEN
3496213248 AND 3496213315 OR tile BETWEEN 3496213320 AND 3496213323 OR
tile BETWEEN 3496213344 AND 3496213347 OR tile BETWEEN 3496213352 AND
3496213355 OR tile BETWEEN 3496213376 AND 3496213417 OR tile BETWEEN
3496213424 AND 3496213433 OR tile BETWEEN 3496213440 AND 3496213443 OR
tile BETWEEN 3496213448 AND 3496213451 OR tile BETWEEN 3496213472 AND
3496213475 OR tile IN (3496212713,3496213057,3496213065,3496213089,
3496213097,3496213185,3496213193,3496213217,3496213225,3496213228,
3496213229,3496213244,3496213245,3496213420,3496213421,3496213436,
3496213437,3496213480,3496213481)

Anyway - postgres/postgis is faster than mysql and i prefer postgres
anyway so i'd not have to deal with this.

Flo
-- 
Florian Lohoff  [EMAIL PROTECTED] +49-171-2280134
Those who would give up a little freedom to get a little 
  security shall soon have neither - Benjamin Franklin


signature.asc
Description: Digital signature
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [josm-dev] JOSM command line parameter --language=

2008-09-14 Thread Ulf Lamping
Jan Peter Stotz schrieb:
 Hi,
 
 usually I use JOSM with the german language plugin but sometimes I need to
 know the non-translated menu item names and other strings. Therefore I
 tried to start josm with the command line option --language=en
 (documented in the command line help in mainApplication.java). But it does
 nothing and when I look into the source I am unable to find a point where
 this command line option is processed. From my point of view it looks like
 the command line help is outdated.
 
 Is there any other way to temporary disable a [language] plugin?
 

Maybe simply disable the lang-xy plugin in the Edit/Preferences/Plugins 
menu and then reenabling it later again?

Regards, ULFL

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] JOSM command line parameter --language=

2008-09-14 Thread Jan Peter Stotz
Ulf Lamping schrieb:
Ulf Lamping wrote:

 Maybe simply disable the lang-xy plugin in the Edit/Preferences/Plugins 
 menu and then reenabling it later again?

The truth: I am too lazy for that solution. I often develop and work with
JOSM nearly at the same time and enabling/disabling plugins by hand isn't
the solution I had in mind. 

But I found a relative simple way (using the attached patch):

I changed the implementation of Preferences.getPreferencesDirFile(). My
implementation now first checks if the system property josm.home has been
set. If it has been set it is used as the preferences directory. Otherwise
the preferences directory is determined as before. 
This modification allows me to define different JOSM preferences and plugin
sets that can be switched when starting JOSM. For example the following
startup command uses the directory josm_home in the current directory
instead of the one within my windows profile APPDATA folder.

java -Djosm.home=.\josm_home -jar josm-custom.jar

Jan___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] wmsplugin improvements

2008-09-14 Thread Petr DlouhĂ˝
On Fri, 12 Sep 2008 16:10:08 +0200, Henrik Niehaus [EMAIL PROTECTED]
wrote:

The changes are finally commited.

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 That's no problem for me. It's only a small patch; nothing to speak of.





-- 
Petr DlouhĂ˝

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev